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



Author: epiotr
Date: Mon Jun  9 15:38:23 2008
New Revision: 1834
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=1834&view=rev

Log:
Code cleanup

Modified:
   branches/gcmd-1-3/src/gnome-cmd-data.cc

Modified: branches/gcmd-1-3/src/gnome-cmd-data.cc
==============================================================================
--- branches/gcmd-1-3/src/gnome-cmd-data.cc	(original)
+++ branches/gcmd-1-3/src/gnome-cmd-data.cc	Mon Jun  9 15:38:23 2008
@@ -133,7 +133,7 @@
 
 inline void save_connections (const gchar *fname)
 {
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir(), fname);
+    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
     FILE  *fd = fopen (path, "w");
 
     if (fd)
@@ -180,7 +180,7 @@
 
 inline void save_devices (const gchar *fname)
 {
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir(), fname);
+    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
     FILE *fd = fopen (path, "w");
 
     if (fd)
@@ -188,7 +188,7 @@
         for (GList *tmp = gnome_cmd_con_list_get_all_dev (data->priv->con_list); tmp; tmp = tmp->next)
         {
             GnomeCmdConDevice *device = GNOME_CMD_CON_DEVICE (tmp->data);
-            if (device && !gnome_cmd_con_device_get_autovol(device))
+            if (device && !gnome_cmd_con_device_get_autovol (device))
             {
                 gchar *alias = gnome_vfs_escape_string (gnome_cmd_con_device_get_alias (device));
                 gchar *device_fn = (gchar *) gnome_cmd_con_device_get_device_fn (device);
@@ -225,7 +225,7 @@
 
 inline void save_fav_apps (const gchar *fname)
 {
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir(), fname);
+    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
     FILE *fd = fopen (path, "w");
 
     if (fd)
@@ -269,7 +269,7 @@
 {
     guint prev_ftp_cons_no = g_list_length (gnome_cmd_con_list_get_all_ftp (data->priv->con_list));
 
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir(), fname);
+    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
     FILE  *fd = fopen (path, "r");
 
     if (fd)
@@ -460,17 +460,17 @@
 
 inline gboolean vfs_is_uri_local (const char *uri)
 {
-    GnomeVFSURI *pURI = gnome_vfs_uri_new(uri);
+    GnomeVFSURI *pURI = gnome_vfs_uri_new (uri);
 
     if (!pURI)
         return FALSE;
 
-    gboolean b = gnome_vfs_uri_is_local(pURI);
-    gnome_vfs_uri_unref(pURI);
+    gboolean b = gnome_vfs_uri_is_local (pURI);
+    gnome_vfs_uri_unref (pURI);
 
     /* make sure this is actually a local path
            (gnome treats "burn://" as local, too and we don't want that)  */
-    if (g_strncasecmp(uri,"file:/", 6)!=0)
+    if (g_strncasecmp (uri,"file:/", 6)!=0)
         b = FALSE;
 
     DEBUG('m',"uri (%s) is %slocal\n", uri, b?"":"NOT ");
@@ -487,19 +487,19 @@
         return;
 
     uri = gnome_vfs_volume_get_activation_uri (volume);
-    if (!vfs_is_uri_local(uri))
+    if (!vfs_is_uri_local (uri))
     {
         g_free (uri);
         return;
     }
 
     path = gnome_vfs_volume_get_device_path (volume);
-    localpath = gnome_vfs_get_local_path_from_uri(uri);
+    localpath = gnome_vfs_get_local_path_from_uri (uri);
 
     for (GList *tmp = gnome_cmd_con_list_get_all_dev (data->priv->con_list); tmp; tmp = tmp->next)
     {
         GnomeCmdConDevice *device = GNOME_CMD_CON_DEVICE (tmp->data);
-        if (device && gnome_cmd_con_device_get_autovol(device))
+        if (device && gnome_cmd_con_device_get_autovol (device))
         {
             gchar *device_fn = (gchar *) gnome_cmd_con_device_get_device_fn (device);
             const gchar *mountp = gnome_cmd_con_device_get_mountp (device);
@@ -508,7 +508,7 @@
             {
                 DEBUG('m',"Remove Volume:\ndevice_fn = %s\tmountp = %s\n",
                 device_fn,mountp);
-                gnome_cmd_con_list_remove_device(data->priv->con_list, device);
+                gnome_cmd_con_list_remove_device (data->priv->con_list, device);
                 break;
             }
         }
@@ -527,7 +527,7 @@
     for (GList *tmp = gnome_cmd_con_list_get_all_dev (list); tmp; tmp = tmp->next)
     {
         GnomeCmdConDevice *device = GNOME_CMD_CON_DEVICE (tmp->data);
-        if (device && !gnome_cmd_con_device_get_autovol(device))
+        if (device && !gnome_cmd_con_device_get_autovol (device))
         {
             gchar *mountp = gnome_vfs_escape_string (gnome_cmd_con_device_get_mountp (device));
             gchar *mountp2= gnome_vfs_unescape_string (mountp, NULL);
@@ -553,7 +553,7 @@
 
     char *uri = gnome_vfs_volume_get_activation_uri (volume);
 
-    if (!vfs_is_uri_local(uri))
+    if (!vfs_is_uri_local (uri))
     {
         g_free (uri);
         return;
@@ -584,11 +584,11 @@
     DEBUG('m',"icon = %s (full path = %s)\n", icon, iconpath);
 
     // Don't create a new device connect if one already exists. This can happen if the user manually added the same device in "Options|Devices" menu
-    if (!device_mount_point_exists(data->priv->con_list, localpath))
+    if (!device_mount_point_exists (data->priv->con_list, localpath))
     {
         GnomeCmdConDevice *ConDev = gnome_cmd_con_device_new (name, path?path:NULL, localpath, iconpath);
-        gnome_cmd_con_device_set_autovol(ConDev, TRUE);
-        gnome_cmd_con_device_set_vfs_volume(ConDev, volume);
+        gnome_cmd_con_device_set_autovol (ConDev, TRUE);
+        gnome_cmd_con_device_set_vfs_volume (ConDev, volume);
         gnome_cmd_con_list_add_device (data->priv->con_list,ConDev);
     }
     else
@@ -606,12 +606,12 @@
 #if 0
 inline void add_vfs_drive (GnomeVFSDrive *drive)
 {
-    if (!gnome_vfs_drive_is_user_visible(drive))
+    if (!gnome_vfs_drive_is_user_visible (drive))
         return;
 
     char *uri = gnome_vfs_drive_get_activation_uri (drive);
 
-    if (!vfs_is_uri_local(uri))
+    if (!vfs_is_uri_local (uri))
     {
         g_free (uri);
         return;
@@ -622,13 +622,13 @@
     char *name = gnome_vfs_drive_get_display_name (drive);
     GnomeVFSVolume *volume = gnome_vfs_drive_get_mounted_volume (drive);
 
-    char *localpath = gnome_vfs_get_local_path_from_uri(uri);
+    char *localpath = gnome_vfs_get_local_path_from_uri (uri);
 
     DEBUG('m',"name = %s\tpath = %s\turi = %s\tlocal = %s\n",name,path,uri,localpath);
 
     GnomeCmdConDevice *ConDev = gnome_cmd_con_device_new (name,path,localpath, icon);
 
-    gnome_cmd_con_device_set_autovol(ConDev, TRUE);
+    gnome_cmd_con_device_set_autovol (ConDev, TRUE);
 
     gnome_cmd_con_list_add_device (data->priv->con_list,ConDev);
 
@@ -644,19 +644,19 @@
 
 static void volume_mounted (GnomeVFSVolumeMonitor *volume_monitor, GnomeVFSVolume *volume)
 {
-    add_vfs_volume(volume);
+    add_vfs_volume (volume);
 }
 
 
 static void volume_unmounted (GnomeVFSVolumeMonitor *volume_monitor, GnomeVFSVolume *volume)
 {
-    remove_vfs_volume(volume);
+    remove_vfs_volume (volume);
 }
 
 #if 0
 static void drive_connected (GnomeVFSVolumeMonitor *volume_monitor, GnomeVFSDrive *drive)
 {
-    add_vfs_drive(drive);
+    add_vfs_drive (drive);
 }
 
 static void drive_disconnected (GnomeVFSVolumeMonitor *volume_monitor, GnomeVFSDrive *drive)
@@ -665,7 +665,7 @@
 }
 #endif
 
-inline void set_vfs_volume_monitor()
+inline void set_vfs_volume_monitor ()
 {
     monitor = gnome_vfs_get_volume_monitor ();
 
@@ -678,7 +678,7 @@
 }
 
 
-inline void load_vfs_auto_devices()
+inline void load_vfs_auto_devices ()
 {
     GnomeVFSVolumeMonitor *monitor = gnome_vfs_get_volume_monitor ();
     GList *volumes = gnome_vfs_volume_monitor_get_mounted_volumes (monitor);
@@ -704,7 +704,7 @@
 
 inline void load_devices (const gchar *fname)
 {
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir(), fname);
+    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
     FILE *fd = fopen (path, "r");
 
     if (fd)
@@ -745,7 +745,7 @@
         if (errno != ENOENT)
             warn_print ("Failed to open the file %s for reading\n", path);
 
-    load_vfs_auto_devices();
+    load_vfs_auto_devices ();
 
     g_free (path);
 }
@@ -754,7 +754,7 @@
 inline void load_fav_apps (const gchar *fname)
 {
     data->priv->fav_apps = NULL;
-    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir(), fname);
+    gchar *path = g_strdup_printf ("%s/.gnome-commander/%s", g_get_home_dir (), fname);
     FILE *fd = fopen (path, "r");
     if (fd)
     {
@@ -1503,7 +1503,7 @@
     load_rename_history ();
     load_auto_load_plugins ();
 
-    set_vfs_volume_monitor();
+    set_vfs_volume_monitor ();
 
     static struct
     {



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