From 3caade32e973e78b9470f6a57e25c53f96c4e083 Mon Sep 17 00:00:00 2001 From: Nick Dedekind Date: Mon, 12 Aug 2013 21:51:20 +0100 Subject: Removed UnityMenuAction. Fixed leaks from unitymenumodel. --- libqmenumodel/src/unitymenuaction.cpp | 60 ----------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 libqmenumodel/src/unitymenuaction.cpp (limited to 'libqmenumodel/src/unitymenuaction.cpp') diff --git a/libqmenumodel/src/unitymenuaction.cpp b/libqmenumodel/src/unitymenuaction.cpp deleted file mode 100644 index f391bfe..0000000 --- a/libqmenumodel/src/unitymenuaction.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2013 Canonical Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * Authors: - * Nick Dedekind - */ - -#include "unitymenuaction.h" -#include "unitymenumodel.h" - -UnityMenuAction::UnityMenuAction(QObject* parent) - : QObject(parent), - m_model(NULL), - m_index(-1) -{ -} - -int UnityMenuAction::index() const -{ - return m_index; -} - -void UnityMenuAction::setIndex(int index) -{ - if (m_index != index) { - m_index = index; - Q_EMIT indexChanged(index); - } -} - -UnityMenuModel* UnityMenuAction::model() const -{ - return m_model; -} - -void UnityMenuAction::setModel(UnityMenuModel* model) -{ - if (m_model != model) { - if (m_model) { - disconnect(m_model); - } - m_model = model; - - connect(model, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&, const QVector&)), SIGNAL(stateChanged())); - - Q_EMIT modelChanged(model); - } -} -- cgit v1.2.3