Esempio n. 1
0
void ContentIndexTest::testToString()
{
  KMime::ContentIndex ci;
  QCOMPARE( ci.toString(), QString() );
  ci.push( 1 );
  QCOMPARE( ci.toString(), QString( "1" ) );
  ci.push( 2 );
  QCOMPARE( ci.toString(), QString( "2.1" ) );
}
 // FIXME: this should actually be a member function of ContentIndex
 int contentIndexUp( KMime::ContentIndex &index )
 {
   Q_ASSERT( index.isValid() );
   QStringList ids = index.toString().split( QLatin1Char('.') );
   QString lastId = ids.takeLast();
   index = KMime::ContentIndex( ids.join( QLatin1String(".") ) );
   return lastId.toInt();
 }