]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/mainwin.cpp
Tweak some comments and formatting.
[bacula/bacula] / bacula / src / qt-console / mainwin.cpp
index 204d9af0b9d6c729d090b517f755f7f193643327..ed9852e746c0de6af710931e0c5c9161d5cab265 100644 (file)
@@ -186,9 +186,9 @@ void MainWin::createPages()
       new MediaList();
       new MediaView();
       new Storage();
-      if (m_openBrowser) {
-         new restoreTree();
-      }
+//    if (m_openBrowser) {
+//       new restoreTree();
+//    }
       if (m_openDirStat) {
          new DirStat();
       }
@@ -442,8 +442,8 @@ void MainWin::readSettings()
 void MainWin::treeItemClicked(QTreeWidgetItem *item, int /*column*/)
 {
    /* Is this a page that has been inserted into the hash  */
-   if (getFromHash(item)) {
-      Pages* page = getFromHash(item);
+   Pages* page = getFromHash(item);
+   if (page) {
       int stackindex = tabWidget->indexOf(page);
 
       if (stackindex >= 0) {
@@ -573,7 +573,7 @@ void MainWin::estimateButtonClicked()
 
 void MainWin::browseButtonClicked() 
 {
-   new restoreTree();
+//   new restoreTree();
 }
 
 void MainWin::statusPageButtonClicked()
@@ -651,9 +651,8 @@ void MainWin::set_statusf(const char *fmt, ...)
 {
    va_list arg_ptr;
    char buf[1000];
-   int len;
    va_start(arg_ptr, fmt);
-   len = bvsnprintf(buf, sizeof(buf), fmt, arg_ptr);
+   bvsnprintf(buf, sizeof(buf), fmt, arg_ptr);
    va_end(arg_ptr);
    set_status(buf);
 }
@@ -679,7 +678,9 @@ void MainWin::set_status(const char *buf)
 void MainWin::undockWindowButton()
 {
    Pages* page = (Pages*)tabWidget->currentWidget();
-   page->togglePageDocking();
+   if (page) {
+      page->togglePageDocking();
+   }
 }
 
 /*
@@ -694,7 +695,9 @@ void MainWin::toggleDockContextWindow()
    /* Is this a page that has been inserted into the hash  */
    if (getFromHash(currentitem)) {
       Pages* page = getFromHash(currentitem);
-      page->togglePageDocking();
+      if (page) {
+         page->togglePageDocking();
+      }
    }
 }
 
@@ -708,7 +711,9 @@ void MainWin::stackItemChanged(int)
    if (m_isClosing) return; /* if closing the application, do nothing here */
    Pages* page = (Pages*)tabWidget->currentWidget();
    /* run the virtual function in case this class overrides it */
-   page->currentStackItem();
+   if (page) {
+      page->currentStackItem();
+   }
    if (!m_waitState) {
       disconnect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(treeItemClicked(QTreeWidgetItem *, int)));
       disconnect(treeWidget, SIGNAL( currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
@@ -772,7 +777,7 @@ void MainWin::closeCurrentPage()
 void MainWin::closePage(int item)
 {
    QTreeWidgetItem *currentitem;
-   Pages *page;
+   Pages *page = NULL;
 
    if (item >= 0) {
      page = (Pages *)tabWidget->widget(item);
@@ -855,7 +860,7 @@ void MainWin::setPreferences()
 }
 
 /* Preferences dialog */
-prefsDialog::prefsDialog()
+prefsDialog::prefsDialog() : QDialog()
 {
    setupUi(this);
 }