diff options
Diffstat (limited to 'sigmodr/tree/StoreGroupModel.cpp')
-rw-r--r-- | sigmodr/tree/StoreGroupModel.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sigmodr/tree/StoreGroupModel.cpp b/sigmodr/tree/StoreGroupModel.cpp index 2b0f633c..eda076b9 100644 --- a/sigmodr/tree/StoreGroupModel.cpp +++ b/sigmodr/tree/StoreGroupModel.cpp @@ -28,14 +28,16 @@ // KDE includes #include <KMenu> -Sigmodr::Tree::StoreGroupModel::StoreGroupModel(BaseModel* parent, Sigmod::Game* game) : +using namespace Sigmodr::Tree; + +StoreGroupModel::StoreGroupModel(BaseModel* parent, Sigmod::Game* game) : GroupModel(parent, game, "Stores") { for (int i = 0; i < game->storeCount(); ++i) addObject(game->store(i)); } -QVariant Sigmodr::Tree::StoreGroupModel::data(const int role) const +QVariant StoreGroupModel::data(const int role) const { if (role == BaseModel::ContextMenuRole) { @@ -46,7 +48,7 @@ QVariant Sigmodr::Tree::StoreGroupModel::data(const int role) const return GroupModel::data(role); } -bool Sigmodr::Tree::StoreGroupModel::setData(const QVariant& value, int role) +bool StoreGroupModel::setData(const QVariant& value, int role) { if (role == BaseModel::XmlRole) { @@ -64,12 +66,12 @@ bool Sigmodr::Tree::StoreGroupModel::setData(const QVariant& value, int role) return false; } -QString Sigmodr::Tree::StoreGroupModel::types() const +QString StoreGroupModel::types() const { return "Store"; } -void Sigmodr::Tree::StoreGroupModel::addObject(Sigmod::Object* object) +void StoreGroupModel::addObject(Sigmod::Object* object) { if (!object) object = qobject_cast<Sigmod::Game*>(m_object)->newStore(); @@ -77,7 +79,7 @@ void Sigmodr::Tree::StoreGroupModel::addObject(Sigmod::Object* object) addChild(new StoreModel(this, qobject_cast<Sigmod::Store*>(object))); } -void Sigmodr::Tree::StoreGroupModel::deleteObject(BaseModel* model) +void StoreGroupModel::deleteObject(BaseModel* model) { const int index = find(model); if (0 <= index) |