From: Dirk H Bartley Date: Sun, 28 Sep 2008 18:12:29 +0000 (+0000) Subject: The earlier fix of populated and populating was causing some issues with X-Git-Tag: Release-7.0.0~4072 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7df0159be9beab25366d4997e1193518e5db6873;p=bacula%2Fbacula The earlier fix of populated and populating was causing some issues with app->processEvents(); in the console class. This would trigger the population again. Now I am trying setting populated early. We will see what goes wrong here. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7660 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/clients/clients.cpp b/bacula/src/qt-console/clients/clients.cpp index ce4b25dd56..ff30579a82 100644 --- a/bacula/src/qt-console/clients/clients.cpp +++ b/bacula/src/qt-console/clients/clients.cpp @@ -53,7 +53,6 @@ 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 @@ -73,12 +72,9 @@ Clients::~Clients() */ void Clients::populateTable() { - if (m_populating) - return; - m_populating = true; - if (!m_console->preventInUseConnect()) return; + m_populated = true; QBrush blackBrush(Qt::black); @@ -162,7 +158,6 @@ void Clients::populateTable() /* Resize rows and columns */ tableWidget->resizeColumnsToContents(); tableWidget->resizeRowsToContents(); - m_populating = false; } /* @@ -173,7 +168,6 @@ void Clients::PgSeltreeWidgetClicked() { if(!m_populated) { populateTable(); - m_populated=true; } } @@ -268,7 +262,6 @@ void Clients::currentStackItem() if(!m_populated) { populateTable(); /* Create the context menu for the client table */ - m_populated=true; } } diff --git a/bacula/src/qt-console/clients/clients.h b/bacula/src/qt-console/clients/clients.h index f90866a138..8c206faa49 100644 --- a/bacula/src/qt-console/clients/clients.h +++ b/bacula/src/qt-console/clients/clients.h @@ -63,7 +63,6 @@ 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 466639bbd1..4ca07c1c07 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -51,7 +51,6 @@ 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(); @@ -72,12 +71,9 @@ FileSet::~FileSet() */ void FileSet::populateTable() { - if (m_populating) - return; - m_populating = true; - if (!m_console->preventInUseConnect()) return; + m_populated = true; QBrush blackBrush(Qt::black); @@ -145,7 +141,6 @@ void FileSet::populateTable() /* Resize rows and columns */ tableWidget->resizeColumnsToContents(); tableWidget->resizeRowsToContents(); - m_populating = false; } /* @@ -157,7 +152,6 @@ void FileSet::PgSeltreeWidgetClicked() if (!m_populated) { populateTable(); createContextMenu(); - m_populated = true; } } @@ -229,7 +223,6 @@ void FileSet::currentStackItem() populateTable(); /* Create the context menu for the fileset table */ createContextMenu(); - m_populated=true; } } diff --git a/bacula/src/qt-console/fileset/fileset.h b/bacula/src/qt-console/fileset/fileset.h index dc22372621..8973c3405e 100644 --- a/bacula/src/qt-console/fileset/fileset.h +++ b/bacula/src/qt-console/fileset/fileset.h @@ -62,7 +62,6 @@ 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 6bc2610414..91c13e355e 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -62,7 +62,6 @@ 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; @@ -109,14 +108,12 @@ JobList::~JobList() */ void JobList::populateTable() { - if (m_populating) - return; - m_populating = true; if (!m_console->preventInUseConnect()) return; /* Can't do this in constructor because not neccesarily conected in constructor */ prepareFilterWidgets(); + m_populated = true; /* Set up query */ QString query; @@ -222,7 +219,6 @@ void JobList::populateTable() tr("The Jobs query returned no results.\n" "Press OK to continue?"), QMessageBox::Ok ); } - m_populating = false; } void JobList::prepareFilterWidgets() @@ -318,7 +314,6 @@ void JobList::PgSeltreeWidgetClicked() { if (!m_populated) { populateTable(); - m_populated=true; } } @@ -328,10 +323,8 @@ void JobList::PgSeltreeWidgetClicked() */ void JobList::currentStackItem() { - populateTable(); - if (!m_populated) { - m_populated=true; - } +/* if (!m_populated) populate every time user comes back to this object */ + populateTable(); } /* diff --git a/bacula/src/qt-console/joblist/joblist.h b/bacula/src/qt-console/joblist/joblist.h index 12cbd60e4e..7138e3b507 100644 --- a/bacula/src/qt-console/joblist/joblist.h +++ b/bacula/src/qt-console/joblist/joblist.h @@ -85,7 +85,6 @@ 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 a6054c79df..ed1d653471 100644 --- a/bacula/src/qt-console/jobs/jobs.cpp +++ b/bacula/src/qt-console/jobs/jobs.cpp @@ -50,7 +50,6 @@ 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 @@ -70,11 +69,9 @@ Jobs::~Jobs() */ void Jobs::populateTable() { - if (m_populating) - return; - m_populating = true; if (!m_console->preventInUseConnect()) return; + m_populated = true; QBrush blackBrush(Qt::black); m_checkcurwidget = false; tableWidget->clear(); @@ -125,7 +122,6 @@ void Jobs::populateTable() /* Resize rows and columns */ tableWidget->resizeColumnsToContents(); tableWidget->resizeRowsToContents(); - m_populating = true; } /* @@ -136,7 +132,6 @@ void Jobs::PgSeltreeWidgetClicked() { if(!m_populated) { populateTable(); - m_populated=true; } } @@ -205,10 +200,9 @@ void Jobs::createContextMenu() */ void Jobs::currentStackItem() { - populateTable(); if(!m_populated) { /* Create the context menu for the client table */ - m_populated=true; + populateTable(); } } diff --git a/bacula/src/qt-console/jobs/jobs.h b/bacula/src/qt-console/jobs/jobs.h index b2ba435567..de255bdda6 100644 --- a/bacula/src/qt-console/jobs/jobs.h +++ b/bacula/src/qt-console/jobs/jobs.h @@ -66,7 +66,6 @@ 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 b32670a379..ab1a877f89 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -56,7 +56,6 @@ 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 @@ -77,9 +76,10 @@ MediaList::~MediaList() */ void MediaList::populateTree() { - if (m_populating) - return; - m_populating = true; + if (m_populated) + writeExpandedSettings(); + m_populated = true; + QTreeWidgetItem *pooltreeitem; if (!m_console->preventInUseConnect()) @@ -92,8 +92,6 @@ void MediaList::populateTree() << tr("RecyclePool") << tr("Last Written")); m_checkcurwidget = false; - if (m_populated) - writeExpandedSettings(); mp_treeWidget->clear(); m_checkcurwidget = true; mp_treeWidget->setColumnCount(headerlist.count()); @@ -222,7 +220,6 @@ void MediaList::populateTree() for(int cnter=0; cnterresizeColumnToContents(cnter); } - m_populating = false; } /* @@ -252,7 +249,6 @@ void MediaList::PgSeltreeWidgetClicked() if (!m_populated) { populateTree(); createContextMenu(); - m_populated=true; } } @@ -323,7 +319,6 @@ void MediaList::currentStackItem() populateTree(); /* Create the context menu for the medialist tree */ createContextMenu(); - m_populated=true; } } diff --git a/bacula/src/qt-console/medialist/medialist.h b/bacula/src/qt-console/medialist/medialist.h index 2fec22fb76..f51f565e3b 100644 --- a/bacula/src/qt-console/medialist/medialist.h +++ b/bacula/src/qt-console/medialist/medialist.h @@ -69,7 +69,6 @@ private: QString m_currentVolumeName; QString m_currentVolumeId; bool m_populated; - bool m_populating; bool m_checkcurwidget; QTreeWidgetItem *m_topItem; }; diff --git a/bacula/src/qt-console/storage/storage.cpp b/bacula/src/qt-console/storage/storage.cpp index f1391d9176..c6fe69c922 100644 --- a/bacula/src/qt-console/storage/storage.cpp +++ b/bacula/src/qt-console/storage/storage.cpp @@ -53,7 +53,6 @@ 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 = ""; @@ -75,14 +74,12 @@ Storage::~Storage() */ void Storage::populateTree() { - if (m_populating) - return; - m_populating = true; if (!m_console->preventInUseConnect()) return; if (m_populated) writeExpandedSettings(); + m_populated = true; m_checkcurwidget = false; mp_treeWidget->clear(); @@ -150,7 +147,6 @@ void Storage::populateTree() for(int cnter=0; cnterresizeColumnToContents(cnter); } - m_populating = false; } void Storage::mediaList(QTreeWidgetItem *parent, const QString &storageID) { @@ -217,7 +213,6 @@ void Storage::PgSeltreeWidgetClicked() if(!m_populated) { populateTree(); createContextMenu(); - m_populated = true; } } @@ -322,7 +317,6 @@ void Storage::currentStackItem() populateTree(); /* Create the context menu for the storage tree */ createContextMenu(); - m_populated = true; } } diff --git a/bacula/src/qt-console/storage/storage.h b/bacula/src/qt-console/storage/storage.h index 9a49d04d80..3e778f12bb 100644 --- a/bacula/src/qt-console/storage/storage.h +++ b/bacula/src/qt-console/storage/storage.h @@ -68,7 +68,6 @@ private: QString m_currentStorage; bool m_currentAutoChanger; bool m_populated; - bool m_populating; bool m_checkcurwidget; void writeExpandedSettings(); QTreeWidgetItem *m_topItem;