gnome-commander r1925 - in trunk/src: . intviewer



Author: epiotr
Date: Fri Aug  1 17:52:40 2008
New Revision: 1925
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1925&view=rev

Log:
Code cleanup

Modified:
   trunk/src/gnome-cmd-delete-dialog.cc
   trunk/src/gnome-cmd-dir.cc
   trunk/src/gnome-cmd-main-win.cc
   trunk/src/gnome-cmd-options-dialog.cc
   trunk/src/intviewer/datapresentation.cc
   trunk/src/intviewer/scroll-box.cc
   trunk/src/intviewer/search-dlg.cc
   trunk/src/intviewer/search-progress-dlg.cc
   trunk/src/intviewer/searcher.cc
   trunk/src/intviewer/text-render.cc
   trunk/src/intviewer/text-render.h
   trunk/src/intviewer/viewer-utils.cc
   trunk/src/intviewer/viewer-widget.cc
   trunk/src/intviewer/viewer-window.cc
   trunk/src/plugin_manager.cc
   trunk/src/plugin_manager.h

Modified: trunk/src/gnome-cmd-delete-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-delete-dialog.cc	(original)
+++ trunk/src/gnome-cmd-delete-dialog.cc	Fri Aug  1 17:52:40 2008
@@ -177,12 +177,9 @@
 
     if (uri_list)
     {
-        GnomeVFSXferOptions xferOptions = GNOME_VFS_XFER_DEFAULT;
-        GnomeVFSXferErrorMode xferErrorMode = GNOME_VFS_XFER_ERROR_MODE_QUERY;
-
         GnomeVFSResult result = gnome_vfs_xfer_delete_list (uri_list,
-                                                            xferErrorMode,
-                                                            xferOptions,
+                                                            GNOME_VFS_XFER_ERROR_MODE_QUERY,
+                                                            GNOME_VFS_XFER_DEFAULT,
                                                             (GnomeVFSXferProgressCallback) delete_progress_callback,
                                                             data);
 

Modified: trunk/src/gnome-cmd-dir.cc
==============================================================================
--- trunk/src/gnome-cmd-dir.cc	(original)
+++ trunk/src/gnome-cmd-dir.cc	Fri Aug  1 17:52:40 2008
@@ -445,7 +445,6 @@
 
         if (info && info->name)
         {
-            GnomeCmdFile *finfo;
             GnomeCmdCon *con = gnome_cmd_dir_get_connection (dir);
 
             if (strcmp (info->name, ".") == 0 || strcmp (info->name, "..") == 0)
@@ -470,11 +469,11 @@
                                                                      g_strdup ("x-directory/smb-server");
             }
 
-            finfo = info->type == GNOME_VFS_FILE_TYPE_DIRECTORY ? GNOME_CMD_FILE (gnome_cmd_dir_new_from_info (info, dir)) :
-                                                                  gnome_cmd_file_new (info, dir);
+            GnomeCmdFile *f = info->type == GNOME_VFS_FILE_TYPE_DIRECTORY ? GNOME_CMD_FILE (gnome_cmd_dir_new_from_info (info, dir)) :
+                                                                            gnome_cmd_file_new (info, dir);
 
-            gnome_cmd_file_ref (finfo);
-            file_list = g_list_append (file_list, finfo);
+            gnome_cmd_file_ref (f);
+            file_list = g_list_append (file_list, f);
         }
     }
 

Modified: trunk/src/gnome-cmd-main-win.cc
==============================================================================
--- trunk/src/gnome-cmd-main-win.cc	(original)
+++ trunk/src/gnome-cmd-main-win.cc	Fri Aug  1 17:52:40 2008
@@ -827,12 +827,9 @@
                         "button_press_event", GTK_SIGNAL_FUNC (on_left_fs_select), mw);
     gtk_signal_connect (GTK_OBJECT (GNOME_CMD_FILE_SELECTOR (mw->priv->file_selector[RIGHT])->list),
                         "button_press_event", GTK_SIGNAL_FUNC (on_right_fs_select), mw);
-    gtk_signal_connect (GTK_OBJECT (mw), "size-allocate",
-                        GTK_SIGNAL_FUNC (on_size_allocate), mw);
-    gtk_signal_connect (GTK_OBJECT (mw), "delete-event",
-                        GTK_SIGNAL_FUNC (on_delete_event), mw);
-    gtk_signal_connect (GTK_OBJECT (mw->priv->paned),
-                        "button_press_event", GTK_SIGNAL_FUNC (on_slide_button_press), mw);
+    gtk_signal_connect (GTK_OBJECT (mw), "size-allocate", GTK_SIGNAL_FUNC (on_size_allocate), mw);
+    gtk_signal_connect (GTK_OBJECT (mw), "delete-event", GTK_SIGNAL_FUNC (on_delete_event), mw);
+    gtk_signal_connect (GTK_OBJECT (mw->priv->paned), "button_press_event", GTK_SIGNAL_FUNC (on_slide_button_press), mw);
     g_signal_connect (mw, "window-state-event", GTK_SIGNAL_FUNC (on_window_state_event), NULL);
 
     gnome_cmd_file_selector_update_connections (gnome_cmd_main_win_get_fs (mw, LEFT));

Modified: trunk/src/gnome-cmd-options-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-options-dialog.cc	(original)
+++ trunk/src/gnome-cmd-options-dialog.cc	Fri Aug  1 17:52:40 2008
@@ -57,8 +57,7 @@
     gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
 
 
-    /* Right mouse button settings
-     */
+    // Right mouse button settings
     cat_box = create_vbox (parent, FALSE, 0);
     cat = create_category (parent, cat_box, _("Use right mouse button to"));
     gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, TRUE, 0);
@@ -73,8 +72,7 @@
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
 
 
-    /* FilterType settings
-     */
+    // FilterType settings
     cat_box = create_vbox (parent, FALSE, 0);
     cat = create_category (parent, cat_box, _("Match filenames using"));
     gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, TRUE, 0);
@@ -89,8 +87,7 @@
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
 
 
-    /* Sort options
-     */
+    // Sort options
     cat_box = create_vbox (parent, FALSE, 0);
     cat = create_category (parent, cat_box, _("Sorting options"));
     gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, TRUE, 0);
@@ -100,8 +97,7 @@
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gnome_cmd_data_get_case_sens_sort ());
 
 
-    /* Quick search options
-     */
+    // Quick search options
     cat_box = create_vbox (parent, FALSE, 0);
     cat = create_category (parent, cat_box, _("Quick search using"));
     gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, TRUE, 0);
@@ -114,8 +110,7 @@
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), gnome_cmd_data_get_alt_quick_search ());
 
 
-    /* Directory options
-     */
+    // Directory options
     table = create_table (parent, 2, 2);
     cat = create_category (parent, table, _("Directory options"));
     gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, TRUE, 0);
@@ -162,10 +157,8 @@
 
 static void on_date_format_update (GtkButton *button, GtkWidget *options_dialog)
 {
-    GtkWidget *format_entry, *test_label;
-
-    format_entry = lookup_widget (options_dialog, "date_format_entry");
-    test_label = lookup_widget (options_dialog, "date_format_test_label");
+    GtkWidget *format_entry = lookup_widget (options_dialog, "date_format_entry");
+    GtkWidget *test_label = lookup_widget (options_dialog, "date_format_test_label");
 
     const char *format = gtk_entry_get_text (GTK_ENTRY (format_entry));
 
@@ -189,9 +182,7 @@
     gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
 
 
-    /* Size display mode
-     *
-     */
+    // Size display mode
     cat_box = create_vbox (parent, FALSE, 0);
     cat = create_category (parent, cat_box, _("Size display mode"));
     gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, TRUE, 0);
@@ -219,9 +210,7 @@
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
 
 
-    /* Permission display mode
-     *
-     */
+    // Permission display mode
     cat_box = create_vbox (parent, FALSE, 0);
     cat = create_category (parent, cat_box, _("Permission display mode"));
     gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, TRUE, 0);
@@ -237,9 +226,7 @@
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
 
 
-    /* Date options
-     *
-     */
+    // Date options
     table = create_table (parent, 2, 3);
     cat = create_category (parent, table, _("Date format"));
     gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, FALSE, 0);
@@ -373,9 +360,7 @@
     GtkWidget *table, *label, *cpicker;
     GnomeCmdColorTheme *colors = gnome_cmd_data_get_custom_color_theme ();
 
-    /* The color pickers
-     *
-     */
+    // The color pickers
     cat_box = create_vbox (dlg, FALSE, 12);
     cat = create_category (dlg, cat_box, _("Colors"));
     gnome_cmd_dialog_add_category (GNOME_CMD_DIALOG (dlg), cat);
@@ -466,9 +451,7 @@
     gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
 
 
-    /* File panes
-     *
-     */
+    // File panes
     table = create_table (parent, 5, 2);
     gtk_table_set_homogeneous (GTK_TABLE (table), FALSE);
     cat = create_category (parent, table, _("File panes"));
@@ -529,10 +512,7 @@
     gtk_table_attach (GTK_TABLE (table), check, 0, 2, 5, 6, GTK_FILL, GTK_FILL, 0, 0);
 
 
-
-    /*
-     * MIME icon settings
-     */
+     // MIME icon settings
     table = create_table (parent, 4, 2);
     cat = create_category (parent, table, _("MIME icon settings"));
     gtk_object_set_data (GTK_OBJECT (parent), "mime_icon_settings_frame", cat);
@@ -567,8 +547,6 @@
 
 inline void store_layout_options (GnomeCmdOptionsDialog *dialog)
 {
-    const gchar *list_font;
-
     GtkWidget *iconsize_spin       = lookup_widget (GTK_WIDGET (dialog), "iconsize_spin");
     GtkWidget *iconquality_scale   = lookup_widget (GTK_WIDGET (dialog), "iconquality_scale");
     GtkWidget *theme_icondir_entry = lookup_widget (GTK_WIDGET (dialog), "theme_icondir_entry");
@@ -591,7 +569,7 @@
 
     gnome_cmd_data_set_use_ls_colors (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (use_ls)));
 
