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



commit c7739856fac6a49099563c318abfa9a251de12ee
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Wed Nov 9 19:41:16 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 631afe9..6b6c532 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1738,20 +1738,6 @@ GnomeCmdLsColorsPalette *gnome_cmd_data_get_ls_colors_palette ()
 }
 
 
-const gchar *gnome_cmd_data_get_theme_icon_dir ()
-{
-    return gnome_cmd_data.options.theme_icon_dir;
-}
-
-
-void gnome_cmd_data_set_theme_icon_dir (const gchar *dir)
-{
-    g_free (gnome_cmd_data.options.theme_icon_dir);
-
-    gnome_cmd_data.options.theme_icon_dir = g_strdup (dir);
-}
-
-
 const gchar *gnome_cmd_data_get_document_icon_dir ()
 {
     return gnome_cmd_data.options.document_icon_dir;
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 095b120..98969fd 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -144,6 +144,12 @@ struct GnomeCmdData
             g_free (list_font);
             list_font = g_strdup (font);
         }
+
+        void set_theme_icon_dir (const gchar *dir)
+        {
+            g_free (theme_icon_dir);
+            theme_icon_dir = g_strdup (dir);
+        }
     };
 
     struct Selection
@@ -392,9 +398,6 @@ inline void GnomeCmdData::set_term(const gchar *command)
     term = g_strdup (command);
 }
 
-const gchar *gnome_cmd_data_get_theme_icon_dir ();
-void gnome_cmd_data_set_theme_icon_dir (const gchar *dir);
-
 const gchar *gnome_cmd_data_get_document_icon_dir ();
 void gnome_cmd_data_set_document_icon_dir (const gchar *dir);
 
diff --git a/src/gnome-cmd-options-dialog.cc b/src/gnome-cmd-options-dialog.cc
index a9f2589..05ddfd8 100644
--- a/src/gnome-cmd-options-dialog.cc
+++ b/src/gnome-cmd-options-dialog.cc
@@ -757,7 +757,7 @@ inline GtkWidget *create_layout_tab (GtkWidget *parent, GnomeCmdData &cfg)
     table_add (table, spin, 1, 0, (GtkAttachOptions) GTK_FILL);
     scale = create_scale (parent, "iconquality_scale", cfg.options.icon_scale_quality, 0, 3);
     table_add (table, scale, 1, 1, (GtkAttachOptions) GTK_FILL);
-    entry = create_file_entry (parent, "theme_icondir_entry", gnome_cmd_data_get_theme_icon_dir ());
+    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 ());
     table_add (table, entry, 1, 3, (GtkAttachOptions)0);
@@ -804,7 +804,7 @@ inline void store_layout_options (GtkWidget *dialog, GnomeCmdData &cfg)
     const gchar *list_font = gtk_font_button_get_font_name (GTK_FONT_BUTTON (list_font_picker));
     cfg.options.set_list_font (list_font);
 
-    gnome_cmd_data_set_theme_icon_dir (gtk_entry_get_text (GTK_ENTRY (theme_icondir_entry)));
+    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.icon_size = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (iconsize_spin));
 
diff --git a/src/imageloader.cc b/src/imageloader.cc
index 34746be..c35617a 100644
--- a/src/imageloader.cc
+++ b/src/imageloader.cc
@@ -397,7 +397,7 @@ static gboolean get_mime_icon (GnomeVFSFileType type,
                                GdkPixmap **pixmap,
                                GdkBitmap **mask)
 {
-    if (get_mime_icon_in_dir (gnome_cmd_data_get_theme_icon_dir(), type, mime_type, symlink, pixmap, mask))
+    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);



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