gnome-commander r2089 - in branches/gcmd-1-3: . src



Author: epiotr
Date: Tue Sep 16 16:45:08 2008
New Revision: 2089
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2089&view=rev

Log:
GnomeCmdData: more C++ rework

Modified:
   branches/gcmd-1-3/ChangeLog
   branches/gcmd-1-3/src/gnome-cmd-data.cc
   branches/gcmd-1-3/src/gnome-cmd-data.h
   branches/gcmd-1-3/src/gnome-cmd-file-list.cc
   branches/gcmd-1-3/src/gnome-cmd-main-menu.cc
   branches/gcmd-1-3/src/gnome-cmd-main-win.cc
   branches/gcmd-1-3/src/gnome-cmd-options-dialog.cc
   branches/gcmd-1-3/src/gnome-cmd-user-actions.cc

Modified: branches/gcmd-1-3/src/gnome-cmd-data.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-data.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-data.cc	Tue Sep 16 16:45:08 2008
@@ -55,8 +55,6 @@
     GnomeCmdLayout       layout;
     GnomeCmdColorTheme   color_themes[GNOME_CMD_NUM_COLOR_MODES];
     GnomeCmdExtDispMode  ext_disp_mode;
-    FilterSettings       filter_settings;
-    gint                 main_win_width, main_win_height;
     gboolean             case_sens_sort;
     gint                 list_row_height;
     gchar                *list_font;
@@ -88,7 +86,6 @@
     gint                 main_win_pos[2];
     gchar                *backup_pattern;
     GList                *backup_pattern_list;
-    GdkWindowState       main_win_state;
     gchar                *symlink_prefix;
 
     GnomeCmdConFtp       *quick_connect;
@@ -1113,12 +1110,20 @@
     alt_quick_search = FALSE;
 
     filter_type = Filter::TYPE_FNMATCH;
+    memset(&filter_settings, 0, sizeof(filter_settings));
+    filter_settings.hidden = TRUE;
+    filter_settings.backup = TRUE;
 
     toolbar_visibility = TRUE;
     conbuttons_visibility = TRUE;
     concombo_visibility = TRUE;
     cmdline_visibility = TRUE;
     buttonbar_visibility = TRUE;
+
+    main_win_width = 600;
+    main_win_height = 400;
+
+    main_win_state = GDK_WINDOW_STATE_MAXIMIZED;
 }
 
 
@@ -1231,37 +1236,21 @@
     confirm_copy_overwrite = (GnomeCmdConfirmOverwriteMode) gnome_cmd_data_get_int ("/confirm/copy_overwrite", GNOME_CMD_CONFIRM_OVERWRITE_QUERY);
     confirm_move_overwrite = (GnomeCmdConfirmOverwriteMode) gnome_cmd_data_get_int ("/confirm/move_overwrite", GNOME_CMD_CONFIRM_OVERWRITE_QUERY);
 
