mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: set the slave PID from Slave::createSlave()
if PID is not set then Slave::kill() is non-operational, note that it
was not done by the code before the klauncher rewrite (see
aa6b5ea4f0
)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
bceaae0470
commit
d3bf519674
1 changed files with 16 additions and 2 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <QtCore/QTimer>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QDir>
|
||||
|
||||
#include <kdebug.h>
|
||||
#include <klocale.h>
|
||||
|
@ -398,10 +399,23 @@ Slave* Slave::createSlave( const QString &protocol, const KUrl& url, int& error,
|
|||
return 0;
|
||||
}
|
||||
|
||||
const QStringList args = QStringList() << slaveexe << slaveAddress;
|
||||
kDebug() << "kioslave" << ", " << slaveexe << ", " << protocol << ", " << slaveAddress;
|
||||
|
||||
QProcess::startDetached( KStandardDirs::findExe("kioslave"), args );
|
||||
const QStringList slaveargs = QStringList() << slaveexe << slaveAddress;
|
||||
Q_PID slavepid = 0;
|
||||
const bool result = QProcess::startDetached(
|
||||
KStandardDirs::findExe("kioslave"),
|
||||
slaveargs,
|
||||
QDir::currentPath(),
|
||||
&slavepid
|
||||
);
|
||||
if (!result || !slavepid) {
|
||||
error_text = i18n("Can not start io-slave for protocol '%1'.", protocol);
|
||||
error = KIO::ERR_CANNOT_LAUNCH_PROCESS;
|
||||
delete slave;
|
||||
return 0;
|
||||
}
|
||||
slave->setPID(slavepid);
|
||||
|
||||
return slave;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue