]> git.sur5r.net Git - bacula/bacula/commitdiff
Add a stringlist and a foreach after populating to at least acknowledge
authorDirk H Bartley <dbartley@schupan.com>
Sat, 13 Jun 2009 14:55:28 +0000 (14:55 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sat, 13 Jun 2009 14:55:28 +0000 (14:55 +0000)
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

index 6a8d71609c38b762e0a98a4dc8dee633569d3286..eb211578543722d58e456504c96256a527c0371f 100644 (file)
@@ -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);