aboutsummaryrefslogtreecommitdiff
path: root/lib/bookmarks/model/bookmarkmodel.h
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-01-14 23:34:13 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-01-14 23:34:13 +0200
commit4c71c8571ceb10b29e6550cd0d8eb928049e6851 (patch)
tree2130c586e6be37185ca382e68ff645710d6c5e63 /lib/bookmarks/model/bookmarkmodel.h
parentFix if statements in PKGBUILD (diff)
downloadsmolbote-4c71c8571ceb10b29e6550cd0d8eb928049e6851.tar.xz
Move/rename files for readability
- add BookmarkFormat <<|>> BookmarkModel operators
Diffstat (limited to 'lib/bookmarks/model/bookmarkmodel.h')
-rw-r--r--lib/bookmarks/model/bookmarkmodel.h73
1 files changed, 0 insertions, 73 deletions
diff --git a/lib/bookmarks/model/bookmarkmodel.h b/lib/bookmarks/model/bookmarkmodel.h
deleted file mode 100644
index 300b724..0000000
--- a/lib/bookmarks/model/bookmarkmodel.h
+++ /dev/null
@@ -1,73 +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;
- void setItemExpanded(const QModelIndex &index, bool expanded);
-
- int rowCount(const QModelIndex &index) const override;
- QModelIndex appendBookmark(const QString &title, const QString &url, const QModelIndex &parent);
- QModelIndex appendFolder(const QString &title, 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;
- QModelIndex parentFolder(const QModelIndex &index) const;
-
- BookmarkItem *root()
- {
- return rootItem;
- }
-
- QStringList search(const QString &term) const;
-
- void resetModified()
- {
- m_isModified = false;
- }
- bool isModified() const
- {
- return m_isModified;
- }
-
-private:
- const QLatin1String mimeType = QLatin1String("application/xbel");
-
- BookmarkItem *getItem(const QModelIndex &index) const;
- BookmarkItem *rootItem;
-
- bool m_isModified = false;
-};
-
-#endif // SMOLBOTE_BOOKMARKMODEL_H