From kde-commits Sat Sep 30 20:54:45 2006 From: Mart Kelder Date: Sat, 30 Sep 2006 20:54:45 +0000 To: kde-commits Subject: branches/KDE/3.5/kdepim/korn Message-Id: <1159649685.368462.307.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=115964969722850 SVN commit 590788 by mkelder: Delay startup in certain circumstances for bug 129547 CCBUG: 129547 M +29 -4 kornshell.cpp M +3 -3 kornshell.h --- branches/KDE/3.5/kdepim/korn/kornshell.cpp #590787:590788 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, Mart Kelder (mart.kde@hccnet.nl) + * Copyright (C) 2004-2006, Mart Kelder (mart@kelder31.nl) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,17 +26,32 @@ #include #include +#include #include #include +#include + KornShell::KornShell( QWidget * parent, const char * name ) : QWidget( parent, name ), _config( new KConfig( "kornrc" ) ), _box( 0 ), - _configDialog( 0 ) + _configDialog( 0 ), + _show( false ) { _config->checkUpdate( "korn_kde_3_4_config_change", "korn-3-4-config_change.upd" ); - readConfig(); + if( kapp->isRestored() ) + { + _config->setGroup( "korn" ); + QTimer::singleShot( _config->readNumEntry( "session_startup_delay", 200 ), this, SLOT(readConfig()) ); + kdDebug() << "startup delayed" << endl; + } + else + { + kdDebug() << "Startup not delayed" << endl; + readConfig(); + } + } KornShell::~KornShell() @@ -49,7 +64,10 @@ void KornShell::show() { - _box->showBox(); + if( _box ) + _box->showBox(); + else + _show = true; } void KornShell::optionDlg() @@ -103,6 +121,13 @@ { kapp->quit(); } + + if( _show ) + { + // Show is called, but _box wasn't available at that time + show(); + _show = false; + } } void KornShell::slotDialogClosed() --- branches/KDE/3.5/kdepim/korn/kornshell.h #590787:590788 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, Mart Kelder (mart.kde@hccnet.nl) + * Copyright (C) 2004-2006, Mart Kelder (mart@kelder31.nl) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,13 +45,13 @@ private slots: void slotDialogClosed(); void slotApply(); + void readConfig(); private: - void readConfig(); - KConfig *_config; BoxContainer *_box; KDialogBase *_configDialog; + bool _show; }; #endif //MK_KORNSHELL_H