-    list_font = gnome_font_picker_get_font_name (GNOME_FONT_PICKER (list_font_picker));
+    const gchar *list_font = gnome_font_picker_get_font_name (GNOME_FONT_PICKER (list_font_picker));
     if (strcmp (list_font, "default") != 0)
         gnome_cmd_data_set_list_font (list_font);
 
@@ -1057,7 +1035,6 @@
 
 static void on_edit_app_dialog_ok (GtkButton *button, GtkWidget *dialog)
 {
-    GnomeCmdApp *app;
     gint target;
     gboolean handles_uris, handles_multiple, requires_terminal;
     gchar *name, *cmd, *icon_path, *pattern_string;
@@ -1070,7 +1047,7 @@
                            &handles_uris, &handles_multiple, &requires_terminal);
     if (!name || strlen (name) < 1) return;
 
-    app = (GnomeCmdApp *) gtk_object_get_data (GTK_OBJECT (options_dialog), "selected_app");
+    GnomeCmdApp *app = (GnomeCmdApp *) gtk_object_get_data (GTK_OBJECT (options_dialog), "selected_app");
     if (!app) return;
 
     gnome_cmd_app_set_name (app, name);
@@ -1096,10 +1073,9 @@
 static GtkWidget *create_app_dialog (GnomeCmdApp *app, GtkSignalFunc on_ok, GtkSignalFunc on_cancel, GtkWidget *options_dialog)
 {
     GtkWidget *vbox, *hbox, *table, *entry, *label, *cat, *radio, *check;
-    GtkWidget *dialog;
     const gchar *s = NULL;
 
-    dialog = gnome_cmd_dialog_new (NULL);
+    GtkWidget *dialog = gnome_cmd_dialog_new (NULL);
     gtk_widget_ref (dialog);
     gtk_object_set_data (GTK_OBJECT (dialog), "options_dialog", options_dialog);
 
@@ -1287,7 +1263,6 @@
 {
     GtkWidget *frame, *hbox, *vbox, *cat, *table;
     GtkWidget *entry, *button, *label, *clist, *bbox, *check;
-    GList *apps;
 
     frame = create_tabframe (parent);
     hbox = create_tabhbox (parent);
@@ -1370,7 +1345,7 @@
     gtk_container_add (GTK_CONTAINER (bbox), button);
 
     clist = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (parent), "app_clist");
-    for (apps = gnome_cmd_data_get_fav_apps (); apps; apps = apps->next)
+    for (GList *apps = gnome_cmd_data_get_fav_apps (); apps; apps = apps->next)
         add_app_to_list (GTK_CLIST (clist), (GnomeCmdApp *) apps->data);
 
     return frame;
@@ -1462,7 +1437,6 @@
 
 static void on_add_device_dialog_ok (GtkButton *button, GtkWidget *dialog)
 {
-    GnomeCmdConDevice *dev;
     gchar *alias, *device, *mountp, *icon_path;
 
     GtkWidget *options_dialog = lookup_widget (dialog, "options_dialog");
@@ -1471,7 +1445,7 @@
     get_device_dialog_values (dialog, &alias, &device, &mountp, &icon_path);
     if (!alias || strlen (alias) < 1) return;
 
-    dev = gnome_cmd_con_device_new (alias, device, mountp, icon_path);
+    GnomeCmdConDevice *dev = gnome_cmd_con_device_new (alias, device, mountp, icon_path);
     add_device_to_list (GTK_CLIST (clist), GNOME_CMD_CON_DEVICE (dev));
     gtk_widget_destroy (dialog);
 
@@ -1486,7 +1460,6 @@
 
 static void on_edit_device_dialog_ok (GtkButton *button, GtkWidget *dialog)
 {
-    GnomeCmdConDevice *dev;
     gchar *alias, *device, *mountp, *icon_path;
 
     GtkWidget *options_dialog = lookup_widget (dialog, "options_dialog");
@@ -1495,7 +1468,7 @@
     get_device_dialog_values (dialog, &alias, &device, &mountp, &icon_path);
     if (!alias || strlen (alias) < 1) return;
 
-    dev = GNOME_CMD_CON_DEVICE (gtk_object_get_data (GTK_OBJECT (options_dialog), "selected_device"));
+    GnomeCmdConDevice *dev = GNOME_CMD_CON_DEVICE (gtk_object_get_data (GTK_OBJECT (options_dialog), "selected_device"));
     if (!dev) return;
 
     update_device_in_list (GTK_CLIST (clist), dev, alias, device, mountp, icon_path);
@@ -1651,7 +1624,6 @@
 {
     GtkWidget *frame, *hbox, *vbox, *cat, *cat_box;
     GtkWidget *button, *clist, *bbox, *check;
-    GList *devices;
 
     frame = create_tabframe (parent);
     hbox = create_tabhbox (parent);
@@ -1711,7 +1683,7 @@
 
 
     clist = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (parent), "device_clist");
-    for (devices = gnome_cmd_con_list_get_all_dev (gnome_cmd_con_list_get ()); devices; devices = devices->next)
+    for (GList *devices = gnome_cmd_con_list_get_all_dev (gnome_cmd_con_list_get ()); devices; devices = devices->next)
         if (!gnome_cmd_con_device_get_autovol((GnomeCmdConDevice *) devices->data))
             add_device_to_list (GTK_CLIST (clist), GNOME_CMD_CON_DEVICE (devices->data));
 
@@ -1858,9 +1830,8 @@
         gtk_label_new (_("Devices")));
 
 
-    gnome_cmd_dialog_add_button (
-        GNOME_CMD_DIALOG (dialog), GNOME_STOCK_BUTTON_CLOSE,
-        GTK_SIGNAL_FUNC (on_options_dialog_close), dialog);
+    gnome_cmd_dialog_add_button (GNOME_CMD_DIALOG (dialog), GNOME_STOCK_BUTTON_CLOSE,
+                                 GTK_SIGNAL_FUNC (on_options_dialog_close), dialog);
 }
 
 

Modified: trunk/src/intviewer/datapresentation.cc
==============================================================================
--- trunk/src/intviewer/datapresentation.cc	(original)
+++ trunk/src/intviewer/datapresentation.cc	Fri Aug  1 17:52:40 2008
@@ -305,23 +305,19 @@
 
     while (TRUE)
     {
-        offset_type next_line_offset;
+        offset_type next_line_offset = wrap_get_eol (dp, offset);
 
-        next_line_offset = wrap_get_eol(dp, offset);
+        // this is the line we want: When the next line's offset is the current
+        // offset ('start' parameter), 'offset' will point to the previous
+        // displayable line
 
-        /*
-            this is the line we want:
-            When the next line's offset is the current offset ('start' parameter),
-            'offset' will point to the previous displayable line
-        */
         if (next_line_offset>=start)
             return offset;
 
         offset = next_line_offset;
     }
 
-    // should never get here
-    return 0;
+    return 0;  // should never get here
 }
 
 

