summaryrefslogtreecommitdiffstats
path: root/src/plugins/platformthemes
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-04-12 17:33:01 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-05-02 23:38:46 +0000
commit7c9c195235378c2619d140bccbb957ba1d7a7dea (patch)
treef9bb54b9f713aaf0822401d5af80ebdfbf6f5bbd /src/plugins/platformthemes
parente65e3f3021db90ffd236f9aa4bc3dd43b89a0ec8 (diff)
Plugins: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: Id76add7e86b6dfb89f758a9efb0644067f0f44de Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/plugins/platformthemes')
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp2
-rw-r--r--src/plugins/platformthemes/gtk3/qgtk3menu.cpp16
-rw-r--r--src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
index 9d22f0b701..9ffd5fd496 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
@@ -521,7 +521,7 @@ void QGtk3FileDialogHelper::setNameFilters(const QStringList &filters)
foreach (const QString &filter, filters) {
GtkFileFilter *gtkFilter = gtk_file_filter_new();
- const QString name = filter.left(filter.indexOf(QLatin1Char('(')));
+ const QString name = filter.left(filter.indexOf(u'('));
const QStringList extensions = cleanFilterList(filter);
gtk_file_filter_set_name(gtkFilter, qUtf8Printable(name.isEmpty() ? extensions.join(QLatin1String(", ")) : name));
diff --git a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
index 8726708917..50eb790340 100644
--- a/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
+++ b/src/plugins/platformthemes/gtk3/qgtk3menu.cpp
@@ -158,23 +158,23 @@ static QString convertMnemonics(QString text, bool *found)
{
*found = false;
- int i = text.length() - 1;
+ qsizetype i = text.length() - 1;
while (i >= 0) {
const QChar c = text.at(i);
- if (c == QLatin1Char('&')) {
- if (i == 0 || text.at(i - 1) != QLatin1Char('&')) {
+ if (c == u'&') {
+ if (i == 0 || text.at(i - 1) != u'&') {
// convert Qt to GTK mnemonic
if (i < text.length() - 1 && !text.at(i + 1).isSpace()) {
- text.replace(i, 1, QLatin1Char('_'));
+ text.replace(i, 1, u'_');
*found = true;
}
- } else if (text.at(i - 1) == QLatin1Char('&')) {
+ } else if (text.at(i - 1) == u'&') {
// unescape ampersand
- text.replace(--i, 2, QLatin1Char('&'));
+ text.replace(--i, 2, u'&');
}
- } else if (c == QLatin1Char('_')) {
+ } else if (c == u'_') {
// escape GTK mnemonic
- text.insert(i, QLatin1Char('_'));
+ text.insert(i, u'_');
}
--i;
}
diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp
index 61d0059898..92ac792b9c 100644
--- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp
+++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp
@@ -251,7 +251,7 @@ void QXdgDesktopPortalFileDialog::openPortal()
QRegularExpressionMatch match = regexp.match(nameFilter);
if (match.hasMatch()) {
QString userVisibleName = match.captured(1);
- QStringList filterStrings = match.captured(2).split(QLatin1Char(' '), Qt::SkipEmptyParts);
+ QStringList filterStrings = match.captured(2).split(u' ', Qt::SkipEmptyParts);
if (filterStrings.isEmpty()) {
qWarning() << "Filter " << userVisibleName << " is empty and will be ignored.";