-rw-r--r-- | microkde/kdecore/klibloader.cpp | 17 | ||||
-rw-r--r-- | microkde/kdecore/kstandarddirs.cpp | 3 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.cpp | 2 | ||||
-rw-r--r-- | microkde/kresources/factory.cpp | 3 | ||||
-rw-r--r-- | microkde/microkde.pro | 10 |
5 files changed, 17 insertions, 18 deletions
diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp index c07d50f..c091e05 100644 --- a/microkde/kdecore/klibloader.cpp +++ b/microkde/kdecore/klibloader.cpp | |||
@@ -1,98 +1,95 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 1999 Torben Weis <weis@kde.org> | 2 | Copyright (C) 1999 Torben Weis <weis@kde.org> |
3 | Copyright (C) 2000 Michael Matz <matz@kde.org> | 3 | Copyright (C) 2000 Michael Matz <matz@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
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 version 2 as published by the Free Software Foundation. | 7 | License version 2 as published by the Free Software Foundation. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | //US #include <config.h> | 19 | //US #include <config.h> |
20 | #include <qclipboard.h> | 20 | #include <qclipboard.h> |
21 | #include <qfile.h> | 21 | #include <qfile.h> |
22 | #include <qtimer.h> | 22 | #include <qtimer.h> |
23 | #include <qobjectdict.h> | 23 | #include <qobjectdict.h> |
24 | #include <qwidgetlist.h> | 24 | #include <qwidgetlist.h> |
25 | #include <qwidget.h> | 25 | #include <qwidget.h> |
26 | 26 | ||
27 | #include "kapplication.h" | 27 | #include "kapplication.h" |
28 | #include "klibloader.h" | 28 | #include "klibloader.h" |
29 | #include "kstandarddirs.h" | 29 | #include "kstandarddirs.h" |
30 | #include "kdebug.h" | 30 | #include "kdebug.h" |
31 | #include "klocale.h" | 31 | #include "klocale.h" |
32 | 32 | ||
33 | /*US | 33 | /*US |
34 | #ifndef NDEBUG | 34 | #ifndef NDEBUG |
35 | #include "ltdl.h" | 35 | #include "ltdl.h" |
36 | #endif | 36 | #endif |
37 | */ | 37 | */ |
38 | 38 | ||
39 | //US do everything through qlibrary | 39 | //US do everything through qlibrary |
40 | #ifndef DESKTOP_VERSION | 40 | #ifndef DESKTOP_VERSION |
41 | #include <qpe/qpeapplication.h> | 41 | #include <qpe/qpeapplication.h> |
42 | #include <qtopia/qlibrary.h> | 42 | #include <qtopia/qlibrary.h> |
43 | #else | ||
44 | #include <qlibrary.h> | ||
43 | #endif | 45 | #endif |
44 | 46 | ||
45 | /*US | 47 | |
46 | #ifdef Q_WS_X11 | ||
47 | #include <X11/Xlib.h> | ||
48 | #include <X11/Xatom.h> | ||
49 | #endif | ||
50 | */ | ||
51 | template class QAsciiDict<KLibrary>; | 48 | template class QAsciiDict<KLibrary>; |
52 | 49 | ||
53 | #include <stdlib.h> //getenv | 50 | #include <stdlib.h> //getenv |
54 | 51 | ||
55 | /*US | 52 | /*US |
56 | #if HAVE_DLFCN_H | 53 | #if HAVE_DLFCN_H |
57 | # include <dlfcn.h> | 54 | # include <dlfcn.h> |
58 | #endif | 55 | #endif |
59 | 56 | ||
60 | #ifdef RTLD_GLOBAL | 57 | #ifdef RTLD_GLOBAL |
61 | # define LT_GLOBAL RTLD_GLOBAL | 58 | # define LT_GLOBAL RTLD_GLOBAL |
62 | #else | 59 | #else |
63 | # ifdef DL_GLOBAL | 60 | # ifdef DL_GLOBAL |
64 | # define LT_GLOBAL DL_GLOBAL | 61 | # define LT_GLOBAL DL_GLOBAL |
65 | # endif | 62 | # endif |
66 | #endif | 63 | #endif |
67 | #ifndef LT_GLOBAL | 64 | #ifndef LT_GLOBAL |
68 | # define LT_GLOBAL 0 | 65 | # define LT_GLOBAL 0 |
69 | #endif | 66 | #endif |
70 | */ | 67 | */ |
71 | 68 | ||
72 | /*US | 69 | /*US |
73 | extern "C" { | 70 | extern "C" { |
74 | extern int lt_dlopen_flag; | 71 | extern int lt_dlopen_flag; |
75 | } | 72 | } |
76 | */ | 73 | */ |
77 | 74 | ||
78 | KLibFactory::KLibFactory( QObject* parent, const char* name ) | 75 | KLibFactory::KLibFactory( QObject* parent, const char* name ) |
79 | : QObject( parent, name ) | 76 | : QObject( parent, name ) |
80 | { | 77 | { |
81 | } | 78 | } |
82 | 79 | ||
83 | KLibFactory::~KLibFactory() | 80 | KLibFactory::~KLibFactory() |
84 | { | 81 | { |
85 | // kdDebug(150) << "Deleting KLibFactory " << this << endl; | 82 | // kdDebug(150) << "Deleting KLibFactory " << this << endl; |
86 | } | 83 | } |
87 | 84 | ||
88 | QObject* KLibFactory::create( QObject* parent, const char* name, const char* classname, const QStringList &args ) | 85 | QObject* KLibFactory::create( QObject* parent, const char* name, const char* classname, const QStringList &args ) |
89 | { | 86 | { |
90 | QObject* obj = createObject( parent, name, classname, args ); | 87 | QObject* obj = createObject( parent, name, classname, args ); |
91 | if ( obj ) | 88 | if ( obj ) |
92 | emit objectCreated( obj ); | 89 | emit objectCreated( obj ); |
93 | return obj; | 90 | return obj; |
94 | } | 91 | } |
95 | 92 | ||
96 | 93 | ||
97 | QObject* KLibFactory::createObject( QObject*, const char*, const char*, const QStringList &) | 94 | QObject* KLibFactory::createObject( QObject*, const char*, const char*, const QStringList &) |
98 | { | 95 | { |
@@ -147,97 +144,96 @@ QString KLibrary::name() const | |||
147 | 144 | ||
148 | QString KLibrary::fileName() const | 145 | QString KLibrary::fileName() const |
149 | { | 146 | { |
150 | return m_filename; | 147 | return m_filename; |
151 | } | 148 | } |
152 | 149 | ||
153 | KLibFactory* KLibrary::factory() | 150 | KLibFactory* KLibrary::factory() |
154 | { | 151 | { |
155 | if ( m_factory ) | 152 | if ( m_factory ) |
156 | return m_factory; | 153 | return m_factory; |
157 | 154 | ||
158 | QCString symname; | 155 | QCString symname; |
159 | symname.sprintf("init_%s", name().latin1() ); | 156 | symname.sprintf("init_%s", name().latin1() ); |
160 | 157 | ||
161 | void* sym = symbol( symname ); | 158 | void* sym = symbol( symname ); |
162 | if ( !sym ) | 159 | if ( !sym ) |
163 | { | 160 | { |
164 | qDebug("KLibrary: The library %s does not offer an %s function", name().latin1(), symname.data()); | 161 | qDebug("KLibrary: The library %s does not offer an %s function", name().latin1(), symname.data()); |
165 | #ifndef NDEBUG | 162 | #ifndef NDEBUG |
166 | //US qDebug("KLibrary: errorcode: %s", lt_dlerror()); | 163 | //US qDebug("KLibrary: errorcode: %s", lt_dlerror()); |
167 | #endif | 164 | #endif |
168 | kdWarning(150) << "KLibrary: The library " << name().latin1() << " does not offer an init_" << name().latin1() << " function" << endl; | 165 | kdWarning(150) << "KLibrary: The library " << name().latin1() << " does not offer an init_" << name().latin1() << " function" << endl; |
169 | return 0; | 166 | return 0; |
170 | } | 167 | } |
171 | 168 | ||
172 | typedef KLibFactory* (*t_func)(); | 169 | typedef KLibFactory* (*t_func)(); |
173 | t_func func = (t_func)sym; | 170 | t_func func = (t_func)sym; |
174 | m_factory = func(); | 171 | m_factory = func(); |
175 | 172 | ||
176 | if( !m_factory ) | 173 | if( !m_factory ) |
177 | { | 174 | { |
178 | kdWarning(150) << "KLibrary: The library " << name() << " does not offer a KDE compatible factory" << endl; | 175 | kdWarning(150) << "KLibrary: The library " << name() << " does not offer a KDE compatible factory" << endl; |
179 | return 0; | 176 | return 0; |
180 | } | 177 | } |
181 | 178 | ||
182 | connect( m_factory, SIGNAL( objectCreated( QObject * ) ), | 179 | connect( m_factory, SIGNAL( objectCreated( QObject * ) ), |
183 | this, SLOT( slotObjectCreated( QObject * ) ) ); | 180 | this, SLOT( slotObjectCreated( QObject * ) ) ); |
184 | 181 | ||
185 | return m_factory; | 182 | return m_factory; |
186 | } | 183 | } |
187 | 184 | ||
188 | void* KLibrary::symbol( const char* symname ) const | 185 | void* KLibrary::symbol( const char* symname ) const |
189 | { | 186 | { |
190 | //US void* sym = lt_dlsym( (lt_dlhandle) m_handle, symname ); | 187 | //US void* sym = lt_dlsym( (lt_dlhandle) m_handle, symname ); |
191 | void* sym = m_handle->resolve( symname ); | 188 | void* sym = m_handle->resolve( symname ); |
192 | if ( !sym ) | 189 | if ( !sym ) |
193 | { | 190 | { |
194 | //US kdWarning(150) << "KLibrary: " << lt_dlerror() << endl; | 191 | //US kdWarning(150) << "KLibrary: " << lt_dlerror() << endl; |
195 | kdWarning(150) << "KLibrary: " << m_libname << ", symbol:" << symname << " not found " << endl; | ||
196 | return 0; | 192 | return 0; |
197 | } | 193 | } |
198 | 194 | ||
199 | return sym; | 195 | return sym; |
200 | } | 196 | } |
201 | 197 | ||
202 | bool KLibrary::hasSymbol( const char* symname ) const | 198 | bool KLibrary::hasSymbol( const char* symname ) const |
203 | { | 199 | { |
204 | //US void* sym = lt_dlsym( (lt_dlhandle) m_handle, symname ); | 200 | //US void* sym = lt_dlsym( (lt_dlhandle) m_handle, symname ); |
205 | void* sym = m_handle->resolve( symname ); | 201 | void* sym = m_handle->resolve( symname ); |
206 | return (sym != 0L ); | 202 | return (sym != 0L ); |
207 | } | 203 | } |
208 | 204 | ||
209 | void KLibrary::unload() const | 205 | void KLibrary::unload() const |
210 | { | 206 | { |
211 | if (KLibLoader::s_self) | 207 | if (KLibLoader::s_self) |
212 | KLibLoader::s_self->unloadLibrary(QFile::encodeName(name())); | 208 | KLibLoader::s_self->unloadLibrary(QFile::encodeName(name())); |
213 | } | 209 | } |
214 | 210 | ||
215 | void KLibrary::slotObjectCreated( QObject *obj ) | 211 | void KLibrary::slotObjectCreated( QObject *obj ) |
216 | { | 212 | { |
217 | if ( !obj ) | 213 | if ( !obj ) |
218 | return; | 214 | return; |
219 | 215 | ||
220 | if ( m_timer && m_timer->isActive() ) | 216 | if ( m_timer && m_timer->isActive() ) |
221 | m_timer->stop(); | 217 | m_timer->stop(); |
222 | 218 | ||
223 | if ( m_objs.containsRef( obj ) ) | 219 | if ( m_objs.containsRef( obj ) ) |
224 | return; // we know this object already | 220 | return; // we know this object already |
225 | 221 | ||
226 | connect( obj, SIGNAL( destroyed() ), | 222 | connect( obj, SIGNAL( destroyed() ), |
227 | this, SLOT( slotObjectDestroyed() ) ); | 223 | this, SLOT( slotObjectDestroyed() ) ); |
228 | 224 | ||
229 | m_objs.append( obj ); | 225 | m_objs.append( obj ); |
230 | } | 226 | } |
231 | 227 | ||
232 | void KLibrary::slotObjectDestroyed() | 228 | void KLibrary::slotObjectDestroyed() |
233 | { | 229 | { |
234 | m_objs.removeRef( sender() ); | 230 | m_objs.removeRef( sender() ); |
235 | 231 | ||
236 | if ( m_objs.count() == 0 ) | 232 | if ( m_objs.count() == 0 ) |
237 | { | 233 | { |
238 | // kdDebug(150) << "KLibrary: shutdown timer for " << name() << " started!" | 234 | // kdDebug(150) << "KLibrary: shutdown timer for " << name() << " started!" |
239 | // << endl; | 235 | // << endl; |
240 | 236 | ||
241 | if ( !m_timer ) | 237 | if ( !m_timer ) |
242 | { | 238 | { |
243 | m_timer = new QTimer( this, "klibrary_shutdown_timer" ); | 239 | m_timer = new QTimer( this, "klibrary_shutdown_timer" ); |
@@ -432,98 +428,101 @@ KLibrary* KLibLoader::globalLibrary( const char *name ) | |||
432 | KLibrary *tmp; | 428 | KLibrary *tmp; |
433 | /*US | 429 | /*US |
434 | int olt_dlopen_flag = lt_dlopen_flag; | 430 | int olt_dlopen_flag = lt_dlopen_flag; |
435 | 431 | ||
436 | lt_dlopen_flag |= LT_GLOBAL; | 432 | lt_dlopen_flag |= LT_GLOBAL; |
437 | kdDebug(150) << "Loading the next library global with flag " | 433 | kdDebug(150) << "Loading the next library global with flag " |
438 | << lt_dlopen_flag | 434 | << lt_dlopen_flag |
439 | << "." << endl; | 435 | << "." << endl; |
440 | */ | 436 | */ |
441 | tmp = library(name); | 437 | tmp = library(name); |
442 | /*US | 438 | /*US |
443 | lt_dlopen_flag = olt_dlopen_flag; | 439 | lt_dlopen_flag = olt_dlopen_flag; |
444 | */ | 440 | */ |
445 | return tmp; | 441 | return tmp; |
446 | } | 442 | } |
447 | 443 | ||
448 | 444 | ||
449 | KLibrary* KLibLoader::library( const char *name ) | 445 | KLibrary* KLibLoader::library( const char *name ) |
450 | { | 446 | { |
451 | if (!name) | 447 | if (!name) |
452 | return 0; | 448 | return 0; |
453 | 449 | ||
454 | KLibWrapPrivate* wrap = m_libs[name]; | 450 | KLibWrapPrivate* wrap = m_libs[name]; |
455 | if (wrap) { | 451 | if (wrap) { |
456 | /* Nothing to do to load the library. */ | 452 | /* Nothing to do to load the library. */ |
457 | wrap->ref_count++; | 453 | wrap->ref_count++; |
458 | return wrap->lib; | 454 | return wrap->lib; |
459 | } | 455 | } |
460 | 456 | ||
461 | /* Test if this library was loaded at some time, but got | 457 | /* Test if this library was loaded at some time, but got |
462 | unloaded meanwhile, whithout being dlclose()'ed. */ | 458 | unloaded meanwhile, whithout being dlclose()'ed. */ |
463 | QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack); | 459 | QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack); |
464 | for (; it.current(); ++it) { | 460 | for (; it.current(); ++it) { |
465 | if (it.current()->name == name) | 461 | if (it.current()->name == name) |
466 | wrap = it.current(); | 462 | wrap = it.current(); |
467 | } | 463 | } |
468 | 464 | ||
469 | if (wrap) { | 465 | if (wrap) { |
470 | d->pending_close.removeRef(wrap); | 466 | d->pending_close.removeRef(wrap); |
471 | if (!wrap->lib) { | 467 | if (!wrap->lib) { |
472 | /* This lib only was in loaded_stack, but not in m_libs. */ | 468 | /* This lib only was in loaded_stack, but not in m_libs. */ |
473 | wrap->lib = new KLibrary( name, wrap->filename, wrap->handle ); | 469 | wrap->lib = new KLibrary( name, wrap->filename, wrap->handle ); |
474 | } | 470 | } |
475 | wrap->ref_count++; | 471 | wrap->ref_count++; |
476 | } else { | 472 | } else { |
477 | QString libfile = findLibrary( name ); | 473 | QString libfile = findLibrary( name ); |
478 | if ( libfile.isEmpty() ) | 474 | if ( libfile.isEmpty() ) |
479 | return 0; | 475 | return 0; |
480 | 476 | #ifdef DESKTOP_VERSION | |
477 | QLibrary *qlib = new QLibrary( libfile.latin1() ); | ||
478 | #else | ||
481 | QLibrary *qlib = new QLibrary( libfile.latin1(), QLibrary::Immediately ); | 479 | QLibrary *qlib = new QLibrary( libfile.latin1(), QLibrary::Immediately ); |
480 | #endif | ||
482 | 481 | ||
483 | //US lt_dlhandle handle = lt_dlopen( libfile.latin1() ); | 482 | //US lt_dlhandle handle = lt_dlopen( libfile.latin1() ); |
484 | //US if ( !handle ) | 483 | //US if ( !handle ) |
485 | if ( !qlib ) | 484 | if ( !qlib ) |
486 | { | 485 | { |
487 | //US const char* errmsg = lt_dlerror(); | 486 | //US const char* errmsg = lt_dlerror(); |
488 | char* errmsg; | 487 | char* errmsg; |
489 | sprintf(errmsg, "KLibLoader::library could not load library: %s", libfile.latin1()); | 488 | sprintf(errmsg, "KLibLoader::library could not load library: %s", libfile.latin1()); |
490 | qDebug(errmsg); | 489 | qDebug(errmsg); |
491 | 490 | ||
492 | if(errmsg) | 491 | if(errmsg) |
493 | d->errorMessage = QString::fromLatin1(errmsg); | 492 | d->errorMessage = QString::fromLatin1(errmsg); |
494 | else | 493 | else |
495 | d->errorMessage = QString::null; | 494 | d->errorMessage = QString::null; |
496 | kdWarning(150) << "library=" << name << ": file=" << libfile << ": " << d->errorMessage << endl; | 495 | kdWarning(150) << "library=" << name << ": file=" << libfile << ": " << d->errorMessage << endl; |
497 | return 0; | 496 | return 0; |
498 | } | 497 | } |
499 | else | 498 | else |
500 | d->errorMessage = QString::null; | 499 | d->errorMessage = QString::null; |
501 | 500 | ||
502 | KLibrary *lib = new KLibrary( name, libfile, qlib ); | 501 | KLibrary *lib = new KLibrary( name, libfile, qlib ); |
503 | wrap = new KLibWrapPrivate(lib, qlib); | 502 | wrap = new KLibWrapPrivate(lib, qlib); |
504 | d->loaded_stack.prepend(wrap); | 503 | d->loaded_stack.prepend(wrap); |
505 | } | 504 | } |
506 | m_libs.insert( name, wrap ); | 505 | m_libs.insert( name, wrap ); |
507 | 506 | ||
508 | connect( wrap->lib, SIGNAL( destroyed() ), | 507 | connect( wrap->lib, SIGNAL( destroyed() ), |
509 | this, SLOT( slotLibraryDestroyed() ) ); | 508 | this, SLOT( slotLibraryDestroyed() ) ); |
510 | 509 | ||
511 | return wrap->lib; | 510 | return wrap->lib; |
512 | } | 511 | } |
513 | 512 | ||
514 | QString KLibLoader::lastErrorMessage() const | 513 | QString KLibLoader::lastErrorMessage() const |
515 | { | 514 | { |
516 | return d->errorMessage; | 515 | return d->errorMessage; |
517 | } | 516 | } |
518 | 517 | ||
519 | void KLibLoader::unloadLibrary( const char *libname ) | 518 | void KLibLoader::unloadLibrary( const char *libname ) |
520 | { | 519 | { |
521 | KLibWrapPrivate *wrap = m_libs[ libname ]; | 520 | KLibWrapPrivate *wrap = m_libs[ libname ]; |
522 | if (!wrap) | 521 | if (!wrap) |
523 | return; | 522 | return; |
524 | if (--wrap->ref_count) | 523 | if (--wrap->ref_count) |
525 | return; | 524 | return; |
526 | 525 | ||
527 | // kdDebug(150) << "closing library " << libname << endl; | 526 | // kdDebug(150) << "closing library " << libname << endl; |
528 | 527 | ||
529 | m_libs.remove( libname ); | 528 | m_libs.remove( libname ); |
@@ -554,94 +553,96 @@ void KLibLoader::slotLibraryDestroyed() | |||
554 | wrap->lib = 0; /* the KLibrary object is already away */ | 553 | wrap->lib = 0; /* the KLibrary object is already away */ |
555 | m_libs.remove( it.currentKey() ); | 554 | m_libs.remove( it.currentKey() ); |
556 | close_pending( wrap ); | 555 | close_pending( wrap ); |
557 | return; | 556 | return; |
558 | } | 557 | } |
559 | } | 558 | } |
560 | 559 | ||
561 | void KLibLoader::close_pending(KLibWrapPrivate *wrap) | 560 | void KLibLoader::close_pending(KLibWrapPrivate *wrap) |
562 | { | 561 | { |
563 | if (wrap && !d->pending_close.containsRef( wrap )) | 562 | if (wrap && !d->pending_close.containsRef( wrap )) |
564 | d->pending_close.append( wrap ); | 563 | d->pending_close.append( wrap ); |
565 | 564 | ||
566 | /* First delete all KLibrary objects in pending_close, but _don't_ unload | 565 | /* First delete all KLibrary objects in pending_close, but _don't_ unload |
567 | the DSO behind it. */ | 566 | the DSO behind it. */ |
568 | QPtrListIterator<KLibWrapPrivate> it(d->pending_close); | 567 | QPtrListIterator<KLibWrapPrivate> it(d->pending_close); |
569 | for (; it.current(); ++it) { | 568 | for (; it.current(); ++it) { |
570 | wrap = it.current(); | 569 | wrap = it.current(); |
571 | if (wrap->lib) { | 570 | if (wrap->lib) { |
572 | disconnect( wrap->lib, SIGNAL( destroyed() ), | 571 | disconnect( wrap->lib, SIGNAL( destroyed() ), |
573 | this, SLOT( slotLibraryDestroyed() ) ); | 572 | this, SLOT( slotLibraryDestroyed() ) ); |
574 | delete wrap->lib; | 573 | delete wrap->lib; |
575 | wrap->lib = 0; | 574 | wrap->lib = 0; |
576 | } | 575 | } |
577 | } | 576 | } |
578 | 577 | ||
579 | if (d->unload_mode == KLibLoaderPrivate::DONT_UNLOAD) return; | 578 | if (d->unload_mode == KLibLoaderPrivate::DONT_UNLOAD) return; |
580 | 579 | ||
581 | bool deleted_one = false; | 580 | bool deleted_one = false; |
582 | while ((wrap = d->loaded_stack.first())) { | 581 | while ((wrap = d->loaded_stack.first())) { |
583 | /* Let's first see, if we want to try to unload this lib. | 582 | /* Let's first see, if we want to try to unload this lib. |
584 | If the env. var KDE_DOUNLOAD is set, we try to unload every lib. | 583 | If the env. var KDE_DOUNLOAD is set, we try to unload every lib. |
585 | If not, we look at the lib itself, and unload it only, if it exports | 584 | If not, we look at the lib itself, and unload it only, if it exports |
586 | the symbol __kde_do_unload. */ | 585 | the symbol __kde_do_unload. */ |
587 | if (d->unload_mode != KLibLoaderPrivate::UNLOAD | 586 | if (d->unload_mode != KLibLoaderPrivate::UNLOAD |
588 | && wrap->unload_mode != KLibWrapPrivate::UNLOAD) | 587 | && wrap->unload_mode != KLibWrapPrivate::UNLOAD) |
589 | break; | 588 | break; |
590 | 589 | ||
591 | /* Now ensure, that the libs are only unloaded in the reverse direction | 590 | /* Now ensure, that the libs are only unloaded in the reverse direction |
592 | they were loaded. */ | 591 | they were loaded. */ |
593 | if (!d->pending_close.containsRef( wrap )) { | 592 | if (!d->pending_close.containsRef( wrap )) { |
594 | if (!deleted_one) | 593 | if (!deleted_one) |
595 | /* Only diagnose, if we really haven't deleted anything. */ | 594 | /* Only diagnose, if we really haven't deleted anything. */ |
596 | // kdDebug(150) << "try to dlclose " << wrap->name << ": not yet" << endl; | 595 | // kdDebug(150) << "try to dlclose " << wrap->name << ": not yet" << endl; |
597 | break; | 596 | break; |
598 | } | 597 | } |
599 | 598 | ||
600 | // kdDebug(150) << "try to dlclose " << wrap->name << ": yes, done." << endl; | 599 | // kdDebug(150) << "try to dlclose " << wrap->name << ": yes, done." << endl; |
601 | 600 | ||
601 | #if 0 | ||
602 | #ifndef Q_WS_QWS | 602 | #ifndef Q_WS_QWS |
603 | if ( !deleted_one ) { | 603 | if ( !deleted_one ) { |
604 | /* Only do the hack once in this loop. | 604 | /* Only do the hack once in this loop. |
605 | WABA: *HACK* | 605 | WABA: *HACK* |
606 | We need to make sure to clear the clipboard before unloading a DSO | 606 | We need to make sure to clear the clipboard before unloading a DSO |
607 | because the DSO could have defined an object derived from QMimeSource | 607 | because the DSO could have defined an object derived from QMimeSource |
608 | and placed that on the clipboard. */ | 608 | and placed that on the clipboard. */ |
609 | /*kapp->clipboard()->clear();*/ | 609 | /*kapp->clipboard()->clear();*/ |
610 | 610 | ||
611 | /* Well.. let's do something more subtle... convert the clipboard context | 611 | /* Well.. let's do something more subtle... convert the clipboard context |
612 | to text. That should be safe as it only uses objects defined by Qt. */ | 612 | to text. That should be safe as it only uses objects defined by Qt. */ |
613 | 613 | ||
614 | QWidgetList *widgetlist = QApplication::topLevelWidgets(); | 614 | QWidgetList *widgetlist = QApplication::topLevelWidgets(); |
615 | QWidget *co = widgetlist->first(); | 615 | QWidget *co = widgetlist->first(); |
616 | while (co) { | 616 | while (co) { |
617 | if (qstrcmp(co->name(), "internal clipboard owner") == 0) { | 617 | if (qstrcmp(co->name(), "internal clipboard owner") == 0) { |
618 | if (XGetSelectionOwner(co->x11Display(), XA_PRIMARY) == co->winId()) | 618 | if (XGetSelectionOwner(co->x11Display(), XA_PRIMARY) == co->winId()) |
619 | kapp->clipboard()->setText(kapp->clipboard()->text()); | 619 | kapp->clipboard()->setText(kapp->clipboard()->text()); |
620 | 620 | ||
621 | break; | 621 | break; |
622 | } | 622 | } |
623 | co = widgetlist->next(); | 623 | co = widgetlist->next(); |
624 | } | 624 | } |
625 | delete widgetlist; | 625 | delete widgetlist; |
626 | } | 626 | } |
627 | #else | 627 | #else |
628 | // FIXME(E): Implement in Qt Embedded | 628 | // FIXME(E): Implement in Qt Embedded |
629 | #endif | 629 | #endif |
630 | 630 | ||
631 | #endif // 0 | ||
631 | deleted_one = true; | 632 | deleted_one = true; |
632 | //US lt_dlclose(wrap->handle); | 633 | //US lt_dlclose(wrap->handle); |
633 | wrap->handle->unload(); | 634 | wrap->handle->unload(); |
634 | 635 | ||
635 | d->pending_close.removeRef(wrap); | 636 | d->pending_close.removeRef(wrap); |
636 | /* loaded_stack is AutoDelete, so wrap is freed */ | 637 | /* loaded_stack is AutoDelete, so wrap is freed */ |
637 | d->loaded_stack.remove(); | 638 | d->loaded_stack.remove(); |
638 | } | 639 | } |
639 | } | 640 | } |
640 | 641 | ||
641 | void KLibLoader::virtual_hook( int, void* ) | 642 | void KLibLoader::virtual_hook( int, void* ) |
642 | { /*BASE::virtual_hook( id, data );*/ } | 643 | { /*BASE::virtual_hook( id, data );*/ } |
643 | 644 | ||
644 | void KLibFactory::virtual_hook( int, void* ) | 645 | void KLibFactory::virtual_hook( int, void* ) |
645 | { /*BASE::virtual_hook( id, data );*/ } | 646 | { /*BASE::virtual_hook( id, data );*/ } |
646 | 647 | ||
647 | //US #include "klibloader.moc" | 648 | //US #include "klibloader.moc" |
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp index 1a1e027..7f51d78 100644 --- a/microkde/kdecore/kstandarddirs.cpp +++ b/microkde/kdecore/kstandarddirs.cpp | |||
@@ -1,94 +1,93 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 1999 Sirtaj Singh Kang <taj@kde.org> | 2 | Copyright (C) 1999 Sirtaj Singh Kang <taj@kde.org> |
3 | Copyright (C) 1999 Stephan Kulow <coolo@kde.org> | 3 | Copyright (C) 1999 Stephan Kulow <coolo@kde.org> |
4 | Copyright (C) 1999 Waldo Bastian <bastian@kde.org> | 4 | Copyright (C) 1999 Waldo Bastian <bastian@kde.org> |
5 | 5 | ||
6 | This library is free software; you can redistribute it and/or | 6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public | 7 | modify it under the terms of the GNU Library General Public |
8 | License version 2 as published by the Free Software Foundation. | 8 | License version 2 as published by the Free Software Foundation. |
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 | /* |
22 | * Author: Stephan Kulow <coolo@kde.org> and Sirtaj Singh Kang <taj@kde.org> | 22 | * Author: Stephan Kulow <coolo@kde.org> and Sirtaj Singh Kang <taj@kde.org> |
23 | * Version:$Id$ | 23 | * Version:$Id$ |
24 | * Generated:Thu Mar 5 16:05:28 EST 1998 | 24 | * Generated:Thu Mar 5 16:05:28 EST 1998 |
25 | */ | 25 | */ |
26 | 26 | ||
27 | //US #include "config.h" | 27 | //US #include "config.h" |
28 | 28 | ||
29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
30 | #include <assert.h> | 30 | #include <assert.h> |
31 | //US#include <errno.h> | 31 | //US#include <errno.h> |
32 | //US #ifdef HAVE_SYS_STAT_H | 32 | //US #ifdef HAVE_SYS_STAT_H |
33 | //US #include <sys/stat.h> | 33 | //US #include <sys/stat.h> |
34 | //US #endif | 34 | //US #endif |
35 | //US#include <sys/types.h> | 35 | //US#include <sys/types.h> |
36 | //US#include <dirent.h> | 36 | //US#include <dirent.h> |
37 | //US#include <pwd.h> | 37 | //US#include <pwd.h> |
38 | 38 | ||
39 | #include <qregexp.h> | 39 | #include <qregexp.h> |
40 | #include <qasciidict.h> | 40 | #include <qasciidict.h> |
41 | #include <qdict.h> | 41 | #include <qdict.h> |
42 | #include <qdir.h> | 42 | #include <qdir.h> |
43 | #include <qfileinfo.h> | 43 | #include <qfileinfo.h> |
44 | #include <qstring.h> | 44 | #include <qstring.h> |
45 | #include <qstringlist.h> | 45 | #include <qstringlist.h> |
46 | #include <qpe/qpeapplication.h> | ||
47 | 46 | ||
48 | #include "kstandarddirs.h" | 47 | #include "kstandarddirs.h" |
49 | #include "kconfig.h" | 48 | #include "kconfig.h" |
50 | #include "kdebug.h" | 49 | #include "kdebug.h" |
51 | //US #include "kinstance.h" | 50 | //US #include "kinstance.h" |
52 | #include "kshell.h" | 51 | #include "kshell.h" |
53 | //US#include <sys/param.h> | 52 | //US#include <sys/param.h> |
54 | //US#include <unistd.h> | 53 | //US#include <unistd.h> |
55 | 54 | ||
56 | //US | 55 | //US |
57 | QString KStandardDirs::mAppDir = QString::null; | 56 | QString KStandardDirs::mAppDir = QString::null; |
58 | 57 | ||
59 | 58 | ||
60 | template class QDict<QStringList>; | 59 | template class QDict<QStringList>; |
61 | 60 | ||
62 | #if 0 | 61 | #if 0 |
63 | #include <qtextedit.h> | 62 | #include <qtextedit.h> |
64 | void ddd( QString op ) | 63 | void ddd( QString op ) |
65 | { | 64 | { |
66 | static QTextEdit * dot = 0; | 65 | static QTextEdit * dot = 0; |
67 | if ( ! dot ) | 66 | if ( ! dot ) |
68 | dot = new QTextEdit(); | 67 | dot = new QTextEdit(); |
69 | 68 | ||
70 | dot->show(); | 69 | dot->show(); |
71 | 70 | ||
72 | dot->append( op ); | 71 | dot->append( op ); |
73 | 72 | ||
74 | } | 73 | } |
75 | #endif | 74 | #endif |
76 | class KStandardDirs::KStandardDirsPrivate | 75 | class KStandardDirs::KStandardDirsPrivate |
77 | { | 76 | { |
78 | public: | 77 | public: |
79 | KStandardDirsPrivate() | 78 | KStandardDirsPrivate() |
80 | : restrictionsActive(false), | 79 | : restrictionsActive(false), |
81 | dataRestrictionActive(false) | 80 | dataRestrictionActive(false) |
82 | { } | 81 | { } |
83 | 82 | ||
84 | bool restrictionsActive; | 83 | bool restrictionsActive; |
85 | bool dataRestrictionActive; | 84 | bool dataRestrictionActive; |
86 | QAsciiDict<bool> restrictions; | 85 | QAsciiDict<bool> restrictions; |
87 | QStringList xdgdata_prefixes; | 86 | QStringList xdgdata_prefixes; |
88 | QStringList xdgconf_prefixes; | 87 | QStringList xdgconf_prefixes; |
89 | }; | 88 | }; |
90 | 89 | ||
91 | static const char* const types[] = {"html", "icon", "apps", "sound", | 90 | static const char* const types[] = {"html", "icon", "apps", "sound", |
92 | "data", "locale", "services", "mime", | 91 | "data", "locale", "services", "mime", |
93 | "servicetypes", "config", "exe", | 92 | "servicetypes", "config", "exe", |
94 | "wallpaper", "lib", "pixmap", "templates", | 93 | "wallpaper", "lib", "pixmap", "templates", |
@@ -1180,97 +1179,97 @@ bool KStandardDirs::makeDir(const QString& dir2, int mode) | |||
1180 | if (dirObj.mkdir(base) != true) | 1179 | if (dirObj.mkdir(base) != true) |
1181 | { | 1180 | { |
1182 | qDebug("KStandardDirs::makeDir could not create: %s" , base.latin1()); | 1181 | qDebug("KStandardDirs::makeDir could not create: %s" , base.latin1()); |
1183 | return false; | 1182 | return false; |
1184 | } | 1183 | } |
1185 | } | 1184 | } |
1186 | 1185 | ||
1187 | i = pos + 1; | 1186 | i = pos + 1; |
1188 | } | 1187 | } |
1189 | return true; | 1188 | return true; |
1190 | 1189 | ||
1191 | } | 1190 | } |
1192 | 1191 | ||
1193 | static QString readEnvPath(const char *env) | 1192 | static QString readEnvPath(const char *env) |
1194 | { | 1193 | { |
1195 | #ifdef _WIN32_ | 1194 | #ifdef _WIN32_ |
1196 | return ""; | 1195 | return ""; |
1197 | #else | 1196 | #else |
1198 | QCString c_path = getenv(env); | 1197 | QCString c_path = getenv(env); |
1199 | if (c_path.isEmpty()) | 1198 | if (c_path.isEmpty()) |
1200 | return QString::null; | 1199 | return QString::null; |
1201 | return QFile::decodeName(c_path); | 1200 | return QFile::decodeName(c_path); |
1202 | #endif | 1201 | #endif |
1203 | } | 1202 | } |
1204 | 1203 | ||
1205 | void KStandardDirs::addKDEDefaults() | 1204 | void KStandardDirs::addKDEDefaults() |
1206 | { | 1205 | { |
1207 | //qDebug("ERROR: KStandardDirs::addKDEDefaults() called "); | 1206 | //qDebug("ERROR: KStandardDirs::addKDEDefaults() called "); |
1208 | //return; | 1207 | //return; |
1209 | QStringList kdedirList; | 1208 | QStringList kdedirList; |
1210 | 1209 | ||
1211 | // begin KDEDIRS | 1210 | // begin KDEDIRS |
1212 | QString kdedirs = readEnvPath("MICROKDEDIRS"); | 1211 | QString kdedirs = readEnvPath("MICROKDEDIRS"); |
1213 | if (!kdedirs.isEmpty()) | 1212 | if (!kdedirs.isEmpty()) |
1214 | { | 1213 | { |
1215 | tokenize(kdedirList, kdedirs, ":"); | 1214 | tokenize(kdedirList, kdedirs, ":"); |
1216 | } | 1215 | } |
1217 | else | 1216 | else |
1218 | { | 1217 | { |
1219 | QString kdedir = readEnvPath("MICROKDEDIR"); | 1218 | QString kdedir = readEnvPath("MICROKDEDIR"); |
1220 | if (!kdedir.isEmpty()) | 1219 | if (!kdedir.isEmpty()) |
1221 | { | 1220 | { |
1222 | kdedir = KShell::tildeExpand(kdedir); | 1221 | kdedir = KShell::tildeExpand(kdedir); |
1223 | kdedirList.append(kdedir); | 1222 | kdedirList.append(kdedir); |
1224 | } | 1223 | } |
1225 | } | 1224 | } |
1226 | //US kdedirList.append(KDEDIR); | 1225 | //US kdedirList.append(KDEDIR); |
1227 | //US for embedded, add qtopia dir as kdedir | 1226 | //US for embedded, add qtopia dir as kdedir |
1228 | kdedirList.append(QPEApplication::qpeDir()); | 1227 | kdedirList.append(readEnvPath("QPEDIR" )); |
1229 | 1228 | ||
1230 | #ifdef __KDE_EXECPREFIX | 1229 | #ifdef __KDE_EXECPREFIX |
1231 | QString execPrefix(__KDE_EXECPREFIX); | 1230 | QString execPrefix(__KDE_EXECPREFIX); |
1232 | if (execPrefix!="NONE") | 1231 | if (execPrefix!="NONE") |
1233 | kdedirList.append(execPrefix); | 1232 | kdedirList.append(execPrefix); |
1234 | #endif | 1233 | #endif |
1235 | 1234 | ||
1236 | QString localKdeDir; | 1235 | QString localKdeDir; |
1237 | 1236 | ||
1238 | //US if (getuid()) | 1237 | //US if (getuid()) |
1239 | if (true) | 1238 | if (true) |
1240 | { | 1239 | { |
1241 | localKdeDir = readEnvPath("MICROKDEHOME"); | 1240 | localKdeDir = readEnvPath("MICROKDEHOME"); |
1242 | if (!localKdeDir.isEmpty()) | 1241 | if (!localKdeDir.isEmpty()) |
1243 | { | 1242 | { |
1244 | if (localKdeDir.at(localKdeDir.length()-1) != '/') | 1243 | if (localKdeDir.at(localKdeDir.length()-1) != '/') |
1245 | localKdeDir += '/'; | 1244 | localKdeDir += '/'; |
1246 | } | 1245 | } |
1247 | else | 1246 | else |
1248 | { | 1247 | { |
1249 | localKdeDir = QDir::homeDirPath() + "/kdepim/"; | 1248 | localKdeDir = QDir::homeDirPath() + "/kdepim/"; |
1250 | } | 1249 | } |
1251 | } | 1250 | } |
1252 | else | 1251 | else |
1253 | { | 1252 | { |
1254 | // We treat root different to prevent root messing up the | 1253 | // We treat root different to prevent root messing up the |
1255 | // file permissions in the users home directory. | 1254 | // file permissions in the users home directory. |
1256 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); | 1255 | localKdeDir = readEnvPath("MICROKDEROOTHOME"); |
1257 | if (!localKdeDir.isEmpty()) | 1256 | if (!localKdeDir.isEmpty()) |
1258 | { | 1257 | { |
1259 | if (localKdeDir.at(localKdeDir.length()-1) != '/') | 1258 | if (localKdeDir.at(localKdeDir.length()-1) != '/') |
1260 | localKdeDir += '/'; | 1259 | localKdeDir += '/'; |
1261 | } | 1260 | } |
1262 | else | 1261 | else |
1263 | { | 1262 | { |
1264 | //US struct passwd *pw = getpwuid(0); | 1263 | //US struct passwd *pw = getpwuid(0); |
1265 | //US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; | 1264 | //US localKdeDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.microkde/"; |
1266 | qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); | 1265 | qDebug("KStandardDirs::addKDEDefaults: 1 has to be fixed"); |
1267 | } | 1266 | } |
1268 | 1267 | ||
1269 | } | 1268 | } |
1270 | 1269 | ||
1271 | //US localKdeDir = appDir(); | 1270 | //US localKdeDir = appDir(); |
1272 | 1271 | ||
1273 | //US | 1272 | //US |
1274 | // qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); | 1273 | // qDebug("KStandardDirs::addKDEDefaults: localKdeDir=%s", localKdeDir.latin1()); |
1275 | if (localKdeDir != "-/") | 1274 | if (localKdeDir != "-/") |
1276 | { | 1275 | { |
diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp index 92cb8d2..79b0f9d 100644 --- a/microkde/kdeui/ktoolbar.cpp +++ b/microkde/kdeui/ktoolbar.cpp | |||
@@ -979,97 +979,97 @@ KToolBar::IconText KToolBar::iconText() const | |||
979 | return d->m_iconText; | 979 | return d->m_iconText; |
980 | } | 980 | } |
981 | 981 | ||
982 | 982 | ||
983 | void KToolBar::setIconSize(int size) | 983 | void KToolBar::setIconSize(int size) |
984 | { | 984 | { |
985 | setIconSize( size, true ); | 985 | setIconSize( size, true ); |
986 | } | 986 | } |
987 | 987 | ||
988 | void KToolBar::setIconSize(int size, bool update) | 988 | void KToolBar::setIconSize(int size, bool update) |
989 | { | 989 | { |
990 | bool doUpdate=false; | 990 | bool doUpdate=false; |
991 | 991 | ||
992 | if ( size != d->m_iconSize ) { | 992 | if ( size != d->m_iconSize ) { |
993 | d->m_iconSize = size; | 993 | d->m_iconSize = size; |
994 | doUpdate=true; | 994 | doUpdate=true; |
995 | } | 995 | } |
996 | 996 | ||
997 | if (update == false) | 997 | if (update == false) |
998 | return; | 998 | return; |
999 | 999 | ||
1000 | if (doUpdate) | 1000 | if (doUpdate) |
1001 | emit modechange(); // tell buttons what happened | 1001 | emit modechange(); // tell buttons what happened |
1002 | 1002 | ||
1003 | // ugly hack to force a QMainWindow::triggerLayout( TRUE ) | 1003 | // ugly hack to force a QMainWindow::triggerLayout( TRUE ) |
1004 | if ( mainWindow() ) { | 1004 | if ( mainWindow() ) { |
1005 | QMainWindow *mw = mainWindow(); | 1005 | QMainWindow *mw = mainWindow(); |
1006 | mw->setUpdatesEnabled( FALSE ); | 1006 | mw->setUpdatesEnabled( FALSE ); |
1007 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); | 1007 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); |
1008 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); | 1008 | mw->setToolBarsMovable( !mw->toolBarsMovable() ); |
1009 | mw->setUpdatesEnabled( TRUE ); | 1009 | mw->setUpdatesEnabled( TRUE ); |
1010 | } | 1010 | } |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | 1013 | ||
1014 | int KToolBar::iconSize() const | 1014 | int KToolBar::iconSize() const |
1015 | { | 1015 | { |
1016 | /*US | 1016 | /*US |
1017 | if ( !d->m_iconSize ) // default value? | 1017 | if ( !d->m_iconSize ) // default value? |
1018 | { | 1018 | { |
1019 | if (!::qstrcmp(QObject::name(), "mainToolBar")) | 1019 | if (!::qstrcmp(QObject::name(), "mainToolBar")) |
1020 | return KGlobal::iconLoader()->currentSize(KIcon::MainToolbar); | 1020 | return KGlobal::iconLoader()->currentSize(KIcon::MainToolbar); |
1021 | else | 1021 | else |
1022 | return KGlobal::iconLoader()->currentSize(KIcon::Toolbar); | 1022 | return KGlobal::iconLoader()->currentSize(KIcon::Toolbar); |
1023 | } | 1023 | } |
1024 | return d->m_iconSize; | 1024 | return d->m_iconSize; |
1025 | */ | 1025 | */ |
1026 | int ret = 18; | 1026 | int ret = 18; |
1027 | if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->width() < 650 ) | 1027 | if ( QApplication::desktop()->width() > 320 ) |
1028 | ret = 30; | 1028 | ret = 30; |
1029 | return ret; | 1029 | return ret; |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | 1032 | ||
1033 | void KToolBar::setEnableContextMenu(bool enable ) | 1033 | void KToolBar::setEnableContextMenu(bool enable ) |
1034 | { | 1034 | { |
1035 | d->m_enableContext = enable; | 1035 | d->m_enableContext = enable; |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | 1038 | ||
1039 | bool KToolBar::contextMenuEnabled() const | 1039 | bool KToolBar::contextMenuEnabled() const |
1040 | { | 1040 | { |
1041 | return d->m_enableContext; | 1041 | return d->m_enableContext; |
1042 | } | 1042 | } |
1043 | 1043 | ||
1044 | 1044 | ||
1045 | void KToolBar::setItemNoStyle(int id, bool no_style ) | 1045 | void KToolBar::setItemNoStyle(int id, bool no_style ) |
1046 | { | 1046 | { |
1047 | Id2WidgetMap::Iterator it = id2widget.find( id ); | 1047 | Id2WidgetMap::Iterator it = id2widget.find( id ); |
1048 | if ( it == id2widget.end() ) | 1048 | if ( it == id2widget.end() ) |
1049 | return; | 1049 | return; |
1050 | //US KToolBarButton * button = dynamic_cast<KToolBarButton *>( *it ); | 1050 | //US KToolBarButton * button = dynamic_cast<KToolBarButton *>( *it ); |
1051 | KToolBarButton * button = (KToolBarButton *)( *it ); | 1051 | KToolBarButton * button = (KToolBarButton *)( *it ); |
1052 | if (button) | 1052 | if (button) |
1053 | button->setNoStyle( no_style ); | 1053 | button->setNoStyle( no_style ); |
1054 | } | 1054 | } |
1055 | 1055 | ||
1056 | 1056 | ||
1057 | void KToolBar::setFlat (bool flag) | 1057 | void KToolBar::setFlat (bool flag) |
1058 | { | 1058 | { |
1059 | if ( !mainWindow() ) | 1059 | if ( !mainWindow() ) |
1060 | return; | 1060 | return; |
1061 | if ( flag ) | 1061 | if ( flag ) |
1062 | //US mainWindow()->moveDockWindow( this, DockMinimized ); | 1062 | //US mainWindow()->moveDockWindow( this, DockMinimized ); |
1063 | mainWindow()->moveToolBar( this, QMainWindow::Minimized ); | 1063 | mainWindow()->moveToolBar( this, QMainWindow::Minimized ); |
1064 | else | 1064 | else |
1065 | //US mainWindow()->moveDockWindow( this, DockTop ); | 1065 | //US mainWindow()->moveDockWindow( this, DockTop ); |
1066 | mainWindow()->moveToolBar( this, QMainWindow::Top ); | 1066 | mainWindow()->moveToolBar( this, QMainWindow::Top ); |
1067 | // And remember to save the new look later | 1067 | // And remember to save the new look later |
1068 | /*US | 1068 | /*US |
1069 | if ( mainWindow()->inherits( "KMainWindow" ) ) | 1069 | if ( mainWindow()->inherits( "KMainWindow" ) ) |
1070 | static_cast<KMainWindow *>(mainWindow())->setSettingsDirty(); | 1070 | static_cast<KMainWindow *>(mainWindow())->setSettingsDirty(); |
1071 | */ | 1071 | */ |
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | 1074 | ||
1075 | int KToolBar::count() const | 1075 | int KToolBar::count() const |
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp index 827ec38..2253de4 100644 --- a/microkde/kresources/factory.cpp +++ b/microkde/kresources/factory.cpp | |||
@@ -1,78 +1,79 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkresources. | 2 | This file is part of libkresources. |
3 | 3 | ||
4 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> | 4 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> |
5 | Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org> | 5 | Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org> |
6 | Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> | 6 | Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> |
7 | 7 | ||
8 | This library is free software; you can redistribute it and/or | 8 | This library is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU Library General Public | 9 | modify it under the terms of the GNU Library General Public |
10 | License as published by the Free Software Foundation; either | 10 | License as published by the Free Software Foundation; either |
11 | version 2 of the License, or (at your option) any later version. | 11 | version 2 of the License, or (at your option) any later version. |
12 | 12 | ||
13 | This library is distributed in the hope that it will be useful, | 13 | This library is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | Library General Public License for more details. | 16 | Library General Public License for more details. |
17 | 17 | ||
18 | You should have received a copy of the GNU Library General Public License | 18 | You should have received a copy of the GNU Library General Public License |
19 | along with this library; see the file COPYING.LIB. If not, write to | 19 | along with this library; see the file COPYING.LIB. If not, write to |
20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 20 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
21 | Boston, MA 02111-1307, USA. | 21 | Boston, MA 02111-1307, USA. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <kdebug.h> | 24 | #include <kdebug.h> |
25 | #include <klocale.h> | 25 | #include <klocale.h> |
26 | #include <ksimpleconfig.h> | 26 | #include <ksimpleconfig.h> |
27 | #include <kstandarddirs.h> | 27 | #include <kstandarddirs.h> |
28 | #include <kstaticdeleter.h> | 28 | #include <kstaticdeleter.h> |
29 | //#ifndef DESKTOP_VERSION | ||
29 | #include <klibloader.h> | 30 | #include <klibloader.h> |
30 | 31 | //#endif | |
31 | #include <qfile.h> | 32 | #include <qfile.h> |
32 | 33 | ||
33 | #include "resource.h" | 34 | #include "resource.h" |
34 | #include "factory.h" | 35 | #include "factory.h" |
35 | 36 | ||
36 | using namespace KRES; | 37 | using namespace KRES; |
37 | 38 | ||
38 | QDict<Factory> *Factory::mSelves = 0; | 39 | QDict<Factory> *Factory::mSelves = 0; |
39 | static KStaticDeleter< QDict<Factory> > staticDeleter; | 40 | static KStaticDeleter< QDict<Factory> > staticDeleter; |
40 | 41 | ||
41 | Factory *Factory::self( const QString& resourceFamily ) | 42 | Factory *Factory::self( const QString& resourceFamily ) |
42 | { | 43 | { |
43 | 44 | ||
44 | 45 | ||
45 | Factory *factory = 0; | 46 | Factory *factory = 0; |
46 | if ( !mSelves ) | 47 | if ( !mSelves ) |
47 | { | 48 | { |
48 | mSelves = staticDeleter.setObject( new QDict<Factory> ); | 49 | mSelves = staticDeleter.setObject( new QDict<Factory> ); |
49 | } | 50 | } |
50 | 51 | ||
51 | factory = mSelves->find( resourceFamily ); | 52 | factory = mSelves->find( resourceFamily ); |
52 | 53 | ||
53 | if ( !factory ) { | 54 | if ( !factory ) { |
54 | factory = new Factory( resourceFamily ); | 55 | factory = new Factory( resourceFamily ); |
55 | mSelves->insert( resourceFamily, factory ); | 56 | mSelves->insert( resourceFamily, factory ); |
56 | } | 57 | } |
57 | 58 | ||
58 | return factory; | 59 | return factory; |
59 | } | 60 | } |
60 | 61 | ||
61 | Factory::Factory( const QString& resourceFamily ) : | 62 | Factory::Factory( const QString& resourceFamily ) : |
62 | mResourceFamily( resourceFamily ) | 63 | mResourceFamily( resourceFamily ) |
63 | { | 64 | { |
64 | //US so far we have three types available for resourceFamily "contact" | 65 | //US so far we have three types available for resourceFamily "contact" |
65 | // and that are "file", "dir", "ldap" | 66 | // and that are "file", "dir", "ldap" |
66 | /*US | 67 | /*US |
67 | 68 | ||
68 | KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin", QString( "[X-KDE-ResourceFamily] == '%1'" ) | 69 | KTrader::OfferList plugins = KTrader::self()->query( "KResources/Plugin", QString( "[X-KDE-ResourceFamily] == '%1'" ) |
69 | .arg( resourceFamily ) ); | 70 | .arg( resourceFamily ) ); |
70 | KTrader::OfferList::ConstIterator it; | 71 | KTrader::OfferList::ConstIterator it; |
71 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { | 72 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { |
72 | QVariant type = (*it)->property( "X-KDE-ResourceType" ); | 73 | QVariant type = (*it)->property( "X-KDE-ResourceType" ); |
73 | if ( !type.toString().isEmpty() ) | 74 | if ( !type.toString().isEmpty() ) |
74 | mTypeMap.insert( type.toString(), *it ); | 75 | mTypeMap.insert( type.toString(), *it ); |
75 | } | 76 | } |
76 | */ | 77 | */ |
77 | 78 | ||
78 | //US new | 79 | //US new |
diff --git a/microkde/microkde.pro b/microkde/microkde.pro index 1e9b022..05833a9 100644 --- a/microkde/microkde.pro +++ b/microkde/microkde.pro | |||
@@ -53,118 +53,116 @@ KDGanttMinimizeSplitter.h \ | |||
53 | krestrictedline.h \ | 53 | krestrictedline.h \ |
54 | krun.h \ | 54 | krun.h \ |
55 | ksimpleconfig.h \ | 55 | ksimpleconfig.h \ |
56 | kstaticdeleter.h \ | 56 | kstaticdeleter.h \ |
57 | ksystemtray.h \ | 57 | ksystemtray.h \ |
58 | ktempfile.h \ | 58 | ktempfile.h \ |
59 | ktextedit.h \ | 59 | ktextedit.h \ |
60 | kunload.h \ | 60 | kunload.h \ |
61 | kurl.h \ | 61 | kurl.h \ |
62 | kdeui/kguiitem.h \ | 62 | kdeui/kguiitem.h \ |
63 | kdeui/kcmodule.h \ | 63 | kdeui/kcmodule.h \ |
64 | kdeui/kbuttonbox.h \ | 64 | kdeui/kbuttonbox.h \ |
65 | kdeui/klistbox.h \ | 65 | kdeui/klistbox.h \ |
66 | kdeui/klistview.h \ | 66 | kdeui/klistview.h \ |
67 | kdeui/kjanuswidget.h \ | 67 | kdeui/kjanuswidget.h \ |
68 | kdeui/kseparator.h \ | 68 | kdeui/kseparator.h \ |
69 | kdeui/knuminput.h \ | 69 | kdeui/knuminput.h \ |
70 | kdeui/knumvalidator.h \ | 70 | kdeui/knumvalidator.h \ |
71 | kdeui/ksqueezedtextlabel.h \ | 71 | kdeui/ksqueezedtextlabel.h \ |
72 | kio/job.h \ | 72 | kio/job.h \ |
73 | kio/kfile/kurlrequester.h \ | 73 | kio/kfile/kurlrequester.h \ |
74 | kresources/resource.h \ | 74 | kresources/resource.h \ |
75 | kresources/factory.h \ | 75 | kresources/factory.h \ |
76 | kresources/managerimpl.h \ | 76 | kresources/managerimpl.h \ |
77 | kresources/manager.h \ | 77 | kresources/manager.h \ |
78 | kresources/selectdialog.h \ | 78 | kresources/selectdialog.h \ |
79 | kresources/configpage.h \ | 79 | kresources/configpage.h \ |
80 | kresources/configwidget.h \ | 80 | kresources/configwidget.h \ |
81 | kresources/configdialog.h \ | 81 | kresources/configdialog.h \ |
82 | kresources/kcmkresources.h \ | 82 | kresources/kcmkresources.h \ |
83 | kdecore/kmdcodec.h \ | 83 | kdecore/kmdcodec.h \ |
84 | kdecore/kconfigbase.h \ | 84 | kdecore/kconfigbase.h \ |
85 | kdecore/klocale.h \ | 85 | kdecore/klocale.h \ |
86 | kdecore/kcatalogue.h \ | 86 | kdecore/kcatalogue.h \ |
87 | kdecore/ksharedptr.h \ | 87 | kdecore/ksharedptr.h \ |
88 | kdecore/kshell.h \ | 88 | kdecore/kshell.h \ |
89 | kdecore/kstandarddirs.h \ | 89 | kdecore/kstandarddirs.h \ |
90 | kdecore/kstringhandler.h \ | 90 | kdecore/kstringhandler.h \ |
91 | kdecore/kshortcut.h \ | 91 | kdecore/kshortcut.h \ |
92 | kutils/kcmultidialog.h \ | 92 | kutils/kcmultidialog.h \ |
93 | kdeui/kxmlguiclient.h \ | 93 | kdeui/kxmlguiclient.h \ |
94 | kdeui/kstdaction.h \ | 94 | kdeui/kstdaction.h \ |
95 | kdeui/kmainwindow.h \ | 95 | kdeui/kmainwindow.h \ |
96 | kdeui/ktoolbar.h \ | 96 | kdeui/ktoolbar.h \ |
97 | kdeui/ktoolbarbutton.h \ | 97 | kdeui/ktoolbarbutton.h \ |
98 | kdeui/ktoolbarhandler.h \ | 98 | kdeui/ktoolbarhandler.h \ |
99 | kdeui/kaction.h \ | 99 | kdeui/kaction.h \ |
100 | kdeui/kactionclasses.h \ | 100 | kdeui/kactionclasses.h \ |
101 | kdeui/kactioncollection.h | 101 | kdeui/kactioncollection.h \ |
102 | kdecore/klibloader.h | ||
102 | 103 | ||
103 | 104 | ||
104 | # kdecore/klibloader.h \ | 105 | # kdecore/klibloader.h \ |
105 | 106 | ||
106 | 107 | ||
107 | SOURCES = \ | 108 | SOURCES = \ |
108 | KDGanttMinimizeSplitter.cpp \ | 109 | KDGanttMinimizeSplitter.cpp \ |
109 | kapplication.cpp \ | 110 | kapplication.cpp \ |
110 | kcalendarsystem.cpp \ | 111 | kcalendarsystem.cpp \ |
111 | kcalendarsystemgregorian.cpp \ | 112 | kcalendarsystemgregorian.cpp \ |
112 | kcolorbutton.cpp \ | 113 | kcolorbutton.cpp \ |
113 | kcolordialog.cpp \ | 114 | kcolordialog.cpp \ |
114 | kconfig.cpp \ | 115 | kconfig.cpp \ |
115 | kdatetbl.cpp \ | 116 | kdatetbl.cpp \ |
116 | kdialog.cpp \ | 117 | kdialog.cpp \ |
117 | kdialogbase.cpp \ | 118 | kdialogbase.cpp \ |
118 | keditlistbox.cpp \ | 119 | keditlistbox.cpp \ |
119 | kemailsettings.cpp \ | 120 | kemailsettings.cpp \ |
120 | kfontdialog.cpp \ | 121 | kfontdialog.cpp \ |
121 | kfiledialog.cpp \ | 122 | kfiledialog.cpp \ |
122 | kglobal.cpp \ | 123 | kglobal.cpp \ |
123 | kglobalsettings.cpp \ | 124 | kglobalsettings.cpp \ |
124 | kiconloader.cpp \ | 125 | kiconloader.cpp \ |
125 | kmessagebox.cpp \ | 126 | kmessagebox.cpp \ |
126 | ktextedit.cpp \ | 127 | ktextedit.cpp \ |
127 | kprocess.cpp \ | 128 | kprocess.cpp \ |
128 | krun.cpp \ | 129 | krun.cpp \ |
129 | ksystemtray.cpp \ | 130 | ksystemtray.cpp \ |
130 | ktempfile.cpp \ | 131 | ktempfile.cpp \ |
131 | kurl.cpp \ | 132 | kurl.cpp \ |
132 | kdecore/kcatalogue.cpp \ | 133 | kdecore/kcatalogue.cpp \ |
133 | kdecore/klocale.cpp \ | 134 | kdecore/klocale.cpp \ |
134 | kdecore/kmdcodec.cpp \ | 135 | kdecore/kmdcodec.cpp \ |
135 | kdecore/kshell.cpp \ | 136 | kdecore/kshell.cpp \ |
136 | kdecore/kstandarddirs.cpp \ | 137 | kdecore/kstandarddirs.cpp \ |
137 | kdecore/kstringhandler.cpp \ | 138 | kdecore/kstringhandler.cpp \ |
138 | kdeui/kbuttonbox.cpp \ | 139 | kdeui/kbuttonbox.cpp \ |
139 | kdeui/kcmodule.cpp \ | 140 | kdeui/kcmodule.cpp \ |
140 | kdeui/kguiitem.cpp \ | 141 | kdeui/kguiitem.cpp \ |
141 | kdeui/kjanuswidget.cpp \ | 142 | kdeui/kjanuswidget.cpp \ |
142 | kdeui/klistbox.cpp \ | 143 | kdeui/klistbox.cpp \ |
143 | kdeui/klistview.cpp \ | 144 | kdeui/klistview.cpp \ |
144 | kdeui/knuminput.cpp \ | 145 | kdeui/knuminput.cpp \ |
145 | kdeui/knumvalidator.cpp \ | 146 | kdeui/knumvalidator.cpp \ |
146 | kdeui/kseparator.cpp \ | 147 | kdeui/kseparator.cpp \ |
147 | kdeui/ksqueezedtextlabel.cpp \ | 148 | kdeui/ksqueezedtextlabel.cpp \ |
148 | kio/kfile/kurlrequester.cpp \ | 149 | kio/kfile/kurlrequester.cpp \ |
149 | kresources/configpage.cpp \ | 150 | kresources/configpage.cpp \ |
150 | kresources/configdialog.cpp \ | 151 | kresources/configdialog.cpp \ |
151 | kresources/configwidget.cpp \ | 152 | kresources/configwidget.cpp \ |
152 | kresources/factory.cpp \ | 153 | kresources/factory.cpp \ |
153 | kresources/kcmkresources.cpp \ | 154 | kresources/kcmkresources.cpp \ |
154 | kresources/managerimpl.cpp \ | 155 | kresources/managerimpl.cpp \ |
155 | kresources/resource.cpp \ | 156 | kresources/resource.cpp \ |
156 | kresources/selectdialog.cpp \ | 157 | kresources/selectdialog.cpp \ |
157 | kutils/kcmultidialog.cpp \ | 158 | kutils/kcmultidialog.cpp \ |
158 | kdeui/kaction.cpp \ | 159 | kdeui/kaction.cpp \ |
159 | kdeui/kactionclasses.cpp \ | 160 | kdeui/kactionclasses.cpp \ |
160 | kdeui/kactioncollection.cpp \ | 161 | kdeui/kactioncollection.cpp \ |
161 | kdeui/kmainwindow.cpp \ | 162 | kdeui/kmainwindow.cpp \ |
162 | kdeui/ktoolbar.cpp \ | 163 | kdeui/ktoolbar.cpp \ |
163 | kdeui/ktoolbarbutton.cpp \ | 164 | kdeui/ktoolbarbutton.cpp \ |
164 | kdeui/ktoolbarhandler.cpp \ | 165 | kdeui/ktoolbarhandler.cpp \ |
165 | kdeui/kstdaction.cpp \ | 166 | kdeui/kstdaction.cpp \ |
166 | kdeui/kxmlguiclient.cpp | 167 | kdeui/kxmlguiclient.cpp \ |
167 | 168 | kdecore/klibloader.cpp \ No newline at end of file | |
168 | |||
169 | |||
170 | # kdecore/klibloader.cpp \ \ No newline at end of file | ||