Modified: trunk/src/intviewer/scroll-box.cc
==============================================================================
--- trunk/src/intviewer/scroll-box.cc	(original)
+++ trunk/src/intviewer/scroll-box.cc	Fri Aug  1 17:52:40 2008
@@ -132,7 +132,7 @@
     if (w->priv)
     {
         if (w->priv->client)
-            g_object_unref(G_OBJECT (w->priv->client));
+            g_object_unref (G_OBJECT (w->priv->client));
         w->priv->client=NULL;
 
         g_free(w->priv);
@@ -174,12 +174,12 @@
     if (obj->priv->client)
     {
         if (obj->priv->client)
-            g_object_unref(G_OBJECT (obj->priv->client));
+            g_object_unref (G_OBJECT (obj->priv->client));
         obj->priv->client=NULL;
     }
 
-    g_object_ref(G_OBJECT (client));
-    gtk_widget_show(client);
+    g_object_ref (G_OBJECT (client));
+    gtk_widget_show (client);
     obj->priv->client = client;
     gtk_table_attach (GTK_TABLE (obj), client , 0, 1, 0, 1,
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
@@ -219,7 +219,7 @@
     g_return_val_if_fail (obj != NULL, NULL);
     g_return_val_if_fail (IS_SCROLL_BOX(obj), NULL);
 
-    return gtk_range_get_adjustment(GTK_RANGE(obj->priv->hscroll));
+    return gtk_range_get_adjustment (GTK_RANGE(obj->priv->hscroll));
 }
 
 
@@ -228,5 +228,5 @@
     g_return_val_if_fail (obj != NULL, NULL);
     g_return_val_if_fail (IS_SCROLL_BOX(obj), NULL);
 
-    return gtk_range_get_adjustment(GTK_RANGE(obj->priv->vscroll));
+    return gtk_range_get_adjustment (GTK_RANGE(obj->priv->vscroll));
 }

Modified: trunk/src/intviewer/search-dlg.cc
==============================================================================
--- trunk/src/intviewer/search-dlg.cc	(original)
+++ trunk/src/intviewer/search-dlg.cc	Fri Aug  1 17:52:40 2008
@@ -158,7 +158,7 @@
 
 static void set_text_mode (GViewerSearchDlg *sdlg)
 {
-    gtk_widget_grab_focus(sdlg->priv->entry);
+    gtk_widget_grab_focus (sdlg->priv->entry);
     sdlg->priv->searchmode = SEARCH_MODE_TEXT;
     gtk_widget_set_sensitive(sdlg->priv->case_sensitive_checkbox, TRUE);
 
@@ -175,7 +175,7 @@
             gtk_combo_box_prepend_text (GTK_COMBO_BOX (sdlg->priv->entry), (gchar *) strings->data);
 #endif
 
-    gtk_widget_grab_focus(sdlg->priv->entry);
+    gtk_widget_grab_focus (sdlg->priv->entry);
 
     sdlg->priv->searchmode = SEARCH_MODE_HEX;
 
@@ -353,7 +353,7 @@
     gtk_table_attach(table, sdlg->priv->case_sensitive_checkbox, 2, 3, 1, 2, GtkAttachOptions(GTK_EXPAND|GTK_FILL), GTK_FILL, 0, 0);
 
     gtk_widget_show_all(sdlg->priv->table);
-    gtk_widget_show(GTK_WIDGET (dlg));
+    gtk_widget_show (GTK_WIDGET (dlg));
 
     // Restore the previously saved state (loaded with "load_search_dlg_state")
     if (sdlg->priv->searchmode==SEARCH_MODE_HEX)

Modified: trunk/src/intviewer/search-progress-dlg.cc
==============================================================================
--- trunk/src/intviewer/search-progress-dlg.cc	(original)
+++ trunk/src/intviewer/search-progress-dlg.cc	Fri Aug  1 17:52:40 2008
@@ -153,13 +153,13 @@
 
     GViewerSearchProgressDlg *w = GVIEWER_SEARCH_PROGRESS_DLG(data);
 
-    progress = g_atomic_int_get(w->priv->progress_value);
+    progress = g_atomic_int_get (w->priv->progress_value);
 
     g_snprintf(text, sizeof(text), "%3.1f%%", progress/10.0);
     gtk_progress_bar_set_text(GTK_PROGRESS_BAR(w->priv->progressbar), text);
     gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(w->priv->progressbar), progress/1000.0);
 
