kaddressbook
pab_xxport.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <QtCore/QFile>
00026
00027 #include <kdebug.h>
00028 #include <kfiledialog.h>
00029 #include <kio/netaccess.h>
00030 #include <klocale.h>
00031 #include <kmessagebox.h>
00032 #include <kstandarddirs.h>
00033 #include <ktemporaryfile.h>
00034 #include <kurl.h>
00035
00036 #include "xxportmanager.h"
00037
00038 #include "pab_xxport.h"
00039
00040 K_EXPORT_KADDRESSBOOK_XXFILTER( kaddrbk_pab_xxport, PABXXPort )
00041
00042 PABXXPort::PABXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name )
00043 : KAB::XXPort( ab, parent, name )
00044 {
00045 createImportAction( i18n("Import MS Exchange Personal Address Book (.PAB)") );
00046 }
00047
00048 KABC::Addressee::List PABXXPort::importContacts( const QString& ) const
00049 {
00050 KABC::Addressee::List addrList;
00051
00052 QString fileName = KFileDialog::getOpenFileName( QDir::homePath(),
00053 "*.[pP][aA][bB]|" + i18n("MS Exchange Personal Address Book Files (*.pab)"), 0 );
00054 if ( fileName.isEmpty() )
00055 return addrList;
00056 if ( !QFile::exists( fileName ) ) {
00057 KMessageBox::sorry( parentWidget(), i18n( "<qt>Could not find a MS Exchange Personal Address Book <b>%1</b>.</qt>", fileName ) );
00058 return addrList;
00059 }
00060
00061
00062
00063
00064
00065 return addrList;
00066 }
00067
00068 #include "pab_xxport.moc"
00069
00070