~ubuntu-branches/ubuntu/quantal/akonadi/quantal

« back to all changes in this revision

Viewing changes to server/src/storage/parthelper.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Philip Muškovac
  • Date: 2011-07-16 16:41:20 UTC
  • mfrom: (1.1.30 upstream)
  • Revision ID: james.westby@ubuntu.com-20110716164120-ox4q9lqooq6jfr52
Tags: 1.6.0-0ubuntu1
New upstream release 

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
  if ( part->external() )
43
43
    origFileName = QString::fromUtf8( part->data() );
44
44
 
45
 
  const bool storeExternal = DbConfig::configuredDatabase()->useExternalPayloadFile() && dataSize > DbConfig::configuredDatabase()->sizeThreshold();
 
45
  const bool storeExternal = dataSize > DbConfig::configuredDatabase()->sizeThreshold();
46
46
 
47
47
  if ( storeExternal ) {
48
48
    QString fileName = origFileName;
93
93
  if (!part)
94
94
    return false;
95
95
 
96
 
  const bool storeInFile = DbConfig::configuredDatabase()->useExternalPayloadFile()  && ( part->datasize() > DbConfig::configuredDatabase()->sizeThreshold() );
 
96
  const bool storeInFile = part->datasize() > DbConfig::configuredDatabase()->sizeThreshold();
97
97
 
98
98
  //it is needed to insert first the metadata so a new id is generated for the part,
99
99
  //and we need this id for the payload file name
206
206
  if ( part.external() ) {
207
207
    const QString fileName = QString::fromUtf8( part.data() );
208
208
    QFile::remove( fileName );
209
 
  } 
 
209
  }
210
210
 
211
211
  part.setData( QByteArray() );
212
212
  part.setDatasize( 0 );