author | ulf69 <ulf69> | 2004-07-09 08:12:00 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-09 08:12:00 (UTC) |
commit | aae8af24992bf3b7b59fb425955153b86f31bb5d (patch) (unidiff) | |
tree | 2ad2e501a14c5a96bf5c7deebd3638bed405350e | |
parent | de99e22a7093e857ee3c08a67ccc389d6374099a (diff) | |
download | kdepimpi-aae8af24992bf3b7b59fb425955153b86f31bb5d.zip kdepimpi-aae8af24992bf3b7b59fb425955153b86f31bb5d.tar.gz kdepimpi-aae8af24992bf3b7b59fb425955153b86f31bb5d.tar.bz2 |
IntDateFormat is now an enum instead of an ionteger value
-rw-r--r-- | kabc/field.cpp | 8 | ||||
-rw-r--r-- | kabc/plugins/opie/resourceopie.cpp | 16 | ||||
-rw-r--r-- | kabc/plugins/opie/resourceopieconfig.cpp | 11 | ||||
-rw-r--r-- | kabc/plugins/opie/resourceopieconfig.h | 3 |
4 files changed, 20 insertions, 18 deletions
diff --git a/kabc/field.cpp b/kabc/field.cpp index bc2e176..e27970e 100644 --- a/kabc/field.cpp +++ b/kabc/field.cpp | |||
@@ -258,16 +258,16 @@ QString Field::value( const KABC::Addressee &a ) | |||
258 | case FieldImpl::Email: | 258 | case FieldImpl::Email: |
259 | return a.preferredEmail(); | 259 | return a.preferredEmail(); |
260 | case FieldImpl::Birthday: | 260 | case FieldImpl::Birthday: |
261 | if ( a.birthday().isValid() ) { | 261 | if ( a.birthday().isValid() ) { |
262 | //the generated code had the following format: return a.birthday().date().toString( Qt::ISODate ); | 262 | //the generated code had the following format: return a.birthday().date().toString( Qt::ISODate ); |
263 | // But Qt::IsoDate was not specified. | 263 | // But Qt::IsoDate was not specified. |
264 | QString _oldFormat = KGlobal::locale()->dateFormat(); | 264 | // QString _oldFormat = KGlobal::locale()->dateFormat(); |
265 | KGlobal::locale()->setDateFormat("%Y-%m-%d"); // = Qt::ISODate | 265 | // KGlobal::locale()->setDateFormat("%Y-%m-%d"); // = Qt::ISODate |
266 | QString dt = KGlobal::locale()->formatDate(a.birthday().date(), false); | 266 | QString dt = KGlobal::locale()->formatDate(a.birthday().date(), false, KLocale::ISODate); |
267 | KGlobal::locale()->setDateFormat(_oldFormat); | 267 | // KGlobal::locale()->setDateFormat(_oldFormat); |
268 | return dt; | 268 | return dt; |
269 | } | 269 | } |
270 | else | 270 | else |
271 | return QString::null; | 271 | return QString::null; |
272 | case FieldImpl::Url: | 272 | case FieldImpl::Url: |
273 | return a.url().prettyURL(); | 273 | return a.url().prettyURL(); |
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp index 3b2a6b7..a7d271f 100644 --- a/kabc/plugins/opie/resourceopie.cpp +++ b/kabc/plugins/opie/resourceopie.cpp | |||
@@ -94,13 +94,13 @@ void ResourceOpie::init( const QString &fileName ) | |||
94 | /*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods | 94 | /*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods |
95 | connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); | 95 | connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); |
96 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); | 96 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); |
97 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); | 97 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); |
98 | */ | 98 | */ |
99 | //US opie addressbook is always readonly | 99 | //US opie addressbook is always readonly |
100 | setReadOnly( true ); | 100 | //US setReadOnly( true ); |
101 | 101 | ||
102 | setFileName( fileName ); | 102 | setFileName( fileName ); |
103 | 103 | ||
104 | } | 104 | } |
105 | 105 | ||
106 | ResourceOpie::~ResourceOpie() | 106 | ResourceOpie::~ResourceOpie() |
@@ -109,13 +109,13 @@ ResourceOpie::~ResourceOpie() | |||
109 | delete mConverter; | 109 | delete mConverter; |
110 | } | 110 | } |
111 | 111 | ||
112 | void ResourceOpie::writeConfig( KConfig *config ) | 112 | void ResourceOpie::writeConfig( KConfig *config ) |
113 | { | 113 | { |
114 | //US opie addressbook is always readonly | 114 | //US opie addressbook is always readonly |
115 | setReadOnly( true ); | 115 | //US setReadOnly( true ); |
116 | 116 | ||
117 | Resource::writeConfig( config ); | 117 | Resource::writeConfig( config ); |
118 | 118 | ||
119 | config->writeEntry( "FileName", mFileName ); | 119 | config->writeEntry( "FileName", mFileName ); |
120 | 120 | ||
121 | // qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); | 121 | // qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); |
@@ -191,19 +191,29 @@ bool ResourceOpie::load() | |||
191 | addressBook()->error( i18n( "Unable to load file '%1'." ).arg( mFileName ) ); | 191 | addressBook()->error( i18n( "Unable to load file '%1'." ).arg( mFileName ) ); |
192 | return false; | 192 | return false; |
193 | } | 193 | } |
194 | 194 | ||
195 | access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available | 195 | access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available |
196 | 196 | ||
197 | bool res = false; | ||
197 | if (mConverter == 0) | 198 | if (mConverter == 0) |
199 | { | ||
198 | mConverter = new OpieConverter(); | 200 | mConverter = new OpieConverter(); |
201 | res = mConverter->init(); | ||
202 | if ( !res ) | ||
203 | { | ||
204 | qDebug("Unable to initialize opie converter. Most likely a problem with the category file"); | ||
205 | addressBook()->error( i18n( "Unable to initialize opie converter. Most likely a problem with the category file" ) ); | ||
206 | delete access; | ||
207 | return false; | ||
208 | } | ||
209 | } | ||
199 | 210 | ||
200 | 211 | ||
201 | OContactAccess::List::Iterator it; | 212 | OContactAccess::List::Iterator it; |
202 | OContactAccess::List allList = access->allRecords(); | 213 | OContactAccess::List allList = access->allRecords(); |
203 | bool res = false; | ||
204 | for ( it = allList.begin(); it != allList.end(); ++it ) | 214 | for ( it = allList.begin(); it != allList.end(); ++it ) |
205 | { | 215 | { |
206 | OContact c = (*it); | 216 | OContact c = (*it); |
207 | 217 | ||
208 | KABC::Addressee addressee; | 218 | KABC::Addressee addressee; |
209 | 219 | ||
diff --git a/kabc/plugins/opie/resourceopieconfig.cpp b/kabc/plugins/opie/resourceopieconfig.cpp index f4cc4f9..eef9cc9 100644 --- a/kabc/plugins/opie/resourceopieconfig.cpp +++ b/kabc/plugins/opie/resourceopieconfig.cpp | |||
@@ -59,21 +59,13 @@ ResourceOpieConfig::ResourceOpieConfig( QWidget* parent, const char* name ) | |||
59 | 59 | ||
60 | connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), | 60 | connect( mFileNameEdit, SIGNAL( textChanged( const QString & ) ), |
61 | SLOT( checkFilePermissions( const QString & ) ) ); | 61 | SLOT( checkFilePermissions( const QString & ) ) ); |
62 | 62 | ||
63 | mainLayout->addWidget( label, 0, 0 ); | 63 | mainLayout->addWidget( label, 0, 0 ); |
64 | mainLayout->addWidget( mFileNameEdit, 0, 1 ); | 64 | mainLayout->addWidget( mFileNameEdit, 0, 1 ); |
65 | |||
66 | //US mInEditMode = false; | ||
67 | } | ||
68 | /*US | ||
69 | void ResourceOpieConfig::setEditMode( bool value ) | ||
70 | { | ||
71 | mInEditMode = value; | ||
72 | } | 65 | } |
73 | */ | ||
74 | 66 | ||
75 | void ResourceOpieConfig::loadSettings( KRES::Resource *res ) | 67 | void ResourceOpieConfig::loadSettings( KRES::Resource *res ) |
76 | { | 68 | { |
77 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); | 69 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); |
78 | ResourceOpie *resource = (ResourceOpie*)( res ); | 70 | ResourceOpie *resource = (ResourceOpie*)( res ); |
79 | 71 | ||
@@ -82,12 +74,15 @@ void ResourceOpieConfig::loadSettings( KRES::Resource *res ) | |||
82 | return; | 74 | return; |
83 | } | 75 | } |
84 | 76 | ||
85 | mFileNameEdit->setURL( resource->fileName() ); | 77 | mFileNameEdit->setURL( resource->fileName() ); |
86 | if ( mFileNameEdit->url().isEmpty() ) | 78 | if ( mFileNameEdit->url().isEmpty() ) |
87 | mFileNameEdit->setURL( QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml" ); | 79 | mFileNameEdit->setURL( QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml" ); |
80 | |||
81 | //US Opie resources are ReadOnly by definition | ||
82 | emit setPersistentReadOnly( true ); | ||
88 | } | 83 | } |
89 | 84 | ||
90 | void ResourceOpieConfig::saveSettings( KRES::Resource *res ) | 85 | void ResourceOpieConfig::saveSettings( KRES::Resource *res ) |
91 | { | 86 | { |
92 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); | 87 | //US ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); |
93 | ResourceOpie *resource = (ResourceOpie*)( res ); | 88 | ResourceOpie *resource = (ResourceOpie*)( res ); |
diff --git a/kabc/plugins/opie/resourceopieconfig.h b/kabc/plugins/opie/resourceopieconfig.h index 533b7f4..8cc192c 100644 --- a/kabc/plugins/opie/resourceopieconfig.h +++ b/kabc/plugins/opie/resourceopieconfig.h | |||
@@ -39,23 +39,20 @@ class ResourceOpieConfig : public KRES::ConfigWidget | |||
39 | { | 39 | { |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | 41 | ||
42 | public: | 42 | public: |
43 | ResourceOpieConfig( QWidget* parent = 0, const char* name = 0 ); | 43 | ResourceOpieConfig( QWidget* parent = 0, const char* name = 0 ); |
44 | 44 | ||
45 | //US void setEditMode( bool value ); | ||
46 | |||
47 | public slots: | 45 | public slots: |
48 | void loadSettings( KRES::Resource *resource ); | 46 | void loadSettings( KRES::Resource *resource ); |
49 | void saveSettings( KRES::Resource *resource ); | 47 | void saveSettings( KRES::Resource *resource ); |
50 | 48 | ||
51 | protected slots: | 49 | protected slots: |
52 | void checkFilePermissions( const QString& fileName ); | 50 | void checkFilePermissions( const QString& fileName ); |
53 | 51 | ||
54 | private: | 52 | private: |
55 | KURLRequester* mFileNameEdit; | 53 | KURLRequester* mFileNameEdit; |
56 | //US bool mInEditMode; | ||
57 | }; | 54 | }; |
58 | 55 | ||
59 | } | 56 | } |
60 | 57 | ||
61 | #endif | 58 | #endif |