anjuta r4736 - in trunk: . plugins/gbf-am
- From: sgranjoux svn gnome org
- To: svn-commits-list gnome org
- Subject: anjuta r4736 - in trunk: . plugins/gbf-am
- Date: Wed, 11 Feb 2009 22:06:34 +0000 (UTC)
Author: sgranjoux
Date: Wed Feb 11 22:06:34 2009
New Revision: 4736
URL: http://svn.gnome.org/viewvc/anjuta?rev=4736&view=rev
Log:
* plugins/gbf-am/gbf-am-properties.c:
Fix #556148 â it's impossible to remove project variables
* plugins/gbf-am/plugin.c,
plugins/gbf-am/Makefile.am,
plugins/gbf-am/gbf-am-project.c:
Use Anjute debugging functions
Modified:
trunk/ChangeLog
trunk/plugins/gbf-am/Makefile.am
trunk/plugins/gbf-am/gbf-am-project.c
trunk/plugins/gbf-am/gbf-am-properties.c
trunk/plugins/gbf-am/plugin.c
Modified: trunk/plugins/gbf-am/Makefile.am
==============================================================================
--- trunk/plugins/gbf-am/Makefile.am (original)
+++ trunk/plugins/gbf-am/Makefile.am Wed Feb 11 22:06:34 2009
@@ -27,6 +27,7 @@
$(GIO_CFLAGS) \
$(LIBANJUTA_CFLAGS) \
-DSCRIPTS_DIR=\"$(scriptsdir)\"
+ -DG_LOG_DOMAIN=\"libgbf-am\"
plugin_LTLIBRARIES = \
libgbf-am.la
Modified: trunk/plugins/gbf-am/gbf-am-project.c
==============================================================================
--- trunk/plugins/gbf-am/gbf-am-project.c (original)
+++ trunk/plugins/gbf-am/gbf-am-project.c Wed Feb 11 22:06:34 2009
@@ -37,6 +37,7 @@
#include <libgnome/gnome-macros.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
+#include <libanjuta/anjuta-debug.h>
#include <libanjuta/anjuta-utils.h>
#include "gbf-am-project.h"
#include "gbf-am-config.h"
@@ -45,9 +46,8 @@
/* With debugging enable, the perl script gbf-am-parse outputs
* debugging messages not in xml format and the parser
* return an error */
-/*#define ENABLE_DEBUG*/
-#ifdef ENABLE_DEBUG
+#ifdef DEBUG
#define GBF_DEBUG(x) x
#else
#define GBF_DEBUG(x)
@@ -772,7 +772,7 @@
case G_FILE_MONITOR_EVENT_CHANGED:
case G_FILE_MONITOR_EVENT_DELETED:
/* monitor will be removed here... is this safe? */
- GBF_DEBUG (g_message ("File changed"));
+ DEBUG_PRINT ("File changed");
project_reload (project, NULL);
g_signal_emit_by_name (G_OBJECT (project), "project-updated");
break;
@@ -908,7 +908,7 @@
g_slist_free (change_set);
}
-#ifdef ENABLE_DEBUG
+#ifdef DEBUG
static void
change_set_debug_print (GSList *change_set)
{
@@ -1746,7 +1746,7 @@
g_return_if_fail (data != NULL);
if (data->child_pid) {
- GBF_DEBUG (g_message ("Killing child"));
+ DEBUG_PRINT ("Killing child");
kill (data->child_pid, SIGKILL);
data->child_pid = 0;
}
@@ -1826,7 +1826,7 @@
switch (status) {
case G_IO_STATUS_NORMAL:
- GBF_DEBUG (g_message ("wrote %" G_GSIZE_FORMAT " bytes", bytes_written));
+ DEBUG_PRINT ("wrote %" G_GSIZE_FORMAT " bytes", bytes_written);
if (data->input.length < data->input.size) {
/* don't remove the source */
@@ -1962,7 +1962,7 @@
spawn_kill_child (GbfAmSpawnData *data)
{
/* we can't wait longer */
- GBF_DEBUG (g_message ("Timeout: sending SIGTERM to child process"));
+ DEBUG_PRINT ("Timeout: sending SIGTERM to child process");
kill (data->child_pid, SIGTERM);
@@ -2023,7 +2023,7 @@
data->input.length = 0; /* for input buffer length acts as an index */
}
- GBF_DEBUG (g_message ("Spawning script"));
+ DEBUG_PRINT ("Spawning script");
if (!g_spawn_async_with_pipes (NULL, /* working dir */
argv,
Modified: trunk/plugins/gbf-am/gbf-am-properties.c
==============================================================================
--- trunk/plugins/gbf-am/gbf-am-properties.c (original)
+++ trunk/plugins/gbf-am/gbf-am-properties.c Wed Feb 11 22:06:34 2009
@@ -35,6 +35,8 @@
#include <glib/gi18n.h>
+#include <libanjuta/anjuta-debug.h>
+
#include "gbf-am-config.h"
#include "gbf-am-properties.h"
@@ -269,7 +271,7 @@
while (gtk_tree_model_iter_next (model, &child));
}
- if (strlen (packages_list->str) > 0)
+ if (packages_list->len > 0)
{
GbfAmConfigMapping *pkgmodule;
key_name = g_strconcat ("pkg_check_modules_",
@@ -302,8 +304,10 @@
gbf_am_config_value_set_string (value, packages_list->str);
}
g_free (key_name);
- }
+ }
g_free (module_name);
+
+ g_string_free (packages_list, TRUE);
}
static void
@@ -525,7 +529,9 @@
GTK_BUTTONS_YES_NO,
msg, name);
if (gtk_dialog_run (GTK_DIALOG (dlg)) == GTK_RESPONSE_YES)
+ {
gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
+ }
gtk_widget_destroy (dlg);
g_free (name);
if (has_parent)
@@ -702,9 +708,11 @@
if (value)
{
variables = gbf_am_config_value_get_mapping (value);
- value = gbf_am_config_value_new (GBF_AM_TYPE_STRING);
- gbf_am_config_value_set_string (value, "");
- gbf_am_config_mapping_insert (variables, name, value);
+ value = gbf_am_config_mapping_lookup (variables, name);
+ if (value)
+ {
+ gbf_am_config_value_set_string (value, NULL);
+ }
}
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
}
Modified: trunk/plugins/gbf-am/plugin.c
==============================================================================
--- trunk/plugins/gbf-am/plugin.c (original)
+++ trunk/plugins/gbf-am/plugin.c Wed Feb 11 22:06:34 2009
@@ -18,7 +18,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define DEBUG
#include <config.h>
#include <libanjuta/anjuta-debug.h>
#include <libanjuta/gbf-project.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]