Changeset View
Changeset View
Standalone View
Standalone View
src/widget/tableview/KexiDataTableView.cpp
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | |||||
131 | bool KexiDataTableView::saveSettings() | 131 | bool KexiDataTableView::saveSettings() | ||
132 | { | 132 | { | ||
133 | //! @todo KEXI3 save only if changed | 133 | //! @todo KEXI3 save only if changed | ||
134 | bool ok = true; | 134 | bool ok = true; | ||
135 | KDbTransactionGuard tg; | 135 | KDbTransactionGuard tg; | ||
136 | if (dynamic_cast<KexiDataTableScrollArea*>(mainWidget())) { // db-aware | 136 | if (dynamic_cast<KexiDataTableScrollArea*>(mainWidget())) { // db-aware | ||
137 | KexiTableScrollArea* tv = tableView(); | 137 | KexiTableScrollArea* tv = tableView(); | ||
138 | const int id = window()->id(); | 138 | const int id = window()->id(); | ||
139 | if (id > 0 && tv->data()->columnCount() > 0) { | 139 | if (id > 0 && tv->data() && tv->data()->columnCount() > 0) { | ||
140 | QStringList widths; | 140 | QStringList widths; | ||
141 | bool equal = true; // will be only saved if widths are not equal | 141 | bool equal = true; // will be only saved if widths are not equal | ||
142 | for (int i = 0; i < tv->data()->columnCount(); ++i) { | 142 | for (int i = 0; i < tv->data()->columnCount(); ++i) { | ||
143 | if (equal) { | 143 | if (equal) { | ||
144 | equal = tv->data()->column(i)->width() == tv->columnWidth(i); | 144 | equal = tv->data()->column(i)->width() == tv->columnWidth(i); | ||
145 | } | 145 | } | ||
146 | widths.append(QString::number(tv->columnWidth(i))); | 146 | widths.append(QString::number(tv->columnWidth(i))); | ||
147 | } | 147 | } | ||
Show All 11 Lines |