[file-roller] respect the --default-dir option when creating an archive
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [file-roller] respect the --default-dir option when creating an archive
- Date: Thu, 15 Nov 2012 20:44:32 +0000 (UTC)
commit 3ee400c1d41fb902e65aa90c6f4bd02e705b1fac
Author: Paolo Bacchilega <paobac src gnome org>
Date: Thu Nov 15 21:27:44 2012 +0100
respect the --default-dir option when creating an archive
src/dlg-add.c | 2 ++
src/dlg-batch-add.c | 4 +++-
src/fr-window.c | 7 ++-----
3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/dlg-add.c b/src/dlg-add.c
index 547c046..dbc7e0a 100644
--- a/src/dlg-add.c
+++ b/src/dlg-add.c
@@ -276,6 +276,8 @@ sync_widgets_with_options (DialogData *data,
{
if (directory == NULL)
directory = fr_window_get_add_default_dir (data->window);
+ if (directory == NULL)
+ directory = _g_file_get_home ();
if (files != NULL)
fr_file_selector_dialog_set_selected_files (FR_FILE_SELECTOR_DIALOG (data->dialog), files);
diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c
index 3c82c7f..640eb6a 100644
--- a/src/dlg-batch-add.c
+++ b/src/dlg-batch-add.c
@@ -69,7 +69,9 @@ dlg_batch_add_files (FrWindow *window,
g_return_if_fail (file_list != NULL);
first_file = G_FILE (file_list->data);
- parent = g_file_get_parent (first_file);
+ parent = _g_object_ref (fr_window_get_add_default_dir (window));
+ if (parent == NULL)
+ parent = g_file_get_parent (first_file);
filename = NULL;
if (file_list->next == NULL)
diff --git a/src/fr-window.c b/src/fr-window.c
index f187989..d1192f1 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -5390,7 +5390,7 @@ fr_window_construct (FrWindow *window)
window->priv->action = FR_ACTION_NONE;
window->priv->open_default_dir = g_object_ref (_g_file_get_home ());
- window->priv->add_default_dir = g_object_ref (_g_file_get_home ());
+ window->priv->add_default_dir = NULL;
window->priv->extract_default_dir = g_object_ref (_g_file_get_home ());
window->priv->give_focus_to_the_list = FALSE;
@@ -9099,10 +9099,7 @@ fr_window_set_add_default_dir (FrWindow *window,
GFile *
fr_window_get_add_default_dir (FrWindow *window)
{
- if (window->priv->add_default_dir == NULL)
- return _g_file_get_home ();
- else
- return window->priv->add_default_dir;
+ return window->priv->add_default_dir;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]