Bug 260791 - mail size shown wrong
Summary: mail size shown wrong
Status: CLOSED FIXED
Alias: None
Product: KMail Mobile
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Windows CE Microsoft Windows CE
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-20 14:31 UTC by Marcus Brinkmann
Modified: 2011-01-13 15:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Brinkmann 2010-12-20 14:31:07 UTC
Version:           unspecified (using Devel) 
OS:                Windows CE

many mails are shown with size "1 B"

Reproducible: Sometimes
Comment 1 Tobias Koenig 2010-12-21 11:21:32 UTC
commit 36e15632fa7ee1c26a7b1fcd777fb341d49fabd9
branch master
Author: Tobias Koenig <tokoe@kde.org>
Date:   Tue Dec 21 11:22:49 2010 +0100

    Include only payload parts in partSizes calculation
    
    This will fix the bug that item size is changed
    if an ItemModifyJob is executed with setIgnorePayload( true )
    and an attribute to change.
    
    BUG: 260791

diff --git a/server/src/handler/store.cpp b/server/src/handler/store.cpp
index 7b10a0b..2021850 100644
--- a/server/src/handler/store.cpp
+++ b/server/src/handler/store.cpp
@@ -265,7 +265,8 @@ bool Store::parseStream()
       QByteArray value;
       if ( m_streamParser->hasLiteral() ) {
         const qint64 dataSize = m_streamParser->remainingLiteralSize();
-        partSizes += dataSize;
+        if ( partName.startsWith( "PLD:" ) )
+          partSizes += dataSize;
         const bool storeInFile = ( DbConfig::configuredDatabase()->useExternalPayloadFile() && dataSize > DbConfig::configuredDatabase()->sizeThreshold() );
         //actual case when streaming storage is used: external payload is enabled, data is big enough in a literal
         if ( storeInFile ) {
@@ -310,7 +311,8 @@ bool Store::parseStream()
         }
       } else { //not a literal
         value = m_streamParser->readString();
-        partSizes += value.size();
+        if ( partName.startsWith( "PLD:" ) )
+          partSizes += value.size();
       }
 
       // only relevant for non-literals or non-external literals
Comment 2 Ludwig Reiter 2011-01-13 15:31:05 UTC
version 2011-01-12
It works now.