[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [systemsettings/sebas/quick] /: Revert changes to Menu* and model classes
From: Sebastian_Kügler <sebas () kde ! org>
Date: 2014-07-31 16:51:29
Message-ID: E1XCtZh-00088D-2a () scm ! kde ! org
[Download RAW message or body]
Git commit b39c01f4627af798156ca0b9e89ab72929e621e1 by Sebastian Kügler.
Committed on 21/07/2014 at 23:55.
Pushed by sebas into branch 'sebas/quick'.
Revert changes to Menu* and model classes
Revert changes to Menu* classes, they're not needed with the recursive
Category binding.
M +2 -3 core/MenuItem.cpp
M +2 -4 core/MenuItem.h
M +0 -15 core/MenuModel.cpp
M +0 -2 core/MenuModel.h
M +1 -9 core/MenuProxyModel.cpp
M +0 -1 core/MenuProxyModel.h
M +1 -2 quick/QuickMode.cpp
http://commits.kde.org/systemsettings/b39c01f4627af798156ca0b9e89ab72929e621e1
diff --git a/core/MenuItem.cpp b/core/MenuItem.cpp
index 6a9cfb7..10fe321 100644
--- a/core/MenuItem.cpp
+++ b/core/MenuItem.cpp
@@ -45,9 +45,8 @@ public:
KCModuleInfo item;
};
-MenuItem::MenuItem( bool isMenu, MenuItem * itsParent ) :
- QObject(itsParent),
- d( new Private() )
+MenuItem::MenuItem( bool isMenu, MenuItem * itsParent )
+ : d( new Private() )
{
d->parent = itsParent;
d->menu = isMenu;
diff --git a/core/MenuItem.h b/core/MenuItem.h
index 8d7860d..01e7038 100644
--- a/core/MenuItem.h
+++ b/core/MenuItem.h
@@ -47,10 +47,8 @@ template<typename T> class QList;
* @author Ben Cooksley <bcooksley@kde.org>
* @author Will Stephenson <wstephenson@kde.org>
*/
-class SYSTEMSETTINGSVIEW_EXPORT MenuItem : public QObject
+class SYSTEMSETTINGSVIEW_EXPORT MenuItem
{
- Q_OBJECT
-
public:
/**
* Creates a MenuItem.
@@ -59,7 +57,7 @@ public:
* @param isMenu Specifies if it is a category or not.
* @param parent The item it is parented to. Provide 0 for a top level item.
*/
- MenuItem( bool isMenu, MenuItem * itsParent = 0 );
+ MenuItem( bool isMenu, MenuItem * parent );
/**
* Destroys a MenuItem, including all children, the service object and the \
module information.
diff --git a/core/MenuModel.cpp b/core/MenuModel.cpp
index 5198f6e..0bf8f12 100644
--- a/core/MenuModel.cpp
+++ b/core/MenuModel.cpp
@@ -201,19 +201,4 @@ void MenuModel::removeException( MenuItem * exception )
d->exceptions.removeAll(exception);
}
-QHash< int, QByteArray > MenuModel::roleNames() const
-{
- QHash<int, QByteArray> rn;
- rn[Qt::DisplayRole] = "displayRole";
- rn[Qt::ToolTipRole] = "toolTipRole";
- rn[Qt::DecorationRole] = "decorationRole";
- rn[KCategorizedSortFilterProxyModel::CategorySortRole] = "categorySortRole";
- rn[KCategorizedSortFilterProxyModel::CategoryDisplayRole] = \
"categoryDisplayRole";
- rn[Qt::UserRole] = "userRole";
- rn[MenuModel::UserFilterRole] = "userFilterRole";
- rn[MenuModel::UserSortRole] = "userSortRole";
- return rn;
-}
-
-
#include "MenuModel.moc"
diff --git a/core/MenuModel.h b/core/MenuModel.h
index 55bed4a..c9d2c9e 100644
--- a/core/MenuModel.h
+++ b/core/MenuModel.h
@@ -140,8 +140,6 @@ public:
*/
static const int UserSortRole;
- virtual QHash<int, QByteArray> roleNames() const;
-
protected:
/**
* Provides the MenuItem which is used internally to provide information.
diff --git a/core/MenuProxyModel.cpp b/core/MenuProxyModel.cpp
index 936ce86..527091d 100644
--- a/core/MenuProxyModel.cpp
+++ b/core/MenuProxyModel.cpp
@@ -23,8 +23,6 @@
#include "MenuItem.h"
#include "MenuModel.h"
-#include <QDebug>
-
MenuProxyModel::MenuProxyModel( QObject * parent )
: KCategorizedSortFilterProxyModel( parent )
{
@@ -38,7 +36,7 @@ bool MenuProxyModel::lessThan( const QModelIndex &left, const \
QModelIndex &right if( isCategorizedModel() ) {
return KCategorizedSortFilterProxyModel::lessThan( left, right );
}
-
+
QVariant leftWeight = left.data( MenuModel::UserSortRole );
QVariant rightWeight = right.data( MenuModel::UserSortRole );
@@ -109,11 +107,5 @@ void MenuProxyModel::setFilterRegExp ( const QRegExp & regExp )
emit layoutChanged ();
}
-void MenuProxyModel::clicked(int ix)
-{
- qDebug() << "Clocked" << ix;
-}
-
-
#include "MenuProxyModel.moc"
diff --git a/core/MenuProxyModel.h b/core/MenuProxyModel.h
index dfb9d21..96777f9 100644
--- a/core/MenuProxyModel.h
+++ b/core/MenuProxyModel.h
@@ -99,7 +99,6 @@ public:
*/
void setFilterRegExp ( const QString & pattern );
- Q_INVOKABLE void clicked(int ix);
};
#endif
diff --git a/quick/QuickMode.cpp b/quick/QuickMode.cpp
index 77bbc8b..86dff34 100644
--- a/quick/QuickMode.cpp
+++ b/quick/QuickMode.cpp
@@ -146,8 +146,7 @@ void QuickMode::initEvent()
Host::self()->setModel(d->proxyModel);
Host::self()->setQuickMode(this);
- // Register MenuItem* in the QML runtime
- qmlRegisterUncreatableType<MenuItem>("org.kde.systemsettings", 5, 0, "MenuItem", \
"You cannot create MenuItem objects."); + // Register Category* in the QML runtime
qmlRegisterUncreatableType<Category>("org.kde.systemsettings", 5, 0, "Category", \
"You cannot create Category objects."); \
qmlRegisterType<KUserProxy>("org.kde.systemsettings", 5, 0, "KUser"); }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic