[gnote] Fix first run detection
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Fix first run detection
- Date: Sun, 3 May 2020 10:12:28 +0000 (UTC)
commit 237888b3df5e2888bb18df34e8c1b04bf7dff6b0
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun May 3 13:12:16 2020 +0300
Fix first run detection
src/notemanager.cpp | 4 +---
src/notemanagerbase.cpp | 3 ++-
src/notemanagerbase.hpp | 4 ++--
3 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/notemanager.cpp b/src/notemanager.cpp
index ff7375ed..b94f03ab 100644
--- a/src/notemanager.cpp
+++ b/src/notemanager.cpp
@@ -50,9 +50,7 @@ namespace gnote {
void NoteManager::init(const Glib::ustring & directory)
{
Glib::ustring backup = directory + "/Backup";
- // Before base init, after it will be false already
- bool is_first_run = first_run();
- NoteManagerBase::init(directory, backup);
+ bool is_first_run = NoteManagerBase::init(directory, backup);
Glib::RefPtr<Gio::Settings> settings = m_preferences.get_schema_settings(Preferences::SCHEMA_GNOTE);
// Watch the START_NOTE_URI setting and update it so that the
diff --git a/src/notemanagerbase.cpp b/src/notemanagerbase.cpp
index 772e1270..e67b56b9 100644
--- a/src/notemanagerbase.cpp
+++ b/src/notemanagerbase.cpp
@@ -101,7 +101,7 @@ NoteManagerBase::~NoteManagerBase()
}
}
-void NoteManagerBase::init(const Glib::ustring & directory, const Glib::ustring & backup_directory)
+bool NoteManagerBase::init(const Glib::ustring & directory, const Glib::ustring & backup_directory)
{
m_notes_dir = directory;
m_default_note_template_title = _("New Note Template");
@@ -123,6 +123,7 @@ void NoteManagerBase::init(const Glib::ustring & directory, const Glib::ustring
}
m_trie_controller = create_trie_controller();
+ return is_first_run;
}
bool NoteManagerBase::first_run() const
diff --git a/src/notemanagerbase.hpp b/src/notemanagerbase.hpp
index 66dbf881..280e9a7d 100644
--- a/src/notemanagerbase.hpp
+++ b/src/notemanagerbase.hpp
@@ -102,8 +102,7 @@ public:
NoteBase::RenamedHandler signal_note_renamed;
NoteBase::SavedHandler signal_note_saved;
protected:
- void init(const Glib::ustring & directory, const Glib::ustring & backup);
- bool first_run() const;
+ bool init(const Glib::ustring & directory, const Glib::ustring & backup);
virtual void post_load();
virtual void migrate_notes(const Glib::ustring & old_note_dir);
/** add the note to the manager and setup signals */
@@ -127,6 +126,7 @@ protected:
Glib::ustring m_backup_dir;
Glib::ustring m_default_note_template_title;
private:
+ bool first_run() const;
void create_notes_dir() const;
bool create_directory(const Glib::ustring & directory) const;
TrieController *create_trie_controller();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]