Author: coolo
Date: Tue Dec 11 19:13:07 2007
New Revision: 42985
URL: http://svn.opensuse.org/viewcvs/yast?rev=42985&view=rev
Log:
several bug fixes to speed up the startup
Modified:
trunk/qt4/src/QY2Styler.cc
trunk/qt4/src/YQUI.h
trunk/qt4/src/YQUI_core.cc
trunk/qt4/src/pkg/YQPkgObjList.cc
Modified: trunk/qt4/src/QY2Styler.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/src/QY2Styler.cc?rev=42985&r1=42984&r2=42985&view=diff
==============================================================================
--- trunk/qt4/src/QY2Styler.cc (original)
+++ trunk/qt4/src/QY2Styler.cc Tue Dec 11 19:13:07 2007
@@ -77,7 +77,9 @@
}
QPixmap result( wid->size() );
- result.fill( QColor( 0, 0, 0, 0 ) );
+ if ( wid->contentsRect() != wid->rect() )
+ result.fill( QColor( 0, 128, 0, 0 ) );
+
QPainter pain( &result );
pain.drawImage( wid->contentsRect().topLeft(), _backgroundPx[name].scaled( wid->contentsRect().width(), wid->contentsRect().height() ) );
Modified: trunk/qt4/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/src/YQUI.h?rev=42985&r1=42984&r2=42985&view=diff
==============================================================================
--- trunk/qt4/src/YQUI.h (original)
+++ trunk/qt4/src/YQUI.h Tue Dec 11 19:13:07 2007
@@ -413,6 +413,8 @@
**/
void userInputTimeout();
+ void leaveIdleLoop();
+
//
// Data members
//
@@ -446,6 +448,8 @@
**/
bool _do_exit_loop;
+ bool _leave_idle_loop;
+
/**
* Event loop object. Required since a YaST2 UI needs to react to commands
* from the YCP command stream as well as to X11 / Qt events.
@@ -532,6 +536,7 @@
**/
void slotUserInputTimeout();
+ void slotLeaveIdleLoop();
};
#endif // YQUI_h
Modified: trunk/qt4/src/YQUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/src/YQUI_core.cc?rev=42985&r1=42984&r2=42985&view=diff
==============================================================================
--- trunk/qt4/src/YQUI_core.cc (original)
+++ trunk/qt4/src/YQUI_core.cc Tue Dec 11 19:13:07 2007
@@ -381,21 +381,29 @@
{
init_ui();
- // runs in main thread
- _eventLoop->wakeUp();
+ _leave_idle_loop = false;
- fd_set rfds;
+ // process Qt events until fd_ycp is readable.
+ QSocketNotifier * notifier = new QSocketNotifier( fd_ycp, QSocketNotifier::Read );
+ QObject::connect( notifier, SIGNAL( activated ( int ) ),
+ _qobject, SLOT( slotLeaveIdleLoop() ) );
- FD_ZERO(&rfds);
- FD_SET(fd_ycp, &rfds);
+ notifier->setEnabled( true );
- while (true)
- {
- int retval = select(fd_ycp+1, &rfds, NULL, NULL, NULL);
- if (retval)
- break;
- }
- _eventLoop->exit();
+ while ( !_leave_idle_loop )
+ _eventLoop->processEvents( QEventLoop::ExcludeUserInputEvents | QEventLoop::WaitForMoreEvents );
+
+ delete notifier;
+}
+
+void YQUI::leaveIdleLoop()
+{
+ _leave_idle_loop = true;
+}
+
+void YQUI_Ui::slotLeaveIdleLoop()
+{
+ YQUI::ui()->leaveIdleLoop();
}
void YQUI::sendEvent( YEvent * event )
@@ -418,7 +426,7 @@
_eventLoop->wakeUp();
blocked_level = 0;
- //y2milestone( "userInput %ld", timeout_millisec );
+ //y2milestone( "userInput %ld %ld", timeout_millisec, QThread::currentThreadId() );
YEvent * event = 0;
YQDialog * dialog = dynamic_cast