[gnome-commander] g_build_path() -> g_build_filename()



commit e19c7932964851ce2d790d3aa797c4ca0fa6e6ca
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sun Jun 6 19:08:48 2010 +0200

    g_build_path() -> g_build_filename()

 plugins/fileroller/file-roller-plugin.cc |    2 +-
 src/gnome-cmd-con-device.cc              |    2 +-
 src/gnome-cmd-data.cc                    |    4 ++--
 src/gnome-cmd-file-selector.cc           |    2 +-
 src/gnome-cmd-options-dialog.cc          |    2 +-
 src/gnome-cmd-prepare-xfer-dialog.cc     |    6 +++---
 src/gnome-cmd-python-plugin.cc           |    4 ++--
 src/imageloader.cc                       |   14 +++++++-------
 src/main.cc                              |    2 +-
 src/plugin_manager.cc                    |    4 ++--
 src/utils.cc                             |    4 ++--
 11 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/plugins/fileroller/file-roller-plugin.cc b/plugins/fileroller/file-roller-plugin.cc
index e120a03..453362a 100644
--- a/plugins/fileroller/file-roller-plugin.cc
+++ b/plugins/fileroller/file-roller-plugin.cc
@@ -101,7 +101,7 @@ static void on_extract_cwd (GtkMenuItem *item, GnomeVFSURI *uri)
     if (target_dir==NULL)
     {
         t = g_path_get_dirname (local_path);
-        target_dir = target_name ? g_build_path (G_DIR_SEPARATOR_S, t, target_name, NULL) : g_strdup (t);
+        target_dir = target_name ? g_build_filename (t, target_name, NULL) : g_strdup (t);
         g_free (t);
     }
     g_free (target_name);
diff --git a/src/gnome-cmd-con-device.cc b/src/gnome-cmd-con-device.cc
index a757f29..e2a8c5b 100644
--- a/src/gnome-cmd-con-device.cc
+++ b/src/gnome-cmd-con-device.cc
@@ -284,7 +284,7 @@ static GnomeVFSURI *dev_create_uri (GnomeCmdCon *con, GnomeCmdPath *path)
     GnomeCmdConDevice *dev_con = GNOME_CMD_CON_DEVICE (con);
 
     const gchar *path_str = gnome_cmd_path_get_path (path);
-    gchar *p = g_build_path (G_DIR_SEPARATOR_S, dev_con->priv->mountp, path_str, NULL);
+    gchar *p = g_build_filename (dev_con->priv->mountp, path_str, NULL);
     GnomeVFSURI *u1 = gnome_vfs_uri_new ("file:");
     GnomeVFSURI *u2 = gnome_vfs_uri_append_path (u1, p);
     gnome_vfs_uri_unref (u1);
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 096520c..649d1b0 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1001,7 +1001,7 @@ void GnomeCmdData::free()
 
 void GnomeCmdData::load()
 {
-    gchar *xml_cfg_path = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), "." PACKAGE, PACKAGE ".xml", NULL);
+    gchar *xml_cfg_path = g_build_filename (g_get_home_dir (), "." PACKAGE, PACKAGE ".xml", NULL);
 
     gchar *document_icon_dir = g_strdup_printf ("%s/share/pixmaps/document-icons/", GNOME_PREFIX);
     gchar *theme_icon_dir    = g_strdup_printf ("%s/mime-icons", PIXMAPS_DIR);
@@ -1655,7 +1655,7 @@ void GnomeCmdData::save()
     save_intviewer_defaults();
 
     {
-        gchar *xml_cfg_path = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), "." PACKAGE, PACKAGE ".xml", NULL);
+        gchar *xml_cfg_path = g_build_filename (g_get_home_dir (), "." PACKAGE, PACKAGE ".xml", NULL);
 
         ofstream f(xml_cfg_path);
         XML::xstream xml(f);
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 85eb15c..db4937d 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -986,7 +986,7 @@ static gboolean on_new_textfile_ok (GnomeCmdStringDialog *string_dialog, const g
     g_return_val_if_fail (GNOME_CMD_IS_DIR (dir), TRUE);
 
     gchar *dpath = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dir));
-    gchar *filepath = g_build_path (G_DIR_SEPARATOR_S, dpath, fname, NULL);
+    gchar *filepath = g_build_filename (dpath, fname, NULL);
     g_free (dpath);
     g_return_val_if_fail (filepath, TRUE);
 
