summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/application.cpp b/src/application.cpp
index efc1c2af..910e0bb5 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -102,7 +102,7 @@ struct BookmarksModelPrivate {
BookmarksModelPrivate()
{
model = new BookmarkModel;
- const auto path = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/bookmarks.xbel";
+ const auto path = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/bookmarks.xbel";
spdlog::debug("Loading bookmarks from {}", qUtf8Printable(path));
QFile f(path);
if (f.open(QIODevice::ReadOnly | QIODevice::Text)) {
@@ -110,7 +110,17 @@ struct BookmarksModelPrivate {
f.close();
}
}
- ~BookmarksModelPrivate() noexcept { delete model; }
+ ~BookmarksModelPrivate() noexcept
+ {
+ const auto path = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/bookmarks.xbel";
+ spdlog::debug("Storing bookmarks in {}", qUtf8Printable(path));
+ QFile f(path);
+ if (f.open(QIODevice::WriteOnly | QIODevice::Text)) {
+ model->save(&f);
+ f.close();
+ }
+ delete model;
+ }
BookmarkModel *model;
};