gnome-commander r2100 - in trunk: . src



Author: epiotr
Date: Tue Sep 23 18:46:50 2008
New Revision: 2100
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2100&view=rev

Log:
GnomeCmdData: more C++ rework

Modified:
   trunk/ChangeLog
   trunk/src/gnome-cmd-con-dialog.cc
   trunk/src/gnome-cmd-data.cc
   trunk/src/gnome-cmd-data.h
   trunk/src/gnome-cmd-file-list.cc
   trunk/src/gnome-cmd-file-selector.cc
   trunk/src/gnome-cmd-main-menu.cc
   trunk/src/gnome-cmd-main-win.cc
   trunk/src/gnome-cmd-options-dialog.cc
   trunk/src/gnome-cmd-quicksearch-popup.cc
   trunk/src/gnome-cmd-remote-dialog.cc
   trunk/src/main.cc
   trunk/src/utils.cc

Modified: trunk/src/gnome-cmd-con-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-con-dialog.cc	(original)
+++ trunk/src/gnome-cmd-con-dialog.cc	Tue Sep 23 18:46:50 2008
@@ -550,7 +550,7 @@
 
     gtk_combo_box_set_active (GTK_COMBO_BOX (conndlg->priv->type_combo), CON_SSH);
 
-    conndlg->priv->use_auth = gnome_cmd_data_get_use_gnome_auth_manager ();
+    conndlg->priv->use_auth = gnome_cmd_data.use_gnome_auth_manager;
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (conndlg->priv->auth_check), conndlg->priv->use_auth);
 
     gint response = gtk_dialog_run (GTK_DIALOG (dialog));

Modified: trunk/src/gnome-cmd-data.cc
==============================================================================
--- trunk/src/gnome-cmd-data.cc	(original)
+++ trunk/src/gnome-cmd-data.cc	Tue Sep 23 18:46:50 2008
@@ -54,9 +54,6 @@
     GnomeCmdDateFormat   date_format;
     GnomeCmdLayout       layout;
     GnomeCmdColorTheme   color_themes[GNOME_CMD_NUM_COLOR_MODES];
-    GnomeCmdExtDispMode  ext_disp_mode;
-    gboolean             case_sens_sort;
-    gint                 list_row_height;
     gchar                *list_font;
     guint                icon_size;
     guint                dev_icon_size;
@@ -76,7 +73,6 @@
     gboolean             skip_mounting;
     SearchDefaults       *search_defaults;
     AdvrenameDefaults    *advrename_defaults;
-    gboolean             list_orientation;
     gchar                *start_dirs[2];
     gchar                *last_pattern;
     GList                *auto_load_plugins;
@@ -87,17 +83,12 @@
     GList                *backup_pattern_list;
     gchar                *symlink_prefix;
 
-    GnomeCmdConFtp       *quick_connect;
-
-    gboolean             use_gnome_auth_manager;
     gchar                *ftp_anonymous_password;
 
     gchar *viewer;
     gchar *editor;
     gchar *differ;
     gchar *term;
-
-    gboolean             use_gcmd_block;                    // defaults to FALSE
 };
 
 
