[gnome-commander] Migrate get_uri_str function from gnome-vfs to gio
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Migrate get_uri_str function from gnome-vfs to gio
- Date: Sat, 20 Mar 2021 23:03:21 +0000 (UTC)
commit 3947daa29b25c090b2afe35fb966f898442e0557
Author: Uwe Scholz <u scholz83 gmx de>
Date: Mon Mar 15 22:02:30 2021 +0100
Migrate get_uri_str function from gnome-vfs to gio
src/gnome-cmd-file.cc | 8 ++------
src/gnome-cmd-file.h | 6 +++---
src/gnome-cmd-user-actions.cc | 8 ++++----
src/tags/gnome-cmd-tags-file.cc | 2 +-
4 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index 112bb59c..4daf795c 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -617,13 +617,9 @@ GnomeVFSURI *GnomeCmdFile::get_uri(const gchar *name)
}
-gchar *GnomeCmdFile::get_uri_str(GnomeVFSURIHideOptions hide_options)
+gchar *GnomeCmdFile::get_uri_str()
{
- GnomeVFSURI *uri = get_uri();
- gchar *uri_str = gnome_vfs_uri_to_string (uri, hide_options);
- gnome_vfs_uri_unref (uri);
-
- return uri_str;
+ return g_file_get_uri(this->gFile);
}
diff --git a/src/gnome-cmd-file.h b/src/gnome-cmd-file.h
index c255ce90..58c522e4 100644
--- a/src/gnome-cmd-file.h
+++ b/src/gnome-cmd-file.h
@@ -65,7 +65,7 @@ struct GnomeCmdFile
gchar *get_unescaped_dirname();
GnomeVFSURI *get_uri(const gchar *name=NULL);
- gchar *get_uri_str(GnomeVFSURIHideOptions hide_options=GNOME_VFS_URI_HIDE_PASSWORD);
+ gchar *get_uri_str();
char *get_collation_fname() const { return collate_key ? collate_key : info->name; }
@@ -165,10 +165,10 @@ inline gchar *gnome_cmd_file_get_quoted_real_path (GnomeCmdFile *f)
return f->get_quoted_real_path();
}
-inline gchar *gnome_cmd_file_get_uri_str (GnomeCmdFile *f, GnomeVFSURIHideOptions
hide_options=GNOME_VFS_URI_HIDE_PASSWORD)
+inline gchar *gnome_cmd_file_get_uri_str (GnomeCmdFile *f)
{
g_return_val_if_fail (f != NULL, NULL);
- return f->get_uri_str(hide_options);
+ return f->get_uri_str();
}
void gnome_cmd_file_show_properties (GnomeCmdFile *f);
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 3461e20a..4bf55e6b 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -1102,7 +1102,7 @@ void edit_copy_fnames (GtkMenuItem *menuitem, gpointer fileList)
get_file_list (fnames, sfl, gnome_cmd_file_get_real_path);
else
if (state_is_alt (mask))
- get_file_list (fnames, sfl, gnome_cmd_file_get_uri_str, GNOME_VFS_URI_HIDE_PASSWORD);
+ get_file_list (fnames, sfl, gnome_cmd_file_get_uri_str);
gtk_clipboard_set_text (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), fnames.c_str(), -1);
@@ -2045,7 +2045,7 @@ void help_about (GtkMenuItem *menuitem, gpointer not_used)
* \li \%D: quoted full path to the directory containg file
* \li \%%: percent sign
* Trailing blanks are removed.
- *
+ *
* \param[in] command A char array to be parsed
* \param[out] cmd A string with parsed symbols listed above
* \returns Length of the cmd string
@@ -2087,7 +2087,7 @@ int parse_command(string *cmd, const gchar *command)
*cmd += *s;
else
{
- if (*s == ' ' || *s == '\t')
+ if (*s == ' ' || *s == '\t')
{
continue;
}
@@ -2156,7 +2156,7 @@ int parse_command(string *cmd, const gchar *command)
case 'u': // %u fully qualified URI for the file (or list for multiple selections)
if (uri.empty())
- get_file_list (uri, sfl, gnome_cmd_file_get_uri_str, GNOME_VFS_URI_HIDE_PASSWORD);
+ get_file_list (uri, sfl, gnome_cmd_file_get_uri_str);
if (cmdcap < cmdlen + uri.length())
{
cmd->reserve(cmdlen + uri.length());
diff --git a/src/tags/gnome-cmd-tags-file.cc b/src/tags/gnome-cmd-tags-file.cc
index 34862188..93f4ca81 100644
--- a/src/tags/gnome-cmd-tags-file.cc
+++ b/src/tags/gnome-cmd-tags-file.cc
@@ -56,7 +56,7 @@ void gcmd_tags_file_load_metadata(GnomeCmdFile *f)
g_free (dpath);
- gchar *uri_str = f->get_uri_str(GNOME_VFS_URI_HIDE_PASSWORD);
+ gchar *uri_str = f->get_uri_str();
f->metadata->add(TAG_FILE_LINK, uri_str);
g_free (uri_str);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]