Fix a couple more Qt 5.15 deprecation warnings (#10953)

* More {QString->Qt}::SkipEmptyParts
* QProcess::start: non-deprecated overload
This commit is contained in:
Carlo Teubner 2024-06-22 15:54:50 +01:00 committed by GitHub
parent 6b1ab1a5ed
commit 198889c7a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View File

@ -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();

View File

@ -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();
}