[file-roller/gnome-3-4] "Folder Content could not be displayed" error when using --extract
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller/gnome-3-4] "Folder Content could not be displayed" error when using --extract
- Date: Tue, 26 Jun 2012 17:03:23 +0000 (UTC)
commit 06ff14621a27172431abeef93839eec46f689121
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Jun 26 19:00:01 2012 +0200
"Folder Content could not be displayed" error when using --extract
convert the folder path to a uri
[bug #678884]
src/main.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index b126ef6..7a538d5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,7 +39,7 @@ static int add;
static char *extract_to = NULL;
static int extract;
static int extract_here;
-static char *default_url = NULL;
+static char *default_dir = NULL;
static guint startup_id = 0;
@@ -67,7 +67,7 @@ static const GOptionEntry options[] = {
N_("Extract the contents of the archives in the archive folder and quit the program"),
NULL },
- { "default-dir", '\0', 0, G_OPTION_ARG_STRING, &default_url,
+ { "default-dir", '\0', 0, G_OPTION_ARG_STRING, &default_dir,
N_("Default folder to use for the '--add' and '--extract' commands"),
N_("FOLDER") },
@@ -130,6 +130,7 @@ prepare_app (void)
{
char *extract_to_uri = NULL;
char *add_to_uri = NULL;
+ char *default_uri = NULL;
EggSMClient *client = NULL;
client = egg_sm_client_get ();
@@ -151,6 +152,9 @@ prepare_app (void)
if (add_to != NULL)
add_to_uri = get_uri_from_command_line (add_to);
+ if (default_dir != NULL)
+ default_uri = get_uri_from_command_line (default_dir);
+
if ((add_to != NULL) || (add == 1)) { /* Add files to an archive */
GtkWidget *window;
GList *file_list = NULL;
@@ -158,8 +162,8 @@ prepare_app (void)
int i = 0;
window = fr_window_new ();
- if (default_url != NULL)
- fr_window_set_default_dir (FR_WINDOW (window), default_url, TRUE);
+ if (default_uri != NULL)
+ fr_window_set_default_dir (FR_WINDOW (window), default_uri, TRUE);
while ((filename = remaining_args[i++]) != NULL)
file_list = g_list_prepend (file_list, get_uri_from_command_line (filename));
@@ -182,8 +186,8 @@ prepare_app (void)
int i = 0;
window = fr_window_new ();
- if (default_url != NULL)
- fr_window_set_default_dir (FR_WINDOW (window), default_url, TRUE);
+ if (default_uri != NULL)
+ fr_window_set_default_dir (FR_WINDOW (window), default_uri, TRUE);
fr_window_new_batch (FR_WINDOW (window));
while ((archive = remaining_args[i++]) != NULL) {
@@ -226,6 +230,7 @@ prepare_app (void)
}
}
+ g_free (default_uri);
g_free (add_to_uri);
g_free (extract_to_uri);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]