From: Dirk H Bartley Date: Sun, 22 Mar 2009 20:17:23 +0000 (+0000) Subject: OOps. prevent a segfault when setting table widget items to read only. X-Git-Tag: Release-7.0.0~3272 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c914a73f4e6d66e79ec3d2eaf49639277f0ec56d;p=bacula%2Fbacula OOps. prevent a segfault when setting table widget items to read only. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8582 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index 30d90a9e2f..7f0eb899ac 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -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) {