-    priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_UNKNOWN] =
-        gnome_cmd_data_get_bool ("/options/show_unknown", FALSE);
-
-    priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_REGULAR] =
-        gnome_cmd_data_get_bool ("/options/show_regular", FALSE);
-
-    priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_DIRECTORY] =
-        gnome_cmd_data_get_bool ("/options/show_directory", FALSE);
-
-    priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_FIFO] =
-        gnome_cmd_data_get_bool ("/options/show_fifo", FALSE);
-
-    priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_SOCKET] =
-        gnome_cmd_data_get_bool ("/options/show_socket", FALSE);
-
-    priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE] =
-        gnome_cmd_data_get_bool ("/options/show_char_device", FALSE);
-
-    priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_BLOCK_DEVICE] =
-        gnome_cmd_data_get_bool ("/options/show_block_device", FALSE);
-
-    priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK] =
-        gnome_cmd_data_get_bool ("/options/show_symbolic_link", FALSE);
-
-    priv->filter_settings.hidden = gnome_cmd_data_get_bool ("/options/hidden_filter", TRUE);
-    priv->filter_settings.backup = gnome_cmd_data_get_bool ("/options/backup_filter", TRUE);
+    filter_settings.file_types[GNOME_VFS_FILE_TYPE_UNKNOWN] = gnome_cmd_data_get_bool ("/options/show_unknown", FALSE);
+    filter_settings.file_types[GNOME_VFS_FILE_TYPE_REGULAR] = gnome_cmd_data_get_bool ("/options/show_regular", FALSE);
+    filter_settings.file_types[GNOME_VFS_FILE_TYPE_DIRECTORY] = gnome_cmd_data_get_bool ("/options/show_directory", FALSE);
+    filter_settings.file_types[GNOME_VFS_FILE_TYPE_FIFO] = gnome_cmd_data_get_bool ("/options/show_fifo", FALSE);
+    filter_settings.file_types[GNOME_VFS_FILE_TYPE_SOCKET] = gnome_cmd_data_get_bool ("/options/show_socket", FALSE);
+    filter_settings.file_types[GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE] = gnome_cmd_data_get_bool ("/options/show_char_device", FALSE);
+    filter_settings.file_types[GNOME_VFS_FILE_TYPE_BLOCK_DEVICE] = gnome_cmd_data_get_bool ("/options/show_block_device", FALSE);
+    filter_settings.file_types[GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK] = gnome_cmd_data_get_bool ("/options/show_symbolic_link", FALSE);
+    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);
 
-    priv->main_win_width = get_int ("/gnome-commander-size/main_win/width", 600);
-    priv->main_win_height = get_int ("/gnome-commander-size/main_win/height", 400);
+    main_win_width = get_int ("/gnome-commander-size/main_win/width", 600);
+    main_win_height = get_int ("/gnome-commander-size/main_win/height", 400);
 
     for (gint i=0; i<GnomeCmdFileList::NUM_COLUMNS; i++)
     {
@@ -1352,7 +1341,7 @@
     priv->backup_pattern = gnome_cmd_data_get_string ("/defaults/backup_pattern", "*~;*.bak");
     priv->backup_pattern_list = patlist_new (priv->backup_pattern);
 
-    priv->main_win_state = (GdkWindowState) gnome_cmd_data_get_int ("/options/main_win_state", (gint) GDK_WINDOW_STATE_MAXIMIZED);
+    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);
     priv->ftp_anonymous_password = gnome_cmd_data_get_string ("/network/ftp_anonymous_password", "you provider com");
@@ -1612,17 +1601,17 @@
     gnome_cmd_data_set_int    ("/confirm/copy_overwrite", confirm_copy_overwrite);
     gnome_cmd_data_set_int    ("/confirm/move_overwrite", confirm_move_overwrite);
 
-    gnome_cmd_data_set_bool   ("/options/show_unknown", priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_UNKNOWN]);
-    gnome_cmd_data_set_bool   ("/options/show_regular", priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_REGULAR]);
-    gnome_cmd_data_set_bool   ("/options/show_directory", priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_DIRECTORY]);
-    gnome_cmd_data_set_bool   ("/options/show_fifo", priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_FIFO]);
-    gnome_cmd_data_set_bool   ("/options/show_socket", priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_SOCKET]);
-    gnome_cmd_data_set_bool   ("/options/show_char_device", priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE]);
-    gnome_cmd_data_set_bool   ("/options/show_block_device", priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_BLOCK_DEVICE]);
-    gnome_cmd_data_set_bool   ("/options/show_symbolic_link", priv->filter_settings.file_types[GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK]);
+    gnome_cmd_data_set_bool   ("/options/show_unknown", filter_settings.file_types[GNOME_VFS_FILE_TYPE_UNKNOWN]);
+    gnome_cmd_data_set_bool   ("/options/show_regular", filter_settings.file_types[GNOME_VFS_FILE_TYPE_REGULAR]);
+    gnome_cmd_data_set_bool   ("/options/show_directory", filter_settings.file_types[GNOME_VFS_FILE_TYPE_DIRECTORY]);
+    gnome_cmd_data_set_bool   ("/options/show_fifo", filter_settings.file_types[GNOME_VFS_FILE_TYPE_FIFO]);
+    gnome_cmd_data_set_bool   ("/options/show_socket", filter_settings.file_types[GNOME_VFS_FILE_TYPE_SOCKET]);
+    gnome_cmd_data_set_bool   ("/options/show_char_device", filter_settings.file_types[GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE]);
+    gnome_cmd_data_set_bool   ("/options/show_block_device", filter_settings.file_types[GNOME_VFS_FILE_TYPE_BLOCK_DEVICE]);
+    gnome_cmd_data_set_bool   ("/options/show_symbolic_link", filter_settings.file_types[GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK]);
 
