diff -Nru libkubuntu-14.04ubuntu3/debian/changelog libkubuntu-14.04ubuntu4/debian/changelog --- libkubuntu-14.04ubuntu3/debian/changelog 2014-02-20 08:57:08.000000000 +0000 +++ libkubuntu-14.04ubuntu4/debian/changelog 2014-03-17 12:58:03.000000000 +0000 @@ -1,3 +1,17 @@ +libkubuntu (14.04ubuntu4) trusty; urgency=medium + + * Bump standards from 3.9.4. to 3.9.5 to silence lintian. + * new bool LanguageCollectionPrivate::initalized + + defaults to false + + set to the return value of qapt::backend::init + + presents fatal init error and results in the collection being defunct + + collection::languages() returns an empty set if the backend could not + be initalized + This prevents crashes in l10nevent when either the apt configs or + the cache is busted. + + -- Harald Sitter Thu, 20 Feb 2014 09:58:25 +0100 + libkubuntu (14.04ubuntu3) trusty; urgency=medium * Instead of manually chopping newlines, use QString::simplified diff -Nru libkubuntu-14.04ubuntu3/debian/control libkubuntu-14.04ubuntu4/debian/control --- libkubuntu-14.04ubuntu3/debian/control 2014-02-20 08:57:08.000000000 +0000 +++ libkubuntu-14.04ubuntu4/debian/control 2014-03-17 12:58:03.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Kubuntu Developers XSBC-Original-Maintainer: Harald Sitter Build-Depends: debhelper (>= 9), pkg-kde-tools, cmake, kdelibs5-dev, libqapt-dev -Standards-Version: 3.9.4 +Standards-Version: 3.9.5 Vcs-Git: git://anongit.kde.org/scratch/sitter/libkubuntu.git Package: libkubuntu0 diff -Nru libkubuntu-14.04ubuntu3/src/l10n_languagecollection.cpp libkubuntu-14.04ubuntu4/src/l10n_languagecollection.cpp --- libkubuntu-14.04ubuntu3/src/l10n_languagecollection.cpp 2014-02-20 08:57:08.000000000 +0000 +++ libkubuntu-14.04ubuntu4/src/l10n_languagecollection.cpp 2014-03-17 12:58:03.000000000 +0000 @@ -28,6 +28,7 @@ namespace Kubuntu { LanguageCollectionPrivate::LanguageCollectionPrivate() + : initalized(false) { } @@ -36,7 +37,7 @@ , d_ptr(new LanguageCollectionPrivate) { Q_D(LanguageCollection); - d->backend.init(); + d->initalized = d->backend.init(); connect(&d->backend, SIGNAL(xapianUpdateProgress(int)), this, SIGNAL(updateProgress(int))); connect(&d->backend, SIGNAL(xapianUpdateFinished()), @@ -68,7 +69,18 @@ { Q_D(LanguageCollection); + // Prevent access to an uninitalized backend as QApt doesn't really like it + // and tends to explode at one point or another. + // Init can only fail when either the config parsing/loading did not + // work or when the cache cannot be opened for reading. Both are rather + // fatal, so we are not going to try to recover functionality. Once init + // failed the collection will be defunct. + if (!d->initalized) { + return QSet(); + } + // Make sure the xapian cache is open at this point. + // TODO: look into the necessity of calling reloadCache here. d->backend.openXapianIndex(); const QString queryString = QLatin1String("kde-l10n-"); diff -Nru libkubuntu-14.04ubuntu3/src/l10n_languagecollection_p.h libkubuntu-14.04ubuntu4/src/l10n_languagecollection_p.h --- libkubuntu-14.04ubuntu3/src/l10n_languagecollection_p.h 2014-02-20 08:57:08.000000000 +0000 +++ libkubuntu-14.04ubuntu4/src/l10n_languagecollection_p.h 2014-03-17 12:58:03.000000000 +0000 @@ -31,6 +31,8 @@ LanguageCollectionPrivate(); QApt::Backend backend; + + bool initalized; }; } // namespace Kubuntu