From 691c3a273ac4131975d55a699517cbb69f707bf0 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 29 Oct 2009 21:40:07 +0100 Subject: [PATCH] Fix Restore dlg seg fault + minor cleanups in bat --- bacula/src/qt-console/bcomm/dircomm.cpp | 4 +++- bacula/src/qt-console/jobgraphs/jobplot.cpp | 8 +++++--- bacula/src/qt-console/make-win32 | 2 ++ bacula/src/qt-console/restore/restore.cpp | 6 ++++-- bacula/src/qt-console/status/clientstat.cpp | 4 ++-- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/bacula/src/qt-console/bcomm/dircomm.cpp b/bacula/src/qt-console/bcomm/dircomm.cpp index 86f97478b7..5a36583313 100644 --- a/bacula/src/qt-console/bcomm/dircomm.cpp +++ b/bacula/src/qt-console/bcomm/dircomm.cpp @@ -451,7 +451,9 @@ bool DirComm::notify(bool enable) bool prev_enabled = false; if (m_notifier) { prev_enabled = m_notifier->isEnabled(); - m_notifier->setEnabled(enable); + if (prev_enabled != enable) { + m_notifier->setEnabled(enable); + } if (mainWin->m_connDebug) { if (prev_enabled && !enable) Pmsg2(000, "m_notifier Disabling notifier: %i %s\n", m_conn, m_console->m_dir->name()); diff --git a/bacula/src/qt-console/jobgraphs/jobplot.cpp b/bacula/src/qt-console/jobgraphs/jobplot.cpp index 2fe38d5f28..f2b56735c1 100644 --- a/bacula/src/qt-console/jobgraphs/jobplot.cpp +++ b/bacula/src/qt-console/jobgraphs/jobplot.cpp @@ -135,7 +135,7 @@ void JobPlot::reGraph() void JobPlot::setupControls() { QStringList graphType = QStringList() << /* tr("Fitted") <<*/ tr("Sticks") - << tr("Lines") << tr("Steps") << tr("None"); + << tr("Lines") << tr("Steps") << tr("None"); controls->plotTypeCombo->addItems(graphType); fillSymbolCombo(controls->fileSymbolTypeCombo); @@ -219,7 +219,7 @@ void JobPlot::runQuery() int volumeIndex = controls->volumeComboBox->currentIndex(); if ((volumeIndex != -1) && (controls->volumeComboBox->itemText(volumeIndex) != tr("Any"))) { query += " LEFT OUTER JOIN JobMedia ON (JobMedia.JobId=Job.JobId)" - " LEFT OUTER JOIN Media ON (JobMedia.MediaId=Media.MediaId)"; + " LEFT OUTER JOIN Media ON (JobMedia.MediaId=Media.MediaId)"; conditions.append("Media.VolumeName='" + controls->volumeComboBox->itemText(volumeIndex) + "'"); } comboCond(conditions, controls->fileSetComboBox, "FileSet.FileSet"); @@ -571,6 +571,8 @@ void JobPlot::readSplitterSettings() { QSettings settings(m_console->m_dir->name(), "bat"); settings.beginGroup("JobPlot"); - if (settings.contains("m_splitterSizes")) { m_splitter->restoreState(settings.value("m_splitterSizes").toByteArray()); } + if (settings.contains("m_splitterSizes")) { + m_splitter->restoreState(settings.value("m_splitterSizes").toByteArray()); + } settings.endGroup(); } diff --git a/bacula/src/qt-console/make-win32 b/bacula/src/qt-console/make-win32 index a0683000a3..4b4ed4a27d 100755 --- a/bacula/src/qt-console/make-win32 +++ b/bacula/src/qt-console/make-win32 @@ -13,4 +13,6 @@ if test -e ../config.h.orig ; then fi if test -d ../win32/release32; then cp -f debug/bat.exe ../win32/release32 + cp -f ${DEPKGS}/depkgs-mingw32/lib/qt/QtGui4.dll ../win32/release32 + cp -f ${DEPKGS}/depkgs-mingw32/lib/qt/QtCore4.dll ../win32/release32 fi diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 557a6d05b4..8f30997c93 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -491,7 +491,6 @@ void restorePage::writeSettings() { QSettings settings(m_console->m_dir->name(), "bat"); settings.beginGroup("RestorePage"); - m_splitText = "splitterSizes_2"; settings.setValue(m_splitText, splitter->saveState()); settings.endGroup(); } @@ -501,8 +500,11 @@ void restorePage::writeSettings() */ void restorePage::readSettings() { + m_splitText = "splitterSizes_2"; QSettings settings(m_console->m_dir->name(), "bat"); settings.beginGroup("RestorePage"); - if (settings.contains(m_splitText)) { splitter->restoreState(settings.value(m_splitText).toByteArray()); } + if (settings.contains(m_splitText)) { + splitter->restoreState(settings.value(m_splitText).toByteArray()); + } settings.endGroup(); } diff --git a/bacula/src/qt-console/status/clientstat.cpp b/bacula/src/qt-console/status/clientstat.cpp index 3a1ba5bd67..42d2fdba87 100644 --- a/bacula/src/qt-console/status/clientstat.cpp +++ b/bacula/src/qt-console/status/clientstat.cpp @@ -179,8 +179,8 @@ void ClientStat::populateTerminated() if (field == "OK") p_tableitem->setBackground(Qt::green); else - p_tableitem->setBackground(Qt::red); - } + p_tableitem->setBackground(Qt::red); + } terminatedTable->setItem(results.size() - row - 1, column, p_tableitem); column += 1; } -- 2.39.5