-rw-r--r-- | kabc/addresseeview.cpp | 2 | ||||
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 41 | ||||
-rw-r--r-- | kabc/plugins/file/resourcefile.h | 2 | ||||
-rw-r--r-- | microkde/kdatetbl.cpp | 2 | ||||
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 4 | ||||
-rw-r--r-- | microkde/kdecore/kstandarddirs.h | 4 |
6 files changed, 39 insertions, 16 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index aa96210..9118c3d 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp | |||
@@ -286,25 +286,25 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) | |||
286 | 286 | ||
287 | } else if ( gen == "female" ) { | 287 | } else if ( gen == "female" ) { |
288 | static bool setDefaultImageFemale = false; | 288 | static bool setDefaultImageFemale = false; |
289 | if ( !setDefaultImageFemale ) { | 289 | if ( !setDefaultImageFemale ) { |
290 | QMimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) ); | 290 | QMimeSourceFactory::defaultFactory()->setPixmap( "FemaleIcon", KGlobal::iconLoader()->loadIcon( "ic_female", KIcon::Desktop, 128 ) ); |
291 | setDefaultImageFemale = true; | 291 | setDefaultImageFemale = true; |
292 | } | 292 | } |
293 | picString = "<img src=\"FemaleIcon\" width=\"64\" height=\"64\">"; | 293 | picString = "<img src=\"FemaleIcon\" width=\"64\" height=\"64\">"; |
294 | 294 | ||
295 | } else { | 295 | } else { |
296 | static bool setDefaultImage = false; | 296 | static bool setDefaultImage = false; |
297 | if ( !setDefaultImage ) { | 297 | if ( !setDefaultImage ) { |
298 | qDebug("Setting default pixmap "); | 298 | //qDebug("Setting default pixmap "); |
299 | QMimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) ); | 299 | QMimeSourceFactory::defaultFactory()->setPixmap( "defaultIcon", KGlobal::iconLoader()->loadIcon( "ic_penguin", KIcon::Desktop, 128 ) ); |
300 | setDefaultImage = true; | 300 | setDefaultImage = true; |
301 | } | 301 | } |
302 | picString = "<img src=\"defaultIcon\" width=\"64\" height=\"64\">"; | 302 | picString = "<img src=\"defaultIcon\" width=\"64\" height=\"64\">"; |
303 | } | 303 | } |
304 | } | 304 | } |
305 | } | 305 | } |
306 | } | 306 | } |
307 | mText = QString::fromLatin1( | 307 | mText = QString::fromLatin1( |
308 | "<html>" | 308 | "<html>" |
309 | "<body text=\"%1\" bgcolor=\"%2\">" // text and background color | 309 | "<body text=\"%1\" bgcolor=\"%2\">" // text and background color |
310 | "<table>" | 310 | "<table>" |
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index dc5932f..4ab7f02 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp | |||
@@ -46,25 +46,24 @@ $Id$ | |||
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 | #define NO_DIRWATCH | 52 | #define NO_DIRWATCH |
53 | #include "resourcefile.h" | 53 | #include "resourcefile.h" |
54 | 54 | ||
55 | //#define ALLOW_LOCKING | 55 | //#define ALLOW_LOCKING |
56 | 56 | ||
57 | 57 | ||
58 | |||
59 | using namespace KABC; | 58 | using namespace KABC; |
60 | 59 | ||
61 | extern "C" | 60 | extern "C" |
62 | #ifdef _WIN32_ | 61 | #ifdef _WIN32_ |
63 | __declspec(dllexport) | 62 | __declspec(dllexport) |
64 | #else | 63 | #else |
65 | { | 64 | { |
66 | #endif | 65 | #endif |
67 | 66 | ||
68 | //US void *init_kabc_file() | 67 | //US void *init_kabc_file() |
69 | void *init_microkabc_file() | 68 | void *init_microkabc_file() |
70 | { | 69 | { |
@@ -89,86 +88,104 @@ ResourceFile::ResourceFile( const KConfig *config ) | |||
89 | fileName = default_fileName; | 88 | fileName = default_fileName; |
90 | formatName = "vcard"; | 89 | formatName = "vcard"; |
91 | } | 90 | } |
92 | 91 | ||
93 | init( fileName, formatName ); | 92 | init( fileName, formatName ); |
94 | } | 93 | } |
95 | 94 | ||
96 | ResourceFile::ResourceFile( const QString &fileName , | 95 | ResourceFile::ResourceFile( const QString &fileName , |
97 | const QString &formatName ) | 96 | const QString &formatName ) |
98 | : Resource( 0 ) | 97 | : Resource( 0 ) |
99 | { | 98 | { |
100 | // qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); | 99 | // qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); |
100 | |||
101 | |||
102 | |||
101 | init( fileName, formatName ); | 103 | init( fileName, formatName ); |
102 | } | 104 | } |
103 | 105 | ||
104 | void ResourceFile::init( const QString &fileName, const QString &formatName ) | 106 | void ResourceFile::init( const QString &fileName, const QString &formatName ) |
105 | { | 107 | { |
106 | mFormatName = formatName; | 108 | mFormatName = formatName; |
107 | 109 | ||
108 | FormatFactory *factory = FormatFactory::self(); | 110 | FormatFactory *factory = FormatFactory::self(); |
109 | mFormat = factory->format( mFormatName ); | 111 | mFormat = factory->format( mFormatName ); |
110 | 112 | ||
111 | if ( !mFormat ) { | 113 | if ( !mFormat ) { |
112 | mFormatName = "vcard"; | 114 | mFormatName = "vcard"; |
113 | mFormat = factory->format( mFormatName ); | 115 | mFormat = factory->format( mFormatName ); |
114 | } | 116 | } |
115 | 117 | ||
116 | #ifndef NO_DIRWATCH | 118 | #ifndef NO_DIRWATCH |
117 | connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); | 119 | connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); |
118 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); | 120 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); |
119 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); | 121 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); |
120 | #endif | 122 | #endif |
123 | |||
124 | |||
125 | QString localKdeDir; | ||
126 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); | ||
127 | if ( ! localKdeDir.isEmpty() ) { | ||
128 | qDebug("LOCALMICROKDEHOME is set to: %s",localKdeDir.latin1() ); | ||
129 | |||
130 | |||
131 | |||
132 | |||
133 | } | ||
134 | qDebug("RESOURCE: %s ", fileName.latin1()); | ||
135 | |||
136 | |||
137 | |||
121 | setFileName( fileName ); | 138 | setFileName( fileName ); |
122 | } | 139 | } |
123 | 140 | ||
124 | ResourceFile::~ResourceFile() | 141 | ResourceFile::~ResourceFile() |
125 | { | 142 | { |
126 | delete mFormat; | 143 | delete mFormat; |
127 | mFormat = 0; | 144 | mFormat = 0; |
128 | } | 145 | } |
129 | 146 | ||
130 | void ResourceFile::writeConfig( KConfig *config ) | 147 | void ResourceFile::writeConfig( KConfig *config ) |
131 | { | 148 | { |
132 | 149 | ||
133 | config->setGroup( "Resource_" + identifier() ); | 150 | config->setGroup( "Resource_" + identifier() ); |
134 | Resource::writeConfig( config ); | 151 | Resource::writeConfig( config ); |
135 | 152 | ||
136 | config->writeEntry( "FileName", mFileName ); | 153 | config->writeEntry( "FileName", fileName() ); |
137 | config->writeEntry( "FileFormat", mFormatName ); | 154 | config->writeEntry( "FileFormat", mFormatName ); |
138 | 155 | ||
139 | // qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); | 156 | // qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); |
140 | 157 | ||
141 | } | 158 | } |
142 | 159 | ||
143 | Ticket *ResourceFile::requestSaveTicket() | 160 | Ticket *ResourceFile::requestSaveTicket() |
144 | { | 161 | { |
145 | kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; | 162 | kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; |
146 | 163 | ||
147 | if ( !addressBook() ) return 0; | 164 | if ( !addressBook() ) return 0; |
148 | 165 | ||
149 | #ifdef ALLOW_LOCKING | 166 | #ifdef ALLOW_LOCKING |
150 | if ( !lock( mFileName ) ) { | 167 | if ( !lock( mFileName ) ) { |
151 | qDebug("unablt to lock file "); | 168 | qDebug("unablt to lock file "); |
152 | return 0; | 169 | return 0; |
153 | } | 170 | } |
154 | #endif | 171 | #endif |
155 | return createTicket( this ); | 172 | return createTicket( this ); |
156 | } | 173 | } |
157 | 174 | ||
158 | 175 | ||
159 | bool ResourceFile::doOpen() | 176 | bool ResourceFile::doOpen() |
160 | { | 177 | { |
161 | QFile file( mFileName ); | 178 | QFile file( fileName() ); |
162 | qDebug("ResourceFile::openfile %s ", mFileName.latin1()); | 179 | qDebug("ResourceFile::openfile %s ", fileName().latin1()); |
163 | 180 | ||
164 | if ( !file.exists() ) { | 181 | if ( !file.exists() ) { |
165 | // try to create the file | 182 | // try to create the file |
166 | bool ok = file.open( IO_WriteOnly ); | 183 | bool ok = file.open( IO_WriteOnly ); |
167 | if ( ok ) | 184 | if ( ok ) |
168 | file.close(); | 185 | file.close(); |
169 | 186 | ||
170 | return ok; | 187 | return ok; |
171 | } else { | 188 | } else { |
172 | if ( !file.open( IO_ReadWrite ) ) | 189 | if ( !file.open( IO_ReadWrite ) ) |
173 | return false; | 190 | return false; |
174 | 191 | ||
@@ -182,27 +199,27 @@ bool ResourceFile::doOpen() | |||
182 | 199 | ||
183 | return ok; | 200 | return ok; |
184 | } | 201 | } |
185 | } | 202 | } |
186 | 203 | ||
187 | void ResourceFile::doClose() | 204 | void ResourceFile::doClose() |
188 | { | 205 | { |
189 | } | 206 | } |
190 | 207 | ||
191 | bool ResourceFile::load() | 208 | bool ResourceFile::load() |
192 | { | 209 | { |
193 | 210 | ||
194 | QFile file( mFileName ); | 211 | QFile file( fileName() ); |
195 | if ( !file.open( IO_ReadOnly ) ) { | 212 | if ( !file.open( IO_ReadOnly ) ) { |
196 | addressBook()->error( i18n( "Unable to open file '%1'." ).arg( mFileName ) ); | 213 | addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) ); |
197 | return false; | 214 | return false; |
198 | } | 215 | } |
199 | 216 | ||
200 | // qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1()); | 217 | // qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1()); |
201 | 218 | ||
202 | return mFormat->loadAll( addressBook(), this, &file ); | 219 | return mFormat->loadAll( addressBook(), this, &file ); |
203 | } | 220 | } |
204 | 221 | ||
205 | bool ResourceFile::save( Ticket *ticket ) | 222 | bool ResourceFile::save( Ticket *ticket ) |
206 | { | 223 | { |
207 | // qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1()); | 224 | // qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1()); |
208 | 225 | ||
@@ -220,38 +237,38 @@ bool ResourceFile::save( Ticket *ticket ) | |||
220 | if ( saveFile.status() == 0 && saveFile.file() ) | 237 | if ( saveFile.status() == 0 && saveFile.file() ) |
221 | { | 238 | { |
222 | mFormat->saveAll( addressBook(), this, saveFile.file() ); | 239 | mFormat->saveAll( addressBook(), this, saveFile.file() ); |
223 | ok = saveFile.close(); | 240 | ok = saveFile.close(); |
224 | } | 241 | } |
225 | */ | 242 | */ |
226 | 243 | ||
227 | //US ToDo: write backupfile | 244 | //US ToDo: write backupfile |
228 | #ifndef NO_DIRWATCH | 245 | #ifndef NO_DIRWATCH |
229 | mDirWatch.stopScan(); | 246 | mDirWatch.stopScan(); |
230 | #endif | 247 | #endif |
231 | QFile info; | 248 | QFile info; |
232 | info.setName( mFileName ); | 249 | info.setName( fileName() ); |
233 | bool ok = info.open( IO_WriteOnly ); | 250 | bool ok = info.open( IO_WriteOnly ); |
234 | if ( ok ) { | 251 | if ( ok ) { |
235 | mFormat->saveAll( addressBook(), this, &info ); | 252 | mFormat->saveAll( addressBook(), this, &info ); |
236 | 253 | ||
237 | info.close(); | 254 | info.close(); |
238 | ok = true; | 255 | ok = true; |
239 | } | 256 | } |
240 | else { | 257 | else { |
241 | 258 | ||
242 | } | 259 | } |
243 | 260 | ||
244 | if ( !ok ) | 261 | if ( !ok ) |
245 | addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); | 262 | addressBook()->error( i18n( "Unable to save file '%1'." ).arg( fileName() ) ); |
246 | #ifndef NO_DIRWATCH | 263 | #ifndef NO_DIRWATCH |
247 | mDirWatch.startScan(); | 264 | mDirWatch.startScan(); |
248 | #endif | 265 | #endif |
249 | delete ticket; | 266 | delete ticket; |
250 | #ifdef ALLOW_LOCKING | 267 | #ifdef ALLOW_LOCKING |
251 | unlock( mFileName ); | 268 | unlock( mFileName ); |
252 | #endif | 269 | #endif |
253 | 270 | ||
254 | return ok; | 271 | return ok; |
255 | } | 272 | } |
256 | 273 | ||
257 | bool ResourceFile::lock( const QString &fileName ) | 274 | bool ResourceFile::lock( const QString &fileName ) |
@@ -325,34 +342,34 @@ void ResourceFile::unlock( const QString &fileName ) | |||
325 | 342 | ||
326 | void ResourceFile::setFileName( const QString &fileName ) | 343 | void ResourceFile::setFileName( const QString &fileName ) |
327 | { | 344 | { |
328 | #ifndef NO_DIRWATCH | 345 | #ifndef NO_DIRWATCH |
329 | mDirWatch.stopScan(); | 346 | mDirWatch.stopScan(); |
330 | mDirWatch.removeFile( mFileName ); | 347 | mDirWatch.removeFile( mFileName ); |
331 | mFileName = fileName; | 348 | mFileName = fileName; |
332 | 349 | ||
333 | 350 | ||
334 | mDirWatch.addFile( mFileName ); | 351 | mDirWatch.addFile( mFileName ); |
335 | mDirWatch.startScan(); | 352 | mDirWatch.startScan(); |
336 | #else | 353 | #else |
337 | mFileName = fileName; | 354 | mFileName2 = fileName; |
338 | #endif | 355 | #endif |
339 | 356 | ||
340 | //US simulate KDirWatch event | 357 | //US simulate KDirWatch event |
341 | //US fileChanged(); | 358 | //US fileChanged(); |
342 | } | 359 | } |
343 | 360 | ||
344 | QString ResourceFile::fileName() const | 361 | QString ResourceFile::fileName() const |
345 | { | 362 | { |
346 | return mFileName; | 363 | return mFileName2; |
347 | } | 364 | } |
348 | 365 | ||
349 | void ResourceFile::setFormat( const QString &format ) | 366 | void ResourceFile::setFormat( const QString &format ) |
350 | { | 367 | { |
351 | mFormatName = format; | 368 | mFormatName = format; |
352 | delete mFormat; | 369 | delete mFormat; |
353 | 370 | ||
354 | FormatFactory *factory = FormatFactory::self(); | 371 | FormatFactory *factory = FormatFactory::self(); |
355 | mFormat = factory->format( mFormatName ); | 372 | mFormat = factory->format( mFormatName ); |
356 | /*US | 373 | /*US |
357 | //qDebug("ResourceFile::setFormat initialized with format %s ", format.latin1()); | 374 | //qDebug("ResourceFile::setFormat initialized with format %s ", format.latin1()); |
358 | if (mFormatName == "vcard") { | 375 | if (mFormatName == "vcard") { |
@@ -373,32 +390,32 @@ QString ResourceFile::format() const | |||
373 | { | 390 | { |
374 | return mFormatName; | 391 | return mFormatName; |
375 | } | 392 | } |
376 | 393 | ||
377 | void ResourceFile::fileChanged() | 394 | void ResourceFile::fileChanged() |
378 | { | 395 | { |
379 | // There is a small theoretical chance that KDirWatch calls us before | 396 | // There is a small theoretical chance that KDirWatch calls us before |
380 | // we are fully constructed | 397 | // we are fully constructed |
381 | if (!addressBook()) | 398 | if (!addressBook()) |
382 | return; | 399 | return; |
383 | 400 | ||
384 | 401 | ||
385 | QString text( i18n( "File resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( mFileName ) ); | 402 | QString text( i18n( "File resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( fileName() ) ); |
386 | if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) { | 403 | if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) { |
387 | load(); | 404 | load(); |
388 | addressBook()->emitAddressBookChanged(); | 405 | addressBook()->emitAddressBookChanged(); |
389 | } | 406 | } |
390 | } | 407 | } |
391 | 408 | ||
392 | void ResourceFile::removeAddressee( const Addressee &addr ) | 409 | void ResourceFile::removeAddressee( const Addressee &addr ) |
393 | { | 410 | { |
394 | QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/photos/" ) + addr.uid() ) ); | 411 | QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/photos/" ) + addr.uid() ) ); |
395 | QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/logos/" ) + addr.uid() ) ); | 412 | QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/logos/" ) + addr.uid() ) ); |
396 | QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/sounds/" ) + addr.uid() ) ); | 413 | QFile::remove( QFile::encodeName( locateLocal( "data", "kabc/sounds/" ) + addr.uid() ) ); |
397 | } | 414 | } |
398 | 415 | ||
399 | void ResourceFile::cleanUp() | 416 | void ResourceFile::cleanUp() |
400 | { | 417 | { |
401 | unlock( mFileName ); | 418 | unlock( fileName() ); |
402 | } | 419 | } |
403 | 420 | ||
404 | //US #include "resourcefile.moc" | 421 | //US #include "resourcefile.moc" |
diff --git a/kabc/plugins/file/resourcefile.h b/kabc/plugins/file/resourcefile.h index b4421b2..dd38a9d 100644 --- a/kabc/plugins/file/resourcefile.h +++ b/kabc/plugins/file/resourcefile.h | |||
@@ -138,25 +138,25 @@ public: | |||
138 | virtual void cleanUp(); | 138 | virtual void cleanUp(); |
139 | 139 | ||
140 | protected slots: | 140 | protected slots: |
141 | void fileChanged(); | 141 | void fileChanged(); |
142 | 142 | ||
143 | protected: | 143 | protected: |
144 | void init( const QString &fileName, const QString &format ); | 144 | void init( const QString &fileName, const QString &format ); |
145 | 145 | ||
146 | bool lock( const QString &fileName ); | 146 | bool lock( const QString &fileName ); |
147 | void unlock( const QString &fileName ); | 147 | void unlock( const QString &fileName ); |
148 | 148 | ||
149 | private: | 149 | private: |
150 | QString mFileName; | 150 | QString mFileName2; |
151 | QString mFormatName; | 151 | QString mFormatName; |
152 | 152 | ||
153 | FormatPlugin *mFormat; | 153 | FormatPlugin *mFormat; |
154 | 154 | ||
155 | QString mLockUniqueName; | 155 | QString mLockUniqueName; |
156 | #ifndef NO_DIRWATCH | 156 | #ifndef NO_DIRWATCH |
157 | KDirWatch mDirWatch; | 157 | KDirWatch mDirWatch; |
158 | #endif | 158 | #endif |
159 | }; | 159 | }; |
160 | 160 | ||
161 | } | 161 | } |
162 | 162 | ||
diff --git a/microkde/kdatetbl.cpp b/microkde/kdatetbl.cpp index d182279..2d97c8c 100644 --- a/microkde/kdatetbl.cpp +++ b/microkde/kdatetbl.cpp | |||
@@ -315,25 +315,25 @@ KDateTable::setFontSize(int size) | |||
315 | maxCell.setHeight(QMAX(maxCell.height(), rect.height())); | 315 | maxCell.setHeight(QMAX(maxCell.height(), rect.height())); |
316 | } | 316 | } |
317 | // ----- compare with a real wide number and add some space: | 317 | // ----- compare with a real wide number and add some space: |
318 | rect=metrics.boundingRect(QString::fromLatin1("88")); | 318 | rect=metrics.boundingRect(QString::fromLatin1("88")); |
319 | maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); | 319 | maxCell.setWidth(QMAX(maxCell.width()+2, rect.width())); |
320 | #ifdef DESKTOP_VERSION | 320 | #ifdef DESKTOP_VERSION |
321 | maxCell.setHeight(QMAX(maxCell.height()+8, rect.height())); | 321 | maxCell.setHeight(QMAX(maxCell.height()+8, rect.height())); |
322 | #else | 322 | #else |
323 | maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); | 323 | maxCell.setHeight(QMAX(maxCell.height()+4, rect.height())); |
324 | #endif | 324 | #endif |
325 | if ( maxCell.width() * 1000 / maxCell.height() > 1900 ) { | 325 | if ( maxCell.width() * 1000 / maxCell.height() > 1900 ) { |
326 | maxCell.setHeight(maxCell.width() * 1000 / 1900 ); | 326 | maxCell.setHeight(maxCell.width() * 1000 / 1900 ); |
327 | qDebug("setmax "); | 327 | //qDebug("setmax "); |
328 | } | 328 | } |
329 | } | 329 | } |
330 | 330 | ||
331 | void | 331 | void |
332 | KDateTable::contentsMousePressEvent(QMouseEvent *e) | 332 | KDateTable::contentsMousePressEvent(QMouseEvent *e) |
333 | { | 333 | { |
334 | if(e->type()!=QEvent::MouseButtonPress) | 334 | if(e->type()!=QEvent::MouseButtonPress) |
335 | { // the KDatePicker only reacts on mouse press events: | 335 | { // the KDatePicker only reacts on mouse press events: |
336 | return; | 336 | return; |
337 | } | 337 | } |
338 | if(!isEnabled()) | 338 | if(!isEnabled()) |
339 | { | 339 | { |
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index 810c889..4ab1a68 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp | |||
@@ -1194,25 +1194,25 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) | |||
1194 | { | 1194 | { |
1195 | qDebug("KStandardDirs::makeDir could not create: %s" , base.latin1()); | 1195 | qDebug("KStandardDirs::makeDir could not create: %s" , base.latin1()); |
1196 | return false; | 1196 | return false; |
1197 | } | 1197 | } |
1198 | } | 1198 | } |
1199 | 1199 | ||
1200 | i = pos + 1; | 1200 | i = pos + 1; |
1201 | } | 1201 | } |
1202 | return true; | 1202 | return true; |
1203 | 1203 | ||
1204 | } | 1204 | } |
1205 | 1205 | ||
1206 | static QString readEnvPath(const char *env) | 1206 | QString readEnvPath(const char *env) |
1207 | { | 1207 | { |
1208 | //#ifdef _WIN32_ | 1208 | //#ifdef _WIN32_ |
1209 | // return ""; | 1209 | // return ""; |
1210 | //#else | 1210 | //#else |
1211 | QCString c_path; | 1211 | QCString c_path; |
1212 | if ( getenv(env) != NULL ) | 1212 | if ( getenv(env) != NULL ) |
1213 | c_path = QString ( getenv(env) ); | 1213 | c_path = QString ( getenv(env) ); |
1214 | if (c_path.isEmpty()) | 1214 | if (c_path.isEmpty()) |
1215 | return QString::null; | 1215 | return QString::null; |
1216 | return QFile::decodeName(c_path); | 1216 | return QFile::decodeName(c_path); |
1217 | //#endif | 1217 | //#endif |
1218 | 1218 | ||
@@ -1297,24 +1297,26 @@ void KStandardDirs::addKDEDefaults() | |||
1297 | #endif | 1297 | #endif |
1298 | KConfig cfg ( confFile ); | 1298 | KConfig cfg ( confFile ); |
1299 | cfg.setGroup("Global"); | 1299 | cfg.setGroup("Global"); |
1300 | localKdeDir = cfg.readEntry( "MICROKDEHOME", QDir::homeDirPath() + "/kdepim/" ); | 1300 | localKdeDir = cfg.readEntry( "MICROKDEHOME", QDir::homeDirPath() + "/kdepim/" ); |
1301 | #ifdef DESKTOP_VERSION | 1301 | #ifdef DESKTOP_VERSION |
1302 | if ( localKdeDir.startsWith( "LOCAL:" ) ) { | 1302 | if ( localKdeDir.startsWith( "LOCAL:" ) ) { |
1303 | #ifdef _WIN32_ | 1303 | #ifdef _WIN32_ |
1304 | localKdeDir = qApp->applicationDirPath () + "\\"+ localKdeDir.mid( 6 ); | 1304 | localKdeDir = qApp->applicationDirPath () + "\\"+ localKdeDir.mid( 6 ); |
1305 | #else | 1305 | #else |
1306 | localKdeDir = qApp->applicationDirPath () + "/"+ localKdeDir.mid( 6 ); | 1306 | localKdeDir = qApp->applicationDirPath () + "/"+ localKdeDir.mid( 6 ); |
1307 | #endif | 1307 | #endif |
1308 | qDebug("Using local conf dir %s ",localKdeDir.latin1() ); | 1308 | qDebug("Using local conf dir %s ",localKdeDir.latin1() ); |
1309 | // <stdlib.h> | ||
1310 | setenv( "LOCALMICROKDEHOME", localKdeDir.latin1(), 1 ); | ||
1309 | } | 1311 | } |
1310 | #endif | 1312 | #endif |
1311 | } | 1313 | } |
1312 | } | 1314 | } |
1313 | else | 1315 | else |
1314 | { | 1316 | { |
1315 | // We treat root different to prevent root messing up the | 1317 | // We treat root different to prevent root messing up the |
1316 | // file permissions in the users home directory. | 1318 | // file permissions in the users home directory. |
1317 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); | 1319 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); |
1318 | if (!localKdeDir.isEmpty()) | 1320 | if (!localKdeDir.isEmpty()) |
1319 | { | 1321 | { |
1320 | if (localKdeDir.at(localKdeDir.length()-1) != '/') | 1322 | if (localKdeDir.at(localKdeDir.length()-1) != '/') |
diff --git a/microkde/kdecore/kstandarddirs.h b/microkde/kdecore/kstandarddirs.h index bee864e..901384e 100644 --- a/microkde/kdecore/kstandarddirs.h +++ b/microkde/kdecore/kstandarddirs.h | |||
@@ -638,24 +638,25 @@ public: | |||
638 | * \code | 638 | * \code |
639 | * // Code example | 639 | * // Code example |
640 | * myFile = locateLocal("appdata", "groups.lst"); | 640 | * myFile = locateLocal("appdata", "groups.lst"); |
641 | * myData = myReadGroups(myFile); | 641 | * myData = myReadGroups(myFile); |
642 | * ... | 642 | * ... |
643 | * doSomething(myData); | 643 | * doSomething(myData); |
644 | * ... | 644 | * ... |
645 | * myFile = locateLocal("appdata", "groups.lst"); | 645 | * myFile = locateLocal("appdata", "groups.lst"); |
646 | * myWriteGroups(myFile, myData); | 646 | * myWriteGroups(myFile, myData); |
647 | * \endcode | 647 | * \endcode |
648 | **/ | 648 | **/ |
649 | 649 | ||
650 | |||
650 | /*! | 651 | /*! |
651 | * \relates KStandardDirs | 652 | * \relates KStandardDirs |
652 | * This function is just for convenience. It simply calls | 653 | * This function is just for convenience. It simply calls |
653 | *instance->dirs()->\link KStandardDirs::findResource() findResource\endlink(type, filename). | 654 | *instance->dirs()->\link KStandardDirs::findResource() findResource\endlink(type, filename). |
654 | **/ | 655 | **/ |
655 | QString locate( const char *type, const QString& filename /*US , const KInstance* instance = KGlobal::instance()*/ ); | 656 | QString locate( const char *type, const QString& filename /*US , const KInstance* instance = KGlobal::instance()*/ ); |
656 | 657 | ||
657 | /*! | 658 | /*! |
658 | * \relates KStandardDirs | 659 | * \relates KStandardDirs |
659 | * This function is much like locate. However it returns a | 660 | * This function is much like locate. However it returns a |
660 | * filename suitable for writing to. No check is made if the | 661 | * filename suitable for writing to. No check is made if the |
661 | * specified filename actually exists. Missing directories | 662 | * specified filename actually exists. Missing directories |
@@ -667,15 +668,18 @@ QString locateLocal( const char *type, const QString& filename /*US , const KIns | |||
667 | 668 | ||
668 | /*! | 669 | /*! |
669 | * \relates KStandardDirs | 670 | * \relates KStandardDirs |
670 | * This function is much like locate. No check is made if the | 671 | * This function is much like locate. No check is made if the |
671 | * specified filename actually exists. Missing directories | 672 | * specified filename actually exists. Missing directories |
672 | * are created if @p createDir is true. If filename is only | 673 | * are created if @p createDir is true. If filename is only |
673 | * a directory, without a specific file, | 674 | * a directory, without a specific file, |
674 | * filename must have a trailing slash. | 675 | * filename must have a trailing slash. |
675 | * | 676 | * |
676 | **/ | 677 | **/ |
677 | QString locateLocal( const char *type, const QString& filename, bool createDir /*US , const KInstance* instance = KGlobal::instance() */); | 678 | QString locateLocal( const char *type, const QString& filename, bool createDir /*US , const KInstance* instance = KGlobal::instance() */); |
678 | 679 | ||
680 | QString readEnvPath(const char *env); | ||
681 | |||
682 | |||
679 | /*! @} */ | 683 | /*! @} */ |
680 | 684 | ||
681 | #endif // SSK_KSTDDIRS_H | 685 | #endif // SSK_KSTDDIRS_H |