-    if (g_atomic_int_get(w->priv->completed_indicator)!=0)
+    if (g_atomic_int_get (w->priv->completed_indicator)!=0)
     {
         gtk_dialog_response(GTK_DIALOG(w), GTK_RESPONSE_CANCEL);
         return FALSE;
@@ -192,7 +192,7 @@
 
     gint timeout_source_id = g_timeout_add (300, search_progress_dlg_timeout, (gpointer) dlg);
 
-    dprogress = g_atomic_int_get(dlg->priv->progress_value);
+    dprogress = g_atomic_int_get (dlg->priv->progress_value);
     g_snprintf(text, sizeof(text), "%3.1f%%", dprogress/10.0);
     gtk_progress_bar_set_text(GTK_PROGRESS_BAR(dlg->priv->progressbar), text);
     gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(dlg->priv->progressbar), dprogress/1000.0);

Modified: trunk/src/intviewer/searcher.cc
==============================================================================
--- trunk/src/intviewer/searcher.cc	(original)
+++ trunk/src/intviewer/searcher.cc	Fri Aug  1 17:52:40 2008
@@ -224,11 +224,11 @@
 
 
 void g_viewer_searcher_setup_new_text_search(GViewerSearcher *srchr,
-                             GVInputModesData *imd,
-                             offset_type start_offset,
-                             offset_type max_offset,
-                             const gchar *text,
-                             gboolean case_sensitive)
+                                             GVInputModesData *imd,
+                                             offset_type start_offset,
+                                             offset_type max_offset,
+                                             const gchar *text,
+                                             gboolean case_sensitive)
 {
     g_return_if_fail (srchr!=NULL);
     g_return_if_fail (srchr->priv!=NULL);
@@ -261,10 +261,10 @@
 
 
 void g_viewer_searcher_setup_new_hex_search(GViewerSearcher *srchr,
-                             GVInputModesData *imd,
-                             offset_type start_offset,
-                             offset_type max_offset,
-                             const guint8 *buffer, guint buflen)
+                                            GVInputModesData *imd,
+                                            offset_type start_offset,
+                                            offset_type max_offset,
+                                            const guint8 *buffer, guint buflen)
 {
     g_return_if_fail (srchr!=NULL);
     g_return_if_fail (srchr->priv!=NULL);
@@ -305,14 +305,14 @@
 
     /*This is very bad... (besides being not atomic at all)
        TODO: replace with a gmutex */
-    gint oldval = g_atomic_int_get(&src->priv->progress_value);
-    g_atomic_int_compare_and_exchange(&src->priv->progress_value, oldval, (gint)d);
+    gint oldval = g_atomic_int_get (&src->priv->progress_value);
+    g_atomic_int_compare_and_exchange (&src->priv->progress_value, oldval, (gint)d);
 }
 
 
 gboolean check_abort_request (GViewerSearcher *src)
 {
-    return g_atomic_int_get(&src->priv->abort_indicator)!=0;
+    return g_atomic_int_get (&src->priv->abort_indicator)!=0;
 }
 
 
@@ -321,16 +321,13 @@
     offset_type m, n, j;
     int i;
     gboolean found = FALSE;
-    int update_counter;
     guint8 value;
-    GViewerBMByteData *data;
-
-    data = src->priv->b_data;
+    GViewerBMByteData *data = src->priv->b_data;
 
     m = data->pattern_len;
     n = src->priv->max_offset;
     j = src->priv->start_offset;
-    update_counter = src->priv->update_interval;
+    int update_counter = src->priv->update_interval;
 
     while (j <= n - m)
     {
@@ -428,16 +425,13 @@
     offset_type m, n, j, t, delta;
     int i;
     gboolean found = FALSE;
-    int update_counter;
     char_type value;
-    GViewerBMChartypeData *data;
-
-    data = src->priv->ct_data;
+    GViewerBMChartypeData *data = src->priv->ct_data;
 
     m = data->pattern_len;
     n = src->priv->max_offset;
     j = src->priv->start_offset;
-    update_counter = src->priv->update_interval;
+    int update_counter = src->priv->update_interval;
 
     while (j <= n - m)
     {
@@ -552,7 +546,7 @@
 }
 
 
-gpointer search_func(gpointer user_data)
+gpointer search_func (gpointer user_data)
 {
     g_return_val_if_fail (user_data!=NULL, NULL);
     g_return_val_if_fail (G_IS_VIEWERSEARCHER(user_data), NULL);

Modified: trunk/src/intviewer/text-render.cc
==============================================================================
--- trunk/src/intviewer/text-render.cc	(original)
+++ trunk/src/intviewer/text-render.cc	Fri Aug  1 17:52:40 2008
@@ -921,7 +921,7 @@
     gv_set_fixed_count(w->priv->dp, w->priv->fixed_limit);
     gv_set_tab_size(w->priv->dp, w->priv->tab_size);
 
-    text_render_set_display_mode(w, TR_DISP_MODE_TEXT);
+    text_render_set_display_mode (w, TR_DISP_MODE_TEXT);
 
     text_render_update_adjustments_limits(w);
 }
@@ -1244,7 +1244,7 @@
 }
 
 
