summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/dir/resourcedir.cpp
Unidiff
Diffstat (limited to 'kabc/plugins/dir/resourcedir.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index 29f1e3a..eccd482 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -26,97 +26,97 @@ $Id$
26*/ 26*/
27 27
28 28
29#include <sys/types.h> 29#include <sys/types.h>
30#include <sys/stat.h> 30#include <sys/stat.h>
31#ifndef _WIN32_ 31#ifndef _WIN32_
32#include <unistd.h> 32#include <unistd.h>
33#endif 33#endif
34 34
35#include <qregexp.h> 35#include <qregexp.h>
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qwidget.h> 37#include <qwidget.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//US #include <kgenericfactory.h> 42//US #include <kgenericfactory.h>
43#include <kglobal.h> 43#include <kglobal.h>
44#include <klocale.h> 44#include <klocale.h>
45#include <kstandarddirs.h> 45#include <kstandarddirs.h>
46#include <kurlrequester.h> 46#include <kurlrequester.h>
47#include <kmessagebox.h> 47#include <kmessagebox.h>
48 48
49#include "addressbook.h" 49#include "addressbook.h"
50 50
51#include "formatfactory.h" 51#include "formatfactory.h"
52 52
53#include "resourcedirconfig.h" 53#include "resourcedirconfig.h"
54#include "stdaddressbook.h" 54#include "stdaddressbook.h"
55 55
56//US 56//US
57#include <qdir.h> 57#include <qdir.h>
58 58
59#include "resourcedir.h" 59#include "resourcedir.h"
60#include "syncprefwidget.h" 60#include "syncprefwidget.h"
61 61
62using namespace KABC; 62using namespace KABC;
63 63
64extern "C" 64extern "C"
65#ifdef _WIN32_ 65#ifdef _WIN32_
66__declspec(dllexport) 66__declspec(dllexport)
67#else 67#else
68{ 68{
69#endif 69#endif
70 70
71//US void *init_kabc_dir() 71//US void *init_kabc_dir()
72 void *init_microkabc_dir() 72 void *init_microkabc_dir()
73 { 73 {
74 return new KRES::PluginFactory<ResourceDir,ResourceDirConfig, SyncPrefWidget>(); 74 return new KRES::PluginFactory<ResourceDir,ResourceDirConfig, SyncPrefWidgetContainer>();
75 } 75 }
76#ifndef _WIN32_ 76#ifndef _WIN32_
77} 77}
78#endif 78#endif
79 79
80ResourceDir::ResourceDir( const KConfig *config, bool syncable ) 80ResourceDir::ResourceDir( const KConfig *config, bool syncable )
81 : Resource( config, syncable ) 81 : Resource( config, syncable )
82{ 82{
83 QString path; 83 QString path;
84 84
85 KConfig *cfg = (KConfig *)config; 85 KConfig *cfg = (KConfig *)config;
86 if ( cfg ) { 86 if ( cfg ) {
87//US path = config->readEntry( "FilePath" ); 87//US path = config->readEntry( "FilePath" );
88 path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() ); 88 path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() );
89//US mFormatName = config->readEntry( "FileFormat" ); 89//US mFormatName = config->readEntry( "FileFormat" );
90 mFormatName = cfg->readEntry( "FileFormat", "vcard" ); 90 mFormatName = cfg->readEntry( "FileFormat", "vcard" );
91 } else { 91 } else {
92 path = StdAddressBook::directoryName(); 92 path = StdAddressBook::directoryName();
93 mFormatName = "vcard"; 93 mFormatName = "vcard";
94 } 94 }
95 95
96 96
97 FormatFactory *factory = FormatFactory::self(); 97 FormatFactory *factory = FormatFactory::self();
98 mFormat = factory->format( mFormatName ); 98 mFormat = factory->format( mFormatName );
99 99
100 if ( !mFormat ) { 100 if ( !mFormat ) {
101 mFormatName = "vcard"; 101 mFormatName = "vcard";
102 mFormat = factory->format( mFormatName ); 102 mFormat = factory->format( mFormatName );
103 } 103 }
104 104
105/*US 105/*US
106//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); 106//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1());
107 if (mFormatName == "vcard") 107 if (mFormatName == "vcard")
108 mFormat = new VCardFormatPlugin2(); 108 mFormat = new VCardFormatPlugin2();
109 else if (mFormatName == "binary") 109 else if (mFormatName == "binary")
110 mFormat = new BinaryFormat(); 110 mFormat = new BinaryFormat();
111 else 111 else
112 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); 112 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1());
113*/ 113*/
114 114
115 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); 115 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) );
116 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) ); 116 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) );
117 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) ); 117 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) );
118 118
119 setPath( path ); 119 setPath( path );
120} 120}
121 121
122ResourceDir::~ResourceDir() 122ResourceDir::~ResourceDir()