Skip to content

Commit c9481bf

Browse files
author
Michail Koreshkov
committed
Fix setWordWrap logic
- switch option to positive logic - invoke unconditional setWordWrap()
1 parent 5096be7 commit c9481bf

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

src/ExtendedTableWidget.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,7 @@ ExtendedTableWidget::ExtendedTableWidget(QWidget* parent) :
257257
m_frozen_column_count(0),
258258
m_item_border_delegate(new ItemBorderDelegate(this))
259259
{
260-
// Fix behaviour for ElideMode
261-
if(Settings::getValue("databrowser", "cell_word_wrap").toBool()) {
262-
setWordWrap(false);
263-
}
260+
setWordWrap(Settings::getValue("databrowser", "cell_word_wrap").toBool());
264261

265262
setHorizontalScrollMode(ExtendedTableWidget::ScrollPerPixel);
266263
// Force ScrollPerItem, so scrolling shows all table rows
@@ -517,9 +514,7 @@ void ExtendedTableWidget::reloadSettings()
517514
if(m_frozen_table_view)
518515
m_frozen_table_view->reloadSettings();
519516

520-
bool word_wrap = Settings::getValue("databrowser", "cell_word_wrap").toBool();
521-
if(wordWrap() ^ word_wrap)
522-
setWordWrap(word_wrap);
517+
setWordWrap(Settings::getValue("databrowser", "cell_word_wrap").toBool());
523518
}
524519

525520
bool ExtendedTableWidget::copyMimeData(const QModelIndexList& fromIndices, QMimeData* mimeData, const bool withHeaders, const bool inSQL)

src/PreferencesDialog.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ in new project file</string>
12151215
<item row="3" column="0">
12161216
<widget class="QLabel" name="labelCellWordWrap">
12171217
<property name="text">
1218-
<string>Disable word wrap in cell</string>
1218+
<string>Enable word wrap in cell</string>
12191219
</property>
12201220
<property name="buddy">
12211221
<cstring>checkCellWordWrap</cstring>
@@ -1268,7 +1268,7 @@ Can be set to 0 for disabling completion.</string>
12681268
<item row="3" column="1">
12691269
<widget class="QCheckBox" name="checkCellWordWrap">
12701270
<property name="toolTip">
1271-
<string>Enable this option to turn off word wrap in the cells.</string>
1271+
<string>Enable this option to turn on word wrap in the cells.</string>
12721272
</property>
12731273
</widget>
12741274
</item>

src/Settings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ QVariant Settings::getDefaultValue(const std::string& group, const std::string&
304304
if(name == "image_preview")
305305
return false;
306306
if(name == "cell_word_wrap")
307-
return false;
307+
return true;
308308
if(name == "indent_compact")
309309
return false;
310310
if (name == "sort_keys")

0 commit comments

Comments
 (0)