Commit 237888b3 authored by Aurimas Černius's avatar Aurimas Černius

Fix first run detection

parent ea1da8fe
......@@ -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
......
......@@ -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
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment