[Xfce4-commits] <xfce4-screenshooter:master> If the user does not specify a save location, fallback to home.
Jérôme Guelfucci
jeromeg at xfce.org
Fri Aug 14 00:26:13 CEST 2009
Updating branch refs/heads/master
to 516c7c9a098e8ccf2f904721c59854d817576428 (commit)
from 6e4a655b63002699138cd715ff41fc3636dd79b9 (commit)
commit 516c7c9a098e8ccf2f904721c59854d817576428
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date: Mon Aug 3 19:53:57 2009 +0200
If the user does not specify a save location, fallback to home.
ChangeLog | 4 ++++
src/main.c | 9 +++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index fa50c20..c3a562d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,10 @@ Updated Italian and Galician documentation translation.
2009-08-03 jeromeg
+If the user does not specify a save location, fallback to home.
+
+2009-08-03 jeromeg
+
Fix a crash in the panel plugin and improve cli options handling.
Don't exit the gtk main loop when running the panel plugin, or the
diff --git a/src/main.c b/src/main.c
index 3af8206..8a086f7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -226,7 +226,6 @@ int main (int argc, char **argv)
if (G_UNLIKELY (!g_file_query_exists (default_save_dir, NULL)))
{
g_free (sd->screenshot_dir);
-
sd->screenshot_dir = screenshooter_get_home_uri ();
}
@@ -272,7 +271,7 @@ int main (int argc, char **argv)
sd->action = SAVE;
}
- /* If the user gave a directory name, verify that it is valid */
+ /* If the user gave a directory name, check that it is valid */
if (screenshot_dir != NULL)
{
default_save_dir = g_file_new_for_commandline_arg (screenshot_dir);
@@ -291,6 +290,12 @@ int main (int argc, char **argv)
g_object_unref (default_save_dir);
g_free (screenshot_dir);
}
+ /* Else we fallback to the home directory */
+ else
+ {
+ g_free (sd->screenshot_dir);
+ sd->screenshot_dir = screenshooter_get_home_uri ();
+ }
g_idle_add ((GSourceFunc) screenshooter_take_screenshot_idle, sd);
}
More information about the Xfce4-commits
mailing list