Hello community, here is the log from the commit of package kdepimlibs4 for openSUSE:Factory checked in at 2011-12-08 12:10:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdepimlibs4 (Old) and /work/SRC/openSUSE:Factory/.kdepimlibs4.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdepimlibs4", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/kdepimlibs4/kdepimlibs4.changes 2011-11-14 14:18:16.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kdepimlibs4.new/kdepimlibs4.changes 2011-12-08 12:10:09.000000000 +0100 @@ -1,0 +2,11 @@ +Wed Dec 7 11:30:49 UTC 2011 - [email protected] + +- fix license to be in spdx.org format + +------------------------------------------------------------------- +Fri Dec 2 01:58:54 CET 2011 - [email protected] + +- update to 4.7.4 + * see http://kde.org/announcements/changelogs/changelog4_7_3to4_7_4.php for details + +------------------------------------------------------------------- Old: ---- kdepimlibs-4.7.3.tar.bz2 New: ---- kdepimlibs-4.7.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdepimlibs4.spec ++++++ --- /var/tmp/diff_new_pack.5aRNqM/_old 2011-12-08 12:10:14.000000000 +0100 +++ /var/tmp/diff_new_pack.5aRNqM/_new 2011-12-08 12:10:14.000000000 +0100 @@ -15,15 +15,13 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - - Name: kdepimlibs4 -Version: 4.7.3 -Release: 1 -License: LGPLv2.1+ +Version: 4.7.4 +Release: 0 Summary: KDE PIM Libraries -Url: http://www.kde.org +License: LGPL-2.1+ Group: System/GUI/KDE +Url: http://www.kde.org Source0: kdepimlibs-%{version}.tar.bz2 Patch0: 4_7_BRANCH.diff BuildRequires: boost-devel @@ -75,7 +73,6 @@ rm -rf %{buildroot} %package -n libkdepimlibs4 -License: LGPLv2.1+ Summary: KDE PIM Libraries Group: System/GUI/KDE %requires_ge libical0 @@ -117,7 +114,6 @@ %{_kde4_libdir}/libsyndication.so.* %package -n libakonadi4 -License: LGPLv2.1+ Summary: PIM Storage Service Libraries Group: System/GUI/KDE Requires: libakonadiprotocolinternals1 >= 1.6.0 @@ -143,7 +139,6 @@ %{_kde4_libdir}/libakonadi-kmime.so.* %package -n libkdepimlibs4-devel -License: LGPLv2.1+ Summary: KDE PIM Libraries: Build Environment Group: Development/Libraries/KDE Requires: boost-devel ++++++ kdepimlibs-4.7.3.tar.bz2 -> kdepimlibs-4.7.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/CMakeLists.txt new/kdepimlibs-4.7.4/CMakeLists.txt --- old/kdepimlibs-4.7.3/CMakeLists.txt 2011-10-28 09:48:14.000000000 +0200 +++ new/kdepimlibs-4.7.4/CMakeLists.txt 2011-12-02 00:47:15.000000000 +0100 @@ -7,7 +7,7 @@ ############### The kdepimlibs version (used e.g. in KdepimLibsConfig.cmake) ############### set(KDEPIMLIBS_VERSION_MAJOR 4) set(KDEPIMLIBS_VERSION_MINOR 7) -set(KDEPIMLIBS_VERSION_PATCH 3) +set(KDEPIMLIBS_VERSION_PATCH 4) set(KDEPIMLIBS_VERSION ${KDEPIMLIBS_VERSION_MAJOR}.${KDEPIMLIBS_VERSION_MINOR}.${KDEPIMLIBS_VERSION_PATCH}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/actionstatemanager.cpp new/kdepimlibs-4.7.4/akonadi/actionstatemanager.cpp --- old/kdepimlibs-4.7.3/akonadi/actionstatemanager.cpp 2011-05-20 22:31:22.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/actionstatemanager.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -142,6 +142,14 @@ } } + bool atLeastOneCollectionCanHaveItems = false; + foreach ( const Collection &collection, collections ) { + if ( collectionCanHaveItems( collection ) ) { + atLeastOneCollectionCanHaveItems = true; + break; + } + } + const Collection collection = (!collections.isEmpty() ? collections.first() : Collection()); // collection specific actions @@ -165,8 +173,7 @@ enableAction( StandardActionManager::CollectionProperties, singleCollectionSelected && // we can only configure one collection at a time !isRootCollection( collection ) ); // we can not configure the root collection - enableAction( StandardActionManager::SynchronizeCollections, atLeastOneCollectionSelected && - collectionsAreFolders ); // it must be a valid folder collection + enableAction( StandardActionManager::SynchronizeCollections, atLeastOneCollectionCanHaveItems ); // it must be a valid folder collection enableAction( StandardActionManager::SynchronizeCollectionsRecursive, atLeastOneCollectionSelected && collectionsAreFolders ); // it must be a valid folder collection @@ -300,6 +307,12 @@ return instance.type().capabilities().contains( capability ); } +bool ActionStateManager::collectionCanHaveItems( const Collection &collection ) const +{ + return !( collection.contentMimeTypes() == ( QStringList() << QLatin1String( "inode/directory" ) ) || + CollectionUtils::isStructural( collection ) ); +} + void ActionStateManager::enableAction( int action, bool state ) { if ( !mReceiver ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/actionstatemanager_p.h new/kdepimlibs-4.7.4/akonadi/actionstatemanager_p.h --- old/kdepimlibs-4.7.3/akonadi/actionstatemanager_p.h 2011-05-20 22:31:22.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/actionstatemanager_p.h 2011-12-02 00:24:33.000000000 +0100 @@ -67,6 +67,7 @@ virtual bool isSpecialCollection( const Collection &collection ) const; virtual bool isFavoriteCollection( const Collection &collection ) const; virtual bool hasResourceCapability( const Collection &collection, const QString &capability ) const; + virtual bool collectionCanHaveItems( const Collection &collection ) const; virtual void enableAction( int action, bool state ); virtual void updatePluralLabel( int action, int count ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/agentbase.cpp new/kdepimlibs-4.7.4/akonadi/agentbase.cpp --- old/kdepimlibs-4.7.3/akonadi/agentbase.cpp 2011-10-28 09:41:42.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/agentbase.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -609,7 +609,8 @@ if ( d->mNeedsNetwork ) { connect( Solid::Networking::notifier() , SIGNAL( statusChanged( Solid::Networking::Status ) ) - , this, SLOT( slotNetworkStatusChange( Solid::Networking::Status ) ) ); + , this, SLOT( slotNetworkStatusChange( Solid::Networking::Status ) ) + , Qt::UniqueConnection ); } else { disconnect( Solid::Networking::notifier(), 0, 0, 0 ); setOnline( true ); @@ -620,6 +621,11 @@ { Q_D( AgentBase ); d->mOnline = state; + + const QString newMessage = d->defaultReadyMessage(); + if ( d->mStatusMessage != newMessage && d->mStatusCode != AgentBase::Broken ) + emit status( d->mStatusCode, newMessage ); + d->mSettings->setValue( QLatin1String( "Agent/Online" ), state ); doSetOnline( state ); emit onlineChanged( state ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/agentinstance_p.h new/kdepimlibs-4.7.4/akonadi/agentinstance_p.h --- old/kdepimlibs-4.7.3/akonadi/agentinstance_p.h 2011-05-20 22:31:22.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/agentinstance_p.h 2011-12-02 00:24:33.000000000 +0100 @@ -35,6 +35,7 @@ { public: Private() + : mIsOnline(false) { } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/collectioncombobox.cpp new/kdepimlibs-4.7.4/akonadi/collectioncombobox.cpp --- old/kdepimlibs-4.7.3/akonadi/collectioncombobox.cpp 2011-05-20 22:31:22.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/collectioncombobox.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -71,6 +71,7 @@ mRightsFilterModel->setSourceModel( mMimeTypeFilterModel ); mParent->setModel( mRightsFilterModel ); + mParent->model()->sort( mParent->modelColumn() ); mSelectionHandler = new AsyncSelectionHandler( mRightsFilterModel, mParent ); mParent->connect( mSelectionHandler, SIGNAL( collectionAvailable( const QModelIndex& ) ), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/collectionstatisticsdelegate.cpp new/kdepimlibs-4.7.4/akonadi/collectionstatisticsdelegate.cpp --- old/kdepimlibs-4.7.3/akonadi/collectionstatisticsdelegate.cpp 2011-10-28 09:41:42.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/collectionstatisticsdelegate.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -68,18 +68,19 @@ void getCountRecursive( const QModelIndex &index, qint64 &totalCount, qint64 &unreadCount ) const { Collection collection = qvariant_cast<Collection>( index.data( EntityTreeModel::CollectionRole ) ); - Q_ASSERT( collection.isValid() ); - CollectionStatistics statistics = collection.statistics(); - totalCount += qMax( 0LL, statistics.count() ); - unreadCount += qMax( 0LL, statistics.unreadCount() ); - - if ( index.model()->hasChildren( index ) ) - { - const int rowCount = index.model()->rowCount( index ); - for ( int row = 0; row < rowCount; row++ ) - { - static const int column = 0; - getCountRecursive( index.model()->index( row, column, index ), totalCount, unreadCount ); + // Do not assert on invalid collections, since a collection may be deleted + // in the meantime and deleted collections are invalid. + if ( collection.isValid() ) { + CollectionStatistics statistics = collection.statistics(); + totalCount += qMax( 0LL, statistics.count() ); + unreadCount += qMax( 0LL, statistics.unreadCount() ); + + if ( index.model()->hasChildren( index ) ) { + const int rowCount = index.model()->rowCount( index ); + for ( int row = 0; row < rowCount; row++ ) { + static const int column = 0; + getCountRecursive( index.model()->index( row, column, index ), totalCount, unreadCount ); + } } } } @@ -200,6 +201,7 @@ Q_D( const CollectionStatisticsDelegate ); PainterStateSaver stateSaver( painter ); + const QColor textColor = index.data( Qt::ForegroundRole ).value<QColor>(); // First, paint the basic, but without the text. We remove the text // in initStyleOption(), which gets called by QStyledItemDelegate::paint(). QStyledItemDelegate::paint( painter, option, index ); @@ -223,7 +225,7 @@ bool expanded = treeView && treeView->isExpanded( firstColumn ); if ( option.state & QStyle::State_Selected ) { - painter->setPen( option.palette.highlightedText().color() ); + painter->setPen( textColor.isValid() ? textColor : option.palette.highlightedText().color() ); } Collection collection = index.sibling( index.row(), 0 ).data( EntityTreeModel::CollectionRole ).value<Collection>(); @@ -279,6 +281,8 @@ QRect unreadRect = textRect; folderRect.setRight( textRect.left() + folderWidth ); unreadRect.setLeft( folderRect.right() ); + if ( textColor.isValid() ) + painter->setPen( textColor ); // Draw folder name and unread count painter->drawText( folderRect, Qt::AlignLeft | Qt::AlignVCenter, folderName ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/dragdropmanager.cpp new/kdepimlibs-4.7.4/akonadi/dragdropmanager.cpp --- old/kdepimlibs-4.7.3/akonadi/dragdropmanager.cpp 2011-10-28 09:41:42.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/dragdropmanager.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -96,7 +96,7 @@ return false; } -bool DragDropManager::processDropEvent( QDropEvent *event, bool dropOnItem ) +bool DragDropManager::processDropEvent( QDropEvent *event, bool &menuCanceled, bool dropOnItem ) { const Collection targetCollection = currentDropTarget( event ); if ( !targetCollection.isValid() ) @@ -210,8 +210,8 @@ popup.addAction( KIcon( QString::fromLatin1( "process-stop" ) ), i18n( "C&ancel" ) + QLatin1Char( '\t' ) + QKeySequence( Qt::Key_Escape ).toString() ); QAction *activatedAction = popup.exec( QCursor::pos() ); - if ( !activatedAction ) { + menuCanceled = true; return false; } else if ( activatedAction == moveDropAction ) { event->setDropAction( Qt::MoveAction ); @@ -220,9 +220,9 @@ } else if ( activatedAction == linkAction ) { event->setDropAction( Qt::LinkAction ); } else { + menuCanceled = true; return false; } - return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/dragdropmanager_p.h new/kdepimlibs-4.7.4/akonadi/dragdropmanager_p.h --- old/kdepimlibs-4.7.3/akonadi/dragdropmanager_p.h 2011-10-28 09:41:42.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/dragdropmanager_p.h 2011-12-02 00:24:33.000000000 +0100 @@ -44,7 +44,7 @@ * * @returns True if the event should be further processed, and false otherwise. */ - bool processDropEvent( QDropEvent *event, bool dropOnItem = true ); + bool processDropEvent( QDropEvent *event, bool &menuCanceled, bool dropOnItem = true ); /** * Starts a drag if possible and sets the appropriate supported actions to allow moves. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/entitylistview.cpp new/kdepimlibs-4.7.4/akonadi/entitylistview.cpp --- old/kdepimlibs-4.7.3/akonadi/entitylistview.cpp 2011-07-19 23:33:40.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/entitylistview.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -183,7 +183,14 @@ void EntityListView::dropEvent( QDropEvent * event ) { - if ( d->mDragDropManager->processDropEvent( event ) || qobject_cast<Akonadi::FavoriteCollectionsModel*>( model() ) ) { + bool menuCanceled = false; + if ( d->mDragDropManager->processDropEvent( event, menuCanceled ) && !menuCanceled) { + if ( menuCanceled ) + return; + QListView::dropEvent( event ); + } + else if ( qobject_cast<Akonadi::FavoriteCollectionsModel*>( model() ) &&!menuCanceled ) + { QListView::dropEvent( event ); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/entitytreemodel_p.cpp new/kdepimlibs-4.7.4/akonadi/entitytreemodel_p.cpp --- old/kdepimlibs-4.7.3/akonadi/entitytreemodel_p.cpp 2011-10-28 09:41:42.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/entitytreemodel_p.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -48,6 +48,7 @@ #include <akonadi/servermanager.h> #include <kdebug.h> +#include <QApplication> /// comment this out to track time spent on jobs created by the ETM // #define DBG_TRACK_JOB_TIMES @@ -1177,13 +1178,15 @@ void EntityTreeModelPrivate::fetchJobDone( KJob *job ) { + const Collection::Id collectionId = job->property( FetchCollectionId() ).value<Collection::Id>(); + if ( job->error() ) { kWarning() << "Job error: " << job->errorString() << endl; + KMessageBox::error(qApp->activeWindow(), job->errorString(), i18n("Fetch Job Error")); + m_pendingCollectionRetrieveJobs.remove( collectionId ); return; // let's be safe, otherwise emitting dataChanged will get us into loops } - const Collection::Id collectionId = job->property( FetchCollectionId() ).value<Collection::Id>(); - #ifdef DBG_TRACK_JOB_TIMES kDebug() << "Fetch job took " << jobTimeTracker.take(job).elapsed() << "msec"; if ( CollectionFetchJob* cJob = dynamic_cast<CollectionFetchJob*>( job ) ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/entitytreeview.cpp new/kdepimlibs-4.7.4/akonadi/entitytreeview.cpp --- old/kdepimlibs-4.7.3/akonadi/entitytreeview.cpp 2011-10-28 09:41:42.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/entitytreeview.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -250,7 +250,8 @@ void EntityTreeView::dropEvent( QDropEvent * event ) { d->mDragExpandTimer.stop(); - if ( d->mDragDropManager->processDropEvent( event, ( dropIndicatorPosition () == QAbstractItemView::OnItem ) ) ) + bool menuCanceled = false; + if ( d->mDragDropManager->processDropEvent( event, menuCanceled, ( dropIndicatorPosition () == QAbstractItemView::OnItem ) ) ) QTreeView::dropEvent( event ); } #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/kmime/standardmailactionmanager.cpp new/kdepimlibs-4.7.4/akonadi/kmime/standardmailactionmanager.cpp --- old/kdepimlibs-4.7.3/akonadi/kmime/standardmailactionmanager.cpp 2011-07-19 23:33:40.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/kmime/standardmailactionmanager.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -302,40 +302,52 @@ bool enableMarkAllAsRead = false; bool enableMarkAllAsUnread = false; bool canDeleteItem = true; + bool isSystemFolder = false; if ( collectionIsSelected ) { - const Collection collection = selectedCollections.first(); - if ( collection.isValid() ) { - const Akonadi::CollectionStatistics stats = collection.statistics(); - enableMarkAllAsRead = (stats.unreadCount() > 0); - enableMarkAllAsUnread = (stats.count() != stats.unreadCount()); - canDeleteItem = collection.rights() & Akonadi::Collection::CanDeleteItem; - const bool isSystemFolder = (collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Inbox ) || - collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Outbox ) || - collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::SentMail ) || - collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Trash ) || - collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Drafts ) || - collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Templates )); - - if ( isSystemFolder ) { - if ( mGenericManager->action( StandardActionManager::DeleteCollections ) ) { - mGenericManager->action( StandardActionManager::DeleteCollections )->setEnabled( false ); + foreach( const Collection collection, selectedCollections ) + { + if ( collection.isValid() ) { + const Akonadi::CollectionStatistics stats = collection.statistics(); + if ( !enableMarkAllAsRead ) + enableMarkAllAsRead = (stats.unreadCount() > 0); + if ( !enableMarkAllAsUnread ) + enableMarkAllAsUnread = (stats.count() != stats.unreadCount()); + if ( canDeleteItem ) + canDeleteItem = collection.rights() & Akonadi::Collection::CanDeleteItem; + if ( !isSystemFolder ) { + isSystemFolder = (collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Inbox ) || + collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Outbox ) || + collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::SentMail ) || + collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Trash ) || + collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Drafts ) || + collection == SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Templates )); } + //We will not change after that. + if ( enableMarkAllAsRead && enableMarkAllAsUnread && !canDeleteItem && isSystemFolder ) + break; } } } - + if ( isSystemFolder ) { + if ( mGenericManager->action( StandardActionManager::DeleteCollections ) ) { + mGenericManager->action( StandardActionManager::DeleteCollections )->setEnabled( false ); + } + } + if ( mActions.contains( Akonadi::StandardMailActionManager::MoveToTrash ) ) mActions.value( Akonadi::StandardMailActionManager::MoveToTrash )->setEnabled( itemIsSelected && canDeleteItem ); if ( mActions.contains( Akonadi::StandardMailActionManager::RemoveDuplicates ) ) mActions.value( Akonadi::StandardMailActionManager::RemoveDuplicates )->setEnabled( canDeleteItem ); QAction *action = mActions.value( Akonadi::StandardMailActionManager::MarkAllMailAsRead ); - if ( action ) + if ( action ) { action->setEnabled( enableMarkAllAsRead ); + } action = mActions.value( Akonadi::StandardMailActionManager::MarkAllMailAsUnread ); - if ( action ) + if ( action ) { action->setEnabled( enableMarkAllAsUnread ); + } emit mParent->actionStateUpdated(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/akonadi/standardactionmanager.cpp new/kdepimlibs-4.7.4/akonadi/standardactionmanager.cpp --- old/kdepimlibs-4.7.3/akonadi/standardactionmanager.cpp 2011-09-26 11:37:14.000000000 +0200 +++ new/kdepimlibs-4.7.4/akonadi/standardactionmanager.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -291,7 +291,9 @@ return; const StandardActionManager::Type type = static_cast<StandardActionManager::Type>( menu->property( "actionType" ).toInt() ); - fillFoldersMenu( type, + const QSet<QString> mimeTypes = mimeTypesOfSelection( type ); + fillFoldersMenu( mimeTypes, + type, menu, collectionSelectionModel->model(), QModelIndex() ); @@ -985,13 +987,11 @@ return !(CollectionUtils::isStructural( collection ) || isReadOnlyForItems || isReadOnlyForCollections); } - void fillFoldersMenu( StandardActionManager::Type type, QMenu *menu, + void fillFoldersMenu( const QSet<QString>& mimeTypes, StandardActionManager::Type type, QMenu *menu, const QAbstractItemModel *model, QModelIndex parentIndex ) { const int rowCount = model->rowCount( parentIndex ); - const QSet<QString> mimeTypes = mimeTypesOfSelection( type ); - for ( int row = 0; row < rowCount; ++row ) { const QModelIndex index = model->index( row, 0, parentIndex ); const Collection collection = model->data( index, CollectionModel::CollectionRole ).value<Collection>(); @@ -1014,7 +1014,7 @@ popup->setTitle( label ); popup->setIcon( icon ); - fillFoldersMenu( type, popup, model, index ); + fillFoldersMenu( mimeTypes, type, popup, model, index ); if ( !readOnly ) { popup->addSeparator(); Files old/kdepimlibs-4.7.3/doc/kcontrol/kresources/index.cache.bz2 and new/kdepimlibs-4.7.4/doc/kcontrol/kresources/index.cache.bz2 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kcalcore/icalformat.cpp new/kdepimlibs-4.7.4/kcalcore/icalformat.cpp --- old/kdepimlibs-4.7.3/kcalcore/icalformat.cpp 2011-05-20 22:31:22.000000000 +0200 +++ new/kdepimlibs-4.7.4/kcalcore/icalformat.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -318,11 +318,28 @@ QByteArray ICalFormat::toRawString( const Incidence::Ptr &incidence ) { icalcomponent *component; + ICalTimeZones tzlist; + ICalTimeZones tzUsedList; - component = d->mImpl->writeIncidence( incidence ); + component = d->mImpl->writeIncidence( incidence, iTIPRequest, &tzlist, &tzUsedList ); QByteArray text = icalcomponent_as_ical_string( component ); + // time zones + ICalTimeZones::ZoneMap zones = tzUsedList.zones(); + for ( ICalTimeZones::ZoneMap::ConstIterator it=zones.constBegin(); + it != zones.constEnd(); ++it ) { + icaltimezone *tz = (*it).icalTimezone(); + if ( !tz ) { + kError() << "bad time zone"; + } else { + icalcomponent *tzcomponent = icaltimezone_get_component( tz ); + icalcomponent_add_component( component, component ); + text.append( icalcomponent_as_ical_string( tzcomponent ) ); + icaltimezone_free( tz, 1 ); + } + } + icalcomponent_free( component ); return text; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kcalcore/icalformat_p.cpp new/kdepimlibs-4.7.4/kcalcore/icalformat_p.cpp --- old/kdepimlibs-4.7.3/kcalcore/icalformat_p.cpp 2011-08-22 15:22:19.000000000 +0200 +++ new/kdepimlibs-4.7.4/kcalcore/icalformat_p.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -98,22 +98,22 @@ class ToComponentVisitor : public Visitor { public: - ToComponentVisitor( ICalFormatImpl *impl, iTIPMethod m ) - : mImpl( impl ), mComponent( 0 ), mMethod( m ) {} + ToComponentVisitor( ICalFormatImpl *impl, iTIPMethod m, ICalTimeZones *tzList = 0, ICalTimeZones *tzUsedList = 0 ) + : mImpl( impl ), mComponent( 0 ), mMethod( m ), mTzList( tzList ), mTzUsedList( tzUsedList ) {} bool visit( Event::Ptr e ) { - mComponent = mImpl->writeEvent( e ); + mComponent = mImpl->writeEvent( e, mTzList, mTzUsedList ); return true; } bool visit( Todo::Ptr t ) { - mComponent = mImpl->writeTodo( t ); + mComponent = mImpl->writeTodo( t, mTzList, mTzUsedList ); return true; } bool visit( Journal::Ptr j ) { - mComponent = mImpl->writeJournal( j ); + mComponent = mImpl->writeJournal( j, mTzList, mTzUsedList ); return true; } bool visit( FreeBusy::Ptr fb ) @@ -131,6 +131,8 @@ ICalFormatImpl *mImpl; icalcomponent *mComponent; iTIPMethod mMethod; + ICalTimeZones *mTzList; + ICalTimeZones *mTzUsedList; }; class ICalFormatImpl::Private @@ -174,9 +176,11 @@ } icalcomponent *ICalFormatImpl::writeIncidence( const IncidenceBase::Ptr &incidence, - iTIPMethod method ) + iTIPMethod method, + ICalTimeZones *tzList, + ICalTimeZones *tzUsedList ) { - ToComponentVisitor v( this, method ); + ToComponentVisitor v( this, method, tzList, tzUsedList ); if ( incidence->accept( v, incidence ) ) { return v.component(); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kcalcore/icalformat_p.h new/kdepimlibs-4.7.4/kcalcore/icalformat_p.h --- old/kdepimlibs-4.7.3/kcalcore/icalformat_p.h 2011-05-20 22:31:22.000000000 +0200 +++ new/kdepimlibs-4.7.4/kcalcore/icalformat_p.h 2011-12-02 00:24:33.000000000 +0100 @@ -102,7 +102,9 @@ bool deleted = false, const QString ¬ebook = QString() ); icalcomponent *writeIncidence( const IncidenceBase::Ptr &incidence, - iTIPMethod method = iTIPRequest ); + iTIPMethod method = iTIPRequest, + ICalTimeZones *tzList = 0, + ICalTimeZones *tzUsedList = 0 ); icalcomponent *writeTodo( const Todo::Ptr &todo, ICalTimeZones *tzlist = 0, ICalTimeZones *tzUsedList = 0 ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kcalutils/incidenceformatter.cpp new/kdepimlibs-4.7.4/kcalutils/incidenceformatter.cpp --- old/kdepimlibs-4.7.3/kcalutils/incidenceformatter.cpp 2011-05-20 22:31:22.000000000 +0200 +++ new/kdepimlibs-4.7.4/kcalutils/incidenceformatter.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -84,9 +84,13 @@ if ( !email.isEmpty() ) { Person person( name, email ); + QString path = person.fullName().simplified(); + if ( path.isEmpty() || path.startsWith( '"' ) ) { + path = email; + } KUrl mailto; mailto.setProtocol( "mailto" ); - mailto.setPath( person.fullName() ); + mailto.setPath( path ); const QString iconPath = KIconLoader::global()->iconPath( "mail-message-new", KIconLoader::Small ); str = htmlAddLink( mailto.url(), "<img valign=\"top\" src=\"" + iconPath + "\">" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kimap/getquotarootjob.cpp new/kdepimlibs-4.7.4/kimap/getquotarootjob.cpp --- old/kdepimlibs-4.7.3/kimap/getquotarootjob.cpp 2011-05-20 22:31:22.000000000 +0200 +++ new/kdepimlibs-4.7.4/kimap/getquotarootjob.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -37,7 +37,6 @@ QString mailBox; QList<QByteArray> rootList; - uint rootIndex; QMap< QByteArray, QMap<QByteArray, QPair<qint64, qint64> > > quotas; }; } @@ -63,21 +62,38 @@ { Q_D(GetQuotaRootJob); if (handleErrorReplies(response) == NotHandled) { - if ( response.content.size() >= 4 ) { + if ( response.content.size() >= 3 ) { if (response.content[1].toString() == "QUOTAROOT" ) { d->rootList.clear(); - int i = 3; - while ( i < response.content.size()) - { - d->rootList.append(response.content[i].toString()); - i++; + //some impls don't give the root a name which for us seems as if + //there were no message part + if ( response.content.size() == 3 ) { + d->rootList.append(""); + } else { + int i = 3; + while ( i < response.content.size()) + { + d->rootList.append(response.content[i].toString()); + i++; + } } - d->rootIndex = 0; } else if (response.content[1].toString() == "QUOTA" ) { - //TODO: check if we should use the roots in order it came in QUOTAROOT response or the root name from the QUOTA response itself - d->quotas[ d->rootList[d->rootIndex] ] = d->readQuota(response.content[3]); - d->rootIndex++; + QByteArray rootName; + int quotaContentIndex = 3; + //some impls don't give the root a name in the response + if (response.content.size() == 3 ) { + quotaContentIndex = 2; + } else { + rootName = response.content[2].toString(); + } + + const QMap<QByteArray, QPair<qint64, qint64> >& quota = d->readQuota(response.content[quotaContentIndex]); + if (d->quotas.contains(rootName)) { + d->quotas[ rootName ].unite(quota); + } else { + d->quotas[ rootName ] = quota; + } } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kimap/tests/CMakeLists.txt new/kdepimlibs-4.7.4/kimap/tests/CMakeLists.txt --- old/kdepimlibs-4.7.3/kimap/tests/CMakeLists.txt 2011-05-20 22:31:22.000000000 +0200 +++ new/kdepimlibs-4.7.4/kimap/tests/CMakeLists.txt 2011-12-02 00:24:33.000000000 +0100 @@ -41,6 +41,7 @@ storejobtest imapsettest idlejobtest + quotarootjobtest ) ########### manual tests ############### diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kimap/tests/quotarootjobtest.cpp new/kdepimlibs-4.7.4/kimap/tests/quotarootjobtest.cpp --- old/kdepimlibs-4.7.3/kimap/tests/quotarootjobtest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/kdepimlibs-4.7.4/kimap/tests/quotarootjobtest.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -0,0 +1,187 @@ +/* + Copyright (C) 2011 Andras Mantia <[email protected]> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include <qtest_kde.h> + +#include "kimaptest/fakeserver.h" +#include "kimap/session.h" +#include "kimap/getquotarootjob.h" + +#include <QTcpSocket> +#include <QtTest> +#include <KDebug> + +Q_DECLARE_METATYPE( QList<qint64> ); + +class QuotaRootJobTest: public QObject { + Q_OBJECT + +private Q_SLOTS: + +void testGetQuotaRoot_data() { + QTest::addColumn<QString>("mailbox"); + QTest::addColumn<QList<QByteArray> >( "roots" ); + QTest::addColumn<QList<QByteArray> >( "resources" ); + QTest::addColumn<QList<qint64> >( "usages" ); + QTest::addColumn<QList<qint64> >( "limits" ); + QTest::addColumn<QList<QByteArray> >( "scenario" ); + + QList<QByteArray> roots; + QList<QByteArray> resources; + QList<qint64> usages; + QList<qint64> limits; + QList<QByteArray> scenario; + roots << ""; + resources << "STORAGE"; + limits << 512; + usages << 10; + scenario << FakeServer::preauth() + << "C: A000001 GETQUOTAROOT \"INBOX\"" + << "S: * QUOTAROOT INBOX \"\" " + << "S: * QUOTA \"\" (STORAGE 10 512)" + << "S: A000001 OK GETQUOTA completed"; + QTest::newRow( "one root, one resource" ) << "INBOX" << roots << resources << usages << limits << scenario; + + roots.clear(); + resources.clear(); + usages.clear(); + limits.clear(); + scenario.clear(); + roots << ""; + resources << "STORAGE" << "MESSAGE"; + usages << 10 << 8221; + limits << 512 << 20000; + scenario << FakeServer::preauth() + << "C: A000001 GETQUOTAROOT \"INBOX\"" + << "S: * QUOTAROOT INBOX \"\" " + << "S: * QUOTA \"\" (STORAGE 10 512)" + << "S: * QUOTA \"\" ( MESSAGE 8221 20000 ) " + << "S: A000001 OK GETQUOTA completed"; + QTest::newRow( "one root, multiple resource" ) << "INBOX" << roots << resources << usages << limits << scenario; + + roots.clear(); + resources.clear(); + usages.clear(); + limits.clear(); + scenario.clear(); + roots << "root1" << "root2"; + resources << "STORAGE" << "MESSAGE"; + usages << 10 << 8221 << 30 << 100; + limits << 512 << 20000 << 5124 << 120000; + scenario << FakeServer::preauth() + << "C: A000001 GETQUOTAROOT \"INBOX\"" + << "S: * QUOTAROOT INBOX \"root1\" root2 " + << "S: * QUOTA \"root1\" (STORAGE 10 512)" + << "S: * QUOTA \"root1\" ( MESSAGE 8221 20000 ) " + << "S: * QUOTA \"root2\" ( MESSAGE 100 120000 ) " + << "S: * QUOTA \"root2\" (STORAGE 30 5124)" + << "S: A000001 OK GETQUOTA completed"; + QTest::newRow( "multiple roots, multiple resource" ) << "INBOX" << roots << resources << usages << limits << scenario; + + roots.clear(); + resources.clear(); + usages.clear(); + limits.clear(); + scenario.clear(); + roots << ""; + resources << "STORAGE" << "MESSAGE"; + usages << 10 << 8221; + limits << 512 << 20000; + scenario << FakeServer::preauth() + << "C: A000001 GETQUOTAROOT \"INBOX\"" + << "S: * QUOTAROOT INBOX" + << "S: * QUOTA (STORAGE 10 512)" + << "S: * QUOTA ( MESSAGE 8221 20000 ) " + << "S: A000001 OK GETQUOTA completed"; + QTest::newRow( "no rootname, multiple resource" ) << "INBOX" << roots << resources << usages << limits << scenario; + + roots.clear(); + resources.clear(); + usages.clear(); + limits.clear(); + scenario.clear(); + roots << ""; + resources << "STORAGE"; + limits << 512; + usages << 10; + scenario << FakeServer::preauth() + << "C: A000001 GETQUOTAROOT \"INBOX\"" + << "S: * QUOTAROOT INBOX \"\" " + << "S: * QUOTA (STORAGE 10 512)" + << "S: A000001 OK GETQUOTA completed"; + QTest::newRow( "no rootname in QUOTA, one resource" ) << "INBOX" << roots << resources << usages << limits << scenario; + + roots.clear(); + resources.clear(); + usages.clear(); + limits.clear(); + scenario.clear(); + roots << ""; + resources << "STORAGE"; + limits << 512; + usages << 10; + scenario << FakeServer::preauth() + << "C: A000001 GETQUOTAROOT \"INBOX\"" + << "S: * QUOTAROOT INBOX \"root1\" " + << "S: * QUOTA \"root2\" (STORAGE 10 512)" + << "S: A000001 OK GETQUOTA completed"; + QTest::newRow( "rootname missmatch" ) << "INBOX" << roots << resources << usages << limits << scenario; +} + +void testGetQuotaRoot() +{ + QFETCH( QString, mailbox ); + QFETCH( QList<QByteArray>, roots); + QFETCH( QList<QByteArray>, resources); + QFETCH( QList<qint64>, usages); + QFETCH( QList<qint64>, limits); + QFETCH( QList<QByteArray>, scenario ); + + FakeServer fakeServer; + fakeServer.setScenario( scenario ); + fakeServer.startAndWait(); + + KIMAP::Session session("127.0.0.1", 5989); + + KIMAP::GetQuotaRootJob *job = new KIMAP::GetQuotaRootJob(&session); + job->setMailBox(mailbox); + bool result = job->exec(); + QEXPECT_FAIL("bad" , "Expected failure on BAD response", Continue); + QEXPECT_FAIL("no" , "Expected failure on NO response", Continue); + QVERIFY(result); + QEXPECT_FAIL("rootname missmatch" , "Expected failure on rootname missmatch in QUOTAROOT and QUOTA response", Abort); + QCOMPARE(job->roots(), roots); + for( int rootIdx = 0; rootIdx < roots.size() ;rootIdx++ ) { + const QByteArray& root = roots[rootIdx]; + for( int i = 0; i < resources.size(); i++ ) { + int idx = i + rootIdx * roots.size(); + QByteArray resource = resources[i]; + QCOMPARE(job->limit(root, resource), limits[idx] ); + QCOMPARE(job->usage(root, resource), usages[idx] ); + } + } + + fakeServer.quit(); +} + + +}; + +QTEST_KDEMAIN_CORE( QuotaRootJobTest ) + +#include "quotarootjobtest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kmime/kmime_content.cpp new/kdepimlibs-4.7.4/kmime/kmime_content.cpp --- old/kdepimlibs-4.7.3/kmime/kmime_content.cpp 2011-10-02 14:47:53.000000000 +0200 +++ new/kdepimlibs-4.7.4/kmime/kmime_content.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -412,7 +412,7 @@ QByteArray chset = KGlobal::locale()->encoding(); contentType()->setCharset( chset ); } - + QString s = codec->toUnicode( d_ptr->body.data(), d_ptr->body.length() ); if ( trimText || removeTrailingNewlines ) { @@ -563,10 +563,12 @@ void Content::removeContent( Content *c, bool del ) { Q_D( Content ); - if( !d->multipartContents.contains( c ) ) + if ( d->multipartContents.isEmpty() || !d->multipartContents.contains( c ) ) { return; - // This method makes no sense for encapsulated messages. Should be covered by the above - // assert already, though. + } + + // This method makes no sense for encapsulated messages. + // Should be covered by the above assert already, though. Q_ASSERT( !bodyIsMessage() ); d->multipartContents.removeAll( c ); @@ -902,26 +904,30 @@ return d_ptr->parent == 0; } -void Content::setParent( Content* parent ) +void Content::setParent( Content *parent ) { - //make sure the Content is only in the contents list of one parent object + // Make sure the Content is only in the contents list of one parent object Content *oldParent = d_ptr->parent; - if ( oldParent && oldParent->contents().contains( this ) ) { - oldParent->removeContent( this ); + if ( oldParent ) { + if ( !oldParent->contents().isEmpty() && oldParent->contents().contains( this ) ) { + oldParent->removeContent( this ); + } } d_ptr->parent = parent; - if ( parent && !parent->contents().contains( this ) ) { - parent->addContent( this ); + if ( parent ) { + if ( !parent->contents().isEmpty() && !parent->contents().contains( this ) ) { + parent->addContent( this ); + } } } -Content* Content::parent() const +Content *Content::parent() const { return d_ptr->parent; } -Content* Content::topLevel() const +Content *Content::topLevel() const { Content *top = const_cast<Content*>(this); Content *c = parent(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kmime/kmime_header_parsing.cpp new/kdepimlibs-4.7.4/kmime/kmime_header_parsing.cpp --- old/kdepimlibs-4.7.3/kmime/kmime_header_parsing.cpp 2011-05-20 22:31:23.000000000 +0200 +++ new/kdepimlibs-4.7.4/kmime/kmime_header_parsing.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -113,7 +113,13 @@ QByteArray Mailbox::address() const { - return mAddrSpec.asString().toLatin1(); + QByteArray result; + const QString asString = addr_spec_as_string( mAddrSpec, false ); + if ( !asString.isEmpty() ) { + result = asString.toLatin1(); + } + return result; + //return mAddrSpec.asString().toLatin1(); } AddrSpec Mailbox::addrSpec() const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kmime/kmime_headers.cpp new/kdepimlibs-4.7.4/kmime/kmime_headers.cpp --- old/kdepimlibs-4.7.3/kmime/kmime_headers.cpp 2011-06-22 16:28:23.000000000 +0200 +++ new/kdepimlibs-4.7.4/kmime/kmime_headers.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -206,17 +206,17 @@ bool Base::is( const char *t ) const { - return strcasecmp( t, type() ) == 0; + return qstricmp( t, type() ) == 0; } bool Base::isMimeHeader() const { - return strncasecmp( type(), "Content-", 8 ) == 0; + return qstrnicmp( type(), "Content-", 8 ) == 0; } bool Base::isXHeader() const { - return strncmp( type(), "X-", 2 ) == 0; + return qstrncmp( type(), "X-", 2 ) == 0; } QByteArray Base::typeIntro() const @@ -983,11 +983,18 @@ rv = typeIntro(); } foreach ( const Types::AddrSpec &addr, d->msgIdList ) { - rv += '<'; - rv += addr.asString().toLatin1(); // FIXME: change parsing to use QByteArrays - rv += "> "; + if ( !addr.isEmpty() ) { + const QString asString = addr.asString(); + rv += '<'; + if ( !asString.isEmpty() ) { + rv += asString.toLatin1(); // FIXME: change parsing to use QByteArrays + } + rv += "> "; + } + } + if ( !rv.isEmpty() ) { + rv.resize( rv.length() - 1 ); } - rv.resize( rv.length() - 1 ); return rv; } @@ -1051,7 +1058,12 @@ { QList<QByteArray> rv; foreach ( const Types::AddrSpec &addr, d_func()->msgIdList ) { - rv.append( addr.asString().toLatin1() ); // FIXME change parsing to create QByteArrays + if ( !addr.isEmpty() ) { + const QString asString = addr.asString(); + if ( !asString.isEmpty() ) { + rv.append( asString.toLatin1() ); // FIXME: change parsing to use QByteArrays + } + } } return rv; } @@ -1092,7 +1104,12 @@ if ( d_func()->cachedIdentifier.isEmpty() ) { const Types::AddrSpec &addr = d_func()->msgIdList.first(); - d_func()->cachedIdentifier = addr.asString().toLatin1(); // FIXME change parsing to create QByteArrays + if ( !addr.isEmpty() ) { + const QString asString = addr.asString(); + if ( !asString.isEmpty() ) { + d_func()->cachedIdentifier = asString.toLatin1();// FIXME: change parsing to use QByteArrays + } + } } return d_func()->cachedIdentifier; @@ -1767,7 +1784,7 @@ { Q_D(const ContentType); const int len = strlen( mediatype ); - return strncasecmp( d->mimeType.constData(), mediatype, len ) == 0 && (d->mimeType.at(len) == '/' || d->mimeType.size() == len); + return qstrnicmp( d->mimeType.constData(), mediatype, len ) == 0 && (d->mimeType.at(len) == '/' || d->mimeType.size() == len); } bool ContentType::isSubtype( const char *subtype ) const @@ -1777,7 +1794,7 @@ if ( pos < 0 ) return false; const int len = strlen( subtype ); - return strncasecmp( d->mimeType.constData() + pos + 1, subtype, len ) == 0 && d->mimeType.size() == pos + len + 1; + return qstrnicmp( d->mimeType.constData() + pos + 1, subtype, len ) == 0 && d->mimeType.size() == pos + len + 1; } bool ContentType::isText() const @@ -1787,12 +1804,12 @@ bool ContentType::isPlainText() const { - return ( strcasecmp( d_func()->mimeType.constData(), "text/plain" ) == 0 || isEmpty() ); + return ( qstricmp( d_func()->mimeType.constData(), "text/plain" ) == 0 || isEmpty() ); } bool ContentType::isHTMLText() const { - return strcasecmp( d_func()->mimeType.constData(), "text/html" ) == 0; + return qstricmp( d_func()->mimeType.constData(), "text/html" ) == 0; } bool ContentType::isImage() const @@ -1807,7 +1824,7 @@ bool ContentType::isPartial() const { - return strcasecmp( d_func()->mimeType.constData(), "message/partial" ) == 0; + return qstricmp( d_func()->mimeType.constData(), "message/partial" ) == 0; } QByteArray ContentType::charset() const @@ -2119,7 +2136,7 @@ // TODO: error handling in case of an unknown encoding? for ( int i = 0; encTable[i].s != 0; ++i ) { - if ( strcasecmp( token().constData(), encTable[i].s ) == 0 ) { + if ( qstricmp( token().constData(), encTable[i].s ) == 0 ) { d->cte = ( contentEncoding )encTable[i].e; break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kmime/kmime_util.cpp new/kdepimlibs-4.7.4/kmime/kmime_util.cpp --- old/kdepimlibs-4.7.3/kmime/kmime_util.cpp 2011-05-20 22:31:23.000000000 +0200 +++ new/kdepimlibs-4.7.4/kmime/kmime_util.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -430,7 +430,7 @@ if ( str.isEmpty() ) return QByteArray(); - + const QTextCodec *codec = KGlobal::charsets()->codecForName( QString::fromLatin1( charset ) ); QByteArray latin; if ( charset == "us-ascii" ) @@ -487,11 +487,11 @@ int p = str.indexOf('\''); if (p < 0) return KGlobal::charsets()->codecForName( QString::fromLatin1( defaultCS ))->toUnicode( str ); - + QByteArray charset = str.left(p); QByteArray st = str.mid( str.lastIndexOf('\'') + 1 ); - + char ch, ch2; p = 0; while (p < (int)st.length()) @@ -564,6 +564,10 @@ QByteArray unfoldHeader( const QByteArray &header ) { QByteArray result; + if ( header.isEmpty() ) { + return result; + } + int pos = 0, foldBegin = 0, foldMid = 0, foldEnd = 0; while ( ( foldMid = header.indexOf( '\n', pos ) ) >= 0 ) { foldBegin = foldEnd = foldMid; @@ -598,7 +602,10 @@ result += ' '; pos = foldEnd; } - result += header.mid( pos, header.length() - pos ); + const int len = header.length(); + if ( len > pos ) { + result += header.mid( pos, len - pos ); + } return result; } @@ -687,6 +694,7 @@ return begin; } else { + end = -1; dataBegin = -1; return -1; //header not found } @@ -696,18 +704,23 @@ { int begin, end; bool folded; - indexOfHeader( src, name, end, begin, &folded ); + QByteArray result; + + if ( src.isEmpty() || indexOfHeader( src, name, end, begin, &folded ) < 0 ) { + return result; + } if ( begin >= 0 ) { if ( !folded ) { - return src.mid( begin, end - begin ); + result = src.mid( begin, end - begin ); } else { - QByteArray hdrValue = src.mid( begin, end - begin ); - return unfoldHeader( hdrValue ); + if ( end > begin ) { + QByteArray hdrValue = src.mid( begin, end - begin ); + result = unfoldHeader( hdrValue ); + } } - } else { - return QByteArray(); //header not found } + return result; } QList<QByteArray> extractHeaders( const QByteArray &src, const QByteArray &name ) @@ -717,7 +730,10 @@ QList<QByteArray> result; QByteArray copySrc( src ); - indexOfHeader( copySrc, name, end, begin, &folded ); + if ( indexOfHeader( copySrc, name, end, begin, &folded ) < 0 ) { + return result; + } + while ( begin >= 0 ) { if ( !folded ) { result.append( copySrc.mid( begin, end - begin ) ); @@ -728,7 +744,9 @@ // get the next one, a tiny bit ugly, but we don't want the previous to be found again... copySrc = copySrc.mid( end ); - indexOfHeader( copySrc, name, end, begin, &folded ); + if ( indexOfHeader( copySrc, name, end, begin, &folded ) < 0 ) { + break; + } } return result; @@ -933,7 +951,7 @@ return true; } } - + return false; } @@ -965,7 +983,7 @@ const KMime::Headers::ContentType* const contentType = message->contentType(); if ( contentType->isSubtype( "encrypted" ) || contentType->isSubtype( "pgp-encrypted" ) || - contentType->isSubtype( "pkcs7-mime" ) || + contentType->isSubtype( "pkcs7-mime" ) || message->mainBodyPart( "multipart/encrypted" ) || message->mainBodyPart( "application/pgp-encrypted" ) || message->mainBodyPart( "application/pkcs7-mime" ) ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/kpimidentities/identitymanager.cpp new/kdepimlibs-4.7.4/kpimidentities/identitymanager.cpp --- old/kdepimlibs-4.7.3/kpimidentities/identitymanager.cpp 2011-05-20 22:31:23.000000000 +0200 +++ new/kdepimlibs-4.7.4/kpimidentities/identitymanager.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -60,7 +60,7 @@ : QObject( parent ) { setObjectName( name ); - KGlobal::locale()->insertCatalog("libkpimidentities"); + KGlobal::locale()->insertCatalog( "libkpimidentities" ); new IdentityManagerAdaptor( this ); QDBusConnection dbus = QDBusConnection::sessionBus(); const QString dbusPath = newDBusObjectName(); @@ -173,8 +173,9 @@ emit changed(); // normal signal // DBus signal for other IdentityManager instances - const QString ourIdentifier = QString::fromLatin1( "%1/%2" ).arg( QDBusConnection::sessionBus().baseService() ) - .arg( property( "uniqueDBusPath" ).toString() ); + const QString ourIdentifier = QString::fromLatin1( "%1/%2" ). + arg( QDBusConnection::sessionBus().baseService() ). + arg( property( "uniqueDBusPath" ).toString() ); emit identitiesChanged( ourIdentifier ); } @@ -262,6 +263,7 @@ mIdentities.last().setIsDefault( true ); } } + if ( !haveDefault ) { kWarning( 5325 ) << "IdentityManager: There was no default identity." << "Marking first one as default."; @@ -325,8 +327,9 @@ const QString addrSpec = KPIMUtils::extractEmailAddress( fullAddress ).toLower(); for ( ConstIterator it = begin(); it != end(); ++it ) { const Identity &identity = *it; - if ( identity.matchesEmailAddress( addrSpec ) ) + if ( identity.matchesEmailAddress( addrSpec ) ) { return identity; + } } } return Identity::null(); @@ -373,10 +376,11 @@ } } - if ( mIdentities.isEmpty() ) - kFatal( 5325 ) << "IdentityManager: No default identity found!"; - else - kWarning( 5325 ) << "IdentityManager: No default identity found!"; + if ( mIdentities.isEmpty() ) { + kFatal( 5325 ) << "IdentityManager: No default identity found!"; + } else { + kWarning( 5325 ) << "IdentityManager: No default identity found!"; + } return *begin(); } @@ -407,14 +411,15 @@ bool IdentityManager::removeIdentity( const QString &name ) { - if ( mShadowIdentities.size() <= 1 ) + if ( mShadowIdentities.size() <= 1 ) { return false; + } for ( Iterator it = modifyBegin(); it != modifyEnd(); ++it ) { if ( (*it).identityName() == name ) { bool removedWasDefault = (*it).isDefault(); mShadowIdentities.erase( it ); - if ( removedWasDefault ) { + if ( removedWasDefault && !mShadowIdentities.isEmpty() ) { mShadowIdentities.first().setIsDefault( true ); } return true; @@ -456,8 +461,7 @@ es.getSetting( KEMailSettings::ReplyToAddress ) ) ); } -Identity &IdentityManager::newFromExisting( const Identity &other, - const QString &name ) +Identity &IdentityManager::newFromExisting( const Identity &other, const QString &name ) { mShadowIdentities << other; Identity &result = mShadowIdentities.last(); @@ -575,8 +579,9 @@ QStringList lst; for ( ConstIterator it = begin(); it != end(); ++it ) { lst << (*it).primaryEmailAddress(); - if ( !(*it).emailAliases().isEmpty() ) + if ( !(*it).emailAliases().isEmpty() ) { lst << (*it).emailAliases(); + } } return lst; } @@ -589,8 +594,9 @@ void KPIMIdentities::IdentityManager::slotIdentitiesChanged( const QString &id ) { kDebug( 5325 ) <<" KPIMIdentities::IdentityManager::slotIdentitiesChanged :" << id; - const QString ourIdentifier = QString::fromLatin1( "%1/%2" ).arg( QDBusConnection::sessionBus().baseService() ) - .arg( property( "uniqueDBusPath" ).toString() ); + const QString ourIdentifier = QString::fromLatin1( "%1/%2" ). + arg( QDBusConnection::sessionBus().baseService() ). + arg( property( "uniqueDBusPath" ).toString() ); if ( id != ourIdentifier ) { mConfig->reparseConfiguration(); Q_ASSERT( !hasPendingChanges() ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/mailtransport/outboxactions.cpp new/kdepimlibs-4.7.4/mailtransport/outboxactions.cpp --- old/kdepimlibs-4.7.3/mailtransport/outboxactions.cpp 2011-05-20 22:31:23.000000000 +0200 +++ new/kdepimlibs-4.7.4/mailtransport/outboxactions.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -47,6 +47,7 @@ ItemFetchScope scope; scope.fetchFullPayload( false ); scope.fetchAttribute<DispatchModeAttribute>(); + scope.fetchAttribute<ErrorAttribute>(); scope.setCacheOnly( true ); return scope; } @@ -65,6 +66,10 @@ { Item cp = item; cp.addAttribute( new DispatchModeAttribute ); // defaults to Automatic + if( cp.hasAttribute<ErrorAttribute>() ) { + cp.removeAttribute<ErrorAttribute>(); + cp.clearFlag( Akonadi::MessageFlags::HasError ); + } return new ItemModifyJob( cp, parent ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.7.3/mailtransport/smtpjob.cpp new/kdepimlibs-4.7.4/mailtransport/smtpjob.cpp --- old/kdepimlibs-4.7.3/mailtransport/smtpjob.cpp 2011-05-20 22:31:23.000000000 +0200 +++ new/kdepimlibs-4.7.4/mailtransport/smtpjob.cpp 2011-12-02 00:24:33.000000000 +0100 @@ -123,7 +123,8 @@ return; } - if ( s_slavePool->slaves.contains( transport()->id() ) || + if ( ( !s_slavePool->slaves.isEmpty() && + s_slavePool->slaves.contains( transport()->id() ) ) || transport()->precommand().isEmpty() ) { d->currentState = SmtpJobPrivate::Smtp; startSmtpJob(); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
