From: Eric Bollengier Date: Sun, 23 Aug 2009 08:36:17 +0000 (+0200) Subject: bat: Simplify the code to make TableWidget in read-only X-Git-Tag: Release-5.0.0~332^2^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b7c2be23ca7198cc241c7b582709d089afb0d661;p=bacula%2Fbacula bat: Simplify the code to make TableWidget in read-only --- diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 95dcc8e674..8b35834997 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -231,16 +231,7 @@ void JobList::populateTable() } /* make read only */ - int rcnt = mp_tableWidget->rowCount(); - int ccnt = mp_tableWidget->columnCount(); - for(int r=0; r < rcnt; r++) { - for(int c=0; c < ccnt; c++) { - QTableWidgetItem* item = mp_tableWidget->item(r, c); - if (item) { - item->setFlags(Qt::ItemFlags(item->flags() & (~Qt::ItemIsEditable))); - } - } - } + m_tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); } void JobList::prepareFilterWidgets() diff --git a/bacula/src/qt-console/mediainfo/mediainfo.cpp b/bacula/src/qt-console/mediainfo/mediainfo.cpp index bbb4e7df1d..2de3f2128d 100644 --- a/bacula/src/qt-console/mediainfo/mediainfo.cpp +++ b/bacula/src/qt-console/mediainfo/mediainfo.cpp @@ -254,15 +254,5 @@ void MediaInfo::populateForm() tableJob->verticalHeader()->hide(); /* make read only */ - int rcnt = tableJob->rowCount(); - int ccnt = tableJob->columnCount(); - for(int r=0; r < rcnt; r++) { - for(int c=0; c < ccnt; c++) { - QTableWidgetItem* item = tableJob->item(r, c); - if (item) { - item->setFlags(Qt::ItemFlags(item->flags() & (~Qt::ItemIsEditable))); - } - } - } - + tableJob->setEditTriggers(QAbstractItemView::NoEditTriggers); } diff --git a/bacula/technotes b/bacula/technotes index 3242f0e63a..29e7622e6d 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -3,6 +3,7 @@ General: 23Aug09 +ebl Simplify the code to make TableWidget in read-only kes Free Volume in several places. Fixes virtual-changer problem and possibly bug #1346. kes Add SD Volume debug code