DBus is ignoring me?

Martin Klapetek martin.klapetek at gmail.com
Fri Jun 17 14:25:43 CEST 2011


You're missing factories in your code. You need to set them before creating
the account manager, basically you tell Telepathy what features you want
from it(see main-widget.cpp:192 in kde-telepathy-contactlist)

--Marty


2011/6/17 Marc Mauri Alloza <marcmaurialloza at gmail.com>

> Hello,
>
> 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.
>
> Here is the code:
>
> main.cpp:
>
> #include <QApplication>
> #include "prova.hpp"
>
> int main(int argc, char *argv[] )
> {
>     QApplication app(argc, argv);
>
>     MyClass MC();
>
>     return app.exec();
> }
>
> prova.hpp:
>
> #ifndef PROVA_HPP
> #define PROVA_HPP
>
> #include <QObject>
> #include <TelepathyQt4/AccountManager>
>
> class MyClass : public QObject
>  {
>      Q_OBJECT
>
>  public:
>      MyClass(QObject *parent = 0);
>      ~MyClass() { }
>
>  private Q_SLOTS:
>      void onAccountManagerReady(Tp::PendingOperation*);
>
>  private:
>      Tp::AccountManagerPtr mAM;
>  };
>
> #endif
>
> prova.cpp:
>
> #ifndef PROVA_CPP
> #define PROVA_CPP
>
> #include <QDebug>
> #include <TelepathyQt4/AccountManager>
> #include <TelepathyQt4/PendingOperation>
> #include <TelepathyQt4/PendingReady>
> #include "prova.hpp"
>
>
>  MyClass::MyClass(QObject *parent)
>      : QObject(parent), mAM(Tp::AccountManager::create())
>  {
>
>      connect(mAM->becomeReady(),
>              SIGNAL(finished(Tp::PendingOperation*)),
>              SLOT(onAccountManagerReady(Tp::PendingOperation*)));
>  }
>
>  void MyClass::onAccountManagerReady(Tp::PendingOperation *op)
>  {
>      if (op->isError()) {
>          qWarning() << "Account manager cannot become ready:" <<
>              op->errorName() << "-" << op->errorMessage();
>          return;
>      }
>
>      // AccountManager is now ready
>      qDebug() << "All accounts:";
>
>
>      foreach (const Tp::AccountPtr &acc, mAM->allAccounts()) {
>          qDebug() << " path:" << acc->objectPath();
>      }
>  }
>
> #endif
>
> Maybe it's problem in telepathy's instalation. I'm in archlinux 64bit.
>
> Thank you.
>
>
> _______________________________________________
> KDE-Telepathy mailing list
> KDE-Telepathy at kde.org
> https://mail.kde.org/mailman/listinfo/kde-telepathy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-telepathy/attachments/20110617/1c3d06c7/attachment.htm 


More information about the KDE-Telepathy mailing list