diff options
author | Arno <am@disconnect.de> | 2012-02-25 19:11:59 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2012-02-25 19:11:59 +0100 |
commit | 26530f47ff13e20d46472c12abc7567a61c14e57 (patch) | |
tree | a582b948752ab6a47bdb39c356535e6d0ad44c27 /mappingtreemodel.h | |
parent | 67ddb23a59cb56bd917db2d9c3c7bc62c96e53b4 (diff) | |
download | SheMov-26530f47ff13e20d46472c12abc7567a61c14e57.tar.gz SheMov-26530f47ff13e20d46472c12abc7567a61c14e57.tar.bz2 SheMov-26530f47ff13e20d46472c12abc7567a61c14e57.zip |
Make NewPicsDialog archive pictures
Finally NewPicsDialog actually does something. Added another parameter
to Helper::moveToArchive. If set to true, files will only be copied
instead of moved. Default is false, not changing the expected behavior.
Diffstat (limited to 'mappingtreemodel.h')
-rw-r--r-- | mappingtreemodel.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mappingtreemodel.h b/mappingtreemodel.h index a37e364..e55f609 100644 --- a/mappingtreemodel.h +++ b/mappingtreemodel.h @@ -39,6 +39,7 @@ class MappingTreeModel : public SmTreeModel { bool deleteMappingType(int typeId); bool addChild(const QVariant &name, const QModelIndex &parent); bool deleteChild(const QModelIndex &idx); + int childCount(const QModelIndex &idx) const; public slots: void populate(); @@ -74,22 +75,23 @@ class MappingTreeModel : public SmTreeModel { class MappingTreeResultModel : public SmTreeModel { Q_OBJECT public: - enum Roles { NameRole = Qt::UserRole + 1 }; - enum Fields { Name = 0 }; - enum { NumFields = 1 }; + enum Roles { NameRole = Qt::UserRole + 1, IdRole = Qt::UserRole + 2 }; + enum Fields { Name = 0, Id = 1 }; + enum { NumFields = 2 }; explicit MappingTreeResultModel(const QStringList &headers, QObject *parent = 0); //data + flags Qt::ItemFlags flags(const QModelIndex &index) const; bool setData(const QModelIndex &index, const QVariant &value, int role); - QModelIndex insertChild(const QVariant &data, SmTreeItem *parent); + QModelIndex insertChild(const QVariant &data, int id, SmTreeItem *parent); + QList<int> mappingsIds() const; public slots: void addItem(const MappingData &data); - private: int hasChild(SmTreeItem *item, const QVariant &name, int column = 0) const; + QList<int> mappingIdsRecursive(SmTreeItem *parent) const; }; struct MappingData { |