do not use hardcoded date executable path while at it
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
{
QProcess prc;
prc.setReadChannel(QProcess::StandardOutput);
- if (prc.execute("/bin/date", QStringList() << "+%s" << "-d" << str))
+ prc.start("date", QStringList() << "+%s" << "-d" << str);
+ if (!prc.waitForFinished() || prc.exitCode() != 0)
return -1;
return prc.readAll().simplified().toInt();
}
const QString localPackageDir = KStandardDirs::locateLocal("xdgdata-mime", QString());
Q_ASSERT(!localPackageDir.isEmpty());
QProcess proc;
- if (!proc.execute("update-mime-database", QStringList() << localPackageDir)) {
+ proc.start("update-mime-database", QStringList() << localPackageDir);
+ if (!proc.waitForFinished() || proc.exitCode() != 0) {
kWarning() << "update-mime-database exited with error code" << proc.exitCode();
}
}
QObject::connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), &loop, SLOT(quit()));
QProcess proc;
proc.setProcessChannelMode(QProcess::MergedChannels); // silence kbuildsycoca output
- proc.execute(KStandardDirs::findExe(KBUILDSYCOCA_EXENAME));
+ proc.start(KStandardDirs::findExe(KBUILDSYCOCA_EXENAME));
+ proc.waitForFinished();
loop.exec();
}