Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sqlitetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ void SqliteTableModel::setPseudoPk(const QString& pseudoPk)

bool SqliteTableModel::isEditable() const
{
return !m_sTable.isEmpty();
return !m_sTable.isEmpty() && m_db.getObjectByName(m_sTable)->type() == sqlb::Object::Types::Table;
}

void SqliteTableModel::waitForFetchingFinished()
Expand Down
2 changes: 1 addition & 1 deletion src/sqlitetablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class SqliteTableModel : public QAbstractTableModel

// This returns true if the model is set up for editing. The model is able to operate in more or less two different modes, table browsing
// and query browsing. We only support editing data for the table browsing mode and not for the query mode. This function returns true if
// the model is currently editable, i.e. it's running in table mode.
// the model is currently editable, i.e. it's running in table mode and it isn't a view.
bool isEditable() const;

// Helper function for removing all comments from a SQL query
Expand Down