Skip to content

Commit 516d71f

Browse files
rp-MKleusberg
authored andcommitted
Don't show cells with long text values as BLOB
Don't show cells with a text value longer than 1024 characters as '(BLOB)'. Also don't change back to binary mode in the EditDialog after manually switching to the text mode. Closes issue sqlitebrowser#16.
1 parent 42501d3 commit 516d71f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/EditDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void EditDialog::checkDataType()
141141
{
142142
// Check if data is text only
143143
ui->comboEditor->setVisible(true);
144-
if(QString(hexEdit->data()).toLatin1() == hexEdit->data()) // Any proper way??
144+
if(QString(hexEdit->data()).toUtf8() == hexEdit->data()) // Any proper way??
145145
{
146146
ui->editorStack->setCurrentIndex(0);
147147

src/sqlitetablemodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,6 @@ void SqliteTableModel::clearCache()
436436

437437
bool SqliteTableModel::isBinary(const QModelIndex& index) const
438438
{
439-
QByteArray val = m_data.at(index.row()).at(index.column());
440-
return val.size() > 1024 || val.contains('\0'); // Cheap BLOB test here...
439+
QByteArray val = m_data.at(index.row()).at(index.column()).left(1024);
440+
return val.contains('\0'); // Cheap BLOB test here...
441441
}

0 commit comments

Comments
 (0)