Revision: 624 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=624&view=rev Author: dmaphy Date: 2009-05-04 21:24:38 +0000 (Mon, 04 May 2009)
Log Message: ----------- - rename the unix name from debugger to geanygdb - move configuration directory in ~/.config/geany/plugins/ from debugger to geanygdb - handle this rev with care! - search for tty helper in $PREFIX/$LIBDIR/geany/ and fall back to configuration dir if not found
Modified Paths: -------------- trunk/geanygdb/ChangeLog trunk/geanygdb/INSTALL trunk/geanygdb/src/Makefile.am trunk/geanygdb/src/geanydebug.c
Modified: trunk/geanygdb/ChangeLog =================================================================== --- trunk/geanygdb/ChangeLog 2009-05-04 21:16:59 UTC (rev 623) +++ trunk/geanygdb/ChangeLog 2009-05-04 21:24:38 UTC (rev 624) @@ -1,3 +1,16 @@ +2009-05-04 Dominic Hopf dmaphy@googlemail.com + * search for a globally installed tty helper in $PREFIX/$LIBDIR/geany/, + and fall back to the users config dir if not found. this fixes problems when + the plugin is installed to ~/.config/geany/plugins/. + * rename configuration directory for this plugin from "debugger" to "geanygdb", + GeanyGDB will try to automatically rename ~/.config/geany/plugins/debugger/ + to ~/.config/geany/plugins/geanygdb/. + You are recommended to backup this directory. + +2009-05-02 Dominic Hopf dmaphy@googlemail.com + * fix a crash when trying to delete breakpoints or watchpoints without + selecting one - thanks to eht16 for the patch + 2009-05-01 Dominic Hopf dmaphy@googlemail.com * fix Geany version dependency in configure.in * rewrite Documentation (README and INSTALL) with ReST @@ -4,4 +17,4 @@
2009-04-18 Dominic Hopf dmaphy@googlemail.com * version bump to 0.0.2 - * this maintenance release will be comptabible with Geany 0.16 + * this maintenance release will be compatible with Geany 0.16
Modified: trunk/geanygdb/INSTALL =================================================================== --- trunk/geanygdb/INSTALL 2009-05-04 21:16:59 UTC (rev 623) +++ trunk/geanygdb/INSTALL 2009-05-04 21:24:38 UTC (rev 624) @@ -20,7 +20,7 @@ ./configure make cp src/.libs/geanygdb.so ~/.config/geany/plugins - cp src/geanygdb_ttyhelper ~/.config/geany/plugins + cp src/geanygdb_ttyhelper ~/.config/geany/plugins/geanygdb/ttyhelper/
Third
Modified: trunk/geanygdb/src/Makefile.am =================================================================== --- trunk/geanygdb/src/Makefile.am 2009-05-04 21:16:59 UTC (rev 623) +++ trunk/geanygdb/src/Makefile.am 2009-05-04 21:24:38 UTC (rev 624) @@ -24,5 +24,5 @@ bin_PROGRAMS = geanygdb_ttyhelper geanygdb_ttyhelper_SOURCES = ttyhelper.c
-AM_CFLAGS = @GEANY_CFLAGS@ -DLOCALEDIR=""$(localedir)"" -DPREFIX=""$(prefix)"" +AM_CFLAGS = @GEANY_CFLAGS@ -DLOCALEDIR=""$(localedir)"" -DPREFIX=""$(prefix)"" -DLIBDIR=""$(libdir)""
Modified: trunk/geanygdb/src/geanydebug.c =================================================================== --- trunk/geanygdb/src/geanydebug.c 2009-05-04 21:16:59 UTC (rev 623) +++ trunk/geanygdb/src/geanydebug.c 2009-05-04 21:24:38 UTC (rev 624) @@ -46,7 +46,7 @@
-#define unix_name "debugger" +#define unix_name "geanygdb"
PLUGIN_VERSION_CHECK(115) @@ -275,17 +275,49 @@ g_key_file_set_string(kf, unix_name, "term_cmd", gdbui_setup.options.term_cmd); g_key_file_set_boolean(kf, unix_name, "show_tooltips", gdbui_setup.options.show_tooltips); g_key_file_set_boolean(kf, unix_name, "show_icons", gdbui_setup.options.show_icons); - if (utils_mkdir(gdbio_setup.temp_dir, TRUE) != 0) + + if ( + g_file_test ( + g_build_filename(geany->app->configdir, "plugins", "debugger", NULL), + G_FILE_TEST_IS_DIR + ) + && + !g_file_test ( + g_build_filename(geany->app->configdir, "plugins", unix_name, NULL), + G_FILE_TEST_IS_DIR + ) + ) { - dialogs_show_msgbox(GTK_MESSAGE_ERROR, - _("Plugin configuration directory could not be created.")); + g_rename( + g_build_filename(geany->app->configdir, "plugins", "debugger", NULL), + g_build_filename(geany->app->configdir, "plugins", unix_name, NULL) + ); } + else { - gchar *data = g_key_file_to_data(kf, NULL, NULL); - utils_write_file(config_file, data); - g_free(data); + if (!g_file_test ( + g_build_filename(geany->app->configdir, "plugins", unix_name, NULL), + G_FILE_TEST_IS_DIR + ) + ) + { + if (utils_mkdir(gdbio_setup.temp_dir, TRUE) != 0) + { + dialogs_show_msgbox(GTK_MESSAGE_ERROR, + _("Plugin configuration directory could not be created.")); + } + + else + { + + gchar *data = g_key_file_to_data(kf, NULL, NULL); + utils_write_file(config_file, data); + g_free(data); + } + } } + g_key_file_free(kf); gtk_widget_destroy(GTK_BIN(frame)->child); gdbui_create_widgets(frame); @@ -351,16 +383,24 @@
gdbui_setup.main_window = geany->main_widgets->window;
- /** - * TODO: detect where this plugin is installed so that the path to - * geanygdb_ttyhelper can be automatically detected. + gdbio_setup.temp_dir = g_build_filename(geany->app->configdir, "plugins", unix_name, NULL); + + /* + * the tty helper binary is either in the user's config dir or globally + * installed in $PREFIX/$LIBDIR/geany/ */ - gdbio_setup.temp_dir = g_build_filename(geany->app->configdir, "plugins", unix_name, NULL); - /*gdbio_setup.tty_helper = g_build_filename(gdbio_setup.temp_dir, "geanygdb_ttyhelper", NULL);*/ - /* the tty helper binary is installed in $prefix/bin, so use this path */ - gdbio_setup.tty_helper = g_build_filename(PREFIX, "bin", "geanygdb_ttyhelper", NULL); + gdbio_setup.tty_helper = g_build_filename(PREFIX, LIBDIR, "geany", "ttyhelper", NULL); + if (! (g_file_test(gdbio_setup.tty_helper, G_FILE_TEST_IS_EXECUTABLE) && + g_file_test(gdbio_setup.tty_helper, G_FILE_TEST_IS_REGULAR))) + { + setptr(gdbio_setup.tty_helper, g_build_filename( + geany->app->configdir, "plugins", unix_name, "ttyhelper", NULL)); + } + + g_message(gdbio_setup.tty_helper); config_file = g_build_filename(gdbio_setup.temp_dir, "debugger.cfg", NULL); gdbui_opts_init(); + if (g_key_file_load_from_file(kf, config_file, G_KEY_FILE_NONE, NULL)) { GET_KEY_STR(mono_font); @@ -368,6 +408,7 @@ GET_KEY_BOOL(show_tooltips); GET_KEY_BOOL(show_icons); } + g_key_file_free(kf);
gdbui_setup.warn_func = warn_message_cb;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.