diff options
Diffstat (limited to 'lspackagemodel.cpp')
-rw-r--r-- | lspackagemodel.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lspackagemodel.cpp b/lspackagemodel.cpp index d39bb89..9580e91 100644 --- a/lspackagemodel.cpp +++ b/lspackagemodel.cpp @@ -148,3 +148,16 @@ void LSPackageModel::handleFileWasRenamed(LYTPackageBase::ItemType type, QString if (toIdx != fromIdx) endMoveRows(); } + + +QString LSPackageModel::itemNameForIndex(const QModelIndex &index) const { + if (index.internalId() > 0) + return m_caches[index.internalId() - 1].at(index.row()); + return QString(); +} + +LYTPackageBase::ItemType LSPackageModel::itemTypeForIndex(const QModelIndex &index) const { + if (index.internalId() > 0) + return ContentKinds[index.internalId() - 1].type; + return (LYTPackageBase::ItemType)-1; +} |