You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

  • "David Boosalis" started this thread

Posts: 10

Location: Fresno California, USA

  • Send private message

1

Tuesday, July 20th 2004, 7:43pm

DCOP 101 - some basics

I would like to use KDE's dcop API to send a request to konquer. I think it will be something like:
DCopClient *dcopClient = KApplication::dcopClient();
dcopClient->send("konqueor"
if (dcopClient) {
dcopClient->send("konqueror-3741",
"konqueror-mainwindow#1",
"openURL",
"www.ibm.com/developerWorks");
}


If I do this from the command line it works.

Also how can I dtermine the id, if any for konqueror are available, and is there a good way to start a konqueor session if none exists.


Thank you for any help you can provide.
QT Developer

  • "David Boosalis" started this thread

Posts: 10

Location: Fresno California, USA

  • Send private message

2

Tuesday, July 20th 2004, 9:29pm

Figured it out. I had the third parameter wrong it should have been
openUrl(QString) and not openURL();

If anyone is interested this is how I found the id, as you cannot know it apriori

DCOPClient *dcopClient = KApplication::dcopClient();
if (dcopClient) {
QCStringList csl = dcopClient->registeredApplications();
QCStringList::iterator it;
for(it = csl.begin();it != csl.end();++it) {
cstr = *it;
qDebug("looking at: " + cstr);
if (cstr.contains("konqueror")) {
qDebug("Found browser = " + cstr);
found = TRUE;
break;
}
}
qDebug("Num of registered dcop clinets = %d",csl.count());
qDebug("Send message");
if (found) {
status = dcopClient->send(cstr,
"konqueror-mainwindow#1",
"openURL(QString)",
"www.ibm.com");
qDebug("staus of send = %d",status);

....


Now only one problem remains. If konqueor is closed there seems to be a phantom version of it kep running. That is when you look at kdcop, one copy stays there, in fact when you start another konquer session it is this same one.

but if it is not shown, and you send it a DCOP message your SOL. So how do you make a konquer session visible ????
QT Developer

  • "David Boosalis" started this thread

Posts: 10

Location: Fresno California, USA

  • Send private message

3

Tuesday, July 20th 2004, 10:54pm

More good news

Well I found out out how open a window with a phantom konqueror session.
Instead of calling openURL, call openBrowserWindow. This will open up a brand new window.

DCOPS is very cool

Now if I could just get a handle on using KParts ?
QT Developer