From 5e86d20faec78759e00e184ef174344a483548b5 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 29 Jun 2023 15:28:50 +0200 Subject: [PATCH] CPaster: Avoid some FilePathAspect::value() uses Get in the way of splitting FilePathAspect from StringAspect. Change-Id: Ie2e55847a9242fa4042f37597321b8d77df7e8ad Reviewed-by: Christian Stenger --- src/plugins/cpaster/fileshareprotocol.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/cpaster/fileshareprotocol.cpp b/src/plugins/cpaster/fileshareprotocol.cpp index e9b85ee1af1..e67eac346a9 100644 --- a/src/plugins/cpaster/fileshareprotocol.cpp +++ b/src/plugins/cpaster/fileshareprotocol.cpp @@ -100,7 +100,7 @@ static bool parse(const QString &fileName, bool FileShareProtocol::checkConfiguration(QString *errorMessage) { - if (m_settings.path.value().isEmpty()) { + if (m_settings.path().isEmpty()) { if (errorMessage) *errorMessage = Tr::tr("Please configure a path."); return false; @@ -113,7 +113,7 @@ void FileShareProtocol::fetch(const QString &id) // Absolute or relative path name. QFileInfo fi(id); if (fi.isRelative()) - fi = QFileInfo(m_settings.path.value() + '/' + id); + fi = m_settings.path().pathAppended(id).toFileInfo(); QString errorMessage; QString text; if (parse(fi.absoluteFilePath(), &errorMessage, nullptr, nullptr, &text)) @@ -125,7 +125,7 @@ void FileShareProtocol::fetch(const QString &id) void FileShareProtocol::list() { // Read out directory, display by date (latest first) - QDir dir(m_settings.path.value(), tempGlobPatternC, + QDir dir(m_settings.path().toFSPathString(), tempGlobPatternC, QDir::Time, QDir::Files|QDir::NoDotAndDotDot|QDir::Readable); QStringList entries; QString user; @@ -160,7 +160,7 @@ void FileShareProtocol::paste( ) { // Write out temp XML file - Utils::TempFileSaver saver(m_settings.path.value() + '/' + tempPatternC); + Utils::TempFileSaver saver(m_settings.path().pathAppended(tempPatternC).toFSPathString()); saver.setAutoRemove(false); if (!saver.hasError()) { // Flat text sections embedded into pasterElement