Optimized choosing displayed text for cell

This commit is contained in:
Vladislav Tronko
2016-08-06 05:18:01 +03:00
parent 5b46e442c6
commit 6b42af7fc6

View File

@@ -220,10 +220,10 @@ QVariant SqliteTableModel::data(const QModelIndex &index, int role) const
while(index.row() >= m_data.size() && canFetchMore())
const_cast<SqliteTableModel*>(this)->fetchMore(); // Nothing evil to see here, move along
if(role == Qt::DisplayRole && m_data.at(index.row()).at(index.column()).left(1024).contains('\0'))
return "BLOB";
else if(role == Qt::DisplayRole && m_data.at(index.row()).at(index.column()).isNull())
if(role == Qt::DisplayRole && m_data.at(index.row()).at(index.column()).isNull())
return PreferencesDialog::getSettingsValue("databrowser", "null_text").toString();
else if(role == Qt::DisplayRole && isBinary(index))
return "BLOB";
else
return decode(m_data.at(index.row()).at(index.column()));
} else if(role == Qt::FontRole) {