summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qstandardpaths_unix.cpp2
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.cpp4
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp4
-rw-r--r--src/widgets/styles/qgtkstyle_p.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp
index 6057c26e0d..62c846738e 100644
--- a/src/corelib/io/qstandardpaths_unix.cpp
+++ b/src/corelib/io/qstandardpaths_unix.cpp
@@ -137,7 +137,7 @@ QString QStandardPaths::writableLocation(StandardLocation type)
if (xdgConfigHome.isEmpty())
xdgConfigHome = QDir::homePath() + QLatin1String("/.config");
QFile file(xdgConfigHome + QLatin1String("/user-dirs.dirs"));
- if (file.exists() && file.open(QIODevice::ReadOnly)) {
+ if (file.open(QIODevice::ReadOnly)) {
QHash<QString, QString> lines;
QTextStream stream(&file);
// Only look for lines like: XDG_DESKTOP_DIR="$HOME/Desktop"
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index 1a874a92b7..0e54668394 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -255,7 +255,7 @@ quint64 QConnmanEngine::bytesWritten(const QString &id)
quint64 result = 0;
QString devFile = getInterfaceFromId(id);
QFile tx("/sys/class/net/"+devFile+"/statistics/tx_bytes");
- if(tx.exists() && tx.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ if (tx.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&tx);
in >> result;
tx.close();
@@ -270,7 +270,7 @@ quint64 QConnmanEngine::bytesReceived(const QString &id)
quint64 result = 0;
QString devFile = getInterfaceFromId(id);
QFile rx("/sys/class/net/"+devFile+"/statistics/rx_bytes");
- if(rx.exists() && rx.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ if (rx.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&rx);
in >> result;
rx.close();
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
index fd79cff484..a71a241ea6 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
@@ -837,7 +837,7 @@ quint64 QNetworkManagerEngine::bytesWritten(const QString &id)
quint64 result = Q_UINT64_C(0);
QFile tx(devFile);
- if (tx.exists() && tx.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ if (tx.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&tx);
in >> result;
tx.close();
@@ -865,7 +865,7 @@ quint64 QNetworkManagerEngine::bytesReceived(const QString &id)
quint64 result = Q_UINT64_C(0);
QFile tx(devFile);
- if (tx.exists() && tx.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ if (tx.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&tx);
in >> result;
tx.close();
diff --git a/src/widgets/styles/qgtkstyle_p.cpp b/src/widgets/styles/qgtkstyle_p.cpp
index 40ad9f2a95..18e120a4eb 100644
--- a/src/widgets/styles/qgtkstyle_p.cpp
+++ b/src/widgets/styles/qgtkstyle_p.cpp
@@ -661,7 +661,7 @@ QString QGtkStylePrivate::getThemeName()
foreach (const QString &rcPath, paths) {
if (!rcPath.isEmpty()) {
QFile rcFile(rcPath);
- if (rcFile.exists() && rcFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ if (rcFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&rcFile);
while(!in.atEnd()) {
QString line = in.readLine();