gnome-commander r2136 - in trunk: . src



Author: epiotr
Date: Tue Sep 30 16:06:57 2008
New Revision: 2136
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2136&view=rev

Log:
GnomeCmdData: more C++ rework

Modified:
   trunk/ChangeLog
   trunk/src/gnome-cmd-data.cc
   trunk/src/gnome-cmd-data.h
   trunk/src/gnome-cmd-file-list.cc
   trunk/src/gnome-cmd-main-win.cc

Modified: trunk/src/gnome-cmd-data.cc
==============================================================================
--- trunk/src/gnome-cmd-data.cc	(original)
+++ trunk/src/gnome-cmd-data.cc	Tue Sep 30 16:06:57 2008
@@ -59,7 +59,6 @@
     GdkInterpType        icon_scale_quality;
     gchar                *theme_icon_dir;
     gchar                *document_icon_dir;
-    guint                fs_col_width[GnomeCmdFileList::NUM_COLUMNS];
     guint                bookmark_dialog_col_width[BOOKMARK_DIALOG_NUM_COLUMNS];
     GtkReliefStyle       btn_relief;
     gboolean             device_only_icon;
@@ -1115,6 +1114,7 @@
     icon_size = 16;
     dev_icon_size = 16;
     list_row_height = 16;
+    memset(fs_col_width, 0, sizeof(fs_col_width));
     gui_update_rate = DEFAULT_GUI_UPDATE_RATE;
 
     cmdline_history = NULL;
@@ -1260,7 +1260,7 @@
     for (gint i=0; i<GnomeCmdFileList::NUM_COLUMNS; i++)
     {
         gchar *tmp = g_strdup_printf ("/gnome-commander-size/column-widths/fs_col_width%d", i);
-        priv->fs_col_width[i] = get_int (tmp, GnomeCmdFileList::get_column_default_width((GnomeCmdFileList::ColumnID) i));
+        fs_col_width[i] = get_int (tmp, GnomeCmdFileList::get_column_default_width((GnomeCmdFileList::ColumnID) i));
         g_free (tmp);
     }
 
@@ -1696,7 +1696,7 @@
     for (gint i=0; i<GnomeCmdFileList::NUM_COLUMNS; i++)
     {
         gchar *tmp = g_strdup_printf ("/gnome-commander-size/column-widths/fs_col_width%d", i);
-        gnome_config_set_int (tmp, priv->fs_col_width[i]);
+        gnome_config_set_int (tmp, fs_col_width[i]);
         g_free (tmp);
     }
 
@@ -1944,24 +1944,6 @@
 }
 
 
-void gnome_cmd_data_set_fs_col_width (guint column, gint width)
-{
-    if (column > GnomeCmdFileList::NUM_COLUMNS)
-        return;
-
-    gnome_cmd_data.priv->fs_col_width[column] = width;
-}
-
-
-gint gnome_cmd_data_get_fs_col_width (guint column)
-{
-    if (column > GnomeCmdFileList::NUM_COLUMNS)
-        return 0;
-
-    return gnome_cmd_data.priv->fs_col_width[column];
-}
-
-
 void gnome_cmd_data_set_bookmark_dialog_col_width (guint column, gint width)
 {
     gnome_cmd_data.priv->bookmark_dialog_col_width[column] = width;

Modified: trunk/src/gnome-cmd-data.h
==============================================================================
--- trunk/src/gnome-cmd-data.h	(original)
+++ trunk/src/gnome-cmd-data.h	Tue Sep 30 16:06:57 2008
@@ -120,6 +120,7 @@
     guint                        icon_size;
     guint                        dev_icon_size;
     gint                         list_row_height;
+    guint                        fs_col_width[GnomeCmdFileList::NUM_COLUMNS];
     guint                        gui_update_rate;
 
     GList                       *cmdline_history;
@@ -198,9 +199,6 @@
 const gchar *gnome_cmd_data_get_document_icon_dir ();
 void gnome_cmd_data_set_document_icon_dir (const gchar *dir);
 
-gint gnome_cmd_data_get_fs_col_width (guint column);
-void gnome_cmd_data_set_fs_col_width (guint column, gint width);
-
 gint gnome_cmd_data_get_bookmark_dialog_col_width (guint column);
 void gnome_cmd_data_set_bookmark_dialog_col_width (guint column, gint width);
 

Modified: trunk/src/gnome-cmd-file-list.cc
==============================================================================
--- trunk/src/gnome-cmd-file-list.cc	(original)
+++ trunk/src/gnome-cmd-file-list.cc	Tue Sep 30 16:06:57 2008
@@ -545,7 +545,7 @@
 
     for (gint i=GnomeCmdFileList::COLUMN_ICON; i<GnomeCmdFileList::NUM_COLUMNS; i++)
     {
-        gtk_clist_set_column_width (*fl, i, gnome_cmd_data_get_fs_col_width (i));
+        gtk_clist_set_column_width (*fl, i, gnome_cmd_data.fs_col_width[i]);
         gtk_clist_set_column_justification (*fl, i, file_list_column[i].justification);
     }
 

Modified: trunk/src/gnome-cmd-main-win.cc
==============================================================================
--- trunk/src/gnome-cmd-main-win.cc	(original)
+++ trunk/src/gnome-cmd-main-win.cc	Tue Sep 30 16:06:57 2008
@@ -523,7 +523,7 @@
     if (!column_resize_lock)
     {
         column_resize_lock = TRUE;
-        gnome_cmd_data_set_fs_col_width ((guint) column, width);
+        gnome_cmd_data.fs_col_width[column] = width;
         gtk_clist_set_column_width (other_clist, column, width);
         column_resize_lock = FALSE;
     }



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