[anjuta] Fix callback generation when user_data is set on glade.



commit 5e2e48f6e92c678b567f009e3fcb1e0f63ddf252
Author: Marco Diego Aurélio Mesquita <marcodiegomesquita gmail com>
Date:   Fri Mar 31 16:51:23 2017 -0300

    Fix callback generation when user_data is set on glade.
    
    Callback generation through drag-and-dro was broken a long time ago.
    
    Fix it to work correctly when dragging-and-dropping and also when user_data
    is set on glade.

 plugins/language-support-cpp-java/plugin.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/language-support-cpp-java/plugin.c b/plugins/language-support-cpp-java/plugin.c
index c31b4a6..ab6ef0c 100644
--- a/plugins/language-support-cpp-java/plugin.c
+++ b/plugins/language-support-cpp-java/plugin.c
@@ -69,7 +69,7 @@
 #define C_OFFSET 4
 
 #define CHDR_SEPARATOR " "
-#define CHDR_BODY ";\n"
+#define CHDR_BODY ";"
 #define CHDR_OFFSET 1
 
 /* Widgets marker */
@@ -436,7 +436,7 @@ get_text_between (IAnjutaEditor *editor, gchar *prefix, gchar *suffix)
 static gchar*
 prepare_callback_body (gchar* user_data, IAnjutaEditor* editor, gint *offset)
 {
-    if (g_strcmp0 (user_data, "(null)")) {
+    if (g_strcmp0 (user_data, "(null)") != 0 && g_strcmp0 (user_data, "(none)") != 0) {
         *offset = C_OFFSET + 1;
         return g_strdup_printf("\n{\n\tGObject *%s = G_OBJECT (user_data);\n\n}\n", user_data);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]