Diffstat (limited to 'kabc/plugins/dir/resourcedir.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index c61664b..cc4afee 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp | |||
@@ -167,13 +167,13 @@ bool ResourceDir::doOpen() | |||
167 | } else { | 167 | } else { |
168 | QString testName = dir.entryList( QDir::Files )[0]; | 168 | QString testName = dir.entryList( QDir::Files )[0]; |
169 | if ( testName.isNull() || testName.isEmpty() ) // no file in directory | 169 | if ( testName.isNull() || testName.isEmpty() ) // no file in directory |
170 | return true; | 170 | return true; |
171 | 171 | ||
172 | QFile file( mPath + "/" + testName ); | 172 | QFile file( mPath + "/" + testName ); |
173 | if ( file.open( IO_ReadOnly ) ) | 173 | if ( file.open( QIODevice::ReadOnly ) ) |
174 | return true; | 174 | return true; |
175 | 175 | ||
176 | if ( file.size() == 0 ) | 176 | if ( file.size() == 0 ) |
177 | return true; | 177 | return true; |
178 | 178 | ||
179 | bool ok = mFormat->checkFormat( &file ); | 179 | bool ok = mFormat->checkFormat( &file ); |
@@ -193,13 +193,13 @@ bool ResourceDir::load() | |||
193 | 193 | ||
194 | QStringList::Iterator it; | 194 | QStringList::Iterator it; |
195 | bool ok = true; | 195 | bool ok = true; |
196 | for ( it = files.begin(); it != files.end(); ++it ) { | 196 | for ( it = files.begin(); it != files.end(); ++it ) { |
197 | QFile file( mPath + "/" + (*it) ); | 197 | QFile file( mPath + "/" + (*it) ); |
198 | 198 | ||
199 | if ( !file.open( IO_ReadOnly ) ) { | 199 | if ( !file.open( QIODevice::ReadOnly ) ) { |
200 | addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) ); | 200 | addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) ); |
201 | ok = false; | 201 | ok = false; |
202 | continue; | 202 | continue; |
203 | } | 203 | } |
204 | 204 | ||
205 | if ( !mFormat->loadAll( addressBook(), this, &file ) ) | 205 | if ( !mFormat->loadAll( addressBook(), this, &file ) ) |
@@ -220,13 +220,13 @@ bool ResourceDir::save( Ticket *ticket ) | |||
220 | #endif | 220 | #endif |
221 | for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { | 221 | for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { |
222 | if ( (*it).resource() != this || !(*it).changed() ) | 222 | if ( (*it).resource() != this || !(*it).changed() ) |
223 | continue; | 223 | continue; |
224 | 224 | ||
225 | QFile file( mPath + "/" + (*it).uid() ); | 225 | QFile file( mPath + "/" + (*it).uid() ); |
226 | if ( !file.open( IO_WriteOnly ) ) { | 226 | if ( !file.open( QIODevice::WriteOnly ) ) { |
227 | addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); | 227 | addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); |
228 | continue; | 228 | continue; |
229 | } | 229 | } |
230 | 230 | ||
231 | mFormat->save( *it, &file ); | 231 | mFormat->save( *it, &file ); |
232 | 232 | ||
@@ -264,13 +264,13 @@ bool ResourceDir::lock( const QString &path ) | |||
264 | url = lockUniqueName; | 264 | url = lockUniqueName; |
265 | //US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); | 265 | //US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); |
266 | mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); | 266 | mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); |
267 | 267 | ||
268 | // Create unique file | 268 | // Create unique file |
269 | QFile file( mLockUniqueName ); | 269 | QFile file( mLockUniqueName ); |
270 | file.open( IO_WriteOnly ); | 270 | file.open( QIODevice::WriteOnly ); |
271 | file.close(); | 271 | file.close(); |
272 | 272 | ||
273 | // Create lock file | 273 | // Create lock file |
274 | int result = 0; | 274 | int result = 0; |
275 | #ifndef _WIN32_ | 275 | #ifndef _WIN32_ |
276 | result = ::link( QFile::encodeName( mLockUniqueName ), | 276 | result = ::link( QFile::encodeName( mLockUniqueName ), |