KDE/kdelibs/plasma

Brian Pritchett batenkaitos at gmail.com
Tue Aug 17 10:44:46 CEST 2010


Oh strange, it worked here. I'll have to take another look at it.
On Tuesday, August 17, 2010 02:24:27 am laurent Montel wrote:
> On lundi 16 août 2010 21:02:04 Brian David Pritchett wrote:
> > SVN commit 1164453 by pritchett:
> > 
> > Added akonadi storage plugin loading.
> > 
> >  M  +31 -21    datacontainer.cpp
> >  M  +2 -2      private/datacontainer_p.h
> 
> Hi,
> could you verify these commit please ?
> plasma-desktop doesn't start here (I have 100% cpu here)
> 
> I reverted datacontainer.cpp and it works fine.
> 
> Regards
> 
> -----
> #0  QChar::cell (this=0x233db60) at
> ../../include/QtCore/../../src/corelib/tools/qchar.h:283
> #1  0x00007f6fcc126744 in operator<< (out=..., str=...) at
> tools/qstring.cpp:7249
> #2  0x00007f6fcc200185 in operator<< <QString> (s=..., l=...) at
> ../../include/QtCore/../../src/corelib/io/qdatastream.h:261
> #3  0x00007f6fcc1fff4d in operator<< (out=..., list=...) at
> ../../include/QtCore/../../src/corelib/tools/qstringlist.h:251
> #4  0x00007f6fcc1fe628 in QMetaType::save (stream=..., type=11,
> data=0x21fb7d8) at kernel/qmetatype.cpp:607
> #5  0x00007f6fcc2205ff in QVariant::save (this=0x21fb7d8, s=...) at
> kernel/qvariant.cpp:1998
> #6  0x00007f6fcc220699 in operator<< (s=..., p=...) at
> kernel/qvariant.cpp:2026 #7  0x00007f6fcfd48cf5 in
> Plasma::DataContainer::store (this=0x2334e90) at
> /home/laurent/kde/kde4/kdelibs/plasma/datacontainer.cpp:220
> #8  0x00007f6fcfd4c40c in Plasma::DataEngine::removeSource (this=0x233bcd0,
> source=...)
>     at /home/laurent/kde/kde4/kdelibs/plasma/dataengine.cpp:324
> #9  0x00007f6fcfd4e4b4 in Plasma::DataEngine::qt_metacall (this=0x233bcd0,
> _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>,
>     _a=0x7fff3cf7deb0) at
> /home/laurent/kde/kde4/kdelibs/build/plasma/dataengine.moc:128
> #10 0x00007f6faea98965 in ComicEngine::qt_metacall (this=0x233db60,
> _c=35485056, _id=0, _a=0x21d7578)
>     at /home/laurent/kde/kde4/kdeplasma-
> addons/build/dataengines/comic/comic.moc:75
> #11 0x00007f6fcc1f8103 in QMetaObject::metacall (object=0x233bcd0,
> cl=QMetaObject::InvokeMetaMethod, idx=7, argv=0x7fff3cf7deb0)
>     at kernel/qmetaobject.cpp:237
> #12 0x00007f6fcc20e50c in QMetaObject::activate (sender=0x2334e90,
> m=0x7f6fd013dba0, local_signal_index=1, argv=0x7fff3cf7deb0)
>     at kernel/qobject.cpp:3295
> #13 0x00007f6fcfd47fd5 in Plasma::DataContainer::becameUnused
> (this=0x233db60, _t1=<value optimized out>)
>     at /home/laurent/kde/kde4/kdelibs/build/plasma/datacontainer.moc:119
> #14 0x00007f6fcfd488b6 in Plasma::DataContainer::checkUsage
> (this=0x2334e90) at
> /home/laurent/kde/kde4/kdelibs/plasma/datacontainer.cpp:366
> #15 0x00007f6fcfd4cb43 in Plasma::DataEngine::query (this=0x233bcd0,
> source=...) at /home/laurent/kde/kde4/kdelibs/plasma/dataengine.cpp:148
> #16 0x00007f6fb19b210a in ComicApplet::init (this=0x1eb4030) at
> /home/laurent/kde/kde4/kdeplasma-addons/applets/comic/comic.cpp:146
> #17 0x00007f6fcfd308a0 in Plasma::ContainmentPrivate::initApplets
> (this=0x1ec4ab0)
>     at /home/laurent/kde/kde4/kdelibs/plasma/containment.cpp:451
> #18 0x00007f6fcfd447ac in Plasma::CoronaPrivate::importLayout
> (this=0x1883a90, conf=<value optimized out>,
>     mergeConfig=<value optimized out>) at
> /home/laurent/kde/kde4/kdelibs/plasma/corona.cpp:514
> #19 0x00007f6fcfd45413 in Plasma::Corona::loadLayout (this=0x18cacd0,
> configName=...)
>     at /home/laurent/kde/kde4/kdelibs/plasma/corona.cpp:451
> #20 0x00007f6fcfd46272 in Plasma::Corona::initializeLayout (this=0x18cacd0,
> configName=...)
>     at /home/laurent/kde/kde4/kdelibs/plasma/corona.cpp:354
> #21 0x00007f6fd1044060 in PlasmaApp::corona (this=0x17747f0)
>     at
> /home/laurent/kde/kde4/kdebase/workspace/plasma/desktop/shell/plasmaapp.cpp
> :800 #22 0x00007f6fd10444e3 in PlasmaApp::setupDesktop (this=0x17747f0) at
> /home/laurent/kde/kde4/kdebase/workspace/plasma/desktop/shell/plasmaapp.cpp
> :286 #23 0x00007f6fd1045f8e in PlasmaApp::qt_metacall (this=0x17747f0,
> _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>,
>     _a=0x7fff3cf7eb10) at
> /home/laurent/kde/kde4/kdebase/build/workspace/plasma/desktop/shell/plasmaa
> pp.moc:148 #24 0x00007f6fcc1f8103 in QMetaObject::metacall
> (object=0x17747f0, cl=QMetaObject::InvokeMetaMethod, idx=42,
> argv=0x7fff3cf7eb10)
>     at kernel/qmetaobject.cpp:237
> #25 0x00007f6fcc20e50c in QMetaObject::activate (sender=0x18b63b0,
> m=0x7f6fcc56b400, local_signal_index=0, argv=0x0)
>     at kernel/qobject.cpp:3295
> #26 0x00007f6fcc2180bb in QSingleShotTimer::timeout (this=0x18b63b0) at
> .moc/debug-shared/qtimer.moc:82
> #27 0x00007f6fcc217f8b in QSingleShotTimer::timerEvent (this=0x18b63b0) at
> kernel/qtimer.cpp:308
> #28 0x00007f6fcc209cd9 in QObject::event (this=0x18b63b0, e=0x7fff3cf7f3a0)
> at kernel/qobject.cpp:1212
> #29 0x00007f6fcb0204fc in QApplicationPrivate::notify_helper
> (this=0x178a4c0, receiver=0x18b63b0, e=0x7fff3cf7f3a0)
>     at kernel/qapplication.cpp:4306
> #30 0x00007f6fcb01da01 in QApplication::notify (this=0x17747f0,
> receiver=0x18b63b0, e=0x7fff3cf7f3a0) at kernel/qapplication.cpp:3710
> #31 0x00007f6fccf47336 in KApplication::notify (this=0x17747f0,
> receiver=0x18b63b0, event=0x7fff3cf7f3a0)
>     at /home/laurent/kde/kde4/kdelibs/kdeui/kernel/kapplication.cpp:310
> #32 0x00007f6fcc1eff8c in QCoreApplication::notifyInternal (this=0x17747f0,
> receiver=0x18b63b0, event=0x7fff3cf7f3a0)
> ---Type <return> to continue, or q <return> to quit---kmail(18298)
> KMail::ExpireJob::execute: ExpireJob: deleting unread older than 30 days
> kmail(18298) KMail::ExpireJob::execute: ExpireJob: deleting read older than
> 30 days
> kmail(18298) KMail::ExpireJob::execute: ExpireJob: starting to expire in
> folder "/home/laurent/Mail/.KDE.directory/kde-i18n-doc"
> 
> 
> 
> -----
> 
> > --- trunk/KDE/kdelibs/plasma/datacontainer.cpp #1164452:1164453
> > @@ -19,6 +19,7 @@
> > 
> >  #include "datacontainer.h"
> >  #include "private/datacontainer_p.h"
> >  #include "private/storage_p.h"
> > 
> > +#include "pluginloader.h"
> > 
> >  #include <kdebug.h>
> > 
> > @@ -198,36 +199,43 @@
> > 
> >      setNeedsToBeStored(false);
> > 
> > -    if (d->store == NULL) {
> > +    if (!d->store) {
> > +        QVariantList args;
> > +        args.insert(0, de->name());
> > +        d->store =
> > PluginLoader::pluginLoader()->loadService("akonadi_storage_plugin", args,
> > 0); +        if (!d->store) {
> > 
> >          d->store = new Storage(de->name(), 0);
> >      
> >      }
> > 
> > +    }
> > 
> >      KConfigGroup op = d->store->operationDescription("save");
> >      op.writeEntry("source", objectName());
> >      DataEngine::Data dataToStore = data();
> >      DataEngine::Data::const_iterator it = dataToStore.constBegin();
> > 
> > +
> > 
> >      while (it != dataToStore.constEnd() && dataToStore.constEnd() ==
> > 
> > data().constEnd()) { QVariant v = it.value();
> > -        if ((it.value().type() == QVariant::String) ||
> > (it.value().type() == QVariant::Int)) { -           
> > op.writeEntry("key", it.key()); -            op.writeEntry("data",
> > it.value());
> > -        } else {
> > 
> >              QByteArray b;
> >              QDataStream ds(&b, QIODevice::WriteOnly);
> >              ds << it.value();
> > 
> > -            op.writeEntry("key", "base64-" + it.key());
> > +        op.writeEntry("key", it.key());
> > 
> >              op.writeEntry("data", b.toBase64());
> >          
> >          }
> >          ++it;
> > 
> > -        if (d->store == NULL) {
> > +    if (!d->store) {
> > +        QVariantList args;
> > +        args.insert(0, de->name());
> > +        d->store =
> > PluginLoader::pluginLoader()->loadService("plasma_storage_akonadi", args,
> > 0); +        if (!d->store) {
> > 
> >              d->store = new Storage(de->name(), 0);
> >          
> >          }
> > 
> > +    }
> > 
> >          ServiceJob* job = d->store->startOperationCall(op);
> >          d->storeCount++;
> >          connect(job, SIGNAL(finished(KJob*)), this,
> > 
> > SLOT(storeJobFinished(KJob*))); }
> > -}
> > 
> > +
> > 
> >  void DataContainerPrivate::storeJobFinished(KJob* )
> >  {
> >  
> >      --storeCount;
> > 
> > @@ -243,10 +251,17 @@
> > 
> >      if (de == NULL) {
> >      
> >          return;
> >      
> >      }
> > 
> > -    Storage* store = new Storage(de->name(), 0);
> > -    KConfigGroup retrieveGroup =
> > store->operationDescription("retrieve"); +    if (!d->store) {
> > +        QVariantList args;
> > +        args.insert(0, de->name());
> > +        d->store =
> > PluginLoader::pluginLoader()->loadService("plasma_storage_akonadi", args,
> > 0); +        if (!d->store) {
> > +            d->store = new Storage(de->name(), 0);
> > +        }
> > +    }
> > +    KConfigGroup retrieveGroup =
> > d->store->operationDescription("retrieve");
> > retrieveGroup.writeEntry("source", objectName());
> > -    ServiceJob* retrieveJob = store->startOperationCall(retrieveGroup);
> > +    ServiceJob* retrieveJob =
> > d->store->startOperationCall(retrieveGroup);
> > 
> >      connect(retrieveJob, SIGNAL(result(KJob*)), this,
> >      
> >              SLOT(populateFromStoredData(KJob*)));
> >  
> >  }
> > 
> > @@ -261,27 +276,22 @@
> > 
> >      ServiceJob* ret = dynamic_cast<ServiceJob*>(job);
> >      QHash<QString, QVariant> h = ret->result().toHash();
> >      foreach (QString key, h.keys()) {
> > 
> > -        if (key.startsWith("base64-")) {
> > 
> >              QByteArray b =
> > 
> > QByteArray::fromBase64(h[key].toString().toAscii()); QDataStream ds(&b,
> > QIODevice::ReadOnly);
> > 
> >              QVariant v(ds);
> >              key.remove(0, 7);
> >              dataToInsert.insert(key, v);
> > 
> > -        } else {
> > -            dataToInsert.insert(key, h[key]);
> > 
> >          }
> > 
> > -    }
> > 
> > -    if (!(data.isEmpty()))
> > -    {
> > 
> >          //Do not fill the source with old stored
> >          //data if it is already populated with new data.
> > 
> > -        return;
> > +    if (data.isEmpty())
> > +    {
> > +        data = dataToInsert;
> > +    //    dirty = true;
> > +    //    q->checkForUpdate();
> > 
> >      }
> > 
> > -    data = dataToInsert;
> > -    dirty = true;
> > -    q->checkForUpdate();
> > 
> >  }
> >  
> >  void DataContainer::disconnectVisualization(QObject *visualization)
> > 
> > --- trunk/KDE/kdelibs/plasma/private/datacontainer_p.h #1164452:1164453
> > @@ -35,7 +35,7 @@
> > 
> >  public:
> >      DataContainerPrivate(DataContainer *container)
> >      
> >          : q(container),
> > 
> > -          store(NULL),
> > +          store(0),
> > 
> >            dirty(false),
> >            cached(false),
> >            enableStorage(false),
> > 
> > @@ -66,7 +66,7 @@
> > 
> >      QMap<QObject *, SignalRelay *> relayObjects;
> >      QMap<uint, SignalRelay *> relays;
> >      QTime updateTs;
> > 
> > -    Storage* store;
> > +    Service* store;
> > 
> >      bool dirty : 1;
> >      bool cached : 1;
> >      bool enableStorage : 1;


More information about the Plasma-devel mailing list