-    gnome_cmd_data_set_bool   ("/options/hidden_filter", priv->filter_settings.hidden);
-    gnome_cmd_data_set_bool   ("/options/backup_filter", priv->filter_settings.backup);
+    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);
 
@@ -1694,8 +1683,8 @@
     gnome_config_clean_key (G_DIR_SEPARATOR_S PACKAGE "/quick-connect/port");
     gnome_config_clean_key (G_DIR_SEPARATOR_S PACKAGE "/quick-connect/user");
 
-    gnome_config_set_int ("/gnome-commander-size/main_win/width", priv->main_win_width);
-    gnome_config_set_int ("/gnome-commander-size/main_win/height", priv->main_win_height);
+    gnome_config_set_int ("/gnome-commander-size/main_win/width", main_win_width);
+    gnome_config_set_int ("/gnome-commander-size/main_win/height", main_win_height);
 
     for (gint i=0; i<GnomeCmdFileList::NUM_COLUMNS; i++)
     {
@@ -1709,7 +1698,7 @@
     gnome_cmd_data_set_string ("/defaults/last_pattern", priv->last_pattern);
     gnome_cmd_data_set_string ("/defaults/backup_pattern", priv->backup_pattern);
 
-    gnome_cmd_data_set_int ("/options/main_win_state", (gint) priv->main_win_state);
+    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_string ("/network/ftp_anonymous_password", priv->ftp_anonymous_password);
@@ -1879,20 +1868,6 @@
 }
 
 
-void gnome_cmd_data_set_main_win_size (gint width, gint height)
-{
-    gnome_cmd_data.priv->main_win_width = width;
-    gnome_cmd_data.priv->main_win_height = height;
-}
-
-
-void gnome_cmd_data_get_main_win_size (gint *width, gint *height)
-{
-    *width = gnome_cmd_data.priv->main_win_width;
-    *height = gnome_cmd_data.priv->main_win_height;
-}
-
-
 void gnome_cmd_data_set_viewer (const gchar *command)
 {
     g_free (gnome_cmd_data.priv->viewer);
@@ -2108,42 +2083,6 @@
 }
 
 
-GnomeCmdData::FilterSettings *gnome_cmd_data_get_filter_settings ()
-{
-    return &gnome_cmd_data.priv->filter_settings;
-}
-
-
-gboolean gnome_cmd_data_get_type_filter (GnomeVFSFileType type)
-{
-    return gnome_cmd_data.priv->filter_settings.file_types[type];
-}
-
-
-void gnome_cmd_data_set_hidden_filter (gboolean hide)
-{
-    gnome_cmd_data.priv->filter_settings.hidden = hide;
-}
-
-
-gboolean gnome_cmd_data_get_hidden_filter ()
-{
-    return gnome_cmd_data.priv->filter_settings.hidden;
-}
-
-
-gboolean gnome_cmd_data_get_backup_filter ()
-{
-    return gnome_cmd_data.priv->filter_settings.backup;
-}
-
-
-gboolean gnome_cmd_data_get_other_filter ()
-{
-    return FALSE;
-}
-
-
 void gnome_cmd_data_set_device_only_icon (gboolean value)
 {
     gnome_cmd_data.priv->device_only_icon = value;
@@ -2368,19 +2307,6 @@
 }
 
 
