From c810963a948447277ae858d4644d915666a94970 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 23 Oct 2007 20:14:29 +0000 Subject: [PATCH] minor housecleaning bits: double click in applet dialog works now; put back lines for what the center background painting *shoudl* be were it not for QSvgRenderer being buggy svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=728613 --- applet.cpp | 3 +++ appletbrowser.cpp | 15 +++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/applet.cpp b/applet.cpp index 4d9a79aff..b0984090f 100644 --- a/applet.cpp +++ b/applet.cpp @@ -268,6 +268,9 @@ public: p.drawTiledPixmap(QRect(contentLeft, bottomOffset, contentWidth, bottomHeight), bottom); } + // re-enable this once Qt's svg rendering is un-buggered + //background->resize(contentWidth, contentHeight); + //background->paint(&p, QRect(contentLeft, contentTop, contentWidth, contentHeight), "center"); } p2->drawPixmap(leftOffset, topOffset, *cachedBackground); diff --git a/appletbrowser.cpp b/appletbrowser.cpp index c35d6cc4a..c46370ed9 100644 --- a/appletbrowser.cpp +++ b/appletbrowser.cpp @@ -50,14 +50,12 @@ public: Plasma::Corona *corona; Plasma::Containment *containment; KCategorizedItemsView *appletList; - + KConfig config; KConfigGroup configGroup; PlasmaAppletItemModel itemModel; KCategorizedItemsViewModels::DefaultFilterModel filterModel; - - }; AppletBrowser::AppletBrowser(Plasma::Corona * corona, QWidget * parent, Qt::WindowFlags f) @@ -77,6 +75,7 @@ AppletBrowser::AppletBrowser(Plasma::Containment * containment, QWidget * parent void AppletBrowser::init() { d->appletList = new KCategorizedItemsView(this); + connect(d->appletList, SIGNAL(activated(const QModelIndex &)), this, SLOT(addApplet())); setMainWidget(d->appletList); setWindowTitle("Add Applets"); @@ -94,25 +93,25 @@ void AppletBrowser::init() d->filterModel.addFilter(i18n("All Applets"), KCategorizedItemsViewModels::Filter(), new KIcon("application-x-plasma")); - + // Recommended emblems and filters QRegExp rx("recommended[.]([0-9A-Za-z]+)[.]caption"); QMapIterator i(d->configGroup.entryMap()); while (i.hasNext()) { i.next(); if (!rx.exactMatch(i.key())) continue; - kDebug() << "These are the key/vals in rc file " << rx.cap(1) << "\n"; - + //kDebug() << "These are the key/vals in rc file " << rx.cap(1) << "\n"; + QString id = rx.cap(1); QString caption = d->configGroup.readEntry("recommended." + id + ".caption"); QString icon = d->configGroup.readEntry("recommended." + id + ".icon"); QString plugins = d->configGroup.readEntry("recommended." + id + ".plugins"); - + d->appletList->addEmblem(i18n("Recommended by %1", caption), new KIcon(icon), KCategorizedItemsViewModels::Filter("recommended." + id, true)); d->filterModel.addFilter(i18n("Recommended by %1", caption), KCategorizedItemsViewModels::Filter("recommended." + id, true), new KIcon(icon)); - + //foreach (QString plugin, plugins.split(",")) {} }