-void  text_render_set_display_mode(TextRender *w, TEXTDISPLAYMODE mode)
+void  text_render_set_display_mode (TextRender *w, TEXTDISPLAYMODE mode)
 {
     g_return_if_fail (w!=NULL);
     g_return_if_fail (IS_TEXT_RENDER(w));

Modified: trunk/src/intviewer/text-render.h
==============================================================================
--- trunk/src/intviewer/text-render.h	(original)
+++ trunk/src/intviewer/text-render.h	Fri Aug  1 17:52:40 2008
@@ -79,7 +79,7 @@
 
 void           text_render_notify_status_changed(TextRender *w);
 
-void           text_render_set_display_mode(TextRender *w, TEXTDISPLAYMODE mode);
+void           text_render_set_display_mode (TextRender *w, TEXTDISPLAYMODE mode);
 TEXTDISPLAYMODE text_render_get_display_mode(TextRender *w);
 
 ViewerFileOps      *text_render_get_file_ops(TextRender *w);

Modified: trunk/src/intviewer/viewer-utils.cc
==============================================================================
--- trunk/src/intviewer/viewer-utils.cc	(original)
+++ trunk/src/intviewer/viewer-utils.cc	Fri Aug  1 17:52:40 2008
@@ -63,9 +63,7 @@
 
 void gviewer_free_string_history (GList *strings)
 {
-    GList *temp;
-
-    for (temp = strings; temp; temp = temp->next)
+    for (GList *temp = strings; temp; temp = temp->next)
         if (temp->data!=NULL)
         {
             g_free (temp->data);

Modified: trunk/src/intviewer/viewer-widget.cc
==============================================================================
--- trunk/src/intviewer/viewer-widget.cc	(original)
+++ trunk/src/intviewer/viewer-widget.cc	Fri Aug  1 17:52:40 2008
@@ -53,17 +53,17 @@
 /* Class Private Data */
 struct _GViewerPrivate
 {
-    GtkWidget           *tscrollbox;
-    TextRender          *textr;
+    GtkWidget         *tscrollbox;
+    TextRender        *textr;
 
-    GtkWidget           *iscrollbox;
-    ImageRender         *imgr;
-    gboolean            img_initialized;
+    GtkWidget         *iscrollbox;
+    ImageRender       *imgr;
+    gboolean          img_initialized;
 
-    GtkWidget           *last_client;
+    GtkWidget         *last_client;
 
-    gchar               *filename;
-    VIEWERDISPLAYMODE   dispmode;
+    gchar             *filename;
+    VIEWERDISPLAYMODE dispmode;
 
 };
 
@@ -166,7 +166,7 @@
     text_render_attach_external_v_range(w->priv->textr, scroll_box_get_v_range(SCROLL_BOX(w->priv->tscrollbox)));
     scroll_box_set_client (SCROLL_BOX(w->priv->tscrollbox), GTK_WIDGET (w->priv->textr));
     gtk_widget_show (GTK_WIDGET (w->priv->textr));
-    gtk_widget_show(w->priv->tscrollbox);
+    gtk_widget_show (w->priv->tscrollbox);
     g_object_ref (G_OBJECT (w->priv->tscrollbox));
 
     w->priv->imgr  = (ImageRender *) image_render_new();
@@ -255,8 +255,8 @@
 
     if (w->priv)
     {
-        g_object_unref(G_OBJECT (w->priv->iscrollbox));
-        g_object_unref(G_OBJECT (w->priv->tscrollbox));
+        g_object_unref (G_OBJECT (w->priv->iscrollbox));
+        g_object_unref (G_OBJECT (w->priv->tscrollbox));
 
         g_free (w->priv);
         w->priv = NULL;
@@ -304,7 +304,7 @@
 
     obj->priv->dispmode = DISP_MODE_TEXT_FIXED;
 
-    if (obj->priv->textr==NULL)
+    if (!obj->priv->textr)
         return;
 
     ViewerFileOps *fops = text_render_get_file_ops(obj->priv->textr);
@@ -341,17 +341,17 @@
     {
         case DISP_MODE_TEXT_FIXED:
             client = obj->priv->tscrollbox;
-            text_render_set_display_mode(obj->priv->textr, TR_DISP_MODE_TEXT);
+            text_render_set_display_mode (obj->priv->textr, TR_DISP_MODE_TEXT);
             break;
 
         case DISP_MODE_BINARY:
             client = obj->priv->tscrollbox;
-            text_render_set_display_mode(obj->priv->textr, TR_DISP_MODE_BINARY);
+            text_render_set_display_mode (obj->priv->textr, TR_DISP_MODE_BINARY);
             break;
 
         case DISP_MODE_HEXDUMP:
             client = obj->priv->tscrollbox;
-            text_render_set_display_mode(obj->priv->textr, TR_DISP_MODE_HEXDUMP);
+            text_render_set_display_mode (obj->priv->textr, TR_DISP_MODE_HEXDUMP);
             break;
 
         case DISP_MODE_IMAGE:
@@ -362,9 +362,9 @@
     if (client != obj->priv->last_client)
     {
         if (obj->priv->last_client)
-            gtk_container_remove(GTK_CONTAINER(obj), obj->priv->last_client);
+            gtk_container_remove (GTK_CONTAINER(obj), obj->priv->last_client);
 
-        gtk_widget_grab_focus(GTK_WIDGET (client));
+        gtk_widget_grab_focus (GTK_WIDGET (client));
         gtk_table_attach (GTK_TABLE (obj), client , 0, 1, 0, 1,
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
@@ -382,7 +382,7 @@
                 break;
         }
 
-        gtk_widget_show(client);
+        gtk_widget_show (client);
         obj->priv->last_client = client;
     }
 }

Modified: trunk/src/intviewer/viewer-window.cc
==============================================================================
--- trunk/src/intviewer/viewer-window.cc	(original)
+++ trunk/src/intviewer/viewer-window.cc	Fri Aug  1 17:52:40 2008
@@ -302,11 +302,11 @@
     gtk_box_pack_start (GTK_BOX (w->priv->vbox), w->priv->menubar, FALSE, FALSE, 0);
 
     w->priv->viewer = (GViewer *) gviewer_new();
-    g_object_ref(G_OBJECT (w->priv->viewer));
-    gtk_widget_show(GTK_WIDGET (w->priv->viewer));
+    g_object_ref (G_OBJECT (w->priv->viewer));
+    gtk_widget_show (GTK_WIDGET (w->priv->viewer));
     gtk_box_pack_start (GTK_BOX (w->priv->vbox), GTK_WIDGET (w->priv->viewer), TRUE, TRUE, 0);
     w->priv->exif_viewer = (GViewer *) gviewer_new();
-    g_object_ref(G_OBJECT (w->priv->exif_viewer));
+    g_object_ref (G_OBJECT (w->priv->exif_viewer));
 
     g_signal_connect(G_OBJECT (w->priv->viewer), "status_line_changed", G_CALLBACK (gviewer_window_status_line_changed), (gpointer) w);
 
@@ -317,7 +317,7 @@
 
     w->priv->statusbar_ctx_id  = gtk_statusbar_get_context_id(GTK_STATUSBAR(w->priv->statusbar), "info");
 
-    gtk_widget_grab_focus(GTK_WIDGET (w->priv->viewer));
+    gtk_widget_grab_focus (GTK_WIDGET (w->priv->viewer));
 
     gtk_container_add(GTK_CONTAINER (w), w->priv->vbox);
 
@@ -435,8 +435,8 @@
 
     if (w->priv)
     {
-        g_object_unref(G_OBJECT (w->priv->viewer));
-        g_object_unref(G_OBJECT (w->priv->exif_viewer));
+        g_object_unref (G_OBJECT (w->priv->viewer));
+        g_object_unref (G_OBJECT (w->priv->exif_viewer));
 
 #ifdef EXTERNAL_TOOLS
         g_hash_table_destroy(w->priv->external_tools);
@@ -1019,7 +1019,7 @@
         gviewer_window_hide_exif_viewer(obj);
 
     gviewer_set_display_mode(obj->priv->viewer, dispmode);
-    gtk_widget_grab_focus(GTK_WIDGET (obj->priv->viewer));
+    gtk_widget_grab_focus (GTK_WIDGET (obj->priv->viewer));
 
     gtk_widget_draw(GTK_WIDGET (obj->priv->viewer), NULL);
 }
@@ -1152,7 +1152,7 @@
     // If a previous search is active, delete it
     if (obj->priv->srchr!=NULL)
     {
-        g_object_unref(obj->priv->srchr);
+        g_object_unref (obj->priv->srchr);
         obj->priv->srchr = NULL;
 
         g_free (obj->priv->search_pattern);
@@ -1486,7 +1486,7 @@
 
     g_return_if_fail (obj->priv->exit_data_fd!=-1);
     gviewer_load_filedesc(obj->priv->exif_viewer, obj->priv->exit_data_fd);
-    gtk_widget_show(GTK_WIDGET (obj->priv->exif_viewer));
+    gtk_widget_show (GTK_WIDGET (obj->priv->exif_viewer));
 
     obj->priv->exif_active = TRUE;
     gtk_box_pack_start (GTK_BOX (obj->priv->vbox), GTK_WIDGET (obj->priv->exif_viewer), TRUE, TRUE, 0);
@@ -1506,8 +1506,8 @@
         return;
 
     obj->priv->exif_active = FALSE;
-    gtk_container_remove(GTK_CONTAINER (obj->priv->vbox), GTK_WIDGET (obj->priv->exif_viewer));
-    gtk_widget_grab_focus(GTK_WIDGET (obj->priv->viewer));
+    gtk_container_remove (GTK_CONTAINER (obj->priv->vbox), GTK_WIDGET (obj->priv->exif_viewer));
+    gtk_widget_grab_focus (GTK_WIDGET (obj->priv->viewer));
 
     obj->priv->active_viewer = obj->priv->viewer;
 }

Modified: trunk/src/plugin_manager.cc
==============================================================================
--- trunk/src/plugin_manager.cc	(original)
+++ trunk/src/plugin_manager.cc	Fri Aug  1 17:52:40 2008
@@ -43,8 +43,7 @@
 static GdkBitmap *blank_mask = NULL;
 
 
-static void
-load_plugin (PluginData *data)
+static void load_plugin (PluginData *data)
 {
     GModule *module = g_module_open (data->fpath, G_MODULE_BIND_LAZY);
     PluginInfoFunc info_func;
@@ -109,8 +108,7 @@
 }
 
 
-static void
-activate_plugin (PluginData *data)
+static void activate_plugin (PluginData *data)
 {
     if (data->active)
         return;
@@ -130,8 +128,7 @@
 }
 
 
-static void
-inactivate_plugin (PluginData *data)
+static void inactivate_plugin (PluginData *data)
 {
     if (!data->active)
         return;
@@ -142,8 +139,7 @@
 }
 
 
-static void
-scan_plugins_in_dir (const gchar *dpath)
+static void scan_plugins_in_dir (const gchar *dpath)
 {
     DIR *dir = opendir (dpath);
     char prev_dir[256];
@@ -264,15 +260,13 @@
 }
 
 
-PluginData *
-get_selected_plugin (GtkCList *list)
+PluginData *get_selected_plugin (GtkCList *list)
 {
     return (PluginData *) gtk_clist_get_row_data (list, list->focus_row);
 }
 
 
-static void
-update_plugin_list (GtkCList *list, GtkWidget *dialog)
+static void update_plugin_list (GtkCList *list, GtkWidget *dialog)
 {
     gint old_focus = list->focus_row;
     gint row = 0;
@@ -299,7 +293,6 @@
         else
             gtk_clist_set_pixmap (list, row, 0, blank_pixmap, blank_mask);
 
-
         gtk_clist_set_row_data (list, row, data);
 
         row++;
@@ -309,8 +302,7 @@
 }
 
 
-static void
-do_toggle (GtkWidget *dialog)
+inline void do_toggle (GtkWidget *dialog)
 {
     GtkCList *list = GTK_CLIST (lookup_widget (dialog, "avail_list"));
     PluginData *data = get_selected_plugin (list);
@@ -364,15 +356,13 @@
 }
 
 
-static void
-on_toggle (GtkButton *button, GtkWidget *dialog)
+static void on_toggle (GtkButton *button, GtkWidget *dialog)
 {
     do_toggle (dialog);
 }
 
 
-static void
-on_configure (GtkButton *button, GtkWidget *dialog)
+static void on_configure (GtkButton *button, GtkWidget *dialog)
 {
     GtkCList *list = GTK_CLIST (lookup_widget (dialog, "avail_list"));
     PluginData *data = get_selected_plugin (list);
@@ -384,8 +374,7 @@
 }
 
 
-static void
-on_about (GtkButton *button, GtkWidget *dialog)
+static void on_about (GtkButton *button, GtkWidget *dialog)
 {
     GtkCList *list = GTK_CLIST (lookup_widget (dialog, "avail_list"));
     PluginData *data = get_selected_plugin (list);
@@ -399,8 +388,7 @@
 }
 
 
-static void
-on_close (GtkButton *button, GtkWidget *dialog)
+static void on_close (GtkButton *button, GtkWidget *dialog)
 {
     gtk_widget_destroy (dialog);
 }

Modified: trunk/src/plugin_manager.h
==============================================================================
--- trunk/src/plugin_manager.h	(original)
+++ trunk/src/plugin_manager.h	Fri Aug  1 17:52:40 2008
@@ -22,7 +22,7 @@
 
 #include <gmodule.h>
 
-typedef struct
+struct PluginData
 {
     gboolean active;
     gboolean loaded;
@@ -33,7 +33,7 @@
     PluginInfo *info;
     GtkWidget *menu;
     GModule *module;
-} PluginData;
+};
 
 
 void plugin_manager_init (void);



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