@@ -1100,6 +1091,8 @@
 
 GnomeCmdData::GnomeCmdData()
 {
+    quick_connect = NULL;
+
     confirm_delete = TRUE;
     confirm_copy_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_QUERY;
     confirm_move_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_QUERY;
@@ -1112,14 +1105,23 @@
     filter_settings.hidden = TRUE;
     filter_settings.backup = TRUE;
 
+    case_sens_sort = TRUE;
+    ext_disp_mode = GNOME_CMD_EXT_DISP_BOTH;
+    list_orientation = FALSE;
+
     toolbar_visibility = TRUE;
     conbuttons_visibility = TRUE;
     concombo_visibility = TRUE;
     cmdline_visibility = TRUE;
     buttonbar_visibility = TRUE;
 
+    list_row_height = 16;
     gui_update_rate = DEFAULT_GUI_UPDATE_RATE;
 
+    use_gcmd_block = FALSE;
+
+    use_gnome_auth_manager = FALSE;
+
     main_win_width = 600;
     main_win_height = 400;
 
@@ -1135,10 +1137,10 @@
         // gtk_object_unref (GTK_OBJECT (priv->con_list));
 
         // close quick connect
-        if (priv->quick_connect)
+        if (quick_connect)
         {
-            gnome_cmd_con_close (GNOME_CMD_CON (priv->quick_connect));
-            // gtk_object_destroy (GTK_OBJECT (priv->quick_connect));
+            gnome_cmd_con_close (GNOME_CMD_CON (quick_connect));
+            // gtk_object_destroy (GTK_OBJECT (quick_connect));
         }
 
         // free the anonymous password string
@@ -1229,7 +1231,7 @@
 
     priv->layout = (GnomeCmdLayout) gnome_cmd_data_get_int ("/options/layout", GNOME_CMD_LAYOUT_MIME_ICONS);
 
-    priv->list_row_height = gnome_cmd_data_get_int ("/options/list_row_height", 16);
+    list_row_height = gnome_cmd_data_get_int ("/options/list_row_height", 16);
 
     confirm_delete = gnome_cmd_data_get_bool ("/confirm/delete", TRUE);
     confirm_copy_overwrite = (GnomeCmdConfirmOverwriteMode) gnome_cmd_data_get_int ("/confirm/copy_overwrite", GNOME_CMD_CONFIRM_OVERWRITE_QUERY);
@@ -1246,7 +1248,7 @@
     filter_settings.hidden = gnome_cmd_data_get_bool ("/options/hidden_filter", TRUE);
     filter_settings.backup = gnome_cmd_data_get_bool ("/options/backup_filter", TRUE);
 
-    priv->case_sens_sort = gnome_cmd_data_get_bool ("/sort/case_sensitive", TRUE);
+    case_sens_sort = gnome_cmd_data_get_bool ("/sort/case_sensitive", TRUE);
 
     main_win_width = get_int ("/gnome-commander-size/main_win/width", 600);
     main_win_height = get_int ("/gnome-commander-size/main_win/height", 400);
@@ -1276,7 +1278,7 @@
 
     priv->list_font = gnome_cmd_data_get_string ("/options/list_font", "-misc-fixed-medium-r-normal-*-10-*-*-*-c-*-iso8859-1");
 
-    priv->ext_disp_mode = (GnomeCmdExtDispMode) gnome_cmd_data_get_int ("/options/ext_disp_mode", GNOME_CMD_EXT_DISP_BOTH);
+    ext_disp_mode = (GnomeCmdExtDispMode) gnome_cmd_data_get_int ("/options/ext_disp_mode", GNOME_CMD_EXT_DISP_BOTH);
     right_mouse_button_mode = (GnomeCmdData::RightMouseButtonMode) gnome_cmd_data_get_int ("/options/right_mouse_button_mode", GnomeCmdData::RIGHT_BUTTON_POPUPS_MENU);
     priv->icon_size = gnome_cmd_data_get_int ("/options/icon_size", 16);
     priv->dev_icon_size = gnome_cmd_data_get_int ("/options/dev_icon_size", 16);
@@ -1288,7 +1290,7 @@
     priv->cmdline_history_length = gnome_cmd_data_get_int ("/options/cmdline_history_length", 16);
     priv->btn_relief = (GtkReliefStyle) gnome_cmd_data_get_int ("/options/btn_relief", GTK_RELIEF_NONE);
     filter_type = (Filter::Type) gnome_cmd_data_get_int ("/options/filter_type", Filter::TYPE_FNMATCH);
-    priv->list_orientation = gnome_cmd_data_get_bool ("/options/list_orientation", FALSE);
+    list_orientation = gnome_cmd_data_get_bool ("/options/list_orientation", FALSE);
     gui_update_rate = gnome_cmd_data_get_int ("/options/gui_update_rate", DEFAULT_GUI_UPDATE_RATE);
     priv->main_win_pos[0] = gnome_cmd_data_get_int ("/options/main_win_pos_x", -1);
     priv->main_win_pos[1] = gnome_cmd_data_get_int ("/options/main_win_pos_y", -1);
@@ -1326,7 +1328,7 @@
     priv->differ = gnome_cmd_data_get_string ("/programs/differ", "meld %s");
     priv->term   = gnome_cmd_data_get_string ("/programs/terminal", "xterm -hold -e %s");
 
-    priv->use_gcmd_block = gnome_cmd_data_get_bool ("/programs/use_gcmd_block", FALSE);
+    use_gcmd_block = gnome_cmd_data_get_bool ("/programs/use_gcmd_block", FALSE);
 
     priv->device_only_icon = gnome_cmd_data_get_bool ("/devices/only_icon", FALSE);
     priv->dir_cache_size = gnome_cmd_data_get_int ("/options/dir_cache_size", 10);
@@ -1341,7 +1343,7 @@
 
     main_win_state = (GdkWindowState) gnome_cmd_data_get_int ("/options/main_win_state", (gint) GDK_WINDOW_STATE_MAXIMIZED);
 
-    priv->use_gnome_auth_manager = gnome_cmd_data_get_bool ("/network/use_gnome_auth_manager", FALSE);
+    use_gnome_auth_manager = gnome_cmd_data_get_bool ("/network/use_gnome_auth_manager", FALSE);
     priv->ftp_anonymous_password = gnome_cmd_data_get_string ("/network/ftp_anonymous_password", "you provider com");
 
     if (strcmp (priv->ftp_anonymous_password, "you provider com")==0)   // if '/network/ftp_anonymous_password' entry undefined, try to read '/ftp/anonymous_password'
@@ -1353,7 +1355,7 @@
     // "/quick-connect/uri" must be read AFTER retrieving anonymous password
 
     gchar * quick_connect_uri = gnome_cmd_data_get_string ("/quick-connect/uri", "ftp://anonymous ftp gnome org/pub/GNOME/");
-    priv->quick_connect = gnome_cmd_con_ftp_new (NULL, quick_connect_uri);
+    quick_connect = gnome_cmd_con_ftp_new (NULL, quick_connect_uri);
     g_free (quick_connect_uri);
 
     load_cmdline_history ();
@@ -1593,7 +1595,7 @@
     gnome_cmd_data_set_int    ("/options/perm_disp_mode", priv->perm_disp_mode);
     gnome_cmd_data_set_string ("/options/date_disp_mode", priv->date_format);
     gnome_cmd_data_set_int    ("/options/layout", priv->layout);
-    gnome_cmd_data_set_int    ("/options/list_row_height", priv->list_row_height);
+    gnome_cmd_data_set_int    ("/options/list_row_height", list_row_height);
 
     gnome_cmd_data_set_bool   ("/confirm/delete", confirm_delete);
     gnome_cmd_data_set_int    ("/confirm/copy_overwrite", confirm_copy_overwrite);
@@ -1611,7 +1613,7 @@
     gnome_cmd_data_set_bool   ("/options/hidden_filter", filter_settings.hidden);
     gnome_cmd_data_set_bool   ("/options/backup_filter", filter_settings.backup);
 
-    gnome_cmd_data_set_bool   ("/sort/case_sensitive", priv->case_sens_sort);
+    gnome_cmd_data_set_bool   ("/sort/case_sensitive", case_sens_sort);
 
     gnome_cmd_data_set_int    ("/colors/mode", color_mode);
 
@@ -1624,7 +1626,7 @@
 
     gnome_cmd_data_set_string ("/options/list_font", priv->list_font);
 
-    gnome_cmd_data_set_int    ("/options/ext_disp_mode", priv->ext_disp_mode);
+    gnome_cmd_data_set_int    ("/options/ext_disp_mode", ext_disp_mode);
     gnome_cmd_data_set_int    ("/options/right_mouse_button_mode", right_mouse_button_mode);
     gnome_cmd_data_set_int    ("/options/icon_size", priv->icon_size);
     gnome_cmd_data_set_int    ("/options/dev_icon_size", priv->dev_icon_size);
@@ -1634,7 +1636,7 @@
     gnome_cmd_data_set_int    ("/options/cmdline_history_length", priv->cmdline_history_length);
     gnome_cmd_data_set_int    ("/options/btn_relief", priv->btn_relief);
     gnome_cmd_data_set_int    ("/options/filter_type", filter_type);
-    gnome_cmd_data_set_bool   ("/options/list_orientation", priv->list_orientation);
+    gnome_cmd_data_set_bool   ("/options/list_orientation", list_orientation);
     gnome_cmd_data_set_int    ("/options/gui_update_rate", gui_update_rate);
 
     gnome_cmd_data_set_bool   ("/programs/honor_expect_uris", priv->honor_expect_uris);
@@ -1666,13 +1668,13 @@
     gnome_cmd_data_set_string ("/programs/differ", priv->differ);
     gnome_cmd_data_set_string ("/programs/terminal", priv->term);
 
-    gnome_cmd_data_set_bool   ("/programs/use_gcmd_block", priv->use_gcmd_block);
+    gnome_cmd_data_set_bool   ("/programs/use_gcmd_block", use_gcmd_block);
 
     gnome_cmd_data_set_bool   ("/devices/only_icon", priv->device_only_icon);
     gnome_cmd_data_set_int    ("/options/dir_cache_size", priv->dir_cache_size);
     gnome_cmd_data_set_bool   ("/colors/use_ls_colors", priv->use_ls_colors);
 
-    const gchar *quick_connect_uri = gnome_cmd_con_get_uri (GNOME_CMD_CON (priv->quick_connect));
+    const gchar *quick_connect_uri = gnome_cmd_con_get_uri (GNOME_CMD_CON (quick_connect));
 
     if (quick_connect_uri)
         gnome_cmd_data_set_string ("/quick-connect/uri", quick_connect_uri);
@@ -1698,7 +1700,7 @@
 
     gnome_cmd_data_set_int ("/options/main_win_state", (gint) main_win_state);
 
-    gnome_cmd_data_set_bool ("/network/use_gnome_auth_manager", priv->use_gnome_auth_manager);
+    gnome_cmd_data_set_bool ("/network/use_gnome_auth_manager", use_gnome_auth_manager);
     gnome_cmd_data_set_string ("/network/ftp_anonymous_password", priv->ftp_anonymous_password);
     gnome_config_clean_section (G_DIR_SEPARATOR_S PACKAGE "/ftp");
 
@@ -1739,18 +1741,6 @@
 }
 
 
