Port model to Qt5/Frameworks5

This commit is contained in:
Sebastian Kügler 2013-03-21 01:49:35 +01:00
parent d099b7e2c6
commit 7bea46d23c
3 changed files with 14 additions and 2 deletions

View File

@ -46,6 +46,11 @@ set(scripting_SRC
scripting/widget.cpp scripting/widget.cpp
) )
set(widgetexplorer_SRC
widgetexplorer/kcategorizeditemsviewmodels.cpp
widgetexplorer/plasmaappletitemmodel.cpp
)
add_executable(testplasma2 add_executable(testplasma2
main.cpp main.cpp
desktopcorona.cpp desktopcorona.cpp
@ -55,6 +60,7 @@ add_executable(testplasma2
view.cpp view.cpp
panelconfigview.cpp panelconfigview.cpp
${scripting_SRC} ${scripting_SRC}
${widgetexplorer_SRC}
) )
# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore # The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore

View File

@ -18,6 +18,7 @@
*/ */
#include "kcategorizeditemsviewmodels_p.h" #include "kcategorizeditemsviewmodels_p.h"
#include <KLocalizedString>
#include <klocale.h> #include <klocale.h>
#define COLUMN_COUNT 4 #define COLUMN_COUNT 4

View File

@ -19,7 +19,9 @@
#include "plasmaappletitemmodel_p.h" #include "plasmaappletitemmodel_p.h"
#include <KLocalizedString>
#include <KStandardDirs> #include <KStandardDirs>
#include <KServiceTypeTrader>
#include <KSycoca> #include <KSycoca>
PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model, PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model,
@ -50,7 +52,7 @@ PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model,
setData(info.pluginName(), PlasmaAppletItemModel::PluginNameRole); setData(info.pluginName(), PlasmaAppletItemModel::PluginNameRole);
setData(info.comment(), PlasmaAppletItemModel::DescriptionRole); setData(info.comment(), PlasmaAppletItemModel::DescriptionRole);
setData(info.category().toLower(), PlasmaAppletItemModel::CategoryRole); setData(info.category().toLower(), PlasmaAppletItemModel::CategoryRole);
setData(info.fullLicense().name(KAboutData::FullName), PlasmaAppletItemModel::LicenseRole); //setData(info.fullLicense().name(KAboutData::FullName), PlasmaAppletItemModel::LicenseRole); // FIXME
setData(info.website(), PlasmaAppletItemModel::WebsiteRole); setData(info.website(), PlasmaAppletItemModel::WebsiteRole);
setData(info.version(), PlasmaAppletItemModel::VersionRole); setData(info.version(), PlasmaAppletItemModel::VersionRole);
setData(info.author(), PlasmaAppletItemModel::AuthorRole); setData(info.author(), PlasmaAppletItemModel::AuthorRole);
@ -221,7 +223,10 @@ void PlasmaAppletItemModel::populateModel(const QStringList &whatChanged)
//kDebug() << "number of applets is" //kDebug() << "number of applets is"
// << Plasma::Applet::listAppletInfo(QString(), m_application).count(); // << Plasma::Applet::listAppletInfo(QString(), m_application).count();
foreach (const KPluginInfo &info, Plasma::Applet::listAppletInfo(QString(), m_application)) { KService::List services = KServiceTypeTrader::self()->query("Plasma/Applet", QString());
foreach (const KSharedPtr<KService> service, services) {
KPluginInfo info(service);
//kDebug() << info.pluginName() << "NoDisplay" << info.property("NoDisplay").toBool(); //kDebug() << info.pluginName() << "NoDisplay" << info.property("NoDisplay").toBool();
if (info.property("NoDisplay").toBool() || info.category() == i18n("Containments")) { if (info.property("NoDisplay").toBool() || info.category() == i18n("Containments")) {
// we don't want to show the hidden category // we don't want to show the hidden category