]> git.sur5r.net Git - bacula/bacula/commitdiff
Add debug to bat label seg fault bug
authorKern Sibbald <kern@sibbald.com>
Fri, 29 Apr 2011 07:50:04 +0000 (09:50 +0200)
committerKern Sibbald <kern@sibbald.com>
Sun, 1 May 2011 09:54:26 +0000 (11:54 +0200)
bacula/src/qt-console/label/label.cpp
bacula/src/qt-console/pages.cpp
bacula/src/qt-console/pages.h
bacula/src/qt-console/util/fmtwidgetitem.cpp

index e70aa94faa67a2c4aa20fde02fe384218785dce3..6b43496aca2300734d039cf02827516856676d74 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2011 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -96,11 +96,15 @@ void labelPage::okButtonPushed()
                   .arg(storageCombo->currentText()) 
                   .arg(slotSpin->value());
    if (mainWin->m_commandDebug) {
-      Pmsg1(000, "sending command : %s\n",scmd.toUtf8().data());
+      Pmsg1(000, "sending command : %s\n", scmd.toUtf8().data());
+   }
+   if (m_console) {
+      m_console->write_dir(scmd.toUtf8().data());
+      m_console->displayToPrompt(m_conn);
+      m_console->notify(m_conn, true);
+   } else {
+      Pmsg0(000, "m_console==NULL !!!!!!\n");
    }
-   m_console->write_dir(scmd.toUtf8().data());
-   m_console->displayToPrompt(m_conn);
-   m_console->notify(m_conn, true);
    closeStackPage();
    mainWin->resetFocus();
 }
@@ -108,7 +112,11 @@ void labelPage::okButtonPushed()
 void labelPage::cancelButtonPushed()
 {
    this->hide();
-   m_console->notify(m_conn, true);
+   if (m_console) {
+      m_console->notify(m_conn, true);
+   } else {
+      Pmsg0(000, "m_console==NULL !!!!!!\n");
+   }
    closeStackPage();
    mainWin->resetFocus();
 }
index 096932e2cc3a9f223f8c4490f68ad2c9c60073c3..c98e43eb8dbf8c79ab0587e11b5da718cec72c8c 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2011 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -26,8 +26,6 @@
    Switzerland, email:ftf@fsfeurope.org.
 */
 /*
- *   Version $Id$
- *
  *   Dirk Bartley, March 2007
  */
 
@@ -58,6 +56,8 @@ Pages::Pages()
    m_onceDocked = false;
    m_closeable = true;
    m_dockOnFirstUse = true;
+   m_console = NULL;
+   m_parent = NULL;
 }
 
 /* first Use Dock */
index ea098546b1498670519f6fe850e97a2ecc55a517..6dc2d478f6fa1eafe9a3a693612758837ee1a287 100644 (file)
@@ -3,7 +3,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2011 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -28,8 +28,6 @@
    Switzerland, email:ftf@fsfeurope.org.
 */
 /*
- *   Version $Id$
- *
  *   Dirk Bartley, March 2007
  */
 
@@ -55,6 +53,7 @@ class Console;
 class Pages : public QWidget
 {
 public:
+   /* methods */
    Pages();
    void dockPage();
    void undockPage();
@@ -63,8 +62,6 @@ public:
    bool isDocked();
    bool isOnceDocked();
    bool isCloseable();
-   QTabWidget *m_parent;
-   QList<QAction*> m_contextActions;
    virtual void PgSeltreeWidgetClicked();
    virtual void currentStackItem();
    void closeStackPage();
@@ -81,11 +78,17 @@ public:
    void getStatusList(QStringList &);
    void firstUseDock();
 
+   /* members */
+   QTabWidget *m_parent;
+   QList<QAction*> m_contextActions;
+
+
 public slots:
    /* closeEvent is a virtual function inherited from QWidget */
    virtual void closeEvent(QCloseEvent* event);
 
 protected:
+   /* methods */
    void pgInitialize();
    void pgInitialize(const QString &);
    void pgInitialize(const QString &, QTreeWidgetItem *);
@@ -93,6 +96,8 @@ protected:
    virtual void changeEvent(QEvent *event);
    void setConsoleCurrent();
    void setTitle();
+
+   /* members */
    bool m_closeable;
    bool m_docked;
    bool m_onceDocked;
index 3971fc5eb7861d6b67afb50edc6321d3807f470d..3d51d277d60c949c4cdd7cfb2119b24716432daf 100644 (file)
@@ -87,6 +87,7 @@ Freeze::~Freeze()
 
 ItemFormatterBase::BYTES_CONVERSION ItemFormatterBase::cnvFlag(BYTES_CONVERSION_IEC);
 
+/* String to Electronic value based on K=1024 */
 QString convertBytesIEC(qint64 qfld)
 {
    static const qint64 KB = Q_INT64_C(1024);
@@ -132,6 +133,7 @@ QString convertBytesIEC(qint64 qfld)
    return QString("%1 %2iB").arg(qfld / 1000.0, 0, 'f', 2).arg(suffix);
 }
 
+/* String to human value based on k=1000 */
 QString convertBytesSI(qint64 qfld)
 {
    static const qint64 KB = Q_INT64_C(1000);