diff options
author | Arno <am@disconnect.de> | 2012-03-24 08:40:23 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2012-03-24 08:40:23 +0100 |
commit | f30d07e5acb83dd74bc6e6dc75b8b1c9e39e6e01 (patch) | |
tree | a5a7f348cea349330d230d96d59e79ec8adf7ead /mappingtreemodel.h | |
parent | e788be03472f1617a05274dac6d7f8939ca85f46 (diff) | |
download | SheMov-f30d07e5acb83dd74bc6e6dc75b8b1c9e39e6e01.tar.gz SheMov-f30d07e5acb83dd74bc6e6dc75b8b1c9e39e6e01.tar.bz2 SheMov-f30d07e5acb83dd74bc6e6dc75b8b1c9e39e6e01.zip |
Show mappings in PictureViewer2
Hell, this was one heck of a bitch. Lots of changes just to show the
mapping tree in PictureViewer2. Did I mention that I hate recursion?
Added a function for fetching a SmTreeItem * from MappingTreeModel for
paths, just to turn it into a QTextDocument in PictureViewer2. Of course
everything is recursive. Did I say that I hate recursion?
Well, as said in the comments, one recursion function seems fishy, but
it works (tm).
Diffstat (limited to 'mappingtreemodel.h')
-rw-r--r-- | mappingtreemodel.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mappingtreemodel.h b/mappingtreemodel.h index c1b6248..396484a 100644 --- a/mappingtreemodel.h +++ b/mappingtreemodel.h @@ -32,9 +32,14 @@ class MappingTreeModel : public SmTreeModel { int mappingTypeIdFromName(const QVariant &name) const; QString mappingTypeNameFromId(int id) const; + //static convenience funcs + //the caller is responsible for deleting the result! + SmTreeItem *treeFromPaths(const QStringList &paths); + //data QVariant data(const QModelIndex &index, int role) const; QList<QVariant> childList(const QVariant &value, int column = 0) const; + QList<QVariant> mappingsForFile(const QVariant &fileId) const; QModelIndex indexFromPath(const QString &path, int column = 0) const; bool setData(const QModelIndex &index, const QVariant &value, int role); void move(const QModelIndex &source, const QModelIndex &dest); @@ -80,6 +85,7 @@ class MappingTreeModel : public SmTreeModel { QSqlQuery *mDeleteChildQ; QSqlQuery *mUpdateParentQ; QSqlQuery *mDeleteMappingParentQ; + QSqlQuery *mMappingsForFileIdQ; QList<mappingType> mMappingTypes; QList<MappingData> mValidMappings; QList<SmTreeItem*> mSelectedMappings; |