mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
Merge pull request #767 from justinclift/display_truncated_length_symbol
Indicate when display strings are being truncated
This commit is contained in:
@@ -361,7 +361,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1000</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>20000</number>
|
||||
|
||||
@@ -227,7 +227,13 @@ QVariant SqliteTableModel::data(const QModelIndex &index, int role) const
|
||||
return "BLOB";
|
||||
} else if(role == Qt::DisplayRole) {
|
||||
int limit = Settings::getSettingsValue("databrowser", "symbol_limit").toInt();
|
||||
return decode(m_data.at(index.row()).at(index.column()).left(limit));
|
||||
QByteArray displayText = m_data.at(index.row()).at(index.column());
|
||||
if (displayText.length() > limit) {
|
||||
// Add "..." to the end of truncated strings
|
||||
return decode(displayText.left(limit).append(" ..."));
|
||||
} else {
|
||||
return decode(displayText);
|
||||
}
|
||||
} else {
|
||||
return decode(m_data.at(index.row()).at(index.column()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user