-const gboolean gnome_cmd_data_get_use_gnome_auth_manager ()
-{
-    return gnome_cmd_data.priv->use_gnome_auth_manager;
-}
-
-
-void gnome_cmd_data_set_use_gnome_auth_manager (gboolean use_gnome_auth_manager)
-{
-    gnome_cmd_data.priv->use_gnome_auth_manager = use_gnome_auth_manager;
-}
-
-
 void gnome_cmd_data_add_fav_app (GnomeCmdApp *app)
 {
     g_return_if_fail (app != NULL);
@@ -1842,30 +1832,6 @@
 }
 
 
-gint gnome_cmd_data_get_list_row_height ()
-{
-    return gnome_cmd_data.priv->list_row_height;
-}
-
-
-void gnome_cmd_data_set_list_row_height (gint height)
-{
-    gnome_cmd_data.priv->list_row_height = height;
-}
-
-
-void gnome_cmd_data_set_ext_disp_mode (GnomeCmdExtDispMode mode)
-{
-    gnome_cmd_data.priv->ext_disp_mode = mode;
-}
-
-
-GnomeCmdExtDispMode gnome_cmd_data_get_ext_disp_mode ()
-{
-    return gnome_cmd_data.priv->ext_disp_mode;
-}
-
-
 void gnome_cmd_data_set_viewer (const gchar *command)
 {
     g_free (gnome_cmd_data.priv->viewer);
@@ -1918,24 +1884,6 @@
 }
 
 
