Port away from deprecated KIO/KCM functions

Updated plugins/share/shareplugin.cpp:
 - KFileUtils::suggestName() is a drop-in replacement as of 5.64,
   just moved to another library
Updated plugins/findthisdevice/findthisdevice_config.cpp:
 - KCModule::markAsChanged() is likewise as of 5.64

Signed-off-by: Peter J. Mello <admin@petermello.net>
This commit is contained in:
Peter Mello 2019-12-20 00:23:49 +00:00 committed by Nicolas Fella
parent a47fbe7215
commit bc3c7567a7
2 changed files with 3 additions and 2 deletions

View file

@ -49,7 +49,7 @@ FindThisDeviceConfig::FindThisDeviceConfig(QWidget* parent, const QVariantList&
connect(m_ui->playSoundButton, &QToolButton::clicked, connect(m_ui->playSoundButton, &QToolButton::clicked,
this, &FindThisDeviceConfig::playSound); this, &FindThisDeviceConfig::playSound);
connect(m_ui->soundFileRequester, &KUrlRequester::textChanged, connect(m_ui->soundFileRequester, &KUrlRequester::textChanged,
this, QOverload<>::of(&FindThisDeviceConfig::changed)); this, &FindThisDeviceConfig::markAsChanged);
} }
FindThisDeviceConfig::~FindThisDeviceConfig() FindThisDeviceConfig::~FindThisDeviceConfig()

View file

@ -35,6 +35,7 @@
#include <KIO/Job> #include <KIO/Job>
#include <KIO/MkpathJob> #include <KIO/MkpathJob>
#include <KMimeTypeTrader> #include <KMimeTypeTrader>
#include <KFileUtils>
#include "core/filetransferjob.h" #include "core/filetransferjob.h"
#include "core/daemon.h" #include "core/daemon.h"
@ -73,7 +74,7 @@ QUrl SharePlugin::getFileDestination(const QString filename) const
QUrl destination(dir); QUrl destination(dir);
destination.setPath(dir.path() + QStringLiteral("/") + filename, QUrl::DecodedMode); destination.setPath(dir.path() + QStringLiteral("/") + filename, QUrl::DecodedMode);
if (destination.isLocalFile() && QFile::exists(destination.toLocalFile())) { if (destination.isLocalFile() && QFile::exists(destination.toLocalFile())) {
destination.setPath(dir.path() + QStringLiteral("/") + KIO::suggestName(dir, filename), QUrl::DecodedMode); destination.setPath(dir.path() + QStringLiteral("/") + KFileUtils::suggestName(dir, filename), QUrl::DecodedMode);
} }
return destination; return destination;
} }