From 310600e5b0a4dea9642b27a46bc4436103ebc31e Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 23 Aug 2009 10:36:17 +0200 Subject: [PATCH] bat: Simplify the code to make TableWidget in read-only --- bacula/src/qt-console/joblist/joblist.cpp | 11 +---------- bacula/src/qt-console/mediainfo/mediainfo.cpp | 12 +----------- bacula/technotes | 1 + 3 files changed, 3 insertions(+), 21 deletions(-) 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 -- 2.39.5