-gboolean gnome_cmd_data_get_use_gcmd_block ()
-{
-    return gnome_cmd_data.priv->use_gcmd_block;
-}
-
-
-gboolean gnome_cmd_data_get_case_sens_sort ()
-{
-    return gnome_cmd_data.priv->case_sens_sort;
-}
-
-
-void gnome_cmd_data_set_case_sens_sort (gboolean value)
-{
-    gnome_cmd_data.priv->case_sens_sort = value;
-}
-
-
 const gchar *gnome_cmd_data_get_list_font ()
 {
     return gnome_cmd_data.priv->list_font;
@@ -2110,12 +2058,6 @@
 }
 
 
-GnomeCmdConFtp *gnome_cmd_data_get_quick_connect ()
-{
-    return gnome_cmd_data.priv->quick_connect;
-}
-
-
 GnomeCmdBookmarkGroup *gnome_cmd_data_get_local_bookmarks ()
 {
     return gnome_cmd_con_get_bookmarks (gnome_cmd_con_list_get_home (gnome_cmd_data.priv->con_list));
@@ -2164,18 +2106,6 @@
 }
 
 
-void gnome_cmd_data_set_list_orientation (gboolean vertical)
-{
-    gnome_cmd_data.priv->list_orientation = vertical;
-}
-
-
-gboolean gnome_cmd_data_get_list_orientation ()
-{
-    return gnome_cmd_data.priv->list_orientation;
-}
-
-
 void gnome_cmd_data_set_start_dir (gboolean fs, const gchar *start_dir)
 {
     if (gnome_cmd_data.priv->start_dirs[fs])
@@ -2215,18 +2145,18 @@
 }
 
 
-void gnome_cmd_data_get_sort_params (GnomeCmdFileList *fl, gint *col, gboolean *direction)
+void gnome_cmd_data_get_sort_params (GnomeCmdFileList *fl, gint &col, gboolean &direction)
 {
     if (!gnome_cmd_main_win_get_fs (main_win, LEFT) || gnome_cmd_main_win_get_fs (main_win, LEFT)->file_list() == fl)
     {
-        *col = gnome_cmd_data.priv->sort_column[LEFT];
-        *direction = gnome_cmd_data.priv->sort_direction[LEFT];
+        col = gnome_cmd_data.priv->sort_column[LEFT];
+        direction = gnome_cmd_data.priv->sort_direction[LEFT];
     }
     else
         if (!gnome_cmd_main_win_get_fs (main_win, RIGHT) || gnome_cmd_main_win_get_fs (main_win, RIGHT)->file_list() == fl)
         {
-            *col = gnome_cmd_data.priv->sort_column[RIGHT];
-            *direction = gnome_cmd_data.priv->sort_direction[RIGHT];
+            col = gnome_cmd_data.priv->sort_column[RIGHT];
+            direction = gnome_cmd_data.priv->sort_direction[RIGHT];
         }
 }
 

Modified: trunk/src/gnome-cmd-data.h
==============================================================================
--- trunk/src/gnome-cmd-data.h	(original)
+++ trunk/src/gnome-cmd-data.h	Tue Sep 23 18:46:50 2008
@@ -27,6 +27,8 @@
 #include "history.h"
 #include "dict.h"
 
+typedef struct _GnomeCmdConFtp GnomeCmdConFtp;
+
 struct GnomeCmdData
 {
     enum RightMouseButtonMode
@@ -73,6 +75,12 @@
 
     Private *priv;
 
+  private:
+
+    GnomeCmdConFtp              *quick_connect;
+
+  public:
+
     gboolean                     confirm_delete;
     GnomeCmdConfirmOverwriteMode confirm_copy_overwrite;
     GnomeCmdConfirmOverwriteMode confirm_move_overwrite;
@@ -83,14 +91,23 @@
     Filter::Type                 filter_type;
     FilterSettings               filter_settings;
 
+    gboolean                     case_sens_sort;
+    GnomeCmdExtDispMode          ext_disp_mode;
+    gboolean                     list_orientation;
+
     gboolean                     toolbar_visibility;
     gboolean                     conbuttons_visibility;
     gboolean                     concombo_visibility;
     gboolean                     cmdline_visibility;
     gboolean                     buttonbar_visibility;
 
+    gint                         list_row_height;
     guint                        gui_update_rate;
 
+    gboolean                     use_gcmd_block;
+
+    gboolean                     use_gnome_auth_manager;
+
     gint                         main_win_width;
     gint                         main_win_height;
     GdkWindowState               main_win_state;
@@ -104,10 +121,9 @@
     void save();
 
     gboolean hide_type(GnomeVFSFileType type)     {  return filter_settings.file_types[type];  }
+    GnomeCmdConFtp *get_quick_connect()           {  return quick_connect;                     }
 };
 
