Remove superfluous whitespace from Schema column in DB Structure view

In the Database Structure tab and the DB Schema pane, replace any
sequence of whitespace characters by a single space character if the
one-line Schema view is enabled.

See issue #283.
This commit is contained in:
Martin Kleusberg
2015-05-02 20:16:28 +02:00
parent f921815e9d
commit f21ff619f2

View File

@@ -37,7 +37,7 @@ QVariant DbStructureModel::data(const QModelIndex& index, int role) const
// Depending on the role either return the text or the icon
if(role == Qt::DisplayRole)
return PreferencesDialog::getSettingsValue("db", "hideschemalinebreaks").toBool() ? item->text(index.column()).replace("\n", " ") : item->text(index.column());
return PreferencesDialog::getSettingsValue("db", "hideschemalinebreaks").toBool() ? item->text(index.column()).replace("\n", " ").simplified() : item->text(index.column());
else if(role == Qt::ToolTipRole)
return item->text(index.column()); // Don't modify the text when it's supposed to be shown in a tooltip
else if(role == Qt::DecorationRole)