[gnome-screenshot/gnome-3-4] Return NULL default screenshot dir on absence.
- From: Theppitak Karoonboonyanan <tkaroonb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screenshot/gnome-3-4] Return NULL default screenshot dir on absence.
- Date: Sun, 12 Aug 2012 14:02:03 +0000 (UTC)
commit e114d4de0b77946f67a904b83c4dc284340ce297
Author: Theppitak <thep linux thai net>
Date: Sun Aug 12 20:56:36 2012 +0700
Return NULL default screenshot dir on absence.
When XDG_PICTURES_DIR is not set, get_default_screenshot_dir() should return
NULL, not "file://".
https://bugzilla.gnome.org/show_bug.cgi?id=681659
src/screenshot-filename-builder.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/screenshot-filename-builder.c b/src/screenshot-filename-builder.c
index e143694..8b6d851 100644
--- a/src/screenshot-filename-builder.c
+++ b/src/screenshot-filename-builder.c
@@ -86,9 +86,14 @@ get_fallback_screenshot_dir (void)
static gchar *
get_default_screenshot_dir (void)
{
+ const gchar *pictures_dir;
gchar *shot_dir;
- shot_dir = g_strconcat ("file://", g_get_user_special_dir (G_USER_DIRECTORY_PICTURES), NULL);
+ pictures_dir = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
+ if (pictures_dir == NULL)
+ return NULL;
+
+ shot_dir = g_strconcat ("file://", pictures_dir, NULL);
return shot_dir;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]