[gnote] Remove start up notes



commit c249cd1d5b8ae9247f65c5370a077aeccbea7494
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Sun Nov 18 18:00:02 2012 +0200

    Remove start up notes

 data/org.gnome.gnote.gschema.xml.in |    5 -----
 src/note.cpp                        |   28 ----------------------------
 src/note.hpp                        |   11 -----------
 src/notemanager.cpp                 |   20 +-------------------
 src/preferences.cpp                 |    1 -
 src/preferences.hpp                 |    1 -
 6 files changed, 1 insertions(+), 65 deletions(-)
---
diff --git a/data/org.gnome.gnote.gschema.xml.in b/data/org.gnome.gnote.gschema.xml.in
index aba76d6..d438000 100644
--- a/data/org.gnome.gnote.gschema.xml.in
+++ b/data/org.gnome.gnote.gschema.xml.in
@@ -50,11 +50,6 @@
       <_summary>List of pinned notes</_summary>
       <_description>Whitespace-separated list of note URIs for notes that should always appear in the Gnote note menu.</_description>
     </key>
-    <key name="enable-startup-notes" type="b">
-      <default>true</default>
-      <_summary>Enable startup notes</_summary>
-      <_description>If enabled, all notes that were open when Gnote quit will automatically be reopened at startup.</_description>
-    </key>
     <key name="main-window-maximized" type="b">
       <default>false</default>
       <_summary>Is main window maximized</_summary>
diff --git a/src/note.cpp b/src/note.cpp
index a2b4a32..0719f35 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -137,7 +137,6 @@ namespace gnote {
     , m_height(0)
     , m_x(s_noPosition)
     , m_y(s_noPosition)
-    , m_open_on_startup(false)
   {
   }
 
@@ -871,11 +870,6 @@ namespace gnote {
             DBG_OUT("loading tag subtree failed");
           }
         }
-        else if(name == "open-on-startup") {
-          // TODO this is a hacked on observation about how Mono convert
-          // a bool from a string.
-          set_is_open_on_startup(xml.read_string() == "True");
-        }
         break;
       default:
         break;
@@ -1082,21 +1076,6 @@ namespace gnote {
     notebooks::NotebookManager::instance().signal_note_pin_status_changed(*this, pinned);
   }
 
-  
-  bool Note::is_open_on_startup() const
-  {
-    return data().is_open_on_startup();
-  }
-
-
-  void Note::set_is_open_on_startup(bool value)
-  {
-    if (data().is_open_on_startup() != value) {
-      data().set_is_open_on_startup(value);
-      m_save_needed = true;
-    }
-  }
-  
   void Note::get_tags(std::list<Tag::Ptr> & l) const
   {
     sharp::map_get_values(m_data.data().tags(), l);
@@ -1219,9 +1198,6 @@ namespace gnote {
             DBG_OUT("loading tag subtree failed");
           }
         }
-        else if(name == "open-on-startup") {
-          note->set_is_open_on_startup(xml.read_string() == "True");
-        }
         break;
 
       default:
@@ -1363,10 +1339,6 @@ namespace gnote {
       xml.write_end_element();
     }
 
-    xml.write_start_element("", "open-on-startup", "");
-    xml.write_string(note.is_open_on_startup() ? "True" : "False");
-    xml.write_end_element();
-
     xml.write_end_element(); // Note
     xml.write_end_document();
 
diff --git a/src/note.hpp b/src/note.hpp
index c0ac867..955e386 100644
--- a/src/note.hpp
+++ b/src/note.hpp
@@ -162,14 +162,6 @@ public:
       return m_tags;
     }
 
-  bool is_open_on_startup() const
-    {
-      return m_open_on_startup;
-    }
-  void set_is_open_on_startup(bool v)
-    {
-      m_open_on_startup = v;
-    }
   void set_position_extent(int x, int y, int width, int height);
   bool has_position();
   bool has_extent();
@@ -185,7 +177,6 @@ private:
   int               m_selection_bound_pos;
   int               m_width, m_height;
   int               m_x, m_y;
-  bool              m_open_on_startup;
 
   TagMap m_tags;
 };
@@ -340,8 +331,6 @@ public:
     }
   bool is_pinned() const;
   void set_pinned(bool pinned) const;
-  bool is_open_on_startup() const;
-  void set_is_open_on_startup(bool);
   void get_tags(std::list<Tag::Ptr> &) const;
   bool enabled() const
     {
diff --git a/src/notemanager.cpp b/src/notemanager.cpp
index af07c9d..afaf681 100644
--- a/src/notemanager.cpp
+++ b/src/notemanager.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2010-2011 Aurimas Cernius
+ * Copyright (C) 2010-2012 Aurimas Cernius
  * Copyright (C) 2010 Debarshi Ray
  * Copyright (C) 2009 Hubert Figuiere
  *
@@ -349,9 +349,6 @@ namespace gnote {
     // Update the trie so addins can access it, if they want.
     m_trie_controller->update ();
 
-    bool startup_notes_enabled = Preferences::obj()
-      .get_schema_settings(Preferences::SCHEMA_GNOTE)->get_boolean(Preferences::ENABLE_STARTUP_NOTES);
-
     // Load all the addins for our notes.
     // Iterating through copy of notes list, because list may be
     // changed when loading addins.
@@ -361,16 +358,6 @@ namespace gnote {
       const Note::Ptr & note(*iter);
 
       m_addin_mgr->load_addins_for_note (note);
-
-        // Show all notes that were visible when tomboy was shut down
-      if (note->is_open_on_startup()) {
-        if (startup_notes_enabled) {
-          note->get_window()->show();
-        }
-        
-        note->set_is_open_on_startup(false);
-        note->queue_save (NO_CHANGE);
-      }
     }
   }
 
@@ -423,11 +410,6 @@ namespace gnote {
     for(Note::List::const_iterator iter = notesCopy.begin();
         iter != notesCopy.end(); ++iter) {
       const Note::Ptr & note(*iter);
-      // If the note is visible, it will be shown automatically on
-      // next startup
-      if (note->has_window() && note->get_window()->get_visible())
-          note->set_is_open_on_startup(true);
-
       note->save();
     }
   }
diff --git a/src/preferences.cpp b/src/preferences.cpp
index fc76aa5..873ff26 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -37,7 +37,6 @@ namespace gnote {
   const char * Preferences::ENABLE_WIKIWORDS = "enable-wikiwords";
   const char * Preferences::ENABLE_CUSTOM_FONT = "enable-custom-font";
   const char * Preferences::ENABLE_KEYBINDINGS = "enable-keybindings";
-  const char * Preferences::ENABLE_STARTUP_NOTES = "enable-startup-notes";
   const char * Preferences::ENABLE_AUTO_BULLETED_LISTS = "enable-bulleted-lists";
   const char * Preferences::ENABLE_ICON_PASTE = "enable-icon-paste";
   const char * Preferences::ENABLE_CLOSE_NOTE_ON_ESCAPE = "enable-close-note-on-escape";
diff --git a/src/preferences.hpp b/src/preferences.hpp
index 888dc6f..3d3c621 100644
--- a/src/preferences.hpp
+++ b/src/preferences.hpp
@@ -47,7 +47,6 @@ namespace gnote {
     static const char *ENABLE_WIKIWORDS;
     static const char *ENABLE_CUSTOM_FONT;
     static const char *ENABLE_KEYBINDINGS;
-    static const char *ENABLE_STARTUP_NOTES;
     static const char *ENABLE_AUTO_BULLETED_LISTS;
     static const char *ENABLE_ICON_PASTE;
     static const char *ENABLE_CLOSE_NOTE_ON_ESCAPE;



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