Remove all KDE_VERSION <= 306 hacks

svn path=/trunk/kdenetwork/kmail/; revision=197506
wilder-work
Ingo Klcker 24 years ago
parent 940e585126
commit fd8cd42583
  1. 4
      configuredialog.cpp
  2. 2
      kmaccount.cpp
  3. 4
      kmaccount.h
  4. 64
      kmaddrbook.cpp
  5. 8
      kmaddrbook.h
  6. 6
      kmcomposewin.cpp
  7. 4
      kmfilteraction.cpp
  8. 7
      kmfilterdlg.cpp
  9. 4
      kmidentity.cpp
  10. 12
      kmmainwidget.cpp
  11. 2
      kmstartup.cpp

@ -79,9 +79,7 @@ using KMime::DateFormatter;
#include <kiconloader.h>
#include <kstandarddirs.h>
#include <kwin.h>
#if KDE_VERSION >= 306
#include <knotifydialog.h>
#endif
// Qt headers:
#include <qvalidator.h>
@ -1369,9 +1367,7 @@ void NetworkPage::ReceivingTab::slotRemoveSelectedAccount() {
void NetworkPage::ReceivingTab::slotEditNotifications()
{
#if KDE_VERSION >= 306
KNotifyDialog::configure(this);
#endif
}
void NetworkPage::ReceivingTab::setup() {

@ -31,9 +31,7 @@ KMPrecommand::KMPrecommand(const QString &precommand, QObject *parent)
KMBroadcastStatus::instance()->setStatusMsg(
i18n("Executing precommand %1").arg(precommand ));
#if KDE_VERSION >= 305
mPrecommandProcess.setUseShell(true);
#endif
mPrecommandProcess << precommand;
connect(&mPrecommandProcess, SIGNAL(processExited(KProcess *)),

@ -37,11 +37,7 @@ signals:
void finished(bool);
protected:
#if KDE_VERSION >= 305
KProcess mPrecommandProcess;
#else
KShellProcess mPrecommandProcess;
#endif
QString mPrecommand;
};

@ -179,11 +179,7 @@ void KMAddrBookExternal::addEmail( const QString &addr, QWidget *parent) {
QString email;
QString name;
#if KDE_VERSION >= 305
KABC::Addressee::parseEmailAddress( addr, name, email );
#else
parseEmailAddress( addr, name, email );
#endif
KABC::AddressBook *ab = KABC::StdAddressBook::self();
@ -259,63 +255,3 @@ bool KMAddrBookExternal::checkForAddressBook()
}
}
#if KDE_VERSION < 305
// FIXME: This function is duplicated from kdelibs/kabc. Remove it, when KMail
// depends on the 3.1 libs.
void KMAddrBookExternal::parseEmailAddress( const QString &rawEmail,
QString &fullName,
QString &email)
{
int startPos, endPos, len;
QString partA, partB, result;
char endCh = '>';
startPos = rawEmail.find('<');
if (startPos < 0)
{
startPos = rawEmail.find('(');
endCh = ')';
}
if (startPos < 0)
{
// We couldn't find any separators, so we assume the whole string
// is the email address
email = rawEmail;
fullName = "";
}
else
{
// We have a start position, try to find an end
endPos = rawEmail.find(endCh, startPos+1);
if (endPos < 0)
{
// We couldn't find the end of the email address. We can only
// assume the entire string is the email address.
email = rawEmail;
fullName = "";
}
else
{
// We have a start and end to the email address
// Grab the name part
fullName = rawEmail.left(startPos).stripWhiteSpace();
// grab the email part
email = rawEmail.mid(startPos+1, endPos-startPos-1).stripWhiteSpace();
// Check that we do not have any extra characters on the end of the
// strings
len = fullName.length();
if (fullName[0]=='"' && fullName[len-1]=='"')
fullName = fullName.mid(1, len-2);
else if (fullName[0]=='<' && fullName[len-1]=='>')
fullName = fullName.mid(1, len-2);
else if (fullName[0]=='(' && fullName[len-1]==')')
fullName = fullName.mid(1, len-2);
}
}
}
#endif

@ -24,14 +24,6 @@ public:
static bool useKab();
static bool useKAddressbook();
static bool checkForAddressBook();
#if KDE_VERSION < 305
private:
// FIXME: In version 3.1 this function is in kdelibs. Remove it from here
// when KMail doesn't need to be compilable with 3.0 libs anymore.
static void parseEmailAddress( const QString &rawEmail, QString &fullName,
QString &email );
#endif
};
#endif /*KMAddrBook_h*/

@ -5059,10 +5059,8 @@ void KMComposeWin::slotUpdateToolbars()
void KMComposeWin::slotEditKeys()
{
KKeyDialog::configure( actionCollection()
#if KDE_VERSION >= 306
, false /*don't allow one-letter shortcuts*/
#endif
KKeyDialog::configure( actionCollection(),
false /*don't allow one-letter shortcuts*/
);
}

@ -462,12 +462,8 @@ KMFilterAction::ReturnCode KMFilterActionWithCommand::genericProcess(KMMessage*
kCStringToFile( aMsg->asString(), tempFileName, //###
false, false, false );
#if KDE_VERSION >= 305
KProcess shProc;
shProc.setUseShell(true);
#else
KShellProcess shProc;
#endif
shProc << commandLine;
// let the kernel collect the output for us:

@ -499,18 +499,11 @@ void KMFilterListBox::slotApplyFilterChanges()
// report on invalid filters:
if ( !emptyFilters.empty() ) {
#if KDE_VERSION < 306
QString msg = i18n("Some filters have not been saved because they were "
"invalid (e.g. containing no actions or no search "
"rules).");
KMessageBox::information( 0, msg, QString::null, "ShowInvalidFilterWarning" );
#else
QString msg = i18n("The following filters have not been saved because they "
"were invalid (e.g. containing no actions or no search "
"rules).");
KMessageBox::informationList( 0, msg, emptyFilters, QString::null,
"ShowInvalidFilterWarning" );
#endif
}
if ( oIdxSelItem >= 0 ) {

@ -86,12 +86,8 @@ QString Signature::textFromCommand( bool * ok ) const
}
// create a shell process:
#if KDE_VERSION >= 305
KProcess proc;
proc.setUseShell(true);
#else
KShellProcess proc;
#endif
proc << mUrl;
// let the kernel collect the output for us:

@ -37,9 +37,7 @@
#include <kio/job.h>
#include <ktip.h>
#include <kdeversion.h>
#if KDE_VERSION >= 306
#include <knotifydialog.h>
#endif
#include "kmbroadcaststatus.h"
#include "kmfoldermgr.h"
@ -2345,13 +2343,11 @@ void KMMainWidget::setupActions()
SLOT(slotEditKeys()), mActionCollection,
"kmail_configure_shortcuts" );
#if KDE_VERSION >= 306
// KStdAction::configureNotifications(this, SLOT(slotEditNotifications()), mActionCollection);
(void) new KAction( i18n("Configure &Notifications..."),
"knotify", 0, this,
SLOT(slotEditNotifications()), mActionCollection,
"kmail_configure_notifications" );
#endif
// KStdAction::preferences(this, SLOT(slotSettings()), mActionCollection);
(void) new KAction( i18n("&Configure KMail..."),
"configure", 0, kernel,
@ -2387,17 +2383,13 @@ void KMMainWidget::setupActions()
//-----------------------------------------------------------------------------
void KMMainWidget::slotEditNotifications()
{
#if KDE_VERSION >= 306
KNotifyDialog::configure(this);
#endif
}
void KMMainWidget::slotEditKeys()
{
KKeyDialog::configure( mActionCollection
#if KDE_VERSION >= 306
, true /*allow on-letter shortcuts*/
#endif
KKeyDialog::configure( mActionCollection,
true /*allow one-letter shortcuts*/
);
}

@ -75,7 +75,6 @@ QString getMyHostName(void)
void checkConfigUpdates() {
#if KDE_VERSION >= 306
//Please update the currentUpdateLevel when new updates are created.
const int currentUpdateLevel = 100;
KConfig * config = KMKernel::config();
@ -92,7 +91,6 @@ void checkConfigUpdates() {
for ( QStringList::const_iterator it = updates.begin() ; it != updates.end() ; ++it )
config->checkUpdate( *it, updateFile );
startup.writeEntry( "update-level", currentUpdateLevel );
#endif
}
void lockOrDie() {

Loading…
Cancel
Save