diff options
author | Treeki <treeki@gmail.com> | 2012-08-03 22:08:22 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-08-03 22:08:22 +0200 |
commit | 362976328ecb796d670b32af924f76e25922cb78 (patch) | |
tree | cddf0795aceba0af099debee28ee160f7d4308c1 /lspackagemodel.cpp | |
parent | 7a183cfa367db01413c001306741d06e1826d077 (diff) | |
download | LayoutStudio-362976328ecb796d670b32af924f76e25922cb78.tar.gz LayoutStudio-362976328ecb796d670b32af924f76e25922cb78.zip |
added Rename and Remove Item functions
Diffstat (limited to '')
-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; +} |