gnome-commander r1789 - branches/gcmd-1-3/src



Author: epiotr
Date: Wed May 28 17:09:42 2008
New Revision: 1789
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1789&view=rev

Log:
Code cleanup

Modified:
   branches/gcmd-1-3/src/gnome-cmd-make-copy-dialog.cc
   branches/gcmd-1-3/src/gnome-cmd-make-copy-dialog.h
   branches/gcmd-1-3/src/gnome-cmd-prepare-copy-dialog.cc
   branches/gcmd-1-3/src/gnome-cmd-user-actions.cc

Modified: branches/gcmd-1-3/src/gnome-cmd-make-copy-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-make-copy-dialog.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-make-copy-dialog.cc	Wed May 28 17:09:42 2008
@@ -37,12 +37,9 @@
 static GnomeCmdStringDialogClass *parent_class = NULL;
 
 
-static void
-copy_file (GnomeCmdFile *finfo, GnomeCmdDir *dir, const gchar *filename)
+inline void copy_file (GnomeCmdFile *finfo, GnomeCmdDir *dir, const gchar *filename)
 {
-    GList *src_files;
-
-    src_files = g_list_append (NULL, finfo);
+    GList *src_files = g_list_append (NULL, finfo);
 
     gnome_cmd_xfer_start (src_files,
                           dir,
@@ -55,17 +52,14 @@
 }
 
 
-static gboolean
-on_ok (GnomeCmdStringDialog *string_dialog,
-       const gchar **values,
-       GnomeCmdMakeCopyDialog *dialog)
+static gboolean on_ok (GnomeCmdStringDialog *string_dialog, const gchar **values, GnomeCmdMakeCopyDialog *dialog)
 {
-    const gchar *filename = values[0];
-
     g_return_val_if_fail (dialog, TRUE);
     g_return_val_if_fail (dialog->priv, TRUE);
     g_return_val_if_fail (dialog->priv->finfo, TRUE);
 
+    const gchar *filename = values[0];
+
     if (!filename)
     {
         gnome_cmd_string_dialog_set_error_desc (string_dialog, g_strdup (_("No filename entered")));
@@ -78,8 +72,7 @@
 }
 
 
-static void
-on_cancel (GtkWidget *widget, GnomeCmdMakeCopyDialog *dialog)
+static void on_cancel (GtkWidget *widget, GnomeCmdMakeCopyDialog *dialog)
 {
     gnome_cmd_file_unref (dialog->priv->finfo);
 }
@@ -89,8 +82,7 @@
  * Gtk class implementation
  *******************************/
 
-static void
-destroy (GtkObject *object)
+static void destroy (GtkObject *object)
 {
     GnomeCmdMakeCopyDialog *dialog = GNOME_CMD_MAKE_COPY_DIALOG (object);
 
@@ -101,16 +93,14 @@
 }
 
 
-static void
-map (GtkWidget *widget)
+static void map (GtkWidget *widget)
 {
     if (GTK_WIDGET_CLASS (parent_class)->map != NULL)
         GTK_WIDGET_CLASS (parent_class)->map (widget);
 }
 
 
-static void
-class_init (GnomeCmdMakeCopyDialogClass *klass)
+static void class_init (GnomeCmdMakeCopyDialogClass *klass)
 {
     GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
     GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
@@ -121,8 +111,7 @@
 }
 
 
-static void
-init (GnomeCmdMakeCopyDialog *dialog)
+static void init (GnomeCmdMakeCopyDialog *dialog)
 {
     dialog->priv = g_new0 (GnomeCmdMakeCopyDialogPrivate, 1);
 }
@@ -132,13 +121,12 @@
  * Public functions
  ***********************************/
 
-GtkWidget*
-gnome_cmd_make_copy_dialog_new (GnomeCmdFile *finfo, GnomeCmdDir *dir)
+GtkWidget *gnome_cmd_make_copy_dialog_new (GnomeCmdFile *finfo, GnomeCmdDir *dir)
 {
-    const gchar *labels[] = {""};
-
     g_return_val_if_fail (finfo != NULL, NULL);
 
+    const gchar *labels[] = {""};
+
     GnomeCmdMakeCopyDialog *dialog = (GnomeCmdMakeCopyDialog *) gtk_type_new (gnome_cmd_make_copy_dialog_get_type ());
 
     dialog->priv->finfo = finfo;
@@ -152,14 +140,13 @@
 
     gnome_cmd_dialog_add_category (GNOME_CMD_DIALOG (dialog), msg_label);
 
-    gnome_cmd_string_dialog_setup_with_cancel (
-        GNOME_CMD_STRING_DIALOG (dialog),
-        _("Copy File"),
-        labels,
-        1,
-        (GnomeCmdStringDialogCallback)on_ok,
-        GTK_SIGNAL_FUNC (on_cancel),
-        dialog);
+    gnome_cmd_string_dialog_setup_with_cancel (GNOME_CMD_STRING_DIALOG (dialog),
+                                               _("Copy File"),
+                                               labels,
+                                               1,
+                                               (GnomeCmdStringDialogCallback) on_ok,
+                                               GTK_SIGNAL_FUNC (on_cancel),
+                                               dialog);
 
     gnome_cmd_string_dialog_set_value (GNOME_CMD_STRING_DIALOG (dialog), 0, finfo->info->name);
 
@@ -167,8 +154,7 @@
 }
 
 
-GtkType
-gnome_cmd_make_copy_dialog_get_type         (void)
+GtkType gnome_cmd_make_copy_dialog_get_type (void)
 {
     static GtkType dlg_type = 0;
 

Modified: branches/gcmd-1-3/src/gnome-cmd-make-copy-dialog.h
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-make-copy-dialog.h	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-make-copy-dialog.h	Wed May 28 17:09:42 2008
@@ -48,10 +48,8 @@
 };
 
 
-GtkWidget*
-gnome_cmd_make_copy_dialog_new (GnomeCmdFile *finfo, GnomeCmdDir *dir);
+GtkWidget *gnome_cmd_make_copy_dialog_new (GnomeCmdFile *finfo, GnomeCmdDir *dir);
 
-GtkType
-gnome_cmd_make_copy_dialog_get_type (void);
+GtkType gnome_cmd_make_copy_dialog_get_type (void);
 
 #endif // __GNOME_CMD_MAKE_COPY_DIALOG_H__

Modified: branches/gcmd-1-3/src/gnome-cmd-prepare-copy-dialog.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-prepare-copy-dialog.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-prepare-copy-dialog.cc	Wed May 28 17:09:42 2008
@@ -117,7 +117,7 @@
 
     data->follow_links = gtk_check_button_new_with_label (_("Follow Links"));
     gtk_widget_ref (data->follow_links);
-    gtk_object_set_data_full (GTK_OBJECT (data->dialog), "follow_links", data->follow_links, (GtkDestroyNotify)gtk_widget_unref);
+    gtk_object_set_data_full (GTK_OBJECT (data->dialog), "follow_links", data->follow_links, (GtkDestroyNotify) gtk_widget_unref);
     gtk_widget_show (data->follow_links);
     gtk_box_pack_start (GTK_BOX (data->dialog->right_vbox), data->follow_links, FALSE, FALSE, 0);
 
@@ -136,6 +136,7 @@
     g_free (text);
 
     g_return_if_fail (data->dialog->src_files != NULL);
+
     num_files = g_list_length (data->dialog->src_files);
     finfo = (GnomeCmdFile *) data->dialog->src_files->data;
 
@@ -153,7 +154,7 @@
     gtk_label_set_markup (GTK_LABEL (label), text);
     g_free (text);
 
-    g_free  (dest_dir_frame_msg);
+    g_free (dest_dir_frame_msg);
 
 
     /*

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	Wed May 28 17:09:42 2008
@@ -586,8 +586,6 @@
 /************** File Menu **************/
 void file_copy (GtkMenuItem *menuitem, gpointer not_used)
 {
-    if (!main_win)  return;
-
     GnomeCmdFileSelector *src_fs = get_fs (ACTIVE);
     GnomeCmdFileSelector *dest_fs = get_fs (INACTIVE);
 
@@ -598,8 +596,6 @@
 
 void file_move (GtkMenuItem *menuitem, gpointer not_used)
 {
-    if (!main_win)  return;
-
     GnomeCmdFileSelector *src_fs = get_fs (ACTIVE);
     GnomeCmdFileSelector *dest_fs = get_fs (INACTIVE);
 



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