diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-03-21 15:35:44 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-04-21 17:18:09 +0200 |
commit | 00ff2b06a17e90921d79831a62e95eecf8c6954a (patch) | |
tree | 40877b8e595eda601252c995f57d1dd3166c8cd3 /src/designer/src/lib/shared/qtresourceeditordialog.cpp | |
parent | 6b7f6990aa1abed20c260a2eb2869f39ce59f8f7 (diff) | |
download | qttools-00ff2b06a17e90921d79831a62e95eecf8c6954a.tar.gz |
Qt Designer: Replace QLatin1Char by modern literals
Pick-to: 6.5
Change-Id: Ied11784e840d03542a5db281590729838ed625c3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/designer/src/lib/shared/qtresourceeditordialog.cpp')
-rw-r--r-- | src/designer/src/lib/shared/qtresourceeditordialog.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/designer/src/lib/shared/qtresourceeditordialog.cpp b/src/designer/src/lib/shared/qtresourceeditordialog.cpp index 588d7e3c7..3a9c7cac3 100644 --- a/src/designer/src/lib/shared/qtresourceeditordialog.cpp +++ b/src/designer/src/lib/shared/qtresourceeditordialog.cpp @@ -1302,8 +1302,6 @@ void QtResourceEditorDialogPrivate::slotTreeViewItemChanged(QStandardItem *item) QString QtResourceEditorDialogPrivate::getSaveFileNameWithExtension(QWidget *parent, const QString &title, QString dir, const QString &filter, const QString &extension) const { - const QChar dot = QLatin1Char('.'); - QString saveFile; while (true) { saveFile = m_dlgGui->getSaveFileName(parent, title, dir, filter, nullptr, QFileDialog::DontConfirmOverwrite); @@ -1311,10 +1309,8 @@ QString QtResourceEditorDialogPrivate::getSaveFileNameWithExtension(QWidget *par return saveFile; const QFileInfo fInfo(saveFile); - if (fInfo.suffix().isEmpty() && !fInfo.fileName().endsWith(dot)) { - saveFile += dot; - saveFile += extension; - } + if (fInfo.suffix().isEmpty() && !fInfo.fileName().endsWith(u'.')) + saveFile += u'.' + extension; const QFileInfo fi(saveFile); if (!fi.exists()) @@ -1657,7 +1653,7 @@ void QtResourceEditorDialogPrivate::slotClonePrefix() QDir dir(fi.dir()); QString oldSuffix = fi.completeSuffix(); if (!oldSuffix.isEmpty()) - oldSuffix = QLatin1Char('.') + oldSuffix; + oldSuffix = u'.' + oldSuffix; const QString newBaseName = fi.baseName() + suffix + oldSuffix; const QString newPath = QDir::cleanPath(dir.filePath(newBaseName)); m_qrcManager->insertResourceFile(newResourcePrefix, newPath, @@ -2056,13 +2052,13 @@ QString QtResourceEditorDialog::selectedResource() const if (!currentResourcePrefix) return QString(); - const QChar slash(QLatin1Char('/')); + const QChar slash(u'/'); QString resource = currentResourcePrefix->prefix(); if (!resource.startsWith(slash)) resource.prepend(slash); if (!resource.endsWith(slash)) resource.append(slash); - resource.prepend(QLatin1Char(':')); + resource.prepend(u':'); QtResourceFile *currentResourceFile = d_ptr->getCurrentResourceFile(); if (!currentResourceFile) |