[gnote] Make new notes numbered from 1



commit 4e8e6d82c8343b716848ab74b691e2007f1c7899
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat May 18 21:34:30 2013 +0300

    Make new notes numbered from 1
    
    Start from 1 until we find a unique name.
    Fixes Bug 700448.

 src/notemanager.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/notemanager.cpp b/src/notemanager.cpp
index 333e974..e2b579d 100644
--- a/src/notemanager.cpp
+++ b/src/notemanager.cpp
@@ -521,7 +521,7 @@ namespace gnote {
     title = split_title_from_content (title, body);
       
     if (title.empty()) {
-      title = get_unique_name(_("New Note"), m_notes.size());
+      title = get_unique_name(_("New Note"), 1);
     }
 
     Note::Ptr template_note = get_or_create_template_note();
@@ -715,7 +715,7 @@ namespace gnote {
     std::string new_title(title);
     Tag::Ptr template_save_title = 
ITagManager::obj().get_or_create_system_tag(ITagManager::TEMPLATE_NOTE_SAVE_TITLE_SYSTEM_TAG);
     if(template_note->contains_tag(template_save_title)) {
-      new_title = get_unique_name(template_note->get_title(), m_notes.size());
+      new_title = get_unique_name(template_note->get_title(), 1);
     }
 
     // Use the body from the template note


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