Changeset View
Changeset View
Standalone View
Standalone View
src/core/slave.cpp
Show First 20 Lines • Show All 493 Lines • ▼ Show 20 Line(s) | 483 | if (forkSlaves() == 1) { | |||
---|---|---|---|---|---|
494 | QString lib_path = KPluginLoader::findPlugin(_name); | 494 | QString lib_path = KPluginLoader::findPlugin(_name); | ||
495 | if (lib_path.isEmpty()) { | 495 | if (lib_path.isEmpty()) { | ||
496 | error_text = i18n("Can not find io-slave for protocol '%1'.", protocol); | 496 | error_text = i18n("Can not find io-slave for protocol '%1'.", protocol); | ||
497 | error = KIO::ERR_CANNOT_CREATE_SLAVE; | 497 | error = KIO::ERR_CANNOT_CREATE_SLAVE; | ||
498 | delete slave; | 498 | delete slave; | ||
499 | return nullptr; | 499 | return nullptr; | ||
500 | } | 500 | } | ||
501 | 501 | | |||
502 | #ifdef Q_OS_WIN | ||||
503 | const QString kioslaveName = QStringLiteral("kioslave5"); | ||||
504 | #else | ||||
505 | const QString kioslaveName = QStringLiteral("kioslave"); | ||||
506 | #endif | ||||
502 | const QStringList args = QStringList() << lib_path << protocol << QLatin1String("") << slaveAddress.toString(); | 507 | const QStringList args = QStringList() << lib_path << protocol << QLatin1String("") << slaveAddress.toString(); | ||
503 | //qDebug() << "kioslave" << ", " << lib_path << ", " << protocol << ", " << QString() << ", " << slaveAddress; | 508 | //qDebug() << kioslaveName << ", " << lib_path << ", " << protocol << ", " << QString() << ", " << slaveAddress; | ||
504 | 509 | | |||
505 | // search paths | 510 | // search paths | ||
506 | const QStringList searchPaths = QStringList() | 511 | const QStringList searchPaths = QStringList() | ||
507 | << QCoreApplication::applicationDirPath() // then look where our application binary is located | 512 | << QCoreApplication::applicationDirPath() // then look where our application binary is located | ||
508 | << QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) // look where libexec path is (can be set in qt.conf) | 513 | << QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) // look where libexec path is (can be set in qt.conf) | ||
509 | << QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5); // look at our installation location | 514 | << QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5); // look at our installation location | ||
510 | const QString kioslaveExecutable = QStandardPaths::findExecutable(QStringLiteral("kioslave"), searchPaths); | 515 | const QString kioslaveExecutable = QStandardPaths::findExecutable(kioslaveName, searchPaths); | ||
511 | if (kioslaveExecutable.isEmpty()) { | 516 | if (kioslaveExecutable.isEmpty()) { | ||
512 | error_text = i18n("Can not find 'kioslave' executable at '%1'", searchPaths.join(QStringLiteral(", "))); | 517 | error_text = i18n("Can not find 'kioslave' executable at '%1'", searchPaths.join(QStringLiteral(", "))); | ||
513 | error = KIO::ERR_CANNOT_CREATE_SLAVE; | 518 | error = KIO::ERR_CANNOT_CREATE_SLAVE; | ||
514 | delete slave; | 519 | delete slave; | ||
515 | return nullptr; | 520 | return nullptr; | ||
516 | 521 | | |||
517 | } | 522 | } | ||
518 | QProcess::startDetached(kioslaveExecutable, args); | 523 | QProcess::startDetached(kioslaveExecutable, args); | ||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |