diff --git a/kcms/dateandtime/dtime.cpp b/kcms/dateandtime/dtime.cpp --- a/kcms/dateandtime/dtime.cpp +++ b/kcms/dateandtime/dtime.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -160,9 +159,11 @@ } else { path += QLatin1String("/bin:/usr/bin"); } - - foreach(const QString &possible_ntputility, QStringList() << "ntpdate" << "rdate" ) { - if( !((ntpUtility = KStandardDirs::findExe(possible_ntputility, path)).isEmpty()) ) { + + const auto path_list = path.split(QLatin1Char(':')); + const auto possible_ntputilities = {"ntpdate", "rdate"}; + for(const QString &possible_ntputility : possible_ntputilities) { + if( !((ntpUtility = QStandardPaths::findExecutable(possible_ntputility, path_list)).isEmpty()) ) { qDebug() << "ntpUtility = " << ntpUtility; return; } diff --git a/kcms/dateandtime/helper.cpp b/kcms/dateandtime/helper.cpp --- a/kcms/dateandtime/helper.cpp +++ b/kcms/dateandtime/helper.cpp @@ -227,7 +227,7 @@ void ClockHelper::toHwclock() { - QString hwclock = KStandardDirs::findExe(QStringLiteral("hwclock"), exePath); + QString hwclock = QStandardPaths::findExecutable(QStringLiteral("hwclock"), exePath.split(QLatin1Char(':'))); if (!hwclock.isEmpty()) { KProcess::execute(hwclock, QStringList() << QStringLiteral("--systohc")); }