diff options
author | Alan Fitton <ajf@eth0.org.uk> | 2011-09-18 16:21:04 +0000 |
---|---|---|
committer | Alan Fitton <ajf@eth0.org.uk> | 2011-09-18 16:21:04 +0000 |
commit | 79cd86dbfd5b2ea0963c84b48088ec189acfc795 (patch) | |
tree | 535769200823fdaa1fec9795fe986668cb33bdee /src/util.c | |
parent | 63763bb00502e3c235e478ec50e097904c774696 (diff) |
Big changeset, may break stuff. Unfortunately you can't magically jump into the UI thread using gdk_threads_enter/leave() on Windows, the only way is to schedule a callback using g_idle_add. This required a lot of reworking. Good news, Windows support actually works now \o/
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 14 |
1 files changed, 3 insertions, 11 deletions
@@ -32,7 +32,6 @@ #include <gtk/gtk.h> #include "util.h" -#include "dispatch.h" void add_file_id_to_array(JsonObject * args, gchar * key, gint index) { @@ -70,10 +69,9 @@ gchar *trg_gregex_get_first(GRegex * rx, const gchar * src) return dst; } -void trg_error_dialog(GtkWindow * parent, int status, - JsonObject * response) +void trg_error_dialog(GtkWindow * parent, trg_response *response) { - const gchar *msg = make_error_message(response, status); + gchar *msg = make_error_message(response->obj, response->status); GtkWidget *dialog = gtk_message_dialog_new(parent, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, @@ -82,7 +80,7 @@ void trg_error_dialog(GtkWindow * parent, int status, gtk_window_set_title(GTK_WINDOW(dialog), _("Error")); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); - g_free((gpointer) msg); + g_free(msg); } gchar *make_error_message(JsonObject * response, int status) @@ -104,12 +102,6 @@ gchar *make_error_message(JsonObject * response, int status) } } -void response_unref(JsonObject * response) -{ - if (response != NULL) - json_object_unref(response); -} - char *tr_strlpercent(char *buf, double x, size_t buflen) { return tr_strpercent(buf, x, buflen); |