[Xfce4-commits] r25708 - in mousepad/branches/nick_0_3: . mousepad
Nick Schermer
nick at xfce.org
Sat May 12 18:38:47 CEST 2007
Author: nick
Date: 2007-05-12 16:38:47 +0000 (Sat, 12 May 2007)
New Revision: 25708
Modified:
mousepad/branches/nick_0_3/ChangeLog
mousepad/branches/nick_0_3/mousepad/mousepad-private.h
mousepad/branches/nick_0_3/mousepad/mousepad-window.c
Log:
* mousepad/mousepad-window.c: Add extra tests if the file
really exists, because Gtk file dialogs hang if the
file does not exists.
Modified: mousepad/branches/nick_0_3/ChangeLog
===================================================================
--- mousepad/branches/nick_0_3/ChangeLog 2007-05-12 15:41:04 UTC (rev 25707)
+++ mousepad/branches/nick_0_3/ChangeLog 2007-05-12 16:38:47 UTC (rev 25708)
@@ -1,4 +1,10 @@
2007-05-12 Nick Schermer <nick at xfce.org>
+ * mousepad/mousepad-window.c: Add extra tests if the file
+ really exists, because Gtk file dialogs hang if the
+ file does not exists.
+
+
+2007-05-12 Nick Schermer <nick at xfce.org>
* mousepad/mousepad-window.c: Jump to active file when
opening a new document.
Modified: mousepad/branches/nick_0_3/mousepad/mousepad-private.h
===================================================================
--- mousepad/branches/nick_0_3/mousepad/mousepad-private.h 2007-05-12 15:41:04 UTC (rev 25707)
+++ mousepad/branches/nick_0_3/mousepad/mousepad-private.h 2007-05-12 16:38:47 UTC (rev 25708)
@@ -21,6 +21,7 @@
#ifndef __MOUSEPAD_PRIVATE_H__
#define __MOUSEPAD_PRIVATE_H__
+#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <libxfce4util/libxfce4util.h>
Modified: mousepad/branches/nick_0_3/mousepad/mousepad-window.c
===================================================================
--- mousepad/branches/nick_0_3/mousepad/mousepad-window.c 2007-05-12 15:41:04 UTC (rev 25707)
+++ mousepad/branches/nick_0_3/mousepad/mousepad-window.c 2007-05-12 16:38:47 UTC (rev 25708)
@@ -32,6 +32,8 @@
#include <unistd.h>
#endif
+#include <glib/gstdio.h>
+
#include <mousepad/mousepad-private.h>
#include <mousepad/mousepad-types.h>
#include <mousepad/mousepad-application.h>
@@ -927,6 +929,10 @@
/* get the current filename */
filename = mousepad_document_get_filename (document);
+
+ /* check if the file really exists */
+ if (g_file_test (filename, G_FILE_TEST_EXISTS) == FALSE)
+ filename = NULL;
if (force_save_as || filename == NULL)
{
@@ -2165,7 +2171,7 @@
active_filename = mousepad_document_get_filename (window->active);
/* set the current filename, if there is one */
- if (active_filename)
+ if (active_filename && g_file_test (active_filename, G_FILE_TEST_EXISTS))
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (chooser), active_filename);
}
More information about the Xfce4-commits
mailing list