gnome-commander r1679 - in trunk: . src



Author: epiotr
Date: Tue Apr  1 16:00:49 2008
New Revision: 1679
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1679&view=rev

Log:
Code cleanup

Modified:
   trunk/ChangeLog
   trunk/src/gnome-cmd-chmod-component.cc
   trunk/src/gnome-cmd-chmod-component.h
   trunk/src/gnome-cmd-chmod-dialog.cc
   trunk/src/gnome-cmd-chmod-dialog.h
   trunk/src/gnome-cmd-file-list.cc

Modified: trunk/src/gnome-cmd-chmod-component.cc
==============================================================================
--- trunk/src/gnome-cmd-chmod-component.cc	(original)
+++ trunk/src/gnome-cmd-chmod-component.cc	Tue Apr  1 16:00:49 2008
@@ -46,8 +46,7 @@
 static guint chmod_component_signals[LAST_SIGNAL] = { 0 };
 
 
-static void
-on_perms_changed (GnomeCmdChmodComponent *comp)
+static void on_perms_changed (GnomeCmdChmodComponent *comp)
 {
     static gchar text_view[10];
     static gchar number_view[4];
@@ -61,8 +60,7 @@
 }
 
 
-static void
-on_check_toggled (GtkToggleButton *togglebutton, GnomeCmdChmodComponent *component)
+static void on_check_toggled (GtkToggleButton *togglebutton, GnomeCmdChmodComponent *component)
 {
     gtk_signal_emit (GTK_OBJECT (component), chmod_component_signals[PERMS_CHANGED]);
 }
@@ -72,8 +70,7 @@
  * Gtk class implementation
  *******************************/
 
-static void
-destroy (GtkObject *object)
+static void destroy (GtkObject *object)
 {
     GnomeCmdChmodComponent *comp = GNOME_CMD_CHMOD_COMPONENT (object);
 
@@ -84,16 +81,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 (GnomeCmdChmodComponentClass *klass)
+static void class_init (GnomeCmdChmodComponentClass *klass)
 {
     GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
     GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
@@ -115,8 +110,7 @@
 }
 
 
-static void
-init (GnomeCmdChmodComponent *comp)
+static void init (GnomeCmdChmodComponent *comp)
 {
     GtkWidget *label;
     GtkWidget *hsep;
@@ -140,8 +134,7 @@
 
         for (gint x=0; x<3; x++)
         {
-            comp->priv->check_boxes[y][x] =
-                create_check (GTK_WIDGET (comp), check_text[x], "check");
+            comp->priv->check_boxes[y][x] = create_check (GTK_WIDGET (comp), check_text[x], "check");
             gtk_signal_connect (GTK_OBJECT (comp->priv->check_boxes[y][x]), "toggled",
                                 GTK_SIGNAL_FUNC (on_check_toggled), comp);
             table_add (GTK_WIDGET (table), comp->priv->check_boxes[y][x], x+1, y, GTK_FILL);
@@ -174,8 +167,7 @@
  * Public functions
  ***********************************/
 
-GtkWidget*
-gnome_cmd_chmod_component_new (GnomeVFSFilePermissions perms)
+GtkWidget *gnome_cmd_chmod_component_new (GnomeVFSFilePermissions perms)
 {
     GnomeCmdChmodComponent *comp = (GnomeCmdChmodComponent *) gtk_type_new (gnome_cmd_chmod_component_get_type ());
 
@@ -185,8 +177,7 @@
 }
 
 
-GtkType
-gnome_cmd_chmod_component_get_type (void)
+GtkType gnome_cmd_chmod_component_get_type (void)
 {
     static GtkType type = 0;
 

Modified: trunk/src/gnome-cmd-chmod-component.h
==============================================================================
--- trunk/src/gnome-cmd-chmod-component.h	(original)
+++ trunk/src/gnome-cmd-chmod-component.h	Tue Apr  1 16:00:49 2008
@@ -51,17 +51,11 @@
 };
 
 
-GtkWidget*
-gnome_cmd_chmod_component_new (GnomeVFSFilePermissions perms);
+GtkWidget *gnome_cmd_chmod_component_new (GnomeVFSFilePermissions perms);
 
-GtkType
-gnome_cmd_chmod_component_get_type (void);
+GtkType gnome_cmd_chmod_component_get_type (void);
 
-GnomeVFSFilePermissions
-gnome_cmd_chmod_component_get_perms (GnomeCmdChmodComponent *component);
-
-void
-gnome_cmd_chmod_component_set_perms (GnomeCmdChmodComponent *component,
-                                     GnomeVFSFilePermissions perms);
+GnomeVFSFilePermissions gnome_cmd_chmod_component_get_perms (GnomeCmdChmodComponent *component);
+void gnome_cmd_chmod_component_set_perms (GnomeCmdChmodComponent *component, GnomeVFSFilePermissions perms);
 
 #endif // __GNOME_CMD_CHMOD_COMPONENT_H__

Modified: trunk/src/gnome-cmd-chmod-dialog.cc
==============================================================================
--- trunk/src/gnome-cmd-chmod-dialog.cc	(original)
+++ trunk/src/gnome-cmd-chmod-dialog.cc	Tue Apr  1 16:00:49 2008
@@ -65,23 +65,15 @@
     g_return_if_fail (in_finfo != NULL);
     g_return_if_fail (in_finfo->info != NULL);
 
-    if (!(recursive && mode == CHMOD_DIRS_ONLY
-          && in_finfo->info->type != GNOME_VFS_FILE_TYPE_DIRECTORY))
+    if (!(recursive && mode == CHMOD_DIRS_ONLY && in_finfo->info->type != GNOME_VFS_FILE_TYPE_DIRECTORY))
     {
         GnomeVFSResult ret = gnome_cmd_file_chmod (in_finfo, perm);
 
         if (ret != GNOME_VFS_OK)
-        {
-            gchar *fpath = gnome_cmd_file_get_real_path (in_finfo);
-            gchar *msg = g_strdup_printf (_("Could not chmod %s\n%s"), fpath, gnome_vfs_result_to_string (ret));
-            create_error_dialog (msg);
-            g_free (msg);
-            g_free (fpath);
-        }
-        else if (!recursive)
-        {
-            return;
-        }
+            gnome_cmd_show_message (NULL, gnome_cmd_file_get_name (in_finfo), gnome_vfs_result_to_string (ret));
+        else
+            if (!recursive)
+                return;
     }
 
     if (in_finfo->info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
@@ -108,7 +100,7 @@
 }
 
 
-static void do_chmod_files (GnomeCmdChmodDialog *dialog)
+inline void do_chmod_files (GnomeCmdChmodDialog *dialog)
 {
     for (GList *tmp = dialog->priv->files; tmp; tmp = tmp->next)
     {
@@ -124,11 +116,9 @@
 }
 
 
-static void show_perms (GnomeCmdChmodDialog *dialog)
+inline void show_perms (GnomeCmdChmodDialog *dialog)
 {
-    gnome_cmd_chmod_component_set_perms (
-        GNOME_CMD_CHMOD_COMPONENT (dialog->priv->chmod_component),
-        dialog->priv->perms);
+    gnome_cmd_chmod_component_set_perms (GNOME_CMD_CHMOD_COMPONENT (dialog->priv->chmod_component), dialog->priv->perms);
 }
 
 
@@ -164,8 +154,7 @@
  * Gtk class implementation
  *******************************/
 
-static void
-destroy (GtkObject *object)
+static void destroy (GtkObject *object)
 {
     GnomeCmdChmodDialog *dialog = GNOME_CMD_CHMOD_DIALOG (object);
 
@@ -176,16 +165,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 (GnomeCmdChmodDialogClass *klass)
+static void class_init (GnomeCmdChmodDialogClass *klass)
 {
     GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
     GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
@@ -196,8 +183,7 @@
 }
 
 
-static void
-init (GnomeCmdChmodDialog *dialog)
+static void init (GnomeCmdChmodDialog *dialog)
 {
     GtkWidget *chmod_dialog = GTK_WIDGET (dialog);
     GtkWidget *vbox;
@@ -249,8 +235,7 @@
  * Public functions
  ***********************************/
 
-GtkWidget*
-gnome_cmd_chmod_dialog_new (GList *files)
+GtkWidget *gnome_cmd_chmod_dialog_new (GList *files)
 {
     g_return_val_if_fail (files != NULL, NULL);
 
@@ -275,8 +260,7 @@
 }
 
 
-GtkType
-gnome_cmd_chmod_dialog_get_type         (void)
+GtkType gnome_cmd_chmod_dialog_get_type (void)
 {
     static GtkType dlg_type = 0;
 

Modified: trunk/src/gnome-cmd-chmod-dialog.h
==============================================================================
--- trunk/src/gnome-cmd-chmod-dialog.h	(original)
+++ trunk/src/gnome-cmd-chmod-dialog.h	Tue Apr  1 16:00:49 2008
@@ -45,10 +45,8 @@
 };
 
 
-GtkWidget*
-gnome_cmd_chmod_dialog_new (GList *files);
+GtkWidget *gnome_cmd_chmod_dialog_new (GList *files);
 
-GtkType
-gnome_cmd_chmod_dialog_get_type (void);
+GtkType gnome_cmd_chmod_dialog_get_type (void);
 
 #endif // __GNOME_CMD_CHMOD_DIALOG_H__

Modified: trunk/src/gnome-cmd-file-list.cc
==============================================================================
--- trunk/src/gnome-cmd-file-list.cc	(original)
+++ trunk/src/gnome-cmd-file-list.cc	Tue Apr  1 16:00:49 2008
@@ -2141,7 +2141,7 @@
     if (!finfo)  return;
 
     if (finfo->info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
-        create_error_dialog(_("Not an ordinary file: %s"), finfo->info->name);
+        create_error_dialog (_("Not an ordinary file: %s"), finfo->info->name);
     else
         gnome_cmd_file_view (finfo, internal_viewer!=-1 ? internal_viewer :
                                                           gnome_cmd_data_get_use_internal_viewer ());
@@ -2157,7 +2157,7 @@
     if (!finfo)  return;
 
     if (finfo->info->type == GNOME_VFS_FILE_TYPE_DIRECTORY)
-        create_error_dialog(_("Not an ordinary file: %s"), finfo->info->name);
+        create_error_dialog (_("Not an ordinary file: %s"), finfo->info->name);
     else
         gnome_cmd_file_edit (finfo);
 }



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