Workaround for unsupported QSqlQuery::size()
This commit is contained in:
+3
-1
@@ -158,8 +158,10 @@ void Database::reindex(QProgressDialog *progress)
|
|||||||
QVariantList deleteids;
|
QVariantList deleteids;
|
||||||
QSqlDatabase database = QSqlDatabase::database();
|
QSqlDatabase database = QSqlDatabase::database();
|
||||||
database.transaction();
|
database.transaction();
|
||||||
|
QSqlQuery size = database.exec("SELECT COUNT(*) FROM fits_files");
|
||||||
|
size.next();
|
||||||
|
progress->setMaximum(size.value(0).toInt());
|
||||||
QSqlQuery files = database.exec("SELECT id,file,mtime FROM fits_files");
|
QSqlQuery files = database.exec("SELECT id,file,mtime FROM fits_files");
|
||||||
progress->setMaximum(files.size());
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while(files.next())
|
while(files.next())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user