933
941
idsOfMsgs.append( id );
934
942
mMsgsPendingDownload.insert( id, len );
936
else { // stage == Uidl
937
const QString id = qdata.left(spc);
938
const QString uid = qdata.mid(spc + 1);
939
int *size = new int; //malloc(size_of(int));
940
*size = mMsgsPendingDownload[id];
941
mSizeOfNextSeenMsgsDict.insert( uid, size );
942
if ( mUidsOfSeenMsgsDict.find( uid ) != 0 ) {
944
if ( mMsgsPendingDownload.contains( id ) ) {
945
mMsgsPendingDownload.remove( id );
948
kdDebug(5006) << "PopAccount::slotData synchronization failure." << endl;
949
idsOfMsgsToDelete.append( id );
950
mUidsOfNextSeenMsgsDict.insert( uid, (const int *)1 );
951
if ( mTimeOfSeenMsgsVector.empty() ) {
952
mTimeOfNextSeenMsgsMap.insert( uid, time(0) );
955
// cast the int* with a long to can convert it to a int, BTW
956
// works with g++-4.0 and amd64
957
mTimeOfNextSeenMsgsMap.insert( uid,
958
mTimeOfSeenMsgsVector[(int)( long )mUidsOfSeenMsgsDict[uid] - 1] );
961
mUidForIdMap.insert( id, uid );
946
if ( job ) job->kill();
949
KMessageBox::error( 0, i18n( "Unable to complete LIST operation." ),
950
i18n( "Invalid Response From Server") );
966
if (job) job->kill();
969
KMessageBox::error(0, i18n( "Unable to complete LIST operation." ),
970
i18n("Invalid Response From Server"));
954
else { // stage == Uidl
955
Q_ASSERT ( stage == Uidl);
961
// an invalid uidl line. we might just need to skip it, but
962
// some servers generate invalid uids with valid ids. in that
963
// case we will just make up a uid - which will cause us to
964
// not cache the document, but we will be able to interoperate
966
int testid = atoi ( qdata.ascii() );
968
// we'll just have to skip this
969
kdDebug(5006) << "PopAccount::slotData skipping UIDL entry due to parse error "
970
<< endl << qdata.ascii() << endl;
973
id.setNum (testid, 10);
975
QString datestring, serialstring;
977
serialstring.setNum ( ++dataCounter, 10 );
978
datestring.setNum ( time(NULL),10 );
979
uid = QString( "uidlgen" ) + datestring + QString( "." ) + serialstring;
980
kdDebug(5006) << "PopAccount::slotData message " << id.ascii()
981
<< "%d has bad UIDL, cannot keep a copy on server" << endl;
982
idsOfForcedDeletes.append( id );
985
id = qdata.left( spc );
986
uid = qdata.mid( spc + 1 );
989
int *size = new int; //malloc(size_of(int));
990
*size = mMsgsPendingDownload[id];
991
mSizeOfNextSeenMsgsDict.insert( uid, size );
992
if ( mUidsOfSeenMsgsDict.find( uid ) != 0 ) {
993
if ( mMsgsPendingDownload.contains( id ) ) {
994
mMsgsPendingDownload.remove( id );
997
kdDebug(5006) << "PopAccount::slotData synchronization failure." << endl;
998
idsOfMsgsToDelete.append( id );
999
mUidsOfNextSeenMsgsDict.insert( uid, (const int *)1 );
1000
if ( mTimeOfSeenMsgsVector.empty() ) {
1001
mTimeOfNextSeenMsgsMap.insert( uid, time(0) );
1004
// cast the int* with a long to can convert it to a int, BTW
1005
// works with g++-4.0 and amd64
1006
mTimeOfNextSeenMsgsMap.insert( uid, mTimeOfSeenMsgsVector[(int)( long )
1007
mUidsOfSeenMsgsDict[uid] - 1] );
1010
mUidForIdMap.insert( id, uid );
976
1014
//-----------------------------------------------------------------------------
977
1015
void PopAccount::slotResult( KIO::Job* )