mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
Fix editing table with custom display formats set
Since PR #1436 we allow configuration of the identifier quotes instead of always using backticks. But in the code for detecting a custom display format on a column the assumption still was that normal columns without a custom display format are always surrounded in backticks. The result of this was that even if there is only a single display format configured for a table, no field of no column can be edited anymore. This commit restores the original state which would only disable editing for the columns with a custom display format.
This commit is contained in:
@@ -412,9 +412,8 @@ Qt::ItemFlags SqliteTableModel::flags(const QModelIndex& index) const
|
||||
bool custom_display_format = false;
|
||||
if(m_vDisplayFormat.size())
|
||||
{
|
||||
// NOTE: This assumes that custom display formats never start and end with a backtick
|
||||
if(index.column() > 0)
|
||||
custom_display_format = !(m_vDisplayFormat.at(index.column()-1).startsWith("`") && m_vDisplayFormat.at(index.column()-1).endsWith("`"));
|
||||
custom_display_format = m_vDisplayFormat.at(index.column()-1) != sqlb::escapeIdentifier(headerData(index.column(), Qt::Horizontal).toString());
|
||||
}
|
||||
|
||||
if(!isBinary(index) && !custom_display_format)
|
||||
|
||||
Reference in New Issue
Block a user