[gnac/devel] Replaced deprecated symbols
- From: BenoÃt Dupasquier <bdupasqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnac/devel] Replaced deprecated symbols
- Date: Tue, 6 Mar 2012 18:33:00 +0000 (UTC)
commit 79ec5acdb02c0eec7eb9330a2bc73cd63c67e774
Author: BenoÃt Dupasquier <bdupasqu src gnome org>
Date: Tue Mar 6 18:32:37 2012 +0000
Replaced deprecated symbols
src/gnac-main.c | 11 ++++++++---
src/profiles/gnac-profiles-manager.c | 5 +++++
2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/gnac-main.c b/src/gnac-main.c
index 241cf50..32f8649 100644
--- a/src/gnac-main.c
+++ b/src/gnac-main.c
@@ -256,8 +256,13 @@ gnac_add_files(GSList *files)
continue_files_action = TRUE;
gnac_change_state(GNAC_AUDIO_FILE_ACTION_STATE);
+#if GLIB_CHECK_VERSION(2, 31, 0)
+ file_action_thread = g_thread_try_new("add-files-thread",
+ (GThreadFunc) gnac_add_files_thread_entry, files, &error);
+#else
file_action_thread = g_thread_create(
(GThreadFunc) gnac_add_files_thread_entry, files, TRUE, &error);
+#endif
if (error) {
libgnac_warning(_("Failed to add files: %s"), error->message);
g_clear_error(&error);
@@ -322,14 +327,12 @@ gnac_on_ui_destroy_cb(GtkWidget *widget,
}
case GNAC_AUDIO_FILE_ACTION_STATE: {
- GThread *thread = NULL;
if (file_action_thread) {
- thread = file_action_thread;
quit_app = TRUE;
continue_files_action = FALSE;
+ g_thread_join(file_action_thread);
gnac_change_state(GNAC_AUDIO_READY_STATE);
}
- if (thread) g_thread_join(thread);
}
case GNAC_AUDIO_EMPTY_STATE:
@@ -704,7 +707,9 @@ gint
main(gint argc,
gchar **argv)
{
+#if !GLIB_CHECK_VERSION(2, 31, 0)
if (!g_thread_supported()) g_thread_init(NULL);
+#endif
g_type_init();
diff --git a/src/profiles/gnac-profiles-manager.c b/src/profiles/gnac-profiles-manager.c
index 87d13c7..4dcc3cf 100644
--- a/src/profiles/gnac-profiles-manager.c
+++ b/src/profiles/gnac-profiles-manager.c
@@ -783,8 +783,13 @@ gnac_profiles_mgr_on_drag_data_received(GtkWidget *widget,
GError *error = NULL;
+#if GLIB_CHECK_VERSION(2, 31, 0)
+ g_thread_try_new("drag-data-thread",
+ (GThreadFunc) gnac_profiles_mgr_copy_and_load_files, tcopy_data, &error);
+#else
g_thread_create((GThreadFunc) gnac_profiles_mgr_copy_and_load_files,
tcopy_data, TRUE, &error);
+#endif
if (error) {
libgnac_debug("Failed to create thread: %s", error->message);
gnac_profiles_mgr_display_status_message(NULL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]