summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qstandardpaths
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-03-20 18:01:20 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-28 00:51:32 +0200
commite5d549552614f89dd73b29fc3ee4710f65bb1e57 (patch)
tree0f1480eb7c25a7dc48e5248463daf02d4f36f6c5 /tests/auto/corelib/io/qstandardpaths
parentdf43b9a06a73759ba74f23d9c3e91bd0347d1026 (diff)
Make QCoreApplication::applicationName() default to argv[0]
This makes it more useful in all the Qt apps that don't set it, given that it's used internally by QTemporaryFile, QTemporaryDir, QStandardPaths, QDBus, QAccessibleApplication, etc. Qt4 compatibility in the deprecated QDesktopServices is preserved, no fallback there. Change-Id: I584463507cf917a3720793c6bd45d07c60f8356c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/io/qstandardpaths')
-rw-r--r--tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
index a6eabbbed6..e9af29494b 100644
--- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
+++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
@@ -186,18 +186,12 @@ void tst_qstandardpaths::testDataLocation()
{
// On all platforms, DataLocation should be GenericDataLocation / organization name / app name
// This allows one app to access the data of another app.
- {
- const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
- const QString app = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
- QCOMPARE(base, app);
- }
+ const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
+ QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/tst_qstandardpaths");
QCoreApplication::instance()->setOrganizationName("Qt");
+ QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/Qt/tst_qstandardpaths");
QCoreApplication::instance()->setApplicationName("QtTest");
- {
- const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
- const QString app = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
- QCOMPARE(app, base + "/Qt/QtTest");
- }
+ QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/Qt/QtTest");
#ifdef Q_XDG_PLATFORM
setDefaultLocations();