Skip to content

Commit

Permalink
Don't show foreign key tooltip within Execute SQL tab (sqlitebrowser#942
Browse files Browse the repository at this point in the history
)

This is probably just temporary solution. Tooltip code was written
specifically for Browse Data tab, so it requires some versatile changes.
  • Loading branch information
vtronko committed Jan 25, 2017
1 parent f728ff7 commit 36a3815
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sqlitetablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ QVariant SqliteTableModel::data(const QModelIndex &index, int role) const

sqlb::ForeignKeyClause SqliteTableModel::getForeignKeyClause(int column) const
{
static const sqlb::ForeignKeyClause empty_foreign_key_clause;

if (m_sTable.isEmpty())
return empty_foreign_key_clause;

sqlb::TablePtr obj = m_db.getObjectByName(m_sTable).dynamicCast<sqlb::Table>();
if(obj->name().size() && (column >= 0 && column < obj->fields().count()))
{
Expand All @@ -278,7 +283,6 @@ sqlb::ForeignKeyClause SqliteTableModel::getForeignKeyClause(int column) const
return *(ptr.dynamicCast<sqlb::ForeignKeyClause>());
}

static const sqlb::ForeignKeyClause empty_foreign_key_clause;
return empty_foreign_key_clause;
}

Expand Down

0 comments on commit 36a3815

Please sign in to comment.