PDA

View Full Version : listing the applications running on system, using qtdbus



mj
13th February 2012, 06:44
Hi,
using below sample code im able to list all the dbus services running in my system.
I want to list all the application (like- video player, chat apps, browser.) running in my system, is their any api or tutorial which explains it.



#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QStringList>
#include <QtDBus/QtDBus>
int main (int argc, char **argv)
{
// listing all registered service names.
QCoreApplication app(argc, argv);
QObject *myObject;
QDBusConnection bus = QDBusConnection::sessionBus();
QStringList serviceNames = bus.interface()->registeredServiceNames();
qDebug() << serviceNames;
return 0;
}


thanks.