[gnome-commander] Strip file extension for files in mkdir dlg (F7)
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Strip file extension for files in mkdir dlg (F7)
- Date: Mon, 13 Dec 2010 18:24:34 +0000 (UTC)
commit 2026627695d1350d4786e6135cbf216c95c45979
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Mon Dec 13 19:22:02 2010 +0100
Strip file extension for files in mkdir dlg (F7)
src/dialogs/gnome-cmd-mkdir-dialog.cc | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-mkdir-dialog.cc b/src/dialogs/gnome-cmd-mkdir-dialog.cc
index 2938384..bf3336c 100644
--- a/src/dialogs/gnome-cmd-mkdir-dialog.cc
+++ b/src/dialogs/gnome-cmd-mkdir-dialog.cc
@@ -196,7 +196,23 @@ gboolean gnome_cmd_mkdir_dialog_new (GnomeCmdDir *dir, GnomeCmdFile *selected_fi
entry = gtk_entry_new ();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
if (selected_file)
- gtk_entry_set_text (GTK_ENTRY (entry), selected_file->get_name());
+ {
+ if (GNOME_CMD_IS_DIR (selected_file))
+ gtk_entry_set_text (GTK_ENTRY (entry), selected_file->get_name());
+ else
+ {
+ gchar *fname = g_strdup (selected_file->get_name());
+
+ char *ext = g_utf8_strrchr (fname, -1, '.');
+
+ if (ext)
+ *ext = 0;
+
+ gtk_entry_set_text (GTK_ENTRY (entry), fname);
+
+ g_free (fname);
+ }
+ }
g_object_set_data (G_OBJECT (dialog), "name", entry);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
gtk_table_attach_defaults (GTK_TABLE (table), entry, 1, 2, 0, 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]