gnome-utils r8181 - trunk/gnome-screenshot
- From: cosimoc svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-utils r8181 - trunk/gnome-screenshot
- Date: Sun, 9 Nov 2008 12:18:01 +0000 (UTC)
Author: cosimoc
Date: Sun Nov 9 12:18:01 2008
New Revision: 8181
URL: http://svn.gnome.org/viewvc/gnome-utils?rev=8181&view=rev
Log:
2008-11-09 Cosimo Cecchi <cosimoc gnome org>
* gnome-screenshot.c: (check_file_done), (try_check_file),
(prepare_screenshot), (get_desktop_dir):
Always use URIs to build the GFile when checking for existance.
Don't show an error message when the file-chooser can't find the
parent directory of the last saved position. (#321944).
Modified:
trunk/gnome-screenshot/ChangeLog
trunk/gnome-screenshot/gnome-screenshot.c
Modified: trunk/gnome-screenshot/gnome-screenshot.c
==============================================================================
--- trunk/gnome-screenshot/gnome-screenshot.c (original)
+++ trunk/gnome-screenshot/gnome-screenshot.c Sun Nov 9 12:18:01 2008
@@ -762,6 +762,7 @@
window = job->window;
retval = job->retval;
g_free (job->base_uris[1]);
+ g_free (job->base_uris[2]);
g_slice_free (AsyncExistenceJob, job);
finish_prepare_screenshot (retval, window);
@@ -810,7 +811,7 @@
retval = g_build_filename (job->base_uris[job->type], file_name, NULL);
g_free (file_name);
-
+
return retval;
}
@@ -849,8 +850,28 @@
*/
if (error->code == G_IO_ERROR_NOT_FOUND)
{
- job->retval = uri;
- goto out;
+ GFile *parent;
+
+ /* if the parent directory doesn't exist as well, forget the saved
+ * directory and treat this as a generic error.
+ */
+
+ parent = g_file_get_parent (file);
+
+ if (!g_file_query_exists (parent, NULL))
+ {
+ (job->type)++;
+ job->iteration = 0;
+
+ g_object_unref (file);
+ g_object_unref (parent);
+ goto retry;
+ }
+ else
+ {
+ job->retval = uri;
+ goto out;
+ }
}
else
{
@@ -927,9 +948,9 @@
job = g_slice_new0 (AsyncExistenceJob);
job->base_uris[0] = last_save_dir;
- /* we'll have to free this */
+ /* we'll have to free these two */
job->base_uris[1] = get_desktop_dir ();
- job->base_uris[2] = (char *) g_get_tmp_dir ();
+ job->base_uris[2] = g_strconcat ("file://", g_get_tmp_dir (), NULL);
job->iteration = 0;
job->type = TEST_LAST_DIR;
job->window = find_current_window (&window_title);
@@ -963,9 +984,9 @@
"/apps/nautilus/preferences/desktop_is_home_dir",
NULL);
if (desktop_is_home_dir)
- desktop_dir = g_build_filename (g_get_home_dir (), NULL);
+ desktop_dir = g_strconcat ("file://", g_get_home_dir (), NULL);
else
- desktop_dir = g_strdup (g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP));
+ desktop_dir = g_strconcat ("file://", g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP), NULL);
g_object_unref (gconf_client);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]