From c8cca27ba28d10455a1268059f7a8cd139658449 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Sat, 11 Jan 2014 17:53:43 +0100 Subject: [PATCH] Changes. --- src/core/databasefactory.cpp | 5 ++++- src/core/feedsmodel.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/databasefactory.cpp b/src/core/databasefactory.cpp index c8ac51d81..f755550c0 100644 --- a/src/core/databasefactory.cpp +++ b/src/core/databasefactory.cpp @@ -80,6 +80,9 @@ QSqlDatabase DatabaseFactory::initialize(const QString &connection_name) { query_db.exec("PRAGMA encoding = \"UTF-8\""); query_db.exec("PRAGMA synchronous = OFF"); query_db.exec("PRAGMA journal_mode = MEMORY"); + // TODO: prozkoumat cache a page size a lockingmode co to je + query_db.exec("PRAGMA page_size = 4096"); + query_db.exec("PRAGMA cache_size = 16384"); query_db.exec("PRAGMA count_changes = OFF"); query_db.exec("PRAGMA temp_store = MEMORY"); @@ -158,7 +161,7 @@ QSqlDatabase DatabaseFactory::connection(const QString &connection_name) { } if (!database.isOpen() && !database.open()) { - qFatal("Database was NOT opened. Delivered error message: '%s'", + qFatal("Database was NOT opened. Delivered error message: '%s'.", qPrintable(database.lastError().text())); } else { diff --git a/src/core/feedsmodel.cpp b/src/core/feedsmodel.cpp index 298b9f3f6..5431e93cc 100644 --- a/src/core/feedsmodel.cpp +++ b/src/core/feedsmodel.cpp @@ -344,7 +344,8 @@ void FeedsModel::loadFromDatabase() { if (!query_categories.exec("SELECT * FROM Categories;") || query_categories.lastError().isValid()) { - qFatal("Query for obtaining categories failed."); + qFatal("Query for obtaining categories failed. Error message: '%s'.", + qPrintable(query_categories.lastError().text())); } while (query_categories.next()) {