author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/xxport/kde2_xxport.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/xxport/kde2_xxport.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/xxport/kde2_xxport.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/xxport/kde2_xxport.cpp b/kaddressbook/xxport/kde2_xxport.cpp index 03efc1b..72d3fc2 100644 --- a/kaddressbook/xxport/kde2_xxport.cpp +++ b/kaddressbook/xxport/kde2_xxport.cpp | |||
@@ -1,121 +1,121 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressbook. | 2 | This file is part of KAddressbook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | 32 | ||
33 | #include <kdebug.h> | 33 | #include <kdebug.h> |
34 | #include <kfiledialog.h> | 34 | #include <kfiledialog.h> |
35 | #ifndef KAB_EMBEDDED | 35 | #ifndef KAB_EMBEDDED |
36 | #include <kio/netaccess.h> | 36 | #include <kio/netaccess.h> |
37 | #endif //KAB_EMBEDDED | 37 | #endif //KAB_EMBEDDED |
38 | #include <klocale.h> | 38 | #include <klocale.h> |
39 | #include <kmessagebox.h> | 39 | #include <kmessagebox.h> |
40 | #include <kprocess.h> | 40 | #include <kprocess.h> |
41 | #include <kstandarddirs.h> | 41 | #include <kstandarddirs.h> |
42 | #include <ktempfile.h> | 42 | #include <ktempfile.h> |
43 | #include <kurl.h> | 43 | #include <kurl.h> |
44 | 44 | ||
45 | #include "xxportmanager.h" | 45 | #include "xxportmanager.h" |
46 | 46 | ||
47 | #include "kde2_xxport.h" | 47 | #include "kde2_xxport.h" |
48 | 48 | ||
49 | #ifndef KAB_EMBEDDED | 49 | #ifndef KAB_EMBEDDED |
50 | 50 | ||
51 | class KDE2XXPortFactory : public XXPortFactory | 51 | class KDE2XXPortFactory : public XXPortFactory |
52 | { | 52 | { |
53 | public: | 53 | public: |
54 | XXPortObject *xxportObject( KABC::AddressBook *ab, QWidget *parent, const char *name ) | 54 | XXPortObject *xxportObject( KABC::AddressBook *ab, QWidget *parent, const char *name ) |
55 | { | 55 | { |
56 | return new KDE2XXPort( ab, parent, name ); | 56 | return new KDE2XXPort( ab, parent, name ); |
57 | } | 57 | } |
58 | }; | 58 | }; |
59 | 59 | ||
60 | #endif //KAB_EMBEDDED | 60 | #endif //KAB_EMBEDDED |
61 | 61 | ||
62 | 62 | ||
63 | extern "C" | 63 | extern "C" |
64 | { | 64 | { |
65 | #ifndef KAB_EMBEDDED | 65 | #ifndef KAB_EMBEDDED |
66 | void *init_libkaddrbk_kde2_xxport() | 66 | void *init_libkaddrbk_kde2_xxport() |
67 | #else //KAB_EMBEDDED | 67 | #else //KAB_EMBEDDED |
68 | void *init_microkaddrbk_kde2_xxport() | 68 | void *init_microkaddrbk_kde2_xxport() |
69 | #endif //KAB_EMBEDDED | 69 | #endif //KAB_EMBEDDED |
70 | { | 70 | { |
71 | return ( new KDE2XXPortFactory() ); | 71 | return ( new KDE2XXPortFactory() ); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | KDE2XXPort::KDE2XXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) | 76 | KDE2XXPort::KDE2XXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) |
77 | : XXPortObject( ab, parent, name ) | 77 | : XXPortObject( ab, parent, name ) |
78 | { | 78 | { |
79 | createImportAction( i18n( "Import KDE 2 Addressbook..." ) ); | 79 | createImportAction( i18n( "Import KDE 2 Addressbook..." ) ); |
80 | } | 80 | } |
81 | 81 | ||
82 | KABC::AddresseeList KDE2XXPort::importContacts( const QString& ) const | 82 | KABC::AddresseeList KDE2XXPort::importContacts( const QString& ) const |
83 | { | 83 | { |
84 | QString fileName = locateLocal( "data", "kabc/std.vcf" ); | 84 | QString fileName = locateLocal( "data", "kabc/std.vcf" ); |
85 | if ( !QFile::exists( fileName ) ) { | 85 | if ( !QFile::exists( fileName ) ) { |
86 | KMessageBox::sorry( parentWidget(), i18n( "<qt>Couldn't find a KDE 2 address book <b>%1</b>.</qt>" ).arg( fileName ) ); | 86 | KMessageBox::sorry( parentWidget(), i18n( "<qt>Couldn't find a KDE 2 address book <b>%1</b>.</qt>" ).arg( fileName ) ); |
87 | return KABC::AddresseeList(); | 87 | return KABC::AddresseeList(); |
88 | } | 88 | } |
89 | 89 | ||
90 | #ifndef KAB_EMBEDDED | 90 | #ifndef KAB_EMBEDDED |
91 | int result = KMessageBox::questionYesNoCancel( parentWidget(), | 91 | int result = KMessageBox::questionYesNoCancel( parentWidget(), |
92 | i18n( "Override previously imported entries?" ), | 92 | i18n( "Override previously imported entries?" ), |
93 | i18n( "Import KDE 2 Addressbook" ) ); | 93 | i18n( "Import KDE 2 Addressbook" ) ); |
94 | #else //KAB_EMBEDDED | 94 | #else //KAB_EMBEDDED |
95 | int result = KMessageBox::warningYesNoCancel( parentWidget(), | 95 | int result = KMessageBox::warningYesNoCancel( parentWidget(), |
96 | i18n( "Override previously imported entries?" ), | 96 | i18n( "Override previously imported entries?" ), |
97 | i18n( "Import KDE 2 Addressbook" ) ); | 97 | i18n( "Import KDE 2 Addressbook" ) ); |
98 | #endif //KAB_EMBEDDED | 98 | #endif //KAB_EMBEDDED |
99 | 99 | ||
100 | if ( !result ) return KABC::AddresseeList(); | 100 | if ( !result ) return KABC::AddresseeList(); |
101 | 101 | ||
102 | KProcess proc; | 102 | KProcess proc; |
103 | 103 | ||
104 | if ( result == KMessageBox::Yes ) { | 104 | if ( result == KMessageBox::Yes ) { |
105 | proc << "kab2kabc"; | 105 | proc << "kab2kabc"; |
106 | proc << "--override"; | 106 | proc << "--override"; |
107 | } else if ( result == KMessageBox::No ) | 107 | } else if ( result == KMessageBox::No ) |
108 | proc << "kab2kabc"; | 108 | proc << "kab2kabc"; |
109 | else | 109 | else |
110 | kdDebug(5720) << "KAddressBook::importKDE2(): Unknow return value." << endl; | 110 | kdDebug(5720) << "KAddressBook::importKDE2(): Unknow return value." << endl; |
111 | 111 | ||
112 | proc.start( KProcess::Block ); | 112 | proc.start( KProcess::Block ); |
113 | 113 | ||
114 | addressBook()->load(); | 114 | addressBook()->load(); |
115 | 115 | ||
116 | return KABC::AddresseeList(); | 116 | return KABC::AddresseeList(); |
117 | } | 117 | } |
118 | 118 | ||
119 | #ifndef KAB_EMBEDDED | 119 | #ifndef KAB_EMBEDDED_ |
120 | #include "kde2_xxport.moc" | 120 | #include "moc_kde2_xxport.cpp" |
121 | #endif //KAB_EMBEDDED | 121 | #endif //KAB_EMBEDDED |