[gnote] Fix autolinking when renaming note with no links to it



commit d2c9df112288ddd2c744ef51f412c6e9e868448f
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Jun 7 15:19:35 2020 +0300

    Fix autolinking when renaming note with no links to it

 src/note.cpp     | 4 ++++
 src/notebase.cpp | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/note.cpp b/src/note.cpp
index 6d68b7d8..73052d1d 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -561,6 +561,10 @@ namespace gnote {
         }
       }
     }
+    else {
+      signal_renamed(shared_from_this(), old_title);
+      queue_save(CONTENT_CHANGED);
+    }
   }
 
   void Note::process_rename_link_update_end(int response, Gtk::Dialog *dialog,
diff --git a/src/notebase.cpp b/src/notebase.cpp
index 562de686..e65f6805 100644
--- a/src/notebase.cpp
+++ b/src/notebase.cpp
@@ -141,10 +141,11 @@ void NoteBase::process_rename_link_update(const Glib::ustring & old_title)
   if(!linking_notes.empty()) {
     for(NoteBase::Ptr & note : linking_notes) {
       note->rename_links(old_title, self);
-      signal_renamed(shared_from_this(), old_title);
-      queue_save(CONTENT_CHANGED);
     }
   }
+
+  signal_renamed(shared_from_this(), old_title);
+  queue_save(CONTENT_CHANGED);
 }
 
 void NoteBase::rename_without_link_update(const Glib::ustring & newTitle)


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