From: Dirk H Bartley Date: Wed, 23 Jul 2008 18:23:04 +0000 (+0000) Subject: The fix that I did last night seems to be occuring in just about all of the X-Git-Tag: Release-3.0.0~1119 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cc832ba497bc7cfd8d2a81b23a33077ccdc73db9;p=bacula%2Fbacula The fix that I did last night seems to be occuring in just about all of the major classes. So I put the fix into the rest of the them and added an initialization of the variable to false in the constructor. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7427 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/clients/clients.cpp b/bacula/src/qt-console/clients/clients.cpp index 09a9def72b..ce4b25dd56 100644 --- a/bacula/src/qt-console/clients/clients.cpp +++ b/bacula/src/qt-console/clients/clients.cpp @@ -53,6 +53,7 @@ Clients::Clients() /* tableWidget, Storage Tree Tree Widget inherited from ui_client.h */ m_populated = false; + m_populating = false; m_checkcurwidget = true; m_closeable = false; /* add context sensitive menu items specific to this classto the page @@ -72,11 +73,15 @@ Clients::~Clients() */ void Clients::populateTable() { - QBrush blackBrush(Qt::black); + if (m_populating) + return; + m_populating = true; if (!m_console->preventInUseConnect()) return; + QBrush blackBrush(Qt::black); + QStringList headerlist = (QStringList() << tr("Client Name") << tr("File Retention") << tr("Job Retention") << tr("AutoPrune") << tr("ClientId") << tr("Uname") ); @@ -157,6 +162,7 @@ void Clients::populateTable() /* Resize rows and columns */ tableWidget->resizeColumnsToContents(); tableWidget->resizeRowsToContents(); + m_populating = false; } /* diff --git a/bacula/src/qt-console/clients/clients.h b/bacula/src/qt-console/clients/clients.h index 8c206faa49..f90866a138 100644 --- a/bacula/src/qt-console/clients/clients.h +++ b/bacula/src/qt-console/clients/clients.h @@ -63,6 +63,7 @@ private: void createContextMenu(); QString m_currentlyselected; bool m_populated; + bool m_populating; bool m_checkcurwidget; }; diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index 915afa933e..466639bbd1 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -51,6 +51,7 @@ FileSet::FileSet() /* tableWidget, FileSet Tree Tree Widget inherited from ui_fileset.h */ m_populated = false; + m_populating = false; m_checkcurwidget = true; m_closeable = false; readSettings(); @@ -71,11 +72,15 @@ FileSet::~FileSet() */ void FileSet::populateTable() { - QBrush blackBrush(Qt::black); + if (m_populating) + return; + m_populating = true; if (!m_console->preventInUseConnect()) return; + QBrush blackBrush(Qt::black); + m_checkcurwidget = false; tableWidget->clear(); m_checkcurwidget = true; @@ -140,6 +145,7 @@ void FileSet::populateTable() /* Resize rows and columns */ tableWidget->resizeColumnsToContents(); tableWidget->resizeRowsToContents(); + m_populating = false; } /* diff --git a/bacula/src/qt-console/fileset/fileset.h b/bacula/src/qt-console/fileset/fileset.h index 8973c3405e..dc22372621 100644 --- a/bacula/src/qt-console/fileset/fileset.h +++ b/bacula/src/qt-console/fileset/fileset.h @@ -62,6 +62,7 @@ private: void createContextMenu(); QString m_currentlyselected; bool m_populated; + bool m_populating; bool m_checkcurwidget; }; diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 1e08be172d..6bc2610414 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -62,6 +62,7 @@ JobList::JobList(const QString &mediaName, const QString &clientName, m_resultCount = 0; m_populated = false; + m_populating = false; m_closeable = false; if ((m_mediaName != "") || (m_clientName != "") || (m_jobName != "") || (m_filesetName != "")) m_closeable=true; @@ -108,6 +109,9 @@ JobList::~JobList() */ void JobList::populateTable() { + if (m_populating) + return; + m_populating = true; if (!m_console->preventInUseConnect()) return; @@ -218,6 +222,7 @@ void JobList::populateTable() tr("The Jobs query returned no results.\n" "Press OK to continue?"), QMessageBox::Ok ); } + m_populating = false; } void JobList::prepareFilterWidgets() diff --git a/bacula/src/qt-console/joblist/joblist.h b/bacula/src/qt-console/joblist/joblist.h index 7138e3b507..12cbd60e4e 100644 --- a/bacula/src/qt-console/joblist/joblist.h +++ b/bacula/src/qt-console/joblist/joblist.h @@ -85,6 +85,7 @@ private: QString m_filesetName; QString m_currentJob; bool m_populated; + bool m_populating; bool m_checkCurrentWidget; int m_jobIdIndex; int m_purgedIndex; diff --git a/bacula/src/qt-console/jobs/jobs.cpp b/bacula/src/qt-console/jobs/jobs.cpp index 4bb07ae3a8..a6054c79df 100644 --- a/bacula/src/qt-console/jobs/jobs.cpp +++ b/bacula/src/qt-console/jobs/jobs.cpp @@ -50,6 +50,7 @@ Jobs::Jobs() /* tableWidget, Storage Tree Tree Widget inherited from ui_client.h */ m_populated = false; + m_populating = false; m_checkcurwidget = true; m_closeable = false; /* add context sensitive menu items specific to this classto the page @@ -69,10 +70,12 @@ Jobs::~Jobs() */ void Jobs::populateTable() { - QBrush blackBrush(Qt::black); - + if (m_populating) + return; + m_populating = true; if (!m_console->preventInUseConnect()) return; + QBrush blackBrush(Qt::black); m_checkcurwidget = false; tableWidget->clear(); m_checkcurwidget = true; @@ -122,6 +125,7 @@ void Jobs::populateTable() /* Resize rows and columns */ tableWidget->resizeColumnsToContents(); tableWidget->resizeRowsToContents(); + m_populating = true; } /* diff --git a/bacula/src/qt-console/jobs/jobs.h b/bacula/src/qt-console/jobs/jobs.h index de255bdda6..b2ba435567 100644 --- a/bacula/src/qt-console/jobs/jobs.h +++ b/bacula/src/qt-console/jobs/jobs.h @@ -66,6 +66,7 @@ private: void createContextMenu(); QString m_currentlyselected; bool m_populated; + bool m_populating; bool m_checkcurwidget; int m_typeIndex; }; diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index 7ce47962ea..b32670a379 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -56,6 +56,7 @@ MediaList::MediaList() /* mp_treeWidget, Storage Tree Tree Widget inherited from ui_medialist.h */ m_populated = false; + m_populating = false; m_checkcurwidget = true; m_closeable = false; /* add context sensitive menu items specific to this classto the page diff --git a/bacula/src/qt-console/storage/storage.cpp b/bacula/src/qt-console/storage/storage.cpp index 36e0775250..f1391d9176 100644 --- a/bacula/src/qt-console/storage/storage.cpp +++ b/bacula/src/qt-console/storage/storage.cpp @@ -53,6 +53,7 @@ Storage::Storage() /* mp_treeWidget, Storage Tree Tree Widget inherited from ui_storage.h */ m_populated = false; + m_populating = false; m_checkcurwidget = true; m_closeable = false; m_currentStorage = ""; @@ -74,6 +75,9 @@ Storage::~Storage() */ void Storage::populateTree() { + if (m_populating) + return; + m_populating = true; if (!m_console->preventInUseConnect()) return; @@ -146,6 +150,7 @@ void Storage::populateTree() for(int cnter=0; cnterresizeColumnToContents(cnter); } + m_populating = false; } void Storage::mediaList(QTreeWidgetItem *parent, const QString &storageID) { diff --git a/bacula/src/qt-console/storage/storage.h b/bacula/src/qt-console/storage/storage.h index 3e778f12bb..9a49d04d80 100644 --- a/bacula/src/qt-console/storage/storage.h +++ b/bacula/src/qt-console/storage/storage.h @@ -68,6 +68,7 @@ private: QString m_currentStorage; bool m_currentAutoChanger; bool m_populated; + bool m_populating; bool m_checkcurwidget; void writeExpandedSettings(); QTreeWidgetItem *m_topItem;