[SCM] ktp-kded-integration-module packaging branch, master, updated. debian/15.12.1-2-382-gbd961c2
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:15:51 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-kded-module.git;a=commitdiff;h=11d6280
The following commit has been merged in the master branch:
commit 11d6280d7978bef4657f3908a746db4bc8a51b14
Author: Aleix Pol <aleixpol at kde.org>
Date: Wed Dec 3 13:03:18 2014 +0100
Simplify code
Don't concatenate 2 literals
Don't check if it exists before calling mkpath, mkpath will anyway.
If the database couldn't be opened, output a warning, so it can be reacted
to.
---
contact-cache.cpp | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/contact-cache.cpp b/contact-cache.cpp
index e3ed4aa..3b3c500 100644
--- a/contact-cache.cpp
+++ b/contact-cache.cpp
@@ -57,15 +57,14 @@ ContactCache::ContactCache(QObject *parent):
QObject(parent),
m_db(QSqlDatabase::addDatabase(QLatin1String("QSQLITE")))
{
- QString path(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QStringLiteral("ktp"));
+ QString path(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/ktp"));
QDir dir(path);
-
- if (!dir.exists()) {
- dir.mkpath(path);
- }
+ dir.mkpath(path);
m_db.setDatabaseName(dir.absolutePath() + QStringLiteral("/cache.db"));
- m_db.open();
+ if (!m_db.open()) {
+ qWarning() << "couldn't open database" << m_db.databaseName();
+ }
if (!m_db.tables().contains(QLatin1String("groups"))) {
QSqlQuery preparationsQuery(m_db);
--
ktp-kded-integration-module packaging
More information about the pkg-kde-commits
mailing list