summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Richardson <arichardson.kde@gmail.com>2015-03-03 22:44:23 (GMT)
committerAlex Richardson <arichardson.kde@gmail.com>2015-04-04 11:52:29 (GMT)
commit0436b34a985c3440efdd28c6ab5b9098ead89aef (patch)
tree7df417959d1cbf8fd0b0fa0008d840f0699fe266
parentaf3b4cba17a25fd866f15886eb52a04ef21bae2f (diff)
Use QThread::msleep() instead of platform-specific sleep functions
-rw-r--r--generators/dvi/generator_dvi.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/generators/dvi/generator_dvi.cpp b/generators/dvi/generator_dvi.cpp
index fe0217e..7a6c4f0 100644
--- a/generators/dvi/generator_dvi.cpp
+++ b/generators/dvi/generator_dvi.cpp
@@ -37,12 +37,7 @@
#include <KLocalizedString>
#ifdef DVI_OPEN_BUSYLOOP
-#ifdef Q_OS_UNIX
-#include <ctime>
-#endif
-#ifdef Q_OS_WIN
-#include <windows.h> // for Sleep
-#endif
+#include <QThread>
#endif
static KAboutData createAboutData()
@@ -89,12 +84,7 @@ bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
for ( ; !m_dviRenderer->isValidFile( fileName ) && iter < s_maxIterations; ++iter )
{
qCDebug(OkularDviDebug).nospace() << "file not valid after iteration #" << iter << "/" << s_maxIterations << ", waiting for " << s_waitTime;
-#ifdef Q_OS_WIN
- Sleep( uint( s_waitTime ) );
-#else
- struct timespec ts = { 0, s_waitTime * 1000 * 1000 };
- nanosleep( &ts, NULL );
-#endif
+ QThread::msleep(s_waitTime);
}
if ( iter >= s_maxIterations && !m_dviRenderer->isValidFile( fileName ) )
{