diff options
Diffstat (limited to 'lib/bookmarks/bookmarkmodel.cpp')
-rw-r--r-- | lib/bookmarks/bookmarkmodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bookmarks/bookmarkmodel.cpp b/lib/bookmarks/bookmarkmodel.cpp index 895b178..05df3d7 100644 --- a/lib/bookmarks/bookmarkmodel.cpp +++ b/lib/bookmarks/bookmarkmodel.cpp @@ -12,6 +12,7 @@ #include <QBuffer> #include <QMimeData> #include <QRegularExpression> +#include <QDateTime> BookmarkModel::BookmarkModel(QObject *parent) : QAbstractItemModel(parent) @@ -132,6 +133,7 @@ QModelIndex BookmarkModel::appendBookmark(const QString &title, const QString &u int row = parentItem->childCount(); beginInsertRows(parent, row, row); auto *childItem = new BookmarkItem({ title, url }, BookmarkItem::Bookmark, parentItem); + childItem->setData(BookmarkItem::DateAdded, QDateTime::currentDateTime()); parentItem->appendChild(childItem); endInsertRows(); @@ -146,6 +148,7 @@ QModelIndex BookmarkModel::appendFolder(const QString &title, const QModelIndex beginInsertRows(parent, row, row); auto *childItem = new BookmarkItem({ title }, BookmarkItem::Folder, parentItem); + childItem->setData(BookmarkItem::DateAdded, QDateTime::currentDateTime()); parentItem->appendChild(childItem); endInsertRows(); |