Use G_DIR_SEPARATOR_S where applicable.
authorLaurent Monin <geeqie@norz.org>
Wed, 21 May 2008 11:00:13 +0000 (11:00 +0000)
committerLaurent Monin <geeqie@norz.org>
Wed, 21 May 2008 11:00:13 +0000 (11:00 +0000)
src/filedata.c
src/layout.c
src/pan-view.c
src/ui_bookmark.c
src/ui_pathsel.c
src/view_dir.c
src/view_dir_tree.c

index b2bf342..0b7b920 100644 (file)
@@ -139,7 +139,7 @@ FileData *file_data_disconnect_sidecar_file(FileData *target, FileData *sfd);
 static void file_data_set_path(FileData *fd, const gchar *path)
 {
 
-       if (strcmp(path, "/") == 0)
+       if (strcmp(path, G_DIR_SEPARATOR_S) == 0)
                {
                fd->path = g_strdup(path);
                fd->name = fd->path;
index 23c1a50..6b344ef 100644 (file)
@@ -150,7 +150,7 @@ static void layout_path_entry_tab_cb(const gchar *path, gpointer data)
                        {
                        gint pos = -1;
                        /* put the '/' back, if we are in tab completion for a dir and result was path change */
-                       gtk_editable_insert_text(GTK_EDITABLE(lw->path_entry), "/", -1, &pos);
+                       gtk_editable_insert_text(GTK_EDITABLE(lw->path_entry), G_DIR_SEPARATOR_S, -1, &pos);
                        gtk_editable_set_position(GTK_EDITABLE(lw->path_entry),
                                                  strlen(gtk_entry_get_text(GTK_ENTRY(lw->path_entry))));
                        }
index 9f404eb..7a1c703 100644 (file)
@@ -1162,7 +1162,7 @@ static void pan_layout_set_path(PanWindow *pw, const gchar *path)
 {
        if (!path) return;
 
-       if (strcmp(path, "/") == 0)
+       if (strcmp(path, G_DIR_SEPARATOR_S) == 0)
                {
                pan_warning_folder(path, pw->window);
                return;
@@ -2570,7 +2570,7 @@ static gint pan_warning(const gchar *path)
        GtkWidget *ct_button;
        gint hide_dlg;
 
-       if (path && strcmp(path, "/") == 0)
+       if (path && strcmp(path, G_DIR_SEPARATOR_S) == 0)
                {
                pan_warning_folder(path, NULL);
                return TRUE;
index da18305..4a8d03f 100644 (file)
@@ -503,7 +503,7 @@ static void bookmark_free(BookButtonData *b)
 static gchar *bookmark_string(const gchar *name, const gchar *path, const gchar *icon)
 {
        if (!name) name = _("New Bookmark");
-       if (icon && strncmp(icon, "/", 1) != 0) icon = NULL;
+       if (icon && strncmp(icon, G_DIR_SEPARATOR_S, 1) != 0) icon = NULL;
 
        if (icon)
                {
index 6709e99..2b6c4c7 100644 (file)
@@ -1214,7 +1214,7 @@ GtkWidget *path_selection_new_with_files(GtkWidget *entry, const gchar *path,
        else
                {
                gchar *buf = remove_level_from_path(path);
-               if (buf && buf[0] == '/' && isdir(buf))
+               if (buf && buf[0] == G_DIR_SEPARATOR && isdir(buf))
                        {
                        dest_populate(dd, buf);
                        }
@@ -1223,7 +1223,7 @@ GtkWidget *path_selection_new_with_files(GtkWidget *entry, const gchar *path,
                        gint pos = -1;
 
                        dest_populate(dd, (gchar *)homedir());
-                       if (path) gtk_editable_insert_text(GTK_EDITABLE(dd->entry), "/", -1, &pos);
+                       if (path) gtk_editable_insert_text(GTK_EDITABLE(dd->entry), G_DIR_SEPARATOR_S, -1, &pos);
                        if (path) gtk_editable_insert_text(GTK_EDITABLE(dd->entry), path, -1, &pos);
                        }
                g_free(buf);
index e99ab6b..8d49340 100644 (file)
@@ -356,7 +356,7 @@ static void vd_pop_menu_up_cb(GtkWidget *widget, gpointer data)
        ViewDir *vd = data;
        gchar *path;
 
-       if (!vd->path || strcmp(vd->path, "/") == 0) return;
+       if (!vd->path || strcmp(vd->path, G_DIR_SEPARATOR_S) == 0) return;
        path = remove_level_from_path(vd->path);
 
        if (vd->select_func)
@@ -585,7 +585,7 @@ GtkWidget *vd_pop_menu(ViewDir *vd, FileData *fd)
                         G_CALLBACK(vd_popup_destroy_cb), vd);
 
        menu_item_add_stock_sensitive(menu, _("_Up to parent"), GTK_STOCK_GO_UP,
-                                     (vd->path && strcmp(vd->path, "/") != 0),
+                                     (vd->path && strcmp(vd->path, G_DIR_SEPARATOR_S) != 0),
                                      G_CALLBACK(vd_pop_menu_up_cb), vd);
 
        menu_item_add_divider(menu);
index b913871..1eca737 100644 (file)
@@ -231,7 +231,7 @@ static GList *parts_list(const gchar *path)
 
        list = g_list_reverse(list);
 
-       list = g_list_prepend(list, g_strdup("/"));
+       list = g_list_prepend(list, g_strdup(G_DIR_SEPARATOR_S));
 
        return list;
 }
@@ -895,7 +895,7 @@ static gint vdtree_sort_cb(GtkTreeModel *store, GtkTreeIter *a, GtkTreeIter *b,
 
 static void vdtree_setup_root(ViewDir *vd)
 {
-       const gchar *path = "/";
+       const gchar *path = G_DIR_SEPARATOR_S;
        FileData *fd;