summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'kde-frameworks/baloo')
-rw-r--r--kde-frameworks/baloo/Manifest1
-rw-r--r--kde-frameworks/baloo/baloo-5.26.0-r2.ebuild57
-rw-r--r--kde-frameworks/baloo/files/baloo-5.26.0-dont-corrupt.patch193
-rw-r--r--kde-frameworks/baloo/files/baloo-5.26.0-runtime-crash.patch41
-rw-r--r--kde-frameworks/baloo/files/baloo-5.26.0-size-limit.patch118
-rw-r--r--kde-frameworks/baloo/files/baloo-5.26.0-thread-safety.patch253
-rw-r--r--kde-frameworks/baloo/files/baloo-5.26.0-zerotimestamp-crash.patch39
7 files changed, 0 insertions, 702 deletions
diff --git a/kde-frameworks/baloo/Manifest b/kde-frameworks/baloo/Manifest
index d4946036ce8..1dddd50d7e6 100644
--- a/kde-frameworks/baloo/Manifest
+++ b/kde-frameworks/baloo/Manifest
@@ -1,4 +1,3 @@
DIST baloo-4.14.3.tar.xz 145604 SHA256 9edcd2bf9fcb4f42959087c954e533bf3345d0971b7402f04c0703c1b2e66a5c SHA512 ce46abee6edfea333fe2b361418ee92e1e7e4b252c4cb9a48f302ff906b3dc49d78c4e55c69de09b0085e03fe87e978b90c2896f7492b940550fda9766679218 WHIRLPOOL a7e80983830419c796d18e72df64d08bb51aebda29c527bf6a65c61c233d80ca7ab6c784255949bd0697f67637cb37fe3bffc15fd5dd9253e185f6194221ebc9
-DIST baloo-5.26.0.tar.xz 187444 SHA256 dedd54b468e799cf0fc6e4f69e05659605907a026ec02895fc3bc250ab13f331 SHA512 bec8591648c0e3af7e96e2097725383195fd21fbb7d973738e2ff0caff9fd631b336bccca5ac9d3bc135fda00d2e2edcd9e0d26213f8a0cd1ea88588bc97d2d2 WHIRLPOOL f33b1d5ba9fc2250586f437bc613c3088a18058594f64f80d2b23665c83aa8c15e7167f5cd60dbf8405439e374e55b2a20f92bfb8567c0da17788d47ed75357a
DIST baloo-5.29.0.tar.xz 201068 SHA256 76c0079d965b9a095a396b0e46e257de4458a2288922527a231aa38aad05f81b SHA512 fbaa00b38da33d9ebd635def1d7da180f86cf4e9a90fe42839d8b90c27f173e722fcabfcb29e7cd96cc80a8dc33f1c1637d0120512c504827fb1f0fd89110c41 WHIRLPOOL 2fc86132faf4f3f2f68d5f5bfb69ae6d1dcd38a65d39e31c75c3d13b929e4d452460fff077e9a9a81670c64eccda390209b2843b8ba55a8ddd719ce4a2119d1c
DIST baloo-5.30.0.tar.xz 190248 SHA256 a956c008a220c65dbd42d01a344a3338b6f40706278a6c120987d7e284cd4e08 SHA512 3d0c54c72825c5fcb95246d661826c89df88a21952123960648c3446bd2a53ccba40ae185c00f9250af2a87e65c909274e95d9950835bc1e263f2dac3f345656 WHIRLPOOL 6b6b53854dfcc9be1756564ff1a18cde120b439b8bb5cb062a854ba7bbd9399fac1136ef4e8c42bf11b4deb536b7cd6fc2664e5fbc61e3f838f9c7fcf5995f78
diff --git a/kde-frameworks/baloo/baloo-5.26.0-r2.ebuild b/kde-frameworks/baloo/baloo-5.26.0-r2.ebuild
deleted file mode 100644
index 393ab1434f7..00000000000
--- a/kde-frameworks/baloo/baloo-5.26.0-r2.ebuild
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=6
-
-KDE_TEST="forceoptional"
-VIRTUALX_REQUIRED="test"
-inherit kde5
-
-DESCRIPTION="Framework for searching and managing metadata"
-KEYWORDS="amd64 ~arm x86"
-IUSE=""
-
-DEPEND="
- $(add_frameworks_dep kconfig)
- $(add_frameworks_dep kcoreaddons)
- $(add_frameworks_dep kcrash)
- $(add_frameworks_dep kdbusaddons)
- $(add_frameworks_dep kfilemetadata)
- $(add_frameworks_dep ki18n)
- $(add_frameworks_dep kidletime)
- $(add_frameworks_dep kio)
- $(add_frameworks_dep solid)
- $(add_qt_dep qtdbus)
- $(add_qt_dep qtdeclarative)
- $(add_qt_dep qtgui)
- $(add_qt_dep qtwidgets)
- >=dev-db/lmdb-0.9.17
-"
-RDEPEND="${DEPEND}
- !kde-frameworks/baloo:4[-minimal(-)]
-"
-
-PATCHES=(
- "${FILESDIR}/${P}-runtime-crash.patch"
- "${FILESDIR}/${P}-size-limit.patch"
- "${FILESDIR}/${P}-zerotimestamp-crash.patch"
- "${FILESDIR}/${P}-thread-safety.patch"
- "${FILESDIR}/${P}-dont-corrupt.patch"
-)
-
-src_prepare() {
- kde5_src_prepare
- # upstream commit e73849e052c1a2ca174efe18d4a4958c6576fc33
- sed -e "/^X-KDE-autostart-condition/ s/Enabled/Indexing-Enabled/" \
- -i src/file/baloo_file.desktop || die
-}
-
-pkg_postinst() {
- kde5_pkg_postinst
- if use x86; then
- ewarn "The baloo index size limit for 32-bit is 1GB. For large homes, exclude"
- ewarn "subdirectories in System Settings / Search to avoid random segfaults."
- ewarn "For more information, visit: https://bugs.kde.org/show_bug.cgi?id=364475"
- fi
-}
diff --git a/kde-frameworks/baloo/files/baloo-5.26.0-dont-corrupt.patch b/kde-frameworks/baloo/files/baloo-5.26.0-dont-corrupt.patch
deleted file mode 100644
index 1dc1f1f19fc..00000000000
--- a/kde-frameworks/baloo/files/baloo-5.26.0-dont-corrupt.patch
+++ /dev/null
@@ -1,193 +0,0 @@
-From: Christoph Cullmann <cullmann@kde.org>
-Date: Sun, 11 Sep 2016 21:36:27 +0000
-Subject: Open baloo lmdb database read-only beside in baloo_file/baloo_file_extractor + balooctl (for some commands) + unit tests
-X-Git-Url: http://quickgit.kde.org/?p=baloo.git&a=commitdiff&h=02047b524a176da447d8c96e15c7e2abae8339ae
----
-Open baloo lmdb database read-only beside in baloo_file/baloo_file_extractor + balooctl (for some commands) + unit tests
-
-At the moment, any application that uses baloo can corrupt the db.
-Now, only the things that need to write to it open it with read-write.
-This only works as long as the library exposes only read-only things like Query/...
-
-REVIEW: 128892
----
-
-
---- a/src/engine/database.cpp
-+++ b/src/engine/database.cpp
-@@ -79,7 +79,7 @@
- }
- QFileInfo indexInfo(dir, QStringLiteral("index"));
-
-- if (mode == OpenDatabase && !indexInfo.exists()) {
-+ if ((mode != CreateDatabase) && !indexInfo.exists()) {
- return false;
- }
-
-@@ -117,7 +117,7 @@
-
- // The directory needs to be created before opening the environment
- QByteArray arr = QFile::encodeName(indexInfo.absoluteFilePath());
-- rc = mdb_env_open(m_env, arr.constData(), MDB_NOSUBDIR | MDB_NOMEMINIT, 0664);
-+ rc = mdb_env_open(m_env, arr.constData(), MDB_NOSUBDIR | MDB_NOMEMINIT | ((mode == ReadOnlyDatabase) ? MDB_RDONLY : 0), 0664);
- if (rc) {
- mdb_env_close(m_env);
- m_env = nullptr;
-@@ -136,7 +136,7 @@
- // Individual Databases
- //
- MDB_txn* txn;
-- if (mode == OpenDatabase) {
-+ if (mode != CreateDatabase) {
- int rc = mdb_txn_begin(m_env, NULL, MDB_RDONLY, &txn);
- Q_ASSERT_X(rc == 0, "Database::transaction ro begin", mdb_strerror(rc));
- if (rc) {
-
---- a/src/engine/database.h
-+++ b/src/engine/database.h
-@@ -49,8 +49,20 @@
- * Database open mode
- */
- enum OpenMode {
-+ /**
-+ * Create + open read-write dabase.
-+ */
- CreateDatabase,
-- OpenDatabase
-+
-+ /**
-+ * Read-Write Database, only works if database exists.
-+ */
-+ ReadWriteDatabase,
-+
-+ /**
-+ * Read-Only Database, only works if database exists.
-+ */
-+ ReadOnlyDatabase
- };
-
- /**
-
---- a/src/file/extractor/app.cpp
-+++ b/src/file/extractor/app.cpp
-@@ -55,7 +55,7 @@
- void App::slotNewInput()
- {
- Database *db = globalDatabaseInstance();
-- if (!db->open(Database::OpenDatabase)) {
-+ if (!db->open(Database::ReadWriteDatabase)) {
- qCritical() << "Failed to open the database";
- exit(1);
- }
-
---- a/src/lib/file.cpp
-+++ b/src/lib/file.cpp
-@@ -96,7 +96,7 @@
- }
-
- Database *db = globalDatabaseInstance();
-- if (!db->open(Database::OpenDatabase)) {
-+ if (!db->open(Database::ReadOnlyDatabase)) {
- return false;
- }
-
-
---- a/src/lib/searchstore.cpp
-+++ b/src/lib/searchstore.cpp
-@@ -48,7 +48,7 @@
- : m_db(0)
- {
- m_db = globalDatabaseInstance();
-- if (!m_db->open(Database::OpenDatabase)) {
-+ if (!m_db->open(Database::ReadOnlyDatabase)) {
- m_db = 0;
- }
-
-
---- a/src/lib/taglistjob.cpp
-+++ b/src/lib/taglistjob.cpp
-@@ -46,7 +46,7 @@
- void TagListJob::start()
- {
- Database *db = globalDatabaseInstance();
-- if (!db->open(Database::OpenDatabase)) {
-+ if (!db->open(Database::ReadOnlyDatabase)) {
- setError(UserDefinedError);
- setErrorText(QStringLiteral("Failed to open the database"));
- emitResult();
-
---- a/src/qml/experimental/monitor.cpp
-+++ b/src/qml/experimental/monitor.cpp
-@@ -126,7 +126,7 @@
- void Monitor::fetchTotalFiles()
- {
- Baloo::Database *db = Baloo::globalDatabaseInstance();
-- if (db->open(Baloo::Database::OpenDatabase)) {
-+ if (db->open(Baloo::Database::ReadOnlyDatabase)) {
- Baloo::Transaction tr(db, Baloo::Transaction::ReadOnly);
- m_totalFiles = tr.size();
- m_filesIndexed = tr.size() - tr.phaseOneSize();
-
---- a/src/tools/balooctl/main.cpp
-+++ b/src/tools/balooctl/main.cpp
-@@ -191,7 +191,7 @@
- }
-
- Database *db = globalDatabaseInstance();
-- if (!db->open(Database::OpenDatabase)) {
-+ if (!db->open(Database::ReadWriteDatabase)) {
- out << "Baloo Index could not be opened\n";
- return 1;
- }
-@@ -230,7 +230,7 @@
- }
-
- Database *db = globalDatabaseInstance();
-- if (!db->open(Database::OpenDatabase)) {
-+ if (!db->open(Database::ReadWriteDatabase)) {
- out << "Baloo Index could not be opened\n";
- return 1;
- }
-@@ -260,7 +260,7 @@
-
- if (command == QStringLiteral("indexSize")) {
- Database *db = globalDatabaseInstance();
-- if (!db->open(Database::OpenDatabase)) {
-+ if (!db->open(Database::ReadOnlyDatabase)) {
- out << "Baloo Index could not be opened\n";
- return 1;
- }
-@@ -311,7 +311,7 @@
-
- if (command == QStringLiteral("checkDb")) {
- Database *db = globalDatabaseInstance();
-- if (!db->open(Database::OpenDatabase)) {
-+ if (!db->open(Database::ReadOnlyDatabase)) {
- out << "Baloo Index could not be opened\n";
- return 1;
- }
-
---- a/src/tools/balooctl/statuscommand.cpp
-+++ b/src/tools/balooctl/statuscommand.cpp
-@@ -56,7 +56,7 @@
- }
-
- Database *db = globalDatabaseInstance();
-- if (!db->open(Database::OpenDatabase)) {
-+ if (!db->open(Database::ReadOnlyDatabase)) {
- out << i18n("Baloo Index could not be opened") << endl;
- return 1;
- }
-
---- a/src/tools/balooshow/main.cpp
-+++ b/src/tools/balooshow/main.cpp
-@@ -101,7 +101,7 @@
- QString text;
-
- Baloo::Database *db = Baloo::globalDatabaseInstance();
-- if (!db->open(Baloo::Database::OpenDatabase)) {
-+ if (!db->open(Baloo::Database::ReadOnlyDatabase)) {
- stream << i18n("The Baloo index could not be opened. Please run \"balooctl status\" to see if Baloo is enabled and working.")
- << endl;
- return 1;
-
diff --git a/kde-frameworks/baloo/files/baloo-5.26.0-runtime-crash.patch b/kde-frameworks/baloo/files/baloo-5.26.0-runtime-crash.patch
deleted file mode 100644
index 0ae8b9b453d..00000000000
--- a/kde-frameworks/baloo/files/baloo-5.26.0-runtime-crash.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From: Christoph Cullmann <cullmann@kde.org>
-Date: Thu, 08 Sep 2016 22:00:40 +0000
-Subject: fix baloo_file crash with corrupted database
-X-Git-Url: http://quickgit.kde.org/?p=baloo.git&a=commitdiff&h=a03b0caa4ca1fbfc249bfc0c2730aac340bbf929
----
-fix baloo_file crash with corrupted database
-
-CHANGELOG: Handle corruption of index database for baloo_file, try to recreate the database or abort if that fails.
-
-REVIEW: 128865
----
-
-
---- a/src/file/main.cpp
-+++ b/src/file/main.cpp
-@@ -82,7 +82,23 @@
- QFile::remove(path + "/index-lock");
-
- Baloo::Database *db = Baloo::globalDatabaseInstance();
-- db->open(Baloo::Database::CreateDatabase);
-+
-+ /**
-+ * try to open, if that fails, try to unlink the index db and retry
-+ */
-+ if (!db->open(Baloo::Database::CreateDatabase)) {
-+ // delete old stuff, set to initial run!
-+ qWarning() << "Failed to create database, removing corrupted database.";
-+ QFile::remove(path + "/index");
-+ QFile::remove(path + "/index-lock");
-+ indexerConfig.setInitialRun(true);
-+
-+ // try to create now after cleanup, if still no works => fail
-+ if (!db->open(Baloo::Database::CreateDatabase)) {
-+ qWarning() << "Failed to create database after deleting corrupted one.";
-+ return 1;
-+ }
-+ }
-
- Baloo::MainHub hub(db, &indexerConfig);
- return app.exec();
-
diff --git a/kde-frameworks/baloo/files/baloo-5.26.0-size-limit.patch b/kde-frameworks/baloo/files/baloo-5.26.0-size-limit.patch
deleted file mode 100644
index 6739a2754b6..00000000000
--- a/kde-frameworks/baloo/files/baloo-5.26.0-size-limit.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From: Christoph Cullmann <cullmann@kde.org>
-Date: Sun, 11 Sep 2016 16:54:58 +0000
-Subject: Increase size limit of baloo index for 64-bit machines
-X-Git-Url: http://quickgit.kde.org/?p=baloo.git&a=commitdiff&h=b0890aca71aa4f0fdabe65ee7b7fbd0bc844d8b8
----
-Increase size limit of baloo index for 64-bit machines
-
-CHANGELOG: On 64-bit systems baloo allows now > 5 GB index storage.
-
-Increase size limit of baloo index for 64-bit machines to avoid crashs after > 5GB of index size.
-(Better would be additional out-of-space handling, but ATM baloo has zero checks for that)
-
-The size limit for 32-bit is still 1GB, like before (there was a silent overflow from 5GB to 1GB in the computation), people with large homes will still get random segfaults on 32-bit.
-
-Patch based on patch from Hao Zhang, Bug 364475
-
-REVIEW: 128885
-BUG: 364475
----
-
-
---- a/src/engine/database.cpp
-+++ b/src/engine/database.cpp
-@@ -93,8 +93,18 @@
- return false;
- }
-
-+ /**
-+ * maximal number of allowed named databases, must match number of databases we create below
-+ * each additional one leads to overhead
-+ */
- mdb_env_set_maxdbs(m_env, 12);
-- mdb_env_set_mapsize(m_env, static_cast<size_t>(1024) * 1024 * 1024 * 5); // 5 gb
-+
-+ /**
-+ * size limit for database == size limit of mmap
-+ * use 1 GB on 32-bit, use 256 GB on 64-bit
-+ */
-+ const size_t maximalSizeInBytes = size_t((sizeof(size_t) == 4) ? 1 : 256) * size_t(1024) * size_t(1024) * size_t(1024);
-+ mdb_env_set_mapsize(m_env, maximalSizeInBytes);
-
- // The directory needs to be created before opening the environment
- QByteArray arr = QFile::encodeName(indexInfo.absoluteFilePath());
-
---- a/src/engine/databasesize.h
-+++ b/src/engine/databasesize.h
-@@ -31,30 +31,30 @@
- * This is the size which is computed with all the pages used from all the
- * individual database pages
- */
-- uint expectedSize;
-+ size_t expectedSize;
-
- /**
- * This is the size based on the MDB_env and the total number of pages used
- */
-- uint actualSize;
-+ size_t actualSize;
-
-- uint postingDb;
-- uint positionDb;
-+ size_t postingDb;
-+ size_t positionDb;
-
-- uint docTerms;
-- uint docFilenameTerms;
-- uint docXattrTerms;
-+ size_t docTerms;
-+ size_t docFilenameTerms;
-+ size_t docXattrTerms;
-
-- uint idTree;
-- uint idFilename;
-+ size_t idTree;
-+ size_t idFilename;
-
-- uint docTime;
-- uint docData;
-+ size_t docTime;
-+ size_t docData;
-
-- uint contentIndexingIds;
-- uint failedIds;
-+ size_t contentIndexingIds;
-+ size_t failedIds;
-
-- uint mtimeDb;
-+ size_t mtimeDb;
- };
-
- }
-
---- a/src/engine/transaction.cpp
-+++ b/src/engine/transaction.cpp
-@@ -402,7 +402,7 @@
- //
- // File Size
- //
--static uint dbiSize(MDB_txn* txn, MDB_dbi dbi)
-+static size_t dbiSize(MDB_txn* txn, MDB_dbi dbi)
- {
- MDB_stat stat;
- mdb_stat(txn, dbi, &stat);
-
---- a/src/tools/balooctl/statuscommand.cpp
-+++ b/src/tools/balooctl/statuscommand.cpp
-@@ -92,8 +92,8 @@
-
- const QString path = fileIndexDbPath();
-
-- QFileInfo indexInfo(path + QLatin1String("/index"));
-- quint32 size = indexInfo.size();
-+ const QFileInfo indexInfo(path + QLatin1String("/index"));
-+ const auto size = indexInfo.size();
- KFormat format(QLocale::system());
- if (size) {
- out << "Current size of index is " << format.formatByteSize(size, 2) << endl;
-
diff --git a/kde-frameworks/baloo/files/baloo-5.26.0-thread-safety.patch b/kde-frameworks/baloo/files/baloo-5.26.0-thread-safety.patch
deleted file mode 100644
index 11965f5ef3f..00000000000
--- a/kde-frameworks/baloo/files/baloo-5.26.0-thread-safety.patch
+++ /dev/null
@@ -1,253 +0,0 @@
-From: Christoph Cullmann <cullmann@kde.org>
-Date: Sun, 11 Sep 2016 18:24:40 +0000
-Subject: Make e.g. Baloo::Query thread safe.
-X-Git-Url: http://quickgit.kde.org/?p=baloo.git&a=commitdiff&h=e34da150d82a57cf417a59b8b632b2fecb32a6f7
----
-Make e.g. Baloo::Query thread safe.
-
-lmdb itself is thread safe (e.g. you can use the same env in multiple threads).
-Unfortunately, the Baloo:atabase itself not, as open() might race against other open calls (we have one unique db object in baloo).
-
-=> add non-recursive mutex (recursive mutex not needed, one just must avoid to call isOpen() or path() inside open, that is done, else no unit test works).
-
-REVIEW: 128890
----
-Merged with commits
-988e5feb5de64ed25337fe2ff9b494eb30b15b47
-54f7363048c7db41f63c85f637911a5598c30e9e
-377e62b0307839edb0245d65381a3f55f594ae4e
----
-
---- a/src/engine/database.cpp
-+++ b/src/engine/database.cpp
-@@ -1,6 +1,7 @@
- /*
- This file is part of the KDE Baloo project.
- * Copyright (C) 2015 Vishesh Handa <vhanda@kde.org>
-+ * Copyright (C) 2016 Christoph Cullmann <cullmann@kde.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
-@@ -43,23 +44,31 @@
- #include <QFile>
- #include <QFileInfo>
- #include <QDir>
-+#include <QMutexLocker>
-
- using namespace Baloo;
-
- Database::Database(const QString& path)
- : m_path(path)
-- , m_env(0)
-+ , m_env(nullptr)
- {
- }
-
- Database::~Database()
- {
-- mdb_env_close(m_env);
-+ // try only to close if we did open the DB successfully
-+ if (m_env) {
-+ mdb_env_close(m_env);
-+ m_env = nullptr;
-+ }
- }
-
- bool Database::open(OpenMode mode)
- {
-- if (isOpen()) {
-+ QMutexLocker locker(&m_mutex);
-+
-+ // nop if already open!
-+ if (m_env) {
- return true;
- }
-
-@@ -89,7 +98,7 @@
-
- int rc = mdb_env_create(&m_env);
- if (rc) {
-- m_env = 0;
-+ m_env = nullptr;
- return false;
- }
-
-@@ -110,7 +119,8 @@
- QByteArray arr = QFile::encodeName(indexInfo.absoluteFilePath());
- rc = mdb_env_open(m_env, arr.constData(), MDB_NOSUBDIR | MDB_NOMEMINIT, 0664);
- if (rc) {
-- m_env = 0;
-+ mdb_env_close(m_env);
-+ m_env = nullptr;
- return false;
- }
-
-@@ -118,6 +128,7 @@
- Q_ASSERT_X(rc == 0, "Database::open reader_check", mdb_strerror(rc));
- if (rc) {
- mdb_env_close(m_env);
-+ m_env = nullptr;
- return false;
- }
-
-@@ -129,9 +140,8 @@
- int rc = mdb_txn_begin(m_env, NULL, MDB_RDONLY, &txn);
- Q_ASSERT_X(rc == 0, "Database::transaction ro begin", mdb_strerror(rc));
- if (rc) {
-- mdb_txn_abort(txn);
- mdb_env_close(m_env);
-- m_env = 0;
-+ m_env = nullptr;
- return false;
- }
-
-@@ -157,7 +167,7 @@
- if (!m_dbis.isValid()) {
- mdb_txn_abort(txn);
- mdb_env_close(m_env);
-- m_env = 0;
-+ m_env = nullptr;
- return false;
- }
-
-@@ -165,16 +175,15 @@
- Q_ASSERT_X(rc == 0, "Database::transaction ro commit", mdb_strerror(rc));
- if (rc) {
- mdb_env_close(m_env);
-- m_env = 0;
-+ m_env = nullptr;
- return false;
- }
- } else {
- int rc = mdb_txn_begin(m_env, NULL, 0, &txn);
- Q_ASSERT_X(rc == 0, "Database::transaction begin", mdb_strerror(rc));
- if (rc) {
-- mdb_txn_abort(txn);
- mdb_env_close(m_env);
-- m_env = 0;
-+ m_env = nullptr;
- return false;
- }
-
-@@ -200,7 +209,7 @@
- if (!m_dbis.isValid()) {
- mdb_txn_abort(txn);
- mdb_env_close(m_env);
-- m_env = 0;
-+ m_env = nullptr;
- return false;
- }
-
-@@ -208,16 +217,24 @@
- Q_ASSERT_X(rc == 0, "Database::transaction commit", mdb_strerror(rc));
- if (rc) {
- mdb_env_close(m_env);
-- m_env = 0;
-+ m_env = nullptr;
- return false;
- }
- }
-
-+ Q_ASSERT(m_env);
- return true;
- }
-
-+bool Database::isOpen() const
-+{
-+ QMutexLocker locker(&m_mutex);
-+ return m_env != 0;
-+}
-+
- QString Database::path() const
- {
-+ QMutexLocker locker(&m_mutex);
- return m_path;
- }
-
---- a/src/engine/database.h
-+++ b/src/engine/database.h
-@@ -1,6 +1,7 @@
- /*
- This file is part of the KDE Baloo project.
- * Copyright (C) 2015 Vishesh Handa <vhanda@kde.org>
-+ * Copyright (C) 2016 Christoph Cullmann <cullmann@kde.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
-@@ -21,6 +22,8 @@
- #ifndef BALOO_DATABASE_H
- #define BALOO_DATABASE_H
-
-+#include <QMutex>
-+
- #include "document.h"
- #include "databasedbis.h"
-
-@@ -31,21 +34,56 @@
- class BALOO_ENGINE_EXPORT Database
- {
- public:
-+ /**
-+ * Init database for given DB path, will not open it.
-+ * @param path db path
-+ */
- explicit Database(const QString& path);
-+
-+ /**
-+ * Destruct db, might close it, if opened.
-+ */
- ~Database();
-
-- QString path() const;
--
-+ /**
-+ * Database open mode
-+ */
- enum OpenMode {
- CreateDatabase,
- OpenDatabase
- };
-+
-+ /**
-+ * Open database in given mode.
-+ * Nop after open was done (even if mode differs).
-+ * There is no close as this would invalidate the database for all threads using it.
-+ * @param mode create or open only?
-+ * @return success?
-+ */
- bool open(OpenMode mode);
-
-- bool isOpen() const { return m_env != 0; }
-+ /**
-+ * Is database open?
-+ * @return database open?
-+ */
-+ bool isOpen() const;
-+
-+ /**
-+ * Path to database.
-+ * @return database path
-+ */
-+ QString path() const;
-
- private:
-- QString m_path;
-+ /**
-+ * serialize access, as open might be called from multiple threads
-+ */
-+ mutable QMutex m_mutex;
-+
-+ /**
-+ * database path
-+ */
-+ const QString m_path;
-
- MDB_env* m_env;
- DatabaseDbis m_dbis;
-@@ -56,6 +94,5 @@
- };
- }
-
--
- #endif // BALOO_DATABASE_H
-
diff --git a/kde-frameworks/baloo/files/baloo-5.26.0-zerotimestamp-crash.patch b/kde-frameworks/baloo/files/baloo-5.26.0-zerotimestamp-crash.patch
deleted file mode 100644
index 7e666137861..00000000000
--- a/kde-frameworks/baloo/files/baloo-5.26.0-zerotimestamp-crash.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From: Christoph Cullmann <cullmann@kde.org>
-Date: Sun, 11 Sep 2016 16:48:53 +0000
-Subject: allow ctime/mtime == 0
-X-Git-Url: http://quickgit.kde.org/?p=baloo.git&a=commitdiff&h=628daced19b88d0c537736a14aea3287a4662609
----
-allow ctime/mtime == 0
-
-Fix that baloo is instant killed by any file with timestamp 0. (which is OK and can easily happen after unpacking some zip/tar/..)
-
-REVIEW: 128887
-BUG: 355238
----
-
-
---- a/src/engine/documenttimedb.cpp
-+++ b/src/engine/documenttimedb.cpp
-@@ -58,8 +58,6 @@
- void DocumentTimeDB::put(quint64 docId, const TimeInfo& info)
- {
- Q_ASSERT(docId > 0);
-- Q_ASSERT(info.mTime);
-- Q_ASSERT(info.cTime);
-
- MDB_val key;
- key.mv_size = sizeof(quint64);
-
---- a/src/engine/writetransaction.cpp
-+++ b/src/engine/writetransaction.cpp
-@@ -206,9 +206,6 @@
- }
-
- if (operations & DocumentTime) {
-- Q_ASSERT(doc.m_mTime);
-- Q_ASSERT(doc.m_cTime);
--
- DocumentTimeDB::TimeInfo info;
- info.mTime = doc.m_mTime;
- info.cTime = doc.m_cTime;
-