Diffstat (limited to 'pwmanager/pwmanager/pwminit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | pwmanager/pwmanager/pwminit.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp index d775aa9..fbd17a7 100644 --- a/pwmanager/pwmanager/pwminit.cpp +++ b/pwmanager/pwmanager/pwminit.cpp @@ -88,6 +88,7 @@ PwMInit::PwMInit(PwMApplication *_app) PwMInit::~PwMInit() { + qDebug("PwMInit::~PwMInit() "); #ifndef PWM_EMBEDDED SelfTest::cancel(); // close all open mainwnds @@ -179,7 +180,6 @@ void PwMInit::initializeApp() 0, savedCmd.minimized); } - runStatus = running; } @@ -322,10 +322,8 @@ PwM * PwMInit::createMainWnd(const QString &loadFile, #ifndef DESKTOP_VERSION app->showMainWidget( newWnd ); #else //DESKTOP_VERSION - app->setMainWidget( newWnd ); newWnd->resize (640, 480 ); newWnd->show(); - qDebug("show "); #endif //DESKTOP_VERSION #endif //PWM_EMBEDDED @@ -391,7 +389,7 @@ again: } if (doMinimizeToTray) { - + qDebug("doMinimizeToTray "); PWM_ASSERT(_tray); int mmlock = conf()->confGlobMinimizeLock(); switch (mmlock) { @@ -407,6 +405,7 @@ again: WARN(); } } else if (doDeleteDoc) { + qDebug("doDeleteDoc "); if (!wnd->curDoc()->tryDelete()) { /* We failed deleting the doc, * so open a new window with it, again. @@ -431,6 +430,16 @@ again: #else _mainWndList.remove(i); #endif + + if ( app->mainWidget() == wnd ) { + if ( _mainWndList.count() ) { +#ifndef DESKTOP_VERSION + app->showMainWidget(_mainWndList.first() ); +#endif //DESKTOP_VERSION + + } + } + delete wnd; goto out_success; } ++i; |