[gnome-video-arcade] Adapt main.c to gtk+-3.0.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-video-arcade] Adapt main.c to gtk+-3.0.
- Date: Mon, 31 Jan 2011 03:34:32 +0000 (UTC)
commit 3f7ccf016b4a341c2ef65e231d29d5d4bd24031e
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun Jan 30 21:02:25 2011 -0500
Adapt main.c to gtk+-3.0.
src/main.c | 35 +++++++++++++++--------------------
1 files changed, 15 insertions(+), 20 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 0a90f11..7532ae2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -122,7 +122,7 @@ warn_if_no_roms (void)
gtk_widget_destroy (dialog);
}
-static void
+static gboolean
start (void)
{
GError *error = NULL;
@@ -130,32 +130,20 @@ start (void)
if (gva_db_needs_rebuilt ())
{
if (!gva_main_build_database (&error))
- {
- gva_error_handle (&error);
- return;
- }
+ goto exit;
if (!gva_main_analyze_roms (&error))
- {
- gva_error_handle (&error);
- return;
- }
+ goto exit;
}
else if (gva_audit_detect_changes ())
{
if (!gva_main_analyze_roms (&error))
- {
- gva_error_handle (&error);
- return;
- }
+ goto exit;
}
/* Do this after ROMs are analyzed. */
if (!gva_main_init_search_completion (&error))
- {
- gva_error_handle (&error);
- return;
- }
+ goto exit;
gva_ui_unlock ();
@@ -165,6 +153,11 @@ start (void)
/* Present a helpful dialog if no ROMs were found. */
warn_if_no_roms ();
+
+exit:
+ gva_error_handle (&error);
+
+ return FALSE;
}
static void
@@ -244,7 +237,7 @@ rompath_changed_cb (GFileMonitor *monitor,
dialog = NULL;
}
-static void
+static gboolean
setup_file_monitors (void)
{
gchar **search_paths;
@@ -277,6 +270,8 @@ setup_file_monitors (void)
}
g_strfreev (search_paths);
+
+ return FALSE;
}
gint
@@ -402,8 +397,8 @@ main (gint argc, gchar **argv)
gva_error_handle (&error);
#endif
- gtk_init_add ((GtkFunction) start, NULL);
- gtk_init_add ((GtkFunction) setup_file_monitors, NULL);
+ g_idle_add ((GSourceFunc) start, NULL);
+ g_idle_add ((GSourceFunc) setup_file_monitors, NULL);
gtk_main ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]