[gnome-commander] GnomeCmdFile: more C++ rework
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] GnomeCmdFile: more C++ rework
- Date: Sat, 20 Nov 2010 23:40:38 +0000 (UTC)
commit e49d2963784c949fcd8b77fd95315462e3760695
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Sun Nov 21 00:27:48 2010 +0100
GnomeCmdFile: more C++ rework
src/dialogs/gnome-cmd-advrename-dialog.cc | 10 +++---
src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc | 3 +-
src/dirlist.cc | 2 +-
src/gnome-cmd-chmod-dialog.cc | 2 +-
src/gnome-cmd-chown-dialog.cc | 2 +-
src/gnome-cmd-cmdline.cc | 2 +-
src/gnome-cmd-con.cc | 4 +-
src/gnome-cmd-dir-indicator.cc | 2 +-
src/gnome-cmd-dir.cc | 10 +++---
src/gnome-cmd-file-collection.cc | 4 +-
src/gnome-cmd-file-list.cc | 16 ++++----
src/gnome-cmd-file-popmenu.cc | 6 ++--
src/gnome-cmd-file-props-dialog.cc | 6 ++--
src/gnome-cmd-file-selector.cc | 19 +++++-----
src/gnome-cmd-file.cc | 37 +++++++++----------
src/gnome-cmd-file.h | 41 ++++++++++++++++++---
src/gnome-cmd-make-copy-dialog.cc | 2 +-
src/gnome-cmd-prepare-xfer-dialog.cc | 10 +++---
src/gnome-cmd-python-plugin.cc | 2 +-
src/gnome-cmd-rename-dialog.cc | 2 +-
src/gnome-cmd-search-dialog.cc | 4 +-
src/gnome-cmd-user-actions.cc | 10 +++---
src/gnome-cmd-xfer.cc | 2 +-
src/intviewer/viewer-window.cc | 2 +-
src/tags/gnome-cmd-tags-doc.cc | 2 +-
src/tags/gnome-cmd-tags-exiv2.cc | 2 +-
src/tags/gnome-cmd-tags-file.cc | 2 +-
src/tags/gnome-cmd-tags-poppler.cc | 2 +-
src/tags/gnome-cmd-tags-taglib.cc | 2 +-
src/utils.cc | 14 ++++----
30 files changed, 124 insertions(+), 100 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-advrename-dialog.cc b/src/dialogs/gnome-cmd-advrename-dialog.cc
index 7c63822..2eeffd1 100644
--- a/src/dialogs/gnome-cmd-advrename-dialog.cc
+++ b/src/dialogs/gnome-cmd-advrename-dialog.cc
@@ -311,7 +311,7 @@ void GnomeCmdAdvrenameDialog::Private::on_files_view_popup_menu__update_files (G
-1);
gtk_list_store_set (GTK_LIST_STORE (dialog->files), &i,
- COL_NAME, gnome_cmd_file_get_name (f),
+ COL_NAME, f->get_name(),
COL_SIZE, f->get_size(),
COL_DATE, f->get_mdate(FALSE),
COL_RENAME_FAILED, FALSE,
@@ -412,7 +412,7 @@ void GnomeCmdAdvrenameDialog::Private::on_files_view_cursor_changed (GtkTreeView
gtk_tree_model_get (model, &iter, COL_FILE, &f, -1);
if (f)
- dialog->priv->profile_component->set_sample_fname(gnome_cmd_file_get_name (f));
+ dialog->priv->profile_component->set_sample_fname(f->get_name());
}
}
@@ -454,7 +454,7 @@ void GnomeCmdAdvrenameDialog::Private::on_dialog_response (GnomeCmdAdvrenameDial
result = f->rename(new_name);
gtk_list_store_set (GTK_LIST_STORE (dialog->files), &i,
- COL_NAME, gnome_cmd_file_get_name (f),
+ COL_NAME, f->get_name(),
COL_RENAME_FAILED, result!=GNOME_VFS_OK,
-1);
@@ -710,7 +710,7 @@ GnomeCmdAdvrenameDialog::GnomeCmdAdvrenameDialog(GnomeCmdData::AdvrenameConfig &
void GnomeCmdAdvrenameDialog::set(GList *file_list)
{
- priv->profile_component->set_sample_fname(file_list ? gnome_cmd_file_get_name ((GnomeCmdFile *) file_list->data) : NULL);
+ priv->profile_component->set_sample_fname(file_list ? ((GnomeCmdFile *) file_list->data)->get_name() : NULL);
for (GtkTreeIter iter; file_list; file_list=file_list->next)
{
@@ -719,7 +719,7 @@ void GnomeCmdAdvrenameDialog::set(GList *file_list)
gtk_list_store_append (GTK_LIST_STORE (files), &iter);
gtk_list_store_set (GTK_LIST_STORE (files), &iter,
COL_FILE, f->ref(),
- COL_NAME, gnome_cmd_file_get_name (f),
+ COL_NAME, f->get_name(),
COL_SIZE, f->get_size(),
COL_DATE, f->get_mdate(FALSE),
-1);
diff --git a/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc b/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc
index eb7908c..bb12c33 100644
--- a/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc
+++ b/src/dialogs/gnome-cmd-manage-bookmarks-dialog.cc
@@ -518,8 +518,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 (dir)->get_path();
+ gchar *path = gnome_cmd_dir_is_local (dir) ? GNOME_CMD_FILE (dir)->get_real_path () : GNOME_CMD_FILE (dir)->get_path();
if (!g_utf8_validate (path, -1, NULL))
{
diff --git a/src/dirlist.cc b/src/dirlist.cc
index 76c13e8..bed2d23 100644
--- a/src/dirlist.cc
+++ b/src/dirlist.cc
@@ -116,7 +116,7 @@ inline void blocking_list (GnomeCmdDir *dir)
GnomeVFSFileInfoOptions infoOpts = (GnomeVFSFileInfoOptions) (GNOME_VFS_FILE_INFO_FOLLOW_LINKS | GNOME_VFS_FILE_INFO_GET_MIME_TYPE);
- gchar *uri_str = gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir));
+ gchar *uri_str = GNOME_CMD_FILE (dir)->get_uri_str();
DEBUG('l', "blocking_list: %s\n", uri_str);
dir->list_result = gnome_vfs_directory_list_load (&dir->infolist, uri_str, infoOpts);
diff --git a/src/gnome-cmd-chmod-dialog.cc b/src/gnome-cmd-chmod-dialog.cc
index 049afc0..18ce4d1 100644
--- a/src/gnome-cmd-chmod-dialog.cc
+++ b/src/gnome-cmd-chmod-dialog.cc
@@ -71,7 +71,7 @@ static void do_chmod (GnomeCmdFile *in, GnomeVFSFilePermissions perm, gboolean r
GnomeVFSResult ret = in->chmod(perm);
if (ret != GNOME_VFS_OK)
- gnome_cmd_show_message (NULL, gnome_cmd_file_get_name (in), gnome_vfs_result_to_string (ret));
+ gnome_cmd_show_message (NULL, in->get_name(), gnome_vfs_result_to_string (ret));
else
if (!recursive)
return;
diff --git a/src/gnome-cmd-chown-dialog.cc b/src/gnome-cmd-chown-dialog.cc
index 5984222..d549d77 100644
--- a/src/gnome-cmd-chown-dialog.cc
+++ b/src/gnome-cmd-chown-dialog.cc
@@ -54,7 +54,7 @@ static void do_chown (GnomeCmdFile *in, uid_t uid, gid_t gid, gboolean recurse)
if (ret != GNOME_VFS_OK)
{
- gchar *fpath = gnome_cmd_file_get_real_path (in);
+ gchar *fpath = in->get_real_path();
gchar *msg = g_strdup_printf (_("Could not chown %s"), fpath);
gnome_cmd_show_message (*main_win, msg, gnome_vfs_result_to_string (ret));
g_free (msg);
diff --git a/src/gnome-cmd-cmdline.cc b/src/gnome-cmd-cmdline.cc
index 64365b4..af063b5 100644
--- a/src/gnome-cmd-cmdline.cc
+++ b/src/gnome-cmd-cmdline.cc
@@ -103,7 +103,7 @@ static void on_exec (GnomeCmdCmdline *cmdline, gboolean term)
else
if (fs->is_local())
{
- gchar *fpath = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (fs->get_directory()));
+ gchar *fpath = GNOME_CMD_FILE (fs->get_directory())->get_real_path ();
run_command_indir (cmdline_text, fpath, term);
g_free (fpath);
diff --git a/src/gnome-cmd-con.cc b/src/gnome-cmd-con.cc
index 3007255..a785c5b 100644
--- a/src/gnome-cmd-con.cc
+++ b/src/gnome-cmd-con.cc
@@ -465,7 +465,7 @@ void gnome_cmd_con_add_to_cache (GnomeCmdCon *con, GnomeCmdDir *dir)
g_return_if_fail (GNOME_CMD_IS_CON (con));
g_return_if_fail (GNOME_CMD_IS_DIR (dir));
- gchar *uri_str = gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir));
+ gchar *uri_str = GNOME_CMD_FILE (dir)->get_uri_str();
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);
@@ -480,7 +480,7 @@ void gnome_cmd_con_remove_from_cache (GnomeCmdCon *con, GnomeCmdDir *dir)
g_return_if_fail (GNOME_CMD_IS_CON (con));
g_return_if_fail (GNOME_CMD_IS_DIR (dir));
- gchar *uri_str = gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir));
+ gchar *uri_str = GNOME_CMD_FILE (dir)->get_uri_str();
DEBUG ('k', "REMOVING 0x%p %s from the cache\n", dir, uri_str);
g_hash_table_remove (con->priv->all_dirs_map, uri_str);
diff --git a/src/gnome-cmd-dir-indicator.cc b/src/gnome-cmd-dir-indicator.cc
index 4b6a5c8..eaaec79 100644
--- a/src/gnome-cmd-dir-indicator.cc
+++ b/src/gnome-cmd-dir-indicator.cc
@@ -392,7 +392,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->name = g_strdup (f->get_name());
bm->path = f->get_path();
bm->group = group;
diff --git a/src/gnome-cmd-dir.cc b/src/gnome-cmd-dir.cc
index 52281de..320b357 100644
--- a/src/gnome-cmd-dir.cc
+++ b/src/gnome-cmd-dir.cc
@@ -457,7 +457,7 @@ static GList *create_file_list (GnomeCmdDir *dir, GList *info_list)
// look like normal directories
info->type = GNOME_VFS_FILE_TYPE_DIRECTORY;
// Determining smb MIME type: workgroup or server
- gchar *uri_str = gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir));
+ gchar *uri_str = GNOME_CMD_FILE (dir)->get_uri_str();
info->mime_type = strcmp (uri_str, "smb:///") == 0 ? g_strdup ("x-directory/smb-workgroup") :
g_strdup ("x-directory/smb-server");
@@ -622,7 +622,7 @@ void gnome_cmd_dir_update_path (GnomeCmdDir *dir)
if (!parent)
return;
- GnomeCmdPath *path = gnome_cmd_path_get_child (gnome_cmd_dir_get_path (parent), gnome_cmd_file_get_name (GNOME_CMD_FILE (dir)));
+ GnomeCmdPath *path = gnome_cmd_path_get_child (gnome_cmd_dir_get_path (parent), GNOME_CMD_FILE (dir)->get_name());
if (path)
gnome_cmd_dir_set_path (dir, path);
}
@@ -834,7 +834,7 @@ void gnome_cmd_dir_start_monitoring (GnomeCmdDir *dir)
if (dir->priv->monitor_users == 0)
{
- gchar *uri_str = gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir));
+ gchar *uri_str = GNOME_CMD_FILE (dir)->get_uri_str();
result = gnome_vfs_monitor_add (
&dir->priv->monitor_handle,
@@ -870,10 +870,10 @@ void gnome_cmd_dir_cancel_monitoring (GnomeCmdDir *dir)
GnomeVFSResult result = gnome_vfs_monitor_cancel (dir->priv->monitor_handle);
if (result == GNOME_VFS_OK)
DEBUG('n', "Removed monitor from 0x%p %s\n",
- dir, gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir)));
+ dir, GNOME_CMD_FILE (dir)->get_uri_str());
else
DEBUG('n', "Failed to remove monitor from 0x%p %s: %s\n",
- dir, gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir)),
+ dir, GNOME_CMD_FILE (dir)->get_uri_str(),
gnome_vfs_result_to_string (result));
dir->priv->monitor_handle = NULL;
diff --git a/src/gnome-cmd-file-collection.cc b/src/gnome-cmd-file-collection.cc
index 8cc0a7e..41e2ba4 100644
--- a/src/gnome-cmd-file-collection.cc
+++ b/src/gnome-cmd-file-collection.cc
@@ -32,7 +32,7 @@ void GnomeCmdFileCollection::add(GnomeCmdFile *f)
list = g_list_append (list, f);
- gchar *uri_str = gnome_cmd_file_get_uri_str (f);
+ gchar *uri_str = f->get_uri_str();
g_hash_table_insert (map, uri_str, f);
f->ref();
}
@@ -44,7 +44,7 @@ gboolean GnomeCmdFileCollection::remove(GnomeCmdFile *f)
list = g_list_remove (list, f);
- gchar *uri_str = gnome_cmd_file_get_uri_str (f);
+ gchar *uri_str = f->get_uri_str();
gboolean retval = g_hash_table_remove (map, uri_str);
g_free (uri_str);
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index 2c6c487..90815eb 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -279,12 +279,12 @@ inline FileFormatData::FileFormatData(GnomeCmdFile *f, gboolean tree_size)
if (gnome_cmd_data.ext_disp_mode == GNOME_CMD_EXT_DISP_STRIPPED
&& f->info->type == GNOME_VFS_FILE_TYPE_REGULAR)
{
- gchar *t = strip_extension (gnome_cmd_file_get_name (f));
+ gchar *t = strip_extension (f->get_name());
fname = get_utf8 (t);
g_free (t);
}
else
- fname = get_utf8 (gnome_cmd_file_get_name (f));
+ fname = get_utf8 (f->get_name());
if (gnome_cmd_data.ext_disp_mode != GNOME_CMD_EXT_DISP_WITH_FNAME)
fext = get_utf8 (f->get_extension());
@@ -694,12 +694,12 @@ static char *build_selected_file_list (GnomeCmdFileList *fl, int *file_list_len)
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);
+ fn = gnome_vfs_unescape_string (f->get_uri_str(), 0);
#endif
}
if (!fn)
- fn = gnome_cmd_file_get_uri_str (f);
+ fn = f->get_uri_str();
uri_str = g_strdup_printf ("%s\r\n", fn);
uri_str_list = g_list_append (uri_str_list, uri_str);
@@ -733,7 +733,7 @@ static char *build_selected_file_list (GnomeCmdFileList *fl, int *file_list_len)
if (listlen == 1)
{
GnomeCmdFile *f = (GnomeCmdFile *) sel_files->data;
- char *uri_str = g_strdup (gnome_cmd_file_get_uri_str (f));
+ char *uri_str = g_strdup (f->get_uri_str());
*file_list_len = strlen (uri_str) + 1;
return uri_str;
@@ -1679,7 +1679,7 @@ inline void add_file_to_clist (GnomeCmdFileList *fl, GnomeCmdFile *f, gint in_ro
// If we have been waiting for this file to show up, focus it
if (fl->priv->focus_later &&
- strcmp (gnome_cmd_file_get_name (f), fl->priv->focus_later) == 0)
+ strcmp (f->get_name(), fl->priv->focus_later) == 0)
focus_file_at_row (fl, row);
}
@@ -2637,7 +2637,7 @@ void GnomeCmdFileList::goto_directory(const gchar *in_dir)
g_free (dir);
return;
}
- focus_dir = gnome_cmd_file_get_name (GNOME_CMD_FILE (cwd));
+ focus_dir = GNOME_CMD_FILE (cwd)->get_name();
}
else
{
@@ -2962,6 +2962,6 @@ void GnomeCmdFileList::init_dnd()
XML::xstream &operator << (XML::xstream &xml, GnomeCmdFileList &fl)
{
- return xml << XML::tag("Tab") << XML::attr("dir") << gnome_cmd_file_get_real_path (GNOME_CMD_FILE (fl.cwd)) << XML::attr("sort") << fl.get_sort_column() << XML::attr("asc") << fl.get_sort_order() << XML::endtag();
+ return xml << XML::tag("Tab") << XML::attr("dir") << GNOME_CMD_FILE (fl.cwd)->get_real_path() << XML::attr("sort") << fl.get_sort_column() << XML::attr("asc") << fl.get_sort_order() << XML::endtag();
}
diff --git a/src/gnome-cmd-file-popmenu.cc b/src/gnome-cmd-file-popmenu.cc
index 7b2bbd9..3c9b979 100644
--- a/src/gnome-cmd-file-popmenu.cc
+++ b/src/gnome-cmd-file-popmenu.cc
@@ -135,12 +135,12 @@ static gboolean on_open_with_other_ok (GnomeCmdStringDialog *string_dialog, cons
for (; files; files = files->next)
{
cmd += ' ';
- cmd += stringify (gnome_cmd_file_get_quoted_real_path (GNOME_CMD_FILE (files->data)));
+ cmd += stringify (GNOME_CMD_FILE (files->data)->get_quoted_real_path());
}
GnomeCmdFileSelector *fs = main_win->fs(ACTIVE);
GnomeCmdDir *dir = fs->get_directory();
- gchar *dpath = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dir));
+ gchar *dpath = GNOME_CMD_FILE (dir)->get_real_path();
run_command_indir (cmd.c_str(), dpath, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (term_check)));
g_free (dpath);
@@ -400,7 +400,7 @@ inline gchar *get_default_application_action_name (GList *files)
return g_strdup(_("_Open"));
GnomeCmdFile *f = (GnomeCmdFile *) files->data;
- gchar *uri_str = gnome_cmd_file_get_uri_str (f);
+ gchar *uri_str = f->get_uri_str();
GnomeVFSMimeApplication *app = gnome_vfs_mime_get_default_application_for_uri (uri_str, f->info->mime_type);
g_free (uri_str);
diff --git a/src/gnome-cmd-file-props-dialog.cc b/src/gnome-cmd-file-props-dialog.cc
index bad84eb..edb740b 100644
--- a/src/gnome-cmd-file-props-dialog.cc
+++ b/src/gnome-cmd-file-props-dialog.cc
@@ -218,7 +218,7 @@ static void on_dialog_ok (GtkButton *btn, GnomeCmdFilePropsDialogPrivate *data)
const gchar *filename = gtk_entry_get_text (GTK_ENTRY (data->filename_entry));
- if (strcmp (filename, gnome_cmd_file_get_name (data->f)) != 0)
+ if (strcmp (filename, data->f->get_name()) != 0)
{
result = data->f->rename(filename);
@@ -377,7 +377,7 @@ inline GtkWidget *create_properties_tab (GnomeCmdFilePropsDialogPrivate *data)
label = create_bold_label (dialog, GNOME_CMD_IS_DIR (data->f) ? _("Directory name:") : _("File name:"));
table_add (table, label, 0, y, GTK_FILL);
- fname = get_utf8 (gnome_cmd_file_get_name (data->f));
+ fname = get_utf8 (data->f->get_name());
data->filename_entry = create_entry (dialog, "filename_entry", fname);
g_free (fname);
table_add (table, data->filename_entry, 1, y++, (GtkAttachOptions) (GTK_FILL|GTK_EXPAND));
@@ -398,7 +398,7 @@ inline GtkWidget *create_properties_tab (GnomeCmdFilePropsDialogPrivate *data)
{
GnomeCmdDir *dir = data->f->get_parent_dir();
GnomeCmdCon *con = dir ? gnome_cmd_dir_get_connection (dir) : NULL;
- gchar *location = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dir));
+ gchar *location = GNOME_CMD_FILE (dir)->get_real_path();
label = create_bold_label (dialog, _("Location:"));
table_add (table, label, 0, y, GTK_FILL);
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index f91c17f..47d9e5c 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -270,8 +270,7 @@ inline void add_file_to_cmdline (GnomeCmdFileList *fl, gboolean fullpath)
if (f && gnome_cmd_data.cmdline_visibility)
{
- gchar *text = fullpath ? gnome_cmd_file_get_quoted_real_path (f) :
- gnome_cmd_file_get_quoted_name (f);
+ gchar *text = fullpath ? f->get_quoted_real_path() : f->get_quoted_name();
gnome_cmd_cmdline_append_text (main_win->get_cmdline(), text);
gnome_cmd_cmdline_focus (main_win->get_cmdline());
@@ -286,7 +285,7 @@ inline void add_cwd_to_cmdline (GnomeCmdFileList *fl)
if (gnome_cmd_data.cmdline_visibility)
{
- gchar *dpath = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (fl->cwd));
+ gchar *dpath = GNOME_CMD_FILE (fl->cwd)->get_real_path();
gnome_cmd_cmdline_append_text (main_win->get_cmdline(), dpath);
g_free (dpath);
@@ -510,7 +509,7 @@ static void on_list_dir_changed (GnomeCmdFileList *fl, GnomeCmdDir *dir, GnomeCm
if (fl->cwd != dir) return;
- fs->notebook->set_label(gnome_cmd_file_get_name (GNOME_CMD_FILE (fl->cwd)));
+ fs->notebook->set_label(GNOME_CMD_FILE (fl->cwd)->get_name());
fs->priv->sel_first_file = FALSE;
fs->update_files();
@@ -973,7 +972,7 @@ static gboolean on_new_textfile_ok (GnomeCmdStringDialog *string_dialog, const g
GnomeCmdDir *dir = fs->get_directory();
g_return_val_if_fail (GNOME_CMD_IS_DIR (dir), TRUE);
- gchar *dpath = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dir));
+ gchar *dpath = GNOME_CMD_FILE (dir)->get_real_path();
gchar *filepath = g_build_filename (dpath, fname, NULL);
g_free (dpath);
g_return_val_if_fail (filepath, TRUE);
@@ -1005,7 +1004,7 @@ static gboolean on_create_symlink_ok (GnomeCmdStringDialog *string_dialog, const
}
GnomeVFSURI *uri = gnome_cmd_dir_get_child_uri (fs->get_directory(), fname);
- GnomeVFSResult result = gnome_vfs_create_symbolic_link (uri, gnome_cmd_file_get_uri_str (fs->priv->sym_file));
+ GnomeVFSResult result = gnome_vfs_create_symbolic_link (uri, fs->priv->sym_file->get_uri_str());
if (result == GNOME_VFS_OK)
{
@@ -1171,7 +1170,7 @@ void gnome_cmd_file_selector_create_symlink (GnomeCmdFileSelector *fs, GnomeCmdF
{
const gchar *labels[] = {_("Symbolic link name:")};
- gchar *fname = get_utf8 (gnome_cmd_file_get_name (f));
+ gchar *fname = get_utf8 (f->get_name());
gchar *text = g_strdup_printf (gnome_cmd_data_get_symlink_prefix (), fname);
g_free (fname);
@@ -1197,7 +1196,7 @@ void gnome_cmd_file_selector_create_symlinks (GnomeCmdFileSelector *fs, GList *f
for (; files; files=files->next)
{
GnomeCmdFile *f = (GnomeCmdFile *) files->data;
- gchar *fname = get_utf8 (gnome_cmd_file_get_name (f));
+ gchar *fname = get_utf8 (f->get_name());
gchar *symlink_name = g_strdup_printf (gnome_cmd_data_get_symlink_prefix (), fname);
GnomeVFSURI *uri = gnome_cmd_dir_get_child_uri (fs->get_directory(), symlink_name);
@@ -1209,7 +1208,7 @@ void gnome_cmd_file_selector_create_symlinks (GnomeCmdFileSelector *fs, GList *f
do
{
- result = gnome_vfs_create_symbolic_link (uri, gnome_cmd_file_get_uri_str (f));
+ result = gnome_vfs_create_symbolic_link (uri, f->get_uri_str());
if (result == GNOME_VFS_OK)
{
@@ -1331,7 +1330,7 @@ GtkWidget *GnomeCmdFileSelector::new_tab(GnomeCmdDir *dir, GnomeCmdFileList::Col
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (scrolled_window), *list);
- GtkWidget *label = gtk_label_new (dir ? gnome_cmd_file_get_name (GNOME_CMD_FILE (dir)) : NULL);
+ GtkWidget *label = gtk_label_new (dir ? GNOME_CMD_FILE (dir)->get_name() : NULL);
gint n = notebook->append_page(scrolled_window, label);
#if GTK_CHECK_VERSION (2, 10, 0)
gtk_notebook_set_tab_reorderable (*notebook, scrolled_window, TRUE);
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index dd2a0df..a03b13d 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -280,7 +280,7 @@ GnomeVFSResult GnomeCmdFile::chmod(GnomeVFSFilePermissions perm)
if (has_parent_dir (this))
{
GnomeCmdDir *dir = ::get_parent_dir (this);
- gchar *uri_str = gnome_cmd_file_get_uri_str (this);
+ gchar *uri_str = get_uri_str();
gnome_cmd_dir_file_changed (dir, uri_str);
g_free (uri_str);
}
@@ -304,7 +304,7 @@ GnomeVFSResult GnomeCmdFile::chown(uid_t uid, gid_t gid)
if (has_parent_dir (this))
{
GnomeCmdDir *dir = ::get_parent_dir (this);
- gchar *uri_str = gnome_cmd_file_get_uri_str (this);
+ gchar *uri_str = get_uri_str();
gnome_cmd_dir_file_changed (dir, uri_str);
g_free (uri_str);
}
@@ -336,7 +336,7 @@ GnomeVFSResult GnomeCmdFile::rename(const gchar *new_name)
if (result==GNOME_VFS_OK && has_parent_dir (this))
{
- gchar *old_uri_str = gnome_cmd_file_get_uri_str (this);
+ gchar *old_uri_str = get_uri_str();
update_info(new_info);
gnome_cmd_dir_file_renamed (::get_parent_dir (this), this, old_uri_str);
@@ -348,12 +348,11 @@ GnomeVFSResult GnomeCmdFile::rename(const gchar *new_name)
}
-gchar *gnome_cmd_file_get_quoted_name (GnomeCmdFile *f)
+gchar *GnomeCmdFile::get_quoted_name()
{
- 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);
- return quote_if_needed (f->info->name);
+ return quote_if_needed (info->name);
}
@@ -385,9 +384,9 @@ gchar *GnomeCmdFile::get_path()
}
-gchar *gnome_cmd_file_get_real_path (GnomeCmdFile *f)
+gchar *GnomeCmdFile::get_real_path()
{
- GnomeVFSURI *uri = f->get_uri();
+ GnomeVFSURI *uri = get_uri();
gchar *path = gnome_vfs_unescape_string (gnome_vfs_uri_get_path (uri), NULL);
gnome_vfs_uri_unref (uri);
@@ -395,9 +394,9 @@ gchar *gnome_cmd_file_get_real_path (GnomeCmdFile *f)
}
-gchar *gnome_cmd_file_get_quoted_real_path (GnomeCmdFile *f)
+gchar *GnomeCmdFile::get_quoted_real_path()
{
- gchar *path = gnome_cmd_file_get_real_path (f);
+ gchar *path = get_real_path();
gchar *ret = quote_if_needed (path);
g_free (path);
@@ -446,11 +445,9 @@ GnomeVFSURI *GnomeCmdFile::get_uri(const gchar *name)
}
-gchar *gnome_cmd_file_get_uri_str (GnomeCmdFile *f, GnomeVFSURIHideOptions hide_options)
+gchar *GnomeCmdFile::get_uri_str(GnomeVFSURIHideOptions hide_options)
{
- g_return_val_if_fail (GNOME_CMD_IS_FILE (f), NULL);
-
- GnomeVFSURI *uri = f->get_uri();
+ GnomeVFSURI *uri = get_uri();
gchar *uri_str = gnome_vfs_uri_to_string (uri, hide_options);
gnome_vfs_uri_unref (uri);
@@ -677,7 +674,7 @@ inline void do_view_file (GnomeCmdFile *f, gint internal_viewer=-1)
break;
case FALSE: {
- gchar *filename = gnome_cmd_file_get_quoted_real_path (f);
+ gchar *filename = f->get_quoted_real_path();
gchar *command = g_strdup_printf (gnome_cmd_data.get_viewer(), filename);
run_command (command);
g_free (filename);
@@ -714,7 +711,7 @@ void gnome_cmd_file_view (GnomeCmdFile *f, gint internal_viewer)
}
// The file is remote, let's download it to a temporary file first
- gchar *path_str = get_temp_download_filepath (gnome_cmd_file_get_name (f));
+ gchar *path_str = get_temp_download_filepath (f->get_name());
if (!path_str) return;
GnomeCmdPath *path = gnome_cmd_plain_path_new (path_str);
@@ -741,7 +738,7 @@ void gnome_cmd_file_edit (GnomeCmdFile *f)
if (!f->is_local())
return;
- gchar *fpath = gnome_cmd_file_get_quoted_real_path (f);
+ gchar *fpath = f->get_quoted_real_path();
gchar *dpath = f->get_unescaped_dirname();
gchar *command = g_strdup_printf (gnome_cmd_data.get_editor(), fpath);
@@ -824,7 +821,7 @@ void GnomeCmdFile::is_deleted()
{
if (has_parent_dir (this))
{
- gchar *uri_str = gnome_cmd_file_get_uri_str (this);
+ gchar *uri_str = get_uri_str();
gnome_cmd_dir_file_deleted (::get_parent_dir (this), uri_str);
g_free (uri_str);
}
@@ -833,7 +830,7 @@ void GnomeCmdFile::is_deleted()
void GnomeCmdFile::execute()
{
- gchar *fpath = gnome_cmd_file_get_real_path (this);
+ gchar *fpath = get_real_path();
gchar *dpath = g_path_get_dirname (fpath);
gchar *cmd = g_strdup_printf ("./%s", info->name);
diff --git a/src/gnome-cmd-file.h b/src/gnome-cmd-file.h
index 2c9c3b8..fc5d18d 100644
--- a/src/gnome-cmd-file.h
+++ b/src/gnome-cmd-file.h
@@ -52,10 +52,15 @@ struct GnomeCmdFile
void invalidate_metadata();
+ gchar *get_name();
+ gchar *get_quoted_name();
gchar *get_path();
+ gchar *get_real_path();
+ gchar *get_quoted_real_path();
gchar *get_dirname();
gchar *get_unescaped_dirname();
GnomeVFSURI *get_uri(const gchar *name=NULL);
+ gchar *get_uri_str(GnomeVFSURIHideOptions hide_options=GNOME_VFS_URI_HIDE_NONE);
char *get_collation_fname() const { return collate_key ? collate_key : info->name; }
@@ -106,6 +111,13 @@ struct GnomeCmdFileClass
GtkType gnome_cmd_file_get_type ();
+
+inline gchar *GnomeCmdFile::get_name()
+{
+ g_return_val_if_fail (info != NULL, NULL);
+ return info->name;
+}
+
GnomeCmdFile *gnome_cmd_file_new_from_uri (const gchar *local_full_path);
GnomeCmdFile *gnome_cmd_file_new (GnomeVFSFileInfo *info, GnomeCmdDir *dir);
void gnome_cmd_file_setup (GnomeCmdFile *f, GnomeVFSFileInfo *info, GnomeCmdDir *dir);
@@ -125,15 +137,32 @@ inline void gnome_cmd_file_unref (GnomeCmdFile *f)
inline gchar *gnome_cmd_file_get_name (GnomeCmdFile *f)
{
g_return_val_if_fail (f != NULL, NULL);
- g_return_val_if_fail (f->info != NULL, NULL);
+ return f->get_name();
+}
- return f->info->name;
+inline gchar *gnome_cmd_file_get_quoted_name (GnomeCmdFile *f)
+{
+ g_return_val_if_fail (f != NULL, NULL);
+ return f->get_quoted_name();
}
-gchar *gnome_cmd_file_get_quoted_name (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_uri_str (GnomeCmdFile *f, GnomeVFSURIHideOptions hide_options=GNOME_VFS_URI_HIDE_NONE);
+inline gchar *gnome_cmd_file_get_real_path (GnomeCmdFile *f)
+{
+ g_return_val_if_fail (f != NULL, NULL);
+ return f->get_real_path();
+}
+
+inline gchar *gnome_cmd_file_get_quoted_real_path (GnomeCmdFile *f)
+{
+ g_return_val_if_fail (f != NULL, NULL);
+ return f->get_quoted_real_path();
+}
+
+inline gchar *gnome_cmd_file_get_uri_str (GnomeCmdFile *f, GnomeVFSURIHideOptions hide_options=GNOME_VFS_URI_HIDE_NONE)
+{
+ g_return_val_if_fail (f != NULL, NULL);
+ return f->get_uri_str(hide_options);
+}
void gnome_cmd_file_show_properties (GnomeCmdFile *f);
void gnome_cmd_file_show_chown_dialog (GList *files);
diff --git a/src/gnome-cmd-make-copy-dialog.cc b/src/gnome-cmd-make-copy-dialog.cc
index 10ab1de..3528e4c 100644
--- a/src/gnome-cmd-make-copy-dialog.cc
+++ b/src/gnome-cmd-make-copy-dialog.cc
@@ -136,7 +136,7 @@ GtkWidget *gnome_cmd_make_copy_dialog_new (GnomeCmdFile *f, GnomeCmdDir *dir)
f->ref();
gnome_cmd_dir_ref (dir);
- gchar *msg = g_strdup_printf (_("Copy \"%s\" to"), gnome_cmd_file_get_name (f));
+ gchar *msg = g_strdup_printf (_("Copy \"%s\" to"), f->get_name());
GtkWidget *msg_label = create_label (GTK_WIDGET (dialog), msg);
g_free (msg);
diff --git a/src/gnome-cmd-prepare-xfer-dialog.cc b/src/gnome-cmd-prepare-xfer-dialog.cc
index d85940e..f61cfec 100644
--- a/src/gnome-cmd-prepare-xfer-dialog.cc
+++ b/src/gnome-cmd-prepare-xfer-dialog.cc
@@ -113,7 +113,7 @@ static void on_ok (GtkButton *button, GnomeCmdPrepareXferDialog *dialog)
{
// There exists a directory, copy into it using the original filename
dest_dir = gnome_cmd_dir_new (con, gnome_cmd_con_create_path (con, dest_path));
- dest_fn = g_strdup (gnome_cmd_file_get_name (f));
+ dest_fn = g_strdup (f->get_name());
}
else
if (res == GNOME_VFS_OK)
@@ -217,9 +217,9 @@ static void on_ok (GtkButton *button, GnomeCmdPrepareXferDialog *dialog)
goto bailout;
if (g_list_length (dialog->src_files) == 1)
- DEBUG ('x', "Starting xfer the file '%s' to '%s'\n", dest_fn, gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dest_dir)));
+ DEBUG ('x', "Starting xfer the file '%s' to '%s'\n", dest_fn, GNOME_CMD_FILE (dest_dir)->get_real_path());
else
- DEBUG ('x', "Starting xfer %d files to '%s'\n", g_list_length (dialog->src_files), gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dest_dir)));
+ DEBUG ('x', "Starting xfer %d files to '%s'\n", g_list_length (dialog->src_files), GNOME_CMD_FILE (dest_dir)->get_real_path());
gnome_cmd_dir_ref (dest_dir);
@@ -405,7 +405,7 @@ GtkWidget *gnome_cmd_prepare_xfer_dialog_new (GnomeCmdFileSelector *from, GnomeC
{
GnomeCmdFile *f = (GnomeCmdFile *) dialog->src_files->data;
- gchar *t = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dialog->default_dest_dir));
+ gchar *t = GNOME_CMD_FILE (dialog->default_dest_dir)->get_real_path();
gchar *path = get_utf8 (t);
gchar *fname = get_utf8 (f->info->name);
g_free (t);
@@ -422,7 +422,7 @@ GtkWidget *gnome_cmd_prepare_xfer_dialog_new (GnomeCmdFileSelector *from, GnomeC
}
else
{
- gchar *t = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dialog->default_dest_dir));
+ gchar *t = GNOME_CMD_FILE (dialog->default_dest_dir)->get_real_path();
dest_str = get_utf8 (t);
g_free (t);
}
diff --git a/src/gnome-cmd-python-plugin.cc b/src/gnome-cmd-python-plugin.cc
index 3f7dcd6..d0780a3 100644
--- a/src/gnome-cmd-python-plugin.cc
+++ b/src/gnome-cmd-python-plugin.cc
@@ -297,7 +297,7 @@ gboolean gnome_cmd_python_plugin_execute(const PythonPluginData *plugin, GnomeCm
for (gint i=0; f; f=f->next, ++i)
{
GnomeCmdFile *finfo = (GnomeCmdFile *) f->data;
- gchar *uri_str = gnome_cmd_file_get_uri_str (finfo);
+ gchar *uri_str = finfo->get_uri_str();
PyObject *pArgs = Py_BuildValue("(s)", uri_str);
PyObject *pURI = PyEval_CallObject(pURIclass, pArgs);
Py_XDECREF(pArgs);
diff --git a/src/gnome-cmd-rename-dialog.cc b/src/gnome-cmd-rename-dialog.cc
index 6ecb076..c017ffe 100644
--- a/src/gnome-cmd-rename-dialog.cc
+++ b/src/gnome-cmd-rename-dialog.cc
@@ -159,7 +159,7 @@ GtkWidget *gnome_cmd_rename_dialog_new (GnomeCmdFile *f, gint x, gint y, gint wi
gtk_container_add (GTK_CONTAINER (dialog), GTK_WIDGET (dialog->priv->textbox));
gtk_widget_set_style (GTK_WIDGET (dialog->priv->textbox), list_style);
- gchar *fname = get_utf8 (gnome_cmd_file_get_name (f));
+ gchar *fname = get_utf8 (f->get_name());
gtk_entry_set_text (dialog->priv->textbox, fname);
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index 95fe4fc..530c025 100644
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -155,7 +155,7 @@ static SearchFileData *read_search_file (SearchData *data, SearchFileData *searc
if (searchfile_data == NULL)
{
searchfile_data = g_new0 (SearchFileData, 1);
- searchfile_data->uri_str = gnome_cmd_file_get_uri_str (f);
+ searchfile_data->uri_str = f->get_uri_str();
result = gnome_vfs_open (&searchfile_data->handle, searchfile_data->uri_str, GNOME_VFS_OPEN_READ);
if (result != GNOME_VFS_OK)
@@ -635,7 +635,7 @@ static void on_goto (GtkButton *button, GnomeCmdSearchDialog *dialog)
GnomeCmdFileList *fl = main_win->fs(ACTIVE)->file_list();
fl->goto_directory(dpath);
- fl->focus_file(gnome_cmd_file_get_name (f), TRUE);
+ fl->focus_file(f->get_name(), TRUE);
g_free (fpath);
g_free (dpath);
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 397fc15..4cc26f4 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -95,7 +95,7 @@ inline gboolean append_real_path (string &s, GnomeCmdFile *f)
if (!f)
return FALSE;
- gchar *name = g_shell_quote (gnome_cmd_file_get_real_path (f));
+ gchar *name = g_shell_quote (f->get_real_path());
append_real_path (s, name);
@@ -1078,7 +1078,7 @@ void command_execute (GtkMenuItem *menuitem, gpointer command)
if (dir)
{
- stringify (dir_path, gnome_cmd_file_get_real_path (GNOME_CMD_FILE (dir)));
+ stringify (dir_path, GNOME_CMD_FILE (dir)->get_real_path());
stringify (quoted_dir_path, gnome_cmd_file_get_quoted_real_path (GNOME_CMD_FILE (dir)));
}
@@ -1169,7 +1169,7 @@ void command_execute (GtkMenuItem *menuitem, gpointer command)
void command_open_terminal (GtkMenuItem *menuitem, gpointer not_used)
{
- gchar *dpath = gnome_cmd_file_get_real_path (GNOME_CMD_FILE (get_fs (ACTIVE)->get_directory()));
+ gchar *dpath = GNOME_CMD_FILE (get_fs (ACTIVE)->get_directory())->get_real_path();
if (gnome_execute_terminal_shell (dpath, NULL) == -1)
gnome_cmd_show_message (NULL, _("Unable to open terminal"), g_strerror (errno));
@@ -1203,13 +1203,13 @@ void command_open_nautilus (GtkMenuItem *menuitem, gpointer not_used)
{
GnomeCmdFile *f = get_fl (ACTIVE)->get_selected_file();
- open_uri_in_nautilus (gnome_cmd_file_get_uri_str (GNOME_CMD_IS_DIR (f) ? f : GNOME_CMD_FILE (get_fs (ACTIVE)->get_directory())));
+ open_uri_in_nautilus ((GNOME_CMD_IS_DIR (f) ? f : GNOME_CMD_FILE (get_fs (ACTIVE)->get_directory()))->get_uri_str());
}
void command_open_nautilus_in_cwd (GtkMenuItem *menuitem, gpointer not_used)
{
- open_uri_in_nautilus (gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (get_fs (ACTIVE)->get_directory())));
+ open_uri_in_nautilus (GNOME_CMD_FILE (get_fs (ACTIVE)->get_directory())->get_uri_str());
}
diff --git a/src/gnome-cmd-xfer.cc b/src/gnome-cmd-xfer.cc
index c9f6673..fc473ea 100644
--- a/src/gnome-cmd-xfer.cc
+++ b/src/gnome-cmd-xfer.cc
@@ -344,7 +344,7 @@ inline gboolean file_is_already_in_dir (GnomeVFSURI *uri, GnomeCmdDir *dir)
{
gchar *tmp = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE);
gchar *uri_str = remove_basename (tmp);
- gchar *dir_uri_str = gnome_cmd_file_get_uri_str (GNOME_CMD_FILE (dir));
+ gchar *dir_uri_str = GNOME_CMD_FILE (dir)->get_uri_str();
gboolean ret = (strcmp (uri_str, dir_uri_str) == 0);
diff --git a/src/intviewer/viewer-window.cc b/src/intviewer/viewer-window.cc
index ca156c0..a1d0ff2 100644
--- a/src/intviewer/viewer-window.cc
+++ b/src/intviewer/viewer-window.cc
@@ -167,7 +167,7 @@ void gviewer_window_load_file (GViewerWindow *obj, GnomeCmdFile *f)
g_free (obj->priv->filename);
obj->priv->f = f;
- obj->priv->filename = gnome_cmd_file_get_real_path (f);
+ obj->priv->filename = f->get_real_path();
gviewer_load_file (obj->priv->viewer, obj->priv->filename);
gtk_window_set_title (GTK_WINDOW(obj), obj->priv->filename);
diff --git a/src/tags/gnome-cmd-tags-doc.cc b/src/tags/gnome-cmd-tags-doc.cc
index 556d0a6..19f060d 100644
--- a/src/tags/gnome-cmd-tags-doc.cc
+++ b/src/tags/gnome-cmd-tags-doc.cc
@@ -470,7 +470,7 @@ void gcmd_tags_libgsf_load_metadata(GnomeCmdFile *f)
if (!f->is_local()) return;
GError *err = NULL;
- gchar *fname = gnome_cmd_file_get_real_path (f);
+ gchar *fname = f->get_real_path();
DEBUG('t', "Loading doc metadata for '%s'\n", fname);
diff --git a/src/tags/gnome-cmd-tags-exiv2.cc b/src/tags/gnome-cmd-tags-exiv2.cc
index 6a738f3..569bd23 100644
--- a/src/tags/gnome-cmd-tags-exiv2.cc
+++ b/src/tags/gnome-cmd-tags-exiv2.cc
@@ -384,7 +384,7 @@ void gcmd_tags_exiv2_load_metadata(GnomeCmdFile *f)
if (!f->is_local()) return;
- gchar *fname = gnome_cmd_file_get_real_path (f);
+ gchar *fname = f->get_real_path();
DEBUG('t', "Loading image metadata for '%s'\n", fname);
diff --git a/src/tags/gnome-cmd-tags-file.cc b/src/tags/gnome-cmd-tags-file.cc
index d1c30a7..a635250 100644
--- a/src/tags/gnome-cmd-tags-file.cc
+++ b/src/tags/gnome-cmd-tags-file.cc
@@ -53,7 +53,7 @@ void gcmd_tags_file_load_metadata(GnomeCmdFile *f)
g_free (dpath);
- gchar *uri_str = gnome_cmd_file_get_uri_str (f, GNOME_VFS_URI_HIDE_PASSWORD);
+ gchar *uri_str = f->get_uri_str(GNOME_VFS_URI_HIDE_PASSWORD);
f->metadata->add(TAG_FILE_LINK, uri_str);
g_free (uri_str);
diff --git a/src/tags/gnome-cmd-tags-poppler.cc b/src/tags/gnome-cmd-tags-poppler.cc
index 17d1ebe..6f55287 100644
--- a/src/tags/gnome-cmd-tags-poppler.cc
+++ b/src/tags/gnome-cmd-tags-poppler.cc
@@ -307,7 +307,7 @@ void gcmd_tags_poppler_load_metadata(GnomeCmdFile *f)
// skip non pdf files, as pdf metatags extraction is very expensive...
if (!strstr (f->info->mime_type, "pdf")) return;
- gchar *fname = gnome_cmd_file_get_real_path (f);
+ gchar *fname = f->get_real_path();
DEBUG('t', "Loading PDF metadata for '%s'\n", fname);
diff --git a/src/tags/gnome-cmd-tags-taglib.cc b/src/tags/gnome-cmd-tags-taglib.cc
index 64fc5dd..1643389 100644
--- a/src/tags/gnome-cmd-tags-taglib.cc
+++ b/src/tags/gnome-cmd-tags-taglib.cc
@@ -436,7 +436,7 @@ void gcmd_tags_taglib_load_metadata(GnomeCmdFile *finfo)
if (!finfo->is_local()) return;
- const gchar *fname = gnome_cmd_file_get_real_path (finfo);
+ const gchar *fname = finfo->get_real_path();
DEBUG('t', "Loading audio metadata for '%s'\n", fname);
diff --git a/src/utils.cc b/src/utils.cc
index 26bb299..73b6191 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -473,7 +473,7 @@ static void on_tmp_download_response (GtkWidget *w, gint id, TmpDlData *dldata)
{
if (id == GTK_RESPONSE_YES)
{
- gchar *path_str = get_temp_download_filepath (gnome_cmd_file_get_name (dldata->f));
+ gchar *path_str = get_temp_download_filepath (dldata->f->get_name());
if (!path_str) return;
@@ -581,7 +581,7 @@ void mime_exec_single (GnomeCmdFile *f)
if (f->is_local())
{
args[0] = (gpointer) app;
- args[1] = (gpointer) g_strdup (gnome_cmd_file_get_real_path (f));
+ args[1] = (gpointer) g_strdup (f->get_real_path());
args[2] = (gpointer) g_path_get_dirname ((gchar *) args[1]); // set exec dir for local files
do_mime_exec_single (args);
}
@@ -590,7 +590,7 @@ void mime_exec_single (GnomeCmdFile *f)
if (gnome_cmd_app_get_handles_uris (app) && gnome_cmd_data.honor_expect_uris)
{
args[0] = (gpointer) app;
- args[1] = (gpointer) g_strdup (gnome_cmd_file_get_uri_str (f));
+ args[1] = (gpointer) g_strdup (f->get_uri_str());
// args[2] is NULL here (don't set exec dir for remote files)
do_mime_exec_single (args);
}
@@ -665,13 +665,13 @@ void mime_exec_multiple (GList *files, GnomeCmdApp *app)
GnomeCmdFile *f = (GnomeCmdFile *) files->data;
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)));
+ local_files = g_list_append (local_files, g_strdup (f->get_real_path()));
else
{
++no_of_remote_files;
if (gnome_cmd_app_get_handles_uris (app) && gnome_cmd_data.honor_expect_uris)
{
- local_files = g_list_append (local_files, g_strdup (gnome_cmd_file_get_uri_str (f)));
+ local_files = g_list_append (local_files, g_strdup (f->get_uri_str()));
}
else
{
@@ -686,7 +686,7 @@ void mime_exec_multiple (GList *files, GnomeCmdApp *app)
if (retid==1)
{
- gchar *path_str = get_temp_download_filepath (gnome_cmd_file_get_name (f));
+ gchar *path_str = get_temp_download_filepath (f->get_name());
if (!path_str) return;
@@ -965,7 +965,7 @@ GList *app_get_linked_libs (GnomeCmdFile *f)
gchar *s;
gchar tmp[256];
- gchar *arg = g_shell_quote (gnome_cmd_file_get_real_path (f));
+ gchar *arg = g_shell_quote (f->get_real_path());
gchar *cmd = g_strdup_printf ("ldd %s", arg);
g_free (arg);
FILE *fd = popen (cmd, "r");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]