From 533bad2a1503973aaf8186691422c2eda91d02d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 3 Sep 2013 20:02:55 +0200 Subject: Additional k => tde renaming and fixes --- kmail/CMakeLists.txt | 2 +- kmail/Makefile.am | 8 +-- kmail/folderdiaacltab.h | 2 +- kmail/folderdiaquotatab.h | 2 +- kmail/headerstyle.cpp | 30 ++++----- kmail/imapaccountbase.cpp | 2 +- kmail/imapaccountbase.h | 10 +-- kmail/imapjob.cpp | 2 +- kmail/keyresolver.cpp | 2 +- kmail/kmacctimap.cpp | 2 +- kmail/kmacctimap.h | 2 +- kmail/kmail_part.cpp | 2 +- kmail/kmcommands.cpp | 4 +- kmail/kmcomposewin.cpp | 2 +- kmail/kmcomposewin.h | 2 +- kmail/kmdict.cpp | 117 +++++++++++++++++++++++++++++++++++ kmail/kmdict.h | 68 ++++++++++++++++++++ kmail/kmfolderdia.h | 4 +- kmail/kmmainwin.cpp | 2 +- kmail/kmmsgdict.cpp | 2 +- kmail/kmreaderwin.cpp | 2 +- kmail/networkaccount.h | 2 +- kmail/popaccount.h | 10 +-- kmail/recipientspicker.cpp | 2 +- kmail/redirectdialog.cpp | 2 +- kmail/tdelistboxdialog.h | 4 +- kmail/tdelistviewindexedsearchline.h | 6 +- kmail/tdemdict.cpp | 117 ----------------------------------- kmail/tdemdict.h | 68 -------------------- kmail/tests/Makefile.am | 2 +- kmail/tests/messagedicttests.cpp | 2 +- kmail/tests/mimelibtests.cpp | 4 +- kmail/tests/storagelayermodule.cpp | 4 +- kmail/tests/utiltests.cpp | 4 +- 34 files changed, 248 insertions(+), 248 deletions(-) create mode 100644 kmail/kmdict.cpp create mode 100644 kmail/kmdict.h delete mode 100644 kmail/tdemdict.cpp delete mode 100644 kmail/tdemdict.h (limited to 'kmail') diff --git a/kmail/CMakeLists.txt b/kmail/CMakeLists.txt index 75b32fc2..d3c1d7a7 100644 --- a/kmail/CMakeLists.txt +++ b/kmail/CMakeLists.txt @@ -141,7 +141,7 @@ set( ${target}_SRCS kmcomposewin.cpp kmfolder.cpp kmmsgpartdlg.cpp kmreaderwin.cpp htmlstatusbar.cpp kmgroupware.cpp folderstorage.cpp listjob.cpp csshelper.cpp tdelistboxdialog.cpp kmmsginfo.cpp actionscheduler.cpp messageproperty.cpp accountmanager.cpp kmacctfolder.cpp - tdemdict.cpp kmsystemtray.cpp kmacctlocal.cpp kmfolderdir.cpp kmfoldermgr.cpp + kmdict.cpp kmsystemtray.cpp kmacctlocal.cpp kmfolderdir.cpp kmfoldermgr.cpp kmfoldernode.cpp kmsender.cpp kmacctseldlg.cpp kmfiltermgr.cpp kmfilterdlg.cpp filterimporterexporter.cpp kmsearchpatternedit.cpp encodingdetector.cpp encodingdetector_ja.cpp kmfilteraction.cpp kmsearchpattern.cpp kmfolderimap.cpp kmfolderseldlg.cpp kmfilter.cpp diff --git a/kmail/Makefile.am b/kmail/Makefile.am index f96fdc40..4c74b1b7 100644 --- a/kmail/Makefile.am +++ b/kmail/Makefile.am @@ -32,7 +32,7 @@ libkmailprivate_la_LIBADD = \ ../libksieve/libksieve.la ../libemailfunctions/libemailfunctions.la \ ../certmanager/lib/libkleopatra.la $(INDEXLIB) \ ../libkcal/libkcal.la \ - $(LIB_TDEHTML) $(LIB_KSPELL) $(LIB_TDEABC) + $(LIB_TDEHTML) $(LIB_TDESPELL) $(LIB_TDEABC) kde_module_LTLIBRARIES = kcm_kmail.la libkmailpart.la libkmail_bodypartformatter_application_octetstream.la libkmailpart_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version -no-undefined @@ -65,7 +65,7 @@ libkmailprivate_la_SOURCES = kmmessage.cpp kmmainwin.cpp configuredialog.cpp \ csshelper.cpp tdelistboxdialog.cpp \ actionscheduler.cpp messageproperty.cpp \ kmmsgpart.cpp kmmsginfo.cpp \ - accountmanager.cpp kmacctfolder.cpp tdemdict.cpp \ + accountmanager.cpp kmacctfolder.cpp kmdict.cpp \ kmsystemtray.cpp kmacctlocal.cpp kmfolderdir.cpp \ kmfoldermgr.cpp kmfoldernode.cpp kmsender.cpp \ kmacctseldlg.cpp kmfiltermgr.cpp kmsearchpatternedit.cpp \ @@ -176,11 +176,11 @@ check_PROGRAMS = dcoptest recipienteditortest METASOURCES = AUTO dcoptest_SOURCES = dcoptest.cpp kmailIface.skel kmailIface.stub mailcomposerIface.skel mailcomposerIface.stub -dcoptest_LDADD = $(LIB_KIO) +dcoptest_LDADD = $(LIB_TDEIO) dcoptest_LDFLAGS = $(all_libraries) recipienteditortest_SOURCES = recipientseditortest.cpp -recipienteditortest_LDADD = libkmailprivate.la ../libtdepim/libtdepim.la $(LIB_KIO) $(LIB_TDEABC) +recipienteditortest_LDADD = libkmailprivate.la ../libtdepim/libtdepim.la $(LIB_TDEIO) $(LIB_TDEABC) recipienteditortest_LDFLAGS = $(all_libraries) kmailIface_DCOPIDLNG = true diff --git a/kmail/folderdiaacltab.h b/kmail/folderdiaacltab.h index 6ae09fec..bc619c4e 100644 --- a/kmail/folderdiaacltab.h +++ b/kmail/folderdiaacltab.h @@ -99,7 +99,7 @@ public: static bool supports( KMFolder* refFolder ); private slots: - // Network (KIO) slots + // Network (TDEIO) slots void slotConnectionResult( int, const TQString& ); void slotReceivedACL( KMFolder*, TDEIO::Job*, const KMail::ACLList& ); void slotMultiSetACLResult(TDEIO::Job *); diff --git a/kmail/folderdiaquotatab.h b/kmail/folderdiaquotatab.h index dd36cf97..6b260035 100644 --- a/kmail/folderdiaquotatab.h +++ b/kmail/folderdiaquotatab.h @@ -68,7 +68,7 @@ private: void initializeWithValuesFromFolder( KMFolder* folder ); void showQuotaWidget(); private slots: - // Network (KIO) slots + // Network (TDEIO) slots void slotConnectionResult( int, const TQString& ); void slotReceivedQuotaInfo( KMFolder*, TDEIO::Job*, const KMail::QuotaInfo& ); diff --git a/kmail/headerstyle.cpp b/kmail/headerstyle.cpp index 9e654d68..f7c2973e 100644 --- a/kmail/headerstyle.cpp +++ b/kmail/headerstyle.cpp @@ -276,14 +276,14 @@ namespace KMail { #if 0 // Get Instant Messaging presence TQString presence; - TQString kabcUid; + TQString tdeabcUid; if ( strategy->showHeader( "status" ) ) { TDEABC::AddressBook *addressBook = TDEABC::StdAddressBook::self( true ); TDEABC::AddresseeList addresses = addressBook->findByEmail( KPIM::getFirstEmailAddress( message->from() ) ); ::KIMProxy *imProxy = KMKernel::self()->imProxy(); - kabcUid = addresses[0].uid(); - presence = imProxy->presenceString( kabcUid ); + tdeabcUid = addresses[0].uid(); + presence = imProxy->presenceString( tdeabcUid ); } #endif @@ -298,7 +298,7 @@ namespace KMail { "\">" + i18n("[vCard]") + "" ); #if 0 if ( !presence.isEmpty() && strategy->showHeader( "status" ) ) - headerStr.append("  (" + presence + ")" ); + headerStr.append("  (" + presence + ")" ); #endif if ( strategy->showHeader( "organization" ) @@ -473,10 +473,10 @@ namespace KMail { TQString userHTML; TQString presence; - // IM presence and kabc photo + // IM presence and tdeabc photo ::KIMProxy *imProxy = KMKernel::self()->imProxy(); - TQString kabcUid; + TQString tdeabcUid; TDEABC::AddressBook *addressBook = TDEABC::StdAddressBook::self( true ); TDEABC::AddresseeList addresses = addressBook->findByEmail( KPIM::getFirstEmailAddress( message->from() ) ); @@ -485,16 +485,16 @@ namespace KMail { int photoHeight = 60; if( addresses.count() == 1 ) { - // kabcUid is embedded in im: URIs to indicate which IM contact to message - kabcUid = addresses[0].uid(); + // tdeabcUid is embedded in im: URIs to indicate which IM contact to message + tdeabcUid = addresses[0].uid(); if ( imProxy->initialize() ) { // im status - presence = imProxy->presenceString( kabcUid ); + presence = imProxy->presenceString( tdeabcUid ); if ( !presence.isEmpty() ) { TQString presenceIcon = TQString::fromLatin1( " " ) - .arg( imgToDataUrl( imProxy->presenceIcon( kabcUid ).convertToImage() ) ); + .arg( imgToDataUrl( imProxy->presenceIcon( tdeabcUid ).convertToImage() ) ); presence += presenceIcon; } } @@ -592,9 +592,9 @@ namespace KMail { userHTML = TQString( "
" "%2
" "%4
" - "
" ).arg( kabcUid ) + "" ).arg( tdeabcUid ) .arg( userHTML ) - .arg( kabcUid ) + .arg( tdeabcUid ) .arg( presence ); } } else { @@ -602,8 +602,8 @@ namespace KMail { if ( !presence.isEmpty() ) userHTML = TQString( "
" "%3
" ) - .arg( kabcUid ) - .arg( kabcUid ) + .arg( tdeabcUid ) + .arg( tdeabcUid ) .arg( presence ); } #if 0 @@ -766,7 +766,7 @@ namespace KMail { : TQString("") ) #if 0 + ( ( !presence.isEmpty() ) - ? "  (" + presence + ")" + ? "  (" + presence + ")" : TQString("") ) #endif + ( message->headerField("Organization").isEmpty() diff --git a/kmail/imapaccountbase.cpp b/kmail/imapaccountbase.cpp index e1568b11..1350da29 100644 --- a/kmail/imapaccountbase.cpp +++ b/kmail/imapaccountbase.cpp @@ -373,7 +373,7 @@ namespace KMail { else stream << (int) 'U' << url; - // create the KIO-job + // create the TDEIO-job if ( makeConnection() != Connected ) return;// ## doesn't handle Connecting TDEIO::SimpleJob *job = TDEIO::special(url, packedArgs, false); diff --git a/kmail/imapaccountbase.h b/kmail/imapaccountbase.h index f1bf03f0..2d239d96 100644 --- a/kmail/imapaccountbase.h +++ b/kmail/imapaccountbase.h @@ -240,7 +240,7 @@ namespace KMail { void setImapSeenStatus( KMFolder* folder, const TQString& path, bool seen ); /** - * The KIO-Slave died + * The TDEIO-Slave died */ void slaveDied() { mSlave = 0; killAllJobs(); } @@ -430,9 +430,9 @@ namespace KMail { protected slots: virtual void slotCheckQueuedFolders(); - /// Handle a message coming from the KIO scheduler saying that the slave is now connected + /// Handle a message coming from the TDEIO scheduler saying that the slave is now connected void slotSchedulerSlaveConnected(TDEIO::Slave *aSlave); - /// Handle an error coming from the KIO scheduler + /// Handle an error coming from the TDEIO scheduler void slotSchedulerSlaveError(TDEIO::Slave *aSlave, int, const TQString &errorMsg); /** @@ -484,14 +484,14 @@ namespace KMail { protected: /** - * Handle an error coming from a KIO job or from a KIO slave (via the scheduler) + * Handle an error coming from a TDEIO job or from a TDEIO slave (via the scheduler) * and abort everything (in all cases) if abortSync is true [this is for slotSchedulerSlaveError]. * Otherwise (abortSync==false), dimap will only abort in case of severe errors (connection broken), * but on "normal" errors (no permission to delete, etc.) it will ask the user. * * @param error the error code, usually job->error()) * @param errorMsg the error message, usually job->errorText() - * @param job the kio job (can be 0). If set, removeJob will be called automatically. + * @param job the tdeio job (can be 0). If set, removeJob will be called automatically. * This is important! It means you should not call removeJob yourself in case of errors. * We can't let the caller do that, since it should only be done afterwards, and only if we didn't abort. * diff --git a/kmail/imapjob.cpp b/kmail/imapjob.cpp index c50663ed..dc9a98f5 100644 --- a/kmail/imapjob.cpp +++ b/kmail/imapjob.cpp @@ -259,7 +259,7 @@ ImapJob::~ImapJob() mit.current()->setTransferInProgress( false ); } } - account->removeJob( mJob ); // remove the associated kio job + account->removeJob( mJob ); // remove the associated tdeio job } account->mJobList.remove( this ); // remove the folderjob } diff --git a/kmail/keyresolver.cpp b/kmail/keyresolver.cpp index 1aa6f877..76d4ae8f 100644 --- a/kmail/keyresolver.cpp +++ b/kmail/keyresolver.cpp @@ -586,7 +586,7 @@ struct Kleo::KeyResolver::Private { std::map mFormatInfoMap; - // key=email address, value=crypto preferences for this contact (from kabc) + // key=email address, value=crypto preferences for this contact (from tdeabc) typedef std::map ContactPreferencesMap; ContactPreferencesMap mContactPreferencesMap; }; diff --git a/kmail/kmacctimap.cpp b/kmail/kmacctimap.cpp index d6b55332..8fd2bea0 100644 --- a/kmail/kmacctimap.cpp +++ b/kmail/kmacctimap.cpp @@ -232,7 +232,7 @@ void KMAcctImap::ignoreJobsForFolder( KMFolder* folder ) //----------------------------------------------------------------------------- void KMAcctImap::removeSlaveJobsForFolder( KMFolder* folder ) { - // Make sure the folder is not referenced in any kio slave jobs + // Make sure the folder is not referenced in any tdeio slave jobs TQMap::Iterator it = mapJobData.begin(); while ( it != mapJobData.end() ) { TQMap::Iterator i = it; diff --git a/kmail/kmacctimap.h b/kmail/kmacctimap.h index 99f07f16..3e10332a 100644 --- a/kmail/kmacctimap.h +++ b/kmail/kmacctimap.h @@ -106,7 +106,7 @@ protected: friend class ::AccountManager; KMAcctImap(AccountManager* owner, const TQString& accountName, uint id); /** - * Handle an error coming from a KIO job + * Handle an error coming from a TDEIO job * See ImapAccountBase::handleJobError for details. */ virtual bool handleError( int error, const TQString &errorMsg, TDEIO::Job* job, const TQString& context, bool abortSync = false ); diff --git a/kmail/kmail_part.cpp b/kmail/kmail_part.cpp index 69ccfc9b..23918a04 100644 --- a/kmail/kmail_part.cpp +++ b/kmail/kmail_part.cpp @@ -154,7 +154,7 @@ KMailPart::KMailPart(TQWidget *parentWidget, const char *widgetName, KMailPart::~KMailPart() { kdDebug(5006) << "Closing last KMMainWin: stopping mail check" << endl; - // Running KIO jobs prevent kapp from exiting, so we need to kill them + // Running TDEIO jobs prevent kapp from exiting, so we need to kill them // if they are only about checking mail (not important stuff like moving messages) kmkernel->abortMailCheck(); kmkernel->acctMgr()->cancelMailCheck(); diff --git a/kmail/kmcommands.cpp b/kmail/kmcommands.cpp index d4fead48..8b477924 100644 --- a/kmail/kmcommands.cpp +++ b/kmail/kmcommands.cpp @@ -75,7 +75,7 @@ #include #include #include -// KIO headers +// TDEIO headers #include #include @@ -932,7 +932,7 @@ void KMSaveMsgCommand::slotMessageRetrievedForSaving(KMMessage *msg) mOffset = 0; TQByteArray data; int size; - // Unless it is great than 64 k send the whole message. kio buffers for us. + // Unless it is great than 64 k send the whole message. tdeio buffers for us. if( mData.size() > (unsigned int) MAX_CHUNK_SIZE ) size = MAX_CHUNK_SIZE; else diff --git a/kmail/kmcomposewin.cpp b/kmail/kmcomposewin.cpp index 27a76c72..7863b01b 100644 --- a/kmail/kmcomposewin.cpp +++ b/kmail/kmcomposewin.cpp @@ -2623,7 +2623,7 @@ void KMComposeWin::addrBookSelIntoOld() dlg.setSelectedBCC( lst ); } - dlg.setRecentAddresses( RecentAddresses::self( KMKernel::config() )->kabcAddresses() ); + dlg.setRecentAddresses( RecentAddresses::self( KMKernel::config() )->tdeabcAddresses() ); if (dlg.exec()==TQDialog::Rejected) return; diff --git a/kmail/kmcomposewin.h b/kmail/kmcomposewin.h index 7e43749f..123f112b 100644 --- a/kmail/kmcomposewin.h +++ b/kmail/kmcomposewin.h @@ -486,7 +486,7 @@ private slots: void slotIdentityChanged(uint); /** - * KIO slots for attachment insertion + * TDEIO slots for attachment insertion */ void slotAttachFileData(TDEIO::Job *, const TQByteArray &); void slotAttachFileResult(TDEIO::Job *); diff --git a/kmail/kmdict.cpp b/kmail/kmdict.cpp new file mode 100644 index 00000000..0ad9367b --- /dev/null +++ b/kmail/kmdict.cpp @@ -0,0 +1,117 @@ +/* simple hash table for kmail. inspired by TQDict */ +/* Author: Ronen Tzur */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "kmdict.h" +#include "kmglobal.h" +#include + +#include +//----------------------------------------------------------------------------- + +KMDict::KMDict( int size ) +{ + init( ( int ) KMail::nextPrime( size ) ); + //kdDebug( 5006 ) << "KMMDict::KMDict Size: " << mSize << endl; +} + +//----------------------------------------------------------------------------- + +KMDict::~KMDict() +{ + clear(); +} + +//----------------------------------------------------------------------------- + +void KMDict::init(int size) +{ + mSize = size; + mVecs = new KMDictItem *[mSize]; + memset(mVecs, 0, mSize * sizeof(KMDictItem *)); +} + +//----------------------------------------------------------------------------- + +void KMDict::clear() +{ + if (!mVecs) + return; + for (int i = 0; i < mSize; i++) { + KMDictItem *item = mVecs[i]; + while (item) { + KMDictItem *nextItem = item->next; + delete item; + item = nextItem; + } + } + delete [] mVecs; + mVecs = 0; +} + +//----------------------------------------------------------------------------- + +void KMDict::replace( long key, KMDictItem *item ) +{ + insert( key, item ); + removeFollowing( item, key ); // remove other items with same key +} + +//----------------------------------------------------------------------------- + + +void KMDict::insert( long key, KMDictItem *item ) +{ + item->key = key; + int idx = (unsigned long)key % mSize; // insert in + item->next = mVecs[idx]; // appropriate + mVecs[idx] = item; // column +} + +//----------------------------------------------------------------------------- + +void KMDict::remove(long key) +{ + int idx = (unsigned long)key % mSize; + KMDictItem *item = mVecs[idx]; + + if (item) { + if (item->key == key) { // if first in the column + mVecs[idx] = item->next; + delete item; + } else + removeFollowing(item, key); // if deep in the column + } +} + +//----------------------------------------------------------------------------- + +void KMDict::removeFollowing(KMDictItem *item, long key) +{ + while (item) { + KMDictItem *itemNext = item->next; + if (itemNext && itemNext->key == key) { + KMDictItem *itemNextNext = itemNext->next; + delete itemNext; + item->next = itemNextNext; + } else + item = itemNext; + } +} + +//----------------------------------------------------------------------------- + +KMDictItem *KMDict::find(long key) +{ + int idx = (unsigned long)key % mSize; + KMDictItem *item = mVecs[idx]; + while (item) { + if (item->key == key) + break; + item = item->next; + } + return item; +} diff --git a/kmail/kmdict.h b/kmail/kmdict.h new file mode 100644 index 00000000..6cbbefd5 --- /dev/null +++ b/kmail/kmdict.h @@ -0,0 +1,68 @@ +/* + * simple hash table for kmail. inspired by TQDict + */ + +#ifndef __KMDICT +#define __KMDICT + +/** + * @short Class representing items in a KMDict + */ +class KMDictItem +{ +public: + long key; + KMDictItem *next; +}; + +/** + * @short KMDict implements a lightweight dictionary with serial numbers as keys. + * + * KMDict is a leightweight dictionary used exclusively by KMMsgDict. It uses + * serial numbers as keys. + * + * @author Ronen Tzur + */ +class KMDict +{ + friend class MessageDictTester; +public: + /** Creates a hash table with @p size columns. */ + KMDict(int size = 17); + + /** Destroys the hash table object. */ + ~KMDict(); + + /** Clears the hash table, removing all items. */ + void clear(); + + /** Returns the size of the hash table. */ + int size() { return mSize; } + + /** Inserts an item, replacing old ones with the same key. */ + void replace(long key, KMDictItem *item); + + /** Inserts an item without replacing ones with the same key. */ + void insert(long key, KMDictItem *item); + + /** Removes an item. */ + void remove(long key); + + /** Find an item by key. Returns pointer to it, or 0 if not found. */ + KMDictItem *find(long key); + +private: + /** Removes all items _following_ @p item with key @p key. */ + void removeFollowing(KMDictItem *item, long key); + + /** Initializes the hash table to @p size colums. */ + void init(int size); + + /** The size of the hash. */ + int mSize; + + /** The buckets. */ + KMDictItem **mVecs; +}; + +#endif /* __KMDICT */ diff --git a/kmail/kmfolderdia.h b/kmail/kmfolderdia.h index 764ea897..5f3ea967 100644 --- a/kmail/kmfolderdia.h +++ b/kmail/kmfolderdia.h @@ -60,7 +60,7 @@ namespace KMail { * This is the base class for tabs in the folder dialog. * It uses the API from ConfigModuleTab (basically: it's a widget that can load and save) * but it also adds support for delayed-saving: - * when save() needs to use async jobs (e.g. KIO) for saving, + * when save() needs to use async jobs (e.g. TDEIO) for saving, * we need to delay the closing until after the jobs are finished, * and to cancel the saving on error. * @@ -87,7 +87,7 @@ public: /// Called when clicking OK. /// If a module returns Delayed, the closing is cancelled for now, /// and the module can close the dialog later on (i.e. after an async - /// operation like a KIO job). + /// operation like a TDEIO job). virtual AccepStatus accept() { return save() ? Accepted : Canceled; } diff --git a/kmail/kmmainwin.cpp b/kmail/kmmainwin.cpp index 67965db5..613864b9 100644 --- a/kmail/kmmainwin.cpp +++ b/kmail/kmmainwin.cpp @@ -103,7 +103,7 @@ KMMainWin::~KMMainWin() if ( not_withdrawn == 0 ) { kdDebug(5006) << "Closing last KMMainWin: stopping mail check" << endl; - // Running KIO jobs prevent kapp from exiting, so we need to kill them + // Running TDEIO jobs prevent kapp from exiting, so we need to kill them // if they are only about checking mail (not important stuff like moving messages) kmkernel->abortMailCheck(); kmkernel->acctMgr()->cancelMailCheck(); diff --git a/kmail/kmmsgdict.cpp b/kmail/kmmsgdict.cpp index fdf2e1b2..729a3663 100644 --- a/kmail/kmmsgdict.cpp +++ b/kmail/kmmsgdict.cpp @@ -4,7 +4,7 @@ #include "kmfolderindex.h" #include "kmfolder.h" #include "kmmsgdict.h" -#include "tdemdict.h" +#include "kmdict.h" #include "globalsettings.h" #include "folderstorage.h" diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp index 3aadb963..32483b19 100644 --- a/kmail/kmreaderwin.cpp +++ b/kmail/kmreaderwin.cpp @@ -1671,7 +1671,7 @@ kdDebug(5006) << "KMReaderWin - composing unencrypted message" << endl; void KMReaderWin::updateHeader() { /* - * TODO: mess around with KHTML DOM some more and figure out how to + * TODO: mess around with TDEHTML DOM some more and figure out how to * replace the entire header div w/out flickering to hell and back * * DOM::NodeList divs(mViewer->document().documentElement().getElementsByTagName("div")); diff --git a/kmail/networkaccount.h b/kmail/networkaccount.h index dd62b0cd..503a312d 100644 --- a/kmail/networkaccount.h +++ b/kmail/networkaccount.h @@ -107,7 +107,7 @@ namespace KMail { /** @return an URL for this account */ virtual KURL getUrl() const; - /** @return the KIO slave for this account */ + /** @return the TDEIO slave for this account */ TDEIO::Slave * slave() const { return mSlave; } /** Kill all jobs that are currently in progress */ diff --git a/kmail/popaccount.h b/kmail/popaccount.h index afa0acf2..f8cb0e92 100644 --- a/kmail/popaccount.h +++ b/kmail/popaccount.h @@ -102,12 +102,12 @@ protected: PopAccount(AccountManager* owner, const TQString& accountName, uint id); /** - * Start a KIO Job to get a list of messages on the pop server + * Start a TDEIO Job to get a list of messages on the pop server */ void startJob(); /** - * Connect up the standard signals/slots for the KIO Jobs + * Connect up the standard signals/slots for the TDEIO Jobs */ void connectJob(); @@ -185,7 +185,7 @@ protected slots: void slotProcessPendingMsgs(); /** - * If there are more messages to be downloaded then start a new kio job + * If there are more messages to be downloaded then start a new tdeio job * to get the message whose id is at the head of the queue */ void slotGetNextMsg(); @@ -202,7 +202,7 @@ protected slots: void slotData( TDEIO::Job*, const TQByteArray &); /** - * Finished downloading the current kio job, either due to an error + * Finished downloading the current tdeio job, either due to an error * or because the job has been canceled or because the complete message * has been downloaded */ @@ -230,7 +230,7 @@ protected slots: void slotSlaveError(TDEIO::Slave *, int, const TQString &); /** - * If there are more headers to be downloaded then start a new kio job + * If there are more headers to be downloaded then start a new tdeio job * to get the next header */ void slotGetNextHdr(); diff --git a/kmail/recipientspicker.cpp b/kmail/recipientspicker.cpp index 26fe7213..04cc50e1 100644 --- a/kmail/recipientspicker.cpp +++ b/kmail/recipientspicker.cpp @@ -579,7 +579,7 @@ void RecipientsPicker::insertRecentAddresses() TDEConfig config( "kmailrc" ); TDEABC::Addressee::List recents = - TDERecentAddress::RecentAddresses::self( &config )->kabcAddresses(); + TDERecentAddress::RecentAddresses::self( &config )->tdeabcAddresses(); TDEABC::Addressee::List::ConstIterator it; for( it = recents.begin(); it != recents.end(); ++it ) { diff --git a/kmail/redirectdialog.cpp b/kmail/redirectdialog.cpp index f29b7947..ca6d5a24 100644 --- a/kmail/redirectdialog.cpp +++ b/kmail/redirectdialog.cpp @@ -132,7 +132,7 @@ void RedirectDialog::slotAddrBook() } dlg.setRecentAddresses( - RecentAddresses::self( KMKernel::config() )->kabcAddresses() ); + RecentAddresses::self( KMKernel::config() )->tdeabcAddresses() ); // Make it impossible to specify Cc or Bcc addresses as we support // only the Redirect-To header! diff --git a/kmail/tdelistboxdialog.h b/kmail/tdelistboxdialog.h index 30a67286..a9e949ac 100644 --- a/kmail/tdelistboxdialog.h +++ b/kmail/tdelistboxdialog.h @@ -1,5 +1,5 @@ -#ifndef KLISTBOXDIALOG_H -#define KLISTBOXDIALOG_H +#ifndef TDELISTBOXDIALOG_H +#define TDELISTBOXDIALOG_H #include diff --git a/kmail/tdelistviewindexedsearchline.h b/kmail/tdelistviewindexedsearchline.h index 6f109892..73d5d6f3 100644 --- a/kmail/tdelistviewindexedsearchline.h +++ b/kmail/tdelistviewindexedsearchline.h @@ -1,5 +1,5 @@ -#ifndef LPC_KLISTVIEWINDEXEDSEARCHLINE_H1107549660_INCLUDE_GUARD_ -#define LPC_KLISTVIEWINDEXEDSEARCHLINE_H1107549660_INCLUDE_GUARD_ +#ifndef LPC_TDELISTVIEWINDEXEDSEARCHLINE_H1107549660_INCLUDE_GUARD_ +#define LPC_TDELISTVIEWINDEXEDSEARCHLINE_H1107549660_INCLUDE_GUARD_ /* This file is part of KMail * Copyright (C) 2005 Luís Pedro Coelho @@ -74,4 +74,4 @@ private: -#endif /* LPC_KLISTVIEWINDEXEDSEARCHLINE_H1107549660_INCLUDE_GUARD_ */ +#endif /* LPC_TDELISTVIEWINDEXEDSEARCHLINE_H1107549660_INCLUDE_GUARD_ */ diff --git a/kmail/tdemdict.cpp b/kmail/tdemdict.cpp deleted file mode 100644 index a1c73e6d..00000000 --- a/kmail/tdemdict.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* simple hash table for kmail. inspired by TQDict */ -/* Author: Ronen Tzur */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "tdemdict.h" -#include "kmglobal.h" -#include - -#include -//----------------------------------------------------------------------------- - -KMDict::KMDict( int size ) -{ - init( ( int ) KMail::nextPrime( size ) ); - //kdDebug( 5006 ) << "KMMDict::KMDict Size: " << mSize << endl; -} - -//----------------------------------------------------------------------------- - -KMDict::~KMDict() -{ - clear(); -} - -//----------------------------------------------------------------------------- - -void KMDict::init(int size) -{ - mSize = size; - mVecs = new KMDictItem *[mSize]; - memset(mVecs, 0, mSize * sizeof(KMDictItem *)); -} - -//----------------------------------------------------------------------------- - -void KMDict::clear() -{ - if (!mVecs) - return; - for (int i = 0; i < mSize; i++) { - KMDictItem *item = mVecs[i]; - while (item) { - KMDictItem *nextItem = item->next; - delete item; - item = nextItem; - } - } - delete [] mVecs; - mVecs = 0; -} - -//----------------------------------------------------------------------------- - -void KMDict::replace( long key, KMDictItem *item ) -{ - insert( key, item ); - removeFollowing( item, key ); // remove other items with same key -} - -//----------------------------------------------------------------------------- - - -void KMDict::insert( long key, KMDictItem *item ) -{ - item->key = key; - int idx = (unsigned long)key % mSize; // insert in - item->next = mVecs[idx]; // appropriate - mVecs[idx] = item; // column -} - -//----------------------------------------------------------------------------- - -void KMDict::remove(long key) -{ - int idx = (unsigned long)key % mSize; - KMDictItem *item = mVecs[idx]; - - if (item) { - if (item->key == key) { // if first in the column - mVecs[idx] = item->next; - delete item; - } else - removeFollowing(item, key); // if deep in the column - } -} - -//----------------------------------------------------------------------------- - -void KMDict::removeFollowing(KMDictItem *item, long key) -{ - while (item) { - KMDictItem *itemNext = item->next; - if (itemNext && itemNext->key == key) { - KMDictItem *itemNextNext = itemNext->next; - delete itemNext; - item->next = itemNextNext; - } else - item = itemNext; - } -} - -//----------------------------------------------------------------------------- - -KMDictItem *KMDict::find(long key) -{ - int idx = (unsigned long)key % mSize; - KMDictItem *item = mVecs[idx]; - while (item) { - if (item->key == key) - break; - item = item->next; - } - return item; -} diff --git a/kmail/tdemdict.h b/kmail/tdemdict.h deleted file mode 100644 index 6cbbefd5..00000000 --- a/kmail/tdemdict.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * simple hash table for kmail. inspired by TQDict - */ - -#ifndef __KMDICT -#define __KMDICT - -/** - * @short Class representing items in a KMDict - */ -class KMDictItem -{ -public: - long key; - KMDictItem *next; -}; - -/** - * @short KMDict implements a lightweight dictionary with serial numbers as keys. - * - * KMDict is a leightweight dictionary used exclusively by KMMsgDict. It uses - * serial numbers as keys. - * - * @author Ronen Tzur - */ -class KMDict -{ - friend class MessageDictTester; -public: - /** Creates a hash table with @p size columns. */ - KMDict(int size = 17); - - /** Destroys the hash table object. */ - ~KMDict(); - - /** Clears the hash table, removing all items. */ - void clear(); - - /** Returns the size of the hash table. */ - int size() { return mSize; } - - /** Inserts an item, replacing old ones with the same key. */ - void replace(long key, KMDictItem *item); - - /** Inserts an item without replacing ones with the same key. */ - void insert(long key, KMDictItem *item); - - /** Removes an item. */ - void remove(long key); - - /** Find an item by key. Returns pointer to it, or 0 if not found. */ - KMDictItem *find(long key); - -private: - /** Removes all items _following_ @p item with key @p key. */ - void removeFollowing(KMDictItem *item, long key); - - /** Initializes the hash table to @p size colums. */ - void init(int size); - - /** The size of the hash. */ - int mSize; - - /** The buckets. */ - KMDictItem **mVecs; -}; - -#endif /* __KMDICT */ diff --git a/kmail/tests/Makefile.am b/kmail/tests/Makefile.am index c07ad623..bd8a86b1 100644 --- a/kmail/tests/Makefile.am +++ b/kmail/tests/Makefile.am @@ -6,7 +6,7 @@ check_LTLIBRARIES = tdeunittest_storagelayermodule.la \ tdeunittest_utilmodule.la \ tdeunittest_mimelibmodule.la -tdeunittest_storagelayermodule_la_SOURCES = storagelayermodule.cpp messagedicttests.cpp ../tdemdict.cpp +tdeunittest_storagelayermodule_la_SOURCES = storagelayermodule.cpp messagedicttests.cpp ../kmdict.cpp tdeunittest_storagelayermodule_la_LIBADD = -ltdeunittest tdeunittest_utilmodule_la_SOURCES = utiltests.cpp ../util.cpp tdeunittest_utilmodule_la_LIBADD = -ltdeunittest ../../mimelib/libmimelib.la diff --git a/kmail/tests/messagedicttests.cpp b/kmail/tests/messagedicttests.cpp index 4565f10c..0771aa1c 100644 --- a/kmail/tests/messagedicttests.cpp +++ b/kmail/tests/messagedicttests.cpp @@ -7,7 +7,7 @@ #include #include -#include "tdemdict.h" +#include "kmdict.h" #include "messagedicttests.h" diff --git a/kmail/tests/mimelibtests.cpp b/kmail/tests/mimelibtests.cpp index e1162093..84b3af16 100644 --- a/kmail/tests/mimelibtests.cpp +++ b/kmail/tests/mimelibtests.cpp @@ -26,8 +26,8 @@ using namespace KUnitTest; -KUNITTEST_MODULE( tdeunittest_mimelibmodule, "Mimelib Tests" ); -KUNITTEST_MODULE_REGISTER_TESTER( MimeLibTester ); +TDEUNITTEST_MODULE( tdeunittest_mimelibmodule, "Mimelib Tests" ); +TDEUNITTEST_MODULE_REGISTER_TESTER( MimeLibTester ); #include #include diff --git a/kmail/tests/storagelayermodule.cpp b/kmail/tests/storagelayermodule.cpp index fcfb884e..c8858e42 100644 --- a/kmail/tests/storagelayermodule.cpp +++ b/kmail/tests/storagelayermodule.cpp @@ -12,5 +12,5 @@ using namespace KUnitTest; -KUNITTEST_MODULE( tdeunittest_storagelayermodule, "KMail Storage Layer Tests" ); -KUNITTEST_MODULE_REGISTER_TESTER( MessageDictTester ); +TDEUNITTEST_MODULE( tdeunittest_storagelayermodule, "KMail Storage Layer Tests" ); +TDEUNITTEST_MODULE_REGISTER_TESTER( MessageDictTester ); diff --git a/kmail/tests/utiltests.cpp b/kmail/tests/utiltests.cpp index 936cc3ab..31a43179 100644 --- a/kmail/tests/utiltests.cpp +++ b/kmail/tests/utiltests.cpp @@ -10,8 +10,8 @@ using namespace KUnitTest; -KUNITTEST_MODULE( tdeunittest_utilmodule, "KMail::Util Tests" ); -KUNITTEST_MODULE_REGISTER_TESTER( UtilTester ); +TDEUNITTEST_MODULE( tdeunittest_utilmodule, "KMail::Util Tests" ); +TDEUNITTEST_MODULE_REGISTER_TESTER( UtilTester ); #include "util.h" #include -- cgit v1.2.3