[gnote] Fix build using GCC 4.2



commit a55fb9fd49fc2f5c481d77a64b4423b11e591675
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sun Sep 30 22:20:48 2012 +0300

    Fix build using GCC 4.2
    
    * Remove template from ForcedPresentWindow
    * Create local object in method (details: http://gcc.gnu.org/bugs/#cxx_rvalbind)
    
    Fixes bug 684931

 src/recentchanges.hpp              |    2 +-
 src/synchronization/syncdialog.cpp |    4 +++-
 src/utils.hpp                      |   10 +++++-----
 3 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index 7a52d1f..2d5e52b 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -37,7 +37,7 @@
 namespace gnote {
   class NoteManager;
 
-typedef utils::ForcedPresentWindow<Gtk::ApplicationWindow> NoteRecentChangesParent;
+typedef utils::ForcedPresentWindow NoteRecentChangesParent;
 
 class NoteRecentChanges
   : public NoteRecentChangesParent
diff --git a/src/synchronization/syncdialog.cpp b/src/synchronization/syncdialog.cpp
index c7e4152..ea13e5b 100644
--- a/src/synchronization/syncdialog.cpp
+++ b/src/synchronization/syncdialog.cpp
@@ -353,7 +353,9 @@ SyncDialog::SyncDialog()
   expandVBox->pack_start(*scrolledWindow, true, true, 0);
 
   // Create model for TreeView
-  m_model = Gtk::TreeStore::create(TreeViewModel());
+  // Work-around for GCC versions < 4.3 (http://gcc.gnu.org/bugs/#cxx_rvalbind)
+  TreeViewModel tmp_model;
+  m_model = Gtk::TreeStore::create(tmp_model);
 
   // Create TreeView, attach model
   Gtk::TreeView *treeView = manage(new Gtk::TreeView);
diff --git a/src/utils.hpp b/src/utils.hpp
index 92b2657..ede4244 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -26,6 +26,7 @@
 #include <sigc++/signal.h>
 
 #include <gdkmm/pixbuf.h>
+#include <gtkmm/applicationwindow.h>
 #include <gtkmm/dialog.h>
 #include <gtkmm/image.h>
 #include <gtkmm/menu.h>
@@ -206,20 +207,19 @@ namespace gnote {
       guint m_timeout_id;
     };
 
-    template<typename ParentT>
     class ForcedPresentWindow 
-      : public ParentT
+      : public Gtk::ApplicationWindow
     {
     public:
       ForcedPresentWindow(const Glib::ustring & title)
-        : ParentT()
+        : Gtk::ApplicationWindow()
         {
-          ParentT::set_title(title);
+          Gtk::ApplicationWindow::set_title(title);
         }
 
       void present()
         {
-          ::tomboy_window_present_hardcore(GTK_WINDOW(ParentT::gobj()));
+          ::tomboy_window_present_hardcore(GTK_WINDOW(gobj()));
         }
     };
 



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