-GdkWindowState gnome_cmd_data_get_main_win_state ()
-{
-    return gnome_cmd_data.priv->main_win_state;
-}
-
-
-void gnome_cmd_data_set_main_win_state (GdkWindowState state)
-{
-    gnome_cmd_data.priv->main_win_state = state;
-//    gnome_cmd_data.priv->main_win_state = gdk_window_get_state (GTK_WIDGET (main_win)->window);
-}
-
-
 const gchar *gnome_cmd_data_get_symlink_prefix ()
 {
     return gnome_cmd_data.priv->symlink_prefix ? gnome_cmd_data.priv->symlink_prefix : _("link to %s");

Modified: branches/gcmd-1-3/src/gnome-cmd-data.h
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-data.h	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-data.h	Tue Sep 16 16:45:08 2008
@@ -81,6 +81,7 @@
     gboolean                     alt_quick_search;
 
     Filter::Type                 filter_type;
+    FilterSettings               filter_settings;
 
     gboolean                     toolbar_visibility;
     gboolean                     conbuttons_visibility;
@@ -88,6 +89,10 @@
     gboolean                     cmdline_visibility;
     gboolean                     buttonbar_visibility;
 
+    gint                         main_win_width;
+    gint                         main_win_height;
+    GdkWindowState               main_win_state;
+
     GnomeCmdData();
 
     void free();                // FIXME: free() -> ~GnomeCmdData()
@@ -95,6 +100,8 @@
     void load();
     void load_more();
     void save();
+
+    gboolean hide_type(GnomeVFSFileType type)     {  return filter_settings.file_types[type];  }
 };
 
 typedef struct _GnomeCmdConFtp GnomeCmdConFtp;
@@ -135,16 +142,6 @@
 GnomeCmdExtDispMode gnome_cmd_data_get_ext_disp_mode ();
 void gnome_cmd_data_set_ext_disp_mode (GnomeCmdExtDispMode mode);
 
-GnomeCmdData::FilterSettings *gnome_cmd_data_get_filter_settings ();
-gboolean gnome_cmd_data_get_type_filter (GnomeVFSFileType type);
-void gnome_cmd_data_set_hidden_filter (gboolean hide);
-gboolean gnome_cmd_data_get_hidden_filter ();
-gboolean gnome_cmd_data_get_backup_filter ();
-gboolean gnome_cmd_data_get_other_filter ();
-
-void gnome_cmd_data_get_main_win_size (gint *width, gint *height);
-void gnome_cmd_data_set_main_win_size (gint width, gint height);
-
 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);
 
@@ -245,9 +242,6 @@
 
 GList *gnome_cmd_data_get_backup_pattern_list ();
 
-GdkWindowState gnome_cmd_data_get_main_win_state ();
-void gnome_cmd_data_set_main_win_state (GdkWindowState state);
-
 const gchar *gnome_cmd_data_get_symlink_prefix ();
 void gnome_cmd_data_set_symlink_prefix (const gchar *value);
 

Modified: branches/gcmd-1-3/src/gnome-cmd-file-list.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-file-list.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-file-list.cc	Tue Sep 16 16:45:08 2008
@@ -2240,36 +2240,36 @@
     GnomeVFSFileInfo *info = f->info;
 
     if (info->type == GNOME_VFS_FILE_TYPE_UNKNOWN
-        && gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_UNKNOWN))
+        && gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_UNKNOWN))
         return FALSE;
     if (info->type == GNOME_VFS_FILE_TYPE_REGULAR
-        && gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_REGULAR))
+        && gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_REGULAR))
         return FALSE;
     if (info->type == GNOME_VFS_FILE_TYPE_DIRECTORY
-        && gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_DIRECTORY))
+        && gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_DIRECTORY))
         return FALSE;
     if (info->type == GNOME_VFS_FILE_TYPE_FIFO
-        && gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_FIFO))
+        && gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_FIFO))
         return FALSE;
     if (info->type == GNOME_VFS_FILE_TYPE_SOCKET
-        && gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_SOCKET))
+        && gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_SOCKET))
         return FALSE;
     if (info->type == GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE
-        && gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE))
+        && gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE))
         return FALSE;
     if (info->type == GNOME_VFS_FILE_TYPE_BLOCK_DEVICE
-        && gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_BLOCK_DEVICE))
+        && gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_BLOCK_DEVICE))
         return FALSE;
     if ((info->flags == GNOME_VFS_FILE_FLAGS_SYMLINK || info->symlink_name != NULL)
-        && gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK))
+        && gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK))
         return FALSE;
     if (strcmp (info->name, ".") == 0)
         return FALSE;
     if (strcmp (info->name, "..") == 0)
         return FALSE;
