From 6bcaa162381329e01ff0c4a53697670d1aafbf0a Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Sat, 13 Jun 2009 14:55:28 +0000 Subject: [PATCH] Add a stringlist and a foreach after populating to at least acknowledge to the user that a new fileset. Bat would not show the fileset until the database table had the fileset which was not until used. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8896 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/fileset/fileset.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index 6a8d71609c..eb21157854 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -92,6 +92,7 @@ void FileSet::populateTable() QString fileset_comsep(""); bool first = true; + QStringList notFoundList = m_console->fileset_list; foreach(QString filesetName, m_console->fileset_list) { if (first) { fileset_comsep += "'" + filesetName + "'"; @@ -101,6 +102,8 @@ void FileSet::populateTable() fileset_comsep += ",'" + filesetName + "'"; } + int row = 0; + tableWidget->setRowCount(m_console->fileset_list.count()); if (fileset_comsep != "") { /* Set up query QString and header QStringList */ QString query(""); @@ -115,14 +118,16 @@ void FileSet::populateTable() Pmsg1(000, "FileSet query cmd : %s\n",query.toUtf8().data()); } if (m_console->sql_cmd(query, results)) { - int row = 0; QStringList fieldlist; - tableWidget->setRowCount(results.count()); /* Iterate through the record returned from the query */ foreach (QString resultline, results) { fieldlist = resultline.split("\t"); + /* remove this fileSet from notFoundList */ + int indexOf = notFoundList.indexOf(fieldlist[0]); + if (indexOf != -1) { notFoundList.removeAt(indexOf); } + TableItemFormatter item(*tableWidget, row); /* Iterate through fields in the record */ @@ -142,6 +147,12 @@ void FileSet::populateTable() } } } + foreach(QString filesetName, notFoundList) { + TableItemFormatter item(*tableWidget, row); + item.setTextFld(0, filesetName); + row++; + } + /* set default sorting */ tableWidget->sortByColumn(headerlist.indexOf(tr("Create Time")), Qt::DescendingOrder); tableWidget->setSortingEnabled(true); -- 2.39.5