mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
Multi-threading patch
This was done by Michael Krause. https://lists.sqlitebrowser.org/pipermail/db4s-dev/2018-February/000305.html In this commit I only fixed two compiler warnings, some whitespace issues and removed some debug messages.
This commit is contained in:
@@ -388,7 +388,7 @@ void EditTableDialog::itemChanged(QTreeWidgetItem *item, int column)
|
||||
.arg(sqlb::escapeIdentifier(pdb.getObjectByName(curTable).dynamicCast<sqlb::Table>()->rowidColumn()))
|
||||
.arg(curTable.toString())
|
||||
.arg(sqlb::escapeIdentifier(field->name())));
|
||||
m.waitForFetchingFinished();
|
||||
m.completeCache();
|
||||
if(m.data(m.index(0, 0)).toInt() > 0)
|
||||
{
|
||||
// There is a NULL value, so print an error message, uncheck the combobox, and return here
|
||||
@@ -416,7 +416,7 @@ void EditTableDialog::itemChanged(QTreeWidgetItem *item, int column)
|
||||
.arg(curTable.toString())
|
||||
.arg(sqlb::escapeIdentifier(field->name()))
|
||||
.arg(sqlb::escapeIdentifier(field->name())));
|
||||
m.waitForFetchingFinished();
|
||||
m.completeCache();
|
||||
if(m.data(m.index(0, 0)).toInt() > 0)
|
||||
{
|
||||
// There is a non-integer value, so print an error message, uncheck the combobox, and return here
|
||||
@@ -458,10 +458,10 @@ void EditTableDialog::itemChanged(QTreeWidgetItem *item, int column)
|
||||
// Because our renameColumn() function fails when setting a column to unique when it already contains the same values
|
||||
SqliteTableModel m(pdb, this);
|
||||
m.setQuery(QString("SELECT COUNT(%2) FROM %1;").arg(curTable.toString()).arg(sqlb::escapeIdentifier(field->name())));
|
||||
m.waitForFetchingFinished();
|
||||
m.completeCache();
|
||||
int rowcount = m.data(m.index(0, 0)).toInt();
|
||||
m.setQuery(QString("SELECT COUNT(DISTINCT %2) FROM %1;").arg(curTable.toString()).arg(sqlb::escapeIdentifier(field->name())));
|
||||
m.waitForFetchingFinished();
|
||||
m.completeCache();
|
||||
int uniquecount = m.data(m.index(0, 0)).toInt();
|
||||
if(rowcount != uniquecount)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user