Remove duplicate code

svn path=/branches/work/akonadi-ports/kdepim/; revision=1061318
wilder-work
Laurent Montel 17 years ago
parent 157928e9cb
commit f1f0f63529
  1. 9
      kmmainwidget.cpp
  2. 9
      kmmainwin.cpp
  3. 14
      util.cpp
  4. 2
      util.h

@ -4541,14 +4541,7 @@ void KMMainWidget::slotAntiVirusWizard()
//-----------------------------------------------------------------------------
void KMMainWidget::slotAccountWizard()
{
QStringList lst;
lst.append( "--type" );
lst.append( "\"message/rfc822\"" );
if( !QProcess::startDetached("accountwizard", lst ) )
KMessageBox::error( this, i18n( "Could not start accountwizard "
"please check your installation." ),
i18n( "KMail Error" ) );
KMail::Util::launchAccountWizard( this );
}
//-----------------------------------------------------------------------------

@ -26,6 +26,7 @@
#include "progressdialog.h"
#include "statusbarprogresswidget.h"
#include "broadcaststatus.h"
#include "util.h"
#include <kapplication.h>
#include <klocale.h>
@ -96,13 +97,7 @@ KMMainWin::KMMainWin(QWidget *)
#endif
if ( kmkernel->firstStart() )
{
QStringList lst;
lst.append( "--type" );
lst.append( "\"message/rfc822\"" );
if( !QProcess::startDetached("accountwizard", lst) )
KMessageBox::error( this, i18n( "Could not start accountwizard "
"please check your installation." ),
i18n( "KMail Error" ) );
KMail::Util::launchAccountWizard( this );
}
if ( kmkernel->firstInstance() )
QTimer::singleShot( 200, this, SLOT( slotShowTipOnStart() ) );

@ -316,3 +316,17 @@ OrgKdeAkonadiImapSettingsInterface *KMail::Util::createImapSettingsInterface( co
return new OrgKdeAkonadiImapSettingsInterface("org.freedesktop.Akonadi.Resource." + ident, "/Settings", QDBusConnection::sessionBus() );
}
void KMail::Util::launchAccountWizard( QWidget *w )
{
QStringList lst;
lst.append( "--type" );
lst.append( "\"message/rfc822\"" );
if( !QProcess::startDetached("accountwizard", lst ) )
KMessageBox::error( w, i18n( "Could not start accountwizard "
"please check your installation." ),
i18n( "KMail Error" ) );
}

@ -130,6 +130,8 @@ namespace Util {
KUrl findSieveUrlForAccount( OrgKdeAkonadiImapSettingsInterface *a, const QString &ident);
OrgKdeAkonadiImapSettingsInterface *createImapSettingsInterface( const QString &ident );
void launchAccountWizard( QWidget * );
}
}

Loading…
Cancel
Save