Changeset View
Changeset View
Standalone View
Standalone View
autotests/utils.h
Show All 25 Lines | |||||
26 | 26 | | |||
27 | namespace Plasma { | 27 | namespace Plasma { | ||
28 | namespace TestUtils { | 28 | namespace TestUtils { | ||
29 | 29 | | |||
30 | static void copyPath(const QString &src, const QString &dst) | 30 | static void copyPath(const QString &src, const QString &dst) | ||
31 | { | 31 | { | ||
32 | QDir dir(src); | 32 | QDir dir(src); | ||
33 | 33 | | |||
34 | foreach (const auto &d, dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) { | 34 | const auto dirList = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); | ||
35 | for (const auto &d : dirList ) { | ||||
35 | QString dst_path = dst + QLatin1Char('/') + d; | 36 | QString dst_path = dst + QLatin1Char('/') + d; | ||
36 | dir.mkpath(dst_path); | 37 | dir.mkpath(dst_path); | ||
37 | copyPath(src + QLatin1Char('/') + d, dst_path); | 38 | copyPath(src + QLatin1Char('/') + d, dst_path); | ||
38 | } | 39 | } | ||
39 | 40 | | |||
40 | foreach (const auto &f, dir.entryList(QDir::Files)) { | 41 | const auto entryList = dir.entryList(QDir::Files); | ||
42 | for (const auto &f : entryList) { | ||||
41 | QFile::copy(src + QLatin1Char('/') + f, dst + QLatin1Char('/') + f); | 43 | QFile::copy(src + QLatin1Char('/') + f, dst + QLatin1Char('/') + f); | ||
42 | } | 44 | } | ||
43 | } | 45 | } | ||
44 | 46 | | |||
45 | static void installPlasmaTheme(const QString &theme = QStringLiteral("breeze")) | 47 | static void installPlasmaTheme(const QString &theme = QStringLiteral("breeze")) | ||
46 | { | 48 | { | ||
47 | QString destinationTheme = (theme == QLatin1String("breeze") ? QStringLiteral("default") : theme); | 49 | QString destinationTheme = (theme == QLatin1String("breeze") ? QStringLiteral("default") : theme); | ||
48 | 50 | | |||
Show All 23 Lines |