summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2024-09-24 15:11:17 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2024-09-24 22:10:47 +0900
commit30de6cffc72712fb00117b748a1ae14c89f92e4c (patch)
treebc1bf5b2a57cc7ec5990c20429e9b70d51bac145
parent94890b77a597743cd963422144f81df6d751a9c3 (diff)
downloadtdepim-30de6cffc72712fb00117b748a1ae14c89f92e4c.tar.gz
tdepim-30de6cffc72712fb00117b748a1ae14c89f92e4c.zip
libemailfunctions: move kAscii* functions to tdelibs
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 8e0a91b1a70d6a055a39838489a4dacfd3200740)
-rw-r--r--kmail/CMakeLists.txt4
-rw-r--r--kmail/antispamconfig.cpp2
-rw-r--r--kmail/bodypartformatter.cpp1
-rw-r--r--kmail/configuredialog.cpp4
-rw-r--r--kmail/kmmessage.cpp6
-rw-r--r--kmail/kmmsgbase.cpp10
-rw-r--r--kmail/kmmsgpart.cpp8
-rw-r--r--kmail/kmreaderwin.cpp3
-rw-r--r--kmail/partNode.cpp1
-rw-r--r--knode/CMakeLists.txt2
-rw-r--r--knode/articlewidget.cpp4
-rw-r--r--libemailfunctions/CMakeLists.txt2
-rw-r--r--libemailfunctions/Makefile.am4
-rw-r--r--libemailfunctions/kasciistringtools.cpp62
-rw-r--r--libemailfunctions/kasciistringtools.h49
-rw-r--r--tdeioslave/imap4/CMakeLists.txt2
-rw-r--r--tdeioslave/imap4/imapparser.cpp3
17 files changed, 23 insertions, 144 deletions
diff --git a/kmail/CMakeLists.txt b/kmail/CMakeLists.txt
index daa365ec2..9d503d31a 100644
--- a/kmail/CMakeLists.txt
+++ b/kmail/CMakeLists.txt
@@ -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
)
diff --git a/kmail/antispamconfig.cpp b/kmail/antispamconfig.cpp
index 75959a122..e0dbb5bfb 100644
--- a/kmail/antispamconfig.cpp
+++ b/kmail/antispamconfig.cpp
@@ -33,8 +33,6 @@
#include "antispamconfig.h"
-#include <tdeglobal.h>
-
#include <kstaticdeleter.h>
#include <tdeconfig.h>
diff --git a/kmail/bodypartformatter.cpp b/kmail/bodypartformatter.cpp
index 753608833..3ee62d970 100644
--- a/kmail/bodypartformatter.cpp
+++ b/kmail/bodypartformatter.cpp
@@ -46,7 +46,6 @@
#include <mimelib/utility.h>
#include <kdebug.h>
-#include <tdeglobal.h>
namespace {
class AnyTypeBodyPartFormatter
diff --git a/kmail/configuredialog.cpp b/kmail/configuredialog.cpp
index c0beb0fdb..2c5830abd 100644
--- a/kmail/configuredialog.cpp
+++ b/kmail/configuredialog.cpp
@@ -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) );
}
diff --git a/kmail/kmmessage.cpp b/kmail/kmmessage.cpp
index 70ba72c22..b12ae65cd 100644
--- a/kmail/kmmessage.cpp
+++ b/kmail/kmmessage.cpp
@@ -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();
}
diff --git a/kmail/kmmsgbase.cpp b/kmail/kmmsgbase.cpp
index abf1ade72..61952a00e 100644
--- a/kmail/kmmsgbase.cpp
+++ b/kmail/kmmsgbase.cpp
@@ -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;
diff --git a/kmail/kmmsgpart.cpp b/kmail/kmmsgpart.cpp
index 596828e28..c7fa30d89 100644
--- a/kmail/kmmsgpart.cpp
+++ b/kmail/kmmsgpart.cpp
@@ -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 );
diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp
index 527173480..566298b99 100644
--- a/kmail/kmreaderwin.cpp
+++ b/kmail/kmreaderwin.cpp
@@ -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 );
diff --git a/kmail/partNode.cpp b/kmail/partNode.cpp
index 6d4dfe62e..31b94d68d 100644
--- a/kmail/partNode.cpp
+++ b/kmail/partNode.cpp
@@ -39,7 +39,6 @@
#include "kmmimeparttree.h"
#include <mimelib/utility.h>
#include <tqregexp.h>
-#include <tdeglobal.h>
#include "util.h"
/*
diff --git a/knode/CMakeLists.txt b/knode/CMakeLists.txt
index a21deffb5..ae3c46c93 100644
--- a/knode/CMakeLists.txt
+++ b/knode/CMakeLists.txt
@@ -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}
)
diff --git a/knode/articlewidget.cpp b/knode/articlewidget.cpp
index faf4b4e8b..9e91d090f 100644
--- a/knode/articlewidget.cpp
+++ b/knode/articlewidget.cpp
@@ -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=\"" +
diff --git a/libemailfunctions/CMakeLists.txt b/libemailfunctions/CMakeLists.txt
index 70b69d141..abd46f505 100644
--- a/libemailfunctions/CMakeLists.txt
+++ b/libemailfunctions/CMakeLists.txt
@@ -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
)
diff --git a/libemailfunctions/Makefile.am b/libemailfunctions/Makefile.am
index ece8b103c..2d8fc3dfc 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 \
- 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/kasciistringtools.cpp b/libemailfunctions/kasciistringtools.cpp
deleted file mode 100644
index 9d7590af1..000000000
--- a/libemailfunctions/kasciistringtools.cpp
+++ /dev/null
@@ -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
diff --git a/libemailfunctions/kasciistringtools.h b/libemailfunctions/kasciistringtools.h
deleted file mode 100644
index c67e5c317..000000000
--- a/libemailfunctions/kasciistringtools.h
+++ /dev/null
@@ -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
diff --git a/tdeioslave/imap4/CMakeLists.txt b/tdeioslave/imap4/CMakeLists.txt
index 041aeffca..b62d61dc9 100644
--- a/tdeioslave/imap4/CMakeLists.txt
+++ b/tdeioslave/imap4/CMakeLists.txt
@@ -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}
)
diff --git a/tdeioslave/imap4/imapparser.cpp b/tdeioslave/imap4/imapparser.cpp
index 993c5c62d..bffe88d03 100644
--- a/tdeioslave/imap4/imapparser.cpp
+++ b/tdeioslave/imap4/imapparser.cpp
@@ -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)