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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel