[gnote] Use menu_pinned_notes
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Use menu_pinned_notes
- Date: Sat, 19 Dec 2020 14:06:22 +0000 (UTC)
commit 8d6824ba6a3323ccfb39b3af213450c59a3b6352
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sat Dec 19 16:04:17 2020 +0200
Use menu_pinned_notes
src/note.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/note.cpp b/src/note.cpp
index 4a0368eb..5971b03d 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -766,8 +766,7 @@ namespace gnote {
bool Note::is_pinned() const
{
- Glib::ustring pinned_uris = m_gnote.preferences()
- .get_schema_settings(Preferences::SCHEMA_GNOTE)->get_string(Preferences::MENU_PINNED_NOTES);
+ auto pinned_uris = m_gnote.preferences().menu_pinned_notes();
return pinned_uris.find(uri()) != Glib::ustring::npos;
}
@@ -775,8 +774,7 @@ namespace gnote {
void Note::set_pinned(bool pinned) const
{
Glib::ustring new_pinned;
- Glib::RefPtr<Gio::Settings> settings =
m_gnote.preferences().get_schema_settings(Preferences::SCHEMA_GNOTE);
- Glib::ustring old_pinned = settings->get_string(Preferences::MENU_PINNED_NOTES);
+ auto old_pinned = m_gnote.preferences().menu_pinned_notes();
bool is_currently_pinned = old_pinned.find(uri()) != Glib::ustring::npos;
if (pinned == is_currently_pinned)
@@ -794,7 +792,7 @@ namespace gnote {
}
}
}
- settings->set_string(Preferences::MENU_PINNED_NOTES, new_pinned);
+ m_gnote.preferences().menu_pinned_notes(new_pinned);
m_gnote.notebook_manager().signal_note_pin_status_changed(*this, pinned);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]