plasma dataengine question

Aaron J. Seigo aseigo at kde.org
Mon Mar 14 17:51:54 CET 2011


On Tuesday, March 15, 2011, Farhad Hedayati-Fard wrote:
> Hi!
> I've written a translation dataengine... It needs 3 arguments to initialize
> the translator object ( plugin name, source language and destination
> language). I've put a Q_ASSERT on args.size() in dataengine's constructor
> but now I can't test my dataengine using plasmaengineexplorer because it
> crashes on the Q_ASSERT (no argument is passed to the constructor):
> 
> TranslatorEngine::TranslatorEngine(QObject* parent, const QVariantList&
> args): DataEngine(parent, args)
> {
>    Q_ASSERT(args.size() >= 3);
>    QString from = args[0].toString();
>    QString to = args[1].toString();
>    QString name = args[2].toString();
>    translator = new Translator((QWidget*)this, from, to, name);
>    ....
> }
> 
> What should I do to get this working??

the args passed in are currently always empty for the DataEngine constructor.

perhaps the misunderstanding here is that there is only ever one instance of 
the DataEngine loaded, and that one engine hosts multiple sources of data.

information such as the to/from language should be encoded in the source name, 
e.g. "en:de:flower" (which might have as its data: "Blume"). the DataEngine 
would process these requests in sourceRequestEvent.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20110314/8fb9ac04/attachment-0001.sig 


More information about the Plasma-devel mailing list