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



Author: epiotr
Date: Tue Nov 25 21:10:31 2008
New Revision: 2314
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2314&view=rev

Log:
Code cleanup

Modified:
   branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc
   branches/gcmd-1-3/src/gnome-cmd-data.h
   branches/gcmd-1-3/src/gnome-cmd-search-dialog.cc
   branches/gcmd-1-3/src/intviewer/search-dlg.cc

Modified: branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-advrename-dialog.cc	Tue Nov 25 21:10:31 2008
@@ -403,7 +403,7 @@
 
         case METATAG_MENU:
             {
-                GtkItemFactoryEntry *items = g_try_new0(GtkItemFactoryEntry, G_N_ELEMENTS(metatags));
+                GtkItemFactoryEntry *items = g_try_new0 (GtkItemFactoryEntry, G_N_ELEMENTS(metatags));
 
                 g_return_val_if_fail (items != NULL, NULL);
 

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 Nov 25 21:10:31 2008
@@ -38,7 +38,7 @@
         RIGHT_BUTTON_SELECTS
     };
 
-    enum {PATTERN_HISTORY_SIZE=10};
+    enum {SEARCH_HISTORY_SIZE=10, ADVRENAME_HISTORY_SIZE=10, INTVIEWER_HISTORY_SIZE=16};
 
     struct SearchConfig
     {
@@ -49,9 +49,9 @@
         gboolean case_sens;
         gint width, height;
 
-        SearchConfig(): name_patterns(PATTERN_HISTORY_SIZE),
-                        directories(PATTERN_HISTORY_SIZE),
-                        content_patterns(PATTERN_HISTORY_SIZE),
+        SearchConfig(): name_patterns(SEARCH_HISTORY_SIZE),
+                        directories(SEARCH_HISTORY_SIZE),
+                        content_patterns(SEARCH_HISTORY_SIZE),
                         recursive(TRUE), case_sens(FALSE),
                         width(600), height(400)                 {}
     };
@@ -66,7 +66,7 @@
         guint counter_precision;
         gint width, height;
 
-        AdvrenameConfig(): templates(10), regexes(NULL),
+        AdvrenameConfig(): templates(ADVRENAME_HISTORY_SIZE), regexes(NULL),
                            counter_start(1), counter_increment(1), counter_precision(1),          //  defaults for
                            width(600), height(400)                                            {}  //  advrename settings
         ~AdvrenameConfig()                         {  if (regexes)  g_object_unref (regexes);  }

Modified: branches/gcmd-1-3/src/gnome-cmd-search-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-search-dialog.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-search-dialog.cc	Tue Nov 25 21:10:31 2008
@@ -23,11 +23,11 @@
 #include <regex.h>
 
 #include "gnome-cmd-includes.h"
+#include "gnome-cmd-data.h"
 #include "gnome-cmd-search-dialog.h"
 #include "gnome-cmd-dir.h"
 #include "gnome-cmd-file-list.h"
 #include "gnome-cmd-file-selector.h"
-#include "gnome-cmd-data.h"
 #include "gnome-cmd-main-win.h"
 #include "filter.h"
 #include "utils.h"

Modified: branches/gcmd-1-3/src/intviewer/search-dlg.cc
==============================================================================
--- branches/gcmd-1-3/src/intviewer/search-dlg.cc	(original)
+++ branches/gcmd-1-3/src/intviewer/search-dlg.cc	Tue Nov 25 21:10:31 2008
@@ -185,7 +185,7 @@
 
     gtk_widget_set_sensitive(sdlg->priv->case_sensitive_checkbox, FALSE);
 
-    // Check if the text in the Entry-Box is valud hex, otherwise disable the "Find" button
+    // Check if the text in the GtkEntryBox has hex value, otherwise disable the "Find" button
     GtkEntry *w = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (sdlg->priv->entry)));
     entry_changed (w, (gpointer) sdlg);
 }
@@ -288,7 +288,7 @@
     {
         // Only if the use entered a valid hex string, enable the "find" button
         guint len;
-        guint8 *buf = text2hex(gtk_entry_get_text(entry), &len);
+        guint8 *buf = text2hex (gtk_entry_get_text (entry), &len);
 
         enable = (buf!=NULL) && (len>0);
         g_free (buf);
@@ -296,9 +296,9 @@
     else
     {
         // SEARCH_MODE_TEXT
-        enable = (strlen(gtk_entry_get_text(entry))>0);
+        enable = strlen (gtk_entry_get_text (entry))>0;
     }
-    gtk_dialog_set_response_sensitive(GTK_DIALOG(user_data), GTK_RESPONSE_OK, enable);
+    gtk_dialog_set_response_sensitive (GTK_DIALOG (user_data), GTK_RESPONSE_OK, enable);
 }
 
 
@@ -330,7 +330,7 @@
 
     // Label
     sdlg->priv->label = gtk_label_new(NULL);
-    gtk_label_set_markup_with_mnemonic(GTK_LABEL(sdlg->priv->label), "_Search for:");
+    gtk_label_set_markup_with_mnemonic (GTK_LABEL (sdlg->priv->label), "_Search for:");
     gtk_table_attach(table, sdlg->priv->label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
 
     // Entry Box
@@ -433,7 +433,7 @@
         (GInstanceInitFunc) search_dlg_init,
       };
 
-      ttt_type = g_type_register_static (GTK_TYPE_DIALOG,  "GViewerSearchDlg",  &ttt_info, (GTypeFlags) 0);
+      ttt_type = g_type_register_static (GTK_TYPE_DIALOG, "GViewerSearchDlg", &ttt_info, (GTypeFlags) 0);
     }
 
   return ttt_type;



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