-    if (info->name[0] == '.' && gnome_cmd_data_get_hidden_filter ())
+    if (info->name[0] == '.' && gnome_cmd_data.filter_settings.hidden)
         return FALSE;
-    if (gnome_cmd_data_get_backup_filter () && patlist_matches (gnome_cmd_data_get_backup_pattern_list (), info->name))
+    if (gnome_cmd_data.filter_settings.backup && patlist_matches (gnome_cmd_data_get_backup_pattern_list (), info->name))
         return FALSE;
 
     return TRUE;

Modified: branches/gcmd-1-3/src/gnome-cmd-main-menu.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-main-menu.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-main-menu.cc	Tue Sep 16 16:45:08 2008
@@ -855,10 +855,10 @@
         gnome_cmd_data.cmdline_visibility);
     gtk_check_menu_item_set_active (
         GTK_CHECK_MENU_ITEM (main_menu->priv->menu_view_hidden_files),
-        !gnome_cmd_data_get_hidden_filter ());
+        !gnome_cmd_data.filter_settings.hidden);
     gtk_check_menu_item_set_active (
         GTK_CHECK_MENU_ITEM (main_menu->priv->menu_view_backup_files),
-        !gnome_cmd_data_get_backup_filter ());
+        !gnome_cmd_data.filter_settings.backup);
 
     gtk_signal_connect (GTK_OBJECT (gnome_cmd_con_list_get ()), "list-changed",
                         GTK_SIGNAL_FUNC (on_con_list_list_changed), main_menu);

Modified: branches/gcmd-1-3/src/gnome-cmd-main-win.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-main-win.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-main-win.cc	Tue Sep 16 16:45:08 2008
@@ -531,7 +531,7 @@
 
 static void on_size_allocate (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data)
 {
-    switch (gnome_cmd_data_get_main_win_state())
+    switch (gnome_cmd_data.main_win_state)
     {
         case GDK_WINDOW_STATE_FULLSCREEN:
         case GDK_WINDOW_STATE_ICONIFIED:
@@ -539,7 +539,8 @@
             break;
 
         default:
-            gnome_cmd_data_set_main_win_size (allocation->width, allocation->height);
+            gnome_cmd_data.main_win_width = allocation->width;
+            gnome_cmd_data.main_win_height = allocation->height;
     }
 }
 
@@ -635,16 +636,17 @@
 
 static void restore_size_and_pos (GnomeCmdMainWin *mw)
 {
-    gint w, h, x, y;
+    gint x, y;
 
-    gnome_cmd_data_get_main_win_size (&w, &h);
-    gtk_widget_set_size_request (GTK_WIDGET (main_win), w, h);
+    gtk_widget_set_size_request (GTK_WIDGET (main_win),
+                                 gnome_cmd_data.main_win_width,
+                                 gnome_cmd_data.main_win_height);
 
     gnome_cmd_data_get_main_win_pos (&x, &y);
     if (x >= 0 && y >= 0)
         gtk_window_move (GTK_WINDOW (mw), x, y);
 
-    switch (gnome_cmd_data_get_main_win_state ())
+    switch (gnome_cmd_data.main_win_state)
     {
         case GDK_WINDOW_STATE_MAXIMIZED:
         case GDK_WINDOW_STATE_FULLSCREEN:
@@ -674,8 +676,8 @@
                 break;
 
         case GDK_WINDOW_STATE_ICONIFIED:
-            if (gnome_cmd_data_get_main_win_state() == GDK_WINDOW_STATE_MAXIMIZED ||  // prev state
-                gnome_cmd_data_get_main_win_state() == GDK_WINDOW_STATE_FULLSCREEN)
+            if (gnome_cmd_data.main_win_state == GDK_WINDOW_STATE_MAXIMIZED ||  // prev state
+                gnome_cmd_data.main_win_state == GDK_WINDOW_STATE_FULLSCREEN)
                 break;  // not usable
 
         default:            // other are usable
@@ -683,7 +685,7 @@
             gnome_cmd_data_set_main_win_pos (x, y);
     }
 
-    gnome_cmd_data_set_main_win_state (event->new_window_state);
+    gnome_cmd_data.main_win_state = event->new_window_state;
 
     return FALSE;
 }
