Hello,<br><br>I'm in SoK and my mentor asked my to write a chat application. I'm trying to write an app that lists the accounts, it compiles but it doesn't work i think dbus is not doing his job.<br><br>Here is the code:<br>
<br>main.cpp:<br><br>#include <QApplication><br>#include "prova.hpp"<br><br>int main(int argc, char *argv[] )<br>{ <br> QApplication app(argc, argv);<br> <br> MyClass MC();<br> <br> return app.exec();<br>
}<br><br>prova.hpp:<br><br>#ifndef PROVA_HPP<br>#define PROVA_HPP<br><br>#include <QObject><br>#include <TelepathyQt4/AccountManager><br><br>class MyClass : public QObject<br> {<br> Q_OBJECT<br><br> public:<br>
MyClass(QObject *parent = 0);<br> ~MyClass() { }<br><br> private Q_SLOTS:<br> void onAccountManagerReady(Tp::PendingOperation*);<br><br> private:<br> Tp::AccountManagerPtr mAM;<br> };<br><br>#endif<br><br>
prova.cpp:<br><br>#ifndef PROVA_CPP<br>#define PROVA_CPP<br><br>#include <QDebug><br>#include <TelepathyQt4/AccountManager><br>#include <TelepathyQt4/PendingOperation><br>#include <TelepathyQt4/PendingReady><br>
#include "prova.hpp"<br><br><br> MyClass::MyClass(QObject *parent)<br> : QObject(parent), mAM(Tp::AccountManager::create())<br> {<br> <br> connect(mAM->becomeReady(),<br> SIGNAL(finished(Tp::PendingOperation*)),<br>
SLOT(onAccountManagerReady(Tp::PendingOperation*)));<br> }<br><br> void MyClass::onAccountManagerReady(Tp::PendingOperation *op)<br> {<br> if (op->isError()) {<br> qWarning() << "Account manager cannot become ready:" <<<br>
op->errorName() << "-" << op->errorMessage();<br> return;<br> }<br><br> // AccountManager is now ready<br> qDebug() << "All accounts:";<br> <br>
<br> foreach (const Tp::AccountPtr &acc, mAM->allAccounts()) {<br> qDebug() << " path:" << acc->objectPath();<br> }<br> }<br> <br>#endif<br><br>Maybe it's problem in telepathy's instalation. I'm in archlinux 64bit.<br>
<br>Thank you.<br><br>