[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kinfocenter] Modules: Add QStringLiteral when necessary
From: Laurent Montel <null () kde ! org>
Date: 2018-08-01 5:59:01
Message-ID: E1fkkA1-00088J-Ut () code ! kde ! org
[Download RAW message or body]
Git commit 2c5399f5f8c75b26461b096c9cff327a5eaaeb94 by Laurent Montel.
Committed on 01/08/2018 at 05:58.
Pushed by mlaurent into branch 'master'.
Add QStringLiteral when necessary
M +2 -2 Modules/opengl/opengl.cpp
M +4 -4 Modules/usbview/usbdevices.cpp
https://commits.kde.org/kinfocenter/2c5399f5f8c75b26461b096c9cff327a5eaaeb94
diff --git a/Modules/opengl/opengl.cpp b/Modules/opengl/opengl.cpp
index 795636b..8e5ca14 100644
--- a/Modules/opengl/opengl.cpp
+++ b/Modules/opengl/opengl.cpp
@@ -966,7 +966,7 @@ bool GetInfo_OpenGL(QTreeWidget *treeWidget)
return false;
}
l1->setText(0, i18n("Name of the Display"));
- l1->setText(1, DisplayString(dpy));
+ l1->setText(1, QString::fromLatin1(DisplayString(dpy)));
l1->setExpanded(true);
l1->setFlags(Qt::ItemIsEnabled);
@@ -1004,7 +1004,7 @@ bool GetInfo_OpenGL(QTreeWidget *treeWidget)
if (isWayland) {
IsDirect = true;
l1->setText(0, i18n("Name of the Display"));
- l1->setText(1, qgetenv("WAYLAND_DISPLAY"));
+ l1->setText(1, QString::fromLatin1(qgetenv("WAYLAND_DISPLAY")));
l1->setExpanded(true);
l1->setFlags(Qt::ItemIsEnabled);
#if KCM_HAVE_EGL
diff --git a/Modules/usbview/usbdevices.cpp b/Modules/usbview/usbdevices.cpp
index e6e683b..1fb32e7 100644
--- a/Modules/usbview/usbdevices.cpp
+++ b/Modules/usbview/usbdevices.cpp
@@ -51,7 +51,7 @@ USBDevice::~USBDevice() {
static QString catFile(const QString &fname) {
char buffer[256];
QString result;
- int fd =:: open(QFile::encodeName(fname), O_RDONLY);
+ int fd =:: open(QFile::encodeName(fname).constData(), O_RDONLY);
if (fd<0)
return QString();
@@ -163,12 +163,12 @@ QString USBDevice::dump() {
QString c = QStringLiteral("<td>%1</td>").arg(_class);
QString cname = _db->cls(_class);
if (!cname.isEmpty())
- c += QStringLiteral("<td>(") + i18n(cname.toLatin1()) +QStringLiteral(")</td>");
+ c += QStringLiteral("<td>(") + i18n(cname.toLatin1().constData()) +QStringLiteral(")</td>");
r += i18n("<tr><td><i>Class</i></td>%1</tr>", c);
QString sc = QStringLiteral("<td>%1</td>").arg(_sub);
QString scname = _db->subclass(_class, _sub);
if (!scname.isEmpty())
- sc += QStringLiteral("<td>(") + i18n(scname.toLatin1()) +QStringLiteral(")</td>");
+ sc += QStringLiteral("<td>(") + i18n(scname.toLatin1().constData()) +QStringLiteral(")</td>");
r += i18n("<tr><td><i>Subclass</i></td>%1</tr>", sc);
QString pr = QStringLiteral("<td>%1</td>").arg(_prot);
QString prname = _db->protocol(_class, _sub, _prot);
@@ -239,7 +239,7 @@ bool USBDevice::parse(const QString &fname) {
// Note: we can't use a QTextStream, as the files in /proc
// are pseudo files with zero length
char buffer[256];
- int fd =:: open(QFile::encodeName(fname), O_RDONLY);
+ int fd =:: open(QFile::encodeName(fname).constData(), O_RDONLY);
if (fd<0)
return false;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic