Commit 79f4ed46 authored by Sebastien Granjoux's avatar Sebastien Granjoux

Fix #556148 – it's impossible to remove project variables

	* 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

svn path=/trunk/; revision=4736
parent 4775cdb6
2009-02-11 Sébastien Granjoux <seb.sfo@free.fr>
* 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
2009-02-11 Yang Hong <hongyang@redflag-linux.com>
reviewed by: Sébastien Granjoux <seb.sfo@free.fr>
......@@ -27,6 +27,7 @@ AM_CPPFLAGS = \
$(GIO_CFLAGS) \
$(LIBANJUTA_CFLAGS) \
-DSCRIPTS_DIR=\"$(scriptsdir)\"
-DG_LOG_DOMAIN=\"libgbf-am\"
plugin_LTLIBRARIES = \
libgbf-am.la
......
......@@ -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 @@ monitor_cb (GFileMonitor *monitor,
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 @@ change_set_destroy (GSList *change_set)
g_slist_free (change_set);
}
#ifdef ENABLE_DEBUG
#ifdef DEBUG
static void
change_set_debug_print (GSList *change_set)
{
......@@ -1746,7 +1746,7 @@ spawn_shutdown (GbfAmSpawnData *data)
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 @@ spawn_write_child (GIOChannel *ioc, GIOCondition condition, gpointer user_data)
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 @@ static gboolean
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 @@ spawn_script (gchar **argv,
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,
......
......@@ -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 @@ save_packages_list (GbfAmProject *project, GbfAmConfigMapping *config,
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_",
......@@ -304,6 +306,8 @@ save_packages_list (GbfAmProject *project, GbfAmConfigMapping *config,
g_free (key_name);
}
g_free (module_name);
g_string_free (packages_list, TRUE);
}
static void
......@@ -525,7 +529,9 @@ remove_package_clicked_cb (GtkWidget *button, GbfAmProject *project)
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 @@ remove_variable_clicked_cb (GtkWidget *button, GtkWidget *top_level)
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);
}
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment