[gnote] Do not use tr1 if C++11 is supported



commit f2f65f74c0e24098689dbfa32fde3d9b96124cf8
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Aug 3 22:52:13 2013 +0300

    Do not use tr1 if C++11 is supported

 configure.ac                         |    8 ++++----
 src/base/macros.hpp                  |   14 ++++++++++++++
 src/dbus/remotecontrol.cpp           |    2 +-
 src/note.cpp                         |   12 +++++++++---
 src/note.hpp                         |    6 +++---
 src/notebooks/notebook.hpp           |   15 +++++++--------
 src/notebooks/notebookmanager.cpp    |   10 +++++-----
 src/notebooks/notebookstreeview.cpp  |    4 ++--
 src/notebuffer.cpp                   |   16 +++++++++++-----
 src/notemanager.hpp                  |    2 +-
 src/noterenamedialog.hpp             |    4 ++--
 src/search.hpp                       |    5 +++--
 src/searchnoteswidget.cpp            |   14 +++++++-------
 src/synchronization/isyncmanager.hpp |    8 ++++----
 src/synchronization/syncdialog.hpp   |    2 +-
 src/synchronization/syncmanager.cpp  |    2 +-
 src/synchronization/syncmanager.hpp  |    2 +-
 src/synchronization/syncui.hpp       |    6 +++---
 src/tag.hpp                          |    5 +++--
 src/tray.hpp                         |    2 +-
 src/trie.hpp                         |    5 +++--
 src/triehit.hpp                      |    8 +++++---
 22 files changed, 91 insertions(+), 61 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 140c866..31d5b9c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,10 +91,6 @@ BOOST_REQUIRE([$BOOST_VERSION])
 BOOST_BIND
 BOOST_FORMAT
 BOOST_TEST([s])
-AC_CHECK_HEADER(tr1/memory,,[
-       CXXFLAGS="$CXXFLAGS -I/usr/include/boost/tr1";
-       AC_MSG_NOTICE([using boost tr1 implementation.])
-])
 
 if test $HAVE_CXX11 == 1; then
   cxx11_support="yes";
@@ -102,6 +98,10 @@ else
   cxx11_support="no";
   BOOST_CONVERSION
   BOOST_FOREACH
+  AC_CHECK_HEADER(tr1/memory,,[
+       CXXFLAGS="$CXXFLAGS -I/usr/include/boost/tr1";
+       AC_MSG_NOTICE([using boost tr1 implementation.])
+])
 fi
 
 
diff --git a/src/base/macros.hpp b/src/base/macros.hpp
index caca1d4..bedaeb7 100644
--- a/src/base/macros.hpp
+++ b/src/base/macros.hpp
@@ -30,9 +30,11 @@
 #define __BASE_MACROS_
 
 #if __cplusplus < 201103L
+  #include <tr1/memory>
   #include <boost/foreach.hpp>
   #include <boost/lexical_cast.hpp>
 #else
+  #include <memory>
   #include <string>
 #endif
 
@@ -50,10 +52,22 @@
   #define FOREACH(var, container) BOOST_FOREACH(var, container)
   #define TO_STRING(x) boost::lexical_cast<std::string>(x)
   #define STRING_TO_INT(x) boost::lexical_cast<int>(x)
+
+  using std::tr1::shared_ptr;
+  using std::tr1::weak_ptr;
+  using std::tr1::enable_shared_from_this;
+  using std::tr1::dynamic_pointer_cast;
+  using std::tr1::static_pointer_cast;
 #else
   #define FOREACH(var, container) for(var : container)
   #define TO_STRING(x) std::to_string(x)
   #define STRING_TO_INT(x) std::stoi(x)
+
+  using std::shared_ptr;
+  using std::weak_ptr;
+  using std::enable_shared_from_this;
+  using std::dynamic_pointer_cast;
+  using std::static_pointer_cast;
 #endif
 
 #endif
diff --git a/src/dbus/remotecontrol.cpp b/src/dbus/remotecontrol.cpp
index 7bf43d6..9d3d6c6 100644
--- a/src/dbus/remotecontrol.cpp
+++ b/src/dbus/remotecontrol.cpp
@@ -294,7 +294,7 @@ std::vector< std::string > RemoteControl::ListAllNotes()
 bool RemoteControl::NoteExists(const std::string& uri)
 {
   Note::Ptr note = m_manager.find_by_uri (uri);
-  return note;
+  return note != NULL;
 }
 
 
diff --git a/src/note.cpp b/src/note.cpp
index b82d506..733f299 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -24,8 +24,6 @@
 #include <config.h>
 #endif
 
-#include <tr1/functional>
-
 #include <boost/format.hpp>
 #include <boost/bind.hpp>
 #include <boost/algorithm/string/find.hpp>
@@ -56,6 +54,14 @@
 #include "sharp/xmlreader.hpp"
 #include "sharp/xmlwriter.hpp"
 
+#if HAVE_CXX11
+  #include <functional>
+  using std::hash;
+#else
+  #include <tr1/functional>
+  using std::tr1::hash;
+#endif
+
 
 namespace gnote {
 
@@ -309,7 +315,7 @@ namespace gnote {
 
   int Note::get_hash_code() const
   {
-    std::tr1::hash<std::string> h;
+    hash<std::string> h;
     return h(get_title());
   }
 
diff --git a/src/note.hpp b/src/note.hpp
index 6d871a3..955879d 100644
--- a/src/note.hpp
+++ b/src/note.hpp
@@ -219,12 +219,12 @@ private:
 
 
 class Note 
-  : public std::tr1::enable_shared_from_this<Note>
+  : public enable_shared_from_this<Note>
   , public sigc::trackable
 {
 public:
-  typedef std::tr1::shared_ptr<Note> Ptr;
-  typedef std::tr1::weak_ptr<Note> WeakPtr;
+  typedef shared_ptr<Note> Ptr;
+  typedef weak_ptr<Note> WeakPtr;
   typedef std::list<Ptr> List;
 
   typedef sigc::signal<void, const Note::Ptr&, const std::string& > RenamedHandler;
diff --git a/src/notebooks/notebook.hpp b/src/notebooks/notebook.hpp
index a09739b..745c593 100644
--- a/src/notebooks/notebook.hpp
+++ b/src/notebooks/notebook.hpp
@@ -25,7 +25,6 @@
 
 #include <set>
 #include <string>
-#include <tr1/memory>
 
 #include "base/macros.hpp"
 #include "tag.hpp"
@@ -39,10 +38,10 @@ namespace notebooks {
 /// An object that represents a notebook in Tomboy
 /// </summary>
 class Notebook 
-  : public std::tr1::enable_shared_from_this<Notebook>
+  : public enable_shared_from_this<Notebook>
 {
 public:
-  typedef std::tr1::shared_ptr<Notebook> Ptr;
+  typedef shared_ptr<Notebook> Ptr;
   static const char * NOTEBOOK_TAG_PREFIX;
   Notebook(NoteManager &, const std::string &, bool is_special = false);
   Notebook(NoteManager &, const Tag::Ptr &);
@@ -83,7 +82,7 @@ class SpecialNotebook
   : public Notebook
 {
 public:
-  typedef std::tr1::shared_ptr<SpecialNotebook> Ptr;
+  typedef shared_ptr<SpecialNotebook> Ptr;
 protected:
   SpecialNotebook(NoteManager & m, const std::string &s)
     : Notebook(m, s, true)
@@ -104,7 +103,7 @@ class AllNotesNotebook
   : public SpecialNotebook
 {
 public:
-  typedef std::tr1::shared_ptr<AllNotesNotebook> Ptr;
+  typedef shared_ptr<AllNotesNotebook> Ptr;
   AllNotesNotebook(NoteManager &);
   virtual std::string get_normalized_name() const override;
   virtual bool        contains_note(const Note::Ptr &) override;
@@ -122,7 +121,7 @@ class UnfiledNotesNotebook
   : public SpecialNotebook
 {
 public:
-  typedef std::tr1::shared_ptr<UnfiledNotesNotebook> Ptr;
+  typedef shared_ptr<UnfiledNotesNotebook> Ptr;
   UnfiledNotesNotebook(NoteManager &);
   virtual std::string get_normalized_name() const override;
   virtual bool        contains_note(const Note::Ptr &) override;
@@ -135,7 +134,7 @@ class PinnedNotesNotebook
   : public SpecialNotebook
 {
 public:
-  typedef std::tr1::shared_ptr<PinnedNotesNotebook> Ptr;
+  typedef shared_ptr<PinnedNotesNotebook> Ptr;
   PinnedNotesNotebook(NoteManager &);
   virtual std::string get_normalized_name() const override;
   virtual bool        contains_note(const Note::Ptr &) override;
@@ -148,7 +147,7 @@ class ActiveNotesNotebook
   : public SpecialNotebook
 {
 public:
-  typedef std::tr1::shared_ptr<ActiveNotesNotebook> Ptr;
+  typedef shared_ptr<ActiveNotesNotebook> Ptr;
   ActiveNotesNotebook(NoteManager &);
   virtual std::string get_normalized_name() const override;
   virtual bool        contains_note(const Note::Ptr &) override;
diff --git a/src/notebooks/notebookmanager.cpp b/src/notebooks/notebookmanager.cpp
index 3571fce..f05bd27 100644
--- a/src/notebooks/notebookmanager.cpp
+++ b/src/notebooks/notebookmanager.cpp
@@ -71,7 +71,7 @@ namespace gnote {
 
      iter = m_notebooks->append();
      iter->set_value(0, m_active_notes);
-     std::tr1::static_pointer_cast<ActiveNotesNotebook>(m_active_notes)->signal_size_changed
+     static_pointer_cast<ActiveNotesNotebook>(m_active_notes)->signal_size_changed
        .connect(sigc::mem_fun(*this, &NotebookManager::on_active_notes_size_changed));
 
       
@@ -425,8 +425,8 @@ namespace gnote {
       if (!notebook_a || !notebook_b)
         return 0;
 
-      SpecialNotebook::Ptr spec_a = std::tr1::dynamic_pointer_cast<SpecialNotebook>(notebook_a);
-      SpecialNotebook::Ptr spec_b = std::tr1::dynamic_pointer_cast<SpecialNotebook>(notebook_b);
+      SpecialNotebook::Ptr spec_a = dynamic_pointer_cast<SpecialNotebook>(notebook_a);
+      SpecialNotebook::Ptr spec_b = dynamic_pointer_cast<SpecialNotebook>(notebook_b);
       if(spec_a != 0 && spec_b != 0) {
         return strcmp(spec_a->get_normalized_name().c_str(), spec_b->get_normalized_name().c_str());
       }
@@ -477,7 +477,7 @@ namespace gnote {
     {
       Notebook::Ptr notebook;
       iter->get_value(0, notebook);
-      if (!notebook || std::tr1::dynamic_pointer_cast<SpecialNotebook>(notebook)) {
+      if (!notebook || dynamic_pointer_cast<SpecialNotebook>(notebook)) {
         return false;
       }
       return true;
@@ -488,7 +488,7 @@ namespace gnote {
       Notebook::Ptr notebook;
       iter->get_value(0, notebook);
       if(notebook == m_active_notes) {
-        return !std::tr1::static_pointer_cast<ActiveNotesNotebook>(m_active_notes)->empty();
+        return !static_pointer_cast<ActiveNotesNotebook>(m_active_notes)->empty();
       }
 
       return true;
diff --git a/src/notebooks/notebookstreeview.cpp b/src/notebooks/notebookstreeview.cpp
index a6a32af..ba6d062 100644
--- a/src/notebooks/notebookstreeview.cpp
+++ b/src/notebooks/notebookstreeview.cpp
@@ -73,7 +73,7 @@ namespace gnote {
       
       Notebook::Ptr destNotebook;
       iter->get_value(0, destNotebook);
-      if (std::tr1::dynamic_pointer_cast<AllNotesNotebook>(destNotebook)) {
+      if(dynamic_pointer_cast<AllNotesNotebook>(destNotebook)) {
         context->drag_finish (false, false, time_);
         return;
       }
@@ -111,7 +111,7 @@ namespace gnote {
       
       Notebook::Ptr destNotebook;
       iter->get_value(0, destNotebook);
-      if (std::tr1::dynamic_pointer_cast<AllNotesNotebook>(destNotebook)) {
+      if(dynamic_pointer_cast<AllNotesNotebook>(destNotebook)) {
         gtk_tree_view_set_drag_dest_row (gobj(), NULL, GTK_TREE_VIEW_DROP_INTO_OR_AFTER);
         return true;
       }
diff --git a/src/notebuffer.cpp b/src/notebuffer.cpp
index f681bff..fcc2e2b 100644
--- a/src/notebuffer.cpp
+++ b/src/notebuffer.cpp
@@ -21,11 +21,11 @@
 
 
 #include <algorithm>
-#include <tr1/array>
 
 #include <glibmm/i18n.h>
 #include <glibmm/main.h>
 
+#include "config.h"
 #include "debug.hpp"
 #include "notebuffer.hpp"
 #include "notetag.hpp"
@@ -36,6 +36,14 @@
 #include "sharp/xmlreader.hpp"
 #include "sharp/xmlwriter.hpp"
 
+#if HAVE_CXX11
+  #include <array>
+  using std::array;
+#else
+  #include <tr1/array>
+  using std::tr1::array;
+#endif
+
 namespace gnote {
 
 
@@ -306,13 +314,11 @@ namespace gnote {
   void NoteBuffer::range_deleted_event(const Gtk::TextIter & start,const Gtk::TextIter & end_iter)
   {
     //
-    std::tr1::array<Gtk::TextIter, 2> iters;
+    std::array<Gtk::TextIter, 2> iters;
     iters[0] = start;
     iters[1] = end_iter;
 
-    for(std::tr1::array<Gtk::TextIter, 2>::iterator iter2 = iters.begin();
-        iter2 != iters.end(); ++iter2) {
-      Gtk::TextIter & iter(*iter2);
+    FOREACH(Gtk::TextIter iter, iters) {
       Gtk::TextIter line_start = iter;
       line_start.set_line_offset(0);
 
diff --git a/src/notemanager.hpp b/src/notemanager.hpp
index 9bf12e5..fe298cf 100644
--- a/src/notemanager.hpp
+++ b/src/notemanager.hpp
@@ -41,7 +41,7 @@ namespace gnote {
   class NoteManager 
   {
   public:
-    typedef std::tr1::shared_ptr<NoteManager> Ptr;
+    typedef shared_ptr<NoteManager> Ptr;
     typedef sigc::signal<void, const Note::Ptr &> ChangedHandler;
     typedef sigc::slot<void, const Note::Ptr &> NoteChangedSlot;
     
diff --git a/src/noterenamedialog.hpp b/src/noterenamedialog.hpp
index 8861c3d..29fe3e1 100644
--- a/src/noterenamedialog.hpp
+++ b/src/noterenamedialog.hpp
@@ -23,7 +23,6 @@
 
 #include <map>
 #include <string>
-#include <tr1/memory>
 
 #include <glibmm.h>
 #include <gtkmm/grid.h>
@@ -31,6 +30,7 @@
 #include <gtkmm/radiobutton.h>
 #include <gtkmm/treeview.h>
 
+#include "base/macros.hpp"
 #include "note.hpp"
 
 namespace gnote {
@@ -78,7 +78,7 @@ class NoteRenameDialog
 {
 public:
 
-  typedef std::tr1::shared_ptr<std::map<Note::Ptr, bool> > MapPtr;
+  typedef shared_ptr<std::map<Note::Ptr, bool> > MapPtr;
 
   NoteRenameDialog(const Note::List & notes,
                    const std::string & old_title,
diff --git a/src/search.hpp b/src/search.hpp
index 3e992b0..03b790f 100644
--- a/src/search.hpp
+++ b/src/search.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2011 Aurimas Cernius
+ * Copyright (C) 2011,2013 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -31,6 +31,7 @@
 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>
 
+#include "base/macros.hpp"
 #include "note.hpp"
 #include "notebooks/notebook.hpp"
 
@@ -42,7 +43,7 @@ class Search
 {
 public:
   typedef std::multimap<int,Note::Ptr> Results;
-  typedef std::tr1::shared_ptr<Results> ResultsPtr;
+  typedef shared_ptr<Results> ResultsPtr;
 
   template<typename T>
   static void split_watching_quotes(std::vector<T> & split,
diff --git a/src/searchnoteswidget.cpp b/src/searchnoteswidget.cpp
index 7c2f5d0..788e931 100644
--- a/src/searchnoteswidget.cpp
+++ b/src/searchnoteswidget.cpp
@@ -124,7 +124,7 @@ std::string SearchNotesWidget::get_name() const
 {
   notebooks::Notebook::Ptr selected_notebook = get_selected_notebook();
   if(!selected_notebook
-     || std::tr1::dynamic_pointer_cast<notebooks::AllNotesNotebook>(selected_notebook)) {
+     || dynamic_pointer_cast<notebooks::AllNotesNotebook>(selected_notebook)) {
     return "";
   }
   return selected_notebook->get_name();
@@ -178,7 +178,7 @@ void SearchNotesWidget::perform_search()
 
   // Search using the currently selected notebook
   notebooks::Notebook::Ptr selected_notebook = get_selected_notebook();
-  if (std::tr1::dynamic_pointer_cast<notebooks::SpecialNotebook>(selected_notebook)) {
+  if(dynamic_pointer_cast<notebooks::SpecialNotebook>(selected_notebook)) {
     selected_notebook = notebooks::Notebook::Ptr();
   }
 
@@ -314,7 +314,7 @@ void SearchNotesWidget::notebook_text_cell_data_func(Gtk::CellRenderer * rendere
 
   crt->property_text() = notebook->get_name();
 
-  if(std::tr1::dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
+  if(dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
     // Bold the "Special" Notebooks
     crt->property_markup() = str(boost::format("<span weight=\"bold\">%1%</span>")
                                  % notebook->get_name());
@@ -331,7 +331,7 @@ void SearchNotesWidget::on_notebook_row_edited(const Glib::ustring& /*tree_path*
     return;
   }
   notebooks::Notebook::Ptr old_notebook = this->get_selected_notebook();
-  if(std::tr1::dynamic_pointer_cast<notebooks::SpecialNotebook>(old_notebook)) {
+  if(dynamic_pointer_cast<notebooks::SpecialNotebook>(old_notebook)) {
     return;
   }
   notebooks::Notebook::Ptr new_notebook = notebooks::NotebookManager::obj()
@@ -382,7 +382,7 @@ void SearchNotesWidget::on_notebook_selection_changed()
       m_selected_tags.insert(notebook->get_tag());
     }
     bool allow_edit = false;
-    if(std::tr1::dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
+    if(dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
       m_delete_notebook_action->set_sensitive(false);
       m_rename_notebook_action->set_sensitive(false);
     }
@@ -474,7 +474,7 @@ void SearchNotesWidget::select_all_notes_notebook()
   for(Gtk::TreeIter iter = model->children().begin(); iter; ++iter) {
     notebooks::Notebook::Ptr notebook;
     iter->get_value(0, notebook);
-    if(std::tr1::dynamic_pointer_cast<notebooks::AllNotesNotebook>(notebook) != NULL) {
+    if(dynamic_pointer_cast<notebooks::AllNotesNotebook>(notebook) != NULL) {
       m_notebooksTree->get_selection()->select(iter);
       break;
     }
@@ -1320,7 +1320,7 @@ void SearchNotesWidget::new_note()
 {
   Note::Ptr note;
   notebooks::Notebook::Ptr notebook = get_selected_notebook();
-  if(!notebook || std::tr1::dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
+  if(!notebook || dynamic_pointer_cast<notebooks::SpecialNotebook>(notebook)) {
     // Just create a standard note (not in a notebook)
     note = m_manager.create();
   }
diff --git a/src/synchronization/isyncmanager.hpp b/src/synchronization/isyncmanager.hpp
index a2a004d..2691e24 100644
--- a/src/synchronization/isyncmanager.hpp
+++ b/src/synchronization/isyncmanager.hpp
@@ -23,8 +23,8 @@
 
 #include <list>
 #include <string>
-#include <tr1/memory>
 
+#include "base/macros.hpp"
 #include "note.hpp"
 #include "syncui.hpp"
 #include "syncutils.hpp"
@@ -48,7 +48,7 @@ public:
 class SyncClient
 {
 public:
-  typedef std::tr1::shared_ptr<SyncClient> Ptr;
+  typedef shared_ptr<SyncClient> Ptr;
 
   virtual ~SyncClient();
 
@@ -71,7 +71,7 @@ public:
   virtual ~ISyncManager();
 
   virtual void reset_client() = 0;
-  virtual void perform_synchronization(const std::tr1::shared_ptr<SyncUI> & sync_ui) = 0;
+  virtual void perform_synchronization(const SyncUI::Ptr & sync_ui) = 0;
   virtual void resolve_conflict(SyncTitleConflictResolution resolution) = 0;
   virtual bool synchronized_note_xml_matches(const std::string & noteXml1, const std::string & noteXml2) = 0;
   virtual SyncState state() const = 0;
@@ -80,7 +80,7 @@ public:
 class SyncServer
 {
 public:
-  typedef std::tr1::shared_ptr<SyncServer> Ptr;
+  typedef shared_ptr<SyncServer> Ptr;
 
   virtual ~SyncServer();
 
diff --git a/src/synchronization/syncdialog.hpp b/src/synchronization/syncdialog.hpp
index 900265f..7467f25 100644
--- a/src/synchronization/syncdialog.hpp
+++ b/src/synchronization/syncdialog.hpp
@@ -40,7 +40,7 @@ namespace sync {
     , public SyncUI
   {
   public:
-    typedef std::tr1::shared_ptr<SyncDialog> Ptr;
+    typedef shared_ptr<SyncDialog> Ptr;
 
     static Ptr create(NoteManager &);
 
diff --git a/src/synchronization/syncmanager.cpp b/src/synchronization/syncmanager.cpp
index 4c0c24a..5ee0f2e 100644
--- a/src/synchronization/syncmanager.cpp
+++ b/src/synchronization/syncmanager.cpp
@@ -91,7 +91,7 @@ namespace sync {
   }
 
 
-  void SyncManager::perform_synchronization(const std::tr1::shared_ptr<SyncUI> & sync_ui)
+  void SyncManager::perform_synchronization(const SyncUI::Ptr & sync_ui)
   {
     if(m_sync_thread != NULL) {
       // A synchronization thread is already running
diff --git a/src/synchronization/syncmanager.hpp b/src/synchronization/syncmanager.hpp
index 12dcf62..91a4992 100644
--- a/src/synchronization/syncmanager.hpp
+++ b/src/synchronization/syncmanager.hpp
@@ -43,7 +43,7 @@ namespace sync {
     SyncManager(NoteManager &);
     static void init(NoteManager &);
     virtual void reset_client() override;
-    virtual void perform_synchronization(const std::tr1::shared_ptr<SyncUI> & sync_ui) override;
+    virtual void perform_synchronization(const SyncUI::Ptr & sync_ui) override;
     void synchronization_thread();
     virtual void resolve_conflict(SyncTitleConflictResolution resolution) override;
     virtual bool synchronized_note_xml_matches(const std::string & noteXml1, const std::string & noteXml2) 
override;
diff --git a/src/synchronization/syncui.hpp b/src/synchronization/syncui.hpp
index f25bf54..d0943ec 100644
--- a/src/synchronization/syncui.hpp
+++ b/src/synchronization/syncui.hpp
@@ -24,8 +24,8 @@
 
 #include <list>
 #include <string>
-#include <tr1/memory>
 
+#include "base/macros.hpp"
 #include "syncutils.hpp"
 
 
@@ -33,10 +33,10 @@ namespace gnote {
 namespace sync {
 
   class SyncUI
-    : public std::tr1::enable_shared_from_this<SyncUI>
+    : public enable_shared_from_this<SyncUI>
   {
   public:
-    typedef std::tr1::shared_ptr<SyncUI> Ptr;
+    typedef shared_ptr<SyncUI> Ptr;
     typedef sigc::slot<void> SlotConnecting;
     typedef sigc::slot<void> SlotIdle;
 
diff --git a/src/tag.hpp b/src/tag.hpp
index e717248..82acb4f 100644
--- a/src/tag.hpp
+++ b/src/tag.hpp
@@ -26,7 +26,8 @@
 
 #include <list>
 #include <string>
-#include <tr1/memory>
+
+#include "base/macros.hpp"
 
 namespace gnote {
 
@@ -35,7 +36,7 @@ namespace gnote {
   class Tag 
   {
   public:
-    typedef std::tr1::shared_ptr<Tag> Ptr;
+    typedef shared_ptr<Tag> Ptr;
     static const char * SYSTEM_TAG_PREFIX;
 
     Tag(const std::string & name);
diff --git a/src/tray.hpp b/src/tray.hpp
index e8a576c..f57d124 100644
--- a/src/tray.hpp
+++ b/src/tray.hpp
@@ -75,7 +75,7 @@ public:
 class Tray
 {
 public:
-  typedef std::tr1::shared_ptr<Tray> Ptr;
+  typedef shared_ptr<Tray> Ptr;
 #ifdef HAVE_X11_SUPPORT
   Tray(NoteManager &, IGnoteTray &, IKeybinder &);
 #else
diff --git a/src/trie.hpp b/src/trie.hpp
index c50b7c2..e394cf9 100644
--- a/src/trie.hpp
+++ b/src/trie.hpp
@@ -1,6 +1,7 @@
 /*
  * gnote
  *
+ * Copyright (C) 2013 Aurimas Cernius
  * Copyright (C) 2011 Debarshi Ray
  * Copyright (C) 2009 Hubert Figuiere
  *
@@ -23,10 +24,10 @@
 
 #include <list>
 #include <queue>
-#include <tr1/memory>
 
 #include <glibmm.h>
 
+#include "base/macros.hpp"
 #include "triehit.hpp"
 
 namespace gnote {
@@ -38,7 +39,7 @@ class TrieTree
 private:
 
   class TrieState;
-  typedef std::tr1::shared_ptr<TrieState> TrieStatePtr;
+  typedef shared_ptr<TrieState> TrieStatePtr;
   typedef std::list<TrieStatePtr> TrieStateList;
   typedef std::queue<TrieStatePtr> TrieStateQueue;
 
diff --git a/src/triehit.hpp b/src/triehit.hpp
index fd63462..72b15fc 100644
--- a/src/triehit.hpp
+++ b/src/triehit.hpp
@@ -1,6 +1,7 @@
 /*
  * gnote
  *
+ * Copyright (C) 2013 Aurimas Cernius
  * Copyright (C) 2011 Debarshi Ray
  * Copyright (C) 2009 Hubert Figuiere
  *
@@ -22,19 +23,20 @@
 #define __TRIEHIT_HPP_
 
 #include <list>
-#include <tr1/memory>
 
 #include <glibmm.h>
 
+#include "base/macros.hpp"
+
 namespace gnote {
 
 template<class value_t>
 class TrieHit
 {
 public:
-  typedef std::tr1::shared_ptr<TrieHit> Ptr;
+  typedef shared_ptr<TrieHit> Ptr;
   typedef std::list<Ptr> List;
-  typedef std::tr1::shared_ptr<List> ListPtr;
+  typedef shared_ptr<List> ListPtr;
 
   TrieHit(int s, int e, const Glib::ustring & k, const value_t & v)
     : m_start(s)


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