[gnome-commander] Make search able to process remote folders
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Make search able to process remote folders
- Date: Sun, 3 Oct 2021 21:56:41 +0000 (UTC)
commit 04ce9f6349177d8f63b21066307021d3c37d0626
Author: Uwe Scholz <u scholz83 gmx de>
Date: Sun Oct 3 00:27:16 2021 +0200
Make search able to process remote folders
Still, the search crashes really often, see commit dae7dbb
src/dialogs/gnome-cmd-search-dialog.cc | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-search-dialog.cc b/src/dialogs/gnome-cmd-search-dialog.cc
index 1ad233fa..d9af5b48 100644
--- a/src/dialogs/gnome-cmd-search-dialog.cc
+++ b/src/dialogs/gnome-cmd-search-dialog.cc
@@ -697,37 +697,30 @@ void GnomeCmdSearchDialog::Private::on_dialog_response(GtkDialog *window, int re
data.match_dirs = nullptr;
auto uriString = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog->priv->dir_browser));
- auto dirGFile = g_file_new_for_uri (uriString);
+ auto gUri = g_uri_parse (uriString, G_URI_FLAGS_NONE, nullptr);
+
g_free (uriString);
- auto dirPathString = g_file_get_path (dirGFile);
- gchar *dir_path = g_strconcat (dirPathString, G_DIR_SEPARATOR_S, nullptr);
- g_free (dirPathString);
+ auto dirPathString = g_uri_get_path (gUri);
GnomeCmdCon *con = gnome_cmd_dir_get_connection (data.start_dir);
- if (strncmp(dir_path, gnome_cmd_con_get_root_path (con), con->root_path->len) != 0)
+ if (strncmp(dirPathString, gnome_cmd_con_get_root_path (con), con->root_path->len) != 0)
{
- //if (!gnome_vfs_uri_is_local (dirGFile))
- //{
- // gnome_cmd_show_message (*dialog, stringify(g_strdup_printf (_("Failed to change
directory outside of %s"),
- //
gnome_cmd_con_get_root_path (con))));
- // gnome_vfs_uri_unref (dirGFile);
- // g_free (dir_path);
- //
- // break;
- //}
- //else
- data.start_dir = gnome_cmd_dir_new (get_home_con (), gnome_cmd_con_create_path
(get_home_con (), dir_path));
+ if (!g_strcmp0(g_uri_get_scheme (gUri), "file") != 0)
+ {
+ gnome_cmd_show_message (*dialog, stringify(g_strdup_printf (_("Failed to change
directory outside of %s"),
+
gnome_cmd_con_get_root_path (con))));
+ break;
+ }
+ else
+ data.start_dir = gnome_cmd_dir_new (get_home_con (), gnome_cmd_con_create_path
(get_home_con (), dirPathString));
}
else
- data.start_dir = gnome_cmd_dir_new (con, gnome_cmd_con_create_path (con, dir_path +
con->root_path->len));
+ data.start_dir = gnome_cmd_dir_new (con, gnome_cmd_con_create_path (con, dirPathString +
con->root_path->len));
gnome_cmd_dir_ref (data.start_dir);
- g_object_unref (dirGFile);
- g_free (dir_path);
-
// save default settings
dialog->priv->profile_component->copy();
if (!dialog->defaults.default_profile.filename_pattern.empty())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]