[SCM] Akonadi packaging branch, master, updated. debian/1.13.0-8-27-g15d9dd9
Maximiliano Curia
maxy at moszumanska.debian.org
Sat Sep 5 22:19:01 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/akonadi.git;a=commitdiff;h=b336ad5
The following commit has been merged in the master branch:
commit b336ad5e22abda3cec5a3cdfad6875a2cb2e3936
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date: Sat Sep 5 13:10:51 2015 +0200
Remove upstream patches and refresh the remaining ones.
---
debian/changelog | 2 +
debian/patches/postgresql-data-checksums.patch | 24 +--
debian/patches/postgresql9.4.patch | 26 +--
debian/patches/series | 12 --
debian/patches/upstream-MOVEcomplete.patch | 59 -------
...-do_not_crash_when_setmntent_returns_NULL.patch | 24 ---
...buffer_overflow_in_AKTEST_FAKESERVER_MAIN.patch | 19 ---
.../upstream-fix_typo_in_if_condition.patch | 22 ---
...upstream-prevent-QTimer-negative-interval.patch | 27 ----
debian/patches/upstream-use-QAtomicInt.patch | 37 -----
.../upstream_dont_call_insert_from_Q_ASSERT.patch | 30 ----
...ream_dont_leak_old_external_payload_files.patch | 135 ----------------
.../upstream_opt-0002-intern-entity-strings.patch | 176 ---------------------
.../patches/upstream_opt-0003-QMutexLocker.patch | 112 -------------
.../upstream_opt-0004-one-hash-lookup.patch | 32 ----
.../upstream_opt-0005-optimize-queries.patch | 107 -------------
16 files changed, 27 insertions(+), 817 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 047a9f1..6e6e9e8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ akonadi (15.08.0-1~) UNRELEASED; urgency=medium
* New upstream release (15.07.90).
* New upstream release (15.08.0).
+ * Remove upstream patches.
+ * Refresh patches.
-- Maximiliano Curia <maxy at debian.org> Sat, 05 Sep 2015 12:40:38 +0200
diff --git a/debian/patches/postgresql-data-checksums.patch b/debian/patches/postgresql-data-checksums.patch
index f885f30..00c7b1e 100644
--- a/debian/patches/postgresql-data-checksums.patch
+++ b/debian/patches/postgresql-data-checksums.patch
@@ -4,15 +4,15 @@ Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=791807
Author: Dmitry Smirnov <onlyjob at member.fsf.org>
Description: initialise PSQL database with "--data-checksums".
---- a/server/src/storage/dbconfigpostgresql.cpp
-+++ b/server/src/storage/dbconfigpostgresql.cpp
-@@ -219,8 +219,9 @@
- const QString command = QString::fromLatin1( "%1" ).arg( mInitDbPath );
- QStringList arguments;
- arguments << QString::fromLatin1( "--pgdata=%2" ).arg( mPgData )
- // TODO check locale
-+ << QString::fromLatin1( "--data-checksums" )
- << QString::fromLatin1( "--locale=en_US.UTF-8" );
- QProcess::execute( command, arguments );
- }
-
+Index: akonadi/src/server/storage/dbconfigpostgresql.cpp
+===================================================================
+--- akonadi.orig/src/server/storage/dbconfigpostgresql.cpp 2015-09-05 12:40:50.673166408 +0200
++++ akonadi/src/server/storage/dbconfigpostgresql.cpp 2015-09-05 12:43:05.975761742 +0200
+@@ -223,6 +223,7 @@
+ QStringList arguments;
+ arguments << QString::fromLatin1("--pgdata=%2").arg(mPgData)
+ // TODO check locale
++ << QString::fromLatin1( "--data-checksums")
+ << QString::fromLatin1("--locale=en_US.UTF-8");
+ QProcess::execute(command, arguments);
+ }
diff --git a/debian/patches/postgresql9.4.patch b/debian/patches/postgresql9.4.patch
index 6f96b76..cd7a915 100644
--- a/debian/patches/postgresql9.4.patch
+++ b/debian/patches/postgresql9.4.patch
@@ -6,17 +6,17 @@ Description: add PostgreSQL 9.4 path
Perhaps there shall be a better way to find PostgreSQL executable than
to search through the list of hard-coded paths...
---- a/server/src/storage/dbconfigpostgresql.cpp
-+++ b/server/src/storage/dbconfigpostgresql.cpp
-@@ -78,9 +78,10 @@
- << QLatin1String( "/usr/lib/postgresql/8.4/bin" )
- << QLatin1String( "/usr/lib/postgresql/9.0/bin" )
- << QLatin1String( "/usr/lib/postgresql/9.1/bin" )
- << QLatin1String( "/usr/lib/postgresql/9.2/bin" )
-- << QLatin1String( "/usr/lib/postgresql/9.3/bin" );
-+ << QLatin1String( "/usr/lib/postgresql/9.3/bin" )
-+ << QLatin1String( "/usr/lib/postgresql/9.4/bin" );
+Index: akonadi/src/server/storage/dbconfigpostgresql.cpp
+===================================================================
+--- akonadi.orig/src/server/storage/dbconfigpostgresql.cpp 2015-09-05 12:43:05.975761742 +0200
++++ akonadi/src/server/storage/dbconfigpostgresql.cpp 2015-09-05 12:45:06.906930014 +0200
+@@ -84,7 +84,8 @@
+ << QLatin1String("/usr/lib/postgresql/9.0/bin")
+ << QLatin1String("/usr/lib/postgresql/9.1/bin")
+ << QLatin1String("/usr/lib/postgresql/9.2/bin")
+- << QLatin1String("/usr/lib/postgresql/9.3/bin");
++ << QLatin1String("/usr/lib/postgresql/9.3/bin")
++ << QLatin1String("/usr/lib/postgresql/9.4/bin");
- defaultServerPath = XdgBaseDirs::findExecutableFile( QLatin1String( "pg_ctl" ), postgresSearchPath );
- defaultInitDbPath = XdgBaseDirs::findExecutableFile( QLatin1String( "initdb" ), postgresSearchPath );
- defaultHostName = Utils::preferredSocketDirectory( AkStandardDirs::saveDir( "data", QLatin1String( "db_misc" ) ) );
+ defaultServerPath = XdgBaseDirs::findExecutableFile(QLatin1String("pg_ctl"), postgresSearchPath);
+ defaultInitDbPath = XdgBaseDirs::findExecutableFile(QLatin1String("initdb"), postgresSearchPath);
diff --git a/debian/patches/series b/debian/patches/series
index b64faf0..c599d61 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,14 +1,2 @@
postgresql-data-checksums.patch
postgresql9.4.patch
-upstream-MOVEcomplete.patch
-upstream-fix_typo_in_if_condition.patch
-upstream-fix_buffer_overflow_in_AKTEST_FAKESERVER_MAIN.patch
-upstream-do_not_crash_when_setmntent_returns_NULL.patch
-upstream-prevent-QTimer-negative-interval.patch
-upstream-use-QAtomicInt.patch
-upstream_dont_call_insert_from_Q_ASSERT.patch
-upstream_dont_leak_old_external_payload_files.patch
-upstream_opt-0002-intern-entity-strings.patch
-upstream_opt-0003-QMutexLocker.patch
-upstream_opt-0004-one-hash-lookup.patch
-upstream_opt-0005-optimize-queries.patch
diff --git a/debian/patches/upstream-MOVEcomplete.patch b/debian/patches/upstream-MOVEcomplete.patch
deleted file mode 100644
index c4100f8..0000000
--- a/debian/patches/upstream-MOVEcomplete.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From abe71f46c3b2e657db25ac16c43a4c76b2212a9f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Dan=20Vr=C3=A1til?= <dvratil at redhat.com>
-Date: Wed, 17 Jun 2015 13:04:13 +0200
-Subject: [PATCH] Don't throw exception when MOVE handler finds no items to move
-
-Instead return "OK MOVE complete" right away. The reason for this is that
-when client tries to move an Item from a folder into the same folder (it's
-possible in KMail, also mailfilter agent might trigger this situation) the
-subsequent command gets eaten by ImapStreamParser and the client's Job gets
-stuck waiting for response forever. According to Laurent this could also fix
-the Mail Filter Agent getting stuck occasionally.
-
-The problem is in ImapStreamParser::atCommandEnd() method, which is called
-by the Move handler at some point. atCommandEnd() checks whether we reached
-command end in the stream by looking if the next characters in the stream
-are "
" and if so it will consume the command end ("
"), effectively
-moving the streaming position BEYOND the command. In case of MOVE the
-command has already been completely parsed so we are actually at the end of
-the command and so ImapStreamParser will consume the "
" and position the
-stream beyond the command end.
-
-After that the Move handler tries to get the items from DB and throws the
-exception (the second part of the condition in the SQL query causes that
-the query yields no results in this situation) which gets us back to
-Connection where we then call ImapStreamParser::skipCommand(). At this point
-however there are no more data in the stream (because atCommandEnd() moved
-us beyond the end of the MOVE command) and so ImapStreamParser will block
-and wait for more data (with 30 seconds timeout). If client sends another
-command within this time the ImapStreamParser will think that this is the
-command to be skipped and will consume it. This means that the command never
-really reaches the Connection as it's consumed as soon as it's captured by
-ImapStreamParser. And because Akonadi never receives the command it cannot
-send a response and thus the Job in client will wait forever and ever...
-
-Proper fix would be to make ImapStreamParser::atCommandEnd() to only peek
-instead of actually altering the position in the stream however I'm really
-afraid that it could break some other stuff that relies on this (broken?)
-behaviour and our test coverage is not sufficient at this point to be
-reliable enough.
----
- server/src/handler/move.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/server/src/handler/move.cpp b/server/src/handler/move.cpp
-index 0a6c3bf..4cf9d4e 100644
---- a/server/src/handler/move.cpp
-+++ b/server/src/handler/move.cpp
-@@ -85,7 +85,7 @@ bool Move::parseStream()
- if ( qb.exec() ) {
- const QVector<PimItem> items = qb.result();
- if ( items.isEmpty() ) {
-- throw HandlerException( "No items found" );
-+ return successResponse( "MOVE complete" );
- }
-
- // Split the list by source collection
---
-2.1.4
-
diff --git a/debian/patches/upstream-do_not_crash_when_setmntent_returns_NULL.patch b/debian/patches/upstream-do_not_crash_when_setmntent_returns_NULL.patch
deleted file mode 100644
index f66b429..0000000
--- a/debian/patches/upstream-do_not_crash_when_setmntent_returns_NULL.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit ca59eb345cfef368242929ea33beca4bff837e9d
-Author: Dan Vrátil <dvratil at redhat.com>
-Date: Thu Sep 18 16:54:26 2014 +0200
-
- Don't crash when setmntent returns NULL
-
- setmntent can fail when there's no /etc/mtab file for instance and
- passing NULL pointer to getmntent crashes, so we need to return when
- this happens.
-
-diff --git a/server/src/utils.cpp b/server/src/utils.cpp
-index b04a812..b51c330 100644
---- a/server/src/utils.cpp
-+++ b/server/src/utils.cpp
-@@ -179,6 +179,9 @@ QString Utils::getDirectoryFileSystem(const QString &directory)
- QString bestMatchFS;
-
- FILE *mtab = setmntent("/etc/mtab", "r");
-+ if (!mtab) {
-+ return QString();
-+ }
- while (mntent *mnt = getmntent(mtab)) {
- if (qstrcmp(mnt->mnt_type, MNTTYPE_IGNORE) == 0) {
- continue;
diff --git a/debian/patches/upstream-fix_buffer_overflow_in_AKTEST_FAKESERVER_MAIN.patch b/debian/patches/upstream-fix_buffer_overflow_in_AKTEST_FAKESERVER_MAIN.patch
deleted file mode 100644
index e17f9a0..0000000
--- a/debian/patches/upstream-fix_buffer_overflow_in_AKTEST_FAKESERVER_MAIN.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-commit 01c86229f9e26d9e036f6f2ab405659ed836b5c0
-Author: Dan Vrátil <dvratil at redhat.com>
-Date: Mon Sep 8 15:36:18 2014 +0200
-
- Fix buffer overflow in AKTEST_FAKESERVER_MAIN()
-
-diff --git a/shared/aktest.h b/shared/aktest.h
-index b1b9caa..3026304 100644
---- a/shared/aktest.h
-+++ b/shared/aktest.h
-@@ -57,7 +57,7 @@ int main(int argc, char **argv) \
- } \
- } \
- TestObject tc; \
-- char **fakeArgv = (char **) malloc(options.count()); \
-+ char **fakeArgv = (char **) malloc(options.count() * sizeof(char**)); \
- for (int i = 0; i < options.count(); ++i) { \
- fakeArgv[i] = options[i]; \
- } \
diff --git a/debian/patches/upstream-fix_typo_in_if_condition.patch b/debian/patches/upstream-fix_typo_in_if_condition.patch
deleted file mode 100644
index 2373ccb..0000000
--- a/debian/patches/upstream-fix_typo_in_if_condition.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-commit e52f9be20e566e507e77421f1243f51aa2fe8e55
-Author: Dan Vrátil <dvratil at redhat.com>
-Date: Mon Aug 25 14:35:14 2014 +0200
-
- Fix typo in if condition
-
- BUG: 338483
- FIXED-IN: 1.13.1
-
-diff --git a/server/src/handler/akappend.cpp b/server/src/handler/akappend.cpp
-index 43f03ba..ad3682f 100644
---- a/server/src/handler/akappend.cpp
-+++ b/server/src/handler/akappend.cpp
-@@ -380,7 +380,7 @@ bool AkAppend::parseStream()
- if ( itemFlags.incremental ) {
- throw HandlerException( "Incremental flags changes are not allowed in AK-APPEND" );
- }
-- if ( itemTagsRID.incremental || itemTagsRID.incremental ) {
-+ if ( itemTagsRID.incremental || itemTagsGID.incremental ) {
- throw HandlerException( "Incremental tags changes are not allowed in AK-APPEND" );
- }
-
diff --git a/debian/patches/upstream-prevent-QTimer-negative-interval.patch b/debian/patches/upstream-prevent-QTimer-negative-interval.patch
deleted file mode 100644
index 929b465..0000000
--- a/debian/patches/upstream-prevent-QTimer-negative-interval.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From de9bd9043e8878fc472ced1669bc7d49b07c2062 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Ren=C3=A9=20J=2EV=2E=20Bertin?= <rjvbertin at gmail.com>
-Date: Mon, 3 Nov 2014 16:56:56 +0100
-Subject: [PATCH] prevent starting a QTimer with a negative interval
- Review: 120800
-
----
- server/src/collectionscheduler.cpp | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/server/src/collectionscheduler.cpp b/server/src/collectionscheduler.cpp
-index 8d4cd5c..9ba632f 100644
---- a/server/src/collectionscheduler.cpp
-+++ b/server/src/collectionscheduler.cpp
-@@ -82,7 +82,8 @@ class PauseableTimer : public QTimer
- return;
- }
-
-- start( interval() - ( mStarted.secsTo( mPaused ) * 1000 ) );
-+ const int remainder = interval() - ( mStarted.secsTo( mPaused ) * 1000 );
-+ start( qMax( 0, remainder ) );
- mPaused = QDateTime();
- // Update mStarted so that pause() can be called repeatedly
- mStarted = QDateTime::currentDateTime();
---
-2.1.4
-
diff --git a/debian/patches/upstream-use-QAtomicInt.patch b/debian/patches/upstream-use-QAtomicInt.patch
deleted file mode 100644
index c54930d..0000000
--- a/debian/patches/upstream-use-QAtomicInt.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 8a113985cda1693c8158916065bd54e57d028cda Mon Sep 17 00:00:00 2001
-From: Milian Wolff <mail at milianw.de>
-Date: Mon, 1 Dec 2014 11:39:33 +0100
-Subject: [PATCH] Use an QAtomicInt instead of a plain bool for
- Entity::cacheEnabled.
-
-A plain bool is not thread safe and leads to undefined behavior.
-So better be safe than sorry and use a thread safe QAtomicInt.
----
- server/src/storage/entities-source.xsl | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/server/src/storage/entities-source.xsl b/server/src/storage/entities-source.xsl
-index 05a8cb1..e398da5 100644
---- a/server/src/storage/entities-source.xsl
-+++ b/server/src/storage/entities-source.xsl
-@@ -99,7 +99,7 @@ class <xsl:value-of select="$className"/>::Private : public QSharedData
- static void addToCache( const <xsl:value-of select="$className"/> & entry );
-
- // cache
-- static bool cacheEnabled;
-+ static QAtomicInt cacheEnabled;
- static QMutex cacheMutex;
- <xsl:if test="column[@name = 'id']">
- static QHash<qint64, <xsl:value-of select="$className"/> > idCache;
-@@ -111,7 +111,7 @@ class <xsl:value-of select="$className"/>::Private : public QSharedData
-
-
- // static members
--bool <xsl:value-of select="$className"/>::Private::cacheEnabled = false;
-+QAtomicInt <xsl:value-of select="$className"/>::Private::cacheEnabled(0);
- QMutex <xsl:value-of select="$className"/>::Private::cacheMutex;
- <xsl:if test="column[@name = 'id']">
- QHash<qint64, <xsl:value-of select="$className"/> > <xsl:value-of select="$className"/>::Private::idCache;
---
-2.1.4
-
diff --git a/debian/patches/upstream_dont_call_insert_from_Q_ASSERT.patch b/debian/patches/upstream_dont_call_insert_from_Q_ASSERT.patch
deleted file mode 100644
index 80ebae9..0000000
--- a/debian/patches/upstream_dont_call_insert_from_Q_ASSERT.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-commit c516ec5c28d603aea0df6165f66a3a5d0a0191c4
-Author: Dan Vrátil <dvratil at redhat.com>
-Date: Fri Sep 19 10:50:23 2014 +0200
-
- Don't call insert() from Q_ASSERT - breaks unit-tests in Release mode
-
-diff --git a/server/tests/unittest/collectionreferencetest.cpp b/server/tests/unittest/collectionreferencetest.cpp
-index 1700c75..1b10c55 100644
---- a/server/tests/unittest/collectionreferencetest.cpp
-+++ b/server/tests/unittest/collectionreferencetest.cpp
-@@ -45,7 +45,8 @@ public:
- Resource res;
- res.setId(1);
- res.setName(QLatin1String(name));
-- Q_ASSERT(res.insert());
-+ const bool success = res.insert();
-+ Q_ASSERT(success);
- mResource = res;
- return res;
- }
-@@ -57,7 +58,8 @@ public:
- col.setName(QLatin1String(name));
- col.setRemoteId(QLatin1String(name));
- col.setResource(mResource);
-- Q_ASSERT(col.insert());
-+ const bool success = col.insert();
-+ Q_ASSERT(success);
- return col;
- }
-
diff --git a/debian/patches/upstream_dont_leak_old_external_payload_files.patch b/debian/patches/upstream_dont_leak_old_external_payload_files.patch
deleted file mode 100644
index 227450d..0000000
--- a/debian/patches/upstream_dont_leak_old_external_payload_files.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-From: Dan Vrátil <dvratil at redhat.com>
-Date: Mon, 29 Jun 2015 20:45:11 +0000
-Subject: Don't leak old external payload files
-X-Git-Url: http://quickgit.kde.org/?p=akonadi.git&a=commitdiff&h=9c0dc6b3f0826d32eac310b2e7ecd858ca3df681
----
-Don't leak old external payload files
-
-Actually delete old payload files after we increase the payload revision or
-switch from external to internal payload. This caused ~/.local/share/akonadi/file_db_data
-to grow insanely for all users, leaving them with many duplicated files (just with
-different revisions).
-
-It is recommended that users run akonadictl fsck to clean up the leaked payload
-files.
-
-Note that there won't be any more releases of Akonadi 1.13 (and this has been
-fixed in master already), so I strongly recommend distributions to pick this
-patch into their packaging.
-
-BUG: 341884
-CCBUG: 338402
----
-
-
---- a/server/src/storage/partstreamer.cpp
-+++ b/server/src/storage/partstreamer.cpp
-@@ -290,6 +290,12 @@
- mDataChanged = true;
- }
-
-+ // If the part is external, remember it's current file name
-+ QString originalFile;
-+ if (part.isValid() && part.external()) {
-+ originalFile = PartHelper::resolveAbsolutePath(part.data());
-+ }
-+
- part.setPartType(partType);
- part.setVersion(partVersion);
- part.setPimItemId(mItem.id());
-@@ -306,6 +312,14 @@
- *changed = mDataChanged;
- }
-
-+ if (!originalFile.isEmpty()) {
-+ // If the part was external but is not anymore, or if it's still external
-+ // but the filename has changed (revision update), remove the original file
-+ if (!part.external() || (part.external() && originalFile != PartHelper::resolveAbsolutePath(part.data()))) {
-+ PartHelper::removeFile(originalFile);
-+ }
-+ }
-+
- return ok;
- }
-
-
---- a/server/tests/unittest/partstreamertest.cpp
-+++ b/server/tests/unittest/partstreamertest.cpp
-@@ -91,6 +91,7 @@
- QTest::addColumn<qint64>("expectedPartSize");
- QTest::addColumn<bool>("expectedChanged");
- QTest::addColumn<bool>("isExternal");
-+ QTest::addColumn<int>("version");
- QTest::addColumn<PimItem>("pimItem");
-
- PimItem item;
-@@ -101,22 +102,22 @@
- QVERIFY(item.insert());
-
- // Order of these tests matters!
-- QTest::newRow("item 1, internal") << QByteArray("PLD:DATA") << QByteArray("123") << 3ll << true << false << item;
-- QTest::newRow("item 1, change to external") << QByteArray("PLD:DATA") << QByteArray("123456789") << 9ll << true << true << item;
-- QTest::newRow("item 1, update external") << QByteArray("PLD:DATA") << QByteArray("987654321") << 9ll << true << true << item;
-- QTest::newRow("item 1, external, no change") << QByteArray("PLD:DATA") << QByteArray("987654321") << 9ll << false << true << item;
-- QTest::newRow("item 1, change to internal") << QByteArray("PLD:DATA") << QByteArray("1234") << 4ll << true << false << item;
-- QTest::newRow("item 1, internal, no change") << QByteArray("PLD:DATA") << QByteArray("1234") << 4ll << false << false << item;
-+ QTest::newRow("item 1, internal") << QByteArray("PLD:DATA") << QByteArray("123") << 3ll << true << false << -1 << item;
-+ QTest::newRow("item 1, change to external") << QByteArray("PLD:DATA") << QByteArray("123456789") << 9ll << true << true << 0 << item;
-+ QTest::newRow("item 1, update external") << QByteArray("PLD:DATA") << QByteArray("987654321") << 9ll << true << true << 1 << item;
-+ QTest::newRow("item 1, external, no change") << QByteArray("PLD:DATA") << QByteArray("987654321") << 9ll << false << true << 2 << item;
-+ QTest::newRow("item 1, change to internal") << QByteArray("PLD:DATA") << QByteArray("1234") << 4ll << true << false << 2 << item;
-+ QTest::newRow("item 1, internal, no change") << QByteArray("PLD:DATA") << QByteArray("1234") << 4ll << false << false << 2 << item;
- }
-
- void testStreamer()
- {
-- return;
- QFETCH(QByteArray, expectedPartName);
- QFETCH(QByteArray, expectedData);
- QFETCH(qint64, expectedPartSize);
- QFETCH(bool, expectedChanged);
- QFETCH(bool, isExternal);
-+ QFETCH(int, version);
- QFETCH(PimItem, pimItem);
-
- FakeConnection connection;
-@@ -160,17 +161,18 @@
-
- PimItem item = PimItem::retrieveById(pimItem.id());
- const QVector<Part> parts = item.parts();
-- QVERIFY(parts.count() == 1);
-+ QCOMPARE(parts.count(), 1);
- const Part part = parts[0];
- QCOMPARE(part.datasize(), expectedPartSize);
- QCOMPARE(part.external(), isExternal);
-+ qDebug() << part.version() << part.data();
- const QByteArray data = part.data();
- if (isExternal) {
- QVERIFY(streamerSpy.count() == 1);
- QVERIFY(streamerSpy.first().count() == 1);
- const Response response = streamerSpy.first().first().value<Akonadi::Server::Response>();
- const QByteArray str = response.asString();
-- const QByteArray expectedResponse = "+ STREAM [FILE " + QByteArray::number(part.id()) + "_r" + QByteArray::number(part.version()) + "]";
-+ const QByteArray expectedResponse = "+ STREAM [FILE " + QByteArray::number(part.id()) + "_r" + QByteArray::number(version) + "]";
- QCOMPARE(QString::fromUtf8(str), QString::fromUtf8(expectedResponse));
-
- QFile file(PartHelper::resolveAbsolutePath(data));
-@@ -182,7 +184,7 @@
- QCOMPARE(fileData, expectedData);
-
- // Make sure no previous versions are left behind in file_db_data
-- for (int i = 0; i < part.version(); ++i) {
-+ for (int i = 0; i < version; ++i) {
- const QByteArray fileName = QByteArray::number(part.id()) + "_r" + QByteArray::number(part.version());
- const QString filePath = PartHelper::resolveAbsolutePath(fileName);
- QVERIFY(!QFile::exists(filePath));
-@@ -194,7 +196,7 @@
- QCOMPARE(data, expectedData);
-
- // Make sure nothing is left behind in file_db_data
-- for (int i = 0; i <= part.version(); ++i) {
-+ for (int i = 0; i <= version; ++i) {
- const QByteArray fileName = QByteArray::number(part.id()) + "_r" + QByteArray::number(part.version());
- const QString filePath = PartHelper::resolveAbsolutePath(fileName);
- QVERIFY(!QFile::exists(filePath));
-
diff --git a/debian/patches/upstream_opt-0002-intern-entity-strings.patch b/debian/patches/upstream_opt-0002-intern-entity-strings.patch
deleted file mode 100644
index 13f777d..0000000
--- a/debian/patches/upstream_opt-0002-intern-entity-strings.patch
+++ /dev/null
@@ -1,176 +0,0 @@
-From a04809a44c235bed854adc3bd49ca75b9673bf1f Mon Sep 17 00:00:00 2001
-From: Milian Wolff <mail at milianw.de>
-Date: Wed, 26 Nov 2014 13:20:05 +0100
-Subject: [PATCH] Intern entity strings for table and column names.
-
-This should drastically cut down on the amount of allocations done
-by the AkonadiServer. Currently, the getters will do the conversion
-from QLatin1String to QString on every call. By reusing the data
-via a function-local static const QString object, we can eliminate
-all of these allocations and increase the cache locality as well.
-
-REVIEW: 121255
----
- server/src/storage/entities-source.xsl | 56 +++++++++++++++++++++-------------
- server/src/storage/entities.xsl | 4 +--
- 2 files changed, 36 insertions(+), 24 deletions(-)
-
-diff --git a/server/src/storage/entities-source.xsl b/server/src/storage/entities-source.xsl
-index 174cf4f..7090c31 100644
---- a/server/src/storage/entities-source.xsl
-+++ b/server/src/storage/entities-source.xsl
-@@ -214,36 +214,41 @@ void <xsl:value-of select="$className"/>::<xsl:call-template name="setter-signat
- // SQL table information
- <xsl:text>QString </xsl:text><xsl:value-of select="$className"/>::tableName()
- {
-- return QLatin1String( "<xsl:value-of select="$tableName"/>" );
-+ static const QString tableName = QLatin1String( "<xsl:value-of select="$tableName"/>" );
-+ return tableName;
- }
-
- QStringList <xsl:value-of select="$className"/>::columnNames()
- {
-- QStringList rv;
-+ static const QStringList columns = QStringList()
- <xsl:for-each select="column">
-- rv.append( QLatin1String( "<xsl:value-of select="@name"/>" ) );
-+ << <xsl:value-of select="@name"/>Column()
- </xsl:for-each>
-- return rv;
-+ ;
-+ return columns;
- }
-
- QStringList <xsl:value-of select="$className"/>::fullColumnNames()
- {
-- QStringList rv;
-+ static const QStringList columns = QStringList()
- <xsl:for-each select="column">
-- rv.append( QLatin1String( "<xsl:value-of select="$tableName"/>.<xsl:value-of select="@name"/>" ) );
-+ << <xsl:value-of select="@name"/>FullColumnName()
- </xsl:for-each>
-- return rv;
-+ ;
-+ return columns;
- }
-
- <xsl:for-each select="column">
- QString <xsl:value-of select="$className"/>::<xsl:value-of select="@name"/>Column()
- {
-- return QLatin1String( "<xsl:value-of select="@name"/>" );
-+ static const QString column = QLatin1String( "<xsl:value-of select="@name"/>" );
-+ return column;
- }
-
- QString <xsl:value-of select="$className"/>::<xsl:value-of select="@name"/>FullColumnName()
- {
-- return tableName() + QLatin1String( ".<xsl:value-of select="@name"/>" );
-+ static const QString column = QLatin1String( "<xsl:value-of select="$tableName"/>.<xsl:value-of select="@name"/>" );
-+ return column;
- }
- </xsl:for-each>
-
-@@ -399,7 +404,6 @@ QVector<<xsl:value-of select="@table"/>> <xsl:value-of select="$className"
- <xsl:variable name="relationName"><xsl:value-of select="@table1"/><xsl:value-of select="@table2"/>Relation</xsl:variable>
- <xsl:variable name="rightSideClass"><xsl:value-of select="@table2"/></xsl:variable>
- <xsl:variable name="rightSideEntity"><xsl:value-of select="@table2"/></xsl:variable>
--<xsl:variable name="rightSideTable"><xsl:value-of select="@table2"/>Table</xsl:variable>
-
- // data retrieval for n:m relations
- QVector<<xsl:value-of select="$rightSideClass"/>> <xsl:value-of select="$className"/>::<xsl:value-of select="concat(translate(substring(@table2,1,1),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), substring(@table2,2))"/>s() const
-@@ -408,14 +412,17 @@ QVector<<xsl:value-of select="$rightSideClass"/>> <xsl:value-of select="$c
- if ( !db.isOpen() )
- return QVector<<xsl:value-of select="$rightSideClass"/>>();
-
-- QueryBuilder qb( QLatin1String("<xsl:value-of select="$rightSideTable"/>"), QueryBuilder::Select );
-+ QueryBuilder qb( <xsl:value-of select="$rightSideClass"/>::tableName(), QueryBuilder::Select );
-+ static const QStringList columns = QStringList()
- <xsl:for-each select="/database/table[@name = $rightSideEntity]/column">
-- qb.addColumn( QLatin1String("<xsl:value-of select="$rightSideTable"/>.<xsl:value-of select="@name"/>" ) );
-+ << <xsl:value-of select="$rightSideClass"/>::<xsl:value-of select="@name"/>FullColumnName()
- </xsl:for-each>
-- qb.addJoin( QueryBuilder::InnerJoin, QLatin1String("<xsl:value-of select="$relationName"/>"),
-- QLatin1String("<xsl:value-of select="$relationName"/>.<xsl:value-of select="@table2"/>_<xsl:value-of select="@column2"/>"),
-- QLatin1String("<xsl:value-of select="$rightSideTable"/>.<xsl:value-of select="@column2"/>") );
-- qb.addValueCondition( QLatin1String("<xsl:value-of select="$relationName"/>.<xsl:value-of select="@table1"/>_<xsl:value-of select="@column1"/>"), Query::Equals, id() );
-+ ;
-+ qb.addColumns(columns);
-+ qb.addJoin( QueryBuilder::InnerJoin, <xsl:value-of select="$relationName"/>::tableName(),
-+ <xsl:value-of select="$relationName"/>::rightFullColumnName(),
-+ <xsl:value-of select="$rightSideClass"/>::<xsl:value-of select="@column2"/>FullColumnName() );
-+ qb.addValueCondition( <xsl:value-of select="$relationName"/>::leftFullColumnName(), Query::Equals, id() );
-
- if ( !qb.exec() ) {
- akDebug() << "Error during selection of records from table <xsl:value-of select="@table1"/><xsl:value-of select="@table2"/>Relation"
-@@ -546,7 +553,7 @@ bool <xsl:value-of select="$className"/>::update()
- </xsl:for-each>
-
- <xsl:if test="column[@name = 'id']">
-- qb.addValueCondition( QLatin1String("id"), Query::Equals, id() );
-+ qb.addValueCondition( idColumn(), Query::Equals, id() );
- </xsl:if>
-
- if ( !qb.exec() ) {
-@@ -622,27 +629,32 @@ void <xsl:value-of select="$className"/>::enableCache( bool enable )
- // SQL table information
- QString <xsl:value-of select="$className"/>::tableName()
- {
-- return QLatin1String( "<xsl:value-of select="$tableName"/>" );
-+ static const QString table = QLatin1String( "<xsl:value-of select="$tableName"/>" );
-+ return table;
- }
-
- QString <xsl:value-of select="$className"/>::leftColumn()
- {
-- return QLatin1String( "<xsl:value-of select="@table1"/>_<xsl:value-of select="@column1"/>" );
-+ static const QString column = QLatin1String( "<xsl:value-of select="@table1"/>_<xsl:value-of select="@column1"/>" );
-+ return column;
- }
-
- QString <xsl:value-of select="$className"/>::leftFullColumnName()
- {
-- return tableName() + QLatin1String( "." ) + leftColumn();
-+ static const QString column = QLatin1String( "<xsl:value-of select="$tableName"/>.<xsl:value-of select="@table1"/>_<xsl:value-of select="@column1"/>" );
-+ return column;
- }
-
- QString <xsl:value-of select="$className"/>::rightColumn()
- {
-- return QLatin1String( "<xsl:value-of select="@table2"/>_<xsl:value-of select="@column2"/>" );
-+ static const QString column = QLatin1String( "<xsl:value-of select="@table2"/>_<xsl:value-of select="@column2"/>" );
-+ return column;
- }
-
- QString <xsl:value-of select="$className"/>::rightFullColumnName()
- {
-- return tableName() + QLatin1String( "." ) + rightColumn();
-+ static const QString column = QLatin1String( "<xsl:value-of select="$tableName"/>.<xsl:value-of select="@table2"/>_<xsl:value-of select="@column2"/>" );
-+ return column;
- }
- </xsl:template>
-
-diff --git a/server/src/storage/entities.xsl b/server/src/storage/entities.xsl
-index 033e292..8b0ed03 100644
---- a/server/src/storage/entities.xsl
-+++ b/server/src/storage/entities.xsl
-@@ -114,7 +114,7 @@ using namespace Akonadi::Server;
-
- QVector<QString> Akonadi::Server::allDatabaseTables()
- {
-- static QVector<QString> allTables = QVector<QString>()
-+ static const QVector<QString> allTables = QVector<QString>()
- <xsl:for-each select="database/table">
- << QLatin1String( "<xsl:value-of select="@name"/>Table" )
- </xsl:for-each>
-@@ -182,7 +182,7 @@ set<xsl:value-of select="$methodName"/>( <xsl:call-template name="argument"/> )
-
- QueryBuilder qb( tableName(), QueryBuilder::Select );
- qb.addColumns( columnNames() );
-- qb.addValueCondition( QLatin1String("<xsl:value-of select="$key"/>"), Query::Equals, <xsl:value-of select="$key"/> );
-+ qb.addValueCondition( <xsl:value-of select="$key"/>Column(), Query::Equals, <xsl:value-of select="$key"/> );
- if ( !qb.exec() ) {
- akDebug() << "Error during selection of record with <xsl:value-of select="$key"/>"
- << <xsl:value-of select="$key"/> << "from table" << tableName()
---
-2.1.4
-
diff --git a/debian/patches/upstream_opt-0003-QMutexLocker.patch b/debian/patches/upstream_opt-0003-QMutexLocker.patch
deleted file mode 100644
index e928c60..0000000
--- a/debian/patches/upstream_opt-0003-QMutexLocker.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From f5a0e3f1f4787b6a48880e42463ae38dce336a8f Mon Sep 17 00:00:00 2001
-From: Milian Wolff <mail at milianw.de>
-Date: Mon, 1 Dec 2014 11:36:31 +0100
-Subject: [PATCH] Use QMutexLocker instead of manual lock/unlock calls.
-
-Just a minor cleanup patch, no change of behavior.
----
- server/src/storage/entities-source.xsl | 17 +++++------------
- server/src/storage/entities.xsl | 4 +---
- 2 files changed, 6 insertions(+), 15 deletions(-)
-
-diff --git a/server/src/storage/entities-source.xsl b/server/src/storage/entities-source.xsl
-index 7090c31..05a8cb1 100644
---- a/server/src/storage/entities-source.xsl
-+++ b/server/src/storage/entities-source.xsl
-@@ -125,14 +125,13 @@ void <xsl:value-of select="$className"/>::Private::addToCache( const <xsl:value-
- {
- Q_ASSERT( cacheEnabled );
- Q_UNUSED( entry ); <!-- in case the table has neither an id nor name column -->
-- cacheMutex.lock();
-+ QMutexLocker lock(&cacheMutex);
- <xsl:if test="column[@name = 'id']">
- idCache.insert( entry.id(), entry );
- </xsl:if>
- <xsl:if test="column[@name = 'name']">
- nameCache.insert( entry.name(), entry );
- </xsl:if>
-- cacheMutex.unlock();
- }
-
-
-@@ -264,12 +263,10 @@ int <xsl:value-of select="$className"/>::count( const QString &column, const
- bool <xsl:value-of select="$className"/>::exists( qint64 id )
- {
- if ( Private::cacheEnabled ) {
-- Private::cacheMutex.lock();
-+ QMutexLocker lock(&Private::cacheMutex);
- if ( Private::idCache.contains( id ) ) {
-- Private::cacheMutex.unlock();
- return true;
- }
-- Private::cacheMutex.unlock();
- }
- return count( idColumn(), id ) > 0;
- }
-@@ -278,12 +275,10 @@ bool <xsl:value-of select="$className"/>::exists( qint64 id )
- bool <xsl:value-of select="$className"/>::exists( const <xsl:value-of select="column[@name = 'name']/@type"/> &name )
- {
- if ( Private::cacheEnabled ) {
-- Private::cacheMutex.lock();
-+ QMutexLocker lock(&Private::cacheMutex);
- if ( Private::nameCache.contains( name ) ) {
-- Private::cacheMutex.unlock();
- return true;
- }
-- Private::cacheMutex.unlock();
- }
- return count( nameColumn(), name ) > 0;
- }
-@@ -588,28 +583,26 @@ bool <xsl:value-of select="$className"/>::remove( qint64 id )
- void <xsl:value-of select="$className"/>::invalidateCache() const
- {
- if ( Private::cacheEnabled ) {
-- Private::cacheMutex.lock();
-+ QMutexLocker lock(&Private::cacheMutex);
- <xsl:if test="column[@name = 'id']">
- Private::idCache.remove( id() );
- </xsl:if>
- <xsl:if test="column[@name = 'name']">
- Private::nameCache.remove( name() );
- </xsl:if>
-- Private::cacheMutex.unlock();
- }
- }
-
- void <xsl:value-of select="$className"/>::invalidateCompleteCache()
- {
- if ( Private::cacheEnabled ) {
-- Private::cacheMutex.lock();
-+ QMutexLocker lock(&Private::cacheMutex);
- <xsl:if test="column[@name = 'id']">
- Private::idCache.clear();
- </xsl:if>
- <xsl:if test="column[@name = 'name']">
- Private::nameCache.clear();
- </xsl:if>
-- Private::cacheMutex.unlock();
- }
- }
-
-diff --git a/server/src/storage/entities.xsl b/server/src/storage/entities.xsl
-index 8b0ed03..a397544 100644
---- a/server/src/storage/entities.xsl
-+++ b/server/src/storage/entities.xsl
-@@ -167,13 +167,11 @@ set<xsl:value-of select="$methodName"/>( <xsl:call-template name="argument"/> )
- <xsl:variable name="className"><xsl:value-of select="@name"/></xsl:variable>
- <xsl:if test="$cache != ''">
- if ( Private::cacheEnabled ) {
-- Private::cacheMutex.lock();
-+ QMutexLocker lock(&Private::cacheMutex);
- if ( Private::<xsl:value-of select="$cache"/>.contains( <xsl:value-of select="$key"/> ) ) {
- const <xsl:value-of select="$className"/> tmp = Private::<xsl:value-of select="$cache"/>.value( <xsl:value-of select="$key"/> );
-- Private::cacheMutex.unlock();
- return tmp;
- }
-- Private::cacheMutex.unlock();
- }
- </xsl:if>
- QSqlDatabase db = DataStore::self()->database();
---
-2.1.4
-
diff --git a/debian/patches/upstream_opt-0004-one-hash-lookup.patch b/debian/patches/upstream_opt-0004-one-hash-lookup.patch
deleted file mode 100644
index 8ae4fdc..0000000
--- a/debian/patches/upstream_opt-0004-one-hash-lookup.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 202ffa522668087cc133026febf21a7de8963218 Mon Sep 17 00:00:00 2001
-From: Milian Wolff <mail at milianw.de>
-Date: Mon, 1 Dec 2014 11:51:04 +0100
-Subject: [PATCH] Optimize: Only do one hash lookup to retrieve value from
- cache.
-
-Compilers do not merge the call to contains() and the successive
-value() lookup. Using iterators thus saves us one QHash lookup.
----
- server/src/storage/entities.xsl | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/server/src/storage/entities.xsl b/server/src/storage/entities.xsl
-index a397544..9471293 100644
---- a/server/src/storage/entities.xsl
-+++ b/server/src/storage/entities.xsl
-@@ -168,9 +168,9 @@ set<xsl:value-of select="$methodName"/>( <xsl:call-template name="argument"/> )
- <xsl:if test="$cache != ''">
- if ( Private::cacheEnabled ) {
- QMutexLocker lock(&Private::cacheMutex);
-- if ( Private::<xsl:value-of select="$cache"/>.contains( <xsl:value-of select="$key"/> ) ) {
-- const <xsl:value-of select="$className"/> tmp = Private::<xsl:value-of select="$cache"/>.value( <xsl:value-of select="$key"/> );
-- return tmp;
-+ QHash<<xsl:value-of select="column[@name = $key]/@type"/>, <xsl:value-of select="$className"/>>::const_iterator it = Private::<xsl:value-of select="$cache"/>.constFind(<xsl:value-of select="$key"/>);
-+ if ( it != Private::<xsl:value-of select="$cache"/>.constEnd() ) {
-+ return it.value();
- }
- }
- </xsl:if>
---
-2.1.4
-
diff --git a/debian/patches/upstream_opt-0005-optimize-queries.patch b/debian/patches/upstream_opt-0005-optimize-queries.patch
deleted file mode 100644
index 8435962..0000000
--- a/debian/patches/upstream_opt-0005-optimize-queries.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From e52b57b7a9f0303c0c710e60870d0ec265d32541 Mon Sep 17 00:00:00 2001
-From: Milian Wolff <mail at milianw.de>
-Date: Mon, 1 Dec 2014 14:11:19 +0100
-Subject: [PATCH] Optimize queries: Do not retrieve known key used in the
- condition.
-
-There is no point in doing a select like:
-
-SELECT foo, bar FROM table WHERE foo = needle;
-
-That can be rewritten to say
-
-SELECT bar FROM table WHERE foo = needle;
-
-This reduces the data traffic with the mysql server. Additionally, it
-work-arounds some issues in Qt SQL, which lead to bad performance:
-QSqlResult::value incurs multiple temporary allocations, and string
-conversions, even to read a simple integer ID for example. Finally,
-by reusing an externally provided QString name e.g., we can leverage
-Qt's implicit sharing, instead of duplicating the string in a separate
-QString instance, with the contents read from SQL server.
-
-REVIEW: 121310
----
- server/src/storage/entities.xsl | 50 +++++++++++++++++++++++++++++------------
- 1 file changed, 36 insertions(+), 14 deletions(-)
-
-diff --git a/server/src/storage/entities.xsl b/server/src/storage/entities.xsl
-index 9471293..c8fb1fd 100644
---- a/server/src/storage/entities.xsl
-+++ b/server/src/storage/entities.xsl
-@@ -104,6 +104,12 @@ Q_DECLARE_TYPEINFO( Akonadi::Server::<xsl:value-of select="@name"/>, Q_MOVABLE_T
-
- using namespace Akonadi::Server;
-
-+static QStringList removeEntry(QStringList list, const QString& entry)
-+{
-+ list.removeOne(entry);
-+ return list;
-+}
-+
- <xsl:for-each select="database/table">
- <xsl:call-template name="table-source"/>
- </xsl:for-each>
-@@ -179,7 +185,8 @@ set<xsl:value-of select="$methodName"/>( <xsl:call-template name="argument"/> )
- return <xsl:value-of select="$className"/>();
-
- QueryBuilder qb( tableName(), QueryBuilder::Select );
-- qb.addColumns( columnNames() );
-+ static const QStringList columns = removeEntry(columnNames(), <xsl:value-of select="$key"/>Column());
-+ qb.addColumns( columns );
- qb.addValueCondition( <xsl:value-of select="$key"/>Column(), Query::Equals, <xsl:value-of select="$key"/> );
- if ( !qb.exec() ) {
- akDebug() << "Error during selection of record with <xsl:value-of select="$key"/>"
-@@ -191,21 +198,36 @@ set<xsl:value-of select="$methodName"/>( <xsl:call-template name="argument"/> )
- return <xsl:value-of select="$className"/>();
- }
-
-+ <!-- this indirection is required to prevent off-by-one access now that we skip the key column -->
-+ int valueIndex = 0;
-+ <xsl:for-each select="column">
-+ const <xsl:value-of select="@type"/> value<xsl:value-of select="position()"/> =
-+ <xsl:choose>
-+ <xsl:when test="@name=$key">
-+ <xsl:value-of select="$key"/>;
-+ </xsl:when>
-+ <xsl:otherwise>
-+ (qb.query().isNull(valueIndex)) ?
-+ <xsl:value-of select="@type"/>() :
-+ <xsl:choose>
-+ <xsl:when test="starts-with(@type,'QString')">
-+ Utils::variantToString( qb.query().value( valueIndex ) )
-+ </xsl:when>
-+ <xsl:when test="starts-with(@type, 'Tristate')">
-+ static_cast<Tristate>(qb.query().value( valueIndex ).value<int>())
-+ </xsl:when>
-+ <xsl:otherwise>
-+ qb.query().value( valueIndex ).value<<xsl:value-of select="@type"/>>()
-+ </xsl:otherwise>
-+ </xsl:choose>
-+ ; ++valueIndex;
-+ </xsl:otherwise>
-+ </xsl:choose>
-+ </xsl:for-each>
-+
- <xsl:value-of select="$className"/> rv(
- <xsl:for-each select="column">
-- (qb.query().isNull(<xsl:value-of select="position() - 1"/>)) ?
-- <xsl:value-of select="@type"/>() :
-- <xsl:choose>
-- <xsl:when test="starts-with(@type,'QString')">
-- Utils::variantToString( qb.query().value( <xsl:value-of select="position() - 1"/> ) )
-- </xsl:when>
-- <xsl:when test="starts-with(@type, 'Tristate')">
-- static_cast<Tristate>(qb.query().value( <xsl:value-of select="position() - 1"/> ).value<int>())
-- </xsl:when>
-- <xsl:otherwise>
-- qb.query().value( <xsl:value-of select="position() - 1"/> ).value<<xsl:value-of select="@type"/>>()
-- </xsl:otherwise>
-- </xsl:choose>
-+ value<xsl:value-of select="position()"/>
- <xsl:if test="position() != last()">,</xsl:if>
- </xsl:for-each>
- );
---
-2.1.4
-
--
Akonadi packaging
More information about the pkg-kde-commits
mailing list