mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-03 18:40:19 -05: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>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1000</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>20000</number>
|
<number>20000</number>
|
||||||
|
|||||||
@@ -227,7 +227,13 @@ QVariant SqliteTableModel::data(const QModelIndex &index, int role) const
|
|||||||
return "BLOB";
|
return "BLOB";
|
||||||
} else if(role == Qt::DisplayRole) {
|
} else if(role == Qt::DisplayRole) {
|
||||||
int limit = Settings::getSettingsValue("databrowser", "symbol_limit").toInt();
|
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 {
|
} else {
|
||||||
return decode(m_data.at(index.row()).at(index.column()));
|
return decode(m_data.at(index.row()).at(index.column()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user