[gnome-commander] GnomeCmdData: more C++ rework



commit 4afa45ffcedecebab70ca61354119845101b5740
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Thu Nov 10 22:37:41 2011 +0100

    GnomeCmdData: more C++ rework

 src/gnome-cmd-data.cc           |   14 --------------
 src/gnome-cmd-data.h            |    9 ++++++---
 src/gnome-cmd-options-dialog.cc |    4 ++--
 src/imageloader.cc              |    2 +-
 4 files changed, 9 insertions(+), 20 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 6762680..267bf62 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1732,20 +1732,6 @@ GnomeCmdColorTheme *gnome_cmd_data_get_custom_color_theme ()
 }
 
 
-const gchar *gnome_cmd_data_get_document_icon_dir ()
-{
-    return gnome_cmd_data.options.document_icon_dir;
-}
-
-
-void gnome_cmd_data_set_document_icon_dir (const gchar *dir)
-{
-    g_free (gnome_cmd_data.options.document_icon_dir);
-
-    gnome_cmd_data.options.document_icon_dir = g_strdup (dir);
-}
-
-
 void gnome_cmd_data_set_last_pattern (const gchar *value)
 {
     gnome_cmd_data.priv->last_pattern = g_strdup (value);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index f4e2767..303fb49 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -149,6 +149,12 @@ struct GnomeCmdData
             g_free (theme_icon_dir);
             theme_icon_dir = g_strdup (dir);
         }
+
+        void set_document_icon_dir (const gchar *dir)
+        {
+            g_free (document_icon_dir);
+            document_icon_dir = g_strdup (dir);
+        }
     };
 
     struct Selection
@@ -395,9 +401,6 @@ inline void GnomeCmdData::set_term(const gchar *command)
     term = g_strdup (command);
 }
 
-const gchar *gnome_cmd_data_get_document_icon_dir ();
-void gnome_cmd_data_set_document_icon_dir (const gchar *dir);
-
 const gchar *gnome_cmd_data_get_last_pattern ();
 void gnome_cmd_data_set_last_pattern (const gchar *value);
 
diff --git a/src/gnome-cmd-options-dialog.cc b/src/gnome-cmd-options-dialog.cc
index a24f565..747932b 100644
--- a/src/gnome-cmd-options-dialog.cc
+++ b/src/gnome-cmd-options-dialog.cc
@@ -759,7 +759,7 @@ inline GtkWidget *create_layout_tab (GtkWidget *parent, GnomeCmdData &cfg)
     table_add (table, scale, 1, 1, (GtkAttachOptions) GTK_FILL);
     entry = create_file_entry (parent, "theme_icondir_entry", cfg.options.theme_icon_dir);
     table_add (table, entry, 1, 2, (GtkAttachOptions)0);
-    entry = create_file_entry (parent, "doc_icondir_entry", gnome_cmd_data_get_document_icon_dir ());
+    entry = create_file_entry (parent, "doc_icondir_entry", cfg.options.document_icon_dir);
     table_add (table, entry, 1, 3, (GtkAttachOptions)0);
 
     label = create_label (parent, _("Icon size:"));
@@ -805,7 +805,7 @@ inline void store_layout_options (GtkWidget *dialog, GnomeCmdData &cfg)
     cfg.options.set_list_font (list_font);
 
     cfg.options.set_theme_icon_dir (gtk_entry_get_text (GTK_ENTRY (theme_icondir_entry)));
-    gnome_cmd_data_set_document_icon_dir (gtk_entry_get_text (GTK_ENTRY (doc_icondir_entry)));
+    cfg.options.set_document_icon_dir (gtk_entry_get_text (GTK_ENTRY (doc_icondir_entry)));
     cfg.options.icon_size = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (iconsize_spin));
 
     GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (iconquality_scale));
diff --git a/src/imageloader.cc b/src/imageloader.cc
index c35617a..480cf41 100644
--- a/src/imageloader.cc
+++ b/src/imageloader.cc
@@ -400,7 +400,7 @@ static gboolean get_mime_icon (GnomeVFSFileType type,
     if (get_mime_icon_in_dir (gnome_cmd_data.options.theme_icon_dir, type, mime_type, symlink, pixmap, mask))
         return TRUE;
 
-    return get_mime_icon_in_dir (gnome_cmd_data_get_document_icon_dir(), type, mime_type, symlink, pixmap, mask);
+    return get_mime_icon_in_dir (gnome_cmd_data.options.document_icon_dir, type, mime_type, symlink, pixmap, mask);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]