From 4b79f92eaac280c621244cb36c6954f0976c5142 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Tue, 6 Sep 2016 14:29:07 +0200 Subject: [PATCH] Load the full cell data when trying to edit the cell content In 11bff0ded839c7d4b6b5eea6118ac44938515ce5 a settings option was introduced in order to limit the number of characters loaded into each cell in the Browse Data tab. However, when editing the cell you wouldn't see the full data, i.e. rendering the data incomplete and/or cropping it when it's being edited anyway. This commit fixes this behaviour: when editing a cell (either in-line or using the edit dialog/dock) the full data for this particular cell is loaded and shown. --- src/sqlitetablemodel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sqlitetablemodel.cpp b/src/sqlitetablemodel.cpp index f9bd4d98..c4bf5720 100644 --- a/src/sqlitetablemodel.cpp +++ b/src/sqlitetablemodel.cpp @@ -221,12 +221,15 @@ QVariant SqliteTableModel::data(const QModelIndex &index, int role) const const_cast(this)->fetchMore(); // Nothing evil to see here, move along if(role == Qt::DisplayRole && m_data.at(index.row()).at(index.column()).isNull()) + { return Settings::getSettingsValue("databrowser", "null_text").toString(); - else if(role == Qt::DisplayRole && isBinary(index)) + } else if(role == Qt::DisplayRole && isBinary(index)) { return "BLOB"; - else { + } 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)); + } else { + return decode(m_data.at(index.row()).at(index.column())); } } else if(role == Qt::FontRole) { QFont font;