Port model to Qt5/Frameworks5

wilder-5.14
Sebastian Kügler 13 years ago
parent 5ca77d36bb
commit 4b712cc3f9
  1. 6
      CMakeLists.txt
  2. 1
      widgetexplorer/kcategorizeditemsviewmodels.cpp
  3. 9
      widgetexplorer/plasmaappletitemmodel.cpp

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

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

@ -19,7 +19,9 @@
#include "plasmaappletitemmodel_p.h"
#include <KLocalizedString>
#include <KStandardDirs>
#include <KServiceTypeTrader>
#include <KSycoca>
PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model,
@ -50,7 +52,7 @@ PlasmaAppletItem::PlasmaAppletItem(PlasmaAppletItemModel *model,
setData(info.pluginName(), PlasmaAppletItemModel::PluginNameRole);
setData(info.comment(), PlasmaAppletItemModel::DescriptionRole);
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.version(), PlasmaAppletItemModel::VersionRole);
setData(info.author(), PlasmaAppletItemModel::AuthorRole);
@ -221,7 +223,10 @@ void PlasmaAppletItemModel::populateModel(const QStringList &whatChanged)
//kDebug() << "number of applets is"
// << 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();
if (info.property("NoDisplay").toBool() || info.category() == i18n("Containments")) {
// we don't want to show the hidden category

Loading…
Cancel
Save