~ubuntu-branches/ubuntu/lucid/kdepim-runtime/lucid-proposed

« back to all changes in this revision

Viewing changes to resources/maildir/libmaildir/maildir.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2010-01-06 18:57:08 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100106185708-njxieh19nqhom3nd
Tags: 4:4.3.90-0ubuntu1
* New upstream beta release:
  - Bump build-depend versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
204
204
      }
205
205
    } else {
206
206
      foreach ( const QString &sf, subFolderList() ) {
207
 
        const Maildir subMd = Maildir( path() + '/' + sf );
 
207
        const Maildir subMd = Maildir( path() + QLatin1Char( '/' ) + sf );
208
208
        if ( !subMd.isValid( error ) )
209
209
          return false;
210
210
      }
253
253
        dir.cd( d->subDirPath() );
254
254
    }
255
255
 
256
 
    const QString fullPath = dir.path() + '/' + path;
 
256
    const QString fullPath = dir.path() + QLatin1Char( '/' ) + path;
257
257
    Maildir subdir( fullPath );
258
258
    if ( subdir.create() )
259
259
        return fullPath;
272
272
    if ( !dir.exists( folderName ) ) return false;
273
273
 
274
274
    // remove it recursively
275
 
    return KPIMUtils::removeDirAndContentsRecursively( dir.absolutePath() + '/' + folderName );
 
275
    return KPIMUtils::removeDirAndContentsRecursively( dir.absolutePath() + QLatin1Char( '/' ) + folderName );
276
276
}
277
277
 
278
278
Maildir Maildir::subFolder( const QString& subFolder ) const
286
286
                dir.cd( d->subDirPath() );
287
287
            }
288
288
        }
289
 
        return Maildir( dir.path() + '/' + subFolder );
 
289
        return Maildir( dir.path() + QLatin1Char( '/' ) + subFolder );
290
290
    }
291
291
    return Maildir();
292
292
}
315
315
    }
316
316
    dir.setFilter( QDir::Dirs | QDir::NoDotAndDotDot );
317
317
    QStringList entries = dir.entryList();
318
 
    entries.removeAll( "cur" );
319
 
    entries.removeAll( "new" );
320
 
    entries.removeAll( "tmp" );
 
318
    entries.removeAll( QLatin1String( "cur" ) );
 
319
    entries.removeAll( QLatin1String( "new" ) );
 
320
    entries.removeAll( QLatin1String( "tmp" ) );
321
321
    return entries;
322
322
}
323
323
 
355
355
 
356
356
    return info.size();
357
357
}
358
 
    
 
358
 
359
359
QByteArray Maildir::readEntryHeaders( const QString& key ) const
360
360
{
361
361
    QByteArray result;
405
405
QString Maildir::addEntry( const QByteArray& data )
406
406
{
407
407
    QString uniqueKey( createUniqueFileName() );
408
 
    QString key( d->path + "/tmp/" + uniqueKey );
409
 
    QString finalKey( d->path + "/new/" + uniqueKey );
 
408
    QString key( d->path + QLatin1String( "/tmp/" ) + uniqueKey );
 
409
    QString finalKey( d->path + QLatin1String( "/new/" ) + uniqueKey );
410
410
    QFile f( key );
411
411
    f.open( QIODevice::WriteOnly );
412
412
    f.write( data );
469
469
  QDir dir( d->path );
470
470
  dir.cdUp();
471
471
 
472
 
  return d->moveAndRename( dir, newName ); 
 
472
  return d->moveAndRename( dir, newName );
473
473
}
474
474
 
475
475
QString Maildir::moveEntryTo( const QString &key, const Maildir &destination )