[glibmm] Avoid use of deprecated API in tests and examples.



commit 3e0fbb22c0d4814de4174d32e12a45cbad79980e
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Oct 26 22:34:01 2011 +0200

    Avoid use of deprecated API in tests and examples.
    
    * tests/Makefile.am:
    * examples/Makefile.am: Disable deprecated API.
    * examples/network/socket-client.cc:
    * examples/network/socket-server.cc:
    * examples/thread/dispatcher.cc:
    * examples/thread/dispatcher2.cc:
    * examples/thread/thread.cc: Remove calls to Glib::thread_init(), instead
    calling Glib::init() where that side-effect was also intended.

 ChangeLog                         |   13 +++++++++++++
 examples/Makefile.am              |    3 ++-
 examples/network/socket-client.cc |    2 --
 examples/network/socket-server.cc |    2 --
 examples/thread/dispatcher.cc     |    2 +-
 examples/thread/dispatcher2.cc    |    2 +-
 examples/thread/thread.cc         |    4 ++--
 tests/Makefile.am                 |    3 ++-
 8 files changed, 21 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ab3ff14..69ac18f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2011-10-26  Murray Cumming  <murrayc murrayc com>
 
+	Avoid use of deprecated API in tests and examples.
+
+	* tests/Makefile.am:
+	* examples/Makefile.am: Disable deprecated API.
+	* examples/network/socket-client.cc:
+	* examples/network/socket-server.cc:
+	* examples/thread/dispatcher.cc:
+	* examples/thread/dispatcher2.cc:
+	* examples/thread/thread.cc: Remove calls to Glib::thread_init(), instead 
+	calling Glib::init() where that side-effect was also intended.
+
+2011-10-26  Murray Cumming  <murrayc murrayc com>
+
 	threadpool example: Use Mutex instead of StaticMutex.
 
 	* examples/thread/threadpool.cc: The advantage of StaticMutex was that
diff --git a/examples/Makefile.am b/examples/Makefile.am
index e905b25..0de871a 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -43,7 +43,8 @@ giomm_includes  = -I$(top_builddir)/gio $(if $(srcdir:.=),-I$(top_srcdir)/gio)
 local_cppflags  = -I$(top_builddir) $(glibmm_includes) $(giomm_includes)
 
 AM_CPPFLAGS = $(local_cppflags)
-AM_CXXFLAGS = $(GIOMM_CFLAGS) $(GLIBMM_WXXFLAGS)
+AM_CXXFLAGS = $(GIOMM_CFLAGS) $(GLIBMM_WXXFLAGS) -DGLIBMM_DISABLE_DEPRECATED -DGIOMM_DISABLE_DEPRECATED
+
 
 local_libglibmm = $(top_builddir)/glib/glibmm/libglibmm-$(GLIBMM_API_VERSION).la
 local_libgiomm  = $(top_builddir)/gio/giomm/libgiomm-$(GIOMM_API_VERSION).la
diff --git a/examples/network/socket-client.cc b/examples/network/socket-client.cc
index 33428b2..e6c5ae1 100644
--- a/examples/network/socket-client.cc
+++ b/examples/network/socket-client.cc
@@ -108,8 +108,6 @@ main (int argc,
     Glib::RefPtr<Gio::SocketAddressEnumerator> enumerator;
     Glib::RefPtr<Gio::SocketConnectable> connectable;
 
-    Glib::thread_init (NULL);
-
     Gio::init ();
 
     context = g_option_context_new (" <hostname>[:port] - Test GSocket client stuff");
diff --git a/examples/network/socket-server.cc b/examples/network/socket-server.cc
index d2dc315..bc2822b 100644
--- a/examples/network/socket-server.cc
+++ b/examples/network/socket-server.cc
@@ -111,8 +111,6 @@ main (int argc,
     GOptionContext *context;
     Glib::RefPtr<Gio::Cancellable> cancellable;
 
-    Glib::thread_init (NULL);
-
     Gio::init ();
 
     context = g_option_context_new (" - Test GSocket server stuff");
diff --git a/examples/thread/dispatcher.cc b/examples/thread/dispatcher.cc
index d5d7d8b..01906ab 100644
--- a/examples/thread/dispatcher.cc
+++ b/examples/thread/dispatcher.cc
@@ -213,7 +213,7 @@ void Application::on_progress_finished(ThreadProgress* thread_progress)
 
 int main(int, char**)
 {
-  Glib::thread_init();
+  Glib::init();
 
   Application application;
   application.run();
diff --git a/examples/thread/dispatcher2.cc b/examples/thread/dispatcher2.cc
index fd7379e..2f837b3 100644
--- a/examples/thread/dispatcher2.cc
+++ b/examples/thread/dispatcher2.cc
@@ -216,7 +216,7 @@ void Dispatcher::end()
 
 int main(int, char**)
 {
-  Glib::thread_init();
+  Glib::init();
   main_loop = Glib::MainLoop::create();
 
   Dispatcher dispatcher;
diff --git a/examples/thread/thread.cc b/examples/thread/thread.cc
index 1e26430..06c25f8 100644
--- a/examples/thread/thread.cc
+++ b/examples/thread/thread.cc
@@ -4,7 +4,7 @@
 #include <glibmm/thread.h>
 #include <glibmm/random.h>
 #include <glibmm/timer.h>
-
+#include <glibmm/init.h>
 
 namespace
 {
@@ -93,7 +93,7 @@ void MessageQueue::consumer()
 
 int main(int, char**)
 {
-  Glib::thread_init();
+  Glib::init();
 
   MessageQueue queue;
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 10bc1ac..f58e18c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -45,7 +45,8 @@ giomm_includes  = -I$(top_builddir)/gio $(if $(srcdir:.=),-I$(top_srcdir)/gio)
 local_cppflags  = -I$(top_builddir) $(glibmm_includes) $(giomm_includes)
 
 AM_CPPFLAGS = $(local_cppflags) $(GIOMM_CFLAGS)
-AM_CXXFLAGS = $(GLIBMM_WXXFLAGS)
+AM_CXXFLAGS = $(GLIBMM_WXXFLAGS) -DGLIBMM_DISABLE_DEPRECATED -DGIOMM_DISABLE_DEPRECATED
+
 
 local_libglibmm = $(top_builddir)/glib/glibmm/libglibmm-$(GLIBMM_API_VERSION).la
 local_libgiomm  = $(top_builddir)/gio/giomm/libgiomm-$(GIOMM_API_VERSION).la



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