]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/mainwin.cpp
Fix another bat seg fault
[bacula/bacula] / bacula / src / qt-console / mainwin.cpp
index 676ee898cb6c27df6c4223a32b647e2548e336c3..15d75658251e0c57b5dd46999817ba4a7f4c87d7 100644 (file)
@@ -177,11 +177,12 @@ void MainWin::createPages()
       new MediaList();
       new MediaView();
       new Storage();
-      if (m_openBrowser)
+      if (m_openBrowser) {
          new restoreTree();
-      if (m_openDirStat)
+      }
+      if (m_openDirStat) {
          new DirStat();
-
+      }
       treeWidget->expandItem(topItem);
       tabWidget->setCurrentWidget(m_currentConsole);
    }
@@ -323,10 +324,14 @@ void MainWin::waitEnter()
  */
 void MainWin::waitExit()
 {
+   if (!m_waitState || m_isClosing) {
+      return;
+   }
    m_waitState = false;
    if (mainWin->m_connDebug) Pmsg0(000, "Exiting Wait State\n");
-   if (m_waitTreeItem != treeWidget->currentItem())
+   if (m_waitTreeItem && (m_waitTreeItem != treeWidget->currentItem())) {
       treeWidget->setCurrentItem(m_waitTreeItem);
+   }
    if (m_doConnect) {
       connectSignals();
       connectConsoleSignals();
@@ -515,9 +520,7 @@ void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *pre
       }
       /* set the value for the currently active console */
       int stackindex = tabWidget->indexOf(nextPage);
-      if (!nextPage->isOnceDocked()) {
-         nextPage->dockPage();
-      }
+      nextPage->firstUseDock();
    
       /* Is this page currently on the stack or is it undocked */
       if (stackindex >= 0) {