-typedef struct _GnomeCmdConFtp GnomeCmdConFtp;
-
 #define PATTERN_HISTORY_SIZE 10
 
 gpointer gnome_cmd_data_get_con_list ();
@@ -120,9 +136,6 @@
 const gchar *gnome_cmd_data_get_ftp_anonymous_password ();
 void gnome_cmd_data_set_ftp_anonymous_password (const gchar *pw);
 
-const gboolean gnome_cmd_data_get_use_gnome_auth_manager ();
-void gnome_cmd_data_set_use_gnome_auth_manager (gboolean use_gnome_auth_manager);
-
 GnomeCmdSizeDispMode gnome_cmd_data_get_size_disp_mode ();
 void gnome_cmd_data_set_size_disp_mode (GnomeCmdSizeDispMode mode);
 
@@ -138,13 +151,7 @@
 GnomeCmdColorTheme *gnome_cmd_data_get_custom_color_theme ();
 GnomeCmdColorTheme *gnome_cmd_data_get_current_color_theme ();
 
-gint gnome_cmd_data_get_list_row_height ();
-void gnome_cmd_data_set_list_row_height (gint height);
-
-GnomeCmdExtDispMode gnome_cmd_data_get_ext_disp_mode ();
-void gnome_cmd_data_set_ext_disp_mode (GnomeCmdExtDispMode mode);
-
-void gnome_cmd_data_get_sort_params (GnomeCmdFileList *fl, gint *col, gboolean *direction);
+void gnome_cmd_data_get_sort_params (GnomeCmdFileList *fl, gint &col, gboolean &direction);
 void gnome_cmd_data_set_sort_params (GnomeCmdFileList *fl, gint col, gboolean direction);
 
 const gchar *gnome_cmd_data_get_viewer ();
@@ -155,17 +162,12 @@
 void gnome_cmd_data_set_editor (const gchar *command);
 void gnome_cmd_data_set_differ (const gchar *command);
 
-gboolean gnome_cmd_data_get_case_sens_sort ();
-void gnome_cmd_data_set_case_sens_sort (gboolean value);
-
 const gchar *gnome_cmd_data_get_list_font ();
 void gnome_cmd_data_set_list_font (const gchar *list_font);
 
 const gchar *gnome_cmd_data_get_term ();
 void gnome_cmd_data_set_term (const gchar *shell);
 
-gboolean gnome_cmd_data_get_use_gcmd_block ();
-
 guint gnome_cmd_data_get_icon_size ();
 void gnome_cmd_data_set_icon_size (guint size);
 
@@ -203,8 +205,6 @@
 
 GnomeCmdData::SearchDefaults *gnome_cmd_data_get_search_defaults ();
 
-GnomeCmdConFtp *gnome_cmd_data_get_quick_connect ();
-
 GnomeCmdBookmarkGroup *gnome_cmd_data_get_local_bookmarks ();
 GList *gnome_cmd_data_get_bookmark_groups ();
 
@@ -219,9 +219,6 @@
 
 GnomeCmdData::AdvrenameDefaults *gnome_cmd_data_get_advrename_defaults ();
 
-gboolean gnome_cmd_data_get_list_orientation ();
-void gnome_cmd_data_set_list_orientation (gboolean vertical);
-
 const gchar *gnome_cmd_data_get_start_dir (gboolean fs);
 void gnome_cmd_data_set_start_dir (gboolean fs, const gchar *start_dir);
 

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 23 18:46:50 2008
@@ -162,7 +162,7 @@
     gint col = COLUMN_NAME;             // defaults,
     gboolean b = GTK_SORT_ASCENDING;    // used when not set by gnome_cmd_data_get_sort_params()
 
-    gnome_cmd_data_get_sort_params (fl, &col, &b);
+    gnome_cmd_data_get_sort_params (fl, col, b);
     current_col = col;
     sort_raising[col] = b;
     sort_func = file_list_column[col].sort_func;
@@ -216,7 +216,7 @@
     g_free (t1);
     g_free (t2);
 
