当前位置: 首页>>代码示例>>C++>>正文


C++ QDBusInterface类代码示例

本文整理汇总了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);
}
开发者ID:gnuton,项目名称:QDe,代码行数:25,代码来源:sysmenu.cpp

示例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;
    }
}
开发者ID:KDE,项目名称:kinit,代码行数:28,代码来源:kinit_win.cpp

示例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;
}
开发者ID:donkey4u,项目名称:donkeyseed,代码行数:7,代码来源:plasmamule-dbus.cpp

示例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)));
    }
}
开发者ID:blue-shell,项目名称:folderview,代码行数:31,代码来源:kcookiesmain.cpp

示例5: QDBusInterface

void UnrestrictedModel::restartSysuid()
{
        QDBusInterface *unrestricted = new QDBusInterface("com.nokia.unrestricted", "/menuwindow", "com.nokia.unrestricted",
                                                          QDBusConnection::sessionBus(), this);
        unrestricted->call("resetMenuWidget");
        delete unrestricted;
}
开发者ID:CODeRUS,项目名称:duicontrolpanel-unrestricted-settings,代码行数:7,代码来源:unrestrictedplugin.cpp

示例6: userguide

void
ResetApplet::userGuide ()
{
    QDBusInterface userguide ("com.nokia.userguide", "/",
                              "com.nokia.UserGuideIf");
    userguide.call ("pageByPath", "tips.cfg");
    SYS_DEBUG ("");
}
开发者ID:dudochkin-victor,项目名称:touch-controlpanelapplets,代码行数:8,代码来源:resetapplet.cpp

示例7: OviStore

void
ThemeWidget::oviActivated ()
{
    static const char OviIf[] = "com.nokia.OviStoreClient";
    QDBusInterface OviStore (OviIf, "/", OviIf);

    OviStore.call ("LaunchWithKeyword", QString ("themes"));
}
开发者ID:deztructor,项目名称:meegotouch-controlpanelapplets,代码行数:8,代码来源:themewidget.cpp

示例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);
}
开发者ID:SamuelNevala,项目名称:contactsd,代码行数:10,代码来源:test-contactsd.cpp

示例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();
  }
}
开发者ID:deztructor,项目名称:meegotouch-systemui,代码行数:11,代码来源:profile.cpp

示例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);
	}
}
开发者ID:admiral0,项目名称:Antico-Deluxe,代码行数:12,代码来源:soundpref.cpp

示例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;
}
开发者ID:lenggi,项目名称:kcalcore,代码行数:13,代码来源:qskypedialer.cpp

示例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
}
开发者ID:kunwijik,项目名称:Spectroscopy_paper,代码行数:13,代码来源:sipQtDBusQDBusInterface.cpp

示例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;
}
开发者ID:quazgar,项目名称:kdepimlibs,代码行数:13,代码来源:qskypedialer.cpp

示例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();
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:51,代码来源:resourceview.cpp

示例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;
    }
}
开发者ID:g33kyaditya,项目名称:KDE-Now,代码行数:15,代码来源:datahandler.cpp


注:本文中的QDBusInterface类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。