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



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

Log:
Code cleanup

Modified:
   branches/gcmd-1-3/ChangeLog
   branches/gcmd-1-3/src/gnome-cmd-con-device.cc
   branches/gcmd-1-3/src/gnome-cmd-con.cc
   branches/gcmd-1-3/src/gnome-cmd-user-actions.cc

Modified: branches/gcmd-1-3/src/gnome-cmd-con-device.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-con-device.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-con-device.cc	Wed Jan  9 22:14:50 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: branches/gcmd-1-3/src/gnome-cmd-con.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-con.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-con.cc	Wed Jan  9 22:14:50 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: 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 Jan  9 22:14:50 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]