diff options
Diffstat (limited to 'src/schemes')
-rw-r--r-- | src/schemes/about/profiles.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/schemes/about/profiles.c b/src/schemes/about/profiles.c index a4b6eb2..8587a12 100644 --- a/src/schemes/about/profiles.c +++ b/src/schemes/about/profiles.c @@ -70,19 +70,13 @@ generate_div(MqProfiles *profiles, gchar *id) return div; } -void -mq_about_profiles_response(MqApplication *application, - GHashTable G_GNUC_UNUSED *query, - WebKitURISchemeRequest *request) +static gchar * +generate_document(MqProfiles *profiles) { - MqProfiles *profiles; - gchar *document; - gchar **ids; - gsize length; - gchar **divs; - gsize i; - - profiles = mq_application_get_profiles(application); + gchar **ids; + gsize length; + gchar **divs; + gsize i; ids = mq_profiles_get_profiles(profiles, &length); divs = g_new(gchar *, length); @@ -92,8 +86,18 @@ mq_about_profiles_response(MqApplication *application, divs[i] = NULL; g_strfreev(ids); - document = mq_html_document("Profiles", + return mq_html_document("Profiles", mq_html_form_v("Add Profile", NULL, divs), NULL); - mq_about_response(request, document); +} + +void +mq_about_profiles_response(MqApplication *application, + GHashTable G_GNUC_UNUSED *query, WebKitURISchemeRequest *request) +{ + MqProfiles *profiles; + + profiles = mq_application_get_profiles(application); + + mq_about_response(request, generate_document(profiles)); } |