summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2012-10-12 15:06:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-16 22:39:58 +0200
commit3ac719bb6ee535b716ef5b23a1e194946c033dca (patch)
tree789ed217853384cd0eb9c46049f48d2f6dde1a46 /src/tools
parent966825806db0bc96418a41b13728f262de5e3237 (diff)
QtSystems: Fix compiler warnings.
- Fix QString-construction from const char * returned by getenv, (potential crash). - Fix single character string constants. - Integer truncation. - Unused variables. Change-Id: I245daa1eb68801227d42ae07681f8e640c1f55c0 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/servicefw/servicefw.cpp8
-rw-r--r--src/tools/sfwlisten/main.cpp1
2 files changed, 4 insertions, 5 deletions
diff --git a/src/tools/servicefw/servicefw.cpp b/src/tools/servicefw/servicefw.cpp
index 85de4f24..ff0d8a2a 100644
--- a/src/tools/servicefw/servicefw.cpp
+++ b/src/tools/servicefw/servicefw.cpp
@@ -295,14 +295,14 @@ void CommandProcessor::dbusservice(const QStringList &args)
QString path;
if (serviceManager->scope() == QService::UserScope) {
// the d-bus xdg environment variable for the local service paths
- QString xdgPath = getenv("XDG_DATA_HOME");
- if (xdgPath == "") {
+ const QByteArray xdgPath = qgetenv("XDG_DATA_HOME");
+ if (xdgPath.isEmpty()) {
// if not supplied generate in default
QDir dir(QDir::homePath());
dir.mkpath(".local/share/dbus-1/services/");
path = QDir::homePath() + "/.local/share/dbus-1/services/";
} else {
- path = xdgPath;
+ path = QString::fromLocal8Bit(xdgPath);
}
} else {
path = "/usr/share/dbus-1/services/";
@@ -356,7 +356,7 @@ bool CommandProcessor::setOptions(const QStringList &options)
}
if (!opts.isEmpty()) {
- *stdoutStream << "Bad options: " << opts.join(" ") << "\n\n";
+ *stdoutStream << "Bad options: " << opts.join(QLatin1Char(' ')) << "\n\n";
showUsage();
return false;
}
diff --git a/src/tools/sfwlisten/main.cpp b/src/tools/sfwlisten/main.cpp
index a1a28d15..e64ce526 100644
--- a/src/tools/sfwlisten/main.cpp
+++ b/src/tools/sfwlisten/main.cpp
@@ -185,7 +185,6 @@ void SFWReceiver::socketReadyRead()
QByteArray appName(str, len);
delete[] str;
- QTime t = QTime::currentTime();
printf("{%4s} %2d:%02d:%02d.%03d ", qPrintable(intf), hour, minute,
second, msec);
printf("[%5d/%10s] ", pid, appName.constData());