diff options
Diffstat (limited to 'libemailfunctions')
-rw-r--r-- | libemailfunctions/CMakeLists.txt | 3 | ||||
-rw-r--r-- | libemailfunctions/Makefile.am | 4 | ||||
-rw-r--r-- | libemailfunctions/email.cpp | 3 | ||||
-rw-r--r-- | libemailfunctions/email.h | 45 | ||||
-rw-r--r-- | libemailfunctions/idmapper.cpp | 2 | ||||
-rw-r--r-- | libemailfunctions/idmapper.h | 4 | ||||
-rw-r--r-- | libemailfunctions/kasciistricmp.cpp | 47 | ||||
-rw-r--r-- | libemailfunctions/kasciistricmp.h | 28 | ||||
-rw-r--r-- | libemailfunctions/kasciistringtools.cpp | 62 | ||||
-rw-r--r-- | libemailfunctions/kasciistringtools.h | 49 | ||||
-rw-r--r-- | libemailfunctions/networkstatus.h | 2 |
11 files changed, 29 insertions, 220 deletions
diff --git a/libemailfunctions/CMakeLists.txt b/libemailfunctions/CMakeLists.txt index 725dbe07..abd46f50 100644 --- a/libemailfunctions/CMakeLists.txt +++ b/libemailfunctions/CMakeLists.txt @@ -33,6 +33,5 @@ endif() tde_add_library( emailfunctions STATIC_PIC AUTOMOC SOURCES - email.cpp idmapper.cpp kasciistricmp.cpp - kasciistringtools.cpp networkstatus.cpp networkstatus.skel + email.cpp idmapper.cpp networkstatus.cpp networkstatus.skel ) diff --git a/libemailfunctions/Makefile.am b/libemailfunctions/Makefile.am index f631afa3..2d8fc3df 100644 --- a/libemailfunctions/Makefile.am +++ b/libemailfunctions/Makefile.am @@ -1,9 +1,7 @@ INCLUDES = $(all_includes) -I$(srcdir)/../libkmime/ noinst_LTLIBRARIES = libemailfunctions.la -libemailfunctions_la_SOURCES = email.cpp idmapper.cpp kasciistricmp.cpp \ - kasciistringtools.cpp \ - networkstatus.cpp networkstatus.skel +libemailfunctions_la_SOURCES = email.cpp idmapper.cpp networkstatus.cpp networkstatus.skel libemailfunctions_la_LDFLAGS = $(all_libraries) -no-undefined ## Since this is a noinst library, in case of --enable-closure we need ## to link it explicitly to the libraries that it uses. diff --git a/libemailfunctions/email.cpp b/libemailfunctions/email.cpp index 03999f87..d44897be 100644 --- a/libemailfunctions/email.cpp +++ b/libemailfunctions/email.cpp @@ -1,5 +1,4 @@ -/* -*- mode: C++; c-file-style: "gnu" -*- - +/* This file is part of tdepim. Copyright (c) 2004 TDEPIM developers diff --git a/libemailfunctions/email.h b/libemailfunctions/email.h index 6c2a522d..abde8e05 100644 --- a/libemailfunctions/email.h +++ b/libemailfunctions/email.h @@ -1,5 +1,4 @@ -/* -*- mode: C++; c-file-style: "gnu" -*- - +/* This file is part of tdepim. Copyright (c) 2004 TDEPIM developers @@ -25,7 +24,7 @@ #include <tqstringlist.h> #include <tqcstring.h> -#include <tdepimmacros.h> +#include <tdemacros.h> /** @file */ @@ -51,7 +50,7 @@ enum EmailParseResult { AddressOk, AddressEmpty, UnexpectedEnd, // Helper functions /** Split a comma separated list of email addresses. */ -KDE_EXPORT TQStringList splitEmailAddrList(const TQString& aStr); +TDE_EXPORT TQStringList splitEmailAddrList(const TQString& aStr); /** Splits the given address into display name, email address and comment. Returns AddressOk if no error was encountered. Otherwise an appropriate @@ -72,7 +71,7 @@ KDE_EXPORT TQStringList splitEmailAddrList(const TQString& aStr); @return AddressOk if no error was encountered. Otherwise an appropriate error code is returned. */ -KDE_EXPORT EmailParseResult splitAddress( const TQCString & address, +TDE_EXPORT EmailParseResult splitAddress( const TQCString & address, TQCString & displayName, TQCString & addrSpec, TQCString & comment ); @@ -99,7 +98,7 @@ KDE_EXPORT EmailParseResult splitAddress( const TQCString & address, @return AddressOk if no error was encountered. Otherwise an appropriate error code is returned. */ -KDE_EXPORT EmailParseResult splitAddress( const TQString & address, +TDE_EXPORT EmailParseResult splitAddress( const TQString & address, TQString & displayName, TQString & addrSpec, TQString & comment ); @@ -113,7 +112,7 @@ KDE_EXPORT EmailParseResult splitAddress( const TQString & address, @return AddressOk if no error was encountered. Otherwise an appropriate error code is returned. */ -KDE_EXPORT EmailParseResult isValidEmailAddress( const TQString& aStr ); +TDE_EXPORT EmailParseResult isValidEmailAddress( const TQString& aStr ); /** Translate the enum errorcodes from emailParseResult into i18n'd strings that can be used for msg boxes. @@ -122,7 +121,7 @@ KDE_EXPORT EmailParseResult isValidEmailAddress( const TQString& aStr ); @return An i18n ready string for use in msgboxes. */ -KDE_EXPORT TQString emailParseResultToString( EmailParseResult errorCode ); +TDE_EXPORT TQString emailParseResultToString( EmailParseResult errorCode ); /** Validates an email address in the form of joe@example.org. Returns true if no error was encountered. @@ -134,7 +133,7 @@ KDE_EXPORT TQString emailParseResultToString( EmailParseResult errorCode ); example: joe.user@example.org @return true if no error was encountered. */ -KDE_EXPORT bool isValidSimpleEmailAddress( const TQString& aStr ); +TDE_EXPORT bool isValidSimpleEmailAddress( const TQString& aStr ); /** Returns a i18n string to be used in msgboxes this allows for error messages to be the same @@ -143,7 +142,7 @@ KDE_EXPORT bool isValidSimpleEmailAddress( const TQString& aStr ); @return An i18n ready string for use in msgboxes. */ -KDE_EXPORT TQString simpleEmailAddressErrorMsg(); +TDE_EXPORT TQString simpleEmailAddressErrorMsg(); /** Returns the pure email address (addr-spec in RFC2822) of the given address (mailbox in RFC2822). @@ -152,7 +151,7 @@ KDE_EXPORT TQString simpleEmailAddressErrorMsg(); @return the addr-spec of @a address, i.e. joe.user@example.org in the example */ -KDE_EXPORT TQCString getEmailAddress( const TQCString & address ); +TDE_EXPORT TQCString getEmailAddress( const TQCString & address ); /** This is an overloaded member function, provided for convenience. It behaves essentially like the above function. @@ -164,7 +163,7 @@ KDE_EXPORT TQCString getEmailAddress( const TQCString & address ); @return the addr-spec of @a address, i.e. joe.user@example.org in the example */ -KDE_EXPORT TQString getEmailAddress( const TQString & address ); +TDE_EXPORT TQString getEmailAddress( const TQString & address ); /** Returns the pure email address (addr-spec in RFC2822) of the first email address of a list of addresses. @@ -173,7 +172,7 @@ KDE_EXPORT TQString getEmailAddress( const TQString & address ); @return the addr-spec of @a addresses, i.e. joe.user@example.org in the example */ -KDE_EXPORT TQCString getFirstEmailAddress( const TQCString & addresses ); +TDE_EXPORT TQCString getFirstEmailAddress( const TQCString & addresses ); /** This is an overloaded member function, provided for convenience. It behaves essentially like the above function. @@ -185,24 +184,24 @@ KDE_EXPORT TQCString getFirstEmailAddress( const TQCString & addresses ); @return the addr-spec of @a addresses, i.e. joe.user@example.org in the example */ -KDE_EXPORT TQString getFirstEmailAddress( const TQString & addresses ); +TDE_EXPORT TQString getFirstEmailAddress( const TQString & addresses ); /** Return email address and name from string. Examples: * "Stefan Taferner <taferner@example.org>" returns "taferner@example.org" * and "Stefan Taferner". "joe@example.com" returns "joe@example.com" * and "". Note that this only returns the first address. - * Also note that the return value is TRUE if both the name and the + * Also note that the return value is true if both the name and the * mail are not empty: this does NOT tell you if mail contains a * valid email address or just some rubbish. */ -KDE_EXPORT bool getNameAndMail(const TQString& aStr, TQString& name, TQString& mail); +TDE_EXPORT bool getNameAndMail(const TQString& aStr, TQString& name, TQString& mail); /** * Compare two email addresses. If matchName is false, it just checks * the email address, and returns true if this matches. If matchName * is true, both the name and the email must be the same. */ -KDE_EXPORT bool compareEmail( const TQString& email1, const TQString& email2, +TDE_EXPORT bool compareEmail( const TQString& email1, const TQString& email2, bool matchName ); /** Returns a normalized address built from the given parts. The normalized @@ -217,7 +216,7 @@ KDE_EXPORT bool compareEmail( const TQString& email1, const TQString& email2, @param comment a comment @return a normalized address built from the given parts */ -KDE_EXPORT TQString normalizedAddress( const TQString & displayName, +TDE_EXPORT TQString normalizedAddress( const TQString & displayName, const TQString & addrSpec, const TQString & comment ); @@ -226,7 +225,7 @@ KDE_EXPORT TQString normalizedAddress( const TQString & displayName, @param addrSpec a pure 7-bit email address (addr-spec in RFC2822) @return the email address with Unicode domain */ -KDE_EXPORT TQString decodeIDN( const TQString & addrSpec ); +TDE_EXPORT TQString decodeIDN( const TQString & addrSpec ); /** Encodes the domain part of the given addr-spec in punycode if it's an IDN. @@ -234,7 +233,7 @@ KDE_EXPORT TQString decodeIDN( const TQString & addrSpec ); @param addrSpec a pure email address with Unicode domain @return the email address with domain in punycode */ -KDE_EXPORT TQString encodeIDN( const TQString & addrSpec ); +TDE_EXPORT TQString encodeIDN( const TQString & addrSpec ); /** Normalizes all email addresses in the given list and decodes all IDNs. @@ -242,17 +241,17 @@ KDE_EXPORT TQString encodeIDN( const TQString & addrSpec ); @return the email addresses in normalized form with Unicode IDNs */ -KDE_EXPORT TQString normalizeAddressesAndDecodeIDNs( const TQString & addresses ); +TDE_EXPORT TQString normalizeAddressesAndDecodeIDNs( const TQString & addresses ); /** Normalizes all email addresses in the given list and encodes all IDNs in punycode. */ -KDE_EXPORT TQString normalizeAddressesAndEncodeIDNs( const TQString & str ); +TDE_EXPORT TQString normalizeAddressesAndEncodeIDNs( const TQString & str ); /** Add quote characters around the given string if it contains a * character that makes that necessary, in an email name, such as ",". */ -KDE_EXPORT TQString quoteNameIfNecessary( const TQString& str ); +TDE_EXPORT TQString quoteNameIfNecessary( const TQString& str ); } // namespace diff --git a/libemailfunctions/idmapper.cpp b/libemailfunctions/idmapper.cpp index 34bcf6cc..9e197af5 100644 --- a/libemailfunctions/idmapper.cpp +++ b/libemailfunctions/idmapper.cpp @@ -22,7 +22,7 @@ #include "idmapper.h" -#include <kstandarddirs.h> +#include <tdestandarddirs.h> #include <kdebug.h> #include <tqfile.h> diff --git a/libemailfunctions/idmapper.h b/libemailfunctions/idmapper.h index 50075aef..557e61ec 100644 --- a/libemailfunctions/idmapper.h +++ b/libemailfunctions/idmapper.h @@ -25,7 +25,7 @@ #include <tqmap.h> #include <tqvariant.h> -#include <tdepimmacros.h> +#include <tdemacros.h> namespace KPIM { @@ -34,7 +34,7 @@ namespace KPIM { clear, but maps have categories. This is probably an adjoint functor, since adjoint functors are everywhere. */ -class KDE_EXPORT IdMapper +class TDE_EXPORT IdMapper { public: /** diff --git a/libemailfunctions/kasciistricmp.cpp b/libemailfunctions/kasciistricmp.cpp deleted file mode 100644 index 2852bb42..00000000 --- a/libemailfunctions/kasciistricmp.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2004 David Faure <faure@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "kasciistricmp.h" - -#if ! KDE_IS_VERSION(3,3,89) - -static unsigned char tdepim_ASCIIToLower( unsigned char ch ) -{ - if ( ch >= 'A' && ch <= 'Z' ) - return ch - 'A' + 'a'; - else - return ch; -} - -int tdepim_kasciistricmp( const char *str1, const char *str2 ) -{ - const unsigned char *s1 = (const unsigned char *) str1; - const unsigned char *s2 = (const unsigned char *) str2; - int res; - unsigned char c; - - if ( !s1 || !s2 ) - return s1 ? 1 : ( s2 ? -1 : 0 ); - for ( ; !( res = ( c = tdepim_ASCIIToLower( *s1 ) ) - tdepim_ASCIIToLower( *s2 ) ); - ++s1, ++s2 ) - if ( !c ) // strings are equal - break; - return res; -} - -#endif diff --git a/libemailfunctions/kasciistricmp.h b/libemailfunctions/kasciistricmp.h deleted file mode 100644 index 10c1551e..00000000 --- a/libemailfunctions/kasciistricmp.h +++ /dev/null @@ -1,28 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2004 David Faure <faure@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include <tdeversion.h> - -#if KDE_IS_VERSION(3,3,89) -// get kasciistricmp from tdeglobal.h -#include <tdeglobal.h> -#else -// define kasciistricmp to this tdepim symbol (renamed to avoid problems when upgrading tdelibs later) -int tdepim_kasciistricmp( const char *str1, const char *str2 ); -#define kasciistricmp tdepim_kasciistricmp -#endif diff --git a/libemailfunctions/kasciistringtools.cpp b/libemailfunctions/kasciistringtools.cpp deleted file mode 100644 index a9e6fb60..00000000 --- a/libemailfunctions/kasciistringtools.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- - kasciistringtools.cpp - - This file is part of libtdepim. - - Copyright (c) 2005 Ingo Kloecker <kloecker@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "kasciistringtools.h" - -namespace KPIM { - -static unsigned char ASCIIToLower( unsigned char ch ) -{ - if ( ch >= 'A' && ch <= 'Z' ) - return ch - 'A' + 'a'; - else - return ch; -} - -char * kAsciiToLower( char *s ) -{ - if ( !s ) - return 0; - for ( unsigned char *p = (unsigned char *) s; *p; ++p ) - *p = ASCIIToLower( *p ); - return s; -} - -static unsigned char ASCIIToUpper( unsigned char ch ) -{ - if ( ch >= 'a' && ch <= 'z' ) - return ch - 'a' + 'A'; - else - return ch; -} - -char * kAsciiToUpper( char *s ) -{ - if ( !s ) - return 0; - for ( unsigned char *p = (unsigned char *) s; *p; ++p ) - *p = ASCIIToUpper( *p ); - return s; -} - -} // namespace KPIM diff --git a/libemailfunctions/kasciistringtools.h b/libemailfunctions/kasciistringtools.h deleted file mode 100644 index ac19960d..00000000 --- a/libemailfunctions/kasciistringtools.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- c++ -*- - kasciistringtools.h - - This file is part of libtdepim. - - Copyright (c) 2005 Ingo Kloecker <kloecker@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KPIM_KASCIISTRINGTOOLS_H -#define KPIM_KASCIISTRINGTOOLS_H - -namespace KPIM { - -/** - Locale-independent function to convert ASCII strings to lower case ASCII - strings. This means that it affects @em only the ASCII characters A-Z. - - @param str pointer to the string which should be converted to lower case - @return pointer to the converted string (same as @a str) -*/ -char * kAsciiToLower( char *str ); - -/** - Locale-independent function to convert ASCII strings to upper case ASCII - strings. This means that it affects @em only the ASCII characters a-z. - - @param str pointer to the string which should be converted to upper case - @return pointer to the converted string (same as @a str) -*/ -char * kAsciiToUpper( char *str ); - -} // namespace KPIM - -#endif diff --git a/libemailfunctions/networkstatus.h b/libemailfunctions/networkstatus.h index 0aee114e..d05adcef 100644 --- a/libemailfunctions/networkstatus.h +++ b/libemailfunctions/networkstatus.h @@ -34,7 +34,7 @@ namespace KPIM { */ class NetworkStatus : public TQObject, public DCOPObject { - Q_OBJECT + TQ_OBJECT public: /** |