@@ -984,7 +986,7 @@
         {
             case GDK_H:
             case GDK_h:
-                gnome_cmd_data_set_hidden_filter (!gnome_cmd_data_get_hidden_filter ());
+                gnome_cmd_data.filter_settings.hidden = !gnome_cmd_data.filter_settings.hidden;
                 gnome_cmd_style_create ();
                 gnome_cmd_main_win_update_style (main_win);
                 gnome_cmd_data.save();

Modified: branches/gcmd-1-3/src/gnome-cmd-options-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-options-dialog.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-options-dialog.cc	Tue Sep 16 16:45:08 2008
@@ -739,31 +739,31 @@
     check = create_check (parent, _("Unknown"), "hide_unknown_check");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                  gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_UNKNOWN));
+                                  gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_UNKNOWN));
     check = create_check (parent, _("Regular files"), "hide_regular_check");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                  gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_REGULAR));
+                                  gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_REGULAR));
     check = create_check (parent, _("Directories"), "hide_directory_check");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                  gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_DIRECTORY));
+                                  gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_DIRECTORY));
     check = create_check (parent, _("Fifo files"), "hide_fifo_check");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                  gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_FIFO));
+                                  gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_FIFO));
     check = create_check (parent, _("Socket files"), "hide_socket_check");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                  gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_SOCKET));
+                                  gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_SOCKET));
     check = create_check (parent, _("Character devices"), "hide_char_check");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                  gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE));
+                                  gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE));
     check = create_check (parent, _("Block devices"), "hide_block_check");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                  gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_BLOCK_DEVICE));
+                                  gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_BLOCK_DEVICE));
 
 
     cat_box = create_vbox (parent, FALSE, 0);
@@ -772,16 +772,15 @@
 
     check = create_check (parent, _("Hidden files"), "hide_hidden_check");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                  gnome_cmd_data_get_hidden_filter ());
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gnome_cmd_data.filter_settings.hidden);
     backup_check = create_check (parent, _("Backup files"), "hide_backup_check");
     gtk_container_add (GTK_CONTAINER (cat_box), backup_check);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (backup_check),
-                                  gnome_cmd_data_get_backup_filter ());
+                                  gnome_cmd_data.filter_settings.backup);
     check = create_check (parent, _("Symlinks"), "hide_symlink_check");
     gtk_container_add (GTK_CONTAINER (cat_box), check);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check),
-                                  gnome_cmd_data_get_type_filter (GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK));
+                                  gnome_cmd_data.hide_type(GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK));
 
 
     cat_box = create_vbox (parent, FALSE, 0);
@@ -790,7 +789,7 @@
 
     entry = create_entry (parent, "backup_pattern_entry", gnome_cmd_data_get_backup_pattern ());
     gtk_box_pack_start (GTK_BOX (cat_box), entry, TRUE, FALSE, 0);
-    gtk_widget_set_sensitive (entry, gnome_cmd_data_get_backup_filter ());
+    gtk_widget_set_sensitive (entry, gnome_cmd_data.filter_settings.backup);
 
 
     gtk_signal_connect (GTK_OBJECT (backup_check), "toggled", GTK_SIGNAL_FUNC (on_filter_backup_files_toggled), frame);
@@ -812,7 +811,6 @@
     GtkWidget *hide_backup_check;
     GtkWidget *hide_symlink_check;
     GtkWidget *backup_pattern_entry;
