本文整理汇总了C++中DCOPClient::remoteObjects方法的典型用法代码示例。如果您正苦于以下问题:C++ DCOPClient::remoteObjects方法的具体用法?C++ DCOPClient::remoteObjects怎么用?C++ DCOPClient::remoteObjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DCOPClient
的用法示例。
在下文中一共展示了DCOPClient::remoteObjects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateObjects
void AddAction::updateObjects()
{
QStringList names;
theObjects->clear();
uniqueProgramMap.clear();
nameProgramMap.clear();
DCOPClient *theClient = KApplication::kApplication()->dcopClient();
QCStringList theApps = theClient->registeredApplications();
for(QCStringList::iterator i = theApps.begin(); i != theApps.end(); ++i)
{
if(!QString(*i).find("anonymous")) continue;
if(!QString(*i).find(i18n( "anonymous" ))) continue;
QRegExp r("(.*)-[0-9]+");
QString name = r.exactMatch(QString(*i)) ? r.cap(1) : *i;
if(names.contains(name)) continue;
names += name;
KListViewItem *a = new KListViewItem(theObjects, name);
uniqueProgramMap[a] = name == QString(*i);
nameProgramMap[a] = *i;
QCStringList theObjects = theClient->remoteObjects(*i);
for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j)
if(*j != "ksycoca" && *j != "qt")// && getFunctions(*i, *j).count())
new KListViewItem(a, *j);
}
updateFunctions();
}
示例2: sendCommand
void DictApplet::sendCommand(const QCString &fun, const QString &data)
{
if (waiting > 0) {
waiting = 1;
delayedFunc = fun.copy();
delayedData = data;
return;
}
DCOPClient *client = kapp->dcopClient();
if (!client->isApplicationRegistered("kdict")) {
KApplication::startServiceByDesktopName("kdict");
waiting = 1;
delayedFunc = fun.copy();
delayedData = data;
QTimer::singleShot(100, this, SLOT(sendDelayedCommand()));
return;
} else {
QCStringList list = client->remoteObjects("kdict");
if (list.findIndex("KDictIface")==-1) {
waiting = 1;
delayedFunc = fun.copy();
delayedData = data;
QTimer::singleShot(100, this, SLOT(sendDelayedCommand()));
return;
}
}
client->send("kdict","default",fun,data);
}
示例3: updateDCOPObjects
void EditAction::updateDCOPObjects()
{
theDCOPObjects->clear();
DCOPClient *theClient = TDEApplication::kApplication()->dcopClient();
if(theDCOPApplications->currentText().isNull() || theDCOPApplications->currentText().isEmpty()) return;
QCStringList theObjects = theClient->remoteObjects(nameProgramMap[theDCOPApplications->currentText()].utf8());
if(!theObjects.size() && theDCOPApplications->currentText() == (*theAction).program()) theDCOPObjects->insertItem((*theAction).object());
for(QCStringList::iterator j = theObjects.begin(); j != theObjects.end(); ++j)
if(*j != "tdesycoca" && *j != "qt" && AddAction::getFunctions(nameProgramMap[theDCOPApplications->currentText()], *j).count())
theDCOPObjects->insertItem(TQString::fromUtf8(*j));
updateDCOPFunctions();
}
示例4: sendDelayedCommand
void DictApplet::sendDelayedCommand()
{
if (waiting > 100) { // timeout after ten seconds
waiting = 0;
return;
}
DCOPClient *client = kapp->dcopClient();
if (!client->isApplicationRegistered("kdict")) {
waiting++;
QTimer::singleShot(100, this, SLOT(sendDelayedCommand()));
return;
} else {
QCStringList list = client->remoteObjects("kdict");
if (list.findIndex("KDictIface")==-1) {
waiting++;
QTimer::singleShot(100, this, SLOT(sendDelayedCommand()));
return;
}
}
client->send("kdict","default",delayedFunc,delayedData);
waiting = 0;
}