don't loop too much, just takes CPU
authorcoolo <coolo@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Mon, 26 Nov 2007 15:10:34 +0000 (15:10 +0000)
committercoolo <coolo@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Mon, 26 Nov 2007 15:10:34 +0000 (15:10 +0000)
git-svn-id: http://svn.opensuse.org/svn/yast/branches/tmp/coolo/qt4-port@42404 e0cc52ee-31ee-0310-8b87-e83c4596d67c

src/YQUI_core.cc
src/pkg/Makefile.am

index a23368b..db85905 100644 (file)
@@ -104,6 +104,9 @@ void YQUI::init_ui()
 
     new QApplication( _ui_argc, _ui_argv);
     _busy_cursor_timer = new QTimer( qApp );
+    _busy_cursor_timer->setSingleShot( true );
+
+    _user_input_timer.setSingleShot( true );
 
     _normalPalette = qApp->palette();
 
@@ -433,7 +436,7 @@ YEvent * YQUI::userInput( unsigned long timeout_millisec )
 {
     init_ui();
 
-    //y2milestone( "userInput %ld", QThread::currentThreadId () );
+    // y2milestone( "userInput %ld", timeout_millisec );
 
     YEvent *   event  = 0;
     YQDialog * dialog = dynamic_cast<YQDialog *> ( YDialog::currentDialog( false ) );
@@ -444,7 +447,7 @@ YEvent * YQUI::userInput( unsigned long timeout_millisec )
     if ( dialog )
     {
        if ( timeout_millisec > 0 )
-           _user_input_timer.start( timeout_millisec, true ); // single shot
+           _user_input_timer.start( timeout_millisec ); // single shot
 
        dialog->activate( true );
 
@@ -454,7 +457,10 @@ YEvent * YQUI::userInput( unsigned long timeout_millisec )
        normalCursor();
        _do_exit_loop = true; // should exit_loop() be called in sendEvent()?
 
-       _eventLoop->processEvents();
+        while ( ! pendingEvent() )
+       {
+           _eventLoop->processEvents(QEventLoop::WaitForMoreEvents);
+       }
 
        _do_exit_loop = false;
 
@@ -464,7 +470,7 @@ YEvent * YQUI::userInput( unsigned long timeout_millisec )
        // Display a busy cursor, but only if there is no other activity within
        // BUSY_CURSOR_TIMEOUT milliseconds (avoid cursor flicker)
 
-       _busy_cursor_timer->start( BUSY_CURSOR_TIMEOUT, true ); // single shot
+       _busy_cursor_timer->start( BUSY_CURSOR_TIMEOUT ); // single shot
     }
 
     if ( _user_input_timer.isActive() )
index 039d0a4..9c33b6d 100644 (file)
@@ -16,17 +16,17 @@ AM_CXXFLAGS = -DY2LOG=\"ui-qt\"                             \
 
 # plugin, libtool forces 'lib' prefix
 # plugin_LTLIBRARIES = libpy2qt_pkg.la
-plugin_LTLIBRARIES = libpy2qt_pkg.la
-libpy2qt_pkg_la_LDFLAGS = -version-info 2:0
+plugin_LTLIBRARIES = libpy2qt4_pkg.la
+libpy2qt4_pkg_la_LDFLAGS = -version-info 2:0
 
-libpy2qt_pkg_la_LIBADD =                       \
+libpy2qt4_pkg_la_LIBADD =                      \
        -L$(plugindir) -lpy2UI                  \
        -L$(QTLIBDIR) -lQtGui -lQt3Support      \
        ${ZYPP_LIBS}
 
 noinst_HEADERS = $(wildcard *.h)
 
-libpy2qt_pkg_la_SOURCES =                      \
+libpy2qt4_pkg_la_SOURCES =                     \
        YQPackageSelector.cc                    \
        YQPackageSelectorBase.cc                \
        YQPackageSelectorHelp.cc                \