--===============1380804785== Content-Type: multipart/signed; boundary="nextPart1741067.4dfWAtt7zr"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart1741067.4dfWAtt7zr Content-Type: multipart/mixed; boundary="Boundary-01=_CXogC8n73teQJAI" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_CXogC8n73teQJAI Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Please, test this patch with your amd64. According to Stroustrup's book "T= he=20 C++ Programming Language:" Some times it is necesary a reinterpret_cast to= =20 convert a pointer to a int value. Regards --Boundary-01=_CXogC8n73teQJAI Content-Type: text/x-diff; charset="utf-8"; name="reinterpretcast.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="reinterpretcast.diff" Index: kmacctexppop.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kmacctexppop.cpp (revisi=C3=B3n: 412519) +++ kmacctexppop.cpp (copia de trabajo) @@ -63,6 +63,8 @@ processingDelay =3D 2*100; mProcessing =3D false; dataCounter =3D 0; + mUidsOfSeenMsgsDict.setAutoDelete( false ); + mUidsOfNextSeenMsgsDict.setAutoDelete( false ); =20 headersOnServer.setAutoDelete(true); connect(&processMsgsTimer,SIGNAL(timeout()),SLOT(slotProcessPendingMsgs(= ))); @@ -157,14 +159,15 @@ KConfig config( seenUidList ); QStringList uidsOfSeenMsgs =3D config.readListEntry( "seenUidList" ); QValueList timeOfSeenMsgs =3D config.readIntListEntry( "seenUidTi= meList" ); =2D mUidsOfSeenMsgsMap.clear(); + mUidsOfSeenMsgsDict.clear(); + mUidsOfSeenMsgsDict.resize( KMail::nextPrime( ( uidsOfSeenMsgs.count()= * 11 ) / 10 ) ); int idx =3D 1; for ( QStringList::ConstIterator it =3D uidsOfSeenMsgs.begin(); it !=3D uidsOfSeenMsgs.end(); ++it, idx++ ) { =2D // we use mUidsOfSeenMsgsMap to just provide fast random access to= the + // we use mUidsOfSeenMsgsDict to just provide fast random access to = the // keys, so we can store the index(+1) that corresponds to the index= of // mTimeOfSeenMsgsVector for use in KMAcctExpPop::slotData() =2D mUidsOfSeenMsgsMap.insert( *it, idx ); + mUidsOfSeenMsgsDict.insert( *it, reinterpret_cast( idx = ) ); } mTimeOfSeenMsgsVector.clear(); mTimeOfSeenMsgsVector.reserve( timeOfSeenMsgs.size() ); @@ -175,13 +178,13 @@ // If the counts differ then the config file has presumably been tampe= red // with and so to avoid possible unwanted message deletion we'll treat // them all as newly seen by clearing the seen times vector =2D if ( mTimeOfSeenMsgsVector.count() !=3D mUidsOfSeenMsgsMap.count() ) + if ( mTimeOfSeenMsgsVector.count() !=3D mUidsOfSeenMsgsDict.count() ) mTimeOfSeenMsgsVector.clear(); QStringList downloadLater =3D config.readListEntry( "downloadLater" ); for ( QStringList::Iterator it =3D downloadLater.begin(); it !=3D down= loadLater.end(); ++it ) { mHeaderLaterUids.insert( *it, true ); } =2D mUidsOfNextSeenMsgsMap.clear(); + mUidsOfNextSeenMsgsDict.clear(); mTimeOfNextSeenMsgsMap.clear(); =20 interactive =3D _interactive; @@ -305,7 +308,7 @@ } else { idsOfMsgsToDelete.append( *curId ); =2D mUidsOfNextSeenMsgsMap.insert( *curUid, 1 ); + mUidsOfNextSeenMsgsDict.insert( *curUid, reinterpret_cast( 1 ) ); mTimeOfNextSeenMsgsMap.insert( *curUid, QDateTime::currentDateTime().toTime_t() ); } @@ -446,6 +449,9 @@ QStringList emptyList; if (stage =3D=3D List) { kdDebug(5006) << k_funcinfo << "stage =3D=3D List" << endl; + // set the initial size of mUidsOfNextSeenMsgsDict to the number of + // messages on the server + 10% + mUidsOfNextSeenMsgsDict.resize( KMail::nextPrime( ( idsOfMsgs.count() = * 11 ) / 10 ) ); KURL url =3D getUrl(); url.setPath(QString("/uidl")); job =3D KIO::get( url, false, false ); @@ -457,14 +463,14 @@ mUidlFinished =3D TRUE; =20 if ( mLeaveOnServer && mUidForIdMap.isEmpty() && =2D mUidsOfNextSeenMsgsMap.empty() && !idsOfMsgs.isEmpty() ) { + mUidsOfNextSeenMsgsDict.isEmpty() && !idsOfMsgs.isEmpty() ) { KMessageBox::sorry(0, i18n("Your POP3 server does not support the UI= DL " "command: this command is required to determine, in a reliable way, " "which of the mails on the server KMail has already seen before;\n" "the feature to leave the mails on the server will therefore not " "work properly.")); // An attempt to work around buggy pop servers, these seem to be pop= ular. =2D mUidsOfNextSeenMsgsMap=3D mUidsOfSeenMsgsMap; + mUidsOfNextSeenMsgsDict =3D mUidsOfSeenMsgsDict; } =20 //check if filter on server @@ -595,7 +601,8 @@ } if (headersOnServer.current()->action() =3D=3D Delete) { mHeaderDeleteUids.insert(headersOnServer.current()->uid(), true); =2D mUidsOfNextSeenMsgsMap.insert( headersOnServer.current()->uid(= ), 1 ); + mUidsOfNextSeenMsgsDict.insert( headersOnServer.current()->uid(), + reinterpret_cast( 1= ) ); idsOfMsgsToDelete.append(headersOnServer.current()->id()); mTimeOfNextSeenMsgsMap.insert( headersOnServer.current()->uid(), QDateTime::currentDateTime().toTime_t= () ); @@ -690,7 +697,7 @@ // remove the uids of all messages which have been deleted for ( QStringList::ConstIterator it =3D idsOfMsgsToDelete.begin(); it !=3D idsOfMsgsToDelete.end(); ++it ) { =2D mUidsOfNextSeenMsgsMap.remove( mUidForIdMap[*it] ); + mUidsOfNextSeenMsgsDict.remove( mUidForIdMap[*it] ); } idsOfMsgsToDelete.clear(); mMailCheckProgressItem->setStatus( @@ -746,10 +753,10 @@ =20 QStringList uidsOfNextSeenMsgs; QValueList seenUidTimeList; =2D QMapIterator it =3D mUidsOfNextSeenMsgsMap.begin(); =2D for( ; it!=3DmUidsOfNextSeenMsgsMap.end(); ++it ) { =2D uidsOfNextSeenMsgs.append( it.key() ); =2D seenUidTimeList.append( mTimeOfNextSeenMsgsMap[it.key()] ); + QDictIterator it( mUidsOfNextSeenMsgsDict ); + for( ; it.current(); ++it ) { + uidsOfNextSeenMsgs.append( it.currentKey() ); + seenUidTimeList.append( mTimeOfNextSeenMsgsMap[it.currentKey()] ); } QString seenUidList =3D locateLocal( "data", "kmail/" + mLogin + ":" + "= @" + mHost + ":" + QString("%1").arg(mPor= t) ); @@ -853,19 +860,19 @@ else { // stage =3D=3D Uidl const QString id =3D qdata.left(spc); const QString uid =3D qdata.mid(spc + 1); =2D if ( mUidsOfSeenMsgsMap.contains( uid ) ) { + if ( mUidsOfSeenMsgsDict.find( uid ) !=3D 0 ) { if ( mMsgsPendingDownload.contains( id ) ) { mMsgsPendingDownload.remove( id ); } else kdDebug(5006) << "KMAcctExpPop::slotData synchronization failure= =2E" << endl; idsOfMsgsToDelete.append( id ); =2D mUidsOfNextSeenMsgsMap.insert( uid, 1 ); + mUidsOfNextSeenMsgsDict.insert( uid, reinterpret_cast= ( 1 ) ); if ( mTimeOfSeenMsgsVector.empty() ) mTimeOfNextSeenMsgsMap.insert( uid, time(0) ); else mTimeOfNextSeenMsgsMap.insert( uid, =2D mTimeOfSeenMsgsVector[mUidsOfSeenMsgsMap[uid] - 1] ); + mTimeOfSeenMsgsVector[reinterpret_cast( mUidsOfSeenMsgsDi= ct[uid] ) - 1] ); } mUidForIdMap.insert( id, uid ); } Index: kmacctexppop.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kmacctexppop.h (revisi=C3=B3n: 412519) +++ kmacctexppop.h (copia de trabajo) @@ -131,9 +131,9 @@ QStringList idsOfMsgs; //used for ids and for count QValueList lensOfMsgs; QMap mUidForIdMap; // maps message ID (i.e. index on t= he server) to UID =2D QMap mUidsOfSeenMsgsMap; // set of UIDs of previously se= en messages (for fast lookup) + QDict mUidsOfSeenMsgsDict; // set of UIDs of previously seen messag= es (for fast lookup) QValueVector mTimeOfSeenMsgsVector; // list of times of previously = seen messages =2D QMap mUidsOfNextSeenMsgsMap; // set of UIDs of seen mess= ages (for the next check) + QDict mUidsOfNextSeenMsgsDict; // set of UIDs of seen messages (for= the next check) QMap mTimeOfNextSeenMsgsMap; // map of uid to times of see= n messages QStringList idsOfMsgsToDelete; int indexOfCurrentMsg; Index: kmacctimap.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kmacctimap.cpp (revisi=C3=B3n: 412519) +++ kmacctimap.cpp (copia de trabajo) @@ -64,11 +64,12 @@ QString("%1").arg(KAccount::id()) ); KConfig config( serNumUri ); QStringList serNums =3D config.readListEntry( "unfiltered" ); + mFilterSerNumsToSave.setAutoDelete( false ); =20 for ( QStringList::ConstIterator it =3D serNums.begin(); it !=3D serNums.end(); ++it ) { mFilterSerNums.append( (*it).toUInt() ); =2D mFilterSerNumsToSave.insert( *it, 1 ); + mFilterSerNumsToSave.insert( *it, reinterpret_cast( 1 )= ); } } =20 @@ -82,9 +83,9 @@ QString("%1").arg(KAccount::id()) ); KConfig config( serNumUri ); QStringList serNums; =2D QMapIterator it =3D mFilterSerNumsToSave.begin(); =2D for( ; it!=3DmFilterSerNumsToSave.end(); ++it ) =2D serNums.append( it.key() ); + QDictIterator it( mFilterSerNumsToSave ); + for( ; it.current(); ++it ) + serNums.append( it.currentKey() ); config.writeEntry( "unfiltered", serNums ); } =20 @@ -548,7 +549,7 @@ if ( findIt !=3D mFilterSerNums.end() ) return; mFilterSerNums.append( serNum ); =2D mFilterSerNumsToSave.insert( QString( "%1" ).arg( serNum ), 1 ); + mFilterSerNumsToSave.insert( QString( "%1" ).arg( serNum ), reinterpret_= cast( 1 ) ); } =20 int KMAcctImap::slotFilterMsg( KMMessage *msg ) Index: kmacctimap.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- kmacctimap.h (revisi=C3=B3n: 412519) +++ kmacctimap.h (copia de trabajo) @@ -23,7 +23,7 @@ #define KMAcctImap_h =20 #include "imapaccountbase.h" =2D#include +#include =20 class KMFolderImap; class KMFolderTreeItem; @@ -144,7 +144,7 @@ QTimer mErrorTimer; int mCountRemainChecks; QValueList mFilterSerNums; =2D QMap mFilterSerNumsToSave; + QDict mFilterSerNumsToSave; }; =20 #endif /*KMAcctImap_h*/ --Boundary-01=_CXogC8n73teQJAI-- --nextPart1741067.4dfWAtt7zr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQBCgoXGMKsc+XeZcdwRAjdqAJ9xcrSNUzqaFJ0cwoWAumD3QHaigACfb7UA aEvIn8h0hbRrTVa8m+F7m8M= =4Oq4 -----END PGP SIGNATURE----- --nextPart1741067.4dfWAtt7zr-- --===============1380804785== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KMail developers mailing list KMail-devel@kde.org https://mail.kde.org/mailman/listinfo/kmail-devel --===============1380804785==--