gnome-commander r1490 - in trunk: . doc/C src



Author: epiotr
Date: Wed Jan  9 22:14:00 2008
New Revision: 1490
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1490&view=rev

Log:
Code cleanup

Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/doc/C/gnome-commander.xml
   trunk/src/gnome-cmd-con-device.cc
   trunk/src/gnome-cmd-con.cc
   trunk/src/gnome-cmd-user-actions.cc

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Wed Jan  9 22:14:00 2008
@@ -4,7 +4,7 @@
 
 Bug fixes:
  * Fixed problem #353889 (disappearing files after failed move (F6))
- * Fixed problems #346286, #424447, #447882, #467058 (crash when regex in renaming tool)
+ * Fixed problems #346286, #424447, #447882, #467058 (crash when using regex in renaming tool)
  * Fixed problems #365227 and #446361 (build issues on Solaris)
  * Fixed problem #424159 (column sort problem)
  * Fixed problem #434545 (Debian bug #421480: HUGE icons for device icons)

Modified: trunk/doc/C/gnome-commander.xml
==============================================================================
--- trunk/doc/C/gnome-commander.xml	(original)
+++ trunk/doc/C/gnome-commander.xml	Wed Jan  9 22:14:00 2008
@@ -5776,7 +5776,7 @@
                             <para>Fixed problem #353889 (disappearing files after failed move (F6)))</para>
                         </listitem>
                         <listitem>
-                            <para>Fixed problems #346286, #424447, #447882, #467058 (crash when regex in renaming tool)</para>
+                            <para>Fixed problems #346286, #424447, #447882, #467058 (crash when using regex in renaming tool)</para>
                         </listitem>
                         <listitem>
                             <para>Fixed problems #365227 and #446361 (build issues on Solaris)</para>

Modified: trunk/src/gnome-cmd-con-device.cc
==============================================================================
--- trunk/src/gnome-cmd-con-device.cc	(original)
+++ trunk/src/gnome-cmd-con-device.cc	Wed Jan  9 22:14:00 2008
@@ -440,10 +440,10 @@
 {
     g_return_if_fail (dev != NULL);
     g_return_if_fail (dev->priv != NULL);
+
     if (!mountp) return;
 
-    if (dev->priv->mountp)
-        g_free (dev->priv->mountp);
+    g_free (dev->priv->mountp);
 
     dev->priv->mountp = g_strdup (mountp);
 }
@@ -451,15 +451,13 @@
 
 void gnome_cmd_con_device_set_icon_path (GnomeCmdConDevice *dev, const gchar *icon_path)
 {
-    GnomeCmdCon *con;
-
     g_return_if_fail (dev != NULL);
     g_return_if_fail (dev->priv != NULL);
 
-    if (dev->priv->icon_path)
-        g_free (dev->priv->icon_path);
+    g_free (dev->priv->icon_path);
+
+    GnomeCmdCon *con = GNOME_CMD_CON (dev);
 
-    con = GNOME_CMD_CON (dev);
     if (con->go_pixmap)
         gnome_cmd_pixmap_free (con->go_pixmap);
     if (con->open_pixmap)
@@ -500,7 +498,7 @@
 }
 
 
-void gnome_cmd_con_device_set_autovol (GnomeCmdConDevice *dev,    const gboolean autovol)
+void gnome_cmd_con_device_set_autovol (GnomeCmdConDevice *dev, const gboolean autovol)
 {
     g_return_if_fail (dev != NULL);
     g_return_if_fail (dev->priv != NULL);

Modified: trunk/src/gnome-cmd-con.cc
==============================================================================
--- trunk/src/gnome-cmd-con.cc	(original)
+++ trunk/src/gnome-cmd-con.cc	Wed Jan  9 22:14:00 2008
@@ -459,10 +459,8 @@
 }
 
 
-/**
- * Get the type of the file at the specified path. If the operation
- * succeeds GNOME_VFS_OK is returned and type is set
- */
+// Get the type of the file at the specified path.
+// If the operation succeeds GNOME_VFS_OK is returned and type is set
 GnomeVFSResult gnome_cmd_con_get_path_target_type (GnomeCmdCon *con, const gchar *path_str, GnomeVFSFileType *type)
 {
     g_return_val_if_fail (GNOME_CMD_IS_CON (con), GNOME_VFS_ERROR_BAD_PARAMETERS);
@@ -516,8 +514,7 @@
     gchar *uri_str = gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir));
 
     if (!con->priv->all_dirs_map)
-        con->priv->all_dirs_map = g_hash_table_new_full (
-            g_str_hash, g_str_equal, g_free, NULL);
+        con->priv->all_dirs_map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 
     DEBUG ('k', "ADDING 0x%p %s to the cache\n", dir, uri_str);
     g_hash_table_insert (con->priv->all_dirs_map, uri_str, dir);
@@ -548,13 +545,11 @@
         dir = (GnomeCmdDir *) g_hash_table_lookup (con->priv->all_dirs_map, uri_str);
 
     if (dir)
-    {
         DEBUG ('k', "FOUND 0x%p %s in the hash-table, reusing it!\n", dir, uri_str);
-        return dir;
-    }
+    else
+        DEBUG ('k', "FAILED to find %s in the hash-table\n", uri_str);
 
-    DEBUG ('k', "FAILED to find %s in the hash-table\n", uri_str);
-    return NULL;
+    return dir;
 }
 
 

Modified: trunk/src/gnome-cmd-user-actions.cc
==============================================================================
--- trunk/src/gnome-cmd-user-actions.cc	(original)
+++ trunk/src/gnome-cmd-user-actions.cc	Wed Jan  9 22:14:00 2008
@@ -165,7 +165,7 @@
         if (strlen(key)==1 && ascii_isalnum (*key))
             key_val = *key;
 
-    for (const gchar *beg=s; beg=strchr(beg, '<'); ++beg)
+    for (const gchar *beg=s; (beg=strchr(beg, '<')); ++beg)
     {
         if (const gchar *end = strchr(beg, '>'))
             if (guint modifier = gdk_modifiers_names[string(beg,end-beg+1)])



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