-    GnomeCmdData::FilterSettings *f = gnome_cmd_data_get_filter_settings ();
 
     hide_unknown_check = lookup_widget (GTK_WIDGET (dialog), "hide_unknown_check");
     hide_regular_check = lookup_widget (GTK_WIDGET (dialog), "hide_regular_check");
@@ -826,36 +824,36 @@
     hide_backup_check = lookup_widget (GTK_WIDGET (dialog), "hide_backup_check");
     backup_pattern_entry = lookup_widget (GTK_WIDGET (dialog), "backup_pattern_entry");
 
-    f->file_types[GNOME_VFS_FILE_TYPE_UNKNOWN] =
+    gnome_cmd_data.filter_settings.file_types[GNOME_VFS_FILE_TYPE_UNKNOWN] =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_unknown_check));
 
-    f->file_types[GNOME_VFS_FILE_TYPE_REGULAR] =
+    gnome_cmd_data.filter_settings.file_types[GNOME_VFS_FILE_TYPE_REGULAR] =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_regular_check));
 
-    f->file_types[GNOME_VFS_FILE_TYPE_DIRECTORY] =
+    gnome_cmd_data.filter_settings.file_types[GNOME_VFS_FILE_TYPE_DIRECTORY] =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_directory_check));
 
-    f->file_types[GNOME_VFS_FILE_TYPE_FIFO] =
+    gnome_cmd_data.filter_settings.file_types[GNOME_VFS_FILE_TYPE_FIFO] =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_fifo_check));
 
-    f->file_types[GNOME_VFS_FILE_TYPE_SOCKET] =
+    gnome_cmd_data.filter_settings.file_types[GNOME_VFS_FILE_TYPE_SOCKET] =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_socket_check));
 
-    f->file_types[GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE] =
+    gnome_cmd_data.filter_settings.file_types[GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE] =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_char_check));
 
-    f->file_types[GNOME_VFS_FILE_TYPE_BLOCK_DEVICE] =
+    gnome_cmd_data.filter_settings.file_types[GNOME_VFS_FILE_TYPE_BLOCK_DEVICE] =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_block_check));
-    f->file_types[GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK] =
+
+    gnome_cmd_data.filter_settings.file_types[GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK] =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_symlink_check));
 
-    f->hidden =
+    gnome_cmd_data.filter_settings.hidden =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_hidden_check));
-    f->backup =
+    gnome_cmd_data.filter_settings.backup =
         gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_backup_check));
 
-    gnome_cmd_data_set_backup_pattern (
-        gtk_entry_get_text (GTK_ENTRY (backup_pattern_entry)));
+    gnome_cmd_data_set_backup_pattern (gtk_entry_get_text (GTK_ENTRY (backup_pattern_entry)));
 }
 
 

Modified: branches/gcmd-1-3/src/gnome-cmd-user-actions.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-user-actions.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-user-actions.cc	Tue Sep 16 16:45:08 2008
@@ -847,7 +847,7 @@
 {
     gint x, y;
 
-    switch (gnome_cmd_data_get_main_win_state())
+    switch (gnome_cmd_data.main_win_state)
     {
         case GDK_WINDOW_STATE_MAXIMIZED:
         case GDK_WINDOW_STATE_FULLSCREEN:
@@ -1234,7 +1234,7 @@
     if (!GTK_WIDGET_REALIZED (main_win)) return;
 
     GtkCheckMenuItem *checkitem = (GtkCheckMenuItem *) menuitem;
-    gnome_cmd_data_get_filter_settings()->hidden = !checkitem->active;
+    gnome_cmd_data.filter_settings.hidden = !checkitem->active;
     get_fs (ACTIVE)->reload();
     get_fs (INACTIVE)->reload();
 }
@@ -1245,7 +1245,7 @@
     if (!GTK_WIDGET_REALIZED (main_win)) return;
 
     GtkCheckMenuItem *checkitem = (GtkCheckMenuItem *) menuitem;
-    gnome_cmd_data_get_filter_settings()->backup = !checkitem->active;
+    gnome_cmd_data.filter_settings.backup = !checkitem->active;
     get_fs (ACTIVE)->reload();
     get_fs (INACTIVE)->reload();
 }



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