summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxport
Unidiff
Diffstat (limited to 'kaddressbook/xxport') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxport/qtopia_xxport.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/kaddressbook/xxport/qtopia_xxport.cpp b/kaddressbook/xxport/qtopia_xxport.cpp
index 0cf6546..fc4abbb 100644
--- a/kaddressbook/xxport/qtopia_xxport.cpp
+++ b/kaddressbook/xxport/qtopia_xxport.cpp
@@ -24,24 +24,25 @@
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qdir.h> 31#include <qdir.h>
32 32
33#include "addressee.h" 33#include "addressee.h"
34#include "xxportmanager.h" 34#include "xxportmanager.h"
35#include "qtopia_xxport.h" 35#include "qtopia_xxport.h"
36#include <kfiledialog.h>
36 37
37/*US 38/*US
38class QtopiaXXPortFactory : public XXPortFactory 39class QtopiaXXPortFactory : public XXPortFactory
39{ 40{
40 public: 41 public:
41 XXPortObject *xxportObject( KABC::AddressBook *ab, QWidget *parent, const char *name ) 42 XXPortObject *xxportObject( KABC::AddressBook *ab, QWidget *parent, const char *name )
42 { 43 {
43 return new QtopiaXXPort( ab, parent, name ); 44 return new QtopiaXXPort( ab, parent, name );
44 } 45 }
45}; 46};
46*/ 47*/
47 48
@@ -53,26 +54,33 @@ extern "C"
53 } 54 }
54} 55}
55 56
56 57
57 58
58QtopiaXXPort::QtopiaXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) 59QtopiaXXPort::QtopiaXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name )
59 : XXPortResourceObject( ab, parent, name ) 60 : XXPortResourceObject( ab, parent, name )
60{ 61{
61 defaultFileName = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml"; 62 defaultFileName = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml";
62 63
63 if ( mFactory && !mFactory->typeName( "qtopia" ).isEmpty() ) 64 if ( mFactory && !mFactory->typeName( "qtopia" ).isEmpty() )
64 { 65 {
65 createImportAction( i18n( "Import Qtopia..." ) ); 66 createImportAction( i18n( "Import xml (Qtopia)..." ) );
66 createExportAction( i18n( "Export Qtopia..." ) ); 67 createExportAction( i18n( "Export xml (Qtopia)..." ) );
67 } 68 }
68} 69}
69 70
70bool QtopiaXXPort::exportContacts( const KABC::AddresseeList &list, const QString &identifier ) 71bool QtopiaXXPort::exportContacts( const KABC::AddresseeList &list, const QString &identifier )
71{ 72{
72 return _exportContacts( list, identifier, defaultFileName ); 73 QString fn =KFileDialog::getSaveFileName( defaultFileName, i18n("Import xml file"), 0 );
74 if ( fn == "" )
75 return false;
76
77 return _exportContacts( list, identifier, fn );
73} 78}
74 79
75KABC::AddresseeList QtopiaXXPort::importContacts( const QString &identifier ) const 80KABC::AddresseeList QtopiaXXPort::importContacts( const QString &identifier ) const
76{ 81{
77 return _importContacts( identifier, defaultFileName ); 82 QString fn =KFileDialog::getOpenFileName( defaultFileName, i18n("Import xml file"), 0 );
83 if ( fn == "" )
84 return KABC::AddresseeList() ;
85 return _importContacts( identifier, fn );
78} 86}