tests/auto/qfiledialog2/tst_qfiledialog2.cpp
changeset 30 5dc02b23752f
parent 19 fcece45ef507
child 33 3e2da88830cd
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
    74 # define STRINGIFY(x) #x
    74 # define STRINGIFY(x) #x
    75 # define TOSTRING(x) STRINGIFY(x)
    75 # define TOSTRING(x) STRINGIFY(x)
    76 # define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
    76 # define SRCDIR "C:/Private/" TOSTRING(SYMBIAN_SRCDIR_UID) "/"
    77 #endif
    77 #endif
    78 
    78 
       
    79 #if defined QT_BUILD_INTERNAL
       
    80 QT_BEGIN_NAMESPACE
       
    81 Q_GUI_EXPORT bool qt_test_isFetchedRoot();
       
    82 Q_GUI_EXPORT void qt_test_resetFetchedRoot();
       
    83 QT_END_NAMESPACE
       
    84 #endif
       
    85 
    79 class QNonNativeFileDialog : public QFileDialog
    86 class QNonNativeFileDialog : public QFileDialog
    80 {
    87 {
    81     Q_OBJECT
    88     Q_OBJECT
    82 public:
    89 public:
    83     QNonNativeFileDialog(QWidget *parent = 0, const QString &caption = QString(), const QString &directory = QString(), const QString &filter = QString())
    90     QNonNativeFileDialog(QWidget *parent = 0, const QString &caption = QString(), const QString &directory = QString(), const QString &filter = QString())
   137 private:
   144 private:
   138     QByteArray userSettings;
   145     QByteArray userSettings;
   139 };
   146 };
   140 
   147 
   141 tst_QFileDialog2::tst_QFileDialog2()
   148 tst_QFileDialog2::tst_QFileDialog2()
   142 {   
   149 {
   143 #if defined(Q_OS_WINCE)
   150 #if defined(Q_OS_WINCE)
   144     qApp->setAutoMaximizeThreshold(-1);
   151     qApp->setAutoMaximizeThreshold(-1);
   145 #endif
   152 #endif
   146 }
   153 }
   147 
   154 
   175 {
   182 {
   176 #if defined QT_BUILD_INTERNAL
   183 #if defined QT_BUILD_INTERNAL
   177     QFileInfoGatherer fileInfoGatherer;
   184     QFileInfoGatherer fileInfoGatherer;
   178     fileInfoGatherer.start();
   185     fileInfoGatherer.start();
   179     QTest::qWait(1500);
   186     QTest::qWait(1500);
   180 
   187     qt_test_resetFetchedRoot();
   181     QFileInfoGatherer::fetchedRoot = false;
       
   182     QString dir(QDir::currentPath());
   188     QString dir(QDir::currentPath());
   183     QNonNativeFileDialog fd(0, QString(), dir);
   189     QNonNativeFileDialog fd(0, QString(), dir);
   184     fd.show();
   190     fd.show();
   185     QCOMPARE(QFileInfoGatherer::fetchedRoot,false);
   191     QCOMPARE(qt_test_isFetchedRoot(),false);
   186     fd.setDirectory("");
   192     fd.setDirectory("");
   187 #ifdef Q_OS_WINCE
   193 #ifdef Q_OS_WINCE
   188     QTest::qWait(1500);
   194     QTest::qWait(1500);
   189 #else
   195 #else
   190     QTest::qWait(500);
   196     QTest::qWait(500);
   191 #endif
   197 #endif
   192     QCOMPARE(QFileInfoGatherer::fetchedRoot,true);
   198     QCOMPARE(qt_test_isFetchedRoot(),true);
   193 #endif
   199 #endif
   194 }
   200 }
   195 
   201 
   196 void tst_QFileDialog2::heapCorruption()
   202 void tst_QFileDialog2::heapCorruption()
   197 {
   203 {