Hello community, here is the log from the commit of package pragha for openSUSE:Factory checked in at 2014-07-08 13:01:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pragha (Old) and /work/SRC/openSUSE:Factory/.pragha.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "pragha" Changes: -------- --- /work/SRC/openSUSE:Factory/pragha/pragha.changes 2014-05-14 10:44:36.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.pragha.new/pragha.changes 2014-07-08 13:02:04.000000000 +0200 @@ -1,0 +2,10 @@ +Sat Jul 5 15:32:37 UTC 2014 - lazy.kent@opensuse.org + +- Update to 1.2.2. + * Fix some segfault when use Glib >= 2.40. (Change requirements + to Glib >= 2.32). + * Fix segfault when change preferences and mpris2 is disabled. + * Fix segfault when close Pragha and Mpris2 is disabled. +- Add BuildRequires: pkgconfig(glib-2.0) >= 2.32. + +------------------------------------------------------------------- Old: ---- pragha-1.2.1.tar.bz2 New: ---- pragha-1.2.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pragha.spec ++++++ --- /var/tmp/diff_new_pack.mw8xcu/_old 2014-07-08 13:02:05.000000000 +0200 +++ /var/tmp/diff_new_pack.mw8xcu/_new 2014-07-08 13:02:05.000000000 +0200 @@ -17,7 +17,7 @@ Name: pragha -Version: 1.2.1 +Version: 1.2.2 Release: 0 Summary: Lightweight Music Player License: GPL-3.0+ @@ -31,6 +31,7 @@ BuildRequires: intltool BuildRequires: libtool BuildRequires: pkgconfig(dbus-glib-1) +BuildRequires: pkgconfig(glib-2.0) >= 2.32 BuildRequires: pkgconfig(gstreamer-1.0) BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) BuildRequires: pkgconfig(gthread-2.0) >= 2.31 @@ -93,7 +94,7 @@ for size in 96x96 64x64 48x48 32x32 22x22 16x16 ; do install -dm 0755 \ %{buildroot}%{_datadir}/icons/hicolor/${size}/apps - convert -resize ${size} data/%{name}.png \ + convert -strip -resize ${size} data/%{name}.png \ %{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png done %fdupes -s %{buildroot}%{_datadir}/ ++++++ pragha-1.2.1.tar.bz2 -> pragha-1.2.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/Makefile.in new/pragha-1.2.2/Makefile.in --- old/pragha-1.2.1/Makefile.in 2014-04-30 18:09:38.000000000 +0200 +++ new/pragha-1.2.2/Makefile.in 2014-07-03 14:53:45.000000000 +0200 @@ -83,7 +83,7 @@ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in COPYING compile config.guess config.sub \ - depcomp install-sh missing ltmain.sh + install-sh missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/NEWS new/pragha-1.2.2/NEWS --- old/pragha-1.2.1/NEWS 2014-04-30 17:57:33.000000000 +0200 +++ new/pragha-1.2.2/NEWS 2014-07-03 14:51:48.000000000 +0200 @@ -1,8 +1,18 @@ ============================================================== -Overview of changes in Pragha 1.2.1 since 1.2 +Overview of changes in Pragha 1.2.2 since 1.2.1 ============================================================== Bugs fixed: + Fix some segfault when use Glib >= 2.40. (Change requirements to Glib >= 2.32) + Fix segfault when change preferences and mpris2 is disabled. Issue #68 + Fix segfault when close Pragha and Mpris2 is disabled. Issue #68 + +============================================================== +OTHERS REALESES: +============================================================== + +V1.2.1 +Bugs fixed: Create cache folders when init album-art-cache. Lastfm: Backport some changes from Pragha 1.3.1. * Better protect tags and time_t on threads. @@ -13,9 +23,6 @@ Fix Segfault when edit song tags from systray menu. Not import empty playlists when scan the library. -============================================================== -OTHERS REALESES: -============================================================== Pragha V1.2 Bugs fixed: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/configure new/pragha-1.2.2/configure --- old/pragha-1.2.1/configure 2014-04-30 18:09:39.000000000 +0200 +++ new/pragha-1.2.2/configure 2014-07-03 14:53:46.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for pragha 1.2.1. +# Generated by GNU Autoconf 2.69 for pragha 1.2.2. # # Report bugs to <mati86dl@gmail.com>. # @@ -593,8 +593,8 @@ # Identity of this package. PACKAGE_NAME='pragha' PACKAGE_TARNAME='pragha' -PACKAGE_VERSION='1.2.1' -PACKAGE_STRING='pragha 1.2.1' +PACKAGE_VERSION='1.2.2' +PACKAGE_STRING='pragha 1.2.2' PACKAGE_BUGREPORT='mati86dl@gmail.com' PACKAGE_URL='' @@ -1472,7 +1472,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -`configure' configures pragha 1.2.1 to adapt to many kinds of systems. +`configure' configures pragha 1.2.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1542,7 +1542,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pragha 1.2.1:";; + short | recursive ) echo "Configuration of pragha 1.2.2:";; esac cat <<_ACEOF @@ -1693,7 +1693,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<_ACEOF -pragha configure 1.2.1 +pragha configure 1.2.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2065,7 +2065,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by pragha $as_me 1.2.1, which was +It was created by pragha $as_me 1.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2931,7 +2931,7 @@ # Define the identity of the package. PACKAGE='pragha' - VERSION='1.2.1' + VERSION='1.2.2' cat >>confdefs.h <<_ACEOF @@ -13665,9 +13665,9 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gio-2.0 >= 2.28" >&5 -$as_echo_n "checking for gio-2.0 >= 2.28... " >&6; } - if $PKG_CONFIG "--atleast-version=2.28" "gio-2.0" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gio-2.0 >= 2.32" >&5 +$as_echo_n "checking for gio-2.0 >= 2.32... " >&6; } + if $PKG_CONFIG "--atleast-version=2.32" "gio-2.0" >/dev/null 2>&1; then GIO_VERSION=`$PKG_CONFIG --modversion "gio-2.0"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIO_VERSION" >&5 $as_echo "$GIO_VERSION" >&6; } @@ -13684,7 +13684,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIO_LIBS" >&5 $as_echo "$GIO_LIBS" >&6; } - GIO_REQUIRED_VERSION=2.28 + GIO_REQUIRED_VERSION=2.32 @@ -13700,7 +13700,7 @@ echo "*** The required package gio-2.0 was found on your system," echo "*** but the installed version ($xdt_cv_version) is too old." - echo "*** Please upgrade gio-2.0 to atleast version 2.28, or adjust" + echo "*** Please upgrade gio-2.0 to atleast version 2.32, or adjust" echo "*** the PKG_CONFIG_PATH environment variable if you installed" echo "*** the new version of the package in a nonstandard prefix so" echo "*** pkg-config is able to find it." @@ -13712,7 +13712,7 @@ echo "*** The required package gio-2.0 was not found on your system." - echo "*** Please install gio-2.0 (atleast version 2.28) or adjust" + echo "*** Please install gio-2.0 (atleast version 2.32) or adjust" echo "*** the PKG_CONFIG_PATH environment variable if you" echo "*** installed the package in a nonstandard prefix so that" echo "*** pkg-config is able to find it." @@ -17778,7 +17778,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by pragha $as_me 1.2.1, which was +This file was extended by pragha $as_me 1.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17844,7 +17844,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\""`$]/\\&/g'`" ac_cs_version="\ -pragha config.status 1.2.1 +pragha config.status 1.2.2 configured by $0, generated by GNU Autoconf 2.69, with options \"$ac_cs_config\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/configure.ac new/pragha-1.2.2/configure.ac --- old/pragha-1.2.1/configure.ac 2014-04-30 18:08:58.000000000 +0200 +++ new/pragha-1.2.2/configure.ac 2014-07-03 14:52:39.000000000 +0200 @@ -6,7 +6,7 @@ dnl Version information m4_define([pragha_version_major], [1]) m4_define([pragha_version_minor], [2]) -m4_define([pragha_version_micro], [1]) +m4_define([pragha_version_micro], [2]) m4_define([pragha_version], [pragha_version_major().pragha_version_minor().pragha_version_micro()]) dnl Initialize autoconf @@ -81,7 +81,7 @@ dnl Check for required packages XDT_CHECK_PACKAGE([GSTREAMER], [gstreamer-${GSTREAMER_API_VERSION}], [$GSTREAMER_REQUIRED]) XDT_CHECK_PACKAGE([GSTREAMER_BASE], [gstreamer-base-${GSTREAMER_API_VERSION}], [$GSTREAMER_REQUIRED]) -XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.28]) +XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.32]) AS_IF([test "x$with_gtk3" != xno], [XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.0.0])], [XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.24.0])]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-backend.c new/pragha-1.2.2/src/pragha-backend.c --- old/pragha-1.2.1/src/pragha-backend.c 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-backend.c 2014-07-03 14:49:39.000000000 +0200 @@ -1093,7 +1093,7 @@ } PraghaBackend * -pragha_backend_new () +pragha_backend_new (void) { gst_init (NULL, NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-backend.h new/pragha-1.2.2/src/pragha-backend.h --- old/pragha-1.2.1/src/pragha-backend.h 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-backend.h 2014-07-03 14:49:39.000000000 +0200 @@ -77,7 +77,8 @@ PraghaMusicobject *pragha_backend_get_musicobject(PraghaBackend *backend); GstElement * pragha_backend_get_equalizer (PraghaBackend *backend); void pragha_backend_update_equalizer (PraghaBackend *backend, const gdouble *bands); -PraghaBackend * pragha_backend_new (); + +PraghaBackend * pragha_backend_new (void); G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-lastfm.c new/pragha-1.2.2/src/pragha-lastfm.c --- old/pragha-1.2.1/src/pragha-lastfm.c 2014-04-30 17:30:39.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-lastfm.c 2014-07-03 14:49:39.000000000 +0200 @@ -50,7 +50,7 @@ gboolean has_pass; /* Song status */ - PRAGHA_MUTEX (data_mutex); + GMutex data_mutex; time_t playback_started; PraghaMusicobject *current_mobj; PraghaMusicobject *updated_mobj; @@ -394,9 +394,9 @@ /* Get all info of suggestions * Temp Musicobject to not block tag edit dialog */ - pragha_mutex_lock (clastfm->data_mutex); + g_mutex_lock (&clastfm->data_mutex); nmobj = pragha_musicobject_dup(clastfm->updated_mobj); - pragha_mutex_unlock (clastfm->data_mutex); + g_mutex_unlock (&clastfm->data_mutex); g_object_get(nmobj, "title", &ntitle, @@ -982,7 +982,7 @@ CDEBUG(DBG_LASTFM, "Scrobbler thread"); - pragha_mutex_lock (clastfm->data_mutex); + g_mutex_lock (&clastfm->data_mutex); g_object_get (clastfm->current_mobj, "title", &title, "artist", &artist, @@ -991,7 +991,7 @@ "length", &length, NULL); last_time = clastfm->playback_started; - pragha_mutex_unlock (clastfm->data_mutex); + g_mutex_unlock (&clastfm->data_mutex); rv = LASTFM_track_scrobble (clastfm->session_id, title, @@ -1037,11 +1037,11 @@ "file", &cfile, NULL); - pragha_mutex_lock (clastfm->data_mutex); + g_mutex_lock (&clastfm->data_mutex); g_object_get (clastfm->updated_mobj, "file", &nfile, NULL); - pragha_mutex_unlock (clastfm->data_mutex); + g_mutex_unlock (&clastfm->data_mutex); if(g_ascii_strcasecmp(cfile, nfile) == 0) gtk_widget_show (clastfm->ntag_lastfm_button); @@ -1064,7 +1064,7 @@ PraghaLastfm *clastfm = data; CDEBUG(DBG_LASTFM, "Update now playing thread"); - pragha_mutex_lock (clastfm->data_mutex); + g_mutex_lock (&clastfm->data_mutex); g_object_get(clastfm->current_mobj, "title", &title, "artist", &artist, @@ -1072,7 +1072,7 @@ "track-no", &track_no, "length", &length, NULL); - pragha_mutex_unlock (clastfm->data_mutex); + g_mutex_unlock (&clastfm->data_mutex); rv = LASTFM_track_update_now_playing (clastfm->session_id, title, @@ -1106,7 +1106,7 @@ pragha_musicobject_set_artist(clastfm->updated_mobj, ntrack->artist); if(changed & TAG_ALBUM_CHANGED) pragha_musicobject_set_album(clastfm->updated_mobj, ntrack->album); - pragha_mutex_unlock (clastfm->data_mutex); + g_mutex_unlock (&clastfm->data_mutex); g_idle_add (pragha_lastfm_show_corrrection_button, clastfm); } @@ -1412,7 +1412,7 @@ clastfm->session_id = NULL; clastfm->status = LASTFM_STATUS_INVALID; - pragha_mutex_create (clastfm->data_mutex); + g_mutex_init (&clastfm->data_mutex); clastfm->updated_mobj = pragha_musicobject_new (); clastfm->current_mobj = pragha_musicobject_new (); @@ -1432,11 +1432,7 @@ if (pragha_preferences_get_lastfm_support (preferences)) { CDEBUG(DBG_INFO, "Initializing LASTFM"); -#if GLIB_CHECK_VERSION(2,32,0) if (g_network_monitor_get_network_available (g_network_monitor_get_default ())) -#else - if (nm_is_online () == TRUE) -#endif g_idle_add (pragha_lastfm_connect_idle, clastfm); else g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE, 30, @@ -1454,7 +1450,7 @@ g_object_unref (clastfm->updated_mobj); g_object_unref (clastfm->current_mobj); - pragha_mutex_free(clastfm->data_mutex); + g_mutex_clear (&clastfm->data_mutex); g_slice_free(PraghaLastfm, clastfm); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-mpris.c new/pragha-1.2.2/src/pragha-mpris.c --- old/pragha-1.2.1/src/pragha-mpris.c 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-mpris.c 2014-07-03 14:49:39.000000000 +0200 @@ -1447,11 +1447,11 @@ PraghaBackend *backend; PraghaApplication *pragha = mpris2->pragha; - backend = pragha_application_get_backend (pragha); - if(NULL == mpris2->dbus_connection) return; + backend = pragha_application_get_backend (pragha); + for (i = 0; i < N_OBJECTS; i++) { g_dbus_connection_unregister_object (mpris2->dbus_connection, mpris2->registration_object_ids[i]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-playlist.c new/pragha-1.2.2/src/pragha-playlist.c --- old/pragha-1.2.1/src/pragha-playlist.c 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-playlist.c 2014-07-03 14:49:39.000000000 +0200 @@ -3045,7 +3045,7 @@ /* Save current playlist state on exit */ -static void +void pragha_playlist_save_playlist_state (PraghaPlaylist* cplaylist) { GtkTreePath *path = NULL; @@ -4356,8 +4356,6 @@ { PraghaPlaylist *playlist = PRAGHA_PLAYLIST (widget); - if (pragha_preferences_get_restore_playlist (playlist->preferences)) - pragha_playlist_save_playlist_state (playlist); pragha_playlist_save_preferences (playlist); (*GTK_WIDGET_CLASS (pragha_playlist_parent_class)->unrealize) (widget); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-playlist.h new/pragha-1.2.2/src/pragha-playlist.h --- old/pragha-1.2.1/src/pragha-playlist.h 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-playlist.h 2014-07-03 14:49:39.000000000 +0200 @@ -120,6 +120,8 @@ PraghaMusicobject *pragha_playlist_get_selected_musicobject(PraghaPlaylist* cplaylist); void init_current_playlist_view(PraghaPlaylist *cplaylist); +void pragha_playlist_save_playlist_state (PraghaPlaylist* cplaylist); + gboolean pragha_playlist_propagate_event(PraghaPlaylist* cplaylist, GdkEventKey *event); void pragha_playlist_activate_path (PraghaPlaylist* cplaylist, GtkTreePath *path); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-preferences-dialog.c new/pragha-1.2.2/src/pragha-preferences-dialog.c --- old/pragha-1.2.1/src/pragha-preferences-dialog.c 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-preferences-dialog.c 2014-07-03 14:49:39.000000000 +0200 @@ -369,15 +369,16 @@ pragha_preferences_set_use_cddb(dialog->preferences, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->use_cddb_w))); - pragha_preferences_set_use_mpris2(dialog->preferences, - gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->use_mpris2_w))); + pref_setted = pragha_preferences_get_use_mpris2 (dialog->preferences); + pref_toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->use_mpris2_w)); + if (pref_setted != pref_toggled) { + pragha_preferences_set_use_mpris2 (dialog->preferences, pref_toggled); - mpris2 = pragha_application_get_mpris2 (dialog->pragha); - if(!pragha_preferences_get_use_mpris2(dialog->preferences)) { - pragha_mpris_close (mpris2); - } - else { - pragha_mpris_init (mpris2, dialog->pragha); + mpris2 = pragha_application_get_mpris2 (dialog->pragha); + if (pref_toggled) + pragha_mpris_init (mpris2, dialog->pragha); + else + pragha_mpris_close (mpris2); } break; default: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-scanner.c new/pragha-1.2.2/src/pragha-scanner.c --- old/pragha-1.2.1/src/pragha-scanner.c 2014-04-30 17:42:41.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-scanner.c 2014-07-03 14:49:39.000000000 +0200 @@ -47,8 +47,8 @@ GThread *no_files_thread; GThread *worker_thread; /* Mutex to protect progress */ - PRAGHA_MUTEX (no_files_mutex); - PRAGHA_MUTEX (files_scanned_mutex); + GMutex no_files_mutex; + GMutex files_scanned_mutex; /* Progress of threads */ guint no_files; guint files_scanned; @@ -73,13 +73,13 @@ if(g_cancellable_is_cancelled (scanner->cancellable)) return FALSE; - pragha_mutex_lock (scanner->no_files_mutex); + g_mutex_lock (&scanner->no_files_mutex); no_files = scanner->no_files; - pragha_mutex_unlock (scanner->no_files_mutex); + g_mutex_unlock (&scanner->no_files_mutex); - pragha_mutex_lock (scanner->files_scanned_mutex); + g_mutex_lock (&scanner->files_scanned_mutex); files_scanned = scanner->files_scanned; - pragha_mutex_unlock (scanner->files_scanned_mutex); + g_mutex_unlock (&scanner->files_scanned_mutex); if(no_files > 0) { fraction = (gdouble)files_scanned / (gdouble)no_files; @@ -113,9 +113,9 @@ no_files += pragha_get_dir_count(list->data, scanner->cancellable); - pragha_mutex_lock (scanner->no_files_mutex); + g_mutex_lock (&scanner->no_files_mutex); scanner->no_files = no_files; - pragha_mutex_unlock (scanner->no_files_mutex); + g_mutex_unlock (&scanner->no_files_mutex); } return NULL; @@ -356,9 +356,9 @@ break; } - pragha_mutex_lock (scanner->files_scanned_mutex); + g_mutex_lock (&scanner->files_scanned_mutex); scanner->files_scanned++; - pragha_mutex_unlock (scanner->files_scanned_mutex); + g_mutex_unlock (&scanner->files_scanned_mutex); } g_free(ab_file); @@ -440,9 +440,9 @@ } } - pragha_mutex_lock (scanner->files_scanned_mutex); + g_mutex_lock (&scanner->files_scanned_mutex); scanner->files_scanned++; - pragha_mutex_unlock (scanner->files_scanned_mutex); + g_mutex_unlock (&scanner->files_scanned_mutex); g_free(s_ab_file); } @@ -570,11 +570,7 @@ /* Launch threads */ - #if GLIB_CHECK_VERSION(2,31,0) scanner->no_files_thread = g_thread_new("Count no files", pragha_scanner_count_no_files_worker, scanner); - #else - scanner->no_files_thread = g_thread_create(pragha_scanner_count_no_files_worker, scanner, TRUE, NULL); - #endif scanner->worker_thread = pragha_async_launch_full(pragha_scanner_update_worker, pragha_scanner_worker_finished, @@ -622,11 +618,7 @@ /* Launch threads */ - #if GLIB_CHECK_VERSION(2,31,0) scanner->no_files_thread = g_thread_new("Count no files", pragha_scanner_count_no_files_worker, scanner); - #else - scanner->no_files_thread = g_thread_create(pragha_scanner_count_no_files_worker, scanner, TRUE, NULL); - #endif scanner->worker_thread = pragha_async_launch_full(pragha_scanner_scan_worker, pragha_scanner_worker_finished, @@ -645,8 +637,8 @@ g_hash_table_destroy(scanner->tracks_table); free_str_list(scanner->folder_list); free_str_list(scanner->folder_scanned); - pragha_mutex_free(scanner->no_files_mutex); - pragha_mutex_free(scanner->files_scanned_mutex); + g_mutex_clear (&scanner->no_files_mutex); + g_mutex_clear (&scanner->files_scanned_mutex); g_object_unref(scanner->cancellable); g_slice_free (PraghaScanner, scanner); @@ -700,9 +692,9 @@ g_free, g_object_unref); scanner->files_scanned = 0; - pragha_mutex_create(scanner->files_scanned_mutex); + g_mutex_init (&scanner->files_scanned_mutex); scanner->no_files = 0; - pragha_mutex_create(scanner->no_files_mutex); + g_mutex_init (&scanner->no_files_mutex); scanner->cancellable = g_cancellable_new (); scanner->update_timeout = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-simple-async.c new/pragha-1.2.2/src/pragha-simple-async.c --- old/pragha-1.2.1/src/pragha-simple-async.c 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-simple-async.c 2014-07-03 14:49:10.000000000 +0200 @@ -84,11 +84,7 @@ as->userdata = user_data; as->finished_data = NULL; - #if GLIB_CHECK_VERSION(2,31,0) g_thread_unref(g_thread_new("Launch async", pragha_async_worker, as)); - #else - g_thread_create(pragha_async_worker, as, FALSE, NULL); - #endif } GThread * @@ -102,9 +98,5 @@ as->userdata = userdata; as->finished_data = NULL; - #if GLIB_CHECK_VERSION(2,31,0) return g_thread_new("Launch async", pragha_async_worker, as); - #else - return g_thread_create(pragha_async_worker, as, TRUE, NULL); - #endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-simple-async.h new/pragha-1.2.2/src/pragha-simple-async.h --- old/pragha-1.2.1/src/pragha-simple-async.h 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-simple-async.h 2014-07-03 14:49:10.000000000 +0200 @@ -22,20 +22,6 @@ typedef struct _AsyncSimple AsyncSimple; -#if GLIB_CHECK_VERSION (2, 32, 0) -#define PRAGHA_MUTEX(mtx) GMutex mtx -#define pragha_mutex_free(mtx) g_mutex_clear (&(mtx)) -#define pragha_mutex_lock(mtx) g_mutex_lock (&(mtx)) -#define pragha_mutex_unlock(mtx) g_mutex_unlock (&(mtx)) -#define pragha_mutex_create(mtx) g_mutex_init (&(mtx)) -#else -#define PRAGHA_MUTEX(mtx) GMutex *mtx -#define pragha_mutex_free(mtx) g_mutex_free (mtx) -#define pragha_mutex_lock(mtx) g_mutex_lock (mtx) -#define pragha_mutex_unlock(mtx) g_mutex_unlock (mtx) -#define pragha_mutex_create(mtx) (mtx) = g_mutex_new () -#endif - gboolean pragha_async_set_idle_message (gpointer user_data); void pragha_async_launch (GThreadFunc worker_func, GSourceFunc finish_func, gpointer userdata); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-utils.c new/pragha-1.2.2/src/pragha-utils.c --- old/pragha-1.2.1/src/pragha-utils.c 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-utils.c 2014-07-03 14:49:39.000000000 +0200 @@ -168,59 +168,6 @@ aproximate_search ? 1 : 0); } -#if !GLIB_CHECK_VERSION(2,32,0) -/* Functions to check the network manager status. */ - -static NMState -dbus_check_nm_status (GDBusProxy *proxy) -{ - GVariant *tuple = g_dbus_proxy_call_sync(proxy, - "state", - NULL, - G_DBUS_CALL_FLAGS_NONE, - -1, - NULL, - NULL); - - if (!tuple) - return NM_STATE_UNKNOWN; - - guint32 state; - g_variant_get(tuple, "(u)", &state); - - g_variant_unref(tuple); - - return state; -} - -gboolean -nm_is_online () -{ - GDBusProxy *proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM, - G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START, - NULL, - NM_DBUS_SERVICE, - NM_DBUS_PATH, - NM_DBUS_INTERFACE, - NULL, - NULL); - - if (!proxy) - return FALSE; - - NMState state = dbus_check_nm_status (proxy); - - g_object_unref(proxy); - - if (state == NM_STATE_CONNECTED_LOCAL || - state == NM_STATE_CONNECTED_SITE || - state == NM_STATE_CONNECTED_GLOBAL) - return TRUE; - - return FALSE; -} -#endif - /* Set and remove the watch cursor to suggest background work.*/ void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-utils.h new/pragha-1.2.2/src/pragha-utils.h --- old/pragha-1.2.1/src/pragha-utils.h 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-utils.h 2014-07-03 14:49:39.000000000 +0200 @@ -33,24 +33,6 @@ gchar *g_strstr_lv (gchar *haystack, gchar *needle, gsize lv_distance); gchar *pragha_strstr_lv(gchar *haystack, gchar *needle, PraghaPreferences *preferences); -#if !GLIB_CHECK_VERSION(2,32,0) -#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager" -#define NM_DBUS_PATH "/org/freedesktop/NetworkManager" -#define NM_DBUS_INTERFACE "org.freedesktop.NetworkManager" - -typedef enum { - NM_STATE_UNKNOWN = 0, - NM_STATE_ASLEEP = 10, - NM_STATE_DISCONNECTED = 20, - NM_STATE_DISCONNECTING = 30, - NM_STATE_CONNECTING = 40, - NM_STATE_CONNECTED_LOCAL = 50, - NM_STATE_CONNECTED_SITE = 60, - NM_STATE_CONNECTED_GLOBAL = 70 -} NMState; -gboolean nm_is_online (); -#endif - void set_watch_cursor (GtkWidget *widget); void remove_watch_cursor (GtkWidget *widget); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-window.c new/pragha-1.2.2/src/pragha-window.c --- old/pragha-1.2.1/src/pragha-window.c 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-window.c 2014-07-03 14:49:39.000000000 +0200 @@ -223,7 +223,7 @@ */ void -pragha_window_free (PraghaApplication *pragha) +pragha_window_save_settings (PraghaApplication *pragha) { PraghaPreferences *preferences; GtkWidget *window, *pane; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha-window.h new/pragha-1.2.2/src/pragha-window.h --- old/pragha-1.2.1/src/pragha-window.h 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha-window.h 2014-07-03 14:49:39.000000000 +0200 @@ -39,7 +39,7 @@ gint pragha_menubar_append_plugin_action (PraghaApplication *pragha, GtkActionGroup *action_group, const gchar *menu_xml); void pragha_menubar_remove_plugin_action (PraghaApplication *pragha, GtkActionGroup *action_group, gint merge_id); -void pragha_window_free (PraghaApplication *pragha); -void pragha_window_new (PraghaApplication *pragha); +void pragha_window_save_settings (PraghaApplication *pragha); +void pragha_window_new (PraghaApplication *pragha); #endif /* PRAGHA_WINDOW_H */ \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pragha-1.2.1/src/pragha.c new/pragha-1.2.2/src/pragha.c --- old/pragha-1.2.1/src/pragha.c 2014-04-30 16:23:59.000000000 +0200 +++ new/pragha-1.2.2/src/pragha.c 2014-07-03 14:49:39.000000000 +0200 @@ -401,26 +401,10 @@ CDEBUG(DBG_INFO, "Cleaning up"); -#ifdef HAVE_LIBGLYR - if (pragha->glyr) { - pragha_glyr_free (pragha->glyr); - pragha->glyr = NULL; - } -#endif -#ifdef HAVE_LIBCLASTFM - if (pragha->clastfm) { - pragha_lastfm_free (pragha->clastfm); - pragha->clastfm = NULL; - } -#endif if (pragha->sidebar) { pragha_sidebar_free (pragha->sidebar); pragha->sidebar = NULL; } - if (pragha->mpris2) { - pragha_mpris_free (pragha->mpris2); - pragha->mpris2 = NULL; - } if (pragha->backend) { pragha_playback_stop (pragha); g_object_unref (pragha->backend); @@ -430,22 +414,6 @@ pragha_art_cache_free (pragha->art_cache); pragha->art_cache = NULL; } - if (pragha->cgnome_media_keys) { - gnome_media_keys_free (pragha->cgnome_media_keys); - pragha->cgnome_media_keys = NULL; - } -#ifdef HAVE_LIBKEYBINDER - if (pragha->keybinder) { - keybinder_free (); - pragha->keybinder = FALSE; - } -#endif - if (pragha->mainwindow) { - pragha_window_free (pragha); - /* Explicit destroy mainwindow to finalize lifecycle of childrens */ - gtk_widget_destroy (pragha->mainwindow); - pragha->mainwindow = NULL; - } if (pragha->scanner) { pragha_scanner_free (pragha->scanner); pragha->scanner = NULL; @@ -482,6 +450,51 @@ } static void +pragha_application_shutdown (GApplication *application) +{ + PraghaApplication *pragha = PRAGHA_APPLICATION (application); + + CDEBUG(DBG_INFO, "Pragha shutdown: Saving curret state."); + + if (pragha_preferences_get_restore_playlist (pragha->preferences)) + pragha_playlist_save_playlist_state (pragha->playlist); + + pragha_window_save_settings (pragha); + + pragha_playback_stop (pragha); + +#ifdef HAVE_LIBGLYR + if (pragha->glyr) { + pragha_glyr_free (pragha->glyr); + pragha->glyr = NULL; + } +#endif +#ifdef HAVE_LIBCLASTFM + if (pragha->clastfm) { + pragha_lastfm_free (pragha->clastfm); + pragha->clastfm = NULL; + } +#endif + if (pragha->mpris2) { + pragha_mpris_free (pragha->mpris2); + pragha->mpris2 = NULL; + } + if (pragha->cgnome_media_keys) { + gnome_media_keys_free (pragha->cgnome_media_keys); + pragha->cgnome_media_keys = NULL; + } +#ifdef HAVE_LIBKEYBINDER + if (pragha->keybinder) { + keybinder_free (); + pragha->keybinder = FALSE; + } +#endif + gtk_widget_destroy (pragha->mainwindow); + + G_APPLICATION_CLASS (pragha_application_parent_class)->shutdown (application); +} + +static void pragha_application_startup (GApplication *application) { PraghaApplication *pragha = PRAGHA_APPLICATION (application); @@ -512,7 +525,7 @@ pragha->art_cache = pragha_art_cache_new (); - pragha->backend = pragha_backend_new (pragha); + pragha->backend = pragha_backend_new (); g_signal_connect (pragha->backend, "finished", G_CALLBACK(pragha_backend_finished_song), pragha); @@ -680,16 +693,10 @@ return FALSE; } -//TODO consider use of GApplication::shutdown to save preferences and playlist - void pragha_application_quit (PraghaApplication *pragha) { -#if GLIB_CHECK_VERSION (2, 32, 0) g_application_quit (G_APPLICATION (pragha)); -#else - g_application_release (G_APPLICATION (pragha)); -#endif } static void @@ -701,6 +708,7 @@ object_class->dispose = pragha_application_dispose; application_class->startup = pragha_application_startup; + application_class->shutdown = pragha_application_shutdown; application_class->activate = pragha_application_activate; application_class->open = pragha_application_open; application_class->command_line = pragha_application_command_line; @@ -746,10 +754,7 @@ g_setenv("PULSE_PROP_media.role", "audio", TRUE); /* Initialize the GThread system */ -#if !GLIB_CHECK_VERSION(2,31,0) - if (!g_thread_supported()) - g_thread_init(NULL); -#endif + #if !GLIB_CHECK_VERSION(2,35,1) g_type_init (); #endif -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org