Hello community, here is the log from the commit of package kdepimlibs4 for openSUSE:Factory checked in at Tue May 17 13:12:40 CEST 2011.
-------- --- KDE/kdepimlibs4/kdepimlibs4.changes 2011-04-01 17:56:27.000000000 +0200 +++ kdepimlibs4/kdepimlibs4.changes 2011-04-28 18:14:11.000000000 +0200 @@ -1,0 +2,8 @@ +Thu Apr 28 18:14:09 CEST 2011 - [email protected] + +- update to 4.6.3 + * Bugfixes over KDE 4.6.2 + * see http://kde.org/announcements/changelogs/changelog4_6_2to4_6_3.php for details + + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- kdepimlibs-4.6.2.tar.bz2 New: ---- kdepimlibs-4.6.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdepimlibs4.spec ++++++ --- /var/tmp/diff_new_pack.UV5NCO/_old 2011-05-17 13:11:13.000000000 +0200 +++ /var/tmp/diff_new_pack.UV5NCO/_new 2011-05-17 13:11:13.000000000 +0200 @@ -18,7 +18,7 @@ Name: kdepimlibs4 -Version: 4.6.2 +Version: 4.6.3 Release: 1 License: LGPLv2.1+ Summary: KDE PIM Libraries ++++++ kdepimlibs-4.6.2.tar.bz2 -> kdepimlibs-4.6.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/CMakeLists.txt new/kdepimlibs-4.6.3/CMakeLists.txt --- old/kdepimlibs-4.6.2/CMakeLists.txt 2011-03-31 21:40:40.000000000 +0200 +++ new/kdepimlibs-4.6.3/CMakeLists.txt 2011-04-28 15:18:42.000000000 +0200 @@ -7,7 +7,7 @@ ############### The kdepimlibs version (used e.g. in KdepimLibsConfig.cmake) ############### set(KDEPIMLIBS_VERSION_MAJOR 4) set(KDEPIMLIBS_VERSION_MINOR 6) -set(KDEPIMLIBS_VERSION_PATCH 2) +set(KDEPIMLIBS_VERSION_PATCH 3) 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.6.2/akonadi/agentbase.cpp new/kdepimlibs-4.6.3/akonadi/agentbase.cpp --- old/kdepimlibs-4.6.2/akonadi/agentbase.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/agentbase.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -514,13 +514,10 @@ kDebug() << "Identifier argument missing"; exit( 1 ); } - - QByteArray catalog; - char *p = strrchr( argv[0], '/' ); - if ( p ) - catalog = QByteArray( p + 1 ); - else - catalog = QByteArray( argv[0] ); + + const QFileInfo fi( QString::fromLocal8Bit( argv[0] ) ); + // strip off full path and possible .exe suffix + const QByteArray catalog = fi.baseName().toLatin1(); KCmdLineArgs::init( argc, argv, identifier.toLatin1(), catalog, ki18n( "Akonadi Agent" ), "0.1", ki18n( "Akonadi Agent" ) ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/agentbase_p.h new/kdepimlibs-4.6.3/akonadi/agentbase_p.h --- old/kdepimlibs-4.6.2/akonadi/agentbase_p.h 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/agentbase_p.h 2011-04-28 15:15:25.000000000 +0200 @@ -96,18 +96,18 @@ AgentBase::Observer *mObserver; protected Q_SLOTS: - void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection ); - void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers ); - void itemMoved( const Akonadi::Item &, const Akonadi::Collection &source, const Akonadi::Collection &destination ); - void itemRemoved( const Akonadi::Item &item ); + virtual void itemAdded( const Akonadi::Item &item, const Akonadi::Collection &collection ); + virtual void itemChanged( const Akonadi::Item &item, const QSet<QByteArray> &partIdentifiers ); + virtual void itemMoved( const Akonadi::Item &, const Akonadi::Collection &source, const Akonadi::Collection &destination ); + virtual void itemRemoved( const Akonadi::Item &item ); void itemLinked( const Akonadi::Item &item, const Akonadi::Collection &collection ); void itemUnlinked( const Akonadi::Item &item, const Akonadi::Collection &collection ); - void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent ); - void collectionChanged( const Akonadi::Collection &collection ); - void collectionChanged( const Akonadi::Collection &collection, const QSet<QByteArray> &partIdentifiers ); - void collectionMoved( const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination ); - void collectionRemoved( const Akonadi::Collection &collection ); + virtual void collectionAdded( const Akonadi::Collection &collection, const Akonadi::Collection &parent ); + virtual void collectionChanged( const Akonadi::Collection &collection ); + virtual void collectionChanged( const Akonadi::Collection &collection, const QSet<QByteArray> &partIdentifiers ); + virtual void collectionMoved( const Akonadi::Collection &collection, const Akonadi::Collection &source, const Akonadi::Collection &destination ); + virtual void collectionRemoved( const Akonadi::Collection &collection ); void collectionSubscribed( const Akonadi::Collection &collection, const Akonadi::Collection &parent ); void collectionUnsubscribed( const Akonadi::Collection &collection ); }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/contact/editor/im/kaddressbookimprotocol.desktop new/kdepimlibs-4.6.3/akonadi/contact/editor/im/kaddressbookimprotocol.desktop --- old/kdepimlibs-4.6.2/akonadi/contact/editor/im/kaddressbookimprotocol.desktop 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/contact/editor/im/kaddressbookimprotocol.desktop 2011-04-28 15:15:25.000000000 +0200 @@ -27,6 +27,7 @@ Name[pt]=Protocolo de Mensagens Instantâneas do KAddressbook Name[pt_BR]=Protocolo de Mensagens Instantâneas do KAddressbook Name[ro]=Protocol de mesagerie instantanee a cărții de adrese +Name[ru]=Протокол обмена мгновенными сообщениями KAddressBook Name[sr]=Брзогласнички протокол К‑адресра Name[sr@ijekavian]=Брзогласнички протокол К‑адресра Name[sr@ijekavianlatin]=Brzoglasnički protokol K‑adresra diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/contact/editor/im/protocols/smsprotocol.desktop new/kdepimlibs-4.6.3/akonadi/contact/editor/im/protocols/smsprotocol.desktop --- old/kdepimlibs-4.6.2/akonadi/contact/editor/im/protocols/smsprotocol.desktop 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/contact/editor/im/protocols/smsprotocol.desktop 2011-04-28 15:15:25.000000000 +0200 @@ -29,6 +29,7 @@ Comment[pt]=Protocolo SMS Comment[pt_BR]=Protocolo SMS Comment[ro]=Protocol SMS +Comment[ru]=Протокол SMS Comment[sl]=Protokol SMS Comment[sr]=Протокол СМС Comment[sr@ijekavian]=Протокол СМС diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/entitytreemodel.h new/kdepimlibs-4.6.3/akonadi/entitytreemodel.h --- old/kdepimlibs-4.6.2/akonadi/entitytreemodel.h 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/entitytreemodel.h 2011-04-28 15:15:25.000000000 +0200 @@ -631,6 +631,7 @@ Q_PRIVATE_SLOT( d_func(), void monitoredMimeTypeChanged( const QString&, bool ) ) Q_PRIVATE_SLOT( d_func(), void monitoredCollectionsChanged( const Akonadi::Collection&, bool ) ) + Q_PRIVATE_SLOT( d_func(), void monitoredResourcesChanged( const QByteArray&, bool ) ) Q_PRIVATE_SLOT( d_func(), void monitoredCollectionAdded( const Akonadi::Collection&, const Akonadi::Collection& ) ) Q_PRIVATE_SLOT( d_func(), void monitoredCollectionRemoved( const Akonadi::Collection& ) ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/entitytreemodel_p.cpp new/kdepimlibs-4.6.3/akonadi/entitytreemodel_p.cpp --- old/kdepimlibs-4.6.2/akonadi/entitytreemodel_p.cpp 2011-04-01 20:29:03.000000000 +0200 +++ new/kdepimlibs-4.6.3/akonadi/entitytreemodel_p.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -115,6 +115,8 @@ SLOT( monitoredMimeTypeChanged( const QString&, bool ) ) ); q->connect( monitor, SIGNAL( collectionMonitored(Akonadi::Collection,bool)), SLOT( monitoredCollectionsChanged( const Akonadi::Collection&, bool ) ) ); + q->connect( monitor, SIGNAL( resourceMonitored(QByteArray,bool)), + SLOT( monitoredResourcesChanged( const QByteArray&, bool ) ) ); // monitor collection changes q->connect( monitor, SIGNAL( collectionChanged( const Akonadi::Collection& ) ), @@ -516,6 +518,14 @@ Q_UNUSED(monitored) beginResetModel(); endResetModel(); +} + +void EntityTreeModelPrivate::monitoredResourcesChanged(const QByteArray& resource, bool monitored) +{ + Q_UNUSED(resource) + Q_UNUSED(monitored) + beginResetModel(); + endResetModel(); } void EntityTreeModelPrivate::retrieveAncestors( const Akonadi::Collection& collection ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/entitytreemodel_p.h new/kdepimlibs-4.6.3/akonadi/entitytreemodel_p.h --- old/kdepimlibs-4.6.2/akonadi/entitytreemodel_p.h 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/entitytreemodel_p.h 2011-04-28 15:15:25.000000000 +0200 @@ -103,7 +103,8 @@ void monitoredItemUnlinked( const Akonadi::Item&, const Akonadi::Collection& ); void monitoredMimeTypeChanged( const QString &mimeType, bool monitored ); - void monitoredCollectionsChanged( const Akonadi::Collection &colllection, bool monitored ); + void monitoredCollectionsChanged( const Akonadi::Collection &collection, bool monitored ); + void monitoredResourcesChanged( const QByteArray &resource, bool monitored ); Collection::List getParentCollections( const Item &item ) const; Collection getParentCollection( const Collection &collection ) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/entitytreeview.cpp new/kdepimlibs-4.6.3/akonadi/entitytreeview.cpp --- old/kdepimlibs-4.6.2/akonadi/entitytreeview.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/entitytreeview.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -124,6 +124,12 @@ mParent->model()->fetchMore( index.sibling( row, column ) ); } } + + if ( selected.size() == 1 ) { + const QItemSelectionRange &range = selected.first(); + if ( range.topLeft().row() == range.bottomRight().row() ) + mParent->scrollTo( range.topLeft(), QTreeView::EnsureVisible ); + } } void EntityTreeView::Private::itemClicked( const QModelIndex &index ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/item.h new/kdepimlibs-4.6.3/akonadi/item.h --- old/kdepimlibs-4.6.2/akonadi/item.h 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/item.h 2011-04-28 15:15:25.000000000 +0200 @@ -405,6 +405,7 @@ //@cond PRIVATE friend class ItemCreateJob; friend class ItemModifyJob; + friend class ItemSync; friend class ProtocolHelper; PayloadBase* payloadBase() const; void setPayloadBase( PayloadBase* ); @@ -447,7 +448,7 @@ template <typename T> typename boost::disable_if<Internal::is_shared_pointer<T>,bool>::type tryToClone( T * ) const; - + /** * Set the collection ID to where the item is stored in. Should be set only by the ItemFetchJob. * @param collectionId the unique identifier of the the collection where this item is stored in. @@ -650,7 +651,7 @@ template <typename T> void Item::setPayload( T* p ) { - p.You_MUST_NOT_use_a_pointer_as_payload; + p->You_MUST_NOT_use_a_pointer_as_payload; } template <typename T> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/itemsync.cpp new/kdepimlibs-4.6.3/akonadi/itemsync.cpp --- old/kdepimlibs-4.6.2/akonadi/itemsync.cpp 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/itemsync.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -22,6 +22,7 @@ #include "collection.h" #include "item.h" +#include "item_p.h" #include "itemcreatejob.h" #include "itemdeletejob.h" #include "itemfetchjob.h" @@ -215,6 +216,13 @@ if ( d->mIncremental ) return true; + if ( newItem.d_func()->mClearPayload ) + return true; + + // Check whether the remote revisions differ + if ( storedItem.remoteRevision() != newItem.remoteRevision() ) + return true; + // Check whether the flags differ if ( storedItem.flags() != newItem.flags() ) { kDebug() << "Stored flags " << storedItem.flags() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/kmime/standardmailactionmanager.cpp new/kdepimlibs-4.6.3/akonadi/kmime/standardmailactionmanager.cpp --- old/kdepimlibs-4.6.2/akonadi/kmime/standardmailactionmanager.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/kmime/standardmailactionmanager.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -570,6 +570,7 @@ action->setIcon( KIcon( QLatin1String( "mail-mark-unread" ) ) ); d->mActions.insert( MarkMailAsUnread, action ); d->mActionCollection->addAction( QString::fromLatin1( "akonadi_mark_as_unread" ), action ); + action->setShortcut( Qt::CTRL+Qt::Key_U ); action->setData( QByteArray( "U" ) ); connect( action, SIGNAL( triggered( bool ) ), this, SLOT( slotMarkAs() ) ); break; @@ -610,7 +611,6 @@ action->setIcon( KIcon( QLatin1String( "mail-mark-unread" ) ) ); d->mActions.insert( MarkAllMailAsUnread, action ); d->mActionCollection->addAction( QString::fromLatin1( "akonadi_mark_all_as_unread" ), action ); - action->setShortcut( Qt::CTRL+Qt::Key_U ); action->setData( QByteArray( "U" ) ); connect( action, SIGNAL( triggered( bool ) ), this, SLOT( slotMarkAllAs() ) ); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/monitor_p.cpp new/kdepimlibs-4.6.3/akonadi/monitor_p.cpp --- old/kdepimlibs-4.6.2/akonadi/monitor_p.cpp 2011-04-01 20:29:03.000000000 +0200 +++ new/kdepimlibs-4.6.3/akonadi/monitor_p.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -217,16 +217,18 @@ void MonitorPrivate::cleanOldNotifications() { - foreach ( const NotificationMessage &msg, pipeline ) { - if ( !acceptNotification( msg ) ) { - pipeline.removeOne( msg ); - } + for ( NotificationMessage::List::iterator it = pipeline.begin(); it != pipeline.end(); ) { + if ( !acceptNotification( *it ) ) + it = pipeline.erase( it ); + else + ++it; } - foreach ( const NotificationMessage &msg, pendingNotifications ) { - if ( !acceptNotification( msg ) ) { - pendingNotifications.removeOne( msg ); - } + for ( NotificationMessage::List::iterator it = pendingNotifications.begin(); it != pendingNotifications.end(); ) { + if ( !acceptNotification( *it ) ) + it = pendingNotifications.erase( it ); + else + ++it; } } @@ -259,15 +261,19 @@ if ( msg.operation() == NotificationMessage::Move ) destParent = collectionCache.retrieve( msg.parentDestCollection() ); + bool someoneWasListening = false; if ( msg.type() == NotificationMessage::Collection ) { const Collection col = collectionCache.retrieve( msg.uid() ); - return emitCollectionNotification( msg, col, parent, destParent ); + someoneWasListening = emitCollectionNotification( msg, col, parent, destParent ); } else if ( msg.type() == NotificationMessage::Item ) { const Item item = itemCache.retrieve( msg.uid() ); - return emitItemNotification( msg, item, parent, destParent ); + someoneWasListening = emitItemNotification( msg, item, parent, destParent ); } - return false; // nothing emitted + if ( !someoneWasListening ) + cleanOldNotifications(); // probably someone disconnected a signal in the meantime, get rid of the no longer interesting stuff + + return someoneWasListening; } void MonitorPrivate::dataAvailable() @@ -409,6 +415,15 @@ it.setParentCollection( colDest ); else it.setParentCollection( col ); + } else { + // item has a valid parent collection, most likely due to retrieved ancestors + // still, collection might contain extra info, so inject that + if ( it.parentCollection() == col ) { + const Collection oldParent = it.parentCollection(); + if ( oldParent.parentCollection().isValid() && !col.parentCollection().isValid() ) + col.setParentCollection( oldParent.parentCollection() ); // preserve ancestor chain + it.setParentCollection( col ); + } } // HACK: We have the remoteRevision stored in the itemParts set diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/resourcebase.cpp new/kdepimlibs-4.6.3/akonadi/resourcebase.cpp --- old/kdepimlibs-4.6.2/akonadi/resourcebase.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/akonadi/resourcebase.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -171,6 +171,95 @@ scheduler->clear(); } + protected Q_SLOTS: + // reimplementations from AgentbBasePrivate, containing sanity checks that only apply to resources + // such as making sure that RIDs are present as well as translations of cross-resource moves + // TODO: we could possibly add recovery code for no-RID notifications by re-enquing those to the change recorder + // as the corresponding Add notifications, although that contains a risk of endless fail/retry loops + + void itemAdded(const Akonadi::Item& item, const Akonadi::Collection& collection) + { + if ( collection.remoteId().isEmpty() ) { + changeProcessed(); + return; + } + AgentBasePrivate::itemAdded( item, collection ); + } + + void itemChanged(const Akonadi::Item& item, const QSet< QByteArray >& partIdentifiers) + { + if ( item.remoteId().isEmpty() ) { + changeProcessed(); + return; + } + AgentBasePrivate::itemChanged( item, partIdentifiers ); + } + + // TODO move the move translation code from AgebtBasePrivate here, it's wrong for agents + void itemMoved(const Akonadi::Item &item, const Akonadi::Collection &source, const Akonadi::Collection &destination) + { + if ( item.remoteId().isEmpty() || destination.remoteId().isEmpty() || destination == source ) { + changeProcessed(); + return; + } + AgentBasePrivate::itemMoved( item, source, destination ); + } + + void itemRemoved(const Akonadi::Item& item) + { + if ( item.remoteId().isEmpty() ) { + changeProcessed(); + return; + } + AgentBasePrivate::itemRemoved( item ); + } + + void collectionAdded(const Akonadi::Collection& collection, const Akonadi::Collection& parent) + { + if ( parent.remoteId().isEmpty() ) { + changeProcessed(); + return; + } + AgentBasePrivate::collectionAdded( collection, parent ); + } + + void collectionChanged(const Akonadi::Collection& collection) + { + if ( collection.remoteId().isEmpty() ) { + changeProcessed(); + return; + } + AgentBasePrivate::collectionChanged( collection ); + } + + void collectionChanged(const Akonadi::Collection& collection, const QSet< QByteArray >& partIdentifiers) + { + if ( collection.remoteId().isEmpty() ) { + changeProcessed(); + return; + } + AgentBasePrivate::collectionChanged( collection, partIdentifiers ); + } + + // TODO move the move translation code from AgebtBasePrivate here, it's wrong for agents + void collectionMoved(const Akonadi::Collection& collection, const Akonadi::Collection& source, const Akonadi::Collection& destination) + { + if ( collection.remoteId().isEmpty() || destination.remoteId().isEmpty() || source == destination ) { + changeProcessed(); + return; + } + AgentBasePrivate::collectionMoved( collection, source, destination ); + } + + void collectionRemoved(const Akonadi::Collection& collection) + { + if ( collection.remoteId().isEmpty() ) { + changeProcessed(); + return; + } + AgentBasePrivate::collectionRemoved( collection ); + } + public: // synchronize states Collection currentCollection; @@ -200,6 +289,7 @@ d->scheduler, SLOT( scheduleChangeReplay() ) ); d->mChangeRecorder->setResourceMonitored( d->mId.toLatin1() ); + d->mChangeRecorder->fetchCollection( true ); connect( d->scheduler, SIGNAL( executeFullSync() ), SLOT( retrieveCollections() ) ); @@ -277,12 +367,9 @@ exit( 1 ); } - QByteArray catalog; - char *p = strrchr( argv[0], '/' ); - if ( p ) - catalog = QByteArray( p + 1 ); - else - catalog = QByteArray( argv[0] ); + const QFileInfo fi( QString::fromLocal8Bit( argv[0] ) ); + // strip off full path and possible .exe suffix + const QByteArray catalog = fi.baseName().toLatin1(); KCmdLineArgs::init( argc, argv, identifier.toLatin1(), catalog, ki18nc( "@title application name", "Akonadi Resource" ), "0.1", @@ -299,6 +386,7 @@ int ResourceBase::init( ResourceBase *r ) { QApplication::setQuitOnLastWindowClosed( false ); + KGlobal::locale()->insertCatalog( QLatin1String( "libakonadi" ) ); int rv = kapp->exec(); delete r; return rv; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/akonadi/transactionsequence.h new/kdepimlibs-4.6.3/akonadi/transactionsequence.h --- old/kdepimlibs-4.6.2/akonadi/transactionsequence.h 2011-03-31 21:40:40.000000000 +0200 +++ new/kdepimlibs-4.6.3/akonadi/transactionsequence.h 2011-04-28 15:15:25.000000000 +0200 @@ -107,7 +107,7 @@ /** * Disable automatic committing. * Use this when you want to add jobs to this sequence after execution - * has been started, usually that is outside of the contstructor or the + * has been started, usually that is outside of the constructor or the * method that creates this transaction sequence. * @note Calling this method after execution of this job has been started * has no effect. Files old/kdepimlibs-4.6.2/doc/kcontrol/kresources/index.cache.bz2 and new/kdepimlibs-4.6.3/doc/kcontrol/kresources/index.cache.bz2 differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kabc/plugins/dir/dir.desktop new/kdepimlibs-4.6.3/kabc/plugins/dir/dir.desktop --- old/kdepimlibs-4.6.2/kabc/plugins/dir/dir.desktop 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kabc/plugins/dir/dir.desktop 2011-04-28 15:15:25.000000000 +0200 @@ -38,7 +38,7 @@ Name[sr@latin]=Fascikla Name[sv]=Katalog Name[th]=โฟลเดอร์ -Name[tr]=Dizin +Name[tr]=Klasör Name[uk]=Тека Name[wa]=Ridant Name[x-test]=xxFolderxx @@ -81,7 +81,7 @@ Comment[sr@latin]=Pruža pristup kontaktima skladištenim u pojedinačnim fajlovima u datoj fascikli. Podržava standardne vCard fajlove i druge formate, prema raspoloživim priključcima. Comment[sv]=Ger tillgång till kontakter, var och en lagrad i en enstaka fil, i en given katalog. Stöder vCard-standardfiler och andra format, beroende på tillgängliga insticksprogram. Comment[th]=จัดเตรียมส่วนเข้าใช้งานที่อยู่ติดต่อต่าง ๆ ที่แต่ละอันถูกจัดเก็บไว้ในแฟ้มเดี่ยวภายในระบบ ภายในโฟลเดอร์ที่กำหนดให้ รองรับแฟ้มมาตรฐาน VCard และรูปแบบอื่น ๆ โดยขึ้นอยู่กับส่วนเสริมต่าง ๆ ที่ถูกติดตั้งไว้ -Comment[tr]=Verilen bir dizin içerisindeki her biri bir dosya içerisinde bulunan kişilere erişmeyi sağlar. VCard dosyalarını ve eklentilere uygun diğer biçimleri destekler. +Comment[tr]=Verilen bir klasör içerisindeki her biri bir dosya içerisinde bulunan kişilere erişmeyi sağlar. VCard dosyalarını ve eklentilere uygun diğer biçimleri destekler. Comment[uk]=Надає доступ до контактів, кожен з яких зберігається у окремому файлі у вказаній теці. Підтримує стандартні файли VCard та файли у інших форматах, залежно від наявності відповідних додатків. Comment[wa]=Permet d' moussî dins les contaks, tchaeconk estant wårdé dins ene seule fitche, dins on ridant di dné. Sopoite les fitchîs VCard sitandårds eyet d' ôtès cognes sorlon çou k' vos avoz come tchôkes-divins. Comment[x-test]=xxProvides access to contacts, each stored in a single file, in a given folder. Supports standard VCard file and other formats depending on availability of plugins.xx diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kcalcore/event.cpp new/kdepimlibs-4.6.3/kcalcore/event.cpp --- old/kdepimlibs-4.6.2/kcalcore/event.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/kcalcore/event.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -210,7 +210,7 @@ end = end.addSecs( -1 ); } - bool multi = ( start.date() != end.date() && start <= end ); + const bool multi = ( start.date() != end.date() && start <= end ); // Update the cache if ( spec.isValid() ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kcalcore/event.h new/kdepimlibs-4.6.3/kcalcore/event.h --- old/kdepimlibs-4.6.2/kcalcore/event.h 2011-03-31 21:40:40.000000000 +0200 +++ new/kdepimlibs-4.6.3/kcalcore/event.h 2011-04-28 15:15:25.000000000 +0200 @@ -140,6 +140,10 @@ /** Returns true if the event spans multiple days, otherwise return false. + For recurring events, it returns true if the first occurrence spans multiple days, + otherwise returns false. Other occurrences might have a different span due to day light + savings changes. + @param spec If set, looks if the event is multiday for the given spec. If not set, looks if event this multiday for its spec. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kcalutils/incidenceformatter.cpp new/kdepimlibs-4.6.3/kcalutils/incidenceformatter.cpp --- old/kdepimlibs-4.6.2/kcalutils/incidenceformatter.cpp 2011-03-31 21:40:40.000000000 +0200 +++ new/kdepimlibs-4.6.3/kcalutils/incidenceformatter.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -3564,7 +3564,7 @@ // Show the attendee status if the incidence's organizer owns the resource calendar, // which means they are running the show and have all the up-to-date response info. - bool showStatus = incOrganizerOwnsCalendar( calendar, incidence ); + const bool showStatus = attendeeCount > 0 && incOrganizerOwnsCalendar( calendar, incidence ); // Add "chair" str = tooltipFormatAttendeeRoleList( incidence, Attendee::Chair, showStatus ); @@ -3879,72 +3879,74 @@ if ( !incidence->recurs() ) { return i18n( "No recurrence" ); } - QStringList dayList; - dayList.append( i18n( "31st Last" ) ); - dayList.append( i18n( "30th Last" ) ); - dayList.append( i18n( "29th Last" ) ); - dayList.append( i18n( "28th Last" ) ); - dayList.append( i18n( "27th Last" ) ); - dayList.append( i18n( "26th Last" ) ); - dayList.append( i18n( "25th Last" ) ); - dayList.append( i18n( "24th Last" ) ); - dayList.append( i18n( "23rd Last" ) ); - dayList.append( i18n( "22nd Last" ) ); - dayList.append( i18n( "21st Last" ) ); - dayList.append( i18n( "20th Last" ) ); - dayList.append( i18n( "19th Last" ) ); - dayList.append( i18n( "18th Last" ) ); - dayList.append( i18n( "17th Last" ) ); - dayList.append( i18n( "16th Last" ) ); - dayList.append( i18n( "15th Last" ) ); - dayList.append( i18n( "14th Last" ) ); - dayList.append( i18n( "13th Last" ) ); - dayList.append( i18n( "12th Last" ) ); - dayList.append( i18n( "11th Last" ) ); - dayList.append( i18n( "10th Last" ) ); - dayList.append( i18n( "9th Last" ) ); - dayList.append( i18n( "8th Last" ) ); - dayList.append( i18n( "7th Last" ) ); - dayList.append( i18n( "6th Last" ) ); - dayList.append( i18n( "5th Last" ) ); - dayList.append( i18n( "4th Last" ) ); - dayList.append( i18n( "3rd Last" ) ); - dayList.append( i18n( "2nd Last" ) ); - dayList.append( i18nc( "last day of the month", "Last" ) ); - dayList.append( i18nc( "unknown day of the month", "unknown" ) ); //#31 - zero offset from UI - dayList.append( i18n( "1st" ) ); - dayList.append( i18n( "2nd" ) ); - dayList.append( i18n( "3rd" ) ); - dayList.append( i18n( "4th" ) ); - dayList.append( i18n( "5th" ) ); - dayList.append( i18n( "6th" ) ); - dayList.append( i18n( "7th" ) ); - dayList.append( i18n( "8th" ) ); - dayList.append( i18n( "9th" ) ); - dayList.append( i18n( "10th" ) ); - dayList.append( i18n( "11th" ) ); - dayList.append( i18n( "12th" ) ); - dayList.append( i18n( "13th" ) ); - dayList.append( i18n( "14th" ) ); - dayList.append( i18n( "15th" ) ); - dayList.append( i18n( "16th" ) ); - dayList.append( i18n( "17th" ) ); - dayList.append( i18n( "18th" ) ); - dayList.append( i18n( "19th" ) ); - dayList.append( i18n( "20th" ) ); - dayList.append( i18n( "21st" ) ); - dayList.append( i18n( "22nd" ) ); - dayList.append( i18n( "23rd" ) ); - dayList.append( i18n( "24th" ) ); - dayList.append( i18n( "25th" ) ); - dayList.append( i18n( "26th" ) ); - dayList.append( i18n( "27th" ) ); - dayList.append( i18n( "28th" ) ); - dayList.append( i18n( "29th" ) ); - dayList.append( i18n( "30th" ) ); - dayList.append( i18n( "31st" ) ); + static QStringList dayList; + if ( dayList.isEmpty() ) { + dayList.append( i18n( "31st Last" ) ); + dayList.append( i18n( "30th Last" ) ); + dayList.append( i18n( "29th Last" ) ); + dayList.append( i18n( "28th Last" ) ); + dayList.append( i18n( "27th Last" ) ); + dayList.append( i18n( "26th Last" ) ); + dayList.append( i18n( "25th Last" ) ); + dayList.append( i18n( "24th Last" ) ); + dayList.append( i18n( "23rd Last" ) ); + dayList.append( i18n( "22nd Last" ) ); + dayList.append( i18n( "21st Last" ) ); + dayList.append( i18n( "20th Last" ) ); + dayList.append( i18n( "19th Last" ) ); + dayList.append( i18n( "18th Last" ) ); + dayList.append( i18n( "17th Last" ) ); + dayList.append( i18n( "16th Last" ) ); + dayList.append( i18n( "15th Last" ) ); + dayList.append( i18n( "14th Last" ) ); + dayList.append( i18n( "13th Last" ) ); + dayList.append( i18n( "12th Last" ) ); + dayList.append( i18n( "11th Last" ) ); + dayList.append( i18n( "10th Last" ) ); + dayList.append( i18n( "9th Last" ) ); + dayList.append( i18n( "8th Last" ) ); + dayList.append( i18n( "7th Last" ) ); + dayList.append( i18n( "6th Last" ) ); + dayList.append( i18n( "5th Last" ) ); + dayList.append( i18n( "4th Last" ) ); + dayList.append( i18n( "3rd Last" ) ); + dayList.append( i18n( "2nd Last" ) ); + dayList.append( i18nc( "last day of the month", "Last" ) ); + dayList.append( i18nc( "unknown day of the month", "unknown" ) ); //#31 - zero offset from UI + dayList.append( i18n( "1st" ) ); + dayList.append( i18n( "2nd" ) ); + dayList.append( i18n( "3rd" ) ); + dayList.append( i18n( "4th" ) ); + dayList.append( i18n( "5th" ) ); + dayList.append( i18n( "6th" ) ); + dayList.append( i18n( "7th" ) ); + dayList.append( i18n( "8th" ) ); + dayList.append( i18n( "9th" ) ); + dayList.append( i18n( "10th" ) ); + dayList.append( i18n( "11th" ) ); + dayList.append( i18n( "12th" ) ); + dayList.append( i18n( "13th" ) ); + dayList.append( i18n( "14th" ) ); + dayList.append( i18n( "15th" ) ); + dayList.append( i18n( "16th" ) ); + dayList.append( i18n( "17th" ) ); + dayList.append( i18n( "18th" ) ); + dayList.append( i18n( "19th" ) ); + dayList.append( i18n( "20th" ) ); + dayList.append( i18n( "21st" ) ); + dayList.append( i18n( "22nd" ) ); + dayList.append( i18n( "23rd" ) ); + dayList.append( i18n( "24th" ) ); + dayList.append( i18n( "25th" ) ); + dayList.append( i18n( "26th" ) ); + dayList.append( i18n( "27th" ) ); + dayList.append( i18n( "28th" ) ); + dayList.append( i18n( "29th" ) ); + dayList.append( i18n( "30th" ) ); + dayList.append( i18n( "31st" ) ); + } - int weekStart = KGlobal::locale()->weekStartDay(); + const int weekStart = KGlobal::locale()->weekStartDay(); QString dayNames; const KCalendarSystem *calSys = KGlobal::locale()->calendar(); @@ -3953,7 +3955,8 @@ QString txt, recurStr; switch ( recur->recurrenceType() ) { case Recurrence::rNone: - return i18n( "No recurrence" ); + static QString noRecurrence = i18n( "No recurrence" ); + return noRecurrence; case Recurrence::rMinutely: if ( recur->duration() != -1 ) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kimap/copyjob.cpp new/kdepimlibs-4.6.3/kimap/copyjob.cpp --- old/kdepimlibs-4.6.2/kimap/copyjob.cpp 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kimap/copyjob.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -123,7 +123,7 @@ it != response.responseCode.end(); ++it ) { if ( it->toString()=="COPYUID" ) { it = it + 3; - if ( it != response.responseCode.end() ) { + if ( it < response.responseCode.end() ) { d->resultingUids = ImapSet::fromImapSequenceSet( it->toString() ); } break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kimap/fetchjob.cpp new/kdepimlibs-4.6.3/kimap/fetchjob.cpp --- old/kdepimlibs-4.6.2/kimap/fetchjob.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/kimap/fetchjob.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -165,6 +165,7 @@ Q_D(FetchJob); QByteArray parameters = d->set.toImapSequenceSet()+' '; + Q_ASSERT( !parameters.trimmed().isEmpty() ); switch ( d->scope.mode ) { case FetchScope::Headers: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kimap/imapstreamparser.cpp new/kdepimlibs-4.6.3/kimap/imapstreamparser.cpp --- old/kdepimlibs-4.6.2/kimap/imapstreamparser.cpp 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kimap/imapstreamparser.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -232,6 +232,14 @@ ++i; continue; } + if ( m_data.at(i) == '"' ) { + if ( count > 0 ) { + m_position = i; + parseQuotedString(); + i = m_position; + continue; + } + } if ( m_data.at(i) == '[' ) { concatToLast = true; result.last()+='['; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kimap/loginjob.cpp new/kdepimlibs-4.6.3/kimap/loginjob.cpp --- old/kdepimlibs-4.6.2/kimap/loginjob.cpp 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kimap/loginjob.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -230,9 +230,9 @@ if (d->authMode.isEmpty()) { d->authState = LoginJobPrivate::Login; d->tags << d->sessionInternal()->sendCommand( "LOGIN", - quoteIMAP( d->userName ).toUtf8() + '"'+quoteIMAP( d->userName ).toUtf8()+'"' +' ' - +quoteIMAP(d->password ).toUtf8() ); + +'"'+quoteIMAP(d->password ).toUtf8()+'"' ); } else { if (!d->startAuthentication()) { emitResult(); @@ -295,9 +295,9 @@ } else { d->authState = LoginJobPrivate::Login; d->tags << d->sessionInternal()->sendCommand( "LOGIN", - quoteIMAP( d->userName ).toUtf8() + '"'+quoteIMAP( d->userName ).toUtf8()+'"' +' ' - +quoteIMAP( d->password ).toUtf8() ); + +'"'+quoteIMAP( d->password ).toUtf8()+'"'); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kimap/searchjob.cpp new/kdepimlibs-4.6.3/kimap/searchjob.cpp --- old/kdepimlibs-4.6.2/kimap/searchjob.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/kimap/searchjob.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -120,7 +120,7 @@ QByteArray searchKey; if (!d->charset.isEmpty()) { - searchKey = "[CHARSET] " + d->charset; + searchKey = "CHARSET " + d->charset; } if (d->logic == SearchJob::Not) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kimap/session.cpp new/kdepimlibs-4.6.3/kimap/session.cpp --- old/kdepimlibs-4.6.2/kimap/session.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/kimap/session.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -428,7 +428,9 @@ void SessionPrivate::restartSocketTimer() { - stopSocketTimer(); + if ( socketTimer.isActive() ) { + stopSocketTimer(); + } startSocketTimer(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kimap/tests/loginjobtest.cpp new/kdepimlibs-4.6.3/kimap/tests/loginjobtest.cpp --- old/kdepimlibs-4.6.2/kimap/tests/loginjobtest.cpp 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kimap/tests/loginjobtest.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -42,19 +42,26 @@ QList<QByteArray> scenario; scenario << FakeServer::greeting() - << "C: A000001 LOGIN user password" + << "C: A000001 LOGIN \"user\" \"password\"" << "S: A000001 OK User logged in"; QTest::newRow( "success" ) << "user" << "password" << scenario; scenario.clear(); scenario << FakeServer::greeting() - << "C: A000001 LOGIN user_bad password" + << "C: A000001 LOGIN \"user_bad\" \"password\"" << "S: A000001 NO Login failed: authentication failure"; QTest::newRow( "wrong login" ) << "user_bad" << "password" << scenario; scenario.clear(); + scenario << FakeServer::greeting() + << "C: A000001 LOGIN \"user\" \"aa\\\"bb\\\\cc[dd ee\"" + << "S: A000001 OK User logged in"; + + QTest::newRow( "special chars" ) << "user" << "aa\"bb\\cc[dd ee" << scenario; + + scenario.clear(); scenario << FakeServer::preauth(); QTest::newRow( "already authenticated" ) << "user" << "password" << scenario; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kmime/kmime_header_parsing.cpp new/kdepimlibs-4.6.3/kmime/kmime_header_parsing.cpp --- old/kdepimlibs-4.6.2/kmime/kmime_header_parsing.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/kmime/kmime_header_parsing.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -187,7 +187,7 @@ void Mailbox::fromUnicodeString( const QString &s ) { - from7BitString( encodeRFC2047String( s, "utf-8", false ) ); + from7BitString( encodeRFC2047Sentence( s, "utf-8" ) ); } void Mailbox::from7BitString( const QByteArray &s ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kmime/kmime_headers.cpp new/kdepimlibs-4.6.3/kmime/kmime_headers.cpp --- old/kdepimlibs-4.6.2/kmime/kmime_headers.cpp 2011-02-25 23:05:49.000000000 +0100 +++ new/kdepimlibs-4.6.3/kmime/kmime_headers.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -41,6 +41,7 @@ #include "kmime_headers_p.h" #include "kmime_util.h" +#include "kmime_util_p.h" #include "kmime_content.h" #include "kmime_codecs.h" #include "kmime_header_parsing.h" @@ -409,7 +410,7 @@ { Q_D(MailboxList); d->encCS = cachedCharset( b ); - from7BitString( encodeRFC2047String( s, b, false ) ); + from7BitString( encodeRFC2047Sentence( s, b ) ); } QString MailboxList::asUnicodeString() const @@ -561,7 +562,7 @@ { Q_D(AddressList); d->encCS = cachedCharset( b ); - from7BitString( encodeRFC2047String( s, b, false ) ); + from7BitString( encodeRFC2047Sentence( s, b ) ); } QString AddressList::asUnicodeString() const @@ -1272,12 +1273,12 @@ //-----<MessageID>----------------------------- //@cond PRIVATE -kmime_mk_trivial_ctor_with_name( MessageID, Generics::SingleIdent, Message-Id ) +kmime_mk_trivial_ctor_with_name( MessageID, Generics::SingleIdent, Message-ID ) //@endcond void MessageID::generate( const QByteArray &fqdn ) { - setIdentifier( uniqueString() + '@' + fqdn + '>' ); + setIdentifier( '<' + uniqueString() + '@' + fqdn + '>' ); } //-----</MessageID>---------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kmime/kmime_util.cpp new/kdepimlibs-4.6.3/kmime/kmime_util.cpp --- old/kdepimlibs-4.6.2/kmime/kmime_util.cpp 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kmime/kmime_util.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -263,10 +263,12 @@ return decodeRFC2047String( src, usedCS, "utf-8", false ); } +static const char *reservedCharacters = "\"()<>@,.;:\\[]="; + QByteArray encodeRFC2047String( const QString &src, const QByteArray &charset, bool addressHeader, bool allow8BitHeaders ) { - QByteArray encoded8Bit, result; + QByteArray result; int start=0, end=0; bool nonAscii=false, ok=true, useQEncoding=false; @@ -287,12 +289,18 @@ usedCS = charset; } + QTextCodec::ConverterState converterState( QTextCodec::IgnoreHeader ); + QByteArray encoded8Bit = codec->fromUnicode( src.constData(), src.length(), &converterState ); + if ( converterState.invalidChars > 0 ) { + usedCS = "utf-8"; + codec = QTextCodec::codecForName( usedCS ); + encoded8Bit = codec->fromUnicode( src ); + } + if ( usedCS.contains( "8859-" ) ) { // use "B"-Encoding for non iso-8859-x charsets useQEncoding = true; } - encoded8Bit = codec->fromUnicode( src ); - if ( allow8BitHeaders ) { return encoded8Bit; } @@ -320,7 +328,7 @@ for ( int x=end; x<encoded8Bit.length(); x++ ) { if ( ( (signed char)encoded8Bit[x]<0) || ( encoded8Bit[x] == '\033' ) || - ( addressHeader && ( strchr("\"()<>@,.;:\\[]=",encoded8Bit[x]) != 0 ) ) ) { + ( addressHeader && ( strchr(reservedCharacters, encoded8Bit[x]) != 0 ) ) ) { end = x; // we found another non-ascii word while ( ( end < encoded8Bit.length() ) && ( encoded8Bit[end] != ' ' ) ) { @@ -373,6 +381,48 @@ return result; } +QByteArray encodeRFC2047Sentence(const QString& src, const QByteArray& charset ) +{ + QByteArray result; + QList<QChar> splitChars; + splitChars << QLatin1Char(',') << QLatin1Char('\"') << QLatin1Char(';') << QLatin1Char('\\'); + const QChar *ch = src.constData(); + const int length = src.length(); + int pos = 0; + int wordStart = 0; + + //qDebug() << "Input:" << src; + // Loop over all characters of the string. + // When encountering a split character, RFC-2047-encode the word before it, and add it to the result. + while (pos < length) { + //qDebug() << "Pos:" << pos << "Result:" << result << "Char:" << ch->toAscii(); + const bool isAscii = ch->unicode() < 127; + const bool isReserved = (strchr( reservedCharacters, ch->toAscii() ) != 0); + if ( isAscii && isReserved ) { + const int wordSize = pos - wordStart; + if (wordSize > 0) { + const QString word = src.mid( wordStart, wordSize ); + result += encodeRFC2047String( word, charset ); + } + + result += ch->toAscii(); + wordStart = pos + 1; + } + ch++; + pos++; + } + + // Encode the last word + const int wordSize = pos - wordStart; + if (wordSize > 0) { + const QString word = src.mid( wordStart, pos - wordStart ); + result += encodeRFC2047String( word, charset ); + } + + return result; +} + + //----------------------------------------------------------------------------- QByteArray encodeRFC2231String( const QString& str, const QByteArray& charset ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kmime/kmime_util.h new/kdepimlibs-4.6.3/kmime/kmime_util.h --- old/kdepimlibs-4.6.2/kmime/kmime_util.h 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kmime/kmime_util.h 2011-04-28 15:15:25.000000000 +0200 @@ -165,7 +165,7 @@ Encodes string @p src according to RFC2047 using charset @p charset. @param src source string. - @param charset charset to use. + @param charset charset to use. If it can't encode the string, UTF-8 will be used instead. @param addressHeader if this flag is true, all special chars like <,>,[,],... will be encoded, too. @param allow8bitHeaders if this flag is true, 8Bit headers are allowed. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kmime/kmime_util_p.h new/kdepimlibs-4.6.3/kmime/kmime_util_p.h --- old/kdepimlibs-4.6.2/kmime/kmime_util_p.h 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kmime/kmime_util_p.h 2011-04-28 15:15:25.000000000 +0200 @@ -49,6 +49,13 @@ // This is used in zero places at the moment. extern void removeHeader( QByteArray &head, const QByteArray &name ); +/** + * Same as encodeRFC2047String(), but with a crucial difference: Instead of encoding the complete + * string as a single encoded word, the string will be split up at control characters, and only parts of + * the sentence that really need to be encoded will be encoded. + */ +extern QByteArray encodeRFC2047Sentence( const QString &src, const QByteArray &charset ); + } // @endcond diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kmime/tests/auto/headertest.cpp new/kdepimlibs-4.6.3/kmime/tests/auto/headertest.cpp --- old/kdepimlibs-4.6.2/kmime/tests/auto/headertest.cpp 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kmime/tests/auto/headertest.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -918,4 +918,53 @@ QVERIFY( !parseEncodedWord( start, end, result, language, usedCS ) ); } +void HeaderTest::testBug271192() +{ + QFETCH( QString, displayName ); + QFETCH( bool, quote ); + + const QString addrSpec = QLatin1String( "[email protected]" ); + const QString mailbox = (quote ? QLatin1String("\"") : QString()) + displayName + + (quote ? QLatin1String("\"") : QString()) + + QLatin1String(" <") + addrSpec + QLatin1String(">"); + + Headers::Generics::SingleMailbox *h = new Headers::Generics::SingleMailbox(); + h->fromUnicodeString( mailbox, "utf-8" ); + QCOMPARE( h->displayNames().size(), 1 ); + QCOMPARE( h->displayNames().first().toUtf8(), displayName.remove( QLatin1String("\\") ).toUtf8() ); + delete h; + h = 0; + + Headers::Generics::MailboxList *h2 = new Headers::Generics::MailboxList(); + h2->fromUnicodeString( mailbox + QLatin1String(",") + mailbox, "utf-8" ); + QCOMPARE( h2->displayNames().size(), 2 ); + QCOMPARE( h2->displayNames()[0].toUtf8(), displayName.remove( QLatin1String("\\") ).toUtf8() ); + QCOMPARE( h2->displayNames()[1].toUtf8(), displayName.remove( QLatin1String("\\") ).toUtf8() ); + delete h2; + h2 = 0; +} + +void HeaderTest::testBug271192_data() +{ + QTest::addColumn<QString>("displayName"); + QTest::addColumn<bool>("quote"); + + QTest::newRow("Plain") << QString::fromUtf8( "John Doe" ) << false; + QTest::newRow("Firstname 1") << QString::fromUtf8( "Marc-André Lastname" ) << false; + QTest::newRow("Firstname 2") << QString::fromUtf8( "Интернет-компания Lastname" ) << false; + QTest::newRow("Lastname") << QString::fromUtf8( "Tobias König" ) << false; + QTest::newRow("Firstname + Lastname") << QString::fromUtf8( "Интернет-компания König" ) << false; + QTest::newRow("Quotemarks") << QString::fromUtf8( "John \\\"Rocky\\\" Doe" ) << true; + QTest::newRow("Quotemarks") << QString::fromUtf8( "Jöhn \\\"Röcky\\\" Döe" ) << true; + + QTest::newRow("Plain") << QString::fromUtf8( "John Doe" ) << true; + QTest::newRow("Firstname 1") << QString::fromUtf8( "Marc-André Lastname" ) << true; + QTest::newRow("Firstname 2") << QString::fromUtf8( "Интернет-компания Lastname" ) << true; + QTest::newRow("Lastname") << QString::fromUtf8( "Tobias König" ) << true; + QTest::newRow("Firstname + Lastname") << QString::fromUtf8( "Интернет-компания König" ) << true; + QTest::newRow("LastName, Firstname") << QString::fromUtf8( "König, Интернет-компания" ) << true; +} + + + #include "headertest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kmime/tests/auto/headertest.h new/kdepimlibs-4.6.3/kmime/tests/auto/headertest.h --- old/kdepimlibs-4.6.2/kmime/tests/auto/headertest.h 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kmime/tests/auto/headertest.h 2011-04-28 15:15:25.000000000 +0200 @@ -46,6 +46,8 @@ void testInvalidButOkQEncoding(); void testInvalidQEncoding(); void testInvalidQEncoding_data(); + void testBug271192(); + void testBug271192_data(); // makes sure we don't accidently have an abstract header class that's not // meant to be abstract diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kmime/tests/auto/rfc2047test.cpp new/kdepimlibs-4.6.3/kmime/tests/auto/rfc2047test.cpp --- old/kdepimlibs-4.6.2/kmime/tests/auto/rfc2047test.cpp 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kmime/tests/auto/rfc2047test.cpp 2011-04-28 15:15:25.000000000 +0200 @@ -114,4 +114,10 @@ QEXPECT_FAIL( "", "libkmime will chose 'B' instead of 'Q' encoding", Continue ); QCOMPARE( KMime::encodeRFC2047String( QString::fromUtf8( "Ingo Klöcker <[email protected]>" ), "utf-8" ).constData(), "=?utf-8?q?Ingo=20Kl=C3=B6cker?= <[email protected]>" ); + + // Fallback to UTF-8 for encoding since the given charset can't encode the string + const QString input = QString::fromUtf8( "æſðđŋħł" ); + const QByteArray result = KMime::encodeRFC2047String( input, "latin1" ); + QCOMPARE( decodeRFC2047String( result ), input ); + QVERIFY( result.contains( "utf-8" ) ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kdepimlibs-4.6.2/kontactinterface/kontactplugin.desktop new/kdepimlibs-4.6.3/kontactinterface/kontactplugin.desktop --- old/kdepimlibs-4.6.2/kontactinterface/kontactplugin.desktop 2011-02-25 18:45:07.000000000 +0100 +++ new/kdepimlibs-4.6.3/kontactinterface/kontactplugin.desktop 2011-04-28 15:15:25.000000000 +0200 @@ -29,6 +29,7 @@ Name[pt]='Plugin' do Kontact Name[pt_BR]=Plug-in do Kontact Name[ro]=Modul Kontact +Name[ru]=Модуль Kontact Name[sl]=Vstavek za Kontact Name[sr]=Прикључак за Контакт Name[sr@ijekavian]=Прикључак за Контакт ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
