libemailfunctions: move kAscii* functions to tdelibs

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/135/head
Michele Calgaro 2 months ago
parent 1fb5101d49
commit 8e0a91b1a7
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -212,8 +212,8 @@ add_custom_target( kmail_settings_base
tde_add_library( ${target} SHARED AUTOMOC
SOURCES ${${target}_SRCS}
LINK
emailfunctions-static kmime-shared kpgp-shared tdepim-shared kpimidentities-shared
mimelib-shared ksieve-shared tdehtml-shared ${INDEX_LIBRARY}
kmime-shared kpgp-shared tdepim-shared kpimidentities-shared
mimelib-shared ksieve-shared tdecore-shared tdehtml-shared ${INDEX_LIBRARY}
DESTINATION ${LIB_INSTALL_DIR}
DEPENDENCIES kmail_settings_base
)

@ -33,8 +33,6 @@
#include "antispamconfig.h"
#include <tdeglobal.h>
#include <kstaticdeleter.h>
#include <tdeconfig.h>

@ -46,7 +46,6 @@
#include <mimelib/utility.h>
#include <kdebug.h>
#include <tdeglobal.h>
namespace {
class AnyTypeBodyPartFormatter

@ -85,7 +85,6 @@ using KMime::DateFormatter;
#include <tdelocale.h>
#include <tdeapplication.h>
#include <kcharsets.h>
#include <kasciistringtools.h>
#include <kdebug.h>
#include <knuminput.h>
#include <tdefontdialog.h>
@ -117,6 +116,7 @@ using KMime::DateFormatter;
#include <tqlayout.h>
#include <tqcheckbox.h>
#include <tqwidgetstack.h>
#include <tqglobal.h>
// other headers:
#include <assert.h>
@ -3327,7 +3327,7 @@ void ComposerPage::CharsetTab::doLoadOther() {
it != charsets.end() ; ++it )
if ( (*it) == TQString::fromLatin1("locale") ) {
TQCString cset = kmkernel->networkCodec()->mimeName();
KPIM::kAsciiToLower( cset.data() );
kasciitolower( cset.data() );
(*it) = TQString("%1 (locale)").arg( TQString(cset) );
}

@ -28,8 +28,6 @@ using KMail::HeaderStrategy;
#include <libkpimidentities/identitymanager.h>
#include <libemailfunctions/email.h>
#include <kasciistringtools.h>
#include <kpgpblock.h>
#include <kaddrbook.h>
@ -4083,7 +4081,7 @@ TQCString KMMessage::defaultCharset()
if (retval.isEmpty() || (retval == "locale")) {
retval = TQCString(kmkernel->networkCodec()->mimeName());
KPIM::kAsciiToLower( retval.data() );
kasciitolower( retval.data() );
}
if (retval == "jisx0208.1983-0") retval = "iso-2022-jp";
@ -4145,7 +4143,7 @@ void KMMessage::setCharset( const TQCString &charset, DwEntity *entity )
mType.SetModified();
TQCString lowerCharset = charset;
KPIM::kAsciiToLower( lowerCharset.data() );
kasciitolower( lowerCharset.data() );
param->SetValue( DwString( lowerCharset ) );
mType.Assemble();
}

@ -15,13 +15,13 @@ using KMail::MessageProperty;
#include <kdebug.h>
#include <tdeglobal.h>
#include <kcharsets.h>
#include <kasciistringtools.h>
#include <kmdcodec.h>
#include <krfcdate.h>
#include <mimelib/mimepp.h>
#include <kmime_codecs.h>
#include <tqglobal.h>
#include <tqtextcodec.h>
#include <tqdeepcopy.h>
#include <tqregexp.h>
@ -575,7 +575,7 @@ const TQTextCodec* KMMsgBase::codecForName(const TQCString& _str)
{
if (_str.isEmpty()) return 0;
TQCString codec = _str;
KPIM::kAsciiToLower(codec.data());
kasciitolower(codec.data());
return TDEGlobal::charsets()->codecForName(codec);
}
@ -790,7 +790,7 @@ TQCString KMMsgBase::encodeRFC2047String(const TQString& _str,
if (charset.isEmpty())
{
cset = kmkernel->networkCodec()->mimeName();
KPIM::kAsciiToLower(cset.data());
kasciitolower(cset.data());
}
else cset = charset;
@ -881,7 +881,7 @@ TQCString KMMsgBase::encodeRFC2231String( const TQString& _str,
if ( charset.isEmpty() )
{
cset = kmkernel->networkCodec()->mimeName();
KPIM::kAsciiToLower( cset.data() );
kasciitolower( cset.data() );
}
else
cset = charset;
@ -1049,7 +1049,7 @@ TQCString KMMsgBase::autoDetectCharset(const TQCString &_encoding, const TQStrin
if (encoding == "locale")
{
encoding = kmkernel->networkCodec()->mimeName();
KPIM::kAsciiToLower(encoding.data());
kasciitolower(encoding.data());
}
if (text.isEmpty())
return encoding;

@ -12,7 +12,6 @@
#include "globalsettings.h"
#include "util.h"
#include <kasciistringtools.h>
#include <kmime_charfreq.h>
#include <kmime_codecs.h>
#include <mimelib/enum.h>
@ -21,6 +20,7 @@
#include <kiconloader.h>
#include <tqtextcodec.h>
#include <tqglobal.h>
#include <assert.h>
@ -41,8 +41,8 @@ KMMessagePart::KMMessagePart( TQDataStream & stream )
stream >> mOriginalContentTypeStr >> mName >> mContentDescription
>> mContentDisposition >> mCte >> size >> mPartSpecifier;
KPIM::kAsciiToLower( mContentDisposition.data() );
KPIM::kAsciiToUpper( mOriginalContentTypeStr.data() );
kasciitolower( mContentDisposition.data() );
kasciitoupper( mOriginalContentTypeStr.data() );
// set the type
int sep = mOriginalContentTypeStr.find('/');
@ -435,7 +435,7 @@ void KMMessagePart::magicSetType(bool aAutoDecode)
TQString KMMessagePart::iconName( int size ) const
{
TQCString mimeType( mType + "/" + mSubtype );
KPIM::kAsciiToLower( mimeType.data() );
kasciitolower( mimeType.data() );
TQString fileName =
KMimeType::mimeType( mimeType )->icon( TQString(), false );

@ -64,7 +64,6 @@ using KMail::FileHtmlWriter;
using KMail::TeeHtmlWriter;
#endif
#include <kasciistringtools.h>
#include <kstringhandler.h>
#include <mimelib/mimepp.h>
@ -2350,7 +2349,7 @@ void KMReaderWin::openAttachment( int id, const TQString & name )
}
TQCString contentTypeStr( msgPart.typeStr() + '/' + msgPart.subtypeStr() );
KPIM::kAsciiToLower( contentTypeStr.data() );
kasciitolower( contentTypeStr.data() );
if ( qstrcmp( contentTypeStr, "text/x-vcard" ) == 0 ) {
showVCard( &msgPart );

@ -39,7 +39,6 @@
#include "kmmimeparttree.h"
#include <mimelib/utility.h>
#include <tqregexp.h>
#include <tdeglobal.h>
#include "util.h"
/*

@ -84,7 +84,7 @@ tde_add_library( knodecommon SHARED AUTOMOC
kncollectionview.cpp articlewidget.cpp csshelper.cpp
smtpaccountwidget_base.ui
VERSION 3.0.0
LINK emailfunctions-static tdepim-shared kpgp-shared tdehtml-shared
LINK tdecore-shared tdepim-shared kpgp-shared tdehtml-shared
DESTINATION ${LIB_INSTALL_DIR}
)

@ -43,9 +43,9 @@
#include <kstandarddirs.h>
#include <tdetempfile.h>
#include <kurl.h>
#include <tdeglobal.h>
#include <libemailfunctions/email.h>
#include <libemailfunctions/kasciistringtools.h>
#include <libkpgp/kpgp.h>
#include <libkpgp/kpgpblock.h>
@ -881,7 +881,7 @@ void ArticleWidget::displayAttachment( KMime::Content *att, int partNum )
}
} else { // icon
TQCString mimetype = ct->mimeType();
KPIM::kAsciiToLower( mimetype.data() );
kasciitolower( mimetype.data() );
TQString iconName = KMimeType::mimeType( mimetype )->icon( TQString(), false );
TQString iconFile = TDEGlobal::instance()->iconLoader()->iconPath( iconName, TDEIcon::Desktop );
html += "<div><a href=\"" + href + "\"><img src=\"" +

@ -33,5 +33,5 @@ endif()
tde_add_library( emailfunctions STATIC_PIC AUTOMOC
SOURCES
email.cpp idmapper.cpp kasciistringtools.cpp networkstatus.cpp networkstatus.skel
email.cpp idmapper.cpp networkstatus.cpp networkstatus.skel
)

@ -1,9 +1,7 @@
INCLUDES = $(all_includes) -I$(srcdir)/../libkmime/
noinst_LTLIBRARIES = libemailfunctions.la
libemailfunctions_la_SOURCES = email.cpp idmapper.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.

@ -1,62 +0,0 @@
/*
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

@ -1,49 +0,0 @@
/*
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

@ -41,6 +41,6 @@ tde_add_kpart( tdeio_imap4
imapcommand.cpp imaplist.cpp mailaddress.cpp mimeheader.cpp
rfcdecoder.cpp imap4.cpp imapinfo.cpp imapparser.cpp
mailheader.cpp mimehdrline.cpp mimeio.cpp
LINK emailfunctions-static kmime-shared tdeio-shared ${SASL_LIBRARY}
LINK kmime-shared tdecore-shared tdeio-shared ${SASL_LIBRARY}
DESTINATION ${PLUGIN_INSTALL_DIR}
)

@ -57,7 +57,6 @@ extern "C" {
#include <kurl.h>
#include <tdeglobal.h>
#include <kasciistringtools.h>
#ifdef HAVE_LIBSASL2
static sasl_callback_t callbacks[] = {
@ -679,7 +678,7 @@ imapParser::parseResult (TQByteArray & result, parseString & rest,
void imapParser::parseCapability (parseString & result)
{
TQCString temp( result.cstr() );
imapCapabilities = TQStringList::split ( ' ', KPIM::kAsciiToLower( temp.data() ) );
imapCapabilities = TQStringList::split ( ' ', kasciitolower( temp.data() ) );
}
void imapParser::parseFlags (parseString & result)

Loading…
Cancel
Save