GNOME Bugzilla – Bug 669023
Anjuta should automatically detect which file will hold members for ui widgets.
Last modified: 2012-02-08 20:47:17 UTC
Created attachment 206416 [details] [review] Automatically detect which file that will hold member widgets declaration and initialization. The attached patch implements automatic file detection for the file that will hold member widgets declaration and initialization. The typename is currently unused, but is required for proper Vala integration. Please review it.
Review of attachment 206416 [details] [review]: Should be OK for Vala, thanks. I'm however not sure it is acceptable to assume that the source file and ui file are in the same directory. One more thing: your style doesn't seem very consistent, especially regarding space after function name. ::: plugins/glade/plugin.c @@ +354,3 @@ + if(docs) { + gchar *widget_name = glade_widget_get_name (widget); + gchar *widget_typename = G_OBJECT_TYPE_NAME (G_OBJECT (glade_widget_get_object(widget))); you don't need the G_OBJECT cast here @@ +358,3 @@ + IAnjutaDocument *curr_doc = IANJUTA_DOCUMENT(data); + if(IANJUTA_IS_EDITOR(curr_doc)) { + printf("Emitting signal!\n"); A forgotten debug statement? You can use DEBUG_PRINT if you want to keep it. ::: plugins/language-support-cpp-java/plugin.c @@ +893,3 @@ + gchar *current_filedir = g_file_get_path (g_file_get_parent (current_file)); + + /* Continue only if files are on the same dir */ I'm not sure this restriction is OK. Often the ui file isn't in the same directory as the source files.
(In reply to comment #1) > Review of attachment 206416 [details] [review]: > > Should be OK for Vala, thanks. You're welcome. > > I'm however not sure it is acceptable to assume that the source file and ui > file are in the same directory. I'll remove this constraint. > > One more thing: your style doesn't seem very consistent, especially regarding > space after function name. I'll proof-read the patch. > > ::: plugins/glade/plugin.c > @@ +354,3 @@ > + if(docs) { > + gchar *widget_name = glade_widget_get_name (widget); > + gchar *widget_typename = G_OBJECT_TYPE_NAME (G_OBJECT > (glade_widget_get_object(widget))); > > you don't need the G_OBJECT cast here I'll remove it. > > @@ +358,3 @@ > + IAnjutaDocument *curr_doc = IANJUTA_DOCUMENT(data); > + if(IANJUTA_IS_EDITOR(curr_doc)) { > + printf("Emitting signal!\n"); > > A forgotten debug statement? You can use DEBUG_PRINT if you want to keep it. I'll remove it. > > ::: plugins/language-support-cpp-java/plugin.c > @@ +893,3 @@ > + gchar *current_filedir = g_file_get_path (g_file_get_parent > (current_file)); > + > + /* Continue only if files are on the same dir */ > > I'm not sure this restriction is OK. Often the ui file isn't in the same > directory as the source files. I'll remove it.
Created attachment 206508 [details] [review] Automatically detect which file that will hold member widgets declaration and initialization. The attached patch addresses comments of latest review. Please review it.
Review of attachment 206508 [details] [review]: See my small comments. ::: plugins/glade/plugin.c @@ +358,1 @@ + void send_signal (gpointer data, gpointer user_data) { Please follow the coding style. ::: plugins/language-support-cpp-java/plugin.c @@ +923,3 @@ + // Since this signal is not disconnect on plugin uninstall, we have to prevent multiple connection. + if (!g_signal_handler_find (lang_plugin->current_editor, + G_SIGNAL_MATCH_FUNC, The indentation here seems messed up.
Created attachment 206546 [details] [review] Automatically detect which file that will hold member widgets declaration and initialization. The attached patch fixes latest comments. Please review it.
Review of attachment 206546 [details] [review]: Looks good!
Review of attachment 206546 [details] [review]: I've committed this patch (and implemented your feature for the vala plugin). This bug can be closed now.