From 22701d6117ae12c4dac67746493c457ccdd2526f Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 29 Apr 2011 17:40:01 +0200 Subject: [PATCH] bat: Call parent constructor in all pages --- bacula/src/qt-console/clients/clients.cpp | 2 +- bacula/src/qt-console/console/console.cpp | 2 +- bacula/src/qt-console/fileset/fileset.cpp | 2 +- bacula/src/qt-console/job/job.cpp | 2 +- bacula/src/qt-console/jobgraphs/jobplot.cpp | 1 + bacula/src/qt-console/joblist/joblist.cpp | 1 + bacula/src/qt-console/joblog/joblog.cpp | 2 +- bacula/src/qt-console/jobs/jobs.cpp | 2 +- bacula/src/qt-console/label/label.cpp | 4 ++-- bacula/src/qt-console/mainwin.cpp | 2 +- bacula/src/qt-console/mediaedit/mediaedit.cpp | 3 ++- bacula/src/qt-console/mediainfo/mediainfo.cpp | 3 ++- bacula/src/qt-console/medialist/medialist.cpp | 2 +- bacula/src/qt-console/medialist/mediaview.cpp | 2 +- bacula/src/qt-console/mount/mount.cpp | 2 +- bacula/src/qt-console/pages.cpp | 2 +- bacula/src/qt-console/restore/brestore.cpp | 2 +- bacula/src/qt-console/restore/prerestore.cpp | 2 +- bacula/src/qt-console/restore/restore.cpp | 2 +- bacula/src/qt-console/restore/restoretree.cpp | 2 +- bacula/src/qt-console/run/estimate.cpp | 2 +- bacula/src/qt-console/run/prune.cpp | 2 +- bacula/src/qt-console/run/run.cpp | 5 +++-- bacula/src/qt-console/run/runcmd.cpp | 2 +- bacula/src/qt-console/select/select.cpp | 4 ++-- bacula/src/qt-console/status/clientstat.cpp | 1 + bacula/src/qt-console/status/dirstat.cpp | 2 +- bacula/src/qt-console/status/storstat.cpp | 1 + bacula/src/qt-console/storage/content.cpp | 2 +- bacula/src/qt-console/storage/storage.cpp | 2 +- bacula/src/qt-console/util/fmtwidgetitem.cpp | 4 ++-- 31 files changed, 38 insertions(+), 31 deletions(-) diff --git a/bacula/src/qt-console/clients/clients.cpp b/bacula/src/qt-console/clients/clients.cpp index 8378f6620a..bce43e164b 100644 --- a/bacula/src/qt-console/clients/clients.cpp +++ b/bacula/src/qt-console/clients/clients.cpp @@ -43,7 +43,7 @@ #include "status/clientstat.h" #include "util/fmtwidgetitem.h" -Clients::Clients() +Clients::Clients() : Pages() { setupUi(this); m_name = tr("Clients"); diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index 5e9967ebd4..2c5d2e0f07 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -38,7 +38,7 @@ #include "select.h" #include "run/run.h" -Console::Console(QTabWidget *parent) +Console::Console(QTabWidget *parent) : Pages() { QFont font; m_name = tr("Console"); diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index 089f49f547..13f6c5482b 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -41,7 +41,7 @@ #include "fileset/fileset.h" #include "util/fmtwidgetitem.h" -FileSet::FileSet() +FileSet::FileSet() : Pages() { setupUi(this); m_name = tr("FileSets"); diff --git a/bacula/src/qt-console/job/job.cpp b/bacula/src/qt-console/job/job.cpp index 63899c37a8..f8906760a4 100644 --- a/bacula/src/qt-console/job/job.cpp +++ b/bacula/src/qt-console/job/job.cpp @@ -32,7 +32,7 @@ #include "mediainfo/mediainfo.h" #include "run/run.h" -Job::Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem) +Job::Job(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem) : Pages() { setupUi(this); pgInitialize(tr("Job"), parentTreeWidgetItem); diff --git a/bacula/src/qt-console/jobgraphs/jobplot.cpp b/bacula/src/qt-console/jobgraphs/jobplot.cpp index 96cc02b919..95dc4a7b81 100644 --- a/bacula/src/qt-console/jobgraphs/jobplot.cpp +++ b/bacula/src/qt-console/jobgraphs/jobplot.cpp @@ -75,6 +75,7 @@ JobPlotControls::JobPlotControls() * Constructor, this class does not inherit anything but pages. */ JobPlot::JobPlot(QTreeWidgetItem *parentTreeWidgetItem, JobPlotPass &passVals) + : Pages() { setupUserInterface(); pgInitialize(tr("JobPlot"), parentTreeWidgetItem); diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 2cffc47ef1..cab9abdd68 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -49,6 +49,7 @@ */ JobList::JobList(const QString &mediaName, const QString &clientName, const QString &jobName, const QString &filesetName, QTreeWidgetItem *parentTreeWidgetItem) + : Pages() { setupUi(this); m_name = "Jobs Run"; /* treeWidgetName has a virtual override in this class */ diff --git a/bacula/src/qt-console/joblog/joblog.cpp b/bacula/src/qt-console/joblog/joblog.cpp index f1fec50382..25e4c6fe69 100644 --- a/bacula/src/qt-console/joblog/joblog.cpp +++ b/bacula/src/qt-console/joblog/joblog.cpp @@ -38,7 +38,7 @@ #include "bat.h" #include "joblog.h" -JobLog::JobLog(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem) +JobLog::JobLog(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem) : Pages() { setupUi(this); pgInitialize(tr("JobLog"), parentTreeWidgetItem); diff --git a/bacula/src/qt-console/jobs/jobs.cpp b/bacula/src/qt-console/jobs/jobs.cpp index a4ddd6347f..9cf4afee3b 100644 --- a/bacula/src/qt-console/jobs/jobs.cpp +++ b/bacula/src/qt-console/jobs/jobs.cpp @@ -40,7 +40,7 @@ #include "run/run.h" #include "util/fmtwidgetitem.h" -Jobs::Jobs() +Jobs::Jobs() : Pages() { setupUi(this); m_name = tr("Jobs"); diff --git a/bacula/src/qt-console/label/label.cpp b/bacula/src/qt-console/label/label.cpp index 6b43496aca..3afbae22bc 100644 --- a/bacula/src/qt-console/label/label.cpp +++ b/bacula/src/qt-console/label/label.cpp @@ -37,7 +37,7 @@ #include "label.h" #include -labelPage::labelPage() +labelPage::labelPage() : Pages() { QString deflt(""); m_closeable = false; @@ -48,7 +48,7 @@ labelPage::labelPage() * An overload of the constructor to have a default storage show in the * combobox on start. Used from context sensitive in storage class. */ -labelPage::labelPage(QString &defString) +labelPage::labelPage(QString &defString) : Pages() { showPage(defString); } diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index eeaf966dfa..bb753afea1 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -861,7 +861,7 @@ void MainWin::setPreferences() } /* Preferences dialog */ -prefsDialog::prefsDialog() +prefsDialog::prefsDialog() : QDialog() { setupUi(this); } diff --git a/bacula/src/qt-console/mediaedit/mediaedit.cpp b/bacula/src/qt-console/mediaedit/mediaedit.cpp index a07040906b..3e3b6d03bc 100644 --- a/bacula/src/qt-console/mediaedit/mediaedit.cpp +++ b/bacula/src/qt-console/mediaedit/mediaedit.cpp @@ -40,7 +40,8 @@ /* * A constructor */ -MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId) +MediaEdit::MediaEdit(QTreeWidgetItem *parentWidget, QString &mediaId) + : Pages() { setupUi(this); pgInitialize(tr("Media Edit"), parentWidget); diff --git a/bacula/src/qt-console/mediainfo/mediainfo.cpp b/bacula/src/qt-console/mediainfo/mediainfo.cpp index e2bda5baf0..f9ba661f15 100644 --- a/bacula/src/qt-console/mediainfo/mediainfo.cpp +++ b/bacula/src/qt-console/mediainfo/mediainfo.cpp @@ -40,7 +40,8 @@ /* * A constructor */ -MediaInfo::MediaInfo(QTreeWidgetItem *parentWidget, QString &mediaName) +MediaInfo::MediaInfo(QTreeWidgetItem *parentWidget, QString &mediaName) + : Pages() { setupUi(this); pgInitialize(tr("Media Info"), parentWidget); diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index 8b1c9a2e67..09d1dff3ed 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -45,7 +45,7 @@ #include "run/run.h" #include "util/fmtwidgetitem.h" -MediaList::MediaList() +MediaList::MediaList() : Pages() { setupUi(this); m_name = tr("Pools"); diff --git a/bacula/src/qt-console/medialist/mediaview.cpp b/bacula/src/qt-console/medialist/mediaview.cpp index 3e3c7ffe6f..e872876d80 100644 --- a/bacula/src/qt-console/medialist/mediaview.cpp +++ b/bacula/src/qt-console/medialist/mediaview.cpp @@ -38,7 +38,7 @@ #include "run/run.h" #include "util/fmtwidgetitem.h" -MediaView::MediaView() +MediaView::MediaView() : Pages() { setupUi(this); m_name = tr("Media"); diff --git a/bacula/src/qt-console/mount/mount.cpp b/bacula/src/qt-console/mount/mount.cpp index abd4c3e1f5..3324a583cc 100644 --- a/bacula/src/qt-console/mount/mount.cpp +++ b/bacula/src/qt-console/mount/mount.cpp @@ -40,7 +40,7 @@ /* * A constructor */ -mountDialog::mountDialog(Console *console, QString &storageName) +mountDialog::mountDialog(Console *console, QString &storageName) : QDialog() { m_console = console; m_storageName = storageName; diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index c98e43eb8d..b22e6bf71a 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -50,7 +50,7 @@ bool isWin32Path(QString &fullPath) } /* Need to initialize variables here */ -Pages::Pages() +Pages::Pages() : QWidget() { m_docked = false; m_onceDocked = false; diff --git a/bacula/src/qt-console/restore/brestore.cpp b/bacula/src/qt-console/restore/brestore.cpp index baa3a27479..f59f721226 100644 --- a/bacula/src/qt-console/restore/brestore.cpp +++ b/bacula/src/qt-console/restore/brestore.cpp @@ -38,7 +38,7 @@ #include "restore.h" #include "util/fmtwidgetitem.h" -bRestore::bRestore() +bRestore::bRestore() : Pages() { m_name = tr("bRestore"); m_client = ""; diff --git a/bacula/src/qt-console/restore/prerestore.cpp b/bacula/src/qt-console/restore/prerestore.cpp index 74d8f74f26..8a89188508 100644 --- a/bacula/src/qt-console/restore/prerestore.cpp +++ b/bacula/src/qt-console/restore/prerestore.cpp @@ -37,7 +37,7 @@ #include "restore.h" /* Constructor to have job id list default in */ -prerestorePage::prerestorePage(QString &data, unsigned int datatype) +prerestorePage::prerestorePage(QString &data, unsigned int datatype) : Pages() { m_dataIn = data; m_dataInType = datatype; diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 107e791d8a..7bf915d8bb 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -38,7 +38,7 @@ static const int dbglvl = 100; -restorePage::restorePage(int conn) +restorePage::restorePage(int conn) : Pages() { Dmsg1(dbglvl, "Construcing restorePage Instance connection %i\n", conn); m_conn = conn; diff --git a/bacula/src/qt-console/restore/restoretree.cpp b/bacula/src/qt-console/restore/restoretree.cpp index f39df9bcfe..fdfbb1adf5 100644 --- a/bacula/src/qt-console/restore/restoretree.cpp +++ b/bacula/src/qt-console/restore/restoretree.cpp @@ -38,7 +38,7 @@ #include "restoretree.h" #include "pages.h" -restoreTree::restoreTree() +restoreTree::restoreTree() : Pages() { setupUi(this); m_name = tr("Version Browser"); diff --git a/bacula/src/qt-console/run/estimate.cpp b/bacula/src/qt-console/run/estimate.cpp index 217155f92f..4b829b5270 100644 --- a/bacula/src/qt-console/run/estimate.cpp +++ b/bacula/src/qt-console/run/estimate.cpp @@ -40,7 +40,7 @@ /* * Setup all the combo boxes and display the dialog */ -estimatePage::estimatePage() +estimatePage::estimatePage() : Pages() { QDateTime dt; diff --git a/bacula/src/qt-console/run/prune.cpp b/bacula/src/qt-console/run/prune.cpp index 3da47f2484..fbe8d324a4 100644 --- a/bacula/src/qt-console/run/prune.cpp +++ b/bacula/src/qt-console/run/prune.cpp @@ -40,7 +40,7 @@ /* * Setup all the combo boxes and display the dialog */ -prunePage::prunePage(const QString &volume, const QString &client) +prunePage::prunePage(const QString &volume, const QString &client) : Pages() { QDateTime dt; diff --git a/bacula/src/qt-console/run/run.cpp b/bacula/src/qt-console/run/run.cpp index 9510f56804..58f6ec51b8 100644 --- a/bacula/src/qt-console/run/run.cpp +++ b/bacula/src/qt-console/run/run.cpp @@ -37,13 +37,13 @@ #include "run.h" -runPage::runPage() +runPage::runPage() : Pages() { init(); show(); } -runPage::runPage(const QString &defJob) +runPage::runPage(const QString &defJob) : Pages() { m_dockOnFirstUse = false; init(); @@ -56,6 +56,7 @@ runPage::runPage(const QString &defJob) runPage::runPage(const QString &defJob, const QString &level, const QString &pool, const QString &storage, const QString &client, const QString &fileset) + : Pages() { m_dockOnFirstUse = false; init(); diff --git a/bacula/src/qt-console/run/runcmd.cpp b/bacula/src/qt-console/run/runcmd.cpp index 99d300986b..f66bcf29be 100644 --- a/bacula/src/qt-console/run/runcmd.cpp +++ b/bacula/src/qt-console/run/runcmd.cpp @@ -45,7 +45,7 @@ /* * Setup all the combo boxes and display the dialog */ -runCmdPage::runCmdPage(int conn) +runCmdPage::runCmdPage(int conn) : Pages() { m_name = tr("Restore Run"); pgInitialize(); diff --git a/bacula/src/qt-console/select/select.cpp b/bacula/src/qt-console/select/select.cpp index ddc0438a5d..3b330fd2d0 100644 --- a/bacula/src/qt-console/select/select.cpp +++ b/bacula/src/qt-console/select/select.cpp @@ -39,7 +39,7 @@ /* * Read the items for the selection */ -selectDialog::selectDialog(Console *console, int conn) +selectDialog::selectDialog(Console *console, int conn) : QDialog() { m_conn = conn; QDateTime dt; @@ -104,7 +104,7 @@ void selectDialog::index_change(int index) /* * Read the items for the selection */ -yesnoPopUp::yesnoPopUp(Console *console, int conn) +yesnoPopUp::yesnoPopUp(Console *console, int conn) : QDialog() { QMessageBox msgBox; diff --git a/bacula/src/qt-console/status/clientstat.cpp b/bacula/src/qt-console/status/clientstat.cpp index b36b22bf58..f38f7d2858 100644 --- a/bacula/src/qt-console/status/clientstat.cpp +++ b/bacula/src/qt-console/status/clientstat.cpp @@ -42,6 +42,7 @@ static bool working = false; /* prevent timer recursion */ * Constructor for the class */ ClientStat::ClientStat(QString &client, QTreeWidgetItem *parentTreeWidgetItem) + : Pages() { m_client = client; setupUi(this); diff --git a/bacula/src/qt-console/status/dirstat.cpp b/bacula/src/qt-console/status/dirstat.cpp index 47c77fc886..24813b6397 100644 --- a/bacula/src/qt-console/status/dirstat.cpp +++ b/bacula/src/qt-console/status/dirstat.cpp @@ -40,7 +40,7 @@ static bool working = false; /* prevent timer recursion */ /* * Constructor for the class */ -DirStat::DirStat() +DirStat::DirStat() : Pages() { setupUi(this); m_name = tr("Director Status"); diff --git a/bacula/src/qt-console/status/storstat.cpp b/bacula/src/qt-console/status/storstat.cpp index f5235b38cf..5e35162b06 100644 --- a/bacula/src/qt-console/status/storstat.cpp +++ b/bacula/src/qt-console/status/storstat.cpp @@ -57,6 +57,7 @@ spooling * Constructor for the class */ StorStat::StorStat(QString &storage, QTreeWidgetItem *parentTreeWidgetItem) + : Pages() { m_storage = storage; setupUi(this); diff --git a/bacula/src/qt-console/storage/content.cpp b/bacula/src/qt-console/storage/content.cpp index 3a3863bde4..10e615c439 100644 --- a/bacula/src/qt-console/storage/content.cpp +++ b/bacula/src/qt-console/storage/content.cpp @@ -42,7 +42,7 @@ // use user selection to add slot= argument // -Content::Content(QString storage, QTreeWidgetItem *parentWidget) +Content::Content(QString storage, QTreeWidgetItem *parentWidget) : Pages() { setupUi(this); pgInitialize(storage, parentWidget); diff --git a/bacula/src/qt-console/storage/storage.cpp b/bacula/src/qt-console/storage/storage.cpp index 3920ccf15a..8d5fd055eb 100644 --- a/bacula/src/qt-console/storage/storage.cpp +++ b/bacula/src/qt-console/storage/storage.cpp @@ -45,7 +45,7 @@ #include "status/storstat.h" #include "util/fmtwidgetitem.h" -Storage::Storage() +Storage::Storage() : Pages() { setupUi(this); pgInitialize(tr("Storage")); diff --git a/bacula/src/qt-console/util/fmtwidgetitem.cpp b/bacula/src/qt-console/util/fmtwidgetitem.cpp index 3d51d277d6..b98bdcb4fb 100644 --- a/bacula/src/qt-console/util/fmtwidgetitem.cpp +++ b/bacula/src/qt-console/util/fmtwidgetitem.cpp @@ -311,7 +311,7 @@ void ItemFormatterBase::setBytesFld(int index, const QString &fld) break; } - setNumericFld(index, msg, qfld); + setNumericFld(index, msg, QVariant(qfld)); } void ItemFormatterBase::setDurationFld(int index, const QString &fld) @@ -354,7 +354,7 @@ void ItemFormatterBase::setDurationFld(int index, const QString &fld) msg += QString(" %1s").arg(dfld); } - setNumericFld(index, msg, fld.trimmed().toLongLong()); + setNumericFld(index, msg, QVariant(fld.trimmed().toLongLong())); } void ItemFormatterBase::setVolStatusFld(int index, const QString &fld, bool center) -- 2.39.5