[anjuta] libanjuta: Fix some warnings and made AnjutaPluginDescription a boxed type
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] libanjuta: Fix some warnings and made AnjutaPluginDescription a boxed type
- Date: Mon, 23 Jul 2012 09:41:39 +0000 (UTC)
commit 5928ea4a235b20f0ae3592950e09004155fc43bd
Author: Johannes Schmid <jhs gnome org>
Date: Mon Jul 23 11:41:32 2012 +0200
libanjuta: Fix some warnings and made AnjutaPluginDescription a boxed type
libanjuta/anjuta-command-bar.c | 2 +-
libanjuta/anjuta-dock-pane.c | 2 +-
libanjuta/anjuta-dock.c | 10 +++++-----
libanjuta/anjuta-entry.c | 1 -
libanjuta/anjuta-plugin-description.c | 23 +++++++++++++++++++++--
libanjuta/anjuta-plugin-description.h | 7 ++++++-
libanjuta/anjuta-plugin-manager.c | 23 ++++++++---------------
libanjuta/anjuta-project.c | 6 ++++--
libanjuta/anjuta-session.c | 2 +-
libanjuta/anjuta-token.c | 4 ++--
libanjuta/anjuta-utils.c | 15 +++++----------
11 files changed, 54 insertions(+), 41 deletions(-)
---
diff --git a/libanjuta/anjuta-command-bar.c b/libanjuta/anjuta-command-bar.c
index cd3eacb..dc447aa 100644
--- a/libanjuta/anjuta-command-bar.c
+++ b/libanjuta/anjuta-command-bar.c
@@ -276,7 +276,7 @@ anjuta_command_bar_get_action_group (AnjutaCommandBar *self,
* anjuta_command_bar_get_action:
* @self: An AnjutaCommandBar
* @group_name: The name of the #GtkActionGroup to look for the action in
- * @action: The name of the action
+ * @action_name: The name of the action
*
* Retrieves a #GtkAction object in the given group with the given name
*/
diff --git a/libanjuta/anjuta-dock-pane.c b/libanjuta/anjuta-dock-pane.c
index f7a3a6e..204e972 100644
--- a/libanjuta/anjuta-dock-pane.c
+++ b/libanjuta/anjuta-dock-pane.c
@@ -239,7 +239,7 @@ anjuta_dock_pane_notify_single_selection_changed (AnjutaDockPane *self)
/**
* anjuta_dock_pane_notify_multiple_selection_changed:
- * @pane: An AnjutaDockPane
+ * @self: An AnjutaDockPane
*
* Emits the multiple-selection-changed signal.
*/
diff --git a/libanjuta/anjuta-dock.c b/libanjuta/anjuta-dock.c
index 9c6a870..fabcfd4 100644
--- a/libanjuta/anjuta-dock.c
+++ b/libanjuta/anjuta-dock.c
@@ -141,7 +141,7 @@ anjuta_dock_new (void)
* @pane_label: Label to display in this pane's grip
* @pane: The #AnjutaDockPane to add to the dock. The dock takes ownership of
* the pane object.
- * @stock_id: Stock icon to display in this pane's grip
+ * @stock_icon: Stock icon to display in this pane's grip
* @placement: A #GdlDockPlacement value indicating where the pane should be
* placed
* @entries: #AnjutaCommandBar entries for this pane. Can be %NULL
@@ -179,7 +179,7 @@ anjuta_dock_add_pane (AnjutaDock *self, const gchar *pane_name,
* @self: An AnjutaDock
* @pane_name: A unique name for this pane
* @pane_label: Label to display in this pane's grip
- * @stock_id: Stock icon to display in this pane's grip
+ * @stock_icon: Stock icon to display in this pane's grip
* @pane: The #AnjutaDockPane to add to the dock. The dock takes ownership of
* the pane object.
* @placement: A #GdlDockPlacement value indicating where the pane should be
@@ -255,7 +255,7 @@ anjuta_dock_add_pane_full (AnjutaDock *self, const gchar *pane_name,
* @pane_label: Label to display in this pane's grip
* @pane: The #AnjutaDockPane to add to the dock. The dock takes ownership of
* the pane object.
- * @stock_id: Stock icon to display in this pane's grip
+ * @stock_icon: Stock icon to display in this pane's grip
* @placement: A #GdlDockPlacement value indicating where the pane should be
* placed
* @entries: #AnjutaCommandBar entries for this pane. Can be %NULL
@@ -289,7 +289,7 @@ anjuta_dock_replace_command_pane (AnjutaDock *self,
/**
* anjuta_dock_remove_pane:
* @self An AnjutaDock
- * @pane_name: Name of the pane to remove
+ * @pane: Name of the pane to remove
*
* Removes a pane from a dock
*/
@@ -344,7 +344,7 @@ anjuta_dock_show_pane (AnjutaDock *self, AnjutaDockPane *pane)
/**
* anjuta_dock_hide_pane:
* @self: An AnjutaDock
- * @pane_name: Name of the pane to hide
+ * @pane: Name of the pane to hide
*
* Makes the given pane invisible
*/
diff --git a/libanjuta/anjuta-entry.c b/libanjuta/anjuta-entry.c
index 4ffe5b1..81f7b5a 100644
--- a/libanjuta/anjuta-entry.c
+++ b/libanjuta/anjuta-entry.c
@@ -246,7 +246,6 @@ anjuta_entry_class_init (AnjutaEntryClass *klass)
/**
* anjuta_entry_new:
- * @self: An AnjutaEntry
*
* Creates a new AnjutaEntry.
*/
diff --git a/libanjuta/anjuta-plugin-description.c b/libanjuta/anjuta-plugin-description.c
index 49c666f..14e48d2 100644
--- a/libanjuta/anjuta-plugin-description.c
+++ b/libanjuta/anjuta-plugin-description.c
@@ -256,7 +256,6 @@ escape_string (const gchar *str, gboolean escape_first_space)
gchar *res;
char *q;
const gchar *p;
- const gchar *end;
/* len + 1 is enough, because unescaping never makes the
* string longer */
@@ -264,7 +263,6 @@ escape_string (const gchar *str, gboolean escape_first_space)
p = str;
q = res;
- end = str + strlen (str);
while (*p)
{
@@ -561,6 +559,27 @@ report_error (AnjutaPluginDescriptionParser *parser,
}
}
+AnjutaPluginDescription*
+anjuta_plugin_description_copy (AnjutaPluginDescription *df)
+{
+ return anjuta_plugin_description_new_from_string (anjuta_plugin_description_to_string (df),
+ NULL);
+}
+
+GType
+anjuta_plugin_description_get_type (void)
+{
+ static GType type_id = 0;
+
+ if (!type_id)
+ type_id = g_boxed_type_register_static ("AnjutaPluginDescription",
+ (GBoxedCopyFunc) anjuta_plugin_description_copy,
+ (GBoxedFreeFunc) anjuta_plugin_description_free);
+
+ return type_id;
+}
+
+
/**
* anjuta_plugin_description_new_from_string:
* @data: The data to parse. The format of the data is .ini style.
diff --git a/libanjuta/anjuta-plugin-description.h b/libanjuta/anjuta-plugin-description.h
index 8710faf..1d85170 100644
--- a/libanjuta/anjuta-plugin-description.h
+++ b/libanjuta/anjuta-plugin-description.h
@@ -21,10 +21,13 @@
#ifndef ANJUTA_PLUGIN_PARSER_H
#define ANJUTA_PLUGIN_PARSER_H
-#include <glib.h>
+#include <glib-object.h>
G_BEGIN_DECLS
+#define ANJUTA_TYPE_PLUGIN_DESCRIPTION (anjuta_project_property_get_type ())
+#define ANJUTA_IS_PLUGIN_DESCIRPTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJUTA_TYPE_PLUGIN_DESCRIPTION))
+
typedef struct _AnjutaPluginDescription AnjutaPluginDescription;
typedef void (*AnjutaPluginDescriptionSectionFunc) (AnjutaPluginDescription *df,
@@ -59,6 +62,7 @@ typedef enum
GQuark anjuta_plugin_description_parse_error_quark (void);
+GType anjuta_plugin_description_get_type (void);
AnjutaPluginDescription* anjuta_plugin_description_new (const gchar *filename,
GError **error);
@@ -69,6 +73,7 @@ AnjutaPluginDescription* anjuta_plugin_description_new_from_string (gchar *data,
gchar* anjuta_plugin_description_to_string (AnjutaPluginDescription *df);
void anjuta_plugin_description_free (AnjutaPluginDescription *df);
+AnjutaPluginDescription *anjuta_plugin_description_copy (AnjutaPluginDescription *df);
void anjuta_plugin_description_foreach_section (AnjutaPluginDescription *df,
AnjutaPluginDescriptionSectionFunc func,
diff --git a/libanjuta/anjuta-plugin-manager.c b/libanjuta/anjuta-plugin-manager.c
index 19ecf27..bc74ede 100644
--- a/libanjuta/anjuta-plugin-manager.c
+++ b/libanjuta/anjuta-plugin-manager.c
@@ -534,15 +534,10 @@ activate_plugin (AnjutaPluginManager *plugin_manager,
AnjutaPluginManagerPriv *priv;
IAnjutaPluginFactory* factory;
AnjutaPlugin *plugin;
- const gchar *plugin_id;
const gchar *language;
- gboolean resident;
priv = plugin_manager->priv;
- plugin_id = anjuta_plugin_handle_get_id (handle);
-
- resident = anjuta_plugin_handle_get_resident (handle);
language = anjuta_plugin_handle_get_language (handle);
factory = get_plugin_factory (plugin_manager, language, error);
@@ -1147,11 +1142,11 @@ anjuta_plugin_manager_get_plugins_page (AnjutaPluginManager *plugin_manager)
GtkWidget *tree;
GtkWidget *scrolled;
GtkWidget *toolbar;
- GtkWidget *toolitem;
+ GtkToolItem *toolitem;
GtkListStore *store;
/* Plugins page */
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
scrolled = gtk_scrolled_window_new (NULL, NULL);
@@ -1171,7 +1166,7 @@ anjuta_plugin_manager_get_plugins_page (AnjutaPluginManager *plugin_manager)
toolitem = gtk_tool_item_new ();
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (toolitem), 0);
- gtk_widget_show (toolitem);
+ gtk_widget_show (GTK_WIDGET(toolitem));
checkbutton = gtk_check_button_new_with_label (dgettext (GETTEXT_PACKAGE, "Only show user activatable plugins"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), TRUE);
@@ -1210,7 +1205,7 @@ anjuta_plugin_manager_get_remembered_plugins_page (AnjutaPluginManager *plugin_m
GtkTreeSelection *selection;
/* Remembered plugin */
- vbox = gtk_vbox_new (FALSE, 10);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
display_label = gtk_label_new (dgettext (GETTEXT_PACKAGE, "These are the plugins selected by you "
@@ -1236,7 +1231,7 @@ anjuta_plugin_manager_get_remembered_plugins_page (AnjutaPluginManager *plugin_m
g_object_set_data (G_OBJECT (store), "plugin-manager", plugin_manager);
populate_remembered_plugins_model (plugin_manager, store);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
forget_button = gtk_button_new_with_label (dgettext (GETTEXT_PACKAGE, "Forget selected plugin"));
@@ -2570,11 +2565,9 @@ anjuta_plugin_manager_activate_plugins (AnjutaPluginManager *plugin_manager,
if (anjuta_plugin_description_get_string (d, "Anjuta Plugin",
"Location", &plugin_id))
{
- GObject *plugin_obj;
-
- plugin_obj =
- anjuta_plugin_manager_get_plugin_by_id (plugin_manager,
- plugin_id);
+ /* Activate the plugin */
+ anjuta_plugin_manager_get_plugin_by_id (plugin_manager,
+ plugin_id);
g_free (plugin_id);
}
diff --git a/libanjuta/anjuta-project.c b/libanjuta/anjuta-project.c
index b65d75b..91c0bf8 100644
--- a/libanjuta/anjuta-project.c
+++ b/libanjuta/anjuta-project.c
@@ -1012,7 +1012,8 @@ anjuta_project_group_compare (AnjutaProjectNode *node, gpointer data)
/**
* anjuta_project_node_get_group_from_file:
- * @func: (scope call):
+ * @root: the root node
+ * @directory: Directory to search in
*
* Returns: (transfer none):
*/
@@ -1068,7 +1069,8 @@ anjuta_project_source_compare (AnjutaProjectNode *node, gpointer data)
/**
* anjuta_project_node_get_source_from_file:
- * @func: (scope call):
+ * @parent: the parent node
+ * @file: The file to query the source for
*
* Returns: (transfer none):
*/
diff --git a/libanjuta/anjuta-session.c b/libanjuta/anjuta-session.c
index 5b65607..d2104ee 100644
--- a/libanjuta/anjuta-session.c
+++ b/libanjuta/anjuta-session.c
@@ -458,7 +458,7 @@ anjuta_session_get_string_list (AnjutaSession *session,
* anjuta_session_get_relative_uri_from_file:
* @session: an #AnjutaSession object
* @file: a GFile
- * @fragme: an optional fragment
+ * @fragment: an optional fragment
*
* Return an URI relative to the session directory file with an optional
* fragment.
diff --git a/libanjuta/anjuta-token.c b/libanjuta/anjuta-token.c
index b4fd6e0..fbeaf1a 100644
--- a/libanjuta/anjuta-token.c
+++ b/libanjuta/anjuta-token.c
@@ -811,7 +811,7 @@ anjuta_token_prepend_items (AnjutaToken *list, AnjutaToken *item)
/**
* anjuta_token_insert_after:
* @sibling: a #AnjutaToken object.
- * @item: a #AnjutaToken object.
+ * @list: a #AnjutaToken object.
*
* Insert all tokens after sibling.
*
@@ -877,7 +877,7 @@ anjuta_token_insert_after (AnjutaToken *sibling, AnjutaToken *list)
/**
* anjuta_token_insert_before:
* @sibling: a #AnjutaToken object.
- * @item: a #AnjutaToken object.
+ * @list: a #AnjutaToken object.
*
* Insert all tokens before sibling.
*
diff --git a/libanjuta/anjuta-utils.c b/libanjuta/anjuta-utils.c
index 5df562f..76b46b7 100644
--- a/libanjuta/anjuta-utils.c
+++ b/libanjuta/anjuta-utils.c
@@ -197,7 +197,7 @@ anjuta_util_button_new_with_stock_image (const gchar* text,
gtk_label_set_mnemonic_widget (GTK_LABEL (label), GTK_WIDGET (button));
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
- hbox = gtk_hbox_new (FALSE, 2);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
@@ -455,7 +455,7 @@ anjuta_util_dialog_input (GtkWindow *parent, const gchar *prompt,
gtk_widget_show (frame);
gtk_box_pack_start (GTK_BOX (dialog_vbox), frame, FALSE, FALSE, 0);
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
gtk_container_add (GTK_CONTAINER (frame), vbox);
@@ -622,10 +622,8 @@ anjuta_util_glist_from_string (const gchar *string)
gchar *str, *temp, buff[256];
GList *list;
gchar *word_start, *word_end;
- gboolean the_end;
list = NULL;
- the_end = FALSE;
temp = g_strdup (string);
str = temp;
if (!str)
@@ -1191,7 +1189,6 @@ anjuta_util_execute_shell (const gchar *dir, const gchar *command)
{
pid_t pid;
gchar *shell;
- gint err;
g_return_val_if_fail (command != NULL, -1);
@@ -1202,7 +1199,7 @@ anjuta_util_execute_shell (const gchar *dir, const gchar *command)
if(dir)
{
anjuta_util_create_dir (dir);
- err = chdir (dir);
+ chdir (dir);
}
execlp (shell, shell, "-c", command, NULL);
g_warning (_("Cannot execute command: %s (using shell %s)\n"), command, shell);
@@ -1222,7 +1219,6 @@ anjuta_util_execute_terminal_shell (const gchar *dir, const gchar *command)
pid_t pid;
gchar *shell;
gchar **term_argv;
- gint err;
g_return_val_if_fail (command != NULL, -1);
@@ -1234,7 +1230,7 @@ anjuta_util_execute_terminal_shell (const gchar *dir, const gchar *command)
if(dir)
{
anjuta_util_create_dir (dir);
- err = chdir (dir);
+ chdir (dir);
}
execlp (term_argv[0], term_argv[0], term_argv[1], shell, "-c", command, NULL);
g_warning (_("Cannot execute command: %s (using shell %s)\n"), command, shell);
@@ -2422,11 +2418,10 @@ anjuta_util_builder_get_objects (GtkBuilder *builder, const gchar *first_widget,
/**
* anjuta_utils_drop_get_files:
* @selection_data: the #GtkSelectionData from drag_data_received
- * @info: the info from drag_data_received
*
* Create a list of valid uri's from a uri-list drop.
*
- * Return value: a list of GFiles
+ * Return value: (element-type GFile*): a list of GFiles
*/
GSList*
anjuta_utils_drop_get_files (GtkSelectionData *selection_data)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]