[gnote] Fix quit application for glib >= 2.32
- From: Aurimas Äernius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Fix quit application for glib >= 2.32
- Date: Tue, 6 Mar 2012 18:58:15 +0000 (UTC)
commit b690c69d5a35ddaea23d784d9f0a623c79515823
Author: Aurimas Äernius <aurisc4 gmail com>
Date: Tue Mar 6 20:15:35 2012 +0200
Fix quit application for glib >= 2.32
Use g_application_quit() instead of Gtk::Main::quit().
The former is available only since glib 2.32 and should be
used with that version of glib (the later fails).
configure.ac | 5 +++++
src/gnote.cpp | 6 +++++-
2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c8df9c8..32dbf83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,6 +64,11 @@ AC_LANG_COMPILER_REQUIRE
PKG_CHECK_MODULES(LIBGLIBMM, [glibmm-2.4])
PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= $GTK_VERSION])
PKG_CHECK_MODULES(LIBGTKMM, [gtkmm-3.0 >= $LIBGTKMM_VERSION])
+# Check for glib 2.32 or higher, which have certain incompatibilities with older ones
+PKG_CHECK_EXISTS(glib-2.0 >= 2.32,
+ [
+ AC_DEFINE(HAVE_GLIB_2_32, 1, [Define to 1 if glib version is at least 2.32])
+ ])
PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
PKG_CHECK_MODULES(LIBXSLT, [libxslt])
PKG_CHECK_MODULES(PCRE, [libpcrecpp])
diff --git a/src/gnote.cpp b/src/gnote.cpp
index 1a64cef..0bd097b 100644
--- a/src/gnote.cpp
+++ b/src/gnote.cpp
@@ -382,7 +382,11 @@ namespace gnote {
if(m_is_panel_applet) {
return;
}
+#ifdef HAVE_GLIB_2_32
+ g_application_quit(G_APPLICATION(m_app));
+#else
Gtk::Main::quit();
+#endif
}
void Gnote::on_preferences_response(int /*res*/)
@@ -643,7 +647,7 @@ namespace gnote {
else {
execute(remote);
}
- Gtk::Main::quit();
+ Gnote::obj().on_quit_gnote_action();
}
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]