|
|
|
@ -1279,7 +1279,7 @@ void SearchDlg::slotOpen()
|
|
|
|
|
}
|
|
|
|
|
else if (item->uri().startsWith("knotes:/") )
|
|
|
|
|
{
|
|
|
|
|
slotOpenKNotes(item->uri().mid(9,22));
|
|
|
|
|
slotOpenKNotes(item->uri().mid(10,21));
|
|
|
|
|
}
|
|
|
|
|
else if (item->uri().startsWith("note:/")) {
|
|
|
|
|
KProcess *proc = new KProcess;
|
|
|
|
@ -1344,13 +1344,12 @@ void SearchDlg::slotOpenKAddressBook(const QString &uid)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SearchDlg::slotOpenKNotes(const QString ¬eid)
|
|
|
|
|
void SearchDlg::slotOpenKNotes(const QString& noteid)
|
|
|
|
|
{
|
|
|
|
|
if (ensureServiceRunning("knotes")) {
|
|
|
|
|
QByteArray data;
|
|
|
|
|
QDataStream arg(data, IO_WriteOnly);
|
|
|
|
|
arg << noteid;
|
|
|
|
|
|
|
|
|
|
kapp->dcopClient()->send("knotes","KNotesIface","showNote(QString)", data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1817,36 +1816,42 @@ static QLabel* dateSwitches[dateSwitchesCount] = {showAnyDate, showToday, showSi
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool SearchDlg::ensureServiceRunning(const QString & name)
|
|
|
|
|
bool SearchDlg::ensureServiceRunning(const QString& name)
|
|
|
|
|
{
|
|
|
|
|
QStringList URLs;
|
|
|
|
|
QByteArray data, replyData;
|
|
|
|
|
QCString replyType;
|
|
|
|
|
QDataStream arg(data, IO_WriteOnly);
|
|
|
|
|
arg << name << URLs;
|
|
|
|
|
|
|
|
|
|
if ( !kapp->dcopClient()->call( "klauncher", "klauncher", "start_service_by_desktop_name(QString,QStringList)",
|
|
|
|
|
data, replyType, replyData) ) {
|
|
|
|
|
qWarning( "call to klauncher failed.");
|
|
|
|
|
return false;
|
|
|
|
|
QCString appname = name.utf8();
|
|
|
|
|
if (kapp->dcopClient()->isApplicationRegistered(appname)) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
QDataStream reply(replyData, IO_ReadOnly);
|
|
|
|
|
else {
|
|
|
|
|
QStringList URLs;
|
|
|
|
|
QByteArray data, replyData;
|
|
|
|
|
QCString replyType;
|
|
|
|
|
QDataStream arg(data, IO_WriteOnly);
|
|
|
|
|
arg << name << URLs;
|
|
|
|
|
|
|
|
|
|
if ( !kapp->dcopClient()->call( "klauncher", "klauncher", "start_service_by_desktop_name(QString,QStringList)",
|
|
|
|
|
data, replyType, replyData) ) {
|
|
|
|
|
qWarning( "call to klauncher failed.");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
QDataStream reply(replyData, IO_ReadOnly);
|
|
|
|
|
|
|
|
|
|
if ( replyType != "serviceResult" )
|
|
|
|
|
{
|
|
|
|
|
qWarning( "unexpected result '%s' from klauncher.", replyType.data());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
int result;
|
|
|
|
|
QCString dcopName;
|
|
|
|
|
QString error;
|
|
|
|
|
reply >> result >> dcopName >> error;
|
|
|
|
|
if (result != 0)
|
|
|
|
|
{
|
|
|
|
|
qWarning("Error starting: %s", error.local8Bit().data());
|
|
|
|
|
return false;
|
|
|
|
|
if ( replyType != "serviceResult" )
|
|
|
|
|
{
|
|
|
|
|
qWarning( "unexpected result '%s' from klauncher.", replyType.data());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
int result;
|
|
|
|
|
QCString dcopName;
|
|
|
|
|
QString error;
|
|
|
|
|
reply >> result >> dcopName >> error;
|
|
|
|
|
if (result != 0)
|
|
|
|
|
{
|
|
|
|
|
qWarning("Error starting: %s", error.local8Bit().data());
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#include "searchdlg.moc"
|
|
|
|
|