]> git.sur5r.net Git - bacula/bacula/commitdiff
OOps. prevent a segfault when setting table widget items to read only.
authorDirk H Bartley <dbartley@schupan.com>
Sun, 22 Mar 2009 20:17:23 +0000 (20:17 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sun, 22 Mar 2009 20:17:23 +0000 (20:17 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8582 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/fileset/fileset.cpp

index 30d90a9e2f4b48e9be3c9ad2612693a2d2ac703e..7f0eb899ace63f092829add65d0105706c23287d 100644 (file)
@@ -85,7 +85,6 @@ void FileSet::populateTable()
    tableWidget->setColumnCount(headerlist.count());
    tableWidget->setHorizontalHeaderLabels(headerlist);
    tableWidget->horizontalHeader()->setHighlightSections(false);
-   tableWidget->setRowCount(m_console->fileset_list.count());
    tableWidget->verticalHeader()->hide();
    tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
    tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
@@ -118,6 +117,7 @@ void FileSet::populateTable()
       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) {