summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/pwminit.cpp
Unidiff
Diffstat (limited to 'pwmanager/pwmanager/pwminit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwminit.cpp17
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)
88 88
89PwMInit::~PwMInit() 89PwMInit::~PwMInit()
90{ 90{
91 qDebug("PwMInit::~PwMInit() ");
91#ifndef PWM_EMBEDDED 92#ifndef PWM_EMBEDDED
92 SelfTest::cancel(); 93 SelfTest::cancel();
93 // close all open mainwnds 94 // close all open mainwnds
@@ -179,7 +180,6 @@ void PwMInit::initializeApp()
179 0, 180 0,
180 savedCmd.minimized); 181 savedCmd.minimized);
181 } 182 }
182
183 runStatus = running; 183 runStatus = running;
184} 184}
185 185
@@ -322,10 +322,8 @@ PwM * PwMInit::createMainWnd(const QString &loadFile,
322#ifndef DESKTOP_VERSION 322#ifndef DESKTOP_VERSION
323 app->showMainWidget( newWnd ); 323 app->showMainWidget( newWnd );
324#else //DESKTOP_VERSION 324#else //DESKTOP_VERSION
325 app->setMainWidget( newWnd );
326 newWnd->resize (640, 480 ); 325 newWnd->resize (640, 480 );
327 newWnd->show(); 326 newWnd->show();
328 qDebug("show ");
329#endif //DESKTOP_VERSION 327#endif //DESKTOP_VERSION
330 328
331#endif //PWM_EMBEDDED 329#endif //PWM_EMBEDDED
@@ -391,7 +389,7 @@ again:
391 } 389 }
392 390
393 if (doMinimizeToTray) { 391 if (doMinimizeToTray) {
394 392 qDebug("doMinimizeToTray ");
395 PWM_ASSERT(_tray); 393 PWM_ASSERT(_tray);
396 int mmlock = conf()->confGlobMinimizeLock(); 394 int mmlock = conf()->confGlobMinimizeLock();
397 switch (mmlock) { 395 switch (mmlock) {
@@ -407,6 +405,7 @@ again:
407 WARN(); 405 WARN();
408 } 406 }
409 } else if (doDeleteDoc) { 407 } else if (doDeleteDoc) {
408 qDebug("doDeleteDoc ");
410 if (!wnd->curDoc()->tryDelete()) { 409 if (!wnd->curDoc()->tryDelete()) {
411 /* We failed deleting the doc, 410 /* We failed deleting the doc,
412 * so open a new window with it, again. 411 * so open a new window with it, again.
@@ -431,6 +430,16 @@ again:
431#else 430#else
432 _mainWndList.remove(i); 431 _mainWndList.remove(i);
433#endif 432#endif
433
434 if ( app->mainWidget() == wnd ) {
435 if ( _mainWndList.count() ) {
436#ifndef DESKTOP_VERSION
437 app->showMainWidget(_mainWndList.first() );
438#endif //DESKTOP_VERSION
439
440 }
441 }
442 delete wnd;
434 goto out_success; 443 goto out_success;
435 } 444 }
436 ++i; 445 ++i;