Commit bae777cc authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile with QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII

parent 72c6fe1b
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
set(kpimidentities_LIB_SRCS identitymanager.cpp identity.cpp signature.cpp signatureconfigurator.cpp identitycombo.cpp)
add_subdirectory( tests )
......
......@@ -52,14 +52,14 @@ Identity::Identity( const QString &id, const QString &fullName,
const QString &replyToAddr )
: mIsDefault( false )
{
setProperty( s_uoid, 0 );
setProperty( s_identity, id );
setProperty( s_name, fullName );
setProperty( s_email, emailAddr );
setProperty( s_organization, organization );
setProperty( s_replyto, replyToAddr );
setProperty( QLatin1String(s_uoid), 0 );
setProperty( QLatin1String(s_identity), id );
setProperty( QLatin1String(s_name), fullName );
setProperty( QLatin1String(s_email), emailAddr );
setProperty( QLatin1String(s_organization), organization );
setProperty( QLatin1String(s_replyto), replyToAddr );
setDictionary( Sonnet::defaultLanguageName() );
setProperty( s_disabledFcc, false );
setProperty( QLatin1String(s_disabledFcc), false );
}
Identity::~Identity()
......@@ -80,17 +80,17 @@ bool Identity::isNull() const
while ( i != mPropertiesMap.constEnd() ) {
// Take into account that the dictionary for a null identity is not empty
if ( i.key() == s_dict ) {
if ( i.key() == QLatin1String(s_dict) ) {
++i;
continue;
}
// Take into account that disableFcc == false for a null identity
if( i.key() == s_disabledFcc && i.value().toBool() == false ) {
if( i.key() == QLatin1String(s_disabledFcc) && i.value().toBool() == false ) {
++i;
continue;
}
// The uoid is 0 by default, so ignore this
if ( !( i.key() == s_uoid && i.value().toUInt() == 0 ) ) {
if ( !( i.key() == QLatin1String(s_uoid) && i.value().toUInt() == 0 ) ) {
if ( !i.value().isNull() ||
( i.value().type() == QVariant::String && !i.value().toString().isEmpty() ) ) {
empty = false;
......@@ -108,7 +108,7 @@ void Identity::readConfig( const KConfigGroup &config )
QMap<QString, QString>::const_iterator i = entries.constBegin();
QMap<QString, QString>::const_iterator end = entries.constEnd();
while ( i != end ) {
if ( i.key() == s_emailAliases ) {
if ( i.key() == QLatin1String(s_emailAliases) ) {
// HACK: Read s_emailAliases as a stringlist
mPropertiesMap.insert( i.key(), config.readEntry( i.key(), QStringList() ) );
} else {
......@@ -133,12 +133,12 @@ void Identity::writeConfig( KConfigGroup &config ) const
bool Identity::mailingAllowed() const
{
return !property( s_email ).toString().isEmpty();
return !property( QLatin1String(s_email) ).toString().isEmpty();
}
QString Identity::mimeDataType()
{
return "application/x-kmail-identity-drag";
return QLatin1String("application/x-kmail-identity-drag");
}
bool Identity::canDecode( const QMimeData*md )
......@@ -189,7 +189,7 @@ QDataStream &KPIMIdentities::operator<<
<< i.fcc()
<< i.drafts()
<< i.templates()
<< i.mPropertiesMap[s_signature]
<< i.mPropertiesMap[QLatin1String(s_signature)]
<< i.dictionary()
<< i.xface()
<< i.preferredCryptoMessageFormat()
......@@ -207,32 +207,32 @@ QDataStream &KPIMIdentities::operator>>
quint32 uoid;
stream
>> uoid
>> i.mPropertiesMap[s_identity]
>> i.mPropertiesMap[s_name]
>> i.mPropertiesMap[s_organization]
>> i.mPropertiesMap[s_pgps]
>> i.mPropertiesMap[s_pgpe]
>> i.mPropertiesMap[s_smimes]
>> i.mPropertiesMap[s_smimee]
>> i.mPropertiesMap[s_email]
>> i.mPropertiesMap[s_emailAliases]
>> i.mPropertiesMap[s_replyto]
>> i.mPropertiesMap[s_bcc]
>> i.mPropertiesMap[s_vcard]
>> i.mPropertiesMap[s_transport]
>> i.mPropertiesMap[s_fcc]
>> i.mPropertiesMap[s_drafts]
>> i.mPropertiesMap[s_templates]
>> i.mPropertiesMap[s_signature]
>> i.mPropertiesMap[s_dict]
>> i.mPropertiesMap[s_xface]
>> i.mPropertiesMap[s_prefcrypt]
>> i.mPropertiesMap[s_cc]
>> i.mPropertiesMap[s_attachVcard]
>> i.mPropertiesMap[s_autocorrectionLanguage]
>> i.mPropertiesMap[s_disabledFcc];
i.setProperty( s_uoid, uoid );
>> i.mPropertiesMap[QLatin1String(s_identity)]
>> i.mPropertiesMap[QLatin1String(s_name)]
>> i.mPropertiesMap[QLatin1String(s_organization)]
>> i.mPropertiesMap[QLatin1String(s_pgps)]
>> i.mPropertiesMap[QLatin1String(s_pgpe)]
>> i.mPropertiesMap[QLatin1String(s_smimes)]
>> i.mPropertiesMap[QLatin1String(s_smimee)]
>> i.mPropertiesMap[QLatin1String(s_email)]
>> i.mPropertiesMap[QLatin1String(s_emailAliases)]
>> i.mPropertiesMap[QLatin1String(s_replyto)]
>> i.mPropertiesMap[QLatin1String(s_bcc)]
>> i.mPropertiesMap[QLatin1String(s_vcard)]
>> i.mPropertiesMap[QLatin1String(s_transport)]
>> i.mPropertiesMap[QLatin1String(s_fcc)]
>> i.mPropertiesMap[QLatin1String(s_drafts)]
>> i.mPropertiesMap[QLatin1String(s_templates)]
>> i.mPropertiesMap[QLatin1String(s_signature)]
>> i.mPropertiesMap[QLatin1String(s_dict)]
>> i.mPropertiesMap[QLatin1String(s_xface)]
>> i.mPropertiesMap[QLatin1String(s_prefcrypt)]
>> i.mPropertiesMap[QLatin1String(s_cc)]
>> i.mPropertiesMap[QLatin1String(s_attachVcard)]
>> i.mPropertiesMap[QLatin1String(s_autocorrectionLanguage)]
>> i.mPropertiesMap[QLatin1String(s_disabledFcc)];
i.setProperty( QLatin1String(s_uoid), uoid );
return stream;
}
......@@ -288,14 +288,14 @@ QVariant Identity::property( const QString &key ) const
QString Identity::fullEmailAddr( void ) const
{
const QString name = mPropertiesMap.value( s_name ).toString();
const QString mail = mPropertiesMap.value( s_email ).toString();
const QString name = mPropertiesMap.value( QLatin1String(s_name) ).toString();
const QString mail = mPropertiesMap.value( QLatin1String(s_email) ).toString();
if ( name.isEmpty() ) {
return mail;
}
const QString specials( "()<>@,.;:[]" );
const QString specials( QLatin1String("()<>@,.;:[]") );
QString result;
......@@ -305,19 +305,19 @@ QString Identity::fullEmailAddr( void ) const
for ( int i=0; i < nameLength; i++ ) {
if ( specials.contains( name[i] ) ) {
needsQuotes = true;
} else if ( name[i] == '\\' || name[i] == '"' ) {
} else if ( name[i] == QLatin1Char('\\') || name[i] == QLatin1Char('"') ) {
needsQuotes = true;
result += '\\';
result += QLatin1Char('\\');
}
result += name[i];
}
if ( needsQuotes ) {
result.insert( 0, '"' );
result += '"';
result.insert( 0, QLatin1Char('"') );
result += QLatin1Char('"');
}
result += " <" + mail + '>';
result += QLatin1String(" <") + mail + QLatin1Char('>');
return result;
}
......@@ -514,42 +514,42 @@ void Identity::setProperty( const QString &key, const QVariant &value )
void Identity::setUoid( uint aUoid )
{
setProperty( s_uoid, aUoid );
setProperty( QLatin1String(s_uoid), aUoid );
}
void Identity::setIdentityName( const QString &name )
{
setProperty( s_identity, name );
setProperty( QLatin1String(s_identity), name );
}
void Identity::setFullName( const QString &str )
{
setProperty( s_name, str );
setProperty( QLatin1String(s_name), str );
}
void Identity::setOrganization( const QString &str )
{
setProperty( s_organization, str );
setProperty( QLatin1String(s_organization), str );
}
void Identity::setPGPSigningKey( const QByteArray &str )
{
setProperty( s_pgps, QString( str ) );
setProperty( QLatin1String(s_pgps), QLatin1String( str ) );
}
void Identity::setPGPEncryptionKey( const QByteArray &str )
{
setProperty( s_pgpe, QString( str ) );
setProperty( QLatin1String(s_pgpe), QLatin1String( str ) );
}
void Identity::setSMIMESigningKey( const QByteArray &str )
{
setProperty( s_smimes, QString( str ) );
setProperty( QLatin1String(s_smimes), QLatin1String( str ) );
}
void Identity::setSMIMEEncryptionKey( const QByteArray &str )
{
setProperty( s_smimee, QString( str ) );
setProperty( QLatin1String(s_smimee), QLatin1String( str ) );
}
void Identity::setEmailAddr( const QString &str )
......@@ -559,27 +559,27 @@ void Identity::setEmailAddr( const QString &str )
void Identity::setPrimaryEmailAddress( const QString & email )
{
setProperty( s_email, email );
setProperty( QLatin1String(s_email), email );
}
void Identity::setEmailAliases( const QStringList & aliases )
{
setProperty( s_emailAliases, aliases );
setProperty( QLatin1String(s_emailAliases), aliases );
}
void Identity::setVCardFile( const QString &str )
{
setProperty( s_vcard, str );
setProperty( QLatin1String(s_vcard), str );
}
void Identity::setAttachVcard(bool attachment)
{
setProperty( s_attachVcard, attachment );
setProperty( QLatin1String(s_attachVcard), attachment );
}
void Identity::setReplyToAddr( const QString&str )
{
setProperty( s_replyto, str );
setProperty( QLatin1String(s_replyto), str );
}
void Identity::setSignatureFile( const QString &str )
......@@ -594,37 +594,37 @@ void Identity::setSignatureInlineText( const QString &str )
void Identity::setTransport( const QString &str )
{
setProperty( s_transport, str );
setProperty( QLatin1String(s_transport), str );
}
void Identity::setFcc( const QString &str )
{
setProperty( s_fcc, str );
setProperty( QLatin1String(s_fcc), str );
}
void Identity::setDrafts( const QString &str )
{
setProperty( s_drafts, str );
setProperty( QLatin1String(s_drafts), str );
}
void Identity::setTemplates( const QString &str )
{
setProperty( s_templates, str );
setProperty( QLatin1String(s_templates), str );
}
void Identity::setDictionary( const QString &str )
{
setProperty( s_dict, str );
setProperty( QLatin1String(s_dict), str );
}
void Identity::setBcc( const QString &str )
{
setProperty( s_bcc, str );
setProperty( QLatin1String(s_bcc), str );
}
void Identity::setCc( const QString &str )
{
setProperty( s_cc, str );
setProperty( QLatin1String(s_cc), str );
}
void Identity::setIsDefault( bool flag )
......@@ -634,21 +634,21 @@ void Identity::setIsDefault( bool flag )
void Identity::setPreferredCryptoMessageFormat( const QString &str )
{
setProperty( s_prefcrypt, str );
setProperty( QLatin1String(s_prefcrypt), str );
}
void Identity::setXFace( const QString &str )
{
QString strNew = str;
strNew.remove( ' ' );
strNew.remove( '\n' );
strNew.remove( '\r' );
setProperty( s_xface, strNew );
strNew.remove( QLatin1Char(' ') );
strNew.remove( QLatin1Char('\n') );
strNew.remove( QLatin1Char('\r') );
setProperty( QLatin1String(s_xface), strNew );
}
void Identity::setXFaceEnabled( const bool on )
{
setProperty( s_xfaceenabled, on );
setProperty( QLatin1String(s_xfaceenabled), on );
}
void Identity::setSignature( const Signature &sig )
......@@ -688,7 +688,7 @@ QString Identity::verifyAkonadiId(const QString& str) const
void Identity::setAutocorrectionLanguage(const QString& language)
{
setProperty( s_autocorrectionLanguage, language );
setProperty( QLatin1String(s_autocorrectionLanguage), language );
}
......@@ -704,5 +704,5 @@ bool Identity::disabledFcc() const
void Identity::setDisabledFcc(bool disable)
{
setProperty( s_disabledFcc, disable );
setProperty( QLatin1String(s_disabledFcc), disable );
}
......@@ -48,9 +48,9 @@ using namespace KPIMIdentities;
static QString newDBusObjectName()
{
static int s_count = 0;
QString name( "/KPIMIDENTITIES_IdentityManager" );
QString name( QLatin1String("/KPIMIDENTITIES_IdentityManager") );
if ( s_count++ ) {
name += '_';
name += QLatin1Char('_');
name += QString::number( s_count );
}
return name;
......@@ -60,26 +60,26 @@ IdentityManager::IdentityManager( bool readonly, QObject *parent,
const char *name )
: QObject( parent )
{
setObjectName( name );
KGlobal::locale()->insertCatalog( "libkpimidentities" );
setObjectName( QLatin1String(name) );
KGlobal::locale()->insertCatalog( QLatin1String("libkpimidentities") );
new IdentityManagerAdaptor( this );
QDBusConnection dbus = QDBusConnection::sessionBus();
const QString dbusPath = newDBusObjectName();
setProperty( "uniqueDBusPath", dbusPath );
const QString dbusInterface = "org.kde.pim.IdentityManager";
const QString dbusInterface = QLatin1String("org.kde.pim.IdentityManager");
dbus.registerObject( dbusPath, this );
dbus.connect( QString(), QString(), dbusInterface, "identitiesChanged", this,
dbus.connect( QString(), QString(), dbusInterface, QLatin1String("identitiesChanged"), this,
SLOT(slotIdentitiesChanged(QString)) );
mReadOnly = readonly;
mConfig = new KConfig( "emailidentities" );
mConfig = new KConfig( QLatin1String("emailidentities") );
readConfig( mConfig );
if ( mIdentities.isEmpty() ) {
kDebug( 5325 ) << "emailidentities is empty -> convert from kmailrc";
// No emailidentities file, or an empty one due to broken conversion
// (kconf_update bug in kdelibs <= 3.2.2)
// => convert it, i.e. read settings from kmailrc
KConfig kmailConf( "kmailrc" );
KConfig kmailConf( QLatin1String("kmailrc") );
readConfig( &kmailConf );
}
// we need at least a default identity:
......@@ -287,7 +287,7 @@ void IdentityManager::readConfig( KConfig *config )
QStringList IdentityManager::groupList( KConfig *config ) const
{
return config->groupList().filter( QRegExp( "^Identity #\\d+$" ) );
return config->groupList().filter( QRegExp( QLatin1String("^Identity #\\d+$") ) );
}
IdentityManager::ConstIterator IdentityManager::begin() const
......@@ -515,7 +515,7 @@ void IdentityManager::createDefaultIdentity()
KConfigGroup general( mConfig, "General" );
QString defaultdomain = general.readEntry( "Default domain" );
if ( !defaultdomain.isEmpty() ) {
emailAddress += '@' + defaultdomain;
emailAddress += QLatin1Char('@') + defaultdomain;
} else {
emailAddress.clear();
}
......@@ -531,14 +531,14 @@ void IdentityManager::createDefaultIdentity()
if ( !emailAddress.isEmpty() ) {
// If we have an email address, create a default identity name from it
QString idName = emailAddress;
int pos = idName.indexOf( '@' );
int pos = idName.indexOf( QLatin1Char('@') );
if ( pos != -1 ) {
name = idName.mid( pos + 1, -1 );
}
// Make the name a bit more human friendly
name.replace( '.', ' ' );
pos = name.indexOf( ' ' );
name.replace( QLatin1Char('.'), QLatin1Char(' ') );
pos = name.indexOf( QLatin1Char(' ') );
if ( pos != 0 ) {
name[pos + 1] = name[pos + 1].toUpper();
}
......
......@@ -190,7 +190,7 @@ QString Signature::textFromCommand( bool *ok ) const
*ok = false;
}
QString wmsg = i18n( "<qt>Failed to execute signature script<p><b>%1</b>:</p>"
"<p>%2</p></qt>", mUrl, QString( proc.readAllStandardError() ) );
"<p>%2</p></qt>", mUrl, QLatin1String( proc.readAllStandardError() ) );
KMessageBox::error( 0, wmsg );
return QString();
}
......@@ -244,7 +244,7 @@ QString Signature::withSeparator( bool *ok ) const
}
const bool htmlSig = ( isInlinedHtml() && mType == Inlined );
QString newline = htmlSig ? "<br>" : "\n";
QString newline = htmlSig ? QLatin1String("<br>") : QLatin1String("\n");
if ( htmlSig && signature.startsWith( QLatin1String( "<p" ) ) ) {
newline.clear();
}
......@@ -336,7 +336,7 @@ void Signature::saveImages() const
{
if ( isInlinedHtml() && !d( this )->saveLocation.isEmpty() ) {
foreach ( const SignaturePrivate::EmbeddedImagePtr &image, d( this )->embeddedImages ) {
QString location = d( this )->saveLocation + '/' + image->name;
QString location = d( this )->saveLocation + QLatin1Char('/') + image->name;
if ( !image->image.save( location, "PNG" ) ) {
kWarning() << "Failed to save image" << location;
}
......@@ -347,16 +347,16 @@ void Signature::saveImages() const
void Signature::readConfig( const KConfigGroup &config )
{
QString sigType = config.readEntry( sigTypeKey );
if ( sigType == sigTypeInlineValue ) {
if ( sigType == QLatin1String(sigTypeInlineValue) ) {
mType = Inlined;
mInlinedHtml = config.readEntry( sigTypeInlinedHtmlKey, false );
} else if ( sigType == sigTypeFileValue ) {
} else if ( sigType == QLatin1String(sigTypeFileValue) ) {
mType = FromFile;
mUrl = config.readPathEntry( sigFileKey, QString() );
} else if ( sigType == sigTypeCommandValue ) {
} else if ( sigType == QLatin1String(sigTypeCommandValue) ) {
mType = FromCommand;
mUrl = config.readPathEntry( sigCommandKey, QString() );
} else if ( sigType == sigTypeDisabledValue ) {
} else if ( sigType == QLatin1String(sigTypeDisabledValue) ) {
d( this )->enabled = false;
}
if ( mType != Disabled ) {
......@@ -371,11 +371,11 @@ void Signature::readConfig( const KConfigGroup &config )
foreach ( const QString &fileName, dir.entryList( QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks ) ) {
if ( fileName.toLower().endsWith( QLatin1String( ".png" ) ) ) {
QImage image;
if ( image.load( dir.path() + '/' + fileName ) ) {
if ( image.load( dir.path() + QLatin1Char('/') + fileName ) ) {
addImage( image, fileName );
}
else {
kWarning() << "Unable to load image" << dir.path() + '/' + fileName;
kWarning() << "Unable to load image" << dir.path() + QLatin1Char('/') + fileName;
}
}
}
......
......@@ -87,7 +87,7 @@ void SignatureConfigurator::Private::init()
QVBoxLayout * page_vlay;
vlay = new QVBoxLayout( q );
vlay->setObjectName( "main layout" );
vlay->setObjectName( QLatin1String("main layout") );
vlay->setMargin( 0 );
// "enable signatue" checkbox:
......@@ -172,37 +172,37 @@ void SignatureConfigurator::Private::init()
KActionCollection *actionCollection = new KActionCollection( q );
q->mTextEdit->createActions( actionCollection );
#ifndef QT_NO_TOOLBAR
q->mEditToolBar->addAction( actionCollection->action( "format_text_bold" ) );
q->mEditToolBar->addAction( actionCollection->action( "format_text_italic" ) );
q->mEditToolBar->addAction( actionCollection->action( "format_text_underline" ) );
q->mEditToolBar->addAction( actionCollection->action( "format_text_strikeout" ) );
q->mEditToolBar->addAction( actionCollection->action( "format_text_foreground_color" ) );
q->mEditToolBar->addAction( actionCollection->action( "format_text_background_color" ) );
q->mEditToolBar->addAction( actionCollection->action( "format_font_family" ) );
q->mEditToolBar->addAction( actionCollection->action( "format_font_size" ) );
q->mEditToolBar->addAction( actionCollection->action( "format_reset" ) );
q->mFormatToolBar->addAction( actionCollection->action( "format_list_style" ) );
q->mFormatToolBar->addAction( actionCollection->action( "format_list_indent_more" ) );
q->mFormatToolBar->addAction( actionCollection->action( "format_list_indent_less" ) );
q->mFormatToolBar->addAction( actionCollection->action( "format_list_indent_less" ) );
q->mEditToolBar->addAction( actionCollection->action( QLatin1String("format_text_bold") ) );
q->mEditToolBar->addAction( actionCollection->action( QLatin1String("format_text_italic") ) );
q->mEditToolBar->addAction( actionCollection->action( QLatin1String("format_text_underline") ) );
q->mEditToolBar->addAction( actionCollection->action( QLatin1String("format_text_strikeout") ) );
q->mEditToolBar->addAction( actionCollection->action( QLatin1String("format_text_foreground_color") ) );
q->mEditToolBar->addAction( actionCollection->action( QLatin1String("format_text_background_color") ) );
q->mEditToolBar->addAction( actionCollection->action( QLatin1String("format_font_family") ) );
q->mEditToolBar->addAction( actionCollection->action( QLatin1String("format_font_size") ) );
q->mEditToolBar->addAction( actionCollection->action( QLatin1String("format_reset") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("format_list_style") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("format_list_indent_more") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("format_list_indent_less") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("format_list_indent_less") ) );
q->mFormatToolBar->addSeparator();
q->mFormatToolBar->addAction( actionCollection->action( "format_align_left" ) );
q->mFormatToolBar->addAction( actionCollection->action( "format_align_center" ) );
q->mFormatToolBar->addAction( actionCollection->action( "format_align_right" ) );
q->mFormatToolBar->addAction( actionCollection->action( "format_align_justify" ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("format_align_left") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("format_align_center") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("format_align_right") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("format_align_justify") ) );
q->mFormatToolBar->addSeparator();
q->mFormatToolBar->addAction( actionCollection->action( "insert_horizontal_rule" ) );
q->mFormatToolBar->addAction( actionCollection->action( "manage_link" ) );
q->mFormatToolBar->addAction( actionCollection->action( "format_painter" ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("insert_horizontal_rule") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("manage_link") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("format_painter") ) );
q->mFormatToolBar->addSeparator();
q->mFormatToolBar->addAction( actionCollection->action( "add_image" ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("add_image") ) );
q->mFormatToolBar->addSeparator();
q->mFormatToolBar->addAction( actionCollection->action( "insert_html" ) );
q->mFormatToolBar->addAction( actionCollection->action( "insert_table" ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("insert_html") ) );
q->mFormatToolBar->addAction( actionCollection->action( QLatin1String("insert_table" )) );
#endif
hlay = new QHBoxLayout(); // inherits spacing
......@@ -431,8 +431,8 @@ void SignatureConfigurator::Private::init()
QString html = textDocument.toHtml();
// Now remove each line from the text, the result is clean html.
foreach ( const QString& line, html.split( '\n' ) ) {
text.remove( line + '\n' );
foreach ( const QString& line, html.split( QLatin1Char('\n') ) ) {
text.remove( line + QLatin1Char('\n') );
}
return text;
}
......@@ -471,7 +471,7 @@ void SignatureConfigurator::Private::init()
void SignatureConfigurator::setImageLocation( const Identity &identity )
{
const QString dir = QString( "emailidentities/%1/" ).arg(
const QString dir = QString::fromLatin1( "emailidentities/%1/" ).arg(
QString::number( identity.uoid() ) );
setImageLocation( KStandardDirs::locateLocal( "data", dir ) );
}
......
......@@ -31,7 +31,7 @@ QTEST_KDEMAIN_CORE( IdentityTester )
void IdentityTester::test_NullIdentity()
{
IdentityManager manager;
QVERIFY( manager.identityForAddress( "thisaddressforsuredoesnotexist@kde.org" ).isNull() );
QVERIFY( manager.identityForAddress( QLatin1String("thisaddressforsuredoesnotexist@kde.org") ).isNull() );
}
void IdentityTester::test_Aliases()
......@@ -44,14 +44,14 @@ void IdentityTester::test_Aliases()
manager.commit();
}
Identity &i1 = manager.newFromScratch( "Test1" );
i1.setPrimaryEmailAddress( "firstname.lastname@example.com" );
i1.setEmailAliases( QStringList() << "firstname@example.com" << "lastname@example.com" );
QVERIFY( i1.matchesEmailAddress( "\"Lastname, Firstname\" <firstname@example.com>" ) );
QVERIFY( i1.matchesEmailAddress( "\"Lastname, Firstname\" <firstname.lastname@example.com>" ) );
Identity &i1 = manager.newFromScratch( QLatin1String("Test1") );
i1.setPrimaryEmailAddress( QLatin1String("firstname.lastname@example.com") <