diff --git a/src/gnome-cmd-options-dialog.cc b/src/gnome-cmd-options-dialog.cc
index 3740bd1..e695ce0 100644
--- a/src/gnome-cmd-options-dialog.cc
+++ b/src/gnome-cmd-options-dialog.cc
@@ -1707,7 +1707,7 @@ static GtkWidget *create_device_dialog (GnomeCmdConDevice *dev, GtkSignalFunc on
 
     if (dev) s = gnome_cmd_con_device_get_icon_path (dev);
     entry = create_icon_entry (dialog, "device_iconentry", s);
-    icon_dir = g_build_path (G_DIR_SEPARATOR_S, PIXMAPS_DIR, "device-icons", NULL);
+    icon_dir = g_build_filename (PIXMAPS_DIR, "device-icons", NULL);
     gnome_icon_entry_set_pixmap_subdir (GNOME_ICON_ENTRY (entry), icon_dir);
     g_free (icon_dir);
     table_add (table, entry, 1, 3, GTK_FILL);
diff --git a/src/gnome-cmd-prepare-xfer-dialog.cc b/src/gnome-cmd-prepare-xfer-dialog.cc
index 172107c..28dfd33 100644
--- a/src/gnome-cmd-prepare-xfer-dialog.cc
+++ b/src/gnome-cmd-prepare-xfer-dialog.cc
@@ -85,12 +85,12 @@ static void on_ok (GtkButton *button, GnomeCmdPrepareXferDialog *dialog)
         if (!gnome_cmd_dir_is_local (dialog->default_dest_dir))
         {
             const gchar *t = gnome_cmd_path_get_path (gnome_cmd_dir_get_path (dialog->default_dest_dir));
-            dest_path = g_build_path (G_DIR_SEPARATOR_S, t, user_path, NULL);
+            dest_path = g_build_filename (t, user_path, NULL);
         }
         else
         {
             gchar *t = gnome_cmd_file_get_path (GNOME_CMD_FILE (dialog->src_fs->get_directory()));
-            dest_path = g_build_path (G_DIR_SEPARATOR_S, t, user_path, NULL);
+            dest_path = g_build_filename (t, user_path, NULL);
             g_free (t);
         }
         g_free (user_path);
@@ -410,7 +410,7 @@ GtkWidget *gnome_cmd_prepare_xfer_dialog_new (GnomeCmdFileSelector *from, GnomeC
             gchar *fname = get_utf8 (f->info->name);
             g_free (t);
 
-            dest_str = g_build_path (G_DIR_SEPARATOR_S, path, fname, NULL);
+            dest_str = g_build_filename (path, fname, NULL);
             if (path_points_at_directory (to, dest_str))
             {
                 g_free (dest_str);
diff --git a/src/gnome-cmd-python-plugin.cc b/src/gnome-cmd-python-plugin.cc
index 08065ce..c4bbe89 100644
--- a/src/gnome-cmd-python-plugin.cc
+++ b/src/gnome-cmd-python-plugin.cc
@@ -95,7 +95,7 @@ static void scan_plugins_in_dir (const gchar *dpath)
                     data->name = g_strdup (ent->d_name);
                     *strchr (data->name, '.') = '\0';               // strip {.py, .pyc} off
 
-                    data->path = g_build_path (G_DIR_SEPARATOR_S, dpath, data->name, NULL);
+                    data->path = g_build_filename (dpath, data->name, NULL);
                     g_strdelimit (data->name, "_-", ' ');           // replace '[-_]' with ' '
 
                     // if there is already data->name plugin in py_plugins list ...
@@ -128,7 +128,7 @@ static void scan_plugins_in_dir (const gchar *dpath)
 
 void python_plugin_manager_init ()
 {
-    gchar *user_dir = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir(), ".gnome-commander/plugins", NULL);
+    gchar *user_dir = g_build_filename (g_get_home_dir(), ".gnome-commander/plugins", NULL);
     gchar *set_plugin_path = g_strdup_printf("sys.path = ['%s', '%s'] + sys.path", user_dir, PLUGIN_DIR);
 
     DEBUG('p', "User plugin dir: %s\n", user_dir);
diff --git a/src/imageloader.cc b/src/imageloader.cc
index e085bb2..1246cc9 100644
--- a/src/imageloader.cc
+++ b/src/imageloader.cc
@@ -98,14 +98,14 @@ void IMAGE_init ()
 
     for (gint i=1; i<NUM_PIXMAPS; i++)
     {
-        gchar *path = g_build_path (G_DIR_SEPARATOR_S, PIXMAPS_DIR, pixmap_files[i], NULL);
+        gchar *path = g_build_filename (PIXMAPS_DIR, pixmap_files[i], NULL);
 
         DEBUG ('i', "imageloader: loading pixmap: %s\n", path);
 
         pixmaps[i] = gnome_cmd_pixmap_new_from_file (path);
         if (!pixmaps[i])
         {
-            gchar *path2 = g_build_path (G_DIR_SEPARATOR_S, "../pixmaps", pixmap_files[i], NULL);
+            gchar *path2 = g_build_filename ("../pixmaps", pixmap_files[i], NULL);
 
             warn_print (_("Couldn't load installed file type pixmap, trying to load from source-dir\n"));
             warn_print (_("Trying to load %s instead\n"), path2);
@@ -125,13 +125,13 @@ void IMAGE_init ()
      for (gint i=0; i<NUM_FILE_TYPE_PIXMAPS; i++)
     {
         CacheEntry *e = &file_type_pixmaps[i];
-        gchar *path = g_build_path (G_DIR_SEPARATOR_S, PIXMAPS_DIR, file_type_pixmap_files[i], NULL);
+        gchar *path = g_build_filename (PIXMAPS_DIR, file_type_pixmap_files[i], NULL);
 
         DEBUG ('i', "imageloader: loading pixmap: %s\n", path);
 
         if (!load_icon (path, &e->pixmap, &e->mask, &e->lnk_pixmap, &e->lnk_mask))
         {
-            gchar *path2 = g_build_path (G_DIR_SEPARATOR_S, "../pixmaps", pixmap_files[i], NULL);
+            gchar *path2 = g_build_filename ("../pixmaps", pixmap_files[i], NULL);
 
             warn_print (_("Couldn't load installed pixmap, trying to load from source-dir\n"));
             warn_print (_("Trying to load %s instead\n"), path2);
@@ -223,7 +223,7 @@ static const gchar *get_type_icon_name (GnomeVFSFileType type)
  */
 inline gchar *get_mime_file_type_icon_path (GnomeVFSFileType type, const gchar *icon_dir)
 {
-    return g_build_path (G_DIR_SEPARATOR_S, icon_dir, get_type_icon_name (type), NULL);
+    return g_build_filename (icon_dir, get_type_icon_name (type), NULL);
 }
 
 
@@ -235,7 +235,7 @@ inline gchar *get_mime_file_type_icon_path (GnomeVFSFileType type, const gchar *
 inline gchar *get_mime_document_type_icon_path (const gchar *mime_type, const gchar *icon_dir)
 {
     gchar *icon_name = get_mime_icon_name (mime_type);
-    gchar *icon_path = g_build_path (G_DIR_SEPARATOR_S, icon_dir, icon_name, NULL);
+    gchar *icon_path = g_build_filename (icon_dir, icon_name, NULL);
     g_free (icon_name);
 
     return icon_path;
@@ -251,7 +251,7 @@ inline gchar *get_category_icon_path (const gchar *mime_type, const gchar *icon_
 {
     for (gint i=0; i<G_N_ELEMENTS(categories); i++)
         if (g_str_has_prefix (mime_type, categories[i][0]))
-            return g_build_path (G_DIR_SEPARATOR_S, icon_dir, categories[i][1], NULL);
+            return g_build_filename (icon_dir, categories[i][1], NULL);
 
     return NULL;
 }
diff --git a/src/main.cc b/src/main.cc
index e140ec4..13b30e0 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -139,7 +139,7 @@ int main (int argc, char *argv[])
     gdk_rgb_init ();
     gnome_vfs_init ();
 
-    gchar *conf_dir = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome-commander", NULL);
+    gchar *conf_dir = g_build_filename (g_get_home_dir (), ".gnome-commander", NULL);
     create_dir_if_needed (conf_dir);
     g_free (conf_dir);
 
diff --git a/src/plugin_manager.cc b/src/plugin_manager.cc
index 50f221b..6e333bc 100644
--- a/src/plugin_manager.cc
+++ b/src/plugin_manager.cc
@@ -173,7 +173,7 @@ static void scan_plugins_in_dir (const gchar *dpath)
                 // the direntry has the .so extension and is a regular file, lets accept it
                 PluginData *data = g_new0 (PluginData, 1);
                 data->fname = g_strdup (ent->d_name);
-                data->fpath = g_build_path (G_DIR_SEPARATOR_S, dpath, ent->d_name, NULL);
+                data->fpath = g_build_filename (dpath, ent->d_name, NULL);
                 data->loaded = FALSE;
                 data->active = FALSE;
                 data->menu = NULL;
@@ -211,7 +211,7 @@ void plugin_manager_init ()
     }
 
     // find user plugins
-    gchar *user_dir = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome-commander/plugins", NULL);
+    gchar *user_dir = g_build_filename (g_get_home_dir (), ".gnome-commander/plugins", NULL);
     create_dir_if_needed (user_dir);
     scan_plugins_in_dir (user_dir);
     g_free (user_dir);
diff --git a/src/utils.cc b/src/utils.cc
index f82e840..61cebd9 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -1046,7 +1046,7 @@ gchar *get_temp_download_filepath (const gchar *fname)
         }
     }
 
-    return g_build_path (G_DIR_SEPARATOR_S, tmp_dir, tmp_file_dir, fname, NULL);
+    return g_build_filename (tmp_dir, tmp_file_dir, fname, NULL);
 }
 
 
@@ -1056,7 +1056,7 @@ void remove_temp_download_dir ()
 
     if (tmp_file_dir)
     {
-        gchar *path = g_build_path (G_DIR_SEPARATOR_S, tmp_dir, tmp_file_dir, NULL);
+        gchar *path = g_build_filename (tmp_dir, tmp_file_dir, NULL);
         gchar *command = g_strdup_printf ("rm -rf %s", path);
         g_free (path);
         system (command);



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