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 5b75ab5..cb3b667 100644 --- a/src/colnod/databaseapi.cpp +++ b/src/colnod/databaseapi.cpp @@ -81,7 +81,7 @@ bool DatabaseAPI::processData(const std::shared_ptr &data) qInfo(database) << Message::massageTemplate("Updated", "subject", "database", subject->name()); } for (const auto &id : data->deletedSubjects) { - qInfo(database) << Message::massageTemplate("Deleted", "token", "database", id); + qInfo(database) << Message::massageTemplate("Deleted", "subject", "database", id); } if (!data->updatedTokens.isEmpty() || !data->deletedTokens.isEmpty() || !data->updatedSubjects.isEmpty() || !data->deletedSubjects.isEmpty()) { @@ -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..50196b1 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("d3a83bea-2587-4687-946d-ee847eccf477")); } void ColnodTest::download_data_test_now()