[pan2] - deprecation-fix for gmutex - don't use gnome-doc-utils in makefile it is disabled



commit 9c25839136b3e63ece299f3502277d822ef5a32f
Author: Heinrich MÃller <henmull src gnome org>
Date:   Thu Jan 19 07:15:00 2012 +0100

    - deprecation-fix for gmutex
    - don't use gnome-doc-utils in makefile it is disabled

 Makefile.am           |   10 ++++++++--
 pan/general/locking.h |   23 ++++++++++++++++++-----
 pan/gui/pan.cc        |    2 ++
 pan/gui/prefs-ui.cc   |    4 +++-
 4 files changed, 31 insertions(+), 8 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index bdd2a72..426f366 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,19 +10,21 @@ DESKTOP_IN_FILES=pan.desktop.in
 DESKTOP_FILES=$(DESKTOP_IN_FILES:.desktop.in=.desktop)
 
 DISTCLEANFILES = \
- gnome-doc-utils.make \
  intltool-extract \
  intltool-merge \
  intltool-update \
  pan.desktop
 
+if ENABLE_HELP
+DISTCLEANFILES += gnome-doc-utils.make 
+endif 
+
 EXTRA_DIST = \
  README \
  README.windows \
  README.mingw \
  ChangeLog \
  Pan.ico \
- gnome-doc-utils.make \
  pan.spec \
  pan.png \
  $(DESKTOP_IN_FILES) \
@@ -30,6 +32,10 @@ EXTRA_DIST = \
  intltool-extract.in intltool-merge.in intltool-update.in \
  pan_git_rev
 
+if ENABLE_HELP
+EXTRA_DIST += gnome-doc-utils.make 
+endif 
+
 DISTCHECK_CONFIGURE_FLAGS="--disable-scrollkeeper"
 
 Productivitydir = $(datadir)/applications
diff --git a/pan/general/locking.h b/pan/general/locking.h
index 4850576..fa55854 100644
--- a/pan/general/locking.h
+++ b/pan/general/locking.h
@@ -31,24 +31,37 @@ namespace pan
    *
    * @author Calin Culianu <calin ajvar org>
    * @ingroup general
+   * (changed for glib >= 3.32)
    */
   class Mutex
   {
     private:
+      static GMutex mutex;
       GMutex * m;
-      Mutex& operator= (const Mutex&); ///< unimplemented
-      Mutex (const Mutex&); ///< unimplemented
 
     public:
 
       /** Create a new mutex */
-      Mutex(): m(g_mutex_new()) { }
+      Mutex()
+      {
+#if !GLIB_CHECK_VERSION(3,32,0)
+        m = g_mutex_new();
+#else
+        g_mutex_init(&mutex);
+        m = &mutex;
+#endif
+      }
 
       /** Destroy the mutex */
-      ~Mutex() { g_mutex_free(m); }
+      ~Mutex()
+      {
+#if !GLIB_CHECK_VERSION(3,32,0)
+        g_mutex_free(m);
+#endif
+      }
 
       /** Block until a lock is acquired */
-      void lock() { g_mutex_lock(m); }
+      void lock()   { g_mutex_lock(m); }
 
       /** Unlock the mutex - may wake another thread waiting on it */
       void unlock() { g_mutex_unlock(m); }
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index dc07cec..816c8d9 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -839,7 +839,9 @@ main (int argc, char *argv[])
   textdomain (GETTEXT_PACKAGE);
 
   g_type_init();
+#if !GLIB_CHECK_VERSION(2,32,0)
   g_thread_init (0);
+#endif
   g_mime_init (GMIME_ENABLE_RFC2047_WORKAROUNDS);
 
   bool gui(true), nzb(false), verbosed(false);
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index bd5792a..e72a69b 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -598,7 +598,9 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
     gtk_label_set_mnemonic_widget(GTK_LABEL(l), w);
     HIG::workarea_add_row (t, &row, w, l);
     w = new_entry ("cache-file-extension", "msg", prefs);
-    HIG :: workarea_add_row (t, &row, w, gtk_label_new(_("File extension for Cached Articles")));
+    l = gtk_label_new(_("File extension for Cached Articles"));
+    gtk_misc_set_alignment (GTK_MISC(l), 0.0, 0.5);
+    HIG :: workarea_add_row (t, &row, w, l);
 
   HIG :: workarea_finish (t, &row);
   gtk_notebook_append_page (GTK_NOTEBOOK(notebook), t, gtk_label_new_with_mnemonic(_("_Behavior")));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]