summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/file
Unidiff
Diffstat (limited to 'kabc/plugins/file') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/file/resourcefile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp
index 361b36b..d98efc8 100644
--- a/kabc/plugins/file/resourcefile.cpp
+++ b/kabc/plugins/file/resourcefile.cpp
@@ -6,112 +6,112 @@
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#ifndef _WIN32_ 30#ifndef _WIN32_
31#include <unistd.h> 31#include <unistd.h>
32#endif 32#endif
33 33
34#include <qfile.h> 34#include <qfile.h>
35#include <qfileinfo.h> 35#include <qfileinfo.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qtimer.h> 37#include <qtimer.h>
38 38
39#include <kapplication.h> 39#include <kapplication.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <klocale.h> 42#include <klocale.h>
43//US #include <ksavefile.h> 43//US #include <ksavefile.h>
44#include <kstandarddirs.h> 44#include <kstandarddirs.h>
45#include <kmessagebox.h> 45#include <kmessagebox.h>
46 46
47#include "formatfactory.h" 47#include "formatfactory.h"
48 48
49#include "resource.h" 49#include "resource.h"
50#include "resourcefileconfig.h" 50#include "resourcefileconfig.h"
51#include "stdaddressbook.h" 51#include "stdaddressbook.h"
52 52
53#include "resourcefile.h" 53#include "resourcefile.h"
54#include "syncwidget.h" 54#include "syncprefwidget.h"
55 55
56 56
57using namespace KABC; 57using namespace KABC;
58 58
59extern "C" 59extern "C"
60#ifdef _WIN32_ 60#ifdef _WIN32_
61__declspec(dllexport) 61__declspec(dllexport)
62#else 62#else
63{ 63{
64#endif 64#endif
65 65
66//US void *init_kabc_file() 66//US void *init_kabc_file()
67 void *init_microkabc_file() 67 void *init_microkabc_file()
68 { 68 {
69 return new KRES::PluginFactory<ResourceFile,ResourceFileConfig, KRES::SyncWidget>(); 69 return new KRES::PluginFactory<ResourceFile,ResourceFileConfig, SyncPrefWidget>();
70 } 70 }
71#ifndef _WIN32_ 71#ifndef _WIN32_
72} 72}
73#endif 73#endif
74 74
75ResourceFile::ResourceFile( const KConfig *config, bool syncable ) 75ResourceFile::ResourceFile( const KConfig *config, bool syncable )
76 : Resource( config, syncable ) , mFormat( 0 ) 76 : Resource( config, syncable ) , mFormat( 0 )
77{ 77{
78 QString fileName, formatName; 78 QString fileName, formatName;
79 79
80 KConfig *cfg = (KConfig *)config; 80 KConfig *cfg = (KConfig *)config;
81 if ( cfg ) { 81 if ( cfg ) {
82 fileName = cfg->readEntry( "FileName", StdAddressBook::fileName() ); 82 fileName = cfg->readEntry( "FileName", StdAddressBook::fileName() );
83 formatName = cfg->readEntry( "FileFormat", "vcard" ); 83 formatName = cfg->readEntry( "FileFormat", "vcard" );
84// qDebug("ResourceFile::ResourceFile : 1 %s, %s", fileName.latin1(), formatName.latin1() ); 84// qDebug("ResourceFile::ResourceFile : 1 %s, %s", fileName.latin1(), formatName.latin1() );
85 } else { 85 } else {
86 fileName = StdAddressBook::fileName(); 86 fileName = StdAddressBook::fileName();
87 formatName = "vcard"; 87 formatName = "vcard";
88// qDebug("ResourceFile::ResourceFile : 2 %s, %s", fileName.latin1(), formatName.latin1() ); 88// qDebug("ResourceFile::ResourceFile : 2 %s, %s", fileName.latin1(), formatName.latin1() );
89 } 89 }
90 90
91 init( fileName, formatName ); 91 init( fileName, formatName );
92} 92}
93 93
94ResourceFile::ResourceFile( const QString &fileName, bool syncable , 94ResourceFile::ResourceFile( const QString &fileName, bool syncable ,
95 const QString &formatName ) 95 const QString &formatName )
96 : Resource( 0, syncable ) 96 : Resource( 0, syncable )
97{ 97{
98// qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); 98// qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1());
99 init( fileName, formatName ); 99 init( fileName, formatName );
100} 100}
101 101
102void ResourceFile::init( const QString &fileName, const QString &formatName ) 102void ResourceFile::init( const QString &fileName, const QString &formatName )
103{ 103{
104 mFormatName = formatName; 104 mFormatName = formatName;
105 105
106 FormatFactory *factory = FormatFactory::self(); 106 FormatFactory *factory = FormatFactory::self();
107 mFormat = factory->format( mFormatName ); 107 mFormat = factory->format( mFormatName );
108 108
109 if ( !mFormat ) { 109 if ( !mFormat ) {
110 mFormatName = "vcard"; 110 mFormatName = "vcard";
111 mFormat = factory->format( mFormatName ); 111 mFormat = factory->format( mFormatName );
112 } 112 }
113 113
114/*US 114/*US
115//US qDebug("ResourceFile::init initialized with format %s ", formatName.latin1()); 115//US qDebug("ResourceFile::init initialized with format %s ", formatName.latin1());
116 if (mFormatName == "vcard") { 116 if (mFormatName == "vcard") {
117 mFormat = new VCardFormatPlugin2(); 117 mFormat = new VCardFormatPlugin2();