-    if (gnome_cmd_data_get_ext_disp_mode () == GNOME_CMD_EXT_DISP_STRIPPED
+    if (gnome_cmd_data.ext_disp_mode == GNOME_CMD_EXT_DISP_STRIPPED
         && f->info->type == GNOME_VFS_FILE_TYPE_REGULAR)
     {
         gchar *t = strip_extension (gnome_cmd_file_get_name (f));
@@ -226,7 +226,7 @@
     else
         fname = get_utf8 (gnome_cmd_file_get_name (f));
 
-    if (gnome_cmd_data_get_ext_disp_mode () != GNOME_CMD_EXT_DISP_WITH_FNAME)
+    if (gnome_cmd_data.ext_disp_mode != GNOME_CMD_EXT_DISP_WITH_FNAME)
         fext = get_utf8 (gnome_cmd_file_get_extension (f));
     else
         fext = NULL;
@@ -307,7 +307,7 @@
     y = y0 + row*rowh + GTK_CLIST (fl)->voffset;
 
     width = GTK_CLIST (fl)->column[GnomeCmdFileList::COLUMN_NAME].area.width + 2*COLUMN_INSET;
-    if (gnome_cmd_data_get_ext_disp_mode () != GNOME_CMD_EXT_DISP_BOTH)
+    if (gnome_cmd_data.ext_disp_mode != GNOME_CMD_EXT_DISP_BOTH)
         width += GTK_CLIST (fl)->column[GnomeCmdFileList::COLUMN_EXT].area.width + 2*COLUMN_INSET + CELL_SPACING;
 
     height = rowh + 2*CELL_SPACING;
@@ -769,7 +769,7 @@
 {
     int ret = 0;
 
-    if (gnome_cmd_data_get_case_sens_sort ())
+    if (gnome_cmd_data.case_sens_sort)
         ret = strcmp (s1,s2);
     else
         ret = g_strcasecmp (s1,s2);
@@ -2221,7 +2221,7 @@
 
 void GnomeCmdFileList::update_style()
 {
-    gtk_clist_set_row_height (*this, gnome_cmd_data_get_list_row_height ());
+    gtk_clist_set_row_height (*this, gnome_cmd_data.list_row_height);
     gnome_cmd_clist_update_style (*this);
 }
 

Modified: trunk/src/gnome-cmd-file-selector.cc
==============================================================================
--- trunk/src/gnome-cmd-file-selector.cc	(original)
+++ trunk/src/gnome-cmd-file-selector.cc	Tue Sep 23 18:46:50 2008
@@ -495,7 +495,7 @@
     gdk_window_get_size (GTK_WIDGET (clist)->window, &w, &h);
 
     offset = (0-clist->voffset);
-    row_height = gnome_cmd_data_get_list_row_height();
+    row_height = gnome_cmd_data.list_row_height;
     row_count = clist->rows;
     focus_row = gnome_cmd_clist_get_row (GNOME_CMD_CLIST (fs->file_list()), 1, fs->priv->autoscroll_y);
     top_row = gnome_cmd_clist_get_row (GNOME_CMD_CLIST (fs->file_list()), 1, 0);

Modified: trunk/src/gnome-cmd-main-menu.cc
==============================================================================
--- trunk/src/gnome-cmd-main-menu.cc	(original)
+++ trunk/src/gnome-cmd-main-menu.cc	Tue Sep 23 18:46:50 2008
@@ -352,7 +352,7 @@
 
 static void on_switch_orientation (GtkMenuItem *menu_item, GnomeCmdMainMenu *main_menu)
 {
-    gnome_cmd_data_set_list_orientation (!gnome_cmd_data_get_list_orientation ());
+    gnome_cmd_data.list_orientation = !gnome_cmd_data.list_orientation;
 
     gnome_cmd_main_win_update_list_orientation (main_win);
 
@@ -367,7 +367,7 @@
     GdkPixmap *pm;
     GdkBitmap *bm;
 
-    if (gnome_cmd_data_get_list_orientation ())
+    if (gnome_cmd_data.list_orientation)
     {
         label = g_strdup (_("Switch to Vertical Layout"));
         pm = IMAGE_get_pixmap (PIXMAP_SWITCH_V);

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 23 18:46:50 2008
@@ -266,48 +266,48 @@
 static void slide_set_100_0 (GtkMenu *menu, gpointer user_data)
 {
     gtk_paned_set_position (GTK_PANED (main_win->priv->paned),
-                            gnome_cmd_data_get_list_orientation () ? GTK_WIDGET (main_win)->allocation.height :
-                                                                     GTK_WIDGET (main_win)->allocation.width);
+                            gnome_cmd_data.list_orientation ? GTK_WIDGET (main_win)->allocation.height :
+                                                              GTK_WIDGET (main_win)->allocation.width);
 }
 
 
 static void slide_set_80_20 (GtkMenu *menu, gpointer user_data)
 {
     gtk_paned_set_position (GTK_PANED (main_win->priv->paned),
-                            gnome_cmd_data_get_list_orientation () ? (int)(GTK_WIDGET (main_win)->allocation.height*0.8f) :
-                                                                     (int)(GTK_WIDGET (main_win)->allocation.width*0.8f));
+                            gnome_cmd_data.list_orientation ? (int)(GTK_WIDGET (main_win)->allocation.height*0.8f) :
+                                                              (int)(GTK_WIDGET (main_win)->allocation.width*0.8f));
 }
 
 
 static void slide_set_60_40 (GtkMenu *menu, gpointer user_data)
 {
     gtk_paned_set_position (GTK_PANED (main_win->priv->paned),
-                            gnome_cmd_data_get_list_orientation () ? (int)(GTK_WIDGET (main_win)->allocation.height*0.6f) :
-                                                                     (int)(GTK_WIDGET (main_win)->allocation.width*0.6f));
+                            gnome_cmd_data.list_orientation ? (int)(GTK_WIDGET (main_win)->allocation.height*0.6f) :
+                                                              (int)(GTK_WIDGET (main_win)->allocation.width*0.6f));
 }
 
 
 static void slide_set_50_50 (GtkMenu *menu, gpointer user_data)
 {
     gtk_paned_set_position (GTK_PANED (main_win->priv->paned),
-                            gnome_cmd_data_get_list_orientation () ? (int)(GTK_WIDGET (main_win)->allocation.height*0.5f) :
-                                                                     (int)(GTK_WIDGET (main_win)->allocation.width*0.5f));
+                            gnome_cmd_data.list_orientation ? (int)(GTK_WIDGET (main_win)->allocation.height*0.5f) :
+                                                              (int)(GTK_WIDGET (main_win)->allocation.width*0.5f));
 }
 
 
 static void slide_set_40_60 (GtkMenu *menu, gpointer user_data)
 {
     gtk_paned_set_position (GTK_PANED (main_win->priv->paned),
-                            gnome_cmd_data_get_list_orientation () ? (int)(GTK_WIDGET (main_win)->allocation.height*0.4f) :
-                                                                     (int)(GTK_WIDGET (main_win)->allocation.width*0.4f));
+                            gnome_cmd_data.list_orientation ? (int)(GTK_WIDGET (main_win)->allocation.height*0.4f) :
+                                                              (int)(GTK_WIDGET (main_win)->allocation.width*0.4f));
 }
 
 
 static void slide_set_20_80 (GtkMenu *menu, gpointer user_data)
 {
     gtk_paned_set_position (GTK_PANED (main_win->priv->paned),
-                            gnome_cmd_data_get_list_orientation () ? (int)(GTK_WIDGET (main_win)->allocation.height*0.2f) :
-                                                                     (int)(GTK_WIDGET (main_win)->allocation.width*0.2f));
+                            gnome_cmd_data.list_orientation ? (int)(GTK_WIDGET (main_win)->allocation.height*0.2f) :
+                                                              (int)(GTK_WIDGET (main_win)->allocation.width*0.2f));
 }
 
 
