From 198889c7a421e868d2ac9791d9ccfb60b33655de Mon Sep 17 00:00:00 2001 From: Carlo Teubner Date: Sat, 22 Jun 2024 15:54:50 +0100 Subject: [PATCH] Fix a couple more Qt 5.15 deprecation warnings (#10953) * More {QString->Qt}::SkipEmptyParts * QProcess::start: non-deprecated overload --- src/core/Entry.cpp | 4 ++-- src/gui/remote/RemoteProcess.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index d0f9509c9..b05650c6e 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -443,7 +443,7 @@ int Entry::size() const size += autoTypeAssociations()->associationsSize(); size += attachments()->attachmentsSize(); size += customData()->dataSize(); - for (const QString& tag : tags().split(TagDelimiterRegex, QString::SkipEmptyParts)) { + for (const QString& tag : tags().split(TagDelimiterRegex, Qt::SkipEmptyParts)) { size += tag.toUtf8().size(); } @@ -672,7 +672,7 @@ void Entry::setOverrideUrl(const QString& url) void Entry::setTags(const QString& tags) { - auto taglist = tags.split(TagDelimiterRegex, QString::SkipEmptyParts); + auto taglist = tags.split(TagDelimiterRegex, Qt::SkipEmptyParts); // Trim whitespace before/after tag text for (auto& tag : taglist) { tag = tag.trimmed(); diff --git a/src/gui/remote/RemoteProcess.cpp b/src/gui/remote/RemoteProcess.cpp index 33c0614d5..6b2f60717 100644 --- a/src/gui/remote/RemoteProcess.cpp +++ b/src/gui/remote/RemoteProcess.cpp @@ -36,7 +36,17 @@ void RemoteProcess::setTempFileLocation(const QString& tempFile) void RemoteProcess::start(const QString& command) { - m_process->start(resolveTemplateVariables(command)); + const QString commandResolved = resolveTemplateVariables(command); +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + QStringList cmdList = QProcess::splitCommand(commandResolved); + if (!cmdList.isEmpty()) { + const QString program = cmdList.takeFirst(); + m_process->start(program, cmdList); + } +#else + m_process->start(resolveTemplateVariables(commandResolved)); +#endif + m_process->waitForStarted(); }