[libplasma] Add categorized debug output

This commit is contained in:
Martin Klapetek 2015-12-15 16:56:40 -05:00
parent 2df5c4d1eb
commit 76186339f6
25 changed files with 188 additions and 166 deletions

View File

@ -20,6 +20,7 @@ include(ECMPackageConfigHelpers)
include(ECMSetupVersion) include(ECMSetupVersion)
include(KDEFrameworkCompilerSettings) include(KDEFrameworkCompilerSettings)
include(KDETemplateMacro) include(KDETemplateMacro)
include(ECMQtDeclareLoggingCategory)
set(KF5_VERSION "5.18.0") # handled by release scripts set(KF5_VERSION "5.18.0") # handled by release scripts
set(KF5_DEP_VERSION "5.17.0") # handled by release scripts set(KF5_DEP_VERSION "5.17.0") # handled by release scripts

View File

@ -46,7 +46,7 @@ PLASMA_UNIT_TESTS(
# plasmoidpackagetest # plasmoidpackagetest
) )
add_executable(storagetest storagetest.cpp ../src/plasma/private/storage.cpp ../src/plasma/private/storagethread.cpp) add_executable(storagetest storagetest.cpp ../src/plasma/private/storage.cpp ../src/plasma/private/storagethread.cpp ../src/plasma/debug_p.cpp)
target_link_libraries(storagetest Qt5::Gui Qt5::Test Qt5::Sql KF5::KIOCore KF5::Plasma KF5::CoreAddons) target_link_libraries(storagetest Qt5::Gui Qt5::Test Qt5::Sql KF5::KIOCore KF5::Plasma KF5::CoreAddons)
if(HAVE_X11) if(HAVE_X11)

View File

@ -94,6 +94,7 @@ kconfig_add_kcfg_files(Plasma_LIB_SRCS data/kconfigxt/libplasma-theme-global.kcf
# TEST_INCLUDES # TEST_INCLUDES
#) #)
ecm_qt_declare_logging_category(Plasma_LIB_SRCS HEADER debug_p.h IDENTIFIER LOG_PLASMA CATEGORY_NAME org.kde.plasma)
add_library(KF5Plasma ${Plasma_LIB_SRCS}) add_library(KF5Plasma ${Plasma_LIB_SRCS})
add_library(KF5::Plasma ALIAS KF5Plasma) add_library(KF5::Plasma ALIAS KF5Plasma)

View File

@ -55,6 +55,7 @@
#include "private/associatedapplicationmanager_p.h" #include "private/associatedapplicationmanager_p.h"
#include "private/containment_p.h" #include "private/containment_p.h"
#include "private/package_p.h" #include "private/package_p.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -63,7 +64,7 @@ Applet::Applet(const KPluginInfo &info, QObject *parent, uint appletId)
: QObject(parent), : QObject(parent),
d(new AppletPrivate(KService::Ptr(), &info, appletId, this)) d(new AppletPrivate(KService::Ptr(), &info, appletId, this))
{ {
qDebug() << " From KPluginInfo, valid? " << info.isValid(); qCDebug(LOG_PLASMA) << " From KPluginInfo, valid? " << info.isValid();
// WARNING: do not access config() OR globalConfig() in this method! // WARNING: do not access config() OR globalConfig() in this method!
// that requires a scene, which is not available at this point // that requires a scene, which is not available at this point
d->init(); d->init();
@ -141,7 +142,7 @@ void Applet::save(KConfigGroup &g) const
group = *d->mainConfigGroup(); group = *d->mainConfigGroup();
} }
//qDebug() << "saving" << pluginName() << "to" << group.name(); //qCDebug(LOG_PLASMA) << "saving" << pluginName() << "to" << group.name();
// we call the dptr member directly for locked since isImmutable() // we call the dptr member directly for locked since isImmutable()
// also checks kiosk and parent containers // also checks kiosk and parent containers
group.writeEntry("immutability", (int)d->immutability); group.writeEntry("immutability", (int)d->immutability);
@ -174,10 +175,10 @@ void Applet::restore(KConfigGroup &group)
setGlobalShortcut(QKeySequence(shortcutText)); setGlobalShortcut(QKeySequence(shortcutText));
/* /*
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "got global shortcut for" << name() << "of" << QKeySequence(shortcutText); // qCDebug(LOG_PLASMA) << "got global shortcut for" << name() << "of" << QKeySequence(shortcutText);
#endif #endif
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "set to" << d->activationAction->objectName() // qCDebug(LOG_PLASMA) << "set to" << d->activationAction->objectName()
#endif #endif
<< d->activationAction->globalShortcut().primary(); << d->activationAction->globalShortcut().primary();
*/ */
@ -314,7 +315,7 @@ void Applet::constraintsEvent(Plasma::Types::Constraints constraints)
// without calling the Applet:: version as well, which it shouldn't need to. // without calling the Applet:: version as well, which it shouldn't need to.
// INSTEAD put such code into flushPendingConstraintsEvents // INSTEAD put such code into flushPendingConstraintsEvents
Q_UNUSED(constraints) Q_UNUSED(constraints)
//qDebug() << constraints << "constraints are FormFactor: " << formFactor() //qCDebug(LOG_PLASMA) << constraints << "constraints are FormFactor: " << formFactor()
// << ", Location: " << location(); // << ", Location: " << location();
if (d->script) { if (d->script) {
d->script->constraintsEvent(constraints); d->script->constraintsEvent(constraints);
@ -466,7 +467,7 @@ void Applet::flushPendingConstraintsEvents()
d->constraintsTimer.stop(); d->constraintsTimer.stop();
} }
//qDebug() << "fushing constraints: " << d->pendingConstraints << "!!!!!!!!!!!!!!!!!!!!!!!!!!!"; //qCDebug(LOG_PLASMA) << "fushing constraints: " << d->pendingConstraints << "!!!!!!!!!!!!!!!!!!!!!!!!!!!";
Plasma::Types::Constraints c = d->pendingConstraints; Plasma::Types::Constraints c = d->pendingConstraints;
d->pendingConstraints = Types::NoConstraint; d->pendingConstraints = Types::NoConstraint;
@ -562,7 +563,7 @@ void Applet::flushPendingConstraintsEvents()
QList<QAction *> Applet::contextualActions() QList<QAction *> Applet::contextualActions()
{ {
//qDebug() << "empty context actions"; //qCDebug(LOG_PLASMA) << "empty context actions";
return d->script ? d->script->contextualActions() : QList<QAction *>(); return d->script ? d->script->contextualActions() : QList<QAction *>();
} }

View File

@ -49,6 +49,7 @@
#include "containmentactions.h" #include "containmentactions.h"
#include "corona.h" #include "corona.h"
#include "pluginloader.h" #include "pluginloader.h"
#include "debug_p.h"
#include "private/applet_p.h" #include "private/applet_p.h"
@ -166,11 +167,11 @@ void Containment::restore(KConfigGroup &group)
{ {
/* /*
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "!!!!!!!!!!!!initConstraints" << group.name() << d->type; // qCDebug(LOG_PLASMA) << "!!!!!!!!!!!!initConstraints" << group.name() << d->type;
// qDebug() << " location:" << group.readEntry("location", (int)d->location); // qCDebug(LOG_PLASMA) << " location:" << group.readEntry("location", (int)d->location);
// qDebug() << " geom:" << group.readEntry("geometry", geometry()); // qCDebug(LOG_PLASMA) << " geom:" << group.readEntry("geometry", geometry());
// qDebug() << " formfactor:" << group.readEntry("formfactor", (int)d->formFactor); // qCDebug(LOG_PLASMA) << " formfactor:" << group.readEntry("formfactor", (int)d->formFactor);
// qDebug() << " screen:" << group.readEntry("screen", d->screen); // qCDebug(LOG_PLASMA) << " screen:" << group.readEntry("screen", d->screen);
#endif #endif
*/ */
setLocation((Plasma::Types::Location)group.readEntry("location", (int)d->location)); setLocation((Plasma::Types::Location)group.readEntry("location", (int)d->location));
@ -189,10 +190,10 @@ void Containment::restore(KConfigGroup &group)
KConfigGroup cfg = KConfigGroup(corona()->config(), "ActionPlugins"); KConfigGroup cfg = KConfigGroup(corona()->config(), "ActionPlugins");
cfg = KConfigGroup(&cfg, QString::number(containmentType())); cfg = KConfigGroup(&cfg, QString::number(containmentType()));
//qDebug() << cfg.keyList(); //qCDebug(LOG_PLASMA) << cfg.keyList();
if (cfg.exists()) { if (cfg.exists()) {
foreach (const QString &key, cfg.keyList()) { foreach (const QString &key, cfg.keyList()) {
//qDebug() << "loading" << key; //qCDebug(LOG_PLASMA) << "loading" << key;
setContainmentActions(key, cfg.readEntry(key, QString())); setContainmentActions(key, cfg.readEntry(key, QString()));
} }
} else { //shell defaults } else { //shell defaults
@ -213,7 +214,7 @@ void Containment::restore(KConfigGroup &group)
/* /*
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Containment" << id() << // qCDebug(LOG_PLASMA) << "Containment" << id() <<
#endif #endif
"screen" << screen() << "screen" << screen() <<
"geometry is" << geometry() << "geometry is" << geometry() <<
@ -267,7 +268,7 @@ void Containment::restoreContents(KConfigGroup &group)
// are added from left to right or top to bottom for a panel containment // are added from left to right or top to bottom for a panel containment
QList<KConfigGroup> appletConfigs; QList<KConfigGroup> appletConfigs;
foreach (const QString &appletGroup, groups) { foreach (const QString &appletGroup, groups) {
//qDebug() << "reading from applet group" << appletGroup; //qCDebug(LOG_PLASMA) << "reading from applet group" << appletGroup;
KConfigGroup appletConfig(&applets, appletGroup); KConfigGroup appletConfig(&applets, appletGroup);
appletConfigs.append(appletConfig); appletConfigs.append(appletConfig);
} }
@ -329,7 +330,7 @@ void Containment::setFormFactor(Types::FormFactor formFactor)
return; return;
} }
//qDebug() << "switching FF to " << formFactor; //qCDebug(LOG_PLASMA) << "switching FF to " << formFactor;
d->formFactor = formFactor; d->formFactor = formFactor;
updateConstraints(Plasma::Types::FormFactorConstraint); updateConstraints(Plasma::Types::FormFactorConstraint);
@ -375,14 +376,14 @@ void Containment::addApplet(Applet *applet)
if (!applet) { if (!applet) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "adding null applet!?!"; // qCDebug(LOG_PLASMA) << "adding null applet!?!";
#endif #endif
return; return;
} }
if (d->applets.contains(applet)) { if (d->applets.contains(applet)) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "already have this applet!"; // qCDebug(LOG_PLASMA) << "already have this applet!";
#endif #endif
} }

View File

@ -43,6 +43,7 @@
#include "private/containment_p.h" #include "private/containment_p.h"
#include "private/package_p.h" #include "private/package_p.h"
#include "private/timetracker.h" #include "private/timetracker.h"
#include "debug_p.h"
using namespace Plasma; using namespace Plasma;
@ -54,7 +55,7 @@ Corona::Corona(QObject *parent)
d(new CoronaPrivate(this)) d(new CoronaPrivate(this))
{ {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Corona ctor start"; // qCDebug(LOG_PLASMA) << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Corona ctor start";
#endif #endif
d->init(); d->init();
@ -291,7 +292,7 @@ void Corona::setImmutability(const Types::ImmutabilityType immutable)
} }
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "setting immutability to" << immutable; // qCDebug(LOG_PLASMA) << "setting immutability to" << immutable;
#endif #endif
d->immutability = immutable; d->immutability = immutable;
d->updateContainmentImmutability(); d->updateContainmentImmutability();
@ -445,7 +446,7 @@ Containment *CoronaPrivate::addContainment(const QString &name, const QVariantLi
Containment *containment = 0; Containment *containment = 0;
Applet *applet = 0; Applet *applet = 0;
// qDebug() << "Loading" << name << args << id; // qCDebug(LOG_PLASMA) << "Loading" << name << args << id;
if (pluginName.isEmpty() || pluginName == "default") { if (pluginName.isEmpty() || pluginName == "default") {
// default to the desktop containment // default to the desktop containment
@ -464,7 +465,7 @@ Containment *CoronaPrivate::addContainment(const QString &name, const QVariantLi
if (!containment) { if (!containment) {
if (!loadingNull) { if (!loadingNull) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "loading of containment" << name << "failed."; // qCDebug(LOG_PLASMA) << "loading of containment" << name << "failed.";
#endif #endif
} }
@ -562,9 +563,9 @@ QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigGroup &con
containmentConfig.copyTo(&realConf); containmentConfig.copyTo(&realConf);
} }
//qDebug() << "got a containment in the config, trying to make a" << containmentConfig.readEntry("plugin", QString()) << "from" << group; //qCDebug(LOG_PLASMA) << "got a containment in the config, trying to make a" << containmentConfig.readEntry("plugin", QString()) << "from" << group;
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Adding Containment" << containmentConfig.readEntry("plugin", QString()); // qCDebug(LOG_PLASMA) << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Adding Containment" << containmentConfig.readEntry("plugin", QString());
#endif #endif
Containment *c = addContainment(containmentConfig.readEntry("plugin", QString()), QVariantList(), cid); Containment *c = addContainment(containmentConfig.readEntry("plugin", QString()), QVariantList(), cid);
if (!c) { if (!c) {
@ -575,7 +576,7 @@ QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigGroup &con
containmentsIds.insert(c->id()); containmentsIds.insert(c->id());
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Restored Containment" << c->pluginName(); // qCDebug(LOG_PLASMA) << "!!{} STARTUP TIME" << QTime().msecsTo(QTime::currentTime()) << "Restored Containment" << c->pluginName();
#endif #endif
} }

View File

@ -24,6 +24,8 @@
#include <QAbstractItemModel> #include <QAbstractItemModel>
#include "plasma.h" #include "plasma.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -106,7 +108,7 @@ bool DataContainer::visualizationIsConnected(QObject *visualization) const
void DataContainer::connectVisualization(QObject *visualization, uint pollingInterval, void DataContainer::connectVisualization(QObject *visualization, uint pollingInterval,
Plasma::Types::IntervalAlignment alignment) Plasma::Types::IntervalAlignment alignment)
{ {
//qDebug() << "connecting visualization" <<this<< visualization << "at interval of" //qCDebug(LOG_PLASMA) << "connecting visualization" <<this<< visualization << "at interval of"
// << pollingInterval << "to" << objectName(); // << pollingInterval << "to" << objectName();
QMap<QObject *, SignalRelay *>::iterator objIt = d->relayObjects.find(visualization); QMap<QObject *, SignalRelay *>::iterator objIt = d->relayObjects.find(visualization);
bool connected = objIt != d->relayObjects.end(); bool connected = objIt != d->relayObjects.end();
@ -116,15 +118,15 @@ void DataContainer::connectVisualization(QObject *visualization, uint pollingInt
SignalRelay *relay = objIt.value(); SignalRelay *relay = objIt.value();
if (relay) { if (relay) {
// connected to a relay // connected to a relay
//qDebug() << " already connected, but to a relay"; //qCDebug(LOG_PLASMA) << " already connected, but to a relay";
if (relay->m_interval == pollingInterval && relay->m_align == alignment) { if (relay->m_interval == pollingInterval && relay->m_align == alignment) {
//qDebug() << " already connected to a relay of the same interval of" //qCDebug(LOG_PLASMA) << " already connected to a relay of the same interval of"
// << pollingInterval << ", nothing to do"; // << pollingInterval << ", nothing to do";
return; return;
} }
if (relay->receiverCount() == 1) { if (relay->receiverCount() == 1) {
//qDebug() << " removing relay, as it is now unused"; //qCDebug(LOG_PLASMA) << " removing relay, as it is now unused";
d->relays.remove(relay->m_interval); d->relays.remove(relay->m_interval);
delete relay; delete relay;
} else { } else {
@ -141,7 +143,7 @@ void DataContainer::connectVisualization(QObject *visualization, uint pollingInt
// the visualization was connected already, but not to a relay // the visualization was connected already, but not to a relay
// and it still doesn't want to connect to a relay, so we have // and it still doesn't want to connect to a relay, so we have
// nothing to do! // nothing to do!
//qDebug() << " already connected, nothing to do"; //qCDebug(LOG_PLASMA) << " already connected, nothing to do";
return; return;
} else { } else {
disconnect(this, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)), disconnect(this, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)),
@ -157,7 +159,7 @@ void DataContainer::connectVisualization(QObject *visualization, uint pollingInt
} }
if (pollingInterval < 1) { if (pollingInterval < 1) {
//qDebug() << " connecting directly"; //qCDebug(LOG_PLASMA) << " connecting directly";
d->relayObjects[visualization] = 0; d->relayObjects[visualization] = 0;
if (visualization->metaObject()->indexOfSlot("dataUpdated(QString,Plasma::DataEngine::Data)") >= 0) { if (visualization->metaObject()->indexOfSlot("dataUpdated(QString,Plasma::DataEngine::Data)") >= 0) {
connect(this, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)), connect(this, SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data)),
@ -168,7 +170,7 @@ void DataContainer::connectVisualization(QObject *visualization, uint pollingInt
visualization, SLOT(modelChanged(QString,QAbstractItemModel*))); visualization, SLOT(modelChanged(QString,QAbstractItemModel*)));
} }
} else { } else {
//qDebug() << " connecting to a relay"; //qCDebug(LOG_PLASMA) << " connecting to a relay";
// we only want to do an imediate update if this is not the first object to connect to us // we only want to do an imediate update if this is not the first object to connect to us
// if it is the first visualization, then the source will already have been populated // if it is the first visualization, then the source will already have been populated
// engine's sourceRequested method // engine's sourceRequested method
@ -338,7 +340,7 @@ void DataContainer::disconnectVisualization(QObject *visualization)
void DataContainer::checkForUpdate() void DataContainer::checkForUpdate()
{ {
//qDebug() << objectName() << d->dirty; //qCDebug(LOG_PLASMA) << objectName() << d->dirty;
if (d->dirty) { if (d->dirty) {
emit dataUpdated(objectName(), d->data); emit dataUpdated(objectName(), d->data);
@ -390,7 +392,7 @@ void DataContainer::timerEvent(QTimerEvent *event)
if (event->timerId() == d->checkUsageTimer.timerId()) { if (event->timerId() == d->checkUsageTimer.timerId()) {
if (!isUsed()) { if (!isUsed()) {
// DO NOT CALL ANYTHING AFTER THIS LINE AS IT MAY GET DELETED! // DO NOT CALL ANYTHING AFTER THIS LINE AS IT MAY GET DELETED!
//qDebug() << objectName() << "is unused"; //qCDebug(LOG_PLASMA) << objectName() << "is unused";
//NOTE: Notifying visualization of the model destruction before actual deletion avoids crashes in some edge cases //NOTE: Notifying visualization of the model destruction before actual deletion avoids crashes in some edge cases
if (d->model) { if (d->model) {

View File

@ -74,7 +74,7 @@ DataEngine::DataEngine(QObject *parent, const QVariantList &args)
DataEngine::~DataEngine() DataEngine::~DataEngine()
{ {
//qDebug() << objectName() << ": bye bye birdy! "; //qCDebug(LOG_PLASMA) << objectName() << ": bye bye birdy! ";
delete d; delete d;
} }
@ -108,7 +108,7 @@ void DataEngine::connectSource(const QString &source, QObject *visualization,
uint pollingInterval, uint pollingInterval,
Plasma::Types::IntervalAlignment intervalAlignment) const Plasma::Types::IntervalAlignment intervalAlignment) const
{ {
//qDebug() << "connectSource" << source; //qCDebug(LOG_PLASMA) << "connectSource" << source;
bool newSource; bool newSource;
DataContainer *s = d->requestSource(source, &newSource); DataContainer *s = d->requestSource(source, &newSource);
@ -122,7 +122,7 @@ void DataEngine::connectSource(const QString &source, QObject *visualization,
} }
d->connectSource(s, visualization, pollingInterval, intervalAlignment, d->connectSource(s, visualization, pollingInterval, intervalAlignment,
!newSource || pollingInterval > 0); !newSource || pollingInterval > 0);
//qDebug() << " ==> source connected"; //qCDebug(LOG_PLASMA) << " ==> source connected";
} }
} }
@ -162,7 +162,7 @@ bool DataEngine::updateSourceEvent(const QString &source)
if (d->script) { if (d->script) {
return d->script->updateSourceEvent(source); return d->script->updateSourceEvent(source);
} else { } else {
//qDebug() << source; //qCDebug(LOG_PLASMA) << source;
return false; //TODO: should this be true to trigger, even needless, updates on every tick? return false; //TODO: should this be true to trigger, even needless, updates on every tick?
} }
} }
@ -260,7 +260,7 @@ void DataEngine::addSource(DataContainer *source)
{ {
if (d->sources.contains(source->objectName())) { if (d->sources.contains(source->objectName())) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "source named \"" << source->objectName() << "\" already exists."; // qCDebug(LOG_PLASMA) << "source named \"" << source->objectName() << "\" already exists.";
#endif #endif
return; return;
} }
@ -342,17 +342,17 @@ QHash<QString, DataContainer *> DataEngine::containerDict() const
void DataEngine::timerEvent(QTimerEvent *event) void DataEngine::timerEvent(QTimerEvent *event)
{ {
//qDebug(); //qCDebug(LOG_PLASMA);
if (event->timerId() == d->updateTimerId) { if (event->timerId() == d->updateTimerId) {
// if the freq update is less than 0, don't bother // if the freq update is less than 0, don't bother
if (d->minPollingInterval < 0) { if (d->minPollingInterval < 0) {
//qDebug() << "uh oh.. no polling allowed!"; //qCDebug(LOG_PLASMA) << "uh oh.. no polling allowed!";
return; return;
} }
// minPollingInterval // minPollingInterval
if (d->updateTimer.elapsed() < d->minPollingInterval) { if (d->updateTimer.elapsed() < d->minPollingInterval) {
//qDebug() << "hey now.. slow down!"; //qCDebug(LOG_PLASMA) << "hey now.. slow down!";
return; return;
} }
@ -377,7 +377,7 @@ void DataEngine::updateAllSources()
QHashIterator<QString, Plasma::DataContainer *> it(d->sources); QHashIterator<QString, Plasma::DataContainer *> it(d->sources);
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
//qDebug() << "updating" << it.key(); //qCDebug(LOG_PLASMA) << "updating" << it.key();
if (it.value()->isUsed()) { if (it.value()->isUsed()) {
updateSourceEvent(it.key()); updateSourceEvent(it.key());
} }
@ -445,7 +445,7 @@ DataEnginePrivate::DataEnginePrivate(DataEngine *e, const KPluginInfo &info, con
if (!script) { if (!script) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Could not create a" << api << "ScriptEngine for the" // qCDebug(LOG_PLASMA) << "Could not create a" << api << "ScriptEngine for the"
// << dataEngineDescription.name() << "DataEngine."; // << dataEngineDescription.name() << "DataEngine.";
#endif #endif
delete package; delete package;
@ -468,7 +468,7 @@ void DataEnginePrivate::internalUpdateSource(DataContainer *source)
if (minPollingInterval > 0 && if (minPollingInterval > 0 &&
source->timeSinceLastUpdate() < (uint)minPollingInterval) { source->timeSinceLastUpdate() < (uint)minPollingInterval) {
// skip updating this source; it's been too soon // skip updating this source; it's been too soon
//qDebug() << "internal update source is delaying" << source->timeSinceLastUpdate() << minPollingInterval; //qCDebug(LOG_PLASMA) << "internal update source is delaying" << source->timeSinceLastUpdate() << minPollingInterval;
//but fake an update so that the signalrelay that triggered this gets the data from the //but fake an update so that the signalrelay that triggered this gets the data from the
//recent update. this way we don't have to worry about queuing - the relay will send a //recent update. this way we don't have to worry about queuing - the relay will send a
//signal immediately and everyone else is undisturbed. //signal immediately and everyone else is undisturbed.
@ -477,11 +477,11 @@ void DataEnginePrivate::internalUpdateSource(DataContainer *source)
} }
if (q->updateSourceEvent(source->objectName())) { if (q->updateSourceEvent(source->objectName())) {
//qDebug() << "queuing an update"; //qCDebug(LOG_PLASMA) << "queuing an update";
scheduleSourcesUpdated(); scheduleSourcesUpdated();
}/* else { }/* else {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "no update"; // qCDebug(LOG_PLASMA) << "no update";
#endif #endif
}*/ }*/
} }
@ -513,7 +513,7 @@ DataContainer *DataEnginePrivate::source(const QString &sourceName, bool createW
return 0; return 0;
} }
//qDebug() << "DataEngine " << q->objectName() << ": could not find DataContainer " << sourceName << ", creating"; //qCDebug(LOG_PLASMA) << "DataEngine " << q->objectName() << ": could not find DataContainer " << sourceName << ", creating";
DataContainer *s = new DataContainer(q); DataContainer *s = new DataContainer(q);
s->setObjectName(sourceName); s->setObjectName(sourceName);
sources.insert(sourceName, s); sources.insert(sourceName, s);
@ -529,7 +529,7 @@ void DataEnginePrivate::connectSource(DataContainer *s, QObject *visualization,
Plasma::Types::IntervalAlignment align, Plasma::Types::IntervalAlignment align,
bool immediateCall) bool immediateCall)
{ {
//qDebug() << "connect source called" << s->objectName() << "with interval" << pollingInterval; //qCDebug(LOG_PLASMA) << "connect source called" << s->objectName() << "with interval" << pollingInterval;
if (pollingInterval > 0) { if (pollingInterval > 0) {
// never more frequently than allowed, never more than 20 times per second // never more frequently than allowed, never more than 20 times per second
@ -543,7 +543,7 @@ void DataEnginePrivate::connectSource(DataContainer *s, QObject *visualization,
if (immediateCall) { if (immediateCall) {
// we don't want to do an immediate call if we are simply // we don't want to do an immediate call if we are simply
// reconnecting // reconnecting
//qDebug() << "immediate call requested, we have:" << s->visualizationIsConnected(visualization); //qCDebug(LOG_PLASMA) << "immediate call requested, we have:" << s->visualizationIsConnected(visualization);
immediateCall = !s->data().isEmpty() && immediateCall = !s->data().isEmpty() &&
!s->visualizationIsConnected(visualization); !s->visualizationIsConnected(visualization);
} }
@ -582,12 +582,12 @@ DataContainer *DataEnginePrivate::requestSource(const QString &sourceName, bool
*newSource = false; *newSource = false;
} }
//qDebug() << "requesting source " << sourceName; //qCDebug(LOG_PLASMA) << "requesting source " << sourceName;
DataContainer *s = source(sourceName, false); DataContainer *s = source(sourceName, false);
if (!s) { if (!s) {
// we didn't find a data source, so give the engine an opportunity to make one // we didn't find a data source, so give the engine an opportunity to make one
/*// qDebug() << "DataEngine " << q->objectName() /*// qCDebug(LOG_PLASMA) << "DataEngine " << q->objectName()
<< ": could not find DataContainer " << sourceName << ": could not find DataContainer " << sourceName
<< " will create on request" << endl;*/ << " will create on request" << endl;*/
waitingSourceRequest = sourceName; waitingSourceRequest = sourceName;
@ -619,7 +619,7 @@ void DataEnginePrivate::setupScriptSupport()
/* /*
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "sletting up script support, package is in" << package->path() // qCDebug(LOG_PLASMA) << "sletting up script support, package is in" << package->path()
#endif #endif
<< "which is a" << package->structure()->type() << "package" << "which is a" << package->structure()->type() << "package"
<< ", main script is" << package->filePath("mainscript"); << ", main script is" << package->filePath("mainscript");

View File

@ -29,6 +29,7 @@
#include "private/dataenginemanager_p.h" #include "private/dataenginemanager_p.h"
#include "servicejob.h" #include "servicejob.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -36,36 +37,36 @@ namespace Plasma
void DataEngineConsumerPrivate::slotJobFinished(Plasma::ServiceJob *job) void DataEngineConsumerPrivate::slotJobFinished(Plasma::ServiceJob *job)
{ {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "engine ready!"; // qCDebug(LOG_PLASMA) << "engine ready!";
#endif #endif
QString engineName = job->parameters()["EngineName"].toString(); QString engineName = job->parameters()["EngineName"].toString();
QString location = job->destination(); QString location = job->destination();
QPair<QString, QString> pair(location, engineName); QPair<QString, QString> pair(location, engineName);
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "pair = " << pair; // qCDebug(LOG_PLASMA) << "pair = " << pair;
#endif #endif
} }
void DataEngineConsumerPrivate::slotServiceReady(Plasma::Service *plasmoidService) void DataEngineConsumerPrivate::slotServiceReady(Plasma::Service *plasmoidService)
{ {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "service ready!"; // qCDebug(LOG_PLASMA) << "service ready!";
#endif #endif
if (!engineNameForService.contains(plasmoidService)) { if (!engineNameForService.contains(plasmoidService)) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "no engine name for service!"; // qCDebug(LOG_PLASMA) << "no engine name for service!";
#endif #endif
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "amount of services in map: " << engineNameForService.count(); // qCDebug(LOG_PLASMA) << "amount of services in map: " << engineNameForService.count();
#endif #endif
} else { } else {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "value = " << engineNameForService.value(plasmoidService); // qCDebug(LOG_PLASMA) << "value = " << engineNameForService.value(plasmoidService);
#endif #endif
} }
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "requesting dataengine!"; // qCDebug(LOG_PLASMA) << "requesting dataengine!";
#endif #endif
QVariantMap op = plasmoidService->operationDescription("DataEngine"); QVariantMap op = plasmoidService->operationDescription("DataEngine");
op["EngineName"] = engineNameForService.value(plasmoidService); op["EngineName"] = engineNameForService.value(plasmoidService);

View File

@ -35,6 +35,7 @@
#include "theme.h" #include "theme.h"
#include "private/svg_p.h" #include "private/svg_p.h"
#include "private/framesvg_helpers.h" #include "private/framesvg_helpers.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -137,10 +138,10 @@ void FrameSvg::setEnabledBorders(const EnabledBorders borders)
const QString newKey = d->cacheId(fd, d->prefix); const QString newKey = d->cacheId(fd, d->prefix);
fd->enabledBorders = oldBorders; fd->enabledBorders = oldBorders;
//qDebug() << "looking for" << newKey; //qCDebug(LOG_PLASMA) << "looking for" << newKey;
FrameData *newFd = FrameSvgPrivate::s_sharedFrames[theme()->d].value(newKey); FrameData *newFd = FrameSvgPrivate::s_sharedFrames[theme()->d].value(newKey);
if (newFd) { if (newFd) {
//qDebug() << "FOUND IT!" << newFd->refcount; //qCDebug(LOG_PLASMA) << "FOUND IT!" << newFd->refcount;
// we've found a math, so insert that new one and ref it .. // we've found a math, so insert that new one and ref it ..
newFd->ref(this); newFd->ref(this);
d->frames.insert(d->prefix, newFd); d->frames.insert(d->prefix, newFd);
@ -148,7 +149,7 @@ void FrameSvg::setEnabledBorders(const EnabledBorders borders)
//.. then deref the old one and if it's no longer used, get rid of it //.. then deref the old one and if it's no longer used, get rid of it
if (fd->deref(this)) { if (fd->deref(this)) {
//const QString oldKey = d->cacheId(fd, d->prefix); //const QString oldKey = d->cacheId(fd, d->prefix);
//qDebug() << "1. Removing it" << oldKey << fd->refcount; //qCDebug(LOG_PLASMA) << "1. Removing it" << oldKey << fd->refcount;
FrameSvgPrivate::s_sharedFrames[theme()->d].remove(oldKey); FrameSvgPrivate::s_sharedFrames[theme()->d].remove(oldKey);
delete fd; delete fd;
} }
@ -256,7 +257,7 @@ void FrameSvg::setElementPrefix(const QString &prefix)
// we have to cache after inserting the frame since the cacheId requires the // we have to cache after inserting the frame since the cacheId requires the
// frame to be in the frames collection already // frame to be in the frames collection already
const QString key = d->cacheId(oldFrameData, d->prefix); const QString key = d->cacheId(oldFrameData, d->prefix);
//qDebug() << this << " 1. inserting as" << key; //qCDebug(LOG_PLASMA) << this << " 1. inserting as" << key;
FrameSvgPrivate::s_sharedFrames[theme()->d].insert(key, newFd); FrameSvgPrivate::s_sharedFrames[theme()->d].insert(key, newFd);
} }
@ -329,7 +330,7 @@ void FrameSvg::resizeFrame(const QSizeF &size)
if (size.isEmpty()) { if (size.isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Invalid size" << size; // qCDebug(LOG_PLASMA) << "Invalid size" << size;
#endif #endif
return; return;
} }
@ -345,10 +346,10 @@ void FrameSvg::resizeFrame(const QSizeF &size)
const QString newKey = d->cacheId(fd, d->prefix); const QString newKey = d->cacheId(fd, d->prefix);
fd->frameSize = currentSize; fd->frameSize = currentSize;
//qDebug() << "looking for" << newKey; //qCDebug(LOG_PLASMA) << "looking for" << newKey;
FrameData *newFd = FrameSvgPrivate::s_sharedFrames[theme()->d].value(newKey); FrameData *newFd = FrameSvgPrivate::s_sharedFrames[theme()->d].value(newKey);
if (newFd) { if (newFd) {
//qDebug() << "FOUND IT!" << newFd->refcount; //qCDebug(LOG_PLASMA) << "FOUND IT!" << newFd->refcount;
// we've found a math, so insert that new one and ref it .. // we've found a math, so insert that new one and ref it ..
newFd->ref(this); newFd->ref(this);
d->frames.insert(d->prefix, newFd); d->frames.insert(d->prefix, newFd);
@ -356,7 +357,7 @@ void FrameSvg::resizeFrame(const QSizeF &size)
//.. then deref the old one and if it's no longer used, get rid of it //.. then deref the old one and if it's no longer used, get rid of it
if (fd->deref(this)) { if (fd->deref(this)) {
//const QString oldKey = d->cacheId(fd, d->prefix); //const QString oldKey = d->cacheId(fd, d->prefix);
//qDebug() << "1. Removing it" << oldKey << fd->refcount; //qCDebug(LOG_PLASMA) << "1. Removing it" << oldKey << fd->refcount;
FrameSvgPrivate::s_sharedFrames[theme()->d].remove(oldKey); FrameSvgPrivate::s_sharedFrames[theme()->d].remove(oldKey);
delete fd; delete fd;
} }
@ -583,7 +584,7 @@ FrameSvgPrivate::~FrameSvgPrivate()
{ {
#ifdef DEBUG_FRAMESVG_CACHE #ifdef DEBUG_FRAMESVG_CACHE
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "*************" << q << q->imagePath() << "****************"; // qCDebug(LOG_PLASMA) << "*************" << q << q->imagePath() << "****************";
#endif #endif
#endif #endif
@ -597,7 +598,7 @@ FrameSvgPrivate::~FrameSvgPrivate()
const QString key = cacheId(it.value(), it.key()); const QString key = cacheId(it.value(), it.key());
#ifdef DEBUG_FRAMESVG_CACHE #ifdef DEBUG_FRAMESVG_CACHE
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "2. Removing it" << key << it.value() << it.value()->refcount() << s_sharedFrames[theme()->d].contains(key); // qCDebug(LOG_PLASMA) << "2. Removing it" << key << it.value() << it.value()->refcount() << s_sharedFrames[theme()->d].contains(key);
#endif #endif
#endif #endif
s_sharedFrames[q->theme()->d].remove(key); s_sharedFrames[q->theme()->d].remove(key);
@ -606,12 +607,12 @@ FrameSvgPrivate::~FrameSvgPrivate()
#ifdef DEBUG_FRAMESVG_CACHE #ifdef DEBUG_FRAMESVG_CACHE
else { else {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "still shared:" << cacheId(it.value(), it.key()) << it.value() << it.value()->refcount() << it.value()->isUsed(); // qCDebug(LOG_PLASMA) << "still shared:" << cacheId(it.value(), it.key()) << it.value() << it.value()->refcount() << it.value()->isUsed();
#endif #endif
} }
} else { } else {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "lost our value for" << it.key(); // qCDebug(LOG_PLASMA) << "lost our value for" << it.key();
#endif #endif
#endif #endif
} }
@ -625,22 +626,22 @@ FrameSvgPrivate::~FrameSvgPrivate()
const int rc = it2.value()->refcount(); const int rc = it2.value()->refcount();
if (rc == 0) { if (rc == 0) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << " LOST!" << it2.key() << rc << it2.value();// << it2.value()->references; // qCDebug(LOG_PLASMA) << " LOST!" << it2.key() << rc << it2.value();// << it2.value()->references;
#endif #endif
} else { } else {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << " " << it2.key() << rc << it2.value(); // qCDebug(LOG_PLASMA) << " " << it2.key() << rc << it2.value();
#endif #endif
foreach (FrameSvg *data, it2.value()->references.keys()) { foreach (FrameSvg *data, it2.value()->references.keys()) {
#ifndef NDEBUG #ifndef NDEBUG
qDebug() << " " << (void *)data << it2.value()->references[data]; qCDebug(LOG_PLASMA) << " " << (void *)data << it2.value()->references[data];
#endif #endif
} }
shares += rc - 1; shares += rc - 1;
} }
} }
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "#####################################" << s_sharedFrames[theme()->d].count() << ", pixmaps saved:" << shares; // qCDebug(LOG_PLASMA) << "#####################################" << s_sharedFrames[theme()->d].count() << ", pixmaps saved:" << shares;
#endif #endif
#endif #endif
@ -793,17 +794,17 @@ void FrameSvgPrivate::generateBackground(FrameData *frame)
void FrameSvgPrivate::generateFrameBackground(FrameData *frame) void FrameSvgPrivate::generateFrameBackground(FrameData *frame)
{ {
//qDebug() << "generating background"; //qCDebug(LOG_PLASMA) << "generating background";
const QSize size = frameSize(frame).toSize() * q->devicePixelRatio(); const QSize size = frameSize(frame).toSize() * q->devicePixelRatio();
if (!size.isValid()) { if (!size.isValid()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Invalid frame size" << size; // qCDebug(LOG_PLASMA) << "Invalid frame size" << size;
#endif #endif
return; return;
} }
if (size.width() >= MAX_FRAME_SIZE || size.height() >= MAX_FRAME_SIZE) { if (size.width() >= MAX_FRAME_SIZE || size.height() >= MAX_FRAME_SIZE) {
qWarning() << "Not generating frame background for a size whose width or height is more than" << MAX_FRAME_SIZE << size; qCWarning(LOG_PLASMA) << "Not generating frame background for a size whose width or height is more than" << MAX_FRAME_SIZE << size;
return; return;
} }
@ -934,7 +935,7 @@ void FrameSvgPrivate::cacheFrame(const QString &prefixToSave, const QPixmap &bac
const QString id = cacheId(frame, prefixToSave); const QString id = cacheId(frame, prefixToSave);
//qDebug()<<"Saving to cache frame"<<id; //qCDebug(LOG_PLASMA)<<"Saving to cache frame"<<id;
q->theme()->insertIntoCache(id, background, QString::number((qint64)q, 16) % prefixToSave); q->theme()->insertIntoCache(id, background, QString::number((qint64)q, 16) % prefixToSave);
@ -946,7 +947,7 @@ void FrameSvgPrivate::cacheFrame(const QString &prefixToSave, const QPixmap &bac
void FrameSvgPrivate::updateSizes() const void FrameSvgPrivate::updateSizes() const
{ {
//qDebug() << "!!!!!!!!!!!!!!!!!!!!!! updating sizes" << prefix; //qCDebug(LOG_PLASMA) << "!!!!!!!!!!!!!!!!!!!!!! updating sizes" << prefix;
FrameData *frame = frames[prefix]; FrameData *frame = frames[prefix];
Q_ASSERT(frame); Q_ASSERT(frame);
@ -1073,13 +1074,13 @@ QSizeF FrameSvgPrivate::frameSize(FrameData *frame) const
void FrameData::ref(FrameSvg *svg) void FrameData::ref(FrameSvg *svg)
{ {
references[svg] = references[svg] + 1; references[svg] = references[svg] + 1;
//qDebug() << this << svg << references[svg]; //qCDebug(LOG_PLASMA) << this << svg << references[svg];
} }
bool FrameData::deref(FrameSvg *svg) bool FrameData::deref(FrameSvg *svg)
{ {
references[svg] = references[svg] - 1; references[svg] = references[svg] - 1;
//qDebug() << this << svg << references[svg]; //qCDebug(LOG_PLASMA) << this << svg << references[svg];
if (references[svg] < 1) { if (references[svg] < 1) {
references.remove(svg); references.remove(svg);
} }

View File

@ -290,8 +290,8 @@ KJob *Package::install(const QString &sourcePackage, const QString &packageRoot)
{ {
const QString src = sourcePackage; const QString src = sourcePackage;
const QString dest = packageRoot.isEmpty() ? defaultPackageRoot() : packageRoot; const QString dest = packageRoot.isEmpty() ? defaultPackageRoot() : packageRoot;
//qDebug() << "Source: " << src; //qCDebug(LOG_PLASMA) << "Source: " << src;
//qDebug() << "PackageRoot: " << dest; //qCDebug(LOG_PLASMA) << "PackageRoot: " << dest;
KJob *j = d->structure->install(this, src, dest); KJob *j = d->structure->install(this, src, dest);
return j; return j;
} }

View File

@ -21,6 +21,7 @@
#include <QDebug> #include <QDebug>
#include "private/package_p.h" #include "private/package_p.h"
#include "private/packagestructure_p.h" #include "private/packagestructure_p.h"
#include "debug_p.h"
#include <kpackage/packageloader.h> #include <kpackage/packageloader.h>
#include <kpackage/packagestructure.h> #include <kpackage/packagestructure.h>
@ -108,7 +109,7 @@ void PackageStructurePrivate::installPathChanged(const QString &path)
bool ok = QFile::remove(service); bool ok = QFile::remove(service);
if (!ok) { if (!ok) {
qWarning() << "Unable to remove " << service; qCWarning(LOG_PLASMA) << "Unable to remove " << service;
} }
//install //install
@ -135,16 +136,16 @@ void PackageStructurePrivate::installPathChanged(const QString &path)
QString localServiceDirectory = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/"); QString localServiceDirectory = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kservices5/");
if (!QDir().mkpath(localServiceDirectory)) { if (!QDir().mkpath(localServiceDirectory)) {
qDebug() << "Failed to create ... " << localServiceDirectory; qCDebug(LOG_PLASMA) << "Failed to create ... " << localServiceDirectory;
qWarning() << "Could not create local service directory:" << localServiceDirectory; qCWarning(LOG_PLASMA) << "Could not create local service directory:" << localServiceDirectory;
return; return;
} }
QString service = localServiceDirectory + serviceName; QString service = localServiceDirectory + serviceName;
qDebug() << "-- Copying " << metaPath << service; qCDebug(LOG_PLASMA) << "-- Copying " << metaPath << service;
const bool ok = QFile::copy(metaPath, service); const bool ok = QFile::copy(metaPath, service);
if (ok) { if (ok) {
qDebug() << "Copying metadata went ok."; qCDebug(LOG_PLASMA) << "Copying metadata went ok.";
// the icon in the installed file needs to point to the icon in the // the icon in the installed file needs to point to the icon in the
// installation dir! // installation dir!
QString iconPath = path + '/' + cg.readEntry("Icon"); QString iconPath = path + '/' + cg.readEntry("Icon");
@ -155,7 +156,7 @@ void PackageStructurePrivate::installPathChanged(const QString &path)
cg.writeEntry("Icon", iconPath); cg.writeEntry("Icon", iconPath);
} }
} else { } else {
qWarning() << "Could not register package as service (this is not necessarily fatal):" << serviceName; qCWarning(LOG_PLASMA) << "Could not register package as service (this is not necessarily fatal):" << serviceName;
} }
} }
} }

View File

@ -45,6 +45,7 @@
#include "private/storage_p.h" #include "private/storage_p.h"
#include "private/package_p.h" #include "private/package_p.h"
#include "private/packagestructure_p.h" #include "private/packagestructure_p.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -151,7 +152,7 @@ void PluginLoader::setPluginLoader(PluginLoader *loader)
s_pluginLoader = loader; s_pluginLoader = loader;
} else { } else {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Cannot set pluginLoader, already set!" << s_pluginLoader; // qCDebug(LOG_PLASMA) << "Cannot set pluginLoader, already set!" << s_pluginLoader;
#endif #endif
} }
} }
@ -223,7 +224,7 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
p.setFallbackPackage(fp); p.setFallbackPackage(fp);
if (!fp.isValid()) { if (!fp.isValid()) {
qWarning() << "invalid fallback path in " << p.path(); qCWarning(LOG_PLASMA) << "invalid fallback path in " << p.path();
return 0; return 0;
} }
} }
@ -233,12 +234,12 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
{ {
KPluginInfo info = KPluginInfo::fromMetaData(p.metadata()); KPluginInfo info = KPluginInfo::fromMetaData(p.metadata());
if (!info.isValid()) { if (!info.isValid()) {
qWarning() << "invalid plugin in" << p.path(); qCWarning(LOG_PLASMA) << "invalid plugin in" << p.path();
return 0; return 0;
} }
KPluginLoader loader(info.libraryPath()); KPluginLoader loader(info.libraryPath());
if (!Plasma::isPluginVersionCompatible(loader.pluginVersion())) { if (!Plasma::isPluginVersionCompatible(loader.pluginVersion())) {
qWarning() << "incompatiable plugin version in" << p.path(); qCWarning(LOG_PLASMA) << "incompatiable plugin version in" << p.path();
return 0; return 0;
} }
KPluginFactory *factory = loader.factory(); KPluginFactory *factory = loader.factory();
@ -254,7 +255,7 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
if (!applet) { if (!applet) {
//qDebug() << name << "not a C++ applet: Falling back to an empty one"; //qCDebug(LOG_PLASMA) << name << "not a C++ applet: Falling back to an empty one";
QVariantList allArgs; QVariantList allArgs;
allArgs << p.metadata().fileName() << appletId << args; allArgs << p.metadata().fileName() << appletId << args;
@ -462,7 +463,7 @@ ContainmentActions *PluginLoader::loadContainmentActions(Containment *parent, co
if (offers.isEmpty()) { if (offers.isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
qDebug() << "offers is empty for " << name; qCDebug(LOG_PLASMA) << "offers is empty for " << name;
#endif #endif
return 0; return 0;
} }
@ -481,7 +482,7 @@ ContainmentActions *PluginLoader::loadContainmentActions(Containment *parent, co
if (!actions) { if (!actions) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Couldn't load containmentActions \"" << name << "\"! reason given: " << error; // qCDebug(LOG_PLASMA) << "Couldn't load containmentActions \"" << name << "\"! reason given: " << error;
#endif #endif
} }
@ -551,7 +552,7 @@ Package PluginLoader::loadPackage(const QString &packageFormat, const QString &s
} }
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Couldn't load Package for" << packageFormat << "! reason given: " << error; // qCDebug(LOG_PLASMA) << "Couldn't load Package for" << packageFormat << "! reason given: " << error;
#endif #endif
return Package(); return Package();
@ -581,7 +582,7 @@ KPluginInfo::List PluginLoader::listAppletInfo(const QString &category, const QS
for (auto md : KPackage::PackageLoader::self()->findPackages("Plasma/Applet", QString(), filter)) { for (auto md : KPackage::PackageLoader::self()->findPackages("Plasma/Applet", QString(), filter)) {
auto pi = KPluginInfo(KService::serviceByStorageId(md.metaDataFileName())); auto pi = KPluginInfo(KService::serviceByStorageId(md.metaDataFileName()));
if (!pi.isValid()) { if (!pi.isValid()) {
qWarning() << "Could not load plugin info for plugin :" << md.pluginId() << "skipping plugin"; qCWarning(LOG_PLASMA) << "Could not load plugin info for plugin :" << md.pluginId() << "skipping plugin";
continue; continue;
} }
list << pi; list << pi;
@ -607,7 +608,7 @@ KPluginInfo::List PluginLoader::listAppletInfo(const QString &category, const QS
for (auto md : KPackage::PackageLoader::self()->findPackages("Plasma/Applet", QString(), filter)) { for (auto md : KPackage::PackageLoader::self()->findPackages("Plasma/Applet", QString(), filter)) {
auto pi = KPluginInfo(KService::serviceByStorageId(md.metaDataFileName())); auto pi = KPluginInfo(KService::serviceByStorageId(md.metaDataFileName()));
if (!pi.isValid()) { if (!pi.isValid()) {
qWarning() << "Could not load plugin info for plugin :" << md.pluginId() << "skipping plugin"; qCWarning(LOG_PLASMA) << "Could not load plugin info for plugin :" << md.pluginId() << "skipping plugin";
continue; continue;
} }
list << pi; list << pi;
@ -648,7 +649,7 @@ KPluginInfo::List PluginLoader::listAppletInfoForUrl(const QUrl &url)
rx.setPatternSyntax(QRegExp::Wildcard); rx.setPatternSyntax(QRegExp::Wildcard);
if (rx.exactMatch(url.toString())) { if (rx.exactMatch(url.toString())) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << info.name() << "matches" << glob << url; // qCDebug(LOG_PLASMA) << info.name() << "matches" << glob << url;
#endif #endif
filtered << info; filtered << info;
} }

View File

@ -46,6 +46,7 @@
#include "private/containment_p.h" #include "private/containment_p.h"
#include "private/package_p.h" #include "private/package_p.h"
#include "timetracker.h" #include "timetracker.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -90,7 +91,7 @@ AppletPrivate::AppletPrivate(KService::Ptr service, const KPluginInfo *info, int
AppletPrivate::~AppletPrivate() AppletPrivate::~AppletPrivate()
{ {
if (activationAction && globalShortcutEnabled) { if (activationAction && globalShortcutEnabled) {
//qDebug() << "resetting global action for" << q->title() << activationAction->objectName(); //qCDebug(LOG_PLASMA) << "resetting global action for" << q->title() << activationAction->objectName();
KGlobalAccel::self()->removeAllShortcuts(activationAction); KGlobalAccel::self()->removeAllShortcuts(activationAction);
} }
@ -127,7 +128,7 @@ void AppletPrivate::init(const QString &packagePath, const QVariantList &args)
if (!appletDescription.isValid()) { if (!appletDescription.isValid()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Check your constructor! " // qCDebug(LOG_PLASMA) << "Check your constructor! "
// << "You probably want to be passing in a Service::Ptr " // << "You probably want to be passing in a Service::Ptr "
// << "or a QVariantList with a valid storageid as arg[0]."; // << "or a QVariantList with a valid storageid as arg[0].";
#endif #endif
@ -348,7 +349,7 @@ void AppletPrivate::globalShortcutChanged()
shortcutConfig.writeEntry("global", newShortCut); shortcutConfig.writeEntry("global", newShortCut);
scheduleModificationNotification(); scheduleModificationNotification();
} }
//qDebug() << "after" << shortcut.primary() << d->activationAction->globalShortcut().primary(); //qCDebug(LOG_PLASMA) << "after" << shortcut.primary() << d->activationAction->globalShortcut().primary();
} }
KActionCollection *AppletPrivate::defaultActions(QObject *parent) KActionCollection *AppletPrivate::defaultActions(QObject *parent)
@ -445,7 +446,7 @@ void AppletPrivate::setupPackage()
} }
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "setting up script support, package is in" << package->path() // qCDebug(LOG_PLASMA) << "setting up script support, package is in" << package->path()
// << ", main script is" << package->filePath("mainscript"); // << ", main script is" << package->filePath("mainscript");
#endif #endif
@ -511,7 +512,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup()
if (q->isContainment()) { if (q->isContainment()) {
Corona *corona = static_cast<Containment *>(q)->corona(); Corona *corona = static_cast<Containment *>(q)->corona();
KConfigGroup containmentConfig; KConfigGroup containmentConfig;
//qDebug() << "got a corona, baby?" << (QObject*)corona << (QObject*)q; //qCDebug(LOG_PLASMA) << "got a corona, baby?" << (QObject*)corona << (QObject*)q;
if (parentApplet) { if (parentApplet) {
containmentConfig = parentApplet->config(); containmentConfig = parentApplet->config();
@ -531,7 +532,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup()
appletConfig = c->config(); appletConfig = c->config();
appletConfig = KConfigGroup(&appletConfig, "Applets"); appletConfig = KConfigGroup(&appletConfig, "Applets");
} else { } else {
qWarning() << "requesting config for" << q->title() << "without a containment!"; qCWarning(LOG_PLASMA) << "requesting config for" << q->title() << "without a containment!";
appletConfig = KConfigGroup(KSharedConfig::openConfig(), "Applets"); appletConfig = KConfigGroup(KSharedConfig::openConfig(), "Applets");
} }

View File

@ -20,6 +20,7 @@
#include "associatedapplicationmanager_p.h" #include "associatedapplicationmanager_p.h"
#include "config-plasma.h" #include "config-plasma.h"
#include "debug_p.h"
#include <QAction> #include <QAction>
#include <QHash> #include <QHash>
@ -167,7 +168,7 @@ void AssociatedApplicationManager::run(Plasma::Applet *applet)
#if !PLASMA_NO_KIO #if !PLASMA_NO_KIO
bool success = KRun::run(d->applicationNames.value(applet), d->urlLists.value(applet), 0); bool success = KRun::run(d->applicationNames.value(applet), d->urlLists.value(applet), 0);
if (!success) { if (!success) {
qWarning() << "couldn't run" << d->applicationNames.value(applet) << d->urlLists.value(applet); qCWarning(LOG_PLASMA) << "couldn't run" << d->applicationNames.value(applet) << d->urlLists.value(applet);
} }
#else #else
QString execCommand = d->applicationNames.value(applet); QString execCommand = d->applicationNames.value(applet);

View File

@ -35,6 +35,7 @@
#include "private/applet_p.h" #include "private/applet_p.h"
#include "timetracker.h" #include "timetracker.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -115,7 +116,7 @@ void ContainmentPrivate::configChanged()
void ContainmentPrivate::checkStatus(Plasma::Types::ItemStatus appletStatus) void ContainmentPrivate::checkStatus(Plasma::Types::ItemStatus appletStatus)
{ {
//qDebug() << "================== "<< appletStatus << q->status(); //qCDebug(LOG_PLASMA) << "================== "<< appletStatus << q->status();
if (appletStatus == q->status()) { if (appletStatus == q->status()) {
emit q->statusChanged(appletStatus); emit q->statusChanged(appletStatus);
return; return;
@ -145,7 +146,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Types::Constraints
return; return;
} }
//qDebug() << "got containmentConstraintsEvent" << constraints; //qCDebug(LOG_PLASMA) << "got containmentConstraintsEvent" << constraints;
if (constraints & Plasma::Types::ImmutableConstraint) { if (constraints & Plasma::Types::ImmutableConstraint) {
//update actions //update actions
const bool unlocked = q->immutability() == Types::Mutable; const bool unlocked = q->immutability() == Types::Mutable;
@ -200,7 +201,7 @@ Applet *ContainmentPrivate::createApplet(const QString &name, const QVariantList
if (q->immutability() != Types::Mutable) { if (q->immutability() != Types::Mutable) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "addApplet for" << name << "requested, but we're currently immutable!"; // qCDebug(LOG_PLASMA) << "addApplet for" << name << "requested, but we're currently immutable!";
#endif #endif
return 0; return 0;
} }
@ -208,7 +209,7 @@ Applet *ContainmentPrivate::createApplet(const QString &name, const QVariantList
Applet *applet = PluginLoader::self()->loadApplet(name, id, args); Applet *applet = PluginLoader::self()->loadApplet(name, id, args);
if (!applet) { if (!applet) {
qWarning() << "Applet" << name << "could not be loaded."; qCWarning(LOG_PLASMA) << "Applet" << name << "could not be loaded.";
applet = new Applet(0, QString(), id); applet = new Applet(0, QString(), id);
applet->setLaunchErrorMessage(i18n("Could not find requested component: %1", name)); applet->setLaunchErrorMessage(i18n("Could not find requested component: %1", name));
} }

View File

@ -65,7 +65,7 @@ SignalRelay::SignalRelay(DataContainer *parent, DataContainerPrivate *data, uint
m_resetTimer(true), m_resetTimer(true),
m_queued(true) m_queued(true)
{ {
//qDebug() << "signal relay with time of" << m_timerId << "being set up"; //qCDebug(LOG_PLASMA) << "signal relay with time of" << m_timerId << "being set up";
m_timerId = startTimer(immediateUpdate ? 0 : m_interval); m_timerId = startTimer(immediateUpdate ? 0 : m_interval);
if (m_align != Plasma::Types::NoAlignment) { if (m_align != Plasma::Types::NoAlignment) {
checkAlignment(); checkAlignment();
@ -110,7 +110,7 @@ void SignalRelay::checkAlignment()
void SignalRelay::checkQueueing() void SignalRelay::checkQueueing()
{ {
//qDebug() << m_queued; //qCDebug(LOG_PLASMA) << m_queued;
if (m_queued) { if (m_queued) {
emit dataUpdated(dc->objectName(), d->data); emit dataUpdated(dc->objectName(), d->data);
m_queued = false; m_queued = false;
@ -153,13 +153,13 @@ void SignalRelay::timerEvent(QTimerEvent *event)
emit dc->updateRequested(dc); emit dc->updateRequested(dc);
if (d->hasUpdates()) { if (d->hasUpdates()) {
//qDebug() << "emitting data updated directly" << d->data; //qCDebug(LOG_PLASMA) << "emitting data updated directly" << d->data;
emit dataUpdated(dc->objectName(), d->data); emit dataUpdated(dc->objectName(), d->data);
m_queued = false; m_queued = false;
} else { } else {
// the source wasn't actually updated; so let's put ourselves in the queue // the source wasn't actually updated; so let's put ourselves in the queue
// so we get a dataUpdated() call when the data does arrive // so we get a dataUpdated() call when the data does arrive
//qDebug() << "queued"; //qCDebug(LOG_PLASMA) << "queued";
m_queued = true; m_queued = true;
} }
} }

View File

@ -32,6 +32,7 @@
#include "private/dataengine_p.h" #include "private/dataengine_p.h"
#include "private/datacontainer_p.h" #include "private/datacontainer_p.h"
#include "scripting/scriptengine.h" #include "scripting/scriptengine.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -121,7 +122,7 @@ Plasma::DataEngine *DataEngineManager::engine(const QString &name) const
Plasma::DataEngine *DataEngineManager::loadEngine(const QString &name) Plasma::DataEngine *DataEngineManager::loadEngine(const QString &name)
{ {
if (name.isEmpty()) { if (name.isEmpty()) {
qDebug() << "Asked an engine with empty name"; qCDebug(LOG_PLASMA) << "Asked an engine with empty name";
return d->nullEngine(); return d->nullEngine();
} }
Plasma::DataEngine::Dict::const_iterator it = d->engines.constFind(name); Plasma::DataEngine::Dict::const_iterator it = d->engines.constFind(name);
@ -134,7 +135,7 @@ Plasma::DataEngine *DataEngineManager::loadEngine(const QString &name)
DataEngine *engine = PluginLoader::self()->loadDataEngine(name); DataEngine *engine = PluginLoader::self()->loadDataEngine(name);
if (!engine) { if (!engine) {
qDebug() << "Can't find a dataengine named" << name; qCDebug(LOG_PLASMA) << "Can't find a dataengine named" << name;
// Try installing the engine. However, it's too late for this request. // Try installing the engine. However, it's too late for this request.
ComponentInstaller::self()->installMissingComponent("dataengine", name); ComponentInstaller::self()->installMissingComponent("dataengine", name);
@ -166,7 +167,7 @@ void DataEngineManager::timerEvent(QTimerEvent *)
QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "plasma_dataenginemanager_log"; QString path = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QLatin1Char('/') + "plasma_dataenginemanager_log";
QFile f(path); QFile f(path);
if (!f.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) { if (!f.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) {
// qDebug() << "faild to open" << path; // qCDebug(LOG_PLASMA) << "faild to open" << path;
return; return;
} }

View File

@ -30,6 +30,7 @@
#include <QDebug> #include <QDebug>
#include <qstandardpaths.h> #include <qstandardpaths.h>
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -84,12 +85,12 @@ void StorageThread::initializeDb(StorageJob *caller)
} }
if (!m_db.open()) { if (!m_db.open()) {
qWarning() << "Unable to open the plasma storage cache database: " << m_db.lastError(); qCWarning(LOG_PLASMA) << "Unable to open the plasma storage cache database: " << m_db.lastError();
} else if (!m_db.tables().contains(caller->clientName())) { } else if (!m_db.tables().contains(caller->clientName())) {
QSqlQuery query(m_db); QSqlQuery query(m_db);
query.prepare(QString("create table ") + caller->clientName() + " (valueGroup varchar(256), id varchar(256), txt TEXT, int INTEGER, float REAL, binary BLOB, creationTime datetime, accessTime datetime, primary key (valueGroup, id))"); query.prepare(QString("create table ") + caller->clientName() + " (valueGroup varchar(256), id varchar(256), txt TEXT, int INTEGER, float REAL, binary BLOB, creationTime datetime, accessTime datetime, primary key (valueGroup, id))");
if (!query.exec()) { if (!query.exec()) {
qWarning() << "Unable to create table for" << caller->clientName(); qCWarning(LOG_PLASMA) << "Unable to create table for" << caller->clientName();
m_db.close(); m_db.close();
} }
} }
@ -150,7 +151,7 @@ void StorageThread::save(QWeakPointer<StorageJob> wcaller, const QVariantMap &pa
it.toFront(); it.toFront();
while (it.hasNext()) { while (it.hasNext()) {
it.next(); it.next();
//qDebug() << "going to insert" << valueGroup << it.key(); //qCDebug(LOG_PLASMA) << "going to insert" << valueGroup << it.key();
query.bindValue(":id", it.key()); query.bindValue(":id", it.key());
QString field; QString field;
@ -185,7 +186,7 @@ void StorageThread::save(QWeakPointer<StorageJob> wcaller, const QVariantMap &pa
} }
if (!query.exec()) { if (!query.exec()) {
//qDebug() << "query failed:" << query.lastQuery() << query.lastError().text(); //qCDebug(LOG_PLASMA) << "query failed:" << query.lastQuery() << query.lastError().text();
m_db.commit(); m_db.commit();
emit newResult(caller, false); emit newResult(caller, false);
return; return;

View File

@ -21,6 +21,7 @@
#include "theme_p.h" #include "theme_p.h"
#include "framesvg.h" #include "framesvg.h"
#include "framesvg_p.h" #include "framesvg_p.h"
#include "debug_p.h"
#include <QGuiApplication> #include <QGuiApplication>
#include <QFile> #include <QFile>
@ -143,7 +144,7 @@ KConfigGroup &ThemePrivate::config()
if (!app.isEmpty()) { if (!app.isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "using theme for app" << app; // qCDebug(LOG_PLASMA) << "using theme for app" << app;
#endif #endif
groupName.append('-').append(app); groupName.append('-').append(app);
} }
@ -306,7 +307,7 @@ void ThemePrivate::compositingChanged(bool active)
#if HAVE_X11 #if HAVE_X11
if (compositingActive != active) { if (compositingActive != active) {
compositingActive = active; compositingActive = active;
//qDebug() << QTime::currentTime(); //qCDebug(LOG_PLASMA) << QTime::currentTime();
scheduleThemeChangeNotification(PixmapCache | SvgElementsCache); scheduleThemeChangeNotification(PixmapCache | SvgElementsCache);
} }
#endif #endif
@ -374,7 +375,7 @@ void ThemePrivate::scheduleThemeChangeNotification(CacheTypes caches)
void ThemePrivate::notifyOfChanged() void ThemePrivate::notifyOfChanged()
{ {
//qDebug() << cachesToDiscard; //qCDebug(LOG_PLASMA) << cachesToDiscard;
discardCache(cachesToDiscard); discardCache(cachesToDiscard);
cachesToDiscard = NoCache; cachesToDiscard = NoCache;
emit themeChanged(); emit themeChanged();
@ -501,7 +502,7 @@ const QString ThemePrivate::svgStyleSheet(Plasma::Theme::ColorGroup group)
void ThemePrivate::settingsFileChanged(const QString &file) void ThemePrivate::settingsFileChanged(const QString &file)
{ {
qDebug() << "settingsFile: " << file; qCDebug(LOG_PLASMA) << "settingsFile: " << file;
if (file == themeMetadataPath) { if (file == themeMetadataPath) {
const KPluginInfo pluginInfo(themeMetadataPath); const KPluginInfo pluginInfo(themeMetadataPath);
if (themeVersion != pluginInfo.version()) { if (themeVersion != pluginInfo.version()) {
@ -518,7 +519,7 @@ void ThemePrivate::settingsChanged(bool emitChanges)
if (fixedName) { if (fixedName) {
return; return;
} }
//qDebug() << "Settings Changed!"; //qCDebug(LOG_PLASMA) << "Settings Changed!";
KConfigGroup cg = config(); KConfigGroup cg = config();
setThemeName(cg.readEntry("name", ThemePrivate::defaultTheme), false, emitChanges); setThemeName(cg.readEntry("name", ThemePrivate::defaultTheme), false, emitChanges);
} }
@ -761,7 +762,7 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
const QString colorsFile = realTheme ? QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Literal("/colors")) const QString colorsFile = realTheme ? QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Literal("/colors"))
: QString(); : QString();
//qDebug() << "we're going for..." << colorsFile << "*******************"; //qCDebug(LOG_PLASMA) << "we're going for..." << colorsFile << "*******************";
if (colorsFile.isEmpty()) { if (colorsFile.isEmpty()) {
colors = 0; colors = 0;

View File

@ -28,6 +28,7 @@
#include "private/componentinstaller_p.h" #include "private/componentinstaller_p.h"
#include "scripting/appletscript.h" #include "scripting/appletscript.h"
#include "scripting/dataenginescript.h" #include "scripting/dataenginescript.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -90,7 +91,7 @@ ScriptEngine *loadEngine(const QString &language, Types::ComponentType type, QOb
if (((type & Types::AppletComponent) && !componentTypes.contains(QLatin1String("Applet"))) if (((type & Types::AppletComponent) && !componentTypes.contains(QLatin1String("Applet")))
|| ((type & Types::DataEngineComponent) && !componentTypes.contains(QLatin1String("DataEngine")))) { || ((type & Types::DataEngineComponent) && !componentTypes.contains(QLatin1String("DataEngine")))) {
qWarning() << "ScriptEngine" << plugins.first().name() << "does not provide Applet or DataEngine components, returning empty."; qCWarning(LOG_PLASMA) << "ScriptEngine" << plugins.first().name() << "does not provide Applet or DataEngine components, returning empty.";
return 0; return 0;
} }
KPluginInfo::List lst = KPluginInfo::fromMetaData(plugins); KPluginInfo::List lst = KPluginInfo::fromMetaData(plugins);
@ -99,7 +100,7 @@ ScriptEngine *loadEngine(const QString &language, Types::ComponentType type, QOb
if (factory) { if (factory) {
engine = factory->create<Plasma::ScriptEngine>(0, args); engine = factory->create<Plasma::ScriptEngine>(0, args);
} else { } else {
qWarning() << "Unable to load" << plugins.first().name() << "ScriptEngine"; qCWarning(LOG_PLASMA) << "Unable to load" << plugins.first().name() << "ScriptEngine";
} }
} }

View File

@ -35,6 +35,7 @@
#include "version.h" #include "version.h"
#include "pluginloader.h" #include "pluginloader.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -71,7 +72,7 @@ QStringList Service::operationNames() const
{ {
if (d->operationsMap.keys().isEmpty()) { if (d->operationsMap.keys().isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "No valid operations scheme has been registered"; // qCDebug(LOG_PLASMA) << "No valid operations scheme has been registered";
#endif #endif
return QStringList(); return QStringList();
} }
@ -83,12 +84,12 @@ QVariantMap Service::operationDescription(const QString &operationName)
{ {
if (d->operationsMap.keys().isEmpty()) { if (d->operationsMap.keys().isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "No valid operations scheme has been registered"; // qCDebug(LOG_PLASMA) << "No valid operations scheme has been registered";
#endif #endif
return QVariantMap(); return QVariantMap();
} }
//qDebug() << "operation" << operationName //qCDebug(LOG_PLASMA) << "operation" << operationName
// << "requested, has keys" << d->operationsMap.keys(); // << "requested, has keys" << d->operationsMap.keys();
return d->operationsMap.value(operationName); return d->operationsMap.value(operationName);
} }
@ -101,12 +102,12 @@ ServiceJob *Service::startOperationCall(const QVariantMap &description, QObject
if (d->operationsMap.keys().isEmpty()) { if (d->operationsMap.keys().isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "No valid operations scheme has been registered"; // qCDebug(LOG_PLASMA) << "No valid operations scheme has been registered";
#endif #endif
} else if (!op.isEmpty() && d->operationsMap.contains(op)) { } else if (!op.isEmpty() && d->operationsMap.contains(op)) {
if (d->disabledOperations.contains(op)) { if (d->disabledOperations.contains(op)) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Operation" << op << "is disabled"; // qCDebug(LOG_PLASMA) << "Operation" << op << "is disabled";
#endif #endif
} else { } else {
QVariantMap map = description; QVariantMap map = description;
@ -114,7 +115,7 @@ ServiceJob *Service::startOperationCall(const QVariantMap &description, QObject
} }
} else { } else {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << op << "is not a valid group; valid groups are:" << d->operationsMap.keys(); // qCDebug(LOG_PLASMA) << op << "is not a valid group; valid groups are:" << d->operationsMap.keys();
#endif #endif
} }
@ -192,7 +193,7 @@ void Service::registerOperationsScheme()
if (d->name.isEmpty()) { if (d->name.isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "No name found"; // qCDebug(LOG_PLASMA) << "No name found";
#endif #endif
return; return;
} }
@ -201,7 +202,7 @@ void Service::registerOperationsScheme()
if (path.isEmpty()) { if (path.isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Cannot find operations description:" << d->name << ".operations"; // qCDebug(LOG_PLASMA) << "Cannot find operations description:" << d->name << ".operations";
#endif #endif
return; return;
} }

View File

@ -40,6 +40,7 @@
#include "applet.h" #include "applet.h"
#include "package.h" #include "package.h"
#include "theme.h" #include "theme.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -225,7 +226,7 @@ bool SvgPrivate::setImagePath(const QString &imagePath)
path = actualPath; path = actualPath;
} else { } else {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "file '" << path << "' does not exist!"; // qCDebug(LOG_PLASMA) << "file '" << path << "' does not exist!";
#endif #endif
} }
@ -242,9 +243,9 @@ bool SvgPrivate::setImagePath(const QString &imagePath)
} else { } else {
createRenderer(); createRenderer();
naturalSize = renderer->defaultSize() * scaleFactor; naturalSize = renderer->defaultSize() * scaleFactor;
//qDebug() << "natural size for" << path << "from renderer is" << naturalSize; //qCDebug(LOG_PLASMA) << "natural size for" << path << "from renderer is" << naturalSize;
cacheAndColorsTheme()->insertIntoRectsCache(path, QStringLiteral("_Natural_%1").arg(scaleFactor), QRectF(QPointF(0, 0), naturalSize)); cacheAndColorsTheme()->insertIntoRectsCache(path, QStringLiteral("_Natural_%1").arg(scaleFactor), QRectF(QPointF(0, 0), naturalSize));
//qDebug() << "natural size for" << path << "from cache is" << naturalSize; //qCDebug(LOG_PLASMA) << "natural size for" << path << "from cache is" << naturalSize;
} }
} }
@ -356,18 +357,18 @@ QPixmap SvgPrivate::findInCache(const QString &elementId, qreal ratio, const QSi
id.append(actualElementId); id.append(actualElementId);
} }
//qDebug() << "id is " << id; //qCDebug(LOG_PLASMA) << "id is " << id;
QPixmap p; QPixmap p;
if (cacheRendering && cacheAndColorsTheme()->findInCache(id, p, lastModified)) { if (cacheRendering && cacheAndColorsTheme()->findInCache(id, p, lastModified)) {
p.setDevicePixelRatio(ratio); p.setDevicePixelRatio(ratio);
//qDebug() << "found cached version of " << id << p.size(); //qCDebug(LOG_PLASMA) << "found cached version of " << id << p.size();
return p; return p;
} }
//qDebug() << "didn't find cached version of " << id << ", so re-rendering"; //qCDebug(LOG_PLASMA) << "didn't find cached version of " << id << ", so re-rendering";
//qDebug() << "size for " << actualElementId << " is " << s; //qCDebug(LOG_PLASMA) << "size for " << actualElementId << " is " << s;
// we have to re-render this puppy // we have to re-render this puppy
createRenderer(); createRenderer();
@ -410,7 +411,7 @@ void SvgPrivate::createRenderer()
return; return;
} }
//qDebug() << kBacktrace(); //qCDebug(LOG_PLASMA) << kBacktrace();
if (themed && path.isEmpty() && !themeFailed) { if (themed && path.isEmpty() && !themeFailed) {
Applet *applet = qobject_cast<Applet *>(q->parent()); Applet *applet = qobject_cast<Applet *>(q->parent());
//FIXME: this maybe could be more efficient if we knew if the package was empty, e.g. for //FIXME: this maybe could be more efficient if we knew if the package was empty, e.g. for
@ -429,14 +430,14 @@ void SvgPrivate::createRenderer()
path = actualTheme()->imagePath(themePath); path = actualTheme()->imagePath(themePath);
themeFailed = path.isEmpty(); themeFailed = path.isEmpty();
if (themeFailed) { if (themeFailed) {
qWarning() << "No image path found for" << themePath; qCWarning(LOG_PLASMA) << "No image path found for" << themePath;
} }
} }
} }
//qDebug() << "********************************"; //qCDebug(LOG_PLASMA) << "********************************";
//qDebug() << "FAIL! **************************"; //qCDebug(LOG_PLASMA) << "FAIL! **************************";
//qDebug() << path << "**"; //qCDebug(LOG_PLASMA) << path << "**";
QString styleSheet = cacheAndColorsTheme()->d->svgStyleSheet(colorGroup); QString styleSheet = cacheAndColorsTheme()->d->svgStyleSheet(colorGroup);
styleCrc = qChecksum(styleSheet.toUtf8(), styleSheet.size()); styleCrc = qChecksum(styleSheet.toUtf8(), styleSheet.size());
@ -444,7 +445,7 @@ void SvgPrivate::createRenderer()
QHash<QString, SharedSvgRenderer::Ptr>::const_iterator it = s_renderers.constFind(styleCrc + path); QHash<QString, SharedSvgRenderer::Ptr>::const_iterator it = s_renderers.constFind(styleCrc + path);
if (it != s_renderers.constEnd()) { if (it != s_renderers.constEnd()) {
//qDebug() << "gots us an existing one!"; //qCDebug(LOG_PLASMA) << "gots us an existing one!";
renderer = it.value(); renderer = it.value();
} else { } else {
if (path.isEmpty()) { if (path.isEmpty()) {
@ -639,7 +640,7 @@ QRectF SvgPrivate::makeUniform(const QRectF &orig, const QRectF &dst)
res.setHeight(res.height() + offset); res.setHeight(res.height() + offset);
} }
//qDebug()<<"Aligning Rects, origin:"<<orig<<"destination:"<<dst<<"result:"<<res; //qCDebug(LOG_PLASMA)<<"Aligning Rects, origin:"<<orig<<"destination:"<<dst<<"result:"<<res;
return res; return res;
} }
@ -660,7 +661,7 @@ void SvgPrivate::themeChanged()
setImagePath(currentPath); setImagePath(currentPath);
q->resize(); q->resize();
//qDebug() << themePath << ">>>>>>>>>>>>>>>>>> theme changed"; //qCDebug(LOG_PLASMA) << themePath << ">>>>>>>>>>>>>>>>>> theme changed";
emit q->repaintNeeded(); emit q->repaintNeeded();
} }
@ -671,7 +672,7 @@ void SvgPrivate::colorsChanged()
} }
eraseRenderer(); eraseRenderer();
//qDebug() << "repaint needed from colorsChanged"; //qCDebug(LOG_PLASMA) << "repaint needed from colorsChanged";
// in the case the theme follows the desktop settings, refetch the colorschemes // in the case the theme follows the desktop settings, refetch the colorschemes
// and discard the svg pixmap cache // and discard the svg pixmap cache
@ -913,7 +914,7 @@ bool Svg::containsMultipleImages() const
void Svg::setImagePath(const QString &svgFilePath) void Svg::setImagePath(const QString &svgFilePath)
{ {
if (d->setImagePath(svgFilePath)) { if (d->setImagePath(svgFilePath)) {
//qDebug() << "repaintNeeded"; //qCDebug(LOG_PLASMA) << "repaintNeeded";
emit repaintNeeded(); emit repaintNeeded();
} }
} }

View File

@ -43,6 +43,7 @@
#include <qstandardpaths.h> #include <qstandardpaths.h>
#include "private/packages_p.h" #include "private/packages_p.h"
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -149,7 +150,7 @@ QString Theme::imagePath(const QString &name) const
// look for a compressed svg file in the theme // look for a compressed svg file in the theme
if (name.contains(QLatin1String("../")) || name.isEmpty()) { if (name.contains(QLatin1String("../")) || name.isEmpty()) {
// we don't support relative paths // we don't support relative paths
//qDebug() << "Theme says: bad image path " << name; //qCDebug(LOG_PLASMA) << "Theme says: bad image path " << name;
return QString(); return QString();
} }
@ -180,7 +181,7 @@ QString Theme::imagePath(const QString &name) const
/* /*
if (path.isEmpty()) { if (path.isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "Theme says: bad image path " << name; // qCDebug(LOG_PLASMA) << "Theme says: bad image path " << name;
#endif #endif
} }
*/ */
@ -230,19 +231,19 @@ QString Theme::wallpaperPath(const QSize &size) const
if (fullPath.isEmpty()) { if (fullPath.isEmpty()) {
// we failed to find it in the theme, so look in the standard directories // we failed to find it in the theme, so look in the standard directories
//qDebug() << "looking for" << image; //qCDebug(LOG_PLASMA) << "looking for" << image;
fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + image); fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + image);
} }
if (fullPath.isEmpty()) { if (fullPath.isEmpty()) {
// we still failed to find it in the theme, so look for the default in // we still failed to find it in the theme, so look for the default in
// the standard directories // the standard directories
//qDebug() << "looking for" << defaultImage; //qCDebug(LOG_PLASMA) << "looking for" << defaultImage;
fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + defaultImage); fullPath = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("wallpapers/") + defaultImage);
if (fullPath.isEmpty()) { if (fullPath.isEmpty()) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "exhausted every effort to find a wallpaper."; // qCDebug(LOG_PLASMA) << "exhausted every effort to find a wallpaper.";
#endif #endif
} }
} }

View File

@ -19,6 +19,7 @@
#include <plasma/version.h> #include <plasma/version.h>
#include <QDebug> #include <QDebug>
#include "debug_p.h"
namespace Plasma namespace Plasma
{ {
@ -52,7 +53,7 @@ bool isPluginVersionCompatible(unsigned int version)
{ {
if (version == quint32(-1)) { if (version == quint32(-1)) {
// unversioned, just let it through // unversioned, just let it through
qWarning() << "unversioned plugin detected, may result in instability"; qCWarning(LOG_PLASMA) << "unversioned plugin detected, may result in instability";
return true; return true;
} }
@ -62,7 +63,7 @@ bool isPluginVersionCompatible(unsigned int version)
if (version < minVersion || version > maxVersion) { if (version < minVersion || version > maxVersion) {
#ifndef NDEBUG #ifndef NDEBUG
// qDebug() << "plugin is compiled against incompatible Plasma version " << version // qCDebug(LOG_PLASMA) << "plugin is compiled against incompatible Plasma version " << version
// << "This build is compatible with" << PLASMA_VERSION_MAJOR << ".0.0 (" << minVersion // << "This build is compatible with" << PLASMA_VERSION_MAJOR << ".0.0 (" << minVersion
// << ") to" << PLASMA_VERSION_STRING << "(" << maxVersion << ")"; // << ") to" << PLASMA_VERSION_STRING << "(" << maxVersion << ")";
#endif #endif