[devhelp] Assistant: return DhAssistant type for dh_assistant_new()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] Assistant: return DhAssistant type for dh_assistant_new()
- Date: Sun, 17 Dec 2017 14:28:53 +0000 (UTC)
commit 7d4bd49d3b94a9cec2c1f21e8eaa79a029a1eb3b
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Dec 17 14:57:22 2017 +0100
Assistant: return DhAssistant type for dh_assistant_new()
To have clearer code.
src/dh-app.c | 2 +-
src/dh-assistant.c | 6 +++---
src/dh-assistant.h | 10 ++++++----
3 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/dh-app.c b/src/dh-app.c
index aad3e14..7ab09e9 100644
--- a/src/dh-app.c
+++ b/src/dh-app.c
@@ -218,7 +218,7 @@ search_assistant_cb (GSimpleAction *action,
assistant = get_active_assistant_window (app);
if (assistant == NULL)
- assistant = DH_ASSISTANT (dh_assistant_new (app));
+ assistant = dh_assistant_new (app);
dh_assistant_search (assistant, keyword);
}
diff --git a/src/dh-assistant.c b/src/dh-assistant.c
index 48fd10a..5319c6e 100644
--- a/src/dh-assistant.c
+++ b/src/dh-assistant.c
@@ -95,10 +95,10 @@ dh_assistant_init (DhAssistant *assistant)
assistant);
}
-GtkWidget *
+DhAssistant *
dh_assistant_new (DhApp *application)
{
- GtkWidget *assistant;
+ DhAssistant *assistant;
DhSettings *settings;
assistant = g_object_new (DH_TYPE_ASSISTANT,
@@ -106,7 +106,7 @@ dh_assistant_new (DhApp *application)
NULL);
settings = dh_settings_get_singleton ();
- gtk_widget_realize (assistant);
+ gtk_widget_realize (GTK_WIDGET (assistant));
dh_util_window_settings_restore (GTK_WINDOW (assistant),
dh_settings_peek_assistant_settings (settings));
diff --git a/src/dh-assistant.h b/src/dh-assistant.h
index 7d9e0ba..28fa0f3 100644
--- a/src/dh-assistant.h
+++ b/src/dh-assistant.h
@@ -42,10 +42,12 @@ struct _DhAssistantClass {
GtkApplicationWindowClass parent_class;
};
-GType dh_assistant_get_type (void) G_GNUC_CONST;
-GtkWidget *dh_assistant_new (DhApp *application);
-gboolean dh_assistant_search (DhAssistant *assistant,
- const gchar *str);
+GType dh_assistant_get_type (void) G_GNUC_CONST;
+
+DhAssistant * dh_assistant_new (DhApp *application);
+
+gboolean dh_assistant_search (DhAssistant *assistant,
+ const gchar *str);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]