SF.net SVN: geany-plugins:[913] trunk/geany-plugins/geanygdb

dmaphy at users.sourceforge.net dmaphy at xxxxx
Wed Sep 2 20:29:41 UTC 2009


Revision: 913
          http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=913&view=rev
Author:   dmaphy
Date:     2009-09-02 20:29:40 +0000 (Wed, 02 Sep 2009)

Log Message:
-----------
fix an issue with button labels, where some localizations may caused a stack overflow; rember the last targetpath

Modified Paths:
--------------
    trunk/geany-plugins/geanygdb/ChangeLog
    trunk/geany-plugins/geanygdb/src/gdb-ui-main.c

Modified: trunk/geany-plugins/geanygdb/ChangeLog
===================================================================
--- trunk/geany-plugins/geanygdb/ChangeLog	2009-09-01 15:37:53 UTC (rev 912)
+++ trunk/geany-plugins/geanygdb/ChangeLog	2009-09-02 20:29:40 UTC (rev 913)
@@ -1,3 +1,8 @@
+2009-09-02 Dominic Hopf <dmaphy at googlemail.com>
+ * fix an issue with button labels, where some localizations may caused a stack
+   overflow
+ * rember the last targetpath
+
 2009-05-07 Dominic Hopf <dmaphy at googlemail.com>
  * install ttyhelper and geanydebug.so to /usr/lib/geany/
    patch by Chow Loong Jin, thanks!

Modified: trunk/geany-plugins/geanygdb/src/gdb-ui-main.c
===================================================================
--- trunk/geany-plugins/geanygdb/src/gdb-ui-main.c	2009-09-01 15:37:53 UTC (rev 912)
+++ trunk/geany-plugins/geanygdb/src/gdb-ui-main.c	2009-09-02 20:29:40 UTC (rev 913)
@@ -74,7 +74,13 @@
 #define blue   "#0000FF"
 #define yellow "#FFFF00"
 
+/*
+ * targetpath is to remember the path of the executable. Will be set in
+ * load_click()
+ */
+gchar* targetpath = NULL;
 
+
 void
 gdbui_enable(gboolean enabled)
 {
@@ -366,8 +372,7 @@
 	if (text && disable_mnemonics)
 	{
 		gchar *p;
-		gchar buf[32];
-		strncpy(buf, text, sizeof(buf));
+		gchar *buf = g_strdup(text);
 		for (p = buf; *p; p++)
 		{
 			if (*p == '_')
@@ -486,6 +491,12 @@
 						     GTK_FILE_CHOOSER_ACTION_OPEN,
 						     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 						     GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
+
+	if (targetpath != NULL)
+	{
+		gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(dlg), targetpath);
+	}
+
 	do
 	{
 		if (errmsg)
@@ -493,9 +504,12 @@
 			err_func(errmsg);
 			errmsg = NULL;
 		}
+
 		if (gtk_dialog_run(GTK_DIALOG(dlg)) == GTK_RESPONSE_ACCEPT)
 		{
 			gchar *fn = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dlg));
+			targetpath = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dlg));
+
 			if (fn)
 			{
 				if (access(fn, R_OK) == 0)


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



More information about the Plugins-Commits mailing list