[gnote] Fix test note



commit 6445401ee2dabc07636ab9a13273d27cdab3d9a3
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Mon Dec 23 18:40:05 2019 +0200

    Fix test note

 src/test/testnote.cpp        | 8 ++++----
 src/test/testnote.hpp        | 4 ++--
 src/test/testnotemanager.cpp | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/test/testnote.cpp b/src/test/testnote.cpp
index e2c40652..ce92328c 100644
--- a/src/test/testnote.cpp
+++ b/src/test/testnote.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2014,2018 Aurimas Cernius
+ * Copyright (C) 2014,2018-2019 Aurimas Cernius
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -22,9 +22,9 @@
 
 namespace test {
 
-Note::Note(gnote::NoteData *_data, const Glib::ustring & filepath, gnote::NoteManagerBase & manager_)
-  : gnote::NoteBase(_data, filepath, manager_)
-  , m_data_synchronizer(_data)
+Note::Note(std::unique_ptr<gnote::NoteData> _data, const Glib::ustring & filepath, gnote::NoteManagerBase & 
manager_)
+  : gnote::NoteBase(filepath, manager_)
+  , m_data_synchronizer(std::move(_data))
 {
 }
 
diff --git a/src/test/testnote.hpp b/src/test/testnote.hpp
index 9da0e58e..e3db09b4 100644
--- a/src/test/testnote.hpp
+++ b/src/test/testnote.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2014,2018 Aurimas Cernius
+ * Copyright (C) 2014,2018-2019 Aurimas Cernius
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@ class Note
   : public gnote::NoteBase
 {
 public:
-  Note(gnote::NoteData *_data, const Glib::ustring & filepath, gnote::NoteManagerBase & manager);
+  Note(std::unique_ptr<gnote::NoteData> _data, const Glib::ustring & filepath, gnote::NoteManagerBase & 
manager);
   void set_change_type(gnote::ChangeType c);
 protected:
   virtual const gnote::NoteDataBufferSynchronizerBase & data_synchronizer() const;
diff --git a/src/test/testnotemanager.cpp b/src/test/testnotemanager.cpp
index 7333e338..291e8582 100644
--- a/src/test/testnotemanager.cpp
+++ b/src/test/testnotemanager.cpp
@@ -41,13 +41,13 @@ NoteManager::NoteManager(const Glib::ustring & notesdir, gnote::IGnote & g)
 
 gnote::NoteBase::Ptr NoteManager::note_create_new(const Glib::ustring & title, const Glib::ustring & 
file_name)
 {
-  gnote::NoteData *note_data = new gnote::NoteData(gnote::NoteBase::url_from_path(file_name));
+  auto note_data = std::make_unique<gnote::NoteData>(gnote::NoteBase::url_from_path(file_name));
   note_data->title() = title;
   sharp::DateTime date(sharp::DateTime::now());
   note_data->create_date() = date;
   note_data->set_change_date(date);
 
-  return Note::Ptr(new Note(note_data, file_name, *this));
+  return std::make_shared<Note>(std::move(note_data), file_name, *this);
 }
 
 gnote::NoteBase::Ptr NoteManager::note_load(const Glib::ustring & file_name)


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