[gnote] Move semantic for NoteWindow::set_name



commit dcba9bc6a4fa51d6955b06abdd9b734daa153aff
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Jun 19 17:34:28 2022 +0300

    Move semantic for NoteWindow::set_name

 src/note.cpp       | 4 ++--
 src/notewindow.cpp | 4 ++--
 src/notewindow.hpp | 4 ++--
 src/watchers.cpp   | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/note.cpp b/src/note.cpp
index 2da83103..d04fff6b 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -500,7 +500,7 @@ namespace gnote {
   {
     if (m_data.data().title() != new_title) {
       if (m_window) {
-        m_window->set_name(new_title);
+        m_window->set_name(Glib::ustring(new_title));
       }
 
       Glib::ustring old_title = std::move(m_data.data().title());
@@ -633,7 +633,7 @@ namespace gnote {
   {
     if(data_synchronizer().data().title() != newTitle) {
       if(m_window) {
-        m_window->set_name(newTitle);
+        m_window->set_name(Glib::ustring(newTitle));
       }
     }
     NoteBase::rename_without_link_update(std::move(newTitle));
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index 51991226..4debd74d 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -124,9 +124,9 @@ namespace gnote {
     return m_name;
   }
 
-  void NoteWindow::set_name(const Glib::ustring & name)
+  void NoteWindow::set_name(Glib::ustring && name)
   {
-    m_name = name;
+    m_name = std::move(name);
     signal_name_changed(m_name);
   }
 
diff --git a/src/notewindow.hpp b/src/notewindow.hpp
index 1be54bff..e1974d04 100644
--- a/src/notewindow.hpp
+++ b/src/notewindow.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2011-2017,2019,2021 Aurimas Cernius
+ * Copyright (C) 2011-2017,2019,2021-2022 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -137,7 +137,7 @@ public:
   ~NoteWindow();
 
   virtual Glib::ustring get_name() const override;
-  void set_name(const Glib::ustring & name);
+  void set_name(Glib::ustring && name);
   virtual void foreground() override;
   virtual void background() override;
   virtual void size_internals() override;
diff --git a/src/watchers.cpp b/src/watchers.cpp
index 2168727f..d4e71d2b 100644
--- a/src/watchers.cpp
+++ b/src/watchers.cpp
@@ -184,7 +184,7 @@ namespace gnote {
     }
     // Only set window title here, to give feedback that we
     // are indeed changing the title.
-    get_window()->set_name(title);
+    get_window()->set_name(std::move(title));
   }
 
 


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