本文整理汇总了C++中QDBusInterface类的典型用法代码示例。如果您正苦于以下问题:C++ QDBusInterface类的具体用法?C++ QDBusInterface怎么用?C++ QDBusInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QDBusInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void SystemMenu::onShowHideDock()
{
//qDebug() << "SYSMENU SHOW/HIDE DOCK";
int f = 0;
QAction *action = qobject_cast<QAction *>(sender());
if (app->dock->dockState == Dockbar::Normal) {
action->setText("Turn Hiding Off");
app->dock->setAutoHide(true);
f = 1;
} else if (app->dock->dockState == Dockbar::Hidden) {
//app->dock->animateShow();
app->dock->setAutoHide(false);
action->setText("Turn Hiding On");
f = 0;
}
// Notify AnticoDeluxe WM for changing dock size
QDBusInterface *iface = new QDBusInterface("org.freedesktop.AnticoPref",
"/", "org.freedesktop.AnticoPref.WMCtrl",
QDBusConnection::sessionBus(), this);
if (!iface->isValid())
qDebug() << "NOT VALID INTERFACE" << qPrintable(QDBusConnection::sessionBus().lastError().message());
else
iface->call("callFunction", 30, f);
}
示例2: quitApplicationsOverDBus
void quitApplicationsOverDBus()
{
QDBusConnection connection = QDBusConnection::sessionBus();
QDBusConnectionInterface *bus = connection.interface();
const QStringList services = bus->registeredServiceNames();
foreach (const QString &service, services) {
if (service.startsWith(QLatin1String("org.freedesktop.DBus")) || service.startsWith(QLatin1Char(':'))) {
continue;
}
QDBusInterface *iface = new QDBusInterface(service,
QLatin1String("/MainApplication"),
QLatin1String("org.kde.KApplication"),
connection);
if (!iface->isValid()) {
if (verbose) {
fprintf(stderr, "invalid interface of service %s\n", service.toLatin1().data());
}
continue;
}
iface->call("quit");
if (iface->lastError().isValid()) {
if (verbose) {
fprintf(stderr, "killing %s with result\n", iface->lastError().message().toLatin1().data());
}
}
delete iface;
}
}
示例3: sendLinkToEngine
void sendLinkToEngine (QString link, int cat, QObject* obj, int debugChannel)
{
QDBusConnection bus = QDBusConnection::sessionBus();
QDBusInterface *interface = new QDBusInterface("org.amule.engine", "/Link", "org.amule.engine", bus, obj);
interface->call("engine_add_link", link, cat);
kDebug(debugChannel) << "Sent Link " << link << "with cat " << cat;
}
示例4: KCModule
KCookiesMain::KCookiesMain (QWidget* parent, const QVariantList&)
: KCModule (KioConfigFactory::componentData(), parent)
{
management = 0;
bool managerOK = true;
QDBusInterface kded ("org.kde.kded", "/kded", "org.kde.kded");
QDBusReply<bool> reply = kded.call ("loadModule", QString ("kcookiejar"));
if (!reply.isValid()) {
managerOK = false;
kDebug (7103) << "kcm_kio: KDED could not load KCookiejar!";
KMessageBox::sorry (0, i18n ("Unable to start the cookie handler service.\n"
"You will not be able to manage the cookies that "
"are stored on your computer."));
}
QVBoxLayout* layout = new QVBoxLayout (this);
tab = new QTabWidget (this);
layout->addWidget (tab);
policies = new KCookiesPolicies (componentData(), this);
tab->addTab (policies, i18n ("&Policy"));
connect (policies, SIGNAL (changed (bool)), SIGNAL (changed (bool)));
if (managerOK) {
management = new KCookiesManagement (componentData(), this);
tab->addTab (management, i18n ("&Management"));
connect (management, SIGNAL (changed (bool)), SIGNAL (changed (bool)));
}
}
示例5: QDBusInterface
void UnrestrictedModel::restartSysuid()
{
QDBusInterface *unrestricted = new QDBusInterface("com.nokia.unrestricted", "/menuwindow", "com.nokia.unrestricted",
QDBusConnection::sessionBus(), this);
unrestricted->call("resetMenuWidget");
delete unrestricted;
}
示例6: userguide
void
ResetApplet::userGuide ()
{
QDBusInterface userguide ("com.nokia.userguide", "/",
"com.nokia.UserGuideIf");
userguide.call ("pageByPath", "tips.cfg");
SYS_DEBUG ("");
}
示例7: OviStore
void
ThemeWidget::oviActivated ()
{
static const char OviIf[] = "com.nokia.OviStoreClient";
QDBusInterface OviStore (OviIf, "/", OviIf);
OviStore.call ("LaunchWithKeyword", QString ("themes"));
}
示例8: host
void TestContactsd::importTest()
{
const QString host("com.nokia.contactsd");
QDBusConnection bus = QDBusConnection::sessionBus();
QDBusInterface *interface = new QDBusInterface("com.nokia.contactsd",
"/","com.nokia.contacts.importprogress",bus,this);
QDBusReply<QStringList> result = interface->call("hasActiveImports");
QVERIFY2(result.isValid() == true, result.error().message().toLatin1());
QCOMPARE(result.value().count(), 0);
}
示例9: launcher
void Profile::showProfileDialog()
{
QDBusInterface launcher ("com.nokia.DuiControlPanel", "/",
"com.nokia.DuiControlPanelIf");
launcher.call ("appletPage", "Profile");
// Hide the status indicator menu
if(MStatusIndicatorMenuInterface *menu = plugin->statusIndicatorMenuInterface()) {
menu->hideStatusIndicatorMenu();
}
}
示例10: QDBusInterface
void SoundPref::onChangeDevices()
{
// Notify AnticoDeluxe WM for changing sound devices
QDBusInterface *iface = new QDBusInterface("org.freedesktop.AnticoDeluxe",
"/", "org.freedesktop.AnticoDeluxe.WMCtrl",
QDBusConnection::sessionBus(), this);
if (!iface->isValid())
qDebug() << "NOT VALID INTERFACE" << qPrintable(QDBusConnection::sessionBus().lastError().message());
else {
iface->call("changeSoundDevices", mixerCard, mixerDevice);
}
}
示例11: searchSkypeDBusInterface
static QDBusInterface* searchSkypeDBusInterface()
{
const QLatin1String service( "com.Skype.API" );
const QLatin1String path( "/com/Skype" );
QDBusInterface *interface = new QDBusInterface( service, path, QString(), QDBusConnection::systemBus() );
if ( !interface->isValid() ) {
delete interface;
interface = new QDBusInterface( service, path, QString(), Akonadi::DBusConnectionPool::threadConnection() );
}
return interface;
}
示例12: release_QDBusInterface
static void release_QDBusInterface(void *sipCppV,int)
{
QDBusInterface *sipCpp = reinterpret_cast<QDBusInterface *>(sipCppV);
Py_BEGIN_ALLOW_THREADS
if (QThread::currentThread() == sipCpp->thread())
delete sipCpp;
else
sipCpp->deleteLater();
Py_END_ALLOW_THREADS
}
示例13: service
static QDBusInterface *searchSkypeDBusInterface()
{
const QString service(QStringLiteral("com.Skype.API"));
const QString path(QStringLiteral("/com/Skype"));
QDBusInterface *interface = new QDBusInterface(service, path, QString(), QDBusConnection::sessionBus());
if (!interface->isValid()) {
delete interface;
interface = new QDBusInterface(service, path, QString(), KDBusConnectionPool::threadConnection());
}
return interface;
}
示例14: currentItem
void ResourceView::editResource()
{
bool ok = false;
ResourceItem *item = currentItem();
if ( !item ) {
return;
}
ResourceCalendar *resource = item->resource();
if ( item->isSubresource() ) {
if ( resource->type() == "imap" ) {
QString identifier = item->resourceIdentifier();
const QString newResourceName =
KInputDialog::getText( i18n( "Rename Calendar Folder" ),
i18n( "Please enter a new name for the calendar folder" ),
item->text(0),
&ok, this );
if ( !ok ) {
return;
}
QDBusConnection bus = QDBusConnection::sessionBus();
QDBusInterface *interface =
new QDBusInterface( "org.kde.kmail",
"/Groupware",
"org.kde.kmail.groupware",
bus,
this );
QDBusReply<int> reply =
interface->call( "changeResourceUIName", identifier, newResourceName );
if ( !reply.isValid() ) {
kDebug() << "DBUS Call changeResourceUIName() failed ";
}
} else {
const QString subResourceName = resource->labelForSubresource( item->resourceIdentifier() );
KMessageBox::sorry( this,
i18n ( "<qt>Cannot edit the calendar folder <b>%1</b>.</qt>",
subResourceName ) );
}
} else {
QPointer<KRES::ConfigDialog> dlg =
new KRES::ConfigDialog( this, QString( "calendar" ), resource );
if ( dlg->exec() ) {
item->setText( 0, resource->resourceName() );
mCalendar->resourceManager()->change( resource );
}
delete dlg;
}
emitResourcesChanged();
}
示例15: QDBusInterface
void DataHandler::startDaemon()
{
QDBusInterface* interface = new QDBusInterface("org.kde.kdenow", "/KDENow");
//Call a method, to start the kdenowd daemon if it hasn't yet started
QDBusReply< QString > reply = interface->call("startDaemon");
if (reply.isValid()) {
qDebug() << "Valid Reply received from org.kde.kdenow /KDENow";
qDebug() << reply.value();
}
else {
qDebug() << "Did not receive a valid reply from org.kde.kdenow /KDENow";
return;
}
}