summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2010-05-07 11:51:10 +0300
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2010-05-07 11:55:52 +0300
commitdb1254131c8d372e1d47acbaaa7c5c2b2be5b7d7 (patch)
treea1426d3a70e9f55a2581ee8695d7d476be5e440b
parent175eedd991d321d0902ea0065f9b288c62958a5d (diff)
downloadqt4-tools-db1254131c8d372e1d47acbaaa7c5c2b2be5b7d7.tar.gz
Fix fetchedRoot test variable to work also in Symbian
RVCT builds cannot seem to be able to deal with data symbols at runtime, so made accessors for fetchedRoot test variable. Also moved it out of QFileInfoGatherer class as there is no need to have it there. Reviewed-by: Janne Koskinen
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp15
-rw-r--r--src/gui/dialogs/qfileinfogatherer_p.h3
-rw-r--r--tests/auto/qfiledialog2/tst_qfiledialog2.cpp16
3 files changed, 24 insertions, 10 deletions
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp
index 3b279ae0f1..af0506fc34 100644
--- a/src/gui/dialogs/qfileinfogatherer.cpp
+++ b/src/gui/dialogs/qfileinfogatherer.cpp
@@ -55,7 +55,18 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_FILESYSTEMMODEL
-bool QFileInfoGatherer::fetchedRoot = false;
+#ifdef QT_BUILD_INTERNAL
+static bool fetchedRoot = false;
+Q_AUTOTEST_EXPORT void qt_test_resetFetchedRoot()
+{
+ fetchedRoot = false;
+}
+
+Q_AUTOTEST_EXPORT bool qt_test_isFetchedRoot()
+{
+ return fetchedRoot;
+}
+#endif
/*!
Creates thread
@@ -278,7 +289,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
// List drives
if (path.isEmpty()) {
-#if defined Q_AUTOTEST_EXPORT
+#ifdef QT_BUILD_INTERNAL
fetchedRoot = true;
#endif
QFileInfoList infoList;
diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h
index 5abcd94fe6..8681eb5b96 100644
--- a/src/gui/dialogs/qfileinfogatherer_p.h
+++ b/src/gui/dialogs/qfileinfogatherer_p.h
@@ -195,9 +195,6 @@ private:
uint userId;
uint groupId;
#endif
-public :
- //for testing purpose
- static bool fetchedRoot;
};
#endif // QT_NO_FILESYSTEMMODEL
diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
index 6bfa8be52d..eee495fc33 100644
--- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
+++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp
@@ -76,6 +76,13 @@
# define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
#endif
+#if defined QT_BUILD_INTERNAL
+QT_BEGIN_NAMESPACE
+Q_GUI_EXPORT bool qt_test_isFetchedRoot();
+Q_GUI_EXPORT void qt_test_resetFetchedRoot();
+QT_END_NAMESPACE
+#endif
+
class QNonNativeFileDialog : public QFileDialog
{
Q_OBJECT
@@ -139,7 +146,7 @@ private:
};
tst_QFileDialog2::tst_QFileDialog2()
-{
+{
#if defined(Q_OS_WINCE)
qApp->setAutoMaximizeThreshold(-1);
#endif
@@ -177,19 +184,18 @@ void tst_QFileDialog2::listRoot()
QFileInfoGatherer fileInfoGatherer;
fileInfoGatherer.start();
QTest::qWait(1500);
-
- QFileInfoGatherer::fetchedRoot = false;
+ qt_test_resetFetchedRoot();
QString dir(QDir::currentPath());
QNonNativeFileDialog fd(0, QString(), dir);
fd.show();
- QCOMPARE(QFileInfoGatherer::fetchedRoot,false);
+ QCOMPARE(qt_test_isFetchedRoot(),false);
fd.setDirectory("");
#ifdef Q_OS_WINCE
QTest::qWait(1500);
#else
QTest::qWait(500);
#endif
- QCOMPARE(QFileInfoGatherer::fetchedRoot,true);
+ QCOMPARE(qt_test_isFetchedRoot(),true);
#endif
}