summaryrefslogtreecommitdiff
path: root/lspackagemodel.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-08-03 22:08:22 +0200
committerTreeki <treeki@gmail.com>2012-08-03 22:08:22 +0200
commit362976328ecb796d670b32af924f76e25922cb78 (patch)
treecddf0795aceba0af099debee28ee160f7d4308c1 /lspackagemodel.cpp
parent7a183cfa367db01413c001306741d06e1826d077 (diff)
downloadLayoutStudio-362976328ecb796d670b32af924f76e25922cb78.tar.gz
LayoutStudio-362976328ecb796d670b32af924f76e25922cb78.zip
added Rename and Remove Item functions
Diffstat (limited to 'lspackagemodel.cpp')
-rw-r--r--lspackagemodel.cpp13
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;
+}