@@ -789,7 +789,7 @@
 
     gnome_app_set_contents (GNOME_APP (main_win), mw->priv->vbox);
 
-    mw->priv->paned = gnome_cmd_data_get_list_orientation () ? gtk_vpaned_new () : gtk_hpaned_new ();
+    mw->priv->paned = gnome_cmd_data.list_orientation ? gtk_vpaned_new () : gtk_hpaned_new ();
 
     gtk_widget_ref (mw->priv->paned);
     gtk_object_set_data_full (GTK_OBJECT (main_win), "paned", mw->priv->paned,
@@ -1273,7 +1273,7 @@
 
     gtk_object_destroy (GTK_OBJECT (mw->priv->paned));
 
-    mw->priv->paned = gnome_cmd_data_get_list_orientation () ? gtk_vpaned_new () : gtk_hpaned_new ();
+    mw->priv->paned = gnome_cmd_data.list_orientation ? gtk_vpaned_new () : gtk_hpaned_new ();
 
     gtk_widget_ref (mw->priv->paned);
     gtk_object_set_data_full (GTK_OBJECT (main_win), "paned", mw->priv->paned, (GtkDestroyNotify) gtk_widget_unref);

Modified: trunk/src/gnome-cmd-options-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-options-dialog.cc	(original)
+++ trunk/src/gnome-cmd-options-dialog.cc	Tue Sep 23 18:46:50 2008
@@ -107,7 +107,7 @@
 
     check = create_check (parent, _("Case sensitive"), "case_sens_check");
     gtk_box_pack_start (GTK_BOX (cat_box), check, FALSE, TRUE, 0);
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gnome_cmd_data_get_case_sens_sort ());
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gnome_cmd_data.case_sens_sort);
 
 
     // Quick search options
@@ -154,7 +154,7 @@
     else
         gnome_cmd_data.filter_type = Filter::TYPE_FNMATCH;
 
-    gnome_cmd_data_set_case_sens_sort (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (case_sens_check)));
+    gnome_cmd_data.case_sens_sort = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (case_sens_check));
     gnome_cmd_data_set_dir_cache_size (gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dir_cache_size)));
     gnome_cmd_data.alt_quick_search = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (alt_quick_search));
 }
@@ -472,7 +472,7 @@
     table_add (table, fpicker, 1, 0, GTK_FILL);
     gtk_font_button_set_font_name (GTK_FONT_BUTTON (fpicker), gnome_cmd_data_get_list_font ());
 
-    spin = create_spin (parent, "row_height_spin", 8, 64, gnome_cmd_data_get_list_row_height());
+    spin = create_spin (parent, "row_height_spin", 8, 64, gnome_cmd_data.list_row_height);
     table_add (table, spin, 1, 1, GTK_FILL);
 
     label = create_label (parent, _("Font:"));
@@ -547,7 +547,7 @@
     table_add (table, label, 0, 3, (GtkAttachOptions) GTK_FILL);
 
 
-    gtk_option_menu_set_history (GTK_OPTION_MENU (fe_optmenu), (gint) gnome_cmd_data_get_ext_disp_mode ());
+    gtk_option_menu_set_history (GTK_OPTION_MENU (fe_optmenu), (gint) gnome_cmd_data.ext_disp_mode);
     gtk_option_menu_set_history (GTK_OPTION_MENU (lm_optmenu), (gint) gnome_cmd_data_get_layout ());
     gtk_option_menu_set_history (GTK_OPTION_MENU (cm_optmenu), (gint) gnome_cmd_data.color_mode);
 
@@ -570,8 +570,7 @@
 
     GtkWidget *list_font_picker = lookup_widget (GTK_WIDGET (dialog), "list_font_picker");
 
-    gnome_cmd_data_set_ext_disp_mode (
-        (GnomeCmdExtDispMode) gtk_option_menu_get_history (GTK_OPTION_MENU (fe_optmenu)));
+    gnome_cmd_data.ext_disp_mode = (GnomeCmdExtDispMode) gtk_option_menu_get_history (GTK_OPTION_MENU (fe_optmenu));
     gnome_cmd_data_set_layout (
         (GnomeCmdLayout) gtk_option_menu_get_history (GTK_OPTION_MENU (lm_optmenu)));
     gnome_cmd_data.color_mode = (GnomeCmdColorMode) gtk_option_menu_get_history (GTK_OPTION_MENU (cm_optmenu));
@@ -585,12 +584,10 @@
     gnome_cmd_data_set_document_icon_dir (gtk_entry_get_text (GTK_ENTRY (doc_icondir_entry)));
     gnome_cmd_data_set_icon_size (gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (iconsize_spin)));
 
-    {
-        GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (iconquality_scale));
-        gnome_cmd_data_set_icon_scale_quality ((GdkInterpType) adj->value);
-    }
+    GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (iconquality_scale));
+    gnome_cmd_data_set_icon_scale_quality ((GdkInterpType) adj->value);
 
-    gnome_cmd_data_set_list_row_height (gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (row_height_spin)));
+    gnome_cmd_data.list_row_height = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (row_height_spin));
 }
 
 
@@ -885,7 +882,7 @@
 
     check = create_check (parent, _("Use GNOME Keyring Manager for authentication"), "use_auth_manager");
     gtk_box_pack_start (GTK_BOX (cat_box), check, FALSE, TRUE, 0);
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gnome_cmd_data_get_use_gnome_auth_manager ());
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gnome_cmd_data.use_gnome_auth_manager);
 
 
     // Anonymous FTP password options
@@ -909,7 +906,7 @@
     GtkWidget *use_auth_manager_check = lookup_widget (GTK_WIDGET (dialog), "use_auth_manager");
     GtkWidget *entry = lookup_widget (GTK_WIDGET (dialog), "anonymous_ftp_password");
 
-    gnome_cmd_data_set_use_gnome_auth_manager (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (use_auth_manager_check)));
+    gnome_cmd_data.use_gnome_auth_manager = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (use_auth_manager_check));
     gnome_cmd_data_set_ftp_anonymous_password (gtk_entry_get_text (GTK_ENTRY (entry)));
 }
 

Modified: trunk/src/gnome-cmd-quicksearch-popup.cc
==============================================================================
--- trunk/src/gnome-cmd-quicksearch-popup.cc	(original)
+++ trunk/src/gnome-cmd-quicksearch-popup.cc	Tue Sep 23 18:46:50 2008
@@ -76,7 +76,7 @@
         GnomeCmdFile *finfo = (GnomeCmdFile *) files->data;
         gint res;
 
-        if (gnome_cmd_data_get_case_sens_sort ())
+        if (gnome_cmd_data.case_sens_sort)
             res = strncmp (finfo->info->name, text, strlen(text));
         else
             res = strncasecmp (finfo->info->name, text, strlen(text));

Modified: trunk/src/gnome-cmd-remote-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-remote-dialog.cc	(original)
+++ trunk/src/gnome-cmd-remote-dialog.cc	Tue Sep 23 18:46:50 2008
@@ -590,7 +590,7 @@
 
 void show_quick_connect_dialog ()
 {
-    GnomeCmdConFtp *con = gnome_cmd_data_get_quick_connect ();
+    GnomeCmdConFtp *con = gnome_cmd_data.get_quick_connect();
 
     if (gnome_cmd_connect_dialog_edit (con))
         do_connect_real (con);

Modified: trunk/src/main.cc
==============================================================================
--- trunk/src/main.cc	(original)
+++ trunk/src/main.cc	Tue Sep 23 18:46:50 2008
@@ -123,7 +123,7 @@
     IMAGE_init ();
     gnome_cmd_data.load_more();
 
-    if (gnome_cmd_data_get_use_gnome_auth_manager ())
+    if (gnome_cmd_data.use_gnome_auth_manager)
         gnome_authentication_manager_init ();
     else
         gnome_cmd_smb_auth_init ();

Modified: trunk/src/utils.cc
==============================================================================
--- trunk/src/utils.cc	(original)
+++ trunk/src/utils.cc	Tue Sep 23 18:46:50 2008
@@ -121,7 +121,7 @@
     {
         gchar *arg;
 
-        if (gnome_cmd_data_get_use_gcmd_block ())
+        if (gnome_cmd_data.use_gcmd_block)
         {
             gchar *s = g_strdup_printf ("%s; %s/bin/gcmd-block", in_command, PREFIX);
             arg = g_shell_quote (s);



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