summaryrefslogtreecommitdiff
path: root/kpimutils/email.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kpimutils/email.cpp')
-rw-r--r--kpimutils/email.cpp38
1 files changed, 21 insertions, 17 deletions
diff --git a/kpimutils/email.cpp b/kpimutils/email.cpp
index 5b088a3..9a63705 100644
--- a/kpimutils/email.cpp
+++ b/kpimutils/email.cpp
@@ -28,7 +28,7 @@
#include <kmime/kmime_util.h>
-// #include <kdebug.h>
+#include <QDebug>
// #include <klocale.h>
// #include <kurl.h>
@@ -40,7 +40,12 @@
// static const KCatalogLoader loader( "libkpimutils" );
using namespace KPIMUtils;
-#if 0
+
+const char* i18n(const char* str)
+{
+ return str;
+}
+
//-----------------------------------------------------------------------------
QStringList KPIMUtils::splitAddressList( const QString &aStr )
{
@@ -120,7 +125,7 @@ KPIMUtils::EmailParseResult splitAddressInternal( const QByteArray address,
QByteArray &comment,
bool allowMultipleAddresses )
{
- // kDebug() << "address";
+ // qDebug() << "address";
displayName = "";
addrSpec = "";
comment = "";
@@ -275,9 +280,9 @@ KPIMUtils::EmailParseResult splitAddressInternal( const QByteArray address,
}
}
/*
- kDebug() << "display-name : \"" << displayName << "\"";
- kDebug() << "comment : \"" << comment << "\"";
- kDebug() << "addr-spec : \"" << addrSpec << "\"";
+ qDebug() << "display-name : \"" << displayName << "\"";
+ qDebug() << "comment : \"" << comment << "\"";
+ qDebug() << "addr-spec : \"" << addrSpec << "\"";
*/
return AddressOk;
}
@@ -658,7 +663,7 @@ QByteArray KPIMUtils::extractEmailAddress( const QByteArray &address )
if ( result != AddressOk ) {
addrSpec = QByteArray();
if ( result != AddressEmpty ) {
- kDebug()
+ qDebug()
<< "Input:" << address << "\nError:"
<< emailParseResultToString( result );
}
@@ -683,7 +688,7 @@ QByteArray KPIMUtils::firstEmailAddress( const QByteArray &addresses )
if ( result != AddressOk ) {
addrSpec = QByteArray();
if ( result != AddressEmpty ) {
- kDebug()
+ qDebug()
<< "Input: aStr\nError:"
<< emailParseResultToString( result );
}
@@ -697,7 +702,7 @@ QString KPIMUtils::firstEmailAddress( const QString &addresses )
{
return QString::fromUtf8( firstEmailAddress( addresses.toUtf8() ) );
}
-#endif
+
//-----------------------------------------------------------------------------
bool KPIMUtils::extractEmailAddressAndName( const QString &aStr,
QString &mail, QString &name )
@@ -891,7 +896,7 @@ bool KPIMUtils::extractEmailAddressAndName( const QString &aStr,
return ! ( name.isEmpty() || mail.isEmpty() );
}
-#if 0
+
//-----------------------------------------------------------------------------
bool KPIMUtils::compareEmail( const QString &email1, const QString &email2,
bool matchName )
@@ -962,7 +967,7 @@ QString KPIMUtils::toIdn( const QString &addrSpec )
//-----------------------------------------------------------------------------
QString KPIMUtils::normalizeAddressesAndDecodeIdn( const QString &str )
{
- // kDebug() << str;
+ // qDebug() << str;
if ( str.isEmpty() ) {
return str;
}
@@ -990,7 +995,7 @@ QString KPIMUtils::normalizeAddressesAndDecodeIdn( const QString &str )
}
}
/*
- kDebug() << "normalizedAddressList: \""
+ qDebug() << "normalizedAddressList: \""
<< normalizedAddressList.join( ", " )
<< "\"";
*/
@@ -1000,7 +1005,7 @@ QString KPIMUtils::normalizeAddressesAndDecodeIdn( const QString &str )
//-----------------------------------------------------------------------------
QString KPIMUtils::normalizeAddressesAndEncodeIdn( const QString &str )
{
- //kDebug() << str;
+ //qDebug() << str;
if ( str.isEmpty() ) {
return str;
}
@@ -1025,13 +1030,13 @@ QString KPIMUtils::normalizeAddressesAndEncodeIdn( const QString &str )
}
/*
- kDebug() << "normalizedAddressList: \""
+ qDebug() << "normalizedAddressList: \""
<< normalizedAddressList.join( ", " )
<< "\"";
*/
return normalizedAddressList.join( ", " );
}
-#endif
+
//-----------------------------------------------------------------------------
// Escapes unescaped doublequotes in str.
static QString escapeQuotes( const QString &str )
@@ -1077,7 +1082,7 @@ QString KPIMUtils::quoteNameIfNecessary( const QString &str )
return quoted;
}
-#if 0
+
KUrl KPIMUtils::encodeMailtoUrl( const QString &mailbox )
{
const QByteArray encodedPath = KMime::encodeRFC2047String( mailbox, "utf-8" );
@@ -1092,4 +1097,3 @@ QString KPIMUtils::decodeMailtoUrl( const KUrl &mailtoUrl )
Q_ASSERT( mailtoUrl.protocol().toLower() == "mailto" );
return KMime::decodeRFC2047String( mailtoUrl.path().toUtf8() );
}
-#endif \ No newline at end of file