[gnote/gnome-3-6] Fix build on GCC 4.2



commit 8172b404b47b76dfd8de8c28c99049ed08e2cfd9
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sun Sep 30 22:03:05 2012 +0300

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

 src/notewindow.cpp                 |    6 +++---
 src/notewindow.hpp                 |    2 +-
 src/recentchanges.hpp              |    2 +-
 src/synchronization/syncdialog.cpp |    4 +++-
 src/utils.hpp                      |    9 ++++-----
 5 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index adc565b..8e06f4e 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -52,7 +52,7 @@
 namespace gnote {
 
   NoteWindow::NoteWindow(Note & note)
-    : ForcedPresentWindow<Gtk::Window>(note.get_title())
+    : ForcedPresentWindow(note.get_title())
     , m_note(note)
     , m_global_keys(NULL)
   {
@@ -224,7 +224,7 @@ namespace gnote {
 
   void NoteWindow::on_hide()
   {
-    utils::ForcedPresentWindow<Gtk::Window>::on_hide();
+    utils::ForcedPresentWindow::on_hide();
 
     // Workaround Gtk bug, where adding or changing Widgets
     // while the Window is hidden causes it to be reshown at
@@ -737,7 +737,7 @@ namespace gnote {
 
   void NoteWindow::on_show()
   {
-    utils::ForcedPresentWindow<Gtk::Window>::on_show();
+    utils::ForcedPresentWindow::on_show();
     // Make sure the cursor position is visible
     m_editor->scroll_to (m_editor->get_buffer()->get_insert());
   }
diff --git a/src/notewindow.hpp b/src/notewindow.hpp
index 472b3a0..5eba2f1 100644
--- a/src/notewindow.hpp
+++ b/src/notewindow.hpp
@@ -100,7 +100,7 @@ private:
 
 
 class NoteWindow 
-  : public utils::ForcedPresentWindow<Gtk::Window>
+  : public utils::ForcedPresentWindow
 {
 public:
   NoteWindow(Note &);
diff --git a/src/recentchanges.hpp b/src/recentchanges.hpp
index 6fa0e85..75ec958 100644
--- a/src/recentchanges.hpp
+++ b/src/recentchanges.hpp
@@ -57,7 +57,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 17f887e..e556c7b 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 82094c6..c9c170c 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -206,20 +206,19 @@ namespace gnote {
       guint m_timeout_id;
     };
 
-    template<typename ParentT>
     class ForcedPresentWindow 
-      : public ParentT
+      : public Gtk::Window
     {
     public:
       ForcedPresentWindow(const Glib::ustring & title)
-        : ParentT()
+        : Gtk::Window()
         {
-          ParentT::set_title(title);
+          Gtk::Window::set_title(title);
         }
 
       void present()
         {
-          ::tomboy_window_present_hardcore(GTK_WINDOW(ParentT::gobj()));
+          ::tomboy_window_present_hardcore(GTK_WINDOW(Gtk::Window::gobj()));
         }
     };
 



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