commit akonadi-runtime for openSUSE:Factory
Hello community, here is the log from the commit of package akonadi-runtime for openSUSE:Factory checked in at Fri Nov 5 14:45:47 CET 2010. -------- --- KDE/akonadi-runtime/akonadi-runtime.changes 2010-08-15 09:34:12.000000000 +0200 +++ akonadi-runtime/akonadi-runtime.changes 2010-10-25 09:26:17.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Oct 25 07:23:47 UTC 2010 - wstephenson@novell.com + +- update to 1.4.1: + * Server startup performance fix + * IMAP Parser fixes + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- akonadi-1.4.0.tar.bz2 New: ---- akonadi-1.4.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ akonadi-runtime.spec ++++++ --- /var/tmp/diff_new_pack.Squg2Y/_old 2010-11-05 14:44:48.000000000 +0100 +++ /var/tmp/diff_new_pack.Squg2Y/_new 2010-11-05 14:44:48.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package akonadi-runtime (Version 1.4.0) +# spec file for package akonadi-runtime (Version 1.4.1) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -23,8 +23,8 @@ %if %suse_version > 1020 BuildRequires: fdupes %endif -Version: 1.4.0 -Release: 2 +Version: 1.4.1 +Release: 1 %define rversion %version License: LGPLv2.1+ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -105,7 +105,7 @@ %prep %setup -q -n akonadi-%version -%patch0 +#%patch0 %build %cmake_kde4 -d build -- -DCONFIG_INSTALL_DIR=/etc ++++++ 1_4_BRANCH.diff ++++++ --- /var/tmp/diff_new_pack.Squg2Y/_old 2010-11-05 14:44:48.000000000 +0100 +++ /var/tmp/diff_new_pack.Squg2Y/_new 2010-11-05 14:44:48.000000000 +0100 @@ -1,100 +1 @@ -package: kdelibs-4.4.3.tar.bz2 -kdemod: kdelibs ---- BRANCH_STATUS -+++ BRANCH_STATUS -@@ -0,0 +1,2 @@ -+current HEAD: 1163872 -+svn di between //tags/akonadi/1.4.0 and //branches/akonadi/1.4 -Index: server/src/storage/dbconfigmysql.h -=================================================================== ---- server/src/storage/dbconfigmysql.h (revision 1157505) -+++ server/src/storage/dbconfigmysql.h (revision 1163873) -@@ -78,7 +78,7 @@ - QString mServerPath; - QString mCleanServerShutdownCommand; - QString mMysqlInstallDbPath; -- QString mMysqlUpgradeDBPath; -+ QString mMysqlCheckPath; - bool mInternalServer; - QProcess *mDatabaseProcess; - }; -Index: server/src/storage/dbconfigmysql.cpp -=================================================================== ---- server/src/storage/dbconfigmysql.cpp (revision 1157505) -+++ server/src/storage/dbconfigmysql.cpp (revision 1163873) -@@ -86,8 +86,8 @@ - mMysqlInstallDbPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysql_install_db" ), mysqldSearchPath ); - akDebug() << "Found mysql_install_db: " << mMysqlInstallDbPath; - -- mMysqlUpgradeDBPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysql_upgrade" ), mysqldSearchPath ); -- akDebug() << "Found mysql_upgrade: " << mMysqlUpgradeDBPath; -+ mMysqlCheckPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysqlcheck" ), mysqldSearchPath ); -+ akDebug() << "Found mysqlcheck: " << mMysqlCheckPath; - - mInternalServer = settings.value( QLatin1String( "QMYSQL/StartServer" ), defaultInternalServer ).toBool(); - if ( mInternalServer ) { -@@ -239,7 +239,7 @@ - if ( QDir( dataDir ).entryList( QDir::NoDotAndDotDot | QDir::AllEntries ).isEmpty() && !mMysqlInstallDbPath.isEmpty() ) { - const QStringList arguments = QStringList() << QString::fromLatin1( "--force" ) << QString::fromLatin1( "--defaults-file=%1").arg(confFile) << QString::fromLatin1( "--datadir=%1/" ).arg( dataDir ); - QProcess::execute( mMysqlInstallDbPath, arguments ); -- } -+ } - - // clear mysql ib_logfile's in case innodb_log_file_size option changed in last confUpdate - if ( confUpdate ) { -@@ -267,11 +267,6 @@ - akFatal() << "process error:" << mDatabaseProcess->errorString(); - } - -- if ( !mMysqlUpgradeDBPath.isEmpty() ) { -- const QStringList arguments = QStringList() << QString::fromLatin1( "--socket=%1/mysql.socket" ).arg( miscDir ); -- QProcess::execute( mMysqlUpgradeDBPath, arguments ); -- } -- - const QLatin1String initCon( "initConnection" ); - { - QSqlDatabase db = QSqlDatabase::addDatabase( QLatin1String( "QMYSQL" ), initCon ); -@@ -298,6 +293,15 @@ - } - - if ( opened ) { -+ -+ if ( !mMysqlCheckPath.isEmpty() ) { -+ const QStringList arguments = QStringList() << QLatin1String( "--check-upgrade" ) -+ << QLatin1String( "--all-databases" ) -+ << QLatin1String( "--auto-repair" ) -+ << QString::fromLatin1( "--socket=%1/mysql.socket" ).arg( miscDir ); -+ QProcess::execute( mMysqlCheckPath, arguments ); -+ } -+ - { - QSqlQuery query( db ); - if ( !query.exec( QString::fromLatin1( "USE %1" ).arg( mDatabaseName ) ) ) { -Index: server/src/storage/queryhelper.cpp -=================================================================== ---- server/src/storage/queryhelper.cpp (revision 1157505) -+++ server/src/storage/queryhelper.cpp (revision 1163873) -@@ -32,13 +32,18 @@ - if ( i.size() == 1 ) { - cond.addValueCondition( column, Query::Equals, i.begin() ); - } else { -- Query::Condition subCond( Query::And ); -- subCond.addValueCondition( column, Query::GreaterOrEqual, i.begin() ); -- subCond.addValueCondition( column, Query::LessOrEqual, i.end() ); -- cond.addCondition( subCond ); -+ if ( i.begin() != 1 ) { // 1 is our standard lower bound, so we don't have to check for it explicitly -+ Query::Condition subCond( Query::And ); -+ subCond.addValueCondition( column, Query::GreaterOrEqual, i.begin() ); -+ subCond.addValueCondition( column, Query::LessOrEqual, i.end() ); -+ cond.addCondition( subCond ); -+ } else { -+ cond.addValueCondition( column, Query::LessOrEqual, i.end() ); -+ } - } - } else if ( i.hasDefinedBegin() ) { -- cond.addValueCondition( column, Query::GreaterOrEqual, i.begin() ); -+ if ( i.begin() != 1 ) // 1 is our standard lower bound, so we don't have to check for it explicitly -+ cond.addValueCondition( column, Query::GreaterOrEqual, i.begin() ); - } else if ( i.hasDefinedEnd() ) { - cond.addValueCondition( column, Query::LessOrEqual, i.end() ); - } + ++++++ akonadi-1.4.0.tar.bz2 -> akonadi-1.4.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/CMakeLists.txt new/akonadi-1.4.1/CMakeLists.txt --- old/akonadi-1.4.0/CMakeLists.txt 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/CMakeLists.txt 2010-10-22 17:12:44.000000000 +0200 @@ -37,7 +37,7 @@ set(AKONADI_VERSION_MAJOR "1") set(AKONADI_VERSION_MINOR "4") -set(AKONADI_VERSION_PATCH "0") +set(AKONADI_VERSION_PATCH "1") set(AKONADI_VERSION "${AKONADI_VERSION_MAJOR}.${AKONADI_VERSION_MINOR}.${AKONADI_VERSION_PATCH}") # If Subversion is installed, and a '.svn' directory is found, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/ChangeLog new/akonadi-1.4.1/ChangeLog --- old/akonadi-1.4.0/ChangeLog 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/ChangeLog 2010-10-22 17:12:44.000000000 +0200 @@ -1,3 +1,82 @@ +2010-10-18 08:44 +0000 [r1187073] Tobias Koenig tokoe@kde.org + + * branches/akonadi/1.4/server/src/imapstreamparser.cpp: Backport + bugfix (r1186987) + +2010-10-11 07:48 +0000 [r1184650] Tobias Koenig tokoe@kde.org + + * branches/akonadi/1.4/server/CMakeLists.txt, + branches/akonadi/1.4/server/src/storage/dbconfigmysql.cpp, + branches/akonadi/1.4/server/src/utils.h, + branches/akonadi/1.4/server/src/akonadi.cpp, + branches/akonadi/1.4/server/src/storage/dbconfig.cpp, + branches/akonadi/1.4/server/src/utils.cpp (added), + branches/akonadi/1.4/server/src/storage/dbconfigpostgresql.cpp, + branches/akonadi/1.4/server/src/storage/dbconfig.h: Allow to use + the place holder '$USER' inside the custom socket directory + +2010-10-08 14:10 +0000 [r1183854] Tobias Koenig tokoe@kde.org + + * branches/akonadi/1.4/libs/imapparser.cpp: Backport performance + improvments from commit r1182169 + +2010-10-08 12:28 +0000 [r1183789] Tobias Koenig tokoe@kde.org + + * branches/akonadi/1.4/server/src/storage/dbconfigmysql.cpp, + branches/akonadi/1.4/server/src/storage/dbconfig.cpp, + branches/akonadi/1.4/server/src/storage/dbconfigpostgresql.cpp, + branches/akonadi/1.4/server/src/storage/dbconfig.h: Fixed the + handling of custom Connection/SocketDirectory entry in + akonadiserverrc. The databases (MySQL and PostgreSQL) respect + this setting now as well and the directory is created + automatically if non-existing. + +2010-09-26 14:11 +0000 [r1179920] Tobias Koenig tokoe@kde.org + + * branches/akonadi/1.4/libs/tests/CMakeLists.txt, + branches/akonadi/1.4/libs/tests/imapparserbenchmark.cpp (added), + branches/akonadi/1.4/libs/imapparser.cpp: Backport imapparser + performance improvements (r1179519, r1179534) + +2010-08-19 07:43 +0000 [r1165384] Volker Krause vkrause@kde.org + + * branches/akonadi/1.4/server/src/storage/akonadidb.xml, + branches/akonadi/1.4: Merged revisions 1165376 via svnmerge from + svn+ssh://vkrause@svn.kde.org/home/kde/trunk/kdesupport/akonadi + ........ r1165376 | vkrause | 2010-08-19 09:31:45 +0200 (Thu, 19 + Aug 2010) | 4 lines Add index on part name, speeds up server + startup on big databases considerably (due to + unhideAllPimitems()). Actually found by David during Akademy, but + somehow didn't get committed yet. ........ + +2010-08-05 09:02 +0000 [r1159382] Tobias Koenig tokoe@kde.org + + * branches/akonadi/1.4/server/src/storage/dbconfigmysql.cpp, + branches/akonadi/1.4/server/src/storage/dbconfigmysql.h: Do not + use 'mysql_upgrade', it will call 'mysql_fix_privilege_tables' + internally which prevents us from further logins. Only call + 'mysqlcheck' instead, which does the checks we want to have. + +2010-08-03 15:24 +0000 [r1158741] Tobias Koenig tokoe@kde.org + + * branches/akonadi/1.4/server/src/storage/dbconfigmysql.cpp: Move + the mysql_upgrade call to a place where we have made sure that + mysqld is up and running and accepts connections. This will avoid + mysql_upgrade to fail with the FATAL ERROR message. BUG: 241977 + +2010-08-02 08:59 +0000 [r1158192] Tobias Koenig tokoe@kde.org + + * branches/akonadi/1.4/server/src/storage/queryhelper.cpp: Do not + add '>= 1' condition to query, because this will always be true + for item id sets. Avoiding a range check does improve the + performance of the query. + +2010-07-31 09:50 +0000 [r1157502] Volker Krause vkrause@kde.org + + * branches/akonadi/1.4/ChangeLog, branches/akonadi/1.4/NEWS, + branches/akonadi/1.4/CMakeLists.txt: prepare Akonadi 1.4.0 + release + 2010-07-31 09:45 +0000 [r1157499-1157500] Volker Krause vkrause@kde.org * branches/akonadi/1.4/server/src/storage/notificationcollector.h, @@ -706,12 +785,12 @@ modify job, but that requires intrusive server changes and this makes the search in kmail work. Ok'd by Volker. -2010-04-09 13:52 +0000 [r1112925] Nicolas Lécureuil nlecureuil@mandriva.com +2010-04-09 13:52 +0000 [r1112925] Nicolas Lécureuil neoclust.kde@free.fr * trunk/kdesupport/akonadi/server/src/storage/dbconfigmysql.cpp: Forward port commit 1112923 CCBUG:185395 -2010-04-07 12:42 +0000 [r1112128] Nicolas Lécureuil nlecureuil@mandriva.com +2010-04-07 12:42 +0000 [r1112128] Nicolas Lécureuil neoclust.kde@free.fr * trunk/kdesupport/akonadi/server/src/storage/dbconfigmysql.cpp: Use mysqk_upgrade after the creation of the socket @@ -730,7 +809,7 @@ from restarting). Instead, we now get the postmaster pid and force it to quit. -2010-04-06 08:56 +0000 [r1111611] Nicolas Lécureuil nlecureuil@mandriva.com +2010-04-06 08:56 +0000 [r1111611] Nicolas Lécureuil neoclust.kde@free.fr * trunk/kdesupport/akonadi/server/src/storage/dbconfigmysql.h, trunk/kdesupport/akonadi/server/src/storage/dbconfigmysql.cpp: @@ -1769,18 +1848,18 @@ 1044743, 1044749 and fix only what needs fixing. (and don't break 4.3 compilation against akonadi trunk) -2009-11-04 15:13 +0000 [r1044749] Helio Chissini de Castro helio@kde.org +2009-11-04 15:13 +0000 [r1044749] Helio Castro helio@kde.org * trunk/kdesupport/akonadi/CMakeLists.txt: All kdepimlibs expect that we have akonadi headers installed in <includedir>/akonadi. This now fix the issue -2009-11-04 15:02 +0000 [r1044743] Helio Chissini de Castro helio@kde.org +2009-11-04 15:02 +0000 [r1044743] Helio Castro helio@kde.org * trunk/kdesupport/akonadi/CMakeLists.txt: - Revert this part since was pointed as not necessary by krop. -2009-11-04 14:57 +0000 [r1044736] Helio Chissini de Castro helio@kde.org +2009-11-04 14:57 +0000 [r1044736] Helio Castro helio@kde.org * trunk/kdesupport/akonadi/CMakeLists.txt, trunk/kdesupport/akonadi/libs/CMakeLists.txt: - Make install @@ -3580,7 +3659,7 @@ the KDE Support API docs main pages, but not into the kdelibs API docs main pages? -2009-03-08 16:22 +0000 [r936905] Christian Ehrlicher Ch.Ehrlicher@gmx.de +2009-03-08 16:22 +0000 [r936905] Christian Ehrlicher ch.ehrlicher@gmx.de * trunk/kdesupport/akonadi/server/tests/unittest/CMakeLists.txt: the private/public hack does not work on windows -> disabled @@ -4151,7 +4230,7 @@ Restart agents when their executable changed, much easier to test changes this way :) -2008-12-30 17:49 +0000 [r903502] Christian Ehrlicher Ch.Ehrlicher@gmx.de +2008-12-30 17:49 +0000 [r903502] Christian Ehrlicher ch.ehrlicher@gmx.de * trunk/kdesupport/akonadi/server/src/tests/CMakeLists.txt, trunk/kdesupport/akonadi/CMakeLists.txt, @@ -4718,12 +4797,12 @@ trunk/kdesupport/akonadi/server/src/handler/copy.cpp: Add serverside timestamp support for items. -2008-07-20 08:55 +0000 [r835215] Christian Ehrlicher Ch.Ehrlicher@gmx.de +2008-07-20 08:55 +0000 [r835215] Christian Ehrlicher ch.ehrlicher@gmx.de * trunk/kdesupport/akonadi/libs/xdgbasedirs.cpp: better fix for windows -2008-07-19 13:19 +0000 [r834689] Christian Ehrlicher Ch.Ehrlicher@gmx.de +2008-07-19 13:19 +0000 [r834689] Christian Ehrlicher ch.ehrlicher@gmx.de * trunk/kdesupport/akonadi/libs/xdgbasedirs.cpp, trunk/kdesupport/akonadi/server/src/akonadi.cpp: make msvc and @@ -4885,7 +4964,7 @@ * trunk/kdesupport/akonadi/server/control/agentmanager.cpp: dynamic_cast provides a runtime check, static_cast doesn't -2008-05-05 17:48 +0000 [r804324-804326] Christian Ehrlicher Ch.Ehrlicher@gmx.de +2008-05-05 17:48 +0000 [r804324-804326] Christian Ehrlicher ch.ehrlicher@gmx.de * trunk/kdesupport/akonadi/interfaces/org.kde.Akonadi.Agent.Control.xml (removed): two seconds to late... @@ -5077,7 +5156,7 @@ * trunk/kdesupport/akonadi/cmake/modules/FindAutomoc4.cmake (added): -add FindAutomoc4.cmake, forgot that last night Alex -2008-04-26 08:06 +0000 [r801261] Christian Ehrlicher Ch.Ehrlicher@gmx.de +2008-04-26 08:06 +0000 [r801261] Christian Ehrlicher ch.ehrlicher@gmx.de * trunk/kdesupport/akonadi/server/control/kcrash.cpp: mingw doesn't have _exit(), only _Exit() or better - it has _exit() but not @@ -5150,12 +5229,12 @@ trunk/kdesupport/akonadi/INSTALL (added): Add INSTALL and README file -2008-04-25 15:12 +0000 [r801052] Christian Ehrlicher Ch.Ehrlicher@gmx.de +2008-04-25 15:12 +0000 [r801052] Christian Ehrlicher ch.ehrlicher@gmx.de * trunk/kdesupport/akonadi/server/CMakeLists.txt: no need to link against kdewin32 lib here -2008-04-25 14:25 +0000 [r801042] Christian Ehrlicher Ch.Ehrlicher@gmx.de +2008-04-25 14:25 +0000 [r801042] Christian Ehrlicher ch.ehrlicher@gmx.de * trunk/kdesupport/akonadi/server/control/kcrash.cpp: _exit() -> exit() because _exit() is not available when compiling on @@ -5167,7 +5246,7 @@ flags for -Wno-long-long and more warnings - add the cmake directory after that flags are set -2008-04-25 05:09 +0000 [r800884] Christian Ehrlicher Ch.Ehrlicher@gmx.de +2008-04-25 05:09 +0000 [r800884] Christian Ehrlicher ch.ehrlicher@gmx.de * trunk/kdesupport/akonadi/server/CMakeLists.txt, trunk/kdesupport/akonadi/libs/CMakeLists.txt: win32 compile++ @@ -5188,7 +5267,7 @@ * trunk/kdesupport/akonadi/CMakeLists.txt: Check that Qt has DBus -2008-04-24 10:23 +0000 [r800462] Nicolas Lécureuil nlecureuil@mandriva.com +2008-04-24 10:23 +0000 [r800462] Nicolas Lécureuil neoclust.kde@free.fr * trunk/kdesupport/akonadi/CMakeLists.txt: Require Qt 4.4 minimum diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/NEWS new/akonadi-1.4.1/NEWS --- old/akonadi-1.4.0/NEWS 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/NEWS 2010-10-22 17:12:44.000000000 +0200 @@ -1,3 +1,15 @@ +1.4.1 22-October-2010 +--------------------------------------------- +- Improve range query performance. +- Fix MySQL database upgrade happening too early. +- Fix MySQL database upgrade setting wrong priviledges. +- Fix non-index access slowing down server startup. +- ASAP parser performance optimizations +- Respect SocketDirectory setting also for database sockets. +- Allow $USER placeholder in SocketDirectory setting. +- Fix ASAP parser failing on non-zero serialization format versions. + + 1.4.0 31-July-2010 --------------------------------------------- - Add change notification for collection subscription state changes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/libs/imapparser.cpp new/akonadi-1.4.1/libs/imapparser.cpp --- old/akonadi-1.4.0/libs/imapparser.cpp 2010-07-31 18:12:24.000000000 +0200 +++ new/akonadi-1.4.1/libs/imapparser.cpp 2010-10-22 17:12:42.000000000 +0200 @@ -77,13 +77,14 @@ int sublistbegin = start; bool insideQuote = false; for ( int i = begin + 1; i < data.length(); ++i ) { - if ( data[i] == '(' && !insideQuote ) { + const char currentChar = data[i]; + if ( currentChar == '(' && !insideQuote ) { ++count; if ( count == 1 ) sublistbegin = i; continue; } - if ( data[i] == ')' && !insideQuote ) { + if ( currentChar == ')' && !insideQuote ) { if ( count <= 0 ) return i + 1; if ( count == 1 ) @@ -91,7 +92,7 @@ --count; continue; } - if ( data[i] == ' ' || data[i] == '\n' || data[i] == '\r' ) + if ( currentChar == ' ' || currentChar == '\n' || currentChar == '\r' ) continue; if ( count == 0 ) { QByteArray ba; @@ -99,9 +100,9 @@ i = consumed - 1; // compensate for the for loop increment result.append( ba ); } else if ( count > 0 ) { - if ( data[i] == '"' ) { + if ( currentChar == '"' ) { insideQuote = !insideQuote; - } else if ( data[i] == '\\' && insideQuote ) { + } else if ( currentChar == '\\' && insideQuote ) { ++i; continue; } @@ -200,12 +201,13 @@ else { bool reachedInputEnd = true; for ( int i = begin; i < data.length(); ++i ) { - if ( data[i] == ' ' || data[i] == '(' || data[i] == ')' || data[i] == '\n' || data[i] == '\r' ) { + const char ch = data.at( i ); + if ( ch == ' ' || ch == '(' || ch == ')' || ch == '\n' || ch == '\r' ) { end = i; reachedInputEnd = false; break; } - if (data[i] == '\\') + if ( ch == '\\' ) foundSlash = true; } if ( reachedInputEnd ) @@ -242,19 +244,20 @@ int count = 0; bool insideQuote = false; for ( int i = start; i < data.length(); ++i ) { - if ( data[i] == '"' ) { + const char ch = data[i]; + if ( ch == '"' ) { insideQuote = !insideQuote; continue; } - if ( data[i] == '\\' && insideQuote ) { + if ( ch == '\\' && insideQuote ) { ++i; continue; } - if ( data[i] == '(' && !insideQuote ) { + if ( ch == '(' && !insideQuote ) { ++count; continue; } - if ( data[i] == ')' && !insideQuote ) { + if ( ch == ')' && !insideQuote ) { --count; continue; } @@ -264,14 +267,28 @@ QByteArray ImapParser::join(const QList< QByteArray > & list, const QByteArray & separator) { + // shortcuts for the easy cases if ( list.isEmpty() ) return QByteArray(); + if ( list.size() == 1 ) + return list.first(); - QByteArray result = list.first(); - QList<QByteArray>::ConstIterator it = list.constBegin(); + // avoid expensive realloc's by determining the size beforehand + QList<QByteArray>::const_iterator it = list.constBegin(); + const QList<QByteArray>::const_iterator endIt = list.constEnd(); + int resultSize = (list.size() - 1) * separator.size(); + for ( ; it != endIt; ++it ) + resultSize += (*it).size(); + + QByteArray result; + result.reserve( resultSize ); + it = list.constBegin(); + result += (*it); ++it; - for ( ; it != list.constEnd(); ++it ) - result += separator + (*it); + for ( ; it != endIt; ++it ) { + result += separator; + result += (*it); + } return result; } @@ -310,24 +327,43 @@ QByteArray ImapParser::quote(const QByteArray & data) { - QByteArray result( "\"" ); - result.reserve( data.length() + 2 ); - for ( int i = 0; i < data.length(); ++i ) { + if ( data.isEmpty() ) + return QByteArray( "\"\"" ); + + const int inputLength = data.length(); + int stuffToQuote = 0; + for ( int i = 0; i < inputLength; ++i ) { const char ch = data.at( i ); - if ( ch == '\n' ) { - result += "\\n"; - continue; - } + if ( ch == '"' || ch == '\\' || ch == '\n' || ch == '\r' ) + ++stuffToQuote; + } - if ( ch == '\r' ) { - result += "\\r"; - continue; + QByteArray result; + result.reserve( inputLength + stuffToQuote + 2 ); + result += '"'; + + // shortcut for the case that we don't need to quote anything at all + if ( stuffToQuote == 0 ) { + result += data; + } else { + for ( int i = 0; i < inputLength; ++i ) { + const char ch = data.at( i ); + if ( ch == '\n' ) { + result += "\\n"; + continue; + } + + if ( ch == '\r' ) { + result += "\\r"; + continue; + } + + if ( ch == '"' || ch == '\\' ) + result += '\\'; + result += ch; } - - if ( ch == '"' || ch == '\\' ) - result += '\\'; - result += ch; } + result += '"'; return result; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/libs/tests/CMakeLists.txt new/akonadi-1.4.1/libs/tests/CMakeLists.txt --- old/akonadi-1.4.0/libs/tests/CMakeLists.txt 2010-07-31 18:12:24.000000000 +0200 +++ new/akonadi-1.4.1/libs/tests/CMakeLists.txt 2010-10-22 17:12:42.000000000 +0200 @@ -10,3 +10,4 @@ endmacro(add_unit_test) add_unit_test( notificationmessagetest.cpp ) +add_unit_test( imapparserbenchmark.cpp ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/libs/tests/imapparserbenchmark.cpp new/akonadi-1.4.1/libs/tests/imapparserbenchmark.cpp --- old/akonadi-1.4.0/libs/tests/imapparserbenchmark.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/akonadi-1.4.1/libs/tests/imapparserbenchmark.cpp 2010-10-22 17:12:42.000000000 +0200 @@ -0,0 +1,73 @@ +/* + Copyright (c) 2010 Volker Krause <vkrause@kde.org> + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + This library is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public + License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. +*/ + +#include <QtTest/QTest> +#include "../imapparser_p.h" + +using namespace Akonadi; + +Q_DECLARE_METATYPE( QList<QByteArray> ) + +class ImapParserBenchmark : public QObject +{ + Q_OBJECT + private slots: + void quote_data() + { + QTest::addColumn<QByteArray>( "input" ); + QTest::newRow( "empty" ) << QByteArray(); + QTest::newRow( "10-idle" ) << QByteArray( "ababababab" ); + QTest::newRow( "10-quote" ) << QByteArray( "\"abababab\"" ); + QTest::newRow( "50-idle" ) << QByteArray( "ababababababababababababababababababababababababab" ); + QTest::newRow( "50-quote" ) << QByteArray( "\"abababab\ncabababab\ncabababab\ncabababab\ncabababab\"" ); + } + + void quote() + { + QFETCH( QByteArray, input ); + QBENCHMARK { + ImapParser::quote( input ); + } + } + + void join_data() + { + QTest::addColumn<QList<QByteArray> >( "list" ); + QTest::newRow( "empty" ) << QList<QByteArray>(); + QTest::newRow( "single" ) << (QList<QByteArray>() << "ababab"); + QTest::newRow( "two" ) << (QList<QByteArray>() << "ababab" << "ababab"); + QTest::newRow( "five" ) << (QList<QByteArray>() << "ababab" << "ababab" << "ababab" << "ababab" << "ababab"); + QList<QByteArray> list; + for ( int i = 0; i < 50; ++i ) + list << "ababab"; + QTest::newRow( "a lot" ) << list; + } + + void join() + { + QFETCH( QList<QByteArray>, list ); + QBENCHMARK { + ImapParser::join( list, " " ); + } + } +}; + +#include "imapparserbenchmark.moc" + +QTEST_MAIN( ImapParserBenchmark ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/CMakeLists.txt new/akonadi-1.4.1/server/CMakeLists.txt --- old/akonadi-1.4.0/server/CMakeLists.txt 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/CMakeLists.txt 2010-10-22 17:12:44.000000000 +0200 @@ -125,6 +125,7 @@ src/storage/transaction.cpp src/storage/parthelper.cpp src/tracer.cpp + src/utils.cpp src/dbustracer.cpp src/filetracer.cpp src/notificationmanager.cpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/akonadi.cpp new/akonadi-1.4.1/server/src/akonadi.cpp --- old/akonadi-1.4.0/server/src/akonadi.cpp 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/src/akonadi.cpp 2010-10-22 17:12:44.000000000 +0200 @@ -29,6 +29,7 @@ #include "notificationmanager.h" #include "resourcemanager.h" #include "tracer.h" +#include "utils.h" #include "debuginterface.h" #include "storage/itemretrievalthread.h" #include "preprocessormanager.h" @@ -84,13 +85,7 @@ connectionSettings.setValue( QLatin1String( "Data/Method" ), QLatin1String( "NamedPipe" ) ); connectionSettings.setValue( QLatin1String( "Data/NamedPipe" ), namedPipe ); #else - const QString defaultSocketDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi" ) ); - QString socketDir = settings.value( QLatin1String( "Connection/SocketDirectory" ), defaultSocketDir ).toString(); - if ( socketDir[0] != QLatin1Char( '/' ) ) { - QDir::home().mkdir( socketDir ); - socketDir = QDir::homePath() + QLatin1Char( '/' ) + socketDir; - } - + const QString socketDir = Utils::preferredSocketDirectory( XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi" ) ) ); const QString socketFile = socketDir + QLatin1String( "/akonadiserver.socket" ); unlink( socketFile.toUtf8().constData() ); if ( !listen( socketFile ) ) @@ -205,8 +200,7 @@ #ifndef Q_OS_WIN QSettings connectionSettings( connectionSettingsFile, QSettings::IniFormat ); - const QString defaultSocketDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi" ) ); - const QString socketDir = settings.value( QLatin1String( "Connection/SocketDirectory" ), defaultSocketDir ).toString(); + const QString socketDir = Utils::preferredSocketDirectory( XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi" ) ) ); if ( !QDir::home().remove( socketDir + QLatin1String( "/akonadiserver.socket" ) ) ) akError() << "Failed to remove Unix socket"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/imapstreamparser.cpp new/akonadi-1.4.1/server/src/imapstreamparser.cpp --- old/akonadi-1.4.0/server/src/imapstreamparser.cpp 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/src/imapstreamparser.cpp 2010-10-22 17:12:44.000000000 +0200 @@ -572,7 +572,9 @@ m_position = i; throw ImapParserException("Unable to read more data"); } - if ( m_data[i] == ' ' || m_data[i] == '(' || m_data[i] == ')' || m_data[i] == '[' || m_data[i] == ']' || m_data[i] == '\n' || m_data[i] == '\r' || m_data[i] == '"') { + // unlike in the copy in KIMAP we do not want to consider [] brackets as separators, breaks payload version parsing + // if that ever gets fixed we can re-add them here, see svn revision 937879 + if ( m_data[i] == ' ' || m_data[i] == '(' || m_data[i] == ')' || m_data[i] == '\n' || m_data[i] == '\r' || m_data[i] == '"') { end = i; reachedInputEnd = false; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/storage/akonadidb.xml new/akonadi-1.4.1/server/src/storage/akonadidb.xml --- old/akonadi-1.4.0/server/src/storage/akonadidb.xml 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/src/storage/akonadidb.xml 2010-10-22 17:12:43.000000000 +0200 @@ -153,6 +153,7 @@ <column name="version" type="int" default="0"/> <column name="external" type="bool" default="false" /> <index name="pimItemIdNameIndex" columns="pimItemId,name" unique="true"/> + <index name="pimItemNameIndex" columns="name"/> </table> <table name="CollectionAttribute"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/storage/dbconfig.cpp new/akonadi-1.4.1/server/src/storage/dbconfig.cpp --- old/akonadi-1.4.0/server/src/storage/dbconfig.cpp 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/src/storage/dbconfig.cpp 2010-10-22 17:12:43.000000000 +0200 @@ -27,6 +27,8 @@ #include <akdebug.h> #include <libs/xdgbasedirs_p.h> +#include <QtCore/QDir> + using namespace Akonadi; //TODO: make me Q_GLOBAL_STATIC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/storage/dbconfigmysql.cpp new/akonadi-1.4.1/server/src/storage/dbconfigmysql.cpp --- old/akonadi-1.4.0/server/src/storage/dbconfigmysql.cpp 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/src/storage/dbconfigmysql.cpp 2010-10-22 17:12:43.000000000 +0200 @@ -21,6 +21,7 @@ #include "../../libs/xdgbasedirs_p.h" #include "akdebug.h" +#include "utils.h" #include <QtCore/QDateTime> #include <QtCore/QDir> @@ -55,6 +56,8 @@ QString defaultServerPath; QString defaultCleanShutdownCommand; + const QString socketDirectory = Utils::preferredSocketDirectory( XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ) ); + defaultDbName = QLatin1String( "akonadi" ); const bool defaultInternalServer = true; #ifdef MYSQLD_EXECUTABLE @@ -77,7 +80,7 @@ #ifndef Q_OS_WIN defaultCleanShutdownCommand = QString::fromLatin1( "%1 shutdown --socket=%2/mysql.socket" ) .arg( mysqladminPath ) - .arg( XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ) ); + .arg( socketDirectory ); #else defaultCleanShutdownCommand = QString::fromLatin1( "%1 shutdown --shared-memory" ).arg( mysqladminPath ); #endif @@ -86,14 +89,13 @@ mMysqlInstallDbPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysql_install_db" ), mysqldSearchPath ); akDebug() << "Found mysql_install_db: " << mMysqlInstallDbPath; - mMysqlUpgradeDBPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysql_upgrade" ), mysqldSearchPath ); - akDebug() << "Found mysql_upgrade: " << mMysqlUpgradeDBPath; + mMysqlCheckPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysqlcheck" ), mysqldSearchPath ); + akDebug() << "Found mysqlcheck: " << mMysqlCheckPath; mInternalServer = settings.value( QLatin1String( "QMYSQL/StartServer" ), defaultInternalServer ).toBool(); if ( mInternalServer ) { - const QString miscDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ); #if !(defined Q_WS_WIN) - defaultOptions = QString::fromLatin1( "UNIX_SOCKET=%1/mysql.socket" ).arg( miscDir ); + defaultOptions = QString::fromLatin1( "UNIX_SOCKET=%1/mysql.socket" ).arg( socketDirectory ); #endif } @@ -163,7 +165,7 @@ const QString akDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/" ) ); const QString dataDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_data" ) ); - const QString miscDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ); + const QString socketDirectory = Utils::preferredSocketDirectory( XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ) ); // generate config file const QString globalConfig = XdgBaseDirs::findResourceFile( "config", QLatin1String( "akonadi/mysql-global.conf" ) ); @@ -212,12 +214,12 @@ if ( akDir.isEmpty() ) akFatal() << "Akonadi server was not able to create database log directory"; - if ( miscDir.isEmpty() ) + if ( socketDirectory.isEmpty() ) akFatal() << "Akonadi server was not able to create database misc directory"; // the socket path must not exceed 103 characters, so check for max dir length right away - if ( miscDir.length() >= 90 ) - akFatal() << "MySQL cannot deal with a socket path this long. Path was: " << miscDir; + if ( socketDirectory.length() >= 90 ) + akFatal() << "MySQL cannot deal with a socket path this long. Path was: " << socketDirectory; // move mysql error log file out of the way const QFileInfo errorLog( dataDir + QDir::separator() + QString::fromLatin1( "mysql.err" ) ); @@ -239,7 +241,7 @@ if ( QDir( dataDir ).entryList( QDir::NoDotAndDotDot | QDir::AllEntries ).isEmpty() && !mMysqlInstallDbPath.isEmpty() ) { const QStringList arguments = QStringList() << QString::fromLatin1( "--force" ) << QString::fromLatin1( "--defaults-file=%1").arg(confFile) << QString::fromLatin1( "--datadir=%1/" ).arg( dataDir ); QProcess::execute( mMysqlInstallDbPath, arguments ); - } + } // clear mysql ib_logfile's in case innodb_log_file_size option changed in last confUpdate if ( confUpdate ) { @@ -252,7 +254,7 @@ arguments << QString::fromLatin1( "--defaults-file=%1/mysql.conf" ).arg( akDir ); #ifndef Q_WS_WIN arguments << QString::fromLatin1( "--datadir" ) << QString::fromLatin1( "%1/" ).arg( dataDir ); - arguments << QString::fromLatin1( "--socket=%1/mysql.socket" ).arg( miscDir ); + arguments << QString::fromLatin1( "--socket=%1/mysql.socket" ).arg( socketDirectory ); #else arguments << QString::fromLatin1( "--datadir=%1/" ).arg( dataDir ); arguments << QString::fromLatin1( "--shared-memory" ); @@ -267,11 +269,6 @@ akFatal() << "process error:" << mDatabaseProcess->errorString(); } - if ( !mMysqlUpgradeDBPath.isEmpty() ) { - const QStringList arguments = QStringList() << QString::fromLatin1( "--socket=%1/mysql.socket" ).arg( miscDir ); - QProcess::execute( mMysqlUpgradeDBPath, arguments ); - } - const QLatin1String initCon( "initConnection" ); { QSqlDatabase db = QSqlDatabase::addDatabase( QLatin1String( "QMYSQL" ), initCon ); @@ -298,6 +295,15 @@ } if ( opened ) { + + if ( !mMysqlCheckPath.isEmpty() ) { + const QStringList arguments = QStringList() << QLatin1String( "--check-upgrade" ) + << QLatin1String( "--all-databases" ) + << QLatin1String( "--auto-repair" ) + << QString::fromLatin1( "--socket=%1/mysql.socket" ).arg( socketDirectory ); + QProcess::execute( mMysqlCheckPath, arguments ); + } + { QSqlQuery query( db ); if ( !query.exec( QString::fromLatin1( "USE %1" ).arg( mDatabaseName ) ) ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/storage/dbconfigmysql.h new/akonadi-1.4.1/server/src/storage/dbconfigmysql.h --- old/akonadi-1.4.0/server/src/storage/dbconfigmysql.h 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/src/storage/dbconfigmysql.h 2010-10-22 17:12:43.000000000 +0200 @@ -78,7 +78,7 @@ QString mServerPath; QString mCleanServerShutdownCommand; QString mMysqlInstallDbPath; - QString mMysqlUpgradeDBPath; + QString mMysqlCheckPath; bool mInternalServer; QProcess *mDatabaseProcess; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/storage/dbconfigpostgresql.cpp new/akonadi-1.4.1/server/src/storage/dbconfigpostgresql.cpp --- old/akonadi-1.4.0/server/src/storage/dbconfigpostgresql.cpp 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/src/storage/dbconfigpostgresql.cpp 2010-10-22 17:12:43.000000000 +0200 @@ -21,6 +21,7 @@ #include "../../libs/xdgbasedirs_p.h" #include "akdebug.h" +#include "utils.h" #include <QtCore/QDir> #include <QtCore/QProcess> @@ -71,7 +72,7 @@ defaultServerPath = XdgBaseDirs::findExecutableFile( QLatin1String( "pg_ctl" ), postgresSearchPath ); defaultInitDbPath = XdgBaseDirs::findExecutableFile( QLatin1String( "initdb" ), postgresSearchPath ); - defaultHostName = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ); + defaultHostName = Utils::preferredSocketDirectory( XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ) ); defaultCleanShutdownCommand = QString::fromLatin1( "%1 stop -D%2" ) .arg( defaultServerPath ) .arg( XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_data" ) ) ); @@ -130,7 +131,7 @@ void DbConfigPostgresql::startInternalServer() { const QString dataDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_data" ) ); - const QString socketDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ); + const QString socketDir = Utils::preferredSocketDirectory( XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) ) ); if ( !QFile::exists( QString::fromLatin1( "%1/PG_VERSION" ).arg( dataDir ) ) ) { // postgres data directory not initialized yet, so call initdb on it diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/storage/queryhelper.cpp new/akonadi-1.4.1/server/src/storage/queryhelper.cpp --- old/akonadi-1.4.0/server/src/storage/queryhelper.cpp 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/src/storage/queryhelper.cpp 2010-10-22 17:12:43.000000000 +0200 @@ -32,13 +32,18 @@ if ( i.size() == 1 ) { cond.addValueCondition( column, Query::Equals, i.begin() ); } else { - Query::Condition subCond( Query::And ); - subCond.addValueCondition( column, Query::GreaterOrEqual, i.begin() ); - subCond.addValueCondition( column, Query::LessOrEqual, i.end() ); - cond.addCondition( subCond ); + if ( i.begin() != 1 ) { // 1 is our standard lower bound, so we don't have to check for it explicitly + Query::Condition subCond( Query::And ); + subCond.addValueCondition( column, Query::GreaterOrEqual, i.begin() ); + subCond.addValueCondition( column, Query::LessOrEqual, i.end() ); + cond.addCondition( subCond ); + } else { + cond.addValueCondition( column, Query::LessOrEqual, i.end() ); + } } } else if ( i.hasDefinedBegin() ) { - cond.addValueCondition( column, Query::GreaterOrEqual, i.begin() ); + if ( i.begin() != 1 ) // 1 is our standard lower bound, so we don't have to check for it explicitly + cond.addValueCondition( column, Query::GreaterOrEqual, i.begin() ); } else if ( i.hasDefinedEnd() ) { cond.addValueCondition( column, Query::LessOrEqual, i.end() ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/utils.cpp new/akonadi-1.4.1/server/src/utils.cpp --- old/akonadi-1.4.0/server/src/utils.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/akonadi-1.4.1/server/src/utils.cpp 2010-10-22 17:12:44.000000000 +0200 @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2010 Tobias Koenig <tokoe@kde.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include "utils.h" + +#include "libs/xdgbasedirs_p.h" + +#include <QtCore/QDir> +#include <QtCore/QFileInfo> +#include <QtCore/QSettings> + +using namespace Akonadi; + +QString Utils::preferredSocketDirectory( const QString &defaultDirectory ) +{ + const QString serverConfigFile = XdgBaseDirs::akonadiServerConfigFile( XdgBaseDirs::ReadWrite ); + const QSettings serverSettings( serverConfigFile, QSettings::IniFormat ); + + QString socketDir = serverSettings.value( QLatin1String( "Connection/SocketDirectory" ), defaultDirectory ).toString(); + + const QString userName = QString::fromLocal8Bit( qgetenv( "USER" ) ); + if ( socketDir.contains( QLatin1String( "$USER" ) ) && !userName.isEmpty() ) + socketDir.replace( QLatin1String( "$USER" ), userName ); + + if ( socketDir[0] != QLatin1Char( '/' ) ) { + QDir::home().mkdir( socketDir ); + socketDir = QDir::homePath() + QLatin1Char( '/' ) + socketDir; + } + + QFileInfo dirInfo( socketDir ); + if ( !dirInfo.exists() ) + QDir::home().mkpath( dirInfo.absoluteFilePath() ); + + return socketDir; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/akonadi-1.4.0/server/src/utils.h new/akonadi-1.4.1/server/src/utils.h --- old/akonadi-1.4.0/server/src/utils.h 2010-07-31 18:12:25.000000000 +0200 +++ new/akonadi-1.4.1/server/src/utils.h 2010-10-22 17:12:44.000000000 +0200 @@ -57,6 +57,12 @@ } } +/** + * Returns the socket @p directory that is passed to this method or the one + * the user has overwritten via the config file. + */ +QString preferredSocketDirectory( const QString &directory ); + } #endif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de