diff --git a/src/app/main.cpp b/src/app/main.cpp index a39418a..3a63727 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) parser.setApplicationDescription("Colnod sync"); QCommandLineOption dryModeOption("dryMode", "ColnodAPI", "Read-only mode, prints changes which would normally be made"); QCommandLineOption dropTablesOption("dropTables", "ColnodAPI", "Delete tables with datas from Colnod"); - QCommandLineOption createTablesOption("createTables", "ColnodAPI", "Create tables to saving data from Colnod"); + QCommandLineOption createTablesOption("createTables", "ColnodAPI", "Create tables for saving data from Colnod"); parser.addOption(dryModeOption); parser.addOption(dropTablesOption); parser.addOption(createTablesOption); @@ -40,7 +40,6 @@ int main(int argc, char *argv[]) QLoggingCategory::setFilterRules(filters.join(QStringLiteral("\n"))); - SyncManager syncManager(parser.isSet(dryModeOption)); // Initialize database and colnod API diff --git a/src/colnod/databaseapi.cpp b/src/colnod/databaseapi.cpp index d1757b3..cb3b667 100644 --- a/src/colnod/databaseapi.cpp +++ b/src/colnod/databaseapi.cpp @@ -292,7 +292,7 @@ int DatabaseAPI::exists(const QString &id, const QString &tableName) qint16 DatabaseAPI::getNumOfTokensOfSubject(const QString &id) { auto query = mDbMan->createQuery(); - query.prepare("SELECT 1 FROM colnod_token WHERE subject_id = :id AND deleted = false"); + query.prepare("SELECT 1 FROM colnod_token WHERE subject_id = :id AND description = 'mobile'"); query.bindValue(":id", id); if (!executeQuery(query)) { qCritical(database) << "ERROR during accessing existing tokens. EXIT(1)"; diff --git a/test/auto/colnod/tst_colnodapi.cpp b/test/auto/colnod/tst_colnodapi.cpp index 902e06f..93eade4 100644 --- a/test/auto/colnod/tst_colnodapi.cpp +++ b/test/auto/colnod/tst_colnodapi.cpp @@ -55,7 +55,7 @@ void ColnodTest::download_data_test() QVERIFY(data); QVERIFY(! data->updatedTokens.isEmpty()); - QVERIFY(data->updatedTokens.contains("5e2f1260-da1c-441f-9644-24dfe3b97b2a")); + QVERIFY(data->updatedTokens.contains("6c907a42-0401-4403-8af4-9d58eb35cddc")); } void ColnodTest::download_data_test_now()