[gnome-commander] GnomeCmdFile: more C++ rework



commit 9e1ca2b8239a44f81b8a65e317d7585aa7a1e4ec
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Fri Aug 13 21:08:29 2010 +0200

    GnomeCmdFile: more C++ rework

 src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc |    2 +-
 src/dirlist.cc                                   |    2 +-
 src/gnome-cmd-advrename-lexer.ll                 |    2 +-
 src/gnome-cmd-delete-dialog.cc                   |    4 +-
 src/gnome-cmd-dir-indicator.cc                   |    2 +-
 src/gnome-cmd-dir.cc                             |    6 +-
 src/gnome-cmd-dir.h                              |    2 +-
 src/gnome-cmd-file-list.cc                       |   10 ++--
 src/gnome-cmd-file-props-dialog.cc               |    2 +-
 src/gnome-cmd-file-selector.cc                   |    2 +-
 src/gnome-cmd-file.cc                            |   61 ++++++++++------------
 src/gnome-cmd-file.h                             |   16 +++---
 src/gnome-cmd-main-win.cc                        |    6 +-
 src/gnome-cmd-prepare-xfer-dialog.cc             |    2 +-
 src/gnome-cmd-search-dialog.cc                   |    6 +-
 src/gnome-cmd-xfer.cc                            |    7 ++-
 src/tags/gnome-cmd-tags-file.cc                  |    2 +-
 src/utils.cc                                     |    8 ++--
 18 files changed, 70 insertions(+), 72 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc b/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc
index 252e65a..c98b0c6 100644
--- a/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc
+++ b/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc
@@ -519,7 +519,7 @@ void gnome_cmd_bookmark_goto (GnomeCmdBookmark *bookmark)
 void gnome_cmd_bookmark_add_current (GnomeCmdDir *dir)
 {
     gchar *path = gnome_cmd_dir_is_local (dir) ? gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dir)) :
-                                                 gnome_cmd_file_get_path (GNOME_CMD_FILE (dir));
+                                                 GNOME_CMD_FILE (dir)->get_path();
 
     if (!g_utf8_validate (path, -1, NULL))
     {
diff --git a/src/dirlist.cc b/src/dirlist.cc
index 5e7d3d9..0362ba3 100644
--- a/src/dirlist.cc
+++ b/src/dirlist.cc
@@ -91,7 +91,7 @@ inline void visprog_list (GnomeCmdDir *dir)
 
     GnomeVFSFileInfoOptions infoOpts = (GnomeVFSFileInfoOptions) (GNOME_VFS_FILE_INFO_FOLLOW_LINKS | GNOME_VFS_FILE_INFO_GET_MIME_TYPE);
 
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (GNOME_CMD_FILE (dir));
+    GnomeVFSURI *uri = GNOME_CMD_FILE (dir)->get_uri();
     gchar *uri_str = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
 
     DEBUG('l', "visprog_list: %s\n", uri_str);
diff --git a/src/gnome-cmd-advrename-lexer.ll b/src/gnome-cmd-advrename-lexer.ll
index f812220..602fa7d 100644
--- a/src/gnome-cmd-advrename-lexer.ll
+++ b/src/gnome-cmd-advrename-lexer.ll
@@ -464,7 +464,7 @@ char *gnome_cmd_advrename_gen_fname (GnomeCmdFile *f, size_t new_fname_size)
   const char *parent_dir, *grandparent_dir;
   int parent_dir_len, grandparent_dir_len;
 
-  find_dirs(gnome_cmd_file_get_path(f), parent_dir, grandparent_dir, parent_dir_len, grandparent_dir_len);
+  find_dirs(f->get_path(), parent_dir, grandparent_dir, parent_dir_len, grandparent_dir_len);
 
   for (vector<CHUNK *>::iterator i=fname_template.begin(); i!=fname_template.end(); ++i)
     switch ((*i)->type)
diff --git a/src/gnome-cmd-delete-dialog.cc b/src/gnome-cmd-delete-dialog.cc
index 9bcf767..c74df3c 100644
--- a/src/gnome-cmd-delete-dialog.cc
+++ b/src/gnome-cmd-delete-dialog.cc
@@ -169,7 +169,7 @@ static void perform_delete_operation (DeleteData *data)
         if (f->is_dotdot || strcmp(f->info->name, ".") == 0)
             continue;
 
-        GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+        GnomeVFSURI *uri = f->get_uri();
         if (!uri) continue;
 
         uri_list = g_list_append (uri_list, gnome_vfs_uri_ref (uri));
@@ -223,7 +223,7 @@ static gboolean update_delete_status_widgets (DeleteData *data)
             for (GList *tmp = data->files; tmp; tmp = tmp->next)
             {
                 GnomeCmdFile *f = GNOME_CMD_FILE (tmp->data);
-                GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+                GnomeVFSURI *uri = f->get_uri();
 
                 if (!gnome_vfs_uri_exists (uri))
                     f->is_deleted();
diff --git a/src/gnome-cmd-dir-indicator.cc b/src/gnome-cmd-dir-indicator.cc
index 2ebf629..4b6a5c8 100644
--- a/src/gnome-cmd-dir-indicator.cc
+++ b/src/gnome-cmd-dir-indicator.cc
@@ -393,7 +393,7 @@ static void on_bookmarks_add_current (GtkMenuItem *item, GnomeCmdDirIndicator *i
     GnomeCmdBookmark *bm = g_new0 (GnomeCmdBookmark, 1);
 
     bm->name = g_strdup (gnome_cmd_file_get_name (f));
-    bm->path = gnome_cmd_file_get_path (f);
+    bm->path = f->get_path();
     bm->group = group;
 
     group->bookmarks = g_list_append (group->bookmarks, bm);
diff --git a/src/gnome-cmd-dir.cc b/src/gnome-cmd-dir.cc
index 12ee57c..3fce77c 100644
--- a/src/gnome-cmd-dir.cc
+++ b/src/gnome-cmd-dir.cc
@@ -575,11 +575,11 @@ void gnome_cmd_dir_list_files (GnomeCmdDir *dir, gboolean visprog)
 {
     g_return_if_fail (GNOME_CMD_IS_DIR (dir));
 
-    if (!dir->priv->files || gnome_vfs_uri_is_local (gnome_cmd_file_get_uri (GNOME_CMD_FILE (dir))))
+    if (!dir->priv->files || gnome_vfs_uri_is_local (GNOME_CMD_FILE (dir)->get_uri()))
     {
         DEBUG ('l', "relisting files for 0x%x %s %d\n",
                dir,
-               gnome_cmd_file_get_path (GNOME_CMD_FILE (dir)),
+               GNOME_CMD_FILE (dir)->get_path(),
                visprog);
         gnome_cmd_dir_relist_files (dir, visprog);
     }
@@ -782,7 +782,7 @@ void gnome_cmd_dir_file_changed (GnomeCmdDir *dir, const gchar *uri_str)
 
     g_return_if_fail (GNOME_CMD_IS_FILE (f));
 
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *uri = f->get_uri();
     GnomeVFSFileInfo *info = gnome_vfs_file_info_new ();
     GnomeVFSResult res = gnome_vfs_get_file_info_uri (uri, info, GNOME_VFS_FILE_INFO_GET_MIME_TYPE);
     gnome_vfs_uri_unref (uri);
diff --git a/src/gnome-cmd-dir.h b/src/gnome-cmd-dir.h
index 19de981..629fd5c 100644
--- a/src/gnome-cmd-dir.h
+++ b/src/gnome-cmd-dir.h
@@ -158,7 +158,7 @@ inline gchar *gnome_cmd_dir_get_free_space (GnomeCmdDir *dir)
     g_return_val_if_fail (GNOME_CMD_IS_DIR (dir), NULL);
 
     GnomeVFSFileSize free_space;
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (GNOME_CMD_FILE (dir));
+    GnomeVFSURI *uri = GNOME_CMD_FILE (dir)->get_uri();
     GnomeVFSResult res = gnome_vfs_get_volume_free_space (uri, &free_space);
     gnome_vfs_uri_unref (uri);
 
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index 96827ca..56dbbc7 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -270,7 +270,7 @@ inline FileFormatData::FileFormatData(GnomeCmdFile *f, gboolean tree_size)
         text[GnomeCmdFileList::COLUMN_ICON] = NULL;
 
     // Prepare the strings to show
-    gchar *t1 = gnome_cmd_file_get_path (f);
+    gchar *t1 = f->get_path();
     gchar *t2 = g_path_get_dirname (t1);
     dpath = get_utf8 (t2);
     g_free (t1);
@@ -693,7 +693,7 @@ static char *build_selected_file_list (GnomeCmdFileList *fl, int *file_list_len)
             const gchar *fn = NULL;
             gchar *uri_str;
 
-            if (gnome_vfs_uri_is_local (gnome_cmd_file_get_uri (f)))
+            if (gnome_vfs_uri_is_local (f->get_uri()))
             {
 #ifdef UNESCAPE_LOCAL_FILES
                 fn = gnome_vfs_unescape_string (gnome_cmd_file_get_uri_str (f), 0);
@@ -904,8 +904,8 @@ static gint sort_by_dir (GnomeCmdFile *f1, GnomeCmdFile *f2, GnomeCmdFileList *f
     if (f1->info->type < f2->info->type)
         return 1;
 
-    // gchar *t1 = gnome_cmd_file_get_path (f1);
-    // gchar *t2 = gnome_cmd_file_get_path (f2);
+    // gchar *t1 = f1->get_path();
+    // gchar *t2 = f2->get_path();
     // gchar *d1 = g_path_get_dirname (t1);
     // gchar *d2 = g_path_get_dirname (t2);
 
@@ -1751,7 +1751,7 @@ void GnomeCmdFileList::show_files(GnomeCmdDir *dir)
     }
 
     // Create a parent dir file (..) if appropriate
-    gchar *path = gnome_cmd_file_get_path (GNOME_CMD_FILE (dir));
+    gchar *path = GNOME_CMD_FILE (dir)->get_path();
     if (path && strcmp (path, G_DIR_SEPARATOR_S) != 0)
         files = g_list_append (files, gnome_cmd_dir_new_parent_dir_file (dir));
     g_free (path);
diff --git a/src/gnome-cmd-file-props-dialog.cc b/src/gnome-cmd-file-props-dialog.cc
index f4dc2e3..6f9c5f2 100644
--- a/src/gnome-cmd-file-props-dialog.cc
+++ b/src/gnome-cmd-file-props-dialog.cc
@@ -723,7 +723,7 @@ GtkWidget *gnome_cmd_file_props_dialog_create (GnomeCmdFile *f)
 
     data->dialog = GTK_WIDGET (dialog);
     data->f = f;
-    data->uri = gnome_cmd_file_get_uri (f);
+    data->uri = f->get_uri();
     data->mutex = g_mutex_new ();
     data->msg = NULL;
     data->notebook = notebook;
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index f46b6af..4191e44 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -486,7 +486,7 @@ static void on_list_dir_changed (GnomeCmdFileList *fl, GnomeCmdDir *dir, GnomeCm
 {
     if (fs->priv->dir_history && !fs->priv->dir_history->locked())
     {
-        gchar *fpath = gnome_cmd_file_get_path (GNOME_CMD_FILE (dir));
+        gchar *fpath = GNOME_CMD_FILE (dir)->get_path();
         fs->priv->dir_history->add(fpath);
         g_free (fpath);
     }
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index 705b538..0d70be9 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -50,7 +50,7 @@ GList *all_files = NULL;
 
 static GnomeCmdFileInfoClass *parent_class = NULL;
 
-struct GnomeCmdFilePrivate
+struct GnomeCmdFile::Private
 {
     Handle *dir_handle;
     GTimeVal last_update;
@@ -119,7 +119,7 @@ static void init (GnomeCmdFile *f)
     // f->info = NULL;
     // f->collate_key = NULL;
 
-    f->priv = g_new0 (GnomeCmdFilePrivate, 1);
+    f->priv = g_new0 (GnomeCmdFile::Private, 1);
 
     // f->priv->dir_handle = NULL;
 
@@ -280,7 +280,7 @@ GnomeVFSResult gnome_cmd_file_chmod (GnomeCmdFile *f, GnomeVFSFilePermissions pe
     g_return_val_if_fail (f->info != NULL, GNOME_VFS_ERROR_CORRUPTED_DATA);
 
     f->info->permissions = perm;
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *uri = f->get_uri();
     GnomeVFSResult ret = gnome_vfs_set_file_info_uri (uri, f->info, GNOME_VFS_SET_FILE_INFO_PERMISSIONS);
     gnome_vfs_uri_unref (uri);
 
@@ -305,7 +305,7 @@ GnomeVFSResult gnome_cmd_file_chown (GnomeCmdFile *f, uid_t uid, gid_t gid)
         f->info->uid = uid;
     f->info->gid = gid;
 
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *uri = f->get_uri();
     GnomeVFSResult ret = gnome_vfs_set_file_info_uri (uri, f->info, GNOME_VFS_SET_FILE_INFO_OWNER);
     gnome_vfs_uri_unref (uri);
 
@@ -331,14 +331,14 @@ GnomeVFSResult gnome_cmd_file_rename (GnomeCmdFile *f, const gchar *new_name)
 
     new_info->name = const_cast<gchar *> (new_name);
 
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *uri = f->get_uri();
     GnomeVFSResult result = gnome_vfs_set_file_info_uri (uri, new_info, GNOME_VFS_SET_FILE_INFO_NAME);
     gnome_vfs_uri_unref (uri);
 
     if (result==GNOME_VFS_OK)       //  re-read GnomeVFSFileInfo for the new MIME type
     {
         const GnomeVFSFileInfoOptions infoOpts = (GnomeVFSFileInfoOptions) (GNOME_VFS_FILE_INFO_FOLLOW_LINKS|GNOME_VFS_FILE_INFO_GET_MIME_TYPE);
-        uri = gnome_cmd_file_get_uri (f, new_name);
+        uri = f->get_uri(new_name);
         result = gnome_vfs_get_file_info_uri (uri, new_info, infoOpts);
         gnome_vfs_uri_unref (uri);
     }
@@ -366,28 +366,27 @@ gchar *gnome_cmd_file_get_quoted_name (GnomeCmdFile *f)
 }
 
 
-gchar *gnome_cmd_file_get_path (GnomeCmdFile *f)
+gchar *GnomeCmdFile::get_path()
 {
-    g_return_val_if_fail (f != NULL, NULL);
-    g_return_val_if_fail (f->info != NULL, NULL);
+    g_return_val_if_fail (info != NULL, NULL);
 
-    if (strcmp (f->info->name, G_DIR_SEPARATOR_S) == 0)
+    if (strcmp (info->name, G_DIR_SEPARATOR_S) == 0)
         return g_strdup (G_DIR_SEPARATOR_S);
 
     GnomeCmdPath *path;
     gchar *path_str;
 
-    if (!has_parent_dir (f))
+    if (!has_parent_dir (this))
     {
-        if (GNOME_CMD_IS_DIR (f))
+        if (GNOME_CMD_IS_DIR (this))
         {
-            path = gnome_cmd_dir_get_path (GNOME_CMD_DIR (f));
+            path = gnome_cmd_dir_get_path (GNOME_CMD_DIR (this));
             return g_strdup (gnome_cmd_path_get_path (path));
         }
         g_assert ("Non directory file without owning directory");
     }
 
-    path = gnome_cmd_path_get_child (gnome_cmd_dir_get_path (get_parent_dir (f)), f->info->name);
+    path = gnome_cmd_path_get_child (gnome_cmd_dir_get_path (get_parent_dir (this)), info->name);
     path_str = g_strdup (gnome_cmd_path_get_path (path));
     gtk_object_destroy (GTK_OBJECT (path));
 
@@ -397,9 +396,8 @@ gchar *gnome_cmd_file_get_path (GnomeCmdFile *f)
 
 gchar *gnome_cmd_file_get_real_path (GnomeCmdFile *f)
 {
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *uri = f->get_uri();
     gchar *path = gnome_vfs_unescape_string (gnome_vfs_uri_get_path (uri), NULL);
-
     gnome_vfs_uri_unref (uri);
 
     return path;
@@ -417,20 +415,19 @@ gchar *gnome_cmd_file_get_quoted_real_path (GnomeCmdFile *f)
 }
 
 
-gchar *gnome_cmd_file_get_dirname (GnomeCmdFile *f)
+gchar *GnomeCmdFile::get_dirname()
 {
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *uri = get_uri();
     gchar *path = gnome_vfs_uri_extract_dirname (uri);
-
     gnome_vfs_uri_unref (uri);
 
     return path;
 }
 
 
-gchar *gnome_cmd_file_get_unescaped_dirname (GnomeCmdFile *f)
+gchar *GnomeCmdFile::get_unescaped_dirname()
 {
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *uri = get_uri();
     gchar *path = gnome_vfs_uri_extract_dirname (uri);
     gnome_vfs_uri_unref (uri);
     gchar *unescaped_path = gnome_vfs_unescape_string (path, NULL);
@@ -440,23 +437,21 @@ gchar *gnome_cmd_file_get_unescaped_dirname (GnomeCmdFile *f)
 }
 
 
-GnomeVFSURI *gnome_cmd_file_get_uri (GnomeCmdFile *f, const gchar *name)
+GnomeVFSURI *GnomeCmdFile::get_uri(const gchar *name)
 {
-    g_return_val_if_fail (GNOME_CMD_IS_FILE (f), NULL);
-
-    if (!has_parent_dir (f))
+    if (!has_parent_dir (this))
     {
-        if (GNOME_CMD_IS_DIR (f))
+        if (GNOME_CMD_IS_DIR (this))
         {
-            GnomeCmdPath *path = gnome_cmd_dir_get_path (GNOME_CMD_DIR (f));
-            GnomeCmdCon *con = gnome_cmd_dir_get_connection (GNOME_CMD_DIR (f));
+            GnomeCmdPath *path = gnome_cmd_dir_get_path (GNOME_CMD_DIR (this));
+            GnomeCmdCon *con = gnome_cmd_dir_get_connection (GNOME_CMD_DIR (this));
             return gnome_cmd_con_create_uri (con, path);
         }
         else
             g_assert ("Non directory file without owning directory");
     }
 
-    return gnome_cmd_dir_get_child_uri (get_parent_dir (f), name ? name : f->info->name);
+    return gnome_cmd_dir_get_child_uri (get_parent_dir (this), name ? name : info->name);
 }
 
 
@@ -464,7 +459,7 @@ gchar *gnome_cmd_file_get_uri_str (GnomeCmdFile *f, GnomeVFSURIHideOptions hide_
 {
     g_return_val_if_fail (GNOME_CMD_IS_FILE (f), NULL);
 
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *uri = f->get_uri();
     gchar *uri_str = gnome_vfs_uri_to_string (uri, hide_options);
     gnome_vfs_uri_unref (uri);
 
@@ -579,7 +574,7 @@ GnomeVFSFileSize gnome_cmd_file_get_tree_size (GnomeCmdFile *f)
     if (f->priv->tree_size != -1)
         return f->priv->tree_size;
 
-    GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *uri = f->get_uri();
     f->priv->tree_size = calc_tree_size (uri);
     gnome_vfs_uri_unref (uri);
 
@@ -766,7 +761,7 @@ void gnome_cmd_file_view (GnomeCmdFile *f, gint internal_viewer)
     if (!path_str)  return;
 
     GnomeCmdPath *path = gnome_cmd_plain_path_new (path_str);
-    GnomeVFSURI *src_uri = gnome_cmd_file_get_uri (f);
+    GnomeVFSURI *src_uri = f->get_uri();
     GnomeVFSURI *dest_uri = gnome_cmd_con_create_uri (get_home_con (), path);
 
     g_printerr ("Copying to: %s\n", path_str);
@@ -790,7 +785,7 @@ void gnome_cmd_file_edit (GnomeCmdFile *f)
         return;
 
     gchar *fpath = gnome_cmd_file_get_quoted_real_path (f);
-    gchar *dpath = gnome_cmd_file_get_unescaped_dirname (f);
+    gchar *dpath = f->get_unescaped_dirname();
     gchar *command = g_strdup_printf (gnome_cmd_data.get_editor(), fpath);
 
     run_command_indir (command, dpath, FALSE);
diff --git a/src/gnome-cmd-file.h b/src/gnome-cmd-file.h
index 5c84b18..e5cc7b4 100644
--- a/src/gnome-cmd-file.h
+++ b/src/gnome-cmd-file.h
@@ -29,19 +29,26 @@
     GTK_CHECK_TYPE (obj, gnome_cmd_file_get_type ())
 
 
-struct GnomeCmdFilePrivate;
 class GnomeCmdFileMetadata;
 
 struct GnomeCmdFile
 {
     GnomeCmdFileInfo parent;
 
+    class Private;
+
+    Private *priv;
+
     GnomeVFSFileInfo *info;
     gboolean is_dotdot;
     gchar *collate_key;                 // necessary for proper sorting of UTF-8 encoded file names
-    GnomeCmdFilePrivate *priv;
     GnomeCmdFileMetadata *metadata;
 
+    gchar *get_path();
+    gchar *get_dirname();
+    gchar *get_unescaped_dirname();
+    GnomeVFSURI *get_uri(const gchar *name=NULL);
+
     char *get_collation_fname() const    {  return collate_key ? collate_key : info->name;  }
 
     void update_info(GnomeVFSFileInfo *info);
@@ -91,13 +98,8 @@ inline gchar *gnome_cmd_file_get_name (GnomeCmdFile *f)
 }
 
 gchar *gnome_cmd_file_get_quoted_name (GnomeCmdFile *f);
-
-gchar *gnome_cmd_file_get_path (GnomeCmdFile *f);
 gchar *gnome_cmd_file_get_real_path (GnomeCmdFile *f);
 gchar *gnome_cmd_file_get_quoted_real_path (GnomeCmdFile *f);
-gchar *gnome_cmd_file_get_dirname (GnomeCmdFile *f);
-gchar *gnome_cmd_file_get_unescaped_dirname (GnomeCmdFile *f);
-GnomeVFSURI *gnome_cmd_file_get_uri (GnomeCmdFile *f, const gchar *name=NULL);
 gchar *gnome_cmd_file_get_uri_str (GnomeCmdFile *f, GnomeVFSURIHideOptions hide_options=GNOME_VFS_URI_HIDE_NONE);
 
 const gchar *gnome_cmd_file_get_extension (GnomeCmdFile *f);
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index 3c10f1b..cbde6fc 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -486,7 +486,7 @@ static void on_main_win_realize (GtkWidget *widget, GnomeCmdMainWin *mw)
 
     // if (gnome_cmd_data.cmdline_visibility)
     // {
-        // gchar *dpath = gnome_cmd_file_get_path (GNOME_CMD_FILE (mw->fs(LEFT)->get_directory()));
+        // gchar *dpath = GNOME_CMD_FILE (mw->fs(LEFT)->get_directory())->get_path();
         // gnome_cmd_cmdline_set_dir (GNOME_CMD_CMDLINE (mw->priv->cmdline), dpath);
         // g_free (dpath);
     // }
@@ -1319,8 +1319,8 @@ GnomeCmdState *GnomeCmdMainWin::get_state() const
     GnomeCmdDir *dir2 = fs2->get_directory();
 
     GnomeCmdState *state = &priv->state;
-    state->active_dir_uri = gnome_cmd_file_get_uri (GNOME_CMD_FILE (dir1));
-    state->inactive_dir_uri = gnome_cmd_file_get_uri (GNOME_CMD_FILE (dir2));
+    state->active_dir_uri = GNOME_CMD_FILE (dir1)->get_uri();
+    state->inactive_dir_uri = GNOME_CMD_FILE (dir2)->get_uri();
     state->active_dir_files = fs1->file_list()->get_visible_files();
     state->inactive_dir_files = fs2->file_list()->get_visible_files();
     state->active_dir_selected_files = fs1->file_list()->get_selected_files();
diff --git a/src/gnome-cmd-prepare-xfer-dialog.cc b/src/gnome-cmd-prepare-xfer-dialog.cc
index e5c88af..d85940e 100644
--- a/src/gnome-cmd-prepare-xfer-dialog.cc
+++ b/src/gnome-cmd-prepare-xfer-dialog.cc
@@ -89,7 +89,7 @@ static void on_ok (GtkButton *button, GnomeCmdPrepareXferDialog *dialog)
         }
         else
         {
-            gchar *t = gnome_cmd_file_get_path (GNOME_CMD_FILE (dialog->src_fs->get_directory()));
+            gchar *t = GNOME_CMD_FILE (dialog->src_fs->get_directory())->get_path();
             dest_path = g_build_filename (t, user_path, NULL);
             g_free (t);
         }
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index 199280a..dedc63e 100644
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -267,7 +267,7 @@ static void search_dir_r (GnomeCmdDir *dir, SearchData *data)
     {
         g_mutex_lock (data->pdata.mutex);
 
-        gchar *path = gnome_cmd_file_get_path (GNOME_CMD_FILE (dir));
+        gchar *path = GNOME_CMD_FILE (dir)->get_path();
         g_free (data->pdata.msg);
         data->pdata.msg = g_strdup_printf (_("Searching in: %s"), path);
         g_free (path);
@@ -630,7 +630,7 @@ static void on_goto (GtkButton *button, GnomeCmdSearchDialog *dialog)
     if (!f)
         return;
 
-    gchar *fpath = gnome_cmd_file_get_path (f);
+    gchar *fpath = f->get_path();
     gchar *dpath = g_path_get_dirname (fpath);
 
     GnomeCmdFileList *fl = main_win->fs(ACTIVE)->file_list();
@@ -974,7 +974,7 @@ GtkWidget *gnome_cmd_search_dialog_new (GnomeCmdDir *default_dir)
     gchar *new_path;
     GnomeCmdSearchDialog *dialog = (GnomeCmdSearchDialog *) gtk_type_new (gnome_cmd_search_dialog_get_type ());
 
-    gchar *path = gnome_cmd_file_get_path (GNOME_CMD_FILE (default_dir));
+    gchar *path = GNOME_CMD_FILE (default_dir)->get_path();
     if (path[strlen(path)-1] != '/')
     {
         new_path = g_strdup_printf ("%s/", path);
diff --git a/src/gnome-cmd-xfer.cc b/src/gnome-cmd-xfer.cc
index f62bfaa..0f32585 100644
--- a/src/gnome-cmd-xfer.cc
+++ b/src/gnome-cmd-xfer.cc
@@ -279,9 +279,10 @@ static gboolean update_xfer_gui_func (XferData *data)
 
                 for (; data->src_files; data->src_files = data->src_files->next)
                 {
-                    GnomeVFSURI *src_uri = gnome_cmd_file_get_uri ((GnomeCmdFile *) data->src_files->data);
+                    GnomeCmdFile *f = (GnomeCmdFile *) data->src_files->data;
+                    GnomeVFSURI *src_uri = f->get_uri();
                     if (!gnome_vfs_uri_exists (src_uri))
-                        data->src_fl->remove_file((GnomeCmdFile *) data->src_files->data);
+                        data->src_fl->remove_file(f);
                     g_free (src_uri);
                 }
             }
@@ -314,7 +315,7 @@ static gboolean update_xfer_gui_func (XferData *data)
 
 inline gboolean uri_is_parent_to_dir_or_equal (GnomeVFSURI *uri, GnomeCmdDir *dir)
 {
-    GnomeVFSURI *dir_uri = gnome_cmd_file_get_uri (GNOME_CMD_FILE (dir));
+    GnomeVFSURI *dir_uri = GNOME_CMD_FILE (dir)->get_uri ();
 
     gboolean is_parent = gnome_vfs_uri_is_parent (uri, dir_uri, TRUE);
 
diff --git a/src/tags/gnome-cmd-tags-file.cc b/src/tags/gnome-cmd-tags-file.cc
index 85d168c..d1c30a7 100644
--- a/src/tags/gnome-cmd-tags-file.cc
+++ b/src/tags/gnome-cmd-tags-file.cc
@@ -44,7 +44,7 @@ void gcmd_tags_file_load_metadata(GnomeCmdFile *f)
 
     // if (!f->is_local())  return;
 
-    gchar *dpath = gnome_cmd_file_get_dirname(f);
+    gchar *dpath = f->get_dirname();
 
     static char buff[32];
 
diff --git a/src/utils.cc b/src/utils.cc
index 9bf75e4..b4efc97 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -479,7 +479,7 @@ static void on_tmp_download_response (GtkWidget *w, gint id, TmpDlData *dldata)
 
         dldata->args[1] = (gpointer) path_str;
 
-        GnomeVFSURI *src_uri = gnome_vfs_uri_dup (gnome_cmd_file_get_uri (dldata->f));
+        GnomeVFSURI *src_uri = gnome_vfs_uri_dup (dldata->f->get_uri());
         GnomeCmdPath *path = gnome_cmd_plain_path_new (path_str);
         GnomeCmdCon *con = get_home_con ();
         GnomeVFSURI *dest_uri = gnome_cmd_con_create_uri (con, path);
@@ -664,7 +664,7 @@ void mime_exec_multiple (GList *files, GnomeCmdApp *app)
     {
         GnomeCmdFile *f = (GnomeCmdFile *) files->data;
 
-        if (gnome_vfs_uri_is_local (gnome_cmd_file_get_uri (f)))
+        if (gnome_vfs_uri_is_local (f->get_uri()))
             local_files = g_list_append (local_files, g_strdup (gnome_cmd_file_get_real_path (f)));
         else
         {
@@ -690,7 +690,7 @@ void mime_exec_multiple (GList *files, GnomeCmdApp *app)
 
                     if (!path_str) return;
 
-                    GnomeVFSURI *src_uri = gnome_vfs_uri_dup (gnome_cmd_file_get_uri (f));
+                    GnomeVFSURI *src_uri = gnome_vfs_uri_dup (f->get_uri());
                     GnomeCmdPath *path = gnome_cmd_plain_path_new (path_str);
                     GnomeVFSURI *dest_uri = gnome_cmd_con_create_uri (get_home_con (), path);
                     gtk_object_destroy (GTK_OBJECT (path));
@@ -1192,7 +1192,7 @@ GList *file_list_to_uri_list (GList *files)
     for (; files; files = files->next)
     {
         GnomeCmdFile *f = GNOME_CMD_FILE (files->data);
-        GnomeVFSURI *uri = gnome_cmd_file_get_uri (f);
+        GnomeVFSURI *uri = f->get_uri();
 
         if (!uri)
             g_warning ("NULL uri!!!");



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