SF.net SVN: geany:[3225] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Nov 14 13:38:59 UTC 2008


Revision: 3225
          http://geany.svn.sourceforge.net/geany/?rev=3225&view=rev
Author:   ntrel
Date:     2008-11-14 13:38:59 +0000 (Fri, 14 Nov 2008)

Log Message:
-----------
Prompt the user for whether to move the configuration directory or
just quit instead. This is useful if the user is already running an
older binary of Geany and the second instance is newer.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/main.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-11-13 17:22:23 UTC (rev 3224)
+++ trunk/ChangeLog	2008-11-14 13:38:59 UTC (rev 3225)
@@ -1,3 +1,11 @@
+2008-11-14  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/main.c:
+   Prompt the user for whether to move the configuration directory or
+   just quit instead. This is useful if the user is already running an
+   older binary of Geany and the second instance is newer.
+
+
 2008-11-13  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * HACKING, doc/geany.1.in, doc/geany.html, doc/geany.txt,

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2008-11-13 17:22:23 UTC (rev 3224)
+++ trunk/src/main.c	2008-11-14 13:38:59 UTC (rev 3225)
@@ -608,6 +608,12 @@
 			/* move the old config dir if it exists */
 			if (g_file_test(old_dir, G_FILE_TEST_EXISTS))
 			{
+				if (! dialogs_show_question_full(main_widgets.window,
+					GTK_STOCK_YES, GTK_STOCK_QUIT, _("Move it now?"),
+					"%s",
+					_("Geany needs to move your old configuration directory before starting.")))
+					exit(0);
+
 				if (g_rename(old_dir, app->configdir) == 0)
 				{
 					dialogs_show_msgbox(GTK_MESSAGE_INFO,
@@ -693,11 +699,9 @@
 static gint setup_config_dir(void)
 {
 	gint mkdir_result = 0;
-	gchar *tmp = app->configdir;
 
 	/* convert configdir to locale encoding to avoid troubles */
-	app->configdir = utils_get_locale_from_utf8(app->configdir);
-	g_free(tmp);
+	setptr(app->configdir, utils_get_locale_from_utf8(app->configdir));
 
 	mkdir_result = create_config_dir();
 	if (mkdir_result != 0)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list