diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-05 21:07:45 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-05 21:07:45 +0200 |
commit | a1d164895fac7fd705c8cb37c4c94700be32a0a2 (patch) | |
tree | 38320fda6dbe01f209b7fae508b089929be8c665 /lib/bookmarks/bookmarkmodel.h | |
parent | Fix line endings in appveyor.yml (diff) | |
download | smolbote-a1d164895fac7fd705c8cb37c4c94700be32a0a2.tar.xz |
bookmarks: fix new/delete buttons
Diffstat (limited to 'lib/bookmarks/bookmarkmodel.h')
-rw-r--r-- | lib/bookmarks/bookmarkmodel.h | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/lib/bookmarks/bookmarkmodel.h b/lib/bookmarks/bookmarkmodel.h deleted file mode 100644 index 28267aa..0000000 --- a/lib/bookmarks/bookmarkmodel.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote - * - * SPDX-License-Identifier: GPL-3.0 - */ - -#ifndef SMOLBOTE_BOOKMARKMODEL_H -#define SMOLBOTE_BOOKMARKMODEL_H - -#include "bookmarkitem.h" -#include <QAbstractItemModel> - -class BookmarkModel : public QAbstractItemModel -{ - Q_OBJECT - -public: - explicit BookmarkModel(QObject *parent = nullptr); - ~BookmarkModel() override; - - QVariant headerData(int section, Qt::Orientation orientation, int role) const override; - QVariant data(const QModelIndex &index, int role) const override; - QVariant data(const QModelIndex &index, int column, int role) const; - bool setData(const QModelIndex &index, const QVariant &value, int role) override; - bool setData(const QModelIndex &index, const QVariant &value, BookmarkItem::Fields column, int role); - Qt::ItemFlags flags(const QModelIndex &index) const override; - - bool isItemExpanded(const QModelIndex &index) const; - - int rowCount(const QModelIndex &index) const override; - bool appendBookmark(const QString &title, const QString &url, const QModelIndex &parent); - bool removeRows(int position, int rows, const QModelIndex &parent) override; - int columnCount(const QModelIndex &index) const override; - - Qt::DropActions supportedDropActions() const override; - QStringList mimeTypes() const override; - QMimeData *mimeData(const QModelIndexList &indexes) const override; - bool dropMimeData(const QMimeData *mimeData, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; - - QModelIndex index(int row, int column, const QModelIndex &parent) const override; - QModelIndex parent(const QModelIndex &index) const override; - - BookmarkItem *root() - { - return rootItem; - } - - QStringList search(const QString &term) const; - -private: - const QLatin1Literal mimeType = QLatin1Literal("application/xbel"); - - BookmarkItem *getItem(const QModelIndex &index) const; - BookmarkItem *rootItem; -}; - -#endif // SMOLBOTE_BOOKMARKMODEL_H |