00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "util_p.h"
00022 #include "../dbusconnectionpool.h"
00023 #include "imapsettings.h"
00024
00025 #include <assert.h>
00026 #include <kio/jobclasses.h>
00027 #include <KDebug>
00028 #include <KIO/JobUiDelegate>
00029
00030 namespace Util
00031 {
00033 void showJobError( KJob* job )
00034 {
00035 assert(job);
00036
00037
00038 KIO::Job* kiojob = dynamic_cast<KIO::Job*>(job);
00039 if( kiojob && kiojob->ui() )
00040 kiojob->ui()->showErrorMessage();
00041 else
00042 kWarning() << "There is no GUI delegate set for a kjob, and it failed with error:" << job->errorString();
00043 }
00044
00045 OrgKdeAkonadiImapSettingsInterface *createImapSettingsInterface( const QString &ident )
00046 {
00047
00048 return new OrgKdeAkonadiImapSettingsInterface( QString::fromLatin1("org.freedesktop.Akonadi.Resource.") + ident,
00049 QString::fromLatin1("/Settings"),
00050 Akonadi::DBusConnectionPool::threadConnection() );
00051 }
00052
00053 }