summaryrefslogtreecommitdiffstats
path: root/archivemodel.h
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-06-14 15:14:58 +0200
committerArno <am@disconnect.de>2013-06-14 15:14:58 +0200
commitdeee95ecd5d92b93956061d4e6ae63246b8bc928 (patch)
tree8a12b93a118e78b431e526aa2178651f346d3200 /archivemodel.h
parent35f5a0c5e13df3a0a41ef990b886a98ce2374a5c (diff)
downloadSheMov-deee95ecd5d92b93956061d4e6ae63246b8bc928.tar.gz
SheMov-deee95ecd5d92b93956061d4e6ae63246b8bc928.tar.bz2
SheMov-deee95ecd5d92b93956061d4e6ae63246b8bc928.zip
Filter recursive
Well, well... Recursion isn't that bad at all. Filter experimental ArchiveView recursive by the following rules: * check children _and_ parents for filter * if any child _or_ parent matches, accept the current row, parents and children. The column is converted to a QString and matched by QRegExp, so don't try to match numbers or anything else.
Diffstat (limited to 'archivemodel.h')
-rw-r--r--archivemodel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/archivemodel.h b/archivemodel.h
index 8055c31..29f10ab 100644
--- a/archivemodel.h
+++ b/archivemodel.h
@@ -30,6 +30,7 @@ class ArchiveModel : public SmTreeModel {
ArchiveCollector *collector() { return mCollector; }
virtual QVariant data(const QModelIndex &index, int role) const;
virtual bool setData(const QModelIndex &idx, const QVariant &value, int role);
+ virtual bool matchRecursive(const QModelIndex &parent, const QRegExp &regex, int column = 0) const;
virtual bool removeNode(const QModelIndex &idx);
QStringList indexToPath(const QModelIndex &idx) const;
QModelIndexList pathToIndex(const QStringList &path) const;
@@ -47,6 +48,7 @@ class ArchiveModel : public SmTreeModel {
void collectorFinished();
private:
+ bool checkParents(const SmTreeItem *item, const QRegExp &regex, int column) const;
void emitDatabaseError(const QSqlError &e);
QSqlDatabase mDb;
QHash<QString, int> mAvailableOrders;