qstandardpaths_unix.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/io/qstandardpaths_unix.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtCore module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qstandardpaths.h"-
41#include <qdir.h>-
42#include <qfile.h>-
43#include <qhash.h>-
44#include <qtextstream.h>-
45#include <private/qfilesystemengine_p.h>-
46#include <errno.h>-
47#include <stdlib.h>-
48-
49#ifndef QT_BOOTSTRAPPED-
50#include <qcoreapplication.h>-
51#endif-
52-
53#ifndef QT_NO_STANDARDPATHS-
54-
55QT_BEGIN_NAMESPACE-
56-
57static void appendOrganizationAndApp(QString &path)-
58{-
59#ifndef QT_BOOTSTRAPPED-
60 const QString org = QCoreApplication::organizationName();-
61 if (!org.isEmpty())
!org.isEmpty()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 30 times by 1 test
Evaluated by:
  • tst_qstandardpaths
8-30
62 path += QLatin1Char('/') + org;
executed 8 times by 1 test: path += QLatin1Char('/') + org;
Executed by:
  • tst_qstandardpaths
8
63 const QString appName = QCoreApplication::applicationName();-
64 if (!appName.isEmpty())
!appName.isEmpty()Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEnever evaluated
0-38
65 path += QLatin1Char('/') + appName;
executed 38 times by 1 test: path += QLatin1Char('/') + appName;
Executed by:
  • tst_qstandardpaths
38
66#else-
67 Q_UNUSED(path);-
68#endif-
69}
executed 38 times by 1 test: end of block
Executed by:
  • tst_qstandardpaths
38
70-
71QString QStandardPaths::writableLocation(StandardLocation type)-
72{-
73 switch (type) {-
74 case HomeLocation:
executed 5 times by 1 test: case HomeLocation:
Executed by:
  • tst_qstandardpaths
5
75 return QDir::homePath();
executed 5 times by 1 test: return QDir::homePath();
Executed by:
  • tst_qstandardpaths
5
76 case TempLocation:
executed 5 times by 1 test: case TempLocation:
Executed by:
  • tst_qstandardpaths
5
77 return QDir::tempPath();
executed 5 times by 1 test: return QDir::tempPath();
Executed by:
  • tst_qstandardpaths
5
78 case CacheLocation:
executed 6 times by 1 test: case CacheLocation:
Executed by:
  • tst_qstandardpaths
6
79 case GenericCacheLocation:
executed 8 times by 1 test: case GenericCacheLocation:
Executed by:
  • tst_qstandardpaths
8
80 {-
81 // http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html-
82 QString xdgCacheHome = QFile::decodeName(qgetenv("XDG_CACHE_HOME"));-
83 if (isTestModeEnabled())
isTestModeEnabled()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qstandardpaths
4-10
84 xdgCacheHome = QDir::homePath() + QLatin1String("/.qttest/cache");
executed 4 times by 1 test: xdgCacheHome = QDir::homePath() + QLatin1String("/.qttest/cache");
Executed by:
  • tst_qstandardpaths
4
85 if (xdgCacheHome.isEmpty())
xdgCacheHome.isEmpty()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qstandardpaths
4-10
86 xdgCacheHome = QDir::homePath() + QLatin1String("/.cache");
executed 10 times by 1 test: xdgCacheHome = QDir::homePath() + QLatin1String("/.cache");
Executed by:
  • tst_qstandardpaths
10
87 if (type == QStandardPaths::CacheLocation)
type == QStand...:CacheLocationDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qstandardpaths
6-8
88 appendOrganizationAndApp(xdgCacheHome);
executed 6 times by 1 test: appendOrganizationAndApp(xdgCacheHome);
Executed by:
  • tst_qstandardpaths
6
89 return xdgCacheHome;
executed 14 times by 1 test: return xdgCacheHome;
Executed by:
  • tst_qstandardpaths
14
90 }-
91 case AppDataLocation:
executed 5 times by 1 test: case AppDataLocation:
Executed by:
  • tst_qstandardpaths
5
92 case AppLocalDataLocation:
executed 13 times by 1 test: case AppLocalDataLocation:
Executed by:
  • tst_qstandardpaths
13
93 case GenericDataLocation:
executed 2676 times by 26 tests: case GenericDataLocation:
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qdesktopservices
  • tst_qmimetype
  • ...
2676
94 {-
95 QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME"));-
96 if (isTestModeEnabled())
isTestModeEnabled()Description
TRUEevaluated 2063 times by 4 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QMimeDatabase
  • tst_qstandardpaths
FALSEevaluated 631 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qdesktopservices
  • tst_qmimetype
  • tst_qstandardpaths
631-2063
97 xdgDataHome = QDir::homePath() + QLatin1String("/.qttest/share");
executed 2063 times by 4 tests: xdgDataHome = QDir::homePath() + QLatin1String("/.qttest/share");
Executed by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QMimeDatabase
  • tst_qstandardpaths
2063
98 if (xdgDataHome.isEmpty())
xdgDataHome.isEmpty()Description
TRUEevaluated 620 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qdesktopservices
  • tst_qmimetype
  • tst_qstandardpaths
FALSEevaluated 2074 times by 4 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QMimeDatabase
  • tst_qstandardpaths
620-2074
99 xdgDataHome = QDir::homePath() + QLatin1String("/.local/share");
executed 620 times by 23 tests: xdgDataHome = QDir::homePath() + QLatin1String("/.local/share");
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qdesktopservices
  • tst_qmimetype
  • tst_qstandardpaths
620
100 if (type == AppDataLocation || type == AppLocalDataLocation)
type == AppDataLocationDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 2689 times by 26 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qdesktopservices
  • tst_qmimetype
  • ...
type == AppLocalDataLocationDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 2676 times by 26 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qdesktopservices
  • tst_qmimetype
  • ...
5-2689
101 appendOrganizationAndApp(xdgDataHome);
executed 18 times by 1 test: appendOrganizationAndApp(xdgDataHome);
Executed by:
  • tst_qstandardpaths
18
102 return xdgDataHome;
executed 2694 times by 26 tests: return xdgDataHome;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qdesktopservices
  • tst_qmimetype
  • ...
2694
103 }-
104 case ConfigLocation:
executed 16 times by 1 test: case ConfigLocation:
Executed by:
  • tst_qstandardpaths
16
105 case GenericConfigLocation:
executed 1098 times by 32 tests: case GenericConfigLocation:
Executed by:
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSettings
  • tst_QSql
  • tst_QTextFormat
  • tst_languageChange
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • ...
1098
106 case AppConfigLocation:
executed 5 times by 1 test: case AppConfigLocation:
Executed by:
  • tst_qstandardpaths
5
107 {-
108 // http://standards.freedesktop.org/basedir-spec/latest/-
109 QString xdgConfigHome = QFile::decodeName(qgetenv("XDG_CONFIG_HOME"));-
110 if (isTestModeEnabled())
isTestModeEnabled()Description
TRUEevaluated 12 times by 5 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QLoggingRegistry
  • tst_QSettings
  • tst_qstandardpaths
FALSEevaluated 1107 times by 28 tests
Evaluated by:
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_QTextFormat
  • tst_languageChange
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • ...
12-1107
111 xdgConfigHome = QDir::homePath() + QLatin1String("/.qttest/config");
executed 12 times by 5 tests: xdgConfigHome = QDir::homePath() + QLatin1String("/.qttest/config");
Executed by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QLoggingRegistry
  • tst_QSettings
  • tst_qstandardpaths
12
112 if (xdgConfigHome.isEmpty())
xdgConfigHome.isEmpty()Description
TRUEevaluated 1098 times by 28 tests
Evaluated by:
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_QTextFormat
  • tst_languageChange
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • ...
FALSEevaluated 21 times by 5 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QLoggingRegistry
  • tst_QSettings
  • tst_qstandardpaths
21-1098
113 xdgConfigHome = QDir::homePath() + QLatin1String("/.config");
executed 1098 times by 28 tests: xdgConfigHome = QDir::homePath() + QLatin1String("/.config");
Executed by:
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_QTextFormat
  • tst_languageChange
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • ...
1098
114 if (type == AppConfigLocation)
type == AppConfigLocationDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 1114 times by 32 tests
Evaluated by:
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSettings
  • tst_QSql
  • tst_QTextFormat
  • tst_languageChange
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • ...
5-1114
115 appendOrganizationAndApp(xdgConfigHome);
executed 5 times by 1 test: appendOrganizationAndApp(xdgConfigHome);
Executed by:
  • tst_qstandardpaths
5
116 return xdgConfigHome;
executed 1119 times by 32 tests: return xdgConfigHome;
Executed by:
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSettings
  • tst_QSql
  • tst_QTextFormat
  • tst_languageChange
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • ...
1119
117 }-
118 case RuntimeLocation:
executed 8 times by 1 test: case RuntimeLocation:
Executed by:
  • tst_qstandardpaths
8
119 {-
120 const uid_t myUid = geteuid();-
121 // http://standards.freedesktop.org/basedir-spec/latest/-
122 QFileInfo fileInfo;-
123 QString xdgRuntimeDir = QFile::decodeName(qgetenv("XDG_RUNTIME_DIR"));-
124 if (xdgRuntimeDir.isEmpty()) {
xdgRuntimeDir.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qstandardpaths
0-8
125 const QString userName = QFileSystemEngine::resolveUserName(myUid);-
126 xdgRuntimeDir = QDir::tempPath() + QLatin1String("/runtime-") + userName;-
127 fileInfo.setFile(xdgRuntimeDir);-
128 if (!fileInfo.isDir()) {
!fileInfo.isDir()Description
TRUEnever evaluated
FALSEnever evaluated
0
129 if (!QDir().mkdir(xdgRuntimeDir)) {
!QDir().mkdir(xdgRuntimeDir)Description
TRUEnever evaluated
FALSEnever evaluated
0
130 qWarning("QStandardPaths: error creating runtime directory %s: %s", qPrintable(xdgRuntimeDir), qPrintable(qt_error_string(errno)));-
131 return QString();
never executed: return QString();
0
132 }-
133 }
never executed: end of block
0
134 qWarning("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '%s'", qPrintable(xdgRuntimeDir));-
135 } else {
never executed: end of block
0
136 fileInfo.setFile(xdgRuntimeDir);-
137 if (!fileInfo.exists()) {
!fileInfo.exists()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_qstandardpaths
1-7
138 qWarning("QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '%s', "-
139 "please create it with 0700 permissions.", qPrintable(xdgRuntimeDir));-
140 return QString();
executed 1 time by 1 test: return QString();
Executed by:
  • tst_qstandardpaths
1
141 }-
142 if (!fileInfo.isDir()) {
!fileInfo.isDir()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qstandardpaths
1-6
143 qWarning("QStandardPaths: XDG_RUNTIME_DIR points to '%s' which is not a directory",-
144 qPrintable(xdgRuntimeDir));-
145 return QString();
executed 1 time by 1 test: return QString();
Executed by:
  • tst_qstandardpaths
1
146 }-
147 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_qstandardpaths
6
148 // "The directory MUST be owned by the user"-
149 if (fileInfo.ownerId() != myUid) {
fileInfo.ownerId() != myUidDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_qstandardpaths
1-5
150 qWarning("QStandardPaths: wrong ownership on runtime directory %s, %d instead of %d", qPrintable(xdgRuntimeDir),-
151 fileInfo.ownerId(), myUid);-
152 return QString();
executed 1 time by 1 test: return QString();
Executed by:
  • tst_qstandardpaths
1
153 }-
154 // "and he MUST be the only one having read and write access to it. Its Unix access mode MUST be 0700."-
155 // since the current user is the owner, set both xxxUser and xxxOwner-
156 const QFile::Permissions wantedPerms = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser-
157 | QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner;-
158 if (fileInfo.permissions() != wantedPerms) {
fileInfo.permi...!= wantedPermsDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qstandardpaths
1-4
159 QFile file(xdgRuntimeDir);-
160 if (!file.setPermissions(wantedPerms)) {
!file.setPermi...s(wantedPerms)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qstandardpaths
0-1
161 qWarning("QStandardPaths: could not set correct permissions on runtime directory %s: %s",-
162 qPrintable(xdgRuntimeDir), qPrintable(file.errorString()));-
163 return QString();
never executed: return QString();
0
164 }-
165 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_qstandardpaths
1
166 return xdgRuntimeDir;
executed 5 times by 1 test: return xdgRuntimeDir;
Executed by:
  • tst_qstandardpaths
5
167 }-
168 default:
executed 45 times by 3 tests: default:
Executed by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
45
169 break;
executed 45 times by 3 tests: break;
Executed by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
45
170 }-
171-
172#ifndef QT_BOOTSTRAPPED-
173 // http://www.freedesktop.org/wiki/Software/xdg-user-dirs-
174 QString xdgConfigHome = QFile::decodeName(qgetenv("XDG_CONFIG_HOME"));-
175 if (xdgConfigHome.isEmpty())
xdgConfigHome.isEmpty()Description
TRUEevaluated 43 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qstandardpaths
2-43
176 xdgConfigHome = QDir::homePath() + QLatin1String("/.config");
executed 43 times by 3 tests: xdgConfigHome = QDir::homePath() + QLatin1String("/.config");
Executed by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
43
177 QFile file(xdgConfigHome + QLatin1String("/user-dirs.dirs"));-
178 if (!isTestModeEnabled() && file.open(QIODevice::ReadOnly)) {
!isTestModeEnabled()Description
TRUEevaluated 45 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEnever evaluated
file.open(QIODevice::ReadOnly)Description
TRUEevaluated 43 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qstandardpaths
0-45
179 QHash<QString, QString> lines;-
180 QTextStream stream(&file);-
181 // Only look for lines like: XDG_DESKTOP_DIR="$HOME/Desktop"-
182 QRegExp exp(QLatin1String("^XDG_(.*)_DIR=(.*)$"));-
183 while (!stream.atEnd()) {
!stream.atEnd()Description
TRUEevaluated 645 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEevaluated 43 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
43-645
184 const QString &line = stream.readLine();-
185 if (exp.indexIn(line) != -1) {
exp.indexIn(line) != -1Description
TRUEevaluated 344 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEevaluated 301 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
301-344
186 const QStringList lst = exp.capturedTexts();-
187 const QString key = lst.at(1);-
188 QString value = lst.at(2);-
189 if (value.length() > 2
value.length() > 2Description
TRUEevaluated 344 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEnever evaluated
0-344
190 && value.startsWith(QLatin1Char('\"'))
value.startsWi...in1Char('\"'))Description
TRUEevaluated 344 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEnever evaluated
0-344
191 && value.endsWith(QLatin1Char('\"')))
value.endsWith...in1Char('\"'))Description
TRUEevaluated 344 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEnever evaluated
0-344
192 value = value.mid(1, value.length() - 2);
executed 344 times by 3 tests: value = value.mid(1, value.length() - 2);
Executed by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
344
193 // Store the key and value: "DESKTOP", "$HOME/Desktop"-
194 lines[key] = value;-
195 }
executed 344 times by 3 tests: end of block
Executed by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
344
196 }
executed 645 times by 3 tests: end of block
Executed by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
645
197-
198 QString key;-
199 switch (type) {-
200 case DesktopLocation:
executed 5 times by 1 test: case DesktopLocation:
Executed by:
  • tst_qstandardpaths
5
201 key = QLatin1String("DESKTOP");-
202 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_qstandardpaths
5
203 case DocumentsLocation:
executed 7 times by 2 tests: case DocumentsLocation:
Executed by:
  • tst_QFileSystemModel
  • tst_qstandardpaths
7
204 key = QLatin1String("DOCUMENTS");-
205 break;
executed 7 times by 2 tests: break;
Executed by:
  • tst_QFileSystemModel
  • tst_qstandardpaths
7
206 case PicturesLocation:
executed 5 times by 1 test: case PicturesLocation:
Executed by:
  • tst_qstandardpaths
5
207 key = QLatin1String("PICTURES");-
208 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_qstandardpaths
5
209 case MusicLocation:
executed 5 times by 1 test: case MusicLocation:
Executed by:
  • tst_qstandardpaths
5
210 key = QLatin1String("MUSIC");-
211 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_qstandardpaths
5
212 case MoviesLocation:
executed 5 times by 1 test: case MoviesLocation:
Executed by:
  • tst_qstandardpaths
5
213 key = QLatin1String("VIDEOS");-
214 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_qstandardpaths
5
215 case DownloadLocation:
executed 6 times by 2 tests: case DownloadLocation:
Executed by:
  • tst_QTemporaryDir
  • tst_qstandardpaths
6
216 key = QLatin1String("DOWNLOAD");-
217 break;
executed 6 times by 2 tests: break;
Executed by:
  • tst_QTemporaryDir
  • tst_qstandardpaths
6
218 default:
executed 10 times by 1 test: default:
Executed by:
  • tst_qstandardpaths
10
219 break;
executed 10 times by 1 test: break;
Executed by:
  • tst_qstandardpaths
10
220 }-
221 if (!key.isEmpty()) {
!key.isEmpty()Description
TRUEevaluated 33 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qstandardpaths
10-33
222 QString value = lines.value(key);-
223 if (!value.isEmpty()) {
!value.isEmpty()Description
TRUEevaluated 33 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEnever evaluated
0-33
224 // value can start with $HOME-
225 if (value.startsWith(QLatin1String("$HOME")))
value.startsWi...ring("$HOME"))Description
TRUEevaluated 33 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEnever evaluated
0-33
226 value = QDir::homePath() + value.mid(5);
executed 33 times by 3 tests: value = QDir::homePath() + value.mid(5);
Executed by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
33
227 if (value.length() > 1 && value.endsWith(QLatin1Char('/')))
value.length() > 1Description
TRUEevaluated 33 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
FALSEnever evaluated
value.endsWith...tin1Char('/'))Description
TRUEnever evaluated
FALSEevaluated 33 times by 3 tests
Evaluated by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
0-33
228 value.chop(1);
never executed: value.chop(1);
0
229 return value;
executed 33 times by 3 tests: return value;
Executed by:
  • tst_QFileSystemModel
  • tst_QTemporaryDir
  • tst_qstandardpaths
33
230 }-
231 }
never executed: end of block
0
232 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qstandardpaths
10
233#endif-
234-
235 QString path;-
236 switch (type) {-
237 case DesktopLocation:
never executed: case DesktopLocation:
0
238 path = QDir::homePath() + QLatin1String("/Desktop");-
239 break;
never executed: break;
0
240 case DocumentsLocation:
never executed: case DocumentsLocation:
0
241 path = QDir::homePath() + QLatin1String("/Documents");-
242 break;
never executed: break;
0
243 case PicturesLocation:
never executed: case PicturesLocation:
0
244 path = QDir::homePath() + QLatin1String("/Pictures");-
245 break;
never executed: break;
0
246-
247 case FontsLocation:
executed 5 times by 1 test: case FontsLocation:
Executed by:
  • tst_qstandardpaths
5
248 path = QDir::homePath() + QLatin1String("/.fonts");-
249 break;
executed 5 times by 1 test: break;
Executed by:
  • tst_qstandardpaths
5
250-
251 case MusicLocation:
never executed: case MusicLocation:
0
252 path = QDir::homePath() + QLatin1String("/Music");-
253 break;
never executed: break;
0
254-
255 case MoviesLocation:
never executed: case MoviesLocation:
0
256 path = QDir::homePath() + QLatin1String("/Videos");-
257 break;
never executed: break;
0
258 case DownloadLocation:
never executed: case DownloadLocation:
0
259 path = QDir::homePath() + QLatin1String("/Downloads");-
260 break;
never executed: break;
0
261 case ApplicationsLocation:
executed 7 times by 1 test: case ApplicationsLocation:
Executed by:
  • tst_qstandardpaths
7
262 path = writableLocation(GenericDataLocation) + QLatin1String("/applications");-
263 break;
executed 7 times by 1 test: break;
Executed by:
  • tst_qstandardpaths
7
264-
265 default:
never executed: default:
0
266 break;
never executed: break;
0
267 }-
268-
269 return path;
executed 12 times by 1 test: return path;
Executed by:
  • tst_qstandardpaths
12
270}-
271-
272static QStringList xdgDataDirs()-
273{-
274 QStringList dirs;-
275 // http://standards.freedesktop.org/basedir-spec/latest/-
276 QString xdgDataDirsEnv = QFile::decodeName(qgetenv("XDG_DATA_DIRS"));-
277 if (xdgDataDirsEnv.isEmpty()) {
xdgDataDirsEnv.isEmpty()Description
TRUEevaluated 2501 times by 23 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qstandardpaths
FALSEevaluated 141 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_qmimetype
  • tst_qstandardpaths
141-2501
278 dirs.append(QString::fromLatin1("/usr/local/share"));-
279 dirs.append(QString::fromLatin1("/usr/share"));-
280 } else {
executed 2501 times by 23 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qstandardpaths
2501
281 dirs = xdgDataDirsEnv.split(QLatin1Char(':'), QString::SkipEmptyParts);-
282-
283 // Normalize paths, skip relative paths-
284 QMutableListIterator<QString> it(dirs);-
285 while (it.hasNext()) {
it.hasNext()Description
TRUEevaluated 142 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_qmimetype
  • tst_qstandardpaths
FALSEevaluated 141 times by 3 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_qmimetype
  • tst_qstandardpaths
141-142
286 const QString dir = it.next();-
287 if (!dir.startsWith(QLatin1Char('/')))
!dir.startsWit...tin1Char('/'))Description
TRUEevaluated 2 times by 2 tests
Evaluated by:
  • tst_qmimetype
  • tst_qstandardpaths
FALSEevaluated 140 times by 2 tests
Evaluated by:
  • tst_QMimeDatabase
  • tst_qstandardpaths
2-140
288 it.remove();
executed 2 times by 2 tests: it.remove();
Executed by:
  • tst_qmimetype
  • tst_qstandardpaths
2
289 else-
290 it.setValue(QDir::cleanPath(dir));
executed 140 times by 2 tests: it.setValue(QDir::cleanPath(dir));
Executed by:
  • tst_QMimeDatabase
  • tst_qstandardpaths
140
291 }-
292-
293 // Remove duplicates from the list, there's no use for duplicated-
294 // paths in XDG_DATA_DIRS - if it's not found in the given-
295 // directory the first time, it won't be there the second time.-
296 // Plus duplicate paths causes problems for example for mimetypes,-
297 // where duplicate paths here lead to duplicated mime types returned-
298 // for a file, eg "text/plain,text/plain" instead of "text/plain"-
299 dirs.removeDuplicates();-
300 }
executed 141 times by 3 tests: end of block
Executed by:
  • tst_QMimeDatabase
  • tst_qmimetype
  • tst_qstandardpaths
141
301 return dirs;
executed 2642 times by 25 tests: return dirs;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qmimetype
  • tst_qstandardpaths
2642
302}-
303-
304static QStringList xdgConfigDirs()-
305{-
306 QStringList dirs;-
307 // http://standards.freedesktop.org/basedir-spec/latest/-
308 const QString xdgConfigDirs = QFile::decodeName(qgetenv("XDG_CONFIG_DIRS"));-
309 if (xdgConfigDirs.isEmpty())
xdgConfigDirs.isEmpty()Description
TRUEevaluated 1086 times by 25 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qstandardpaths
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qstandardpaths
6-1086
310 dirs.append(QString::fromLatin1("/etc/xdg"));
executed 1086 times by 25 tests: dirs.append(QString::fromLatin1("/etc/xdg"));
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qstandardpaths
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1086
311 else-
312 dirs = xdgConfigDirs.split(QLatin1Char(':'));
executed 6 times by 1 test: dirs = xdgConfigDirs.split(QLatin1Char(':'));
Executed by:
  • tst_qstandardpaths
6
313 return dirs;
executed 1092 times by 25 tests: return dirs;
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qstandardpaths
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1092
314}-
315-
316QStringList QStandardPaths::standardLocations(StandardLocation type)-
317{-
318 QStringList dirs;-
319 switch (type) {-
320 case ConfigLocation:
executed 9 times by 1 test: case ConfigLocation:
Executed by:
  • tst_qstandardpaths
9
321 case GenericConfigLocation:
executed 1082 times by 25 tests: case GenericConfigLocation:
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qstandardpaths
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1082
322 dirs = xdgConfigDirs();-
323 break;
executed 1091 times by 25 tests: break;
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QLoggingRegistry
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qstandardpaths
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1091
324 case AppConfigLocation:
executed 1 time by 1 test: case AppConfigLocation:
Executed by:
  • tst_qstandardpaths
1
325 dirs = xdgConfigDirs();-
326 for (int i = 0; i < dirs.count(); ++i)
i < dirs.count()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_qstandardpaths
1
327 appendOrganizationAndApp(dirs[i]);
executed 1 time by 1 test: appendOrganizationAndApp(dirs[i]);
Executed by:
  • tst_qstandardpaths
1
328 break;
executed 1 time by 1 test: break;
Executed by:
  • tst_qstandardpaths
1
329 case GenericDataLocation:
executed 2634 times by 25 tests: case GenericDataLocation:
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qmimetype
  • tst_qstandardpaths
2634
330 dirs = xdgDataDirs();-
331 break;
executed 2634 times by 25 tests: break;
Executed by:
  • tst_QAccessibility
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCompleter
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QMimeDatabase
  • tst_QPrinter
  • tst_QSidebar
  • tst_QStyle
  • tst_QSystemTrayIcon
  • tst_QToolButton
  • tst_languageChange
  • tst_qmimetype
  • tst_qstandardpaths
2634
332 case ApplicationsLocation:
executed 4 times by 1 test: case ApplicationsLocation:
Executed by:
  • tst_qstandardpaths
4
333 dirs = xdgDataDirs();-
334 for (int i = 0; i < dirs.count(); ++i)
i < dirs.count()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qstandardpaths
4-6
335 dirs[i].append(QLatin1String("/applications"));
executed 6 times by 1 test: dirs[i].append(QLatin1String("/applications"));
Executed by:
  • tst_qstandardpaths
6
336 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qstandardpaths
4
337 case AppDataLocation:
executed 1 time by 1 test: case AppDataLocation:
Executed by:
  • tst_qstandardpaths
1
338 case AppLocalDataLocation:
executed 3 times by 1 test: case AppLocalDataLocation:
Executed by:
  • tst_qstandardpaths
3
339 dirs = xdgDataDirs();-
340 for (int i = 0; i < dirs.count(); ++i)
i < dirs.count()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qstandardpaths
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qstandardpaths
4-8
341 appendOrganizationAndApp(dirs[i]);
executed 8 times by 1 test: appendOrganizationAndApp(dirs[i]);
Executed by:
  • tst_qstandardpaths
8
342 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_qstandardpaths
4
343 default:
executed 27 times by 2 tests: default:
Executed by:
  • tst_QFileSystemModel
  • tst_qstandardpaths
27
344 break;
executed 27 times by 2 tests: break;
Executed by:
  • tst_QFileSystemModel
  • tst_qstandardpaths
27
345 }-
346 const QString localDir = writableLocation(type);-
347 dirs.prepend(localDir);-
348 return dirs;
executed 3761 times by 48 tests: return dirs;
Executed by:
  • tst_QAccessibility
  • tst_QApplication
  • tst_QCalendarWidget
  • tst_QComboBox
  • tst_QCommandLineParser
  • tst_QCompleter
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDateTimeEdit
  • tst_QDebug
  • tst_QDnsLookup_Appless
  • tst_QFileDialog2
  • tst_QFileIconProvider
  • tst_QFileSystemModel
  • tst_QFiledialog
  • tst_QFontComboBox
  • tst_QGlobal
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsWidget
  • tst_QGuiApplication
  • tst_QGuiVariant
  • tst_QIcon
  • tst_QLoggingRegistry
  • ...
3761
349}-
350-
351QT_END_NAMESPACE-
352-
353#endif // QT_NO_STANDARDPATHS-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9