From 362976328ecb796d670b32af924f76e25922cb78 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 3 Aug 2012 22:08:22 +0200 Subject: added Rename and Remove Item functions --- lspackagemodel.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lspackagemodel.cpp') 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; +} -- cgit v1.2.3