$OpenBSD: patch-sqlitebrowser_sqlitedb_cpp,v 1.1 2009/08/14 12:44:26 espie Exp $ --- sqlitebrowser/sqlitedb.cpp.orig Thu Aug 13 20:24:07 2009 +++ sqlitebrowser/sqlitedb.cpp Thu Aug 13 21:03:24 2009 @@ -666,10 +666,10 @@ void DBBrowserDB::updateSchema( ) tbmap.clear(); lastErrorMessage = QString("no error"); - QString statement = "SELECT name, sql " + QString statement = "SELECT name, sql, type " "FROM sqlite_master " - "WHERE type='table' " - "ORDER BY name;"; + "WHERE type in ('table', 'view') " + "ORDER BY type, name;"; err=sqlite3_prepare(_db, (const char *) statement.latin1(),-1, &vm, &tail); @@ -677,9 +677,11 @@ void DBBrowserDB::updateSchema( ) logSQL(statement, kLogMsg_App); while ( sqlite3_step(vm) == SQLITE_ROW ){ QString val1, val2; + bool val3; val1 = QString((const char *) sqlite3_column_text(vm, 0)); val2 = QString((const char *) sqlite3_column_text(vm, 1)); - tbmap[tabnum] = DBBrowserTable(val1, val2); + val3 = strcmp((const char *) sqlite3_column_text(vm, 2), "view") == 0; + tbmap[tabnum] = DBBrowserTable(val1, val2, val3); tabnum++; } sqlite3_finalize(vm);