summaryrefslogtreecommitdiffabout
path: root/microkde
Unidiff
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/klibloader.cpp17
-rw-r--r--microkde/kdecore/kstandarddirs.cpp3
-rw-r--r--microkde/kdeui/ktoolbar.cpp2
-rw-r--r--microkde/kresources/factory.cpp3
-rw-r--r--microkde/microkde.pro10
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,647 +1,648 @@
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*/
51template class QAsciiDict<KLibrary>; 48template 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
73extern "C" { 70extern "C" {
74extern int lt_dlopen_flag; 71extern int lt_dlopen_flag;
75} 72}
76*/ 73*/
77 74
78KLibFactory::KLibFactory( QObject* parent, const char* name ) 75KLibFactory::KLibFactory( QObject* parent, const char* name )
79 : QObject( parent, name ) 76 : QObject( parent, name )
80{ 77{
81} 78}
82 79
83KLibFactory::~KLibFactory() 80KLibFactory::~KLibFactory()
84{ 81{
85// kdDebug(150) << "Deleting KLibFactory " << this << endl; 82// kdDebug(150) << "Deleting KLibFactory " << this << endl;
86} 83}
87 84
88QObject* KLibFactory::create( QObject* parent, const char* name, const char* classname, const QStringList &args ) 85QObject* 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
97QObject* KLibFactory::createObject( QObject*, const char*, const char*, const QStringList &) 94QObject* KLibFactory::createObject( QObject*, const char*, const char*, const QStringList &)
98{ 95{
99 return 0; 96 return 0;
100} 97}
101 98
102 99
103// ----------------------------------------------- 100// -----------------------------------------------
104 101
105//US KLibrary::KLibrary( const QString& libname, const QString& filename, void * handle ) 102//US KLibrary::KLibrary( const QString& libname, const QString& filename, void * handle )
106KLibrary::KLibrary( const QString& libname, const QString& filename, QLibrary* handle ) 103KLibrary::KLibrary( const QString& libname, const QString& filename, QLibrary* handle )
107{ 104{
108 /* Make sure, we have a KLibLoader */ 105 /* Make sure, we have a KLibLoader */
109 (void) KLibLoader::self(); 106 (void) KLibLoader::self();
110 m_libname = libname; 107 m_libname = libname;
111 m_filename = filename; 108 m_filename = filename;
112 m_handle = handle; 109 m_handle = handle;
113 m_factory = 0; 110 m_factory = 0;
114 m_timer = 0; 111 m_timer = 0;
115} 112}
116 113
117KLibrary::~KLibrary() 114KLibrary::~KLibrary()
118{ 115{
119// kdDebug(150) << "Deleting KLibrary " << this << " " << m_libname << endl; 116// kdDebug(150) << "Deleting KLibrary " << this << " " << m_libname << endl;
120 if ( m_timer && m_timer->isActive() ) 117 if ( m_timer && m_timer->isActive() )
121 m_timer->stop(); 118 m_timer->stop();
122 119
123 // If any object is remaining, delete 120 // If any object is remaining, delete
124 if ( m_objs.count() > 0 ) 121 if ( m_objs.count() > 0 )
125 { 122 {
126 QPtrListIterator<QObject> it( m_objs ); 123 QPtrListIterator<QObject> it( m_objs );
127 for ( ; it.current() ; ++it ) 124 for ( ; it.current() ; ++it )
128 { 125 {
129 kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl; 126 kdDebug(150) << "Factory still has object " << it.current() << " " << it.current()->name () << " Library = " << m_libname << endl;
130 disconnect( it.current(), SIGNAL( destroyed() ), 127 disconnect( it.current(), SIGNAL( destroyed() ),
131 this, SLOT( slotObjectDestroyed() ) ); 128 this, SLOT( slotObjectDestroyed() ) );
132 } 129 }
133 m_objs.setAutoDelete(true); 130 m_objs.setAutoDelete(true);
134 m_objs.clear(); 131 m_objs.clear();
135 } 132 }
136 133
137 if ( m_factory ) { 134 if ( m_factory ) {
138 //kdDebug(150) << " ... deleting the factory " << m_factory << endl; 135 //kdDebug(150) << " ... deleting the factory " << m_factory << endl;
139 delete m_factory; 136 delete m_factory;
140 } 137 }
141} 138}
142 139
143QString KLibrary::name() const 140QString KLibrary::name() const
144{ 141{
145 return m_libname; 142 return m_libname;
146} 143}
147 144
148QString KLibrary::fileName() const 145QString KLibrary::fileName() const
149{ 146{
150 return m_filename; 147 return m_filename;
151} 148}
152 149
153KLibFactory* KLibrary::factory() 150KLibFactory* 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
188void* KLibrary::symbol( const char* symname ) const 185void* 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
202bool KLibrary::hasSymbol( const char* symname ) const 198bool 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
209void KLibrary::unload() const 205void 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
215void KLibrary::slotObjectCreated( QObject *obj ) 211void 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
232void KLibrary::slotObjectDestroyed() 228void 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" );
244 connect( m_timer, SIGNAL( timeout() ), 240 connect( m_timer, SIGNAL( timeout() ),
245 this, SLOT( slotTimeout() ) ); 241 this, SLOT( slotTimeout() ) );
246 } 242 }
247 243
248 // as long as it's not stable make the timeout short, for debugging 244 // as long as it's not stable make the timeout short, for debugging
249 // pleasure (matz) 245 // pleasure (matz)
250 //m_timer->start( 1000*60, true ); 246 //m_timer->start( 1000*60, true );
251 m_timer->start( 1000*10, true ); 247 m_timer->start( 1000*10, true );
252 } 248 }
253} 249}
254 250
255void KLibrary::slotTimeout() 251void KLibrary::slotTimeout()
256{ 252{
257 if ( m_objs.count() != 0 ) 253 if ( m_objs.count() != 0 )
258 return; 254 return;
259 255
260 /* Don't go through KLibLoader::unloadLibrary(), because that uses the 256 /* Don't go through KLibLoader::unloadLibrary(), because that uses the
261 ref counter, but this timeout means to unconditionally close this library 257 ref counter, but this timeout means to unconditionally close this library
262 The destroyed() signal will take care to remove us from all lists. 258 The destroyed() signal will take care to remove us from all lists.
263 */ 259 */
264 delete this; 260 delete this;
265} 261}
266 262
267// ------------------------------------------------- 263// -------------------------------------------------
268 264
269/* This helper class is needed, because KLibraries can go away without 265/* This helper class is needed, because KLibraries can go away without
270 being unloaded. So we need some info about KLibraries even after its 266 being unloaded. So we need some info about KLibraries even after its
271 death. */ 267 death. */
272class KLibWrapPrivate 268class KLibWrapPrivate
273{ 269{
274public: 270public:
275//US KLibWrapPrivate(KLibrary *l, lt_dlhandle h); 271//US KLibWrapPrivate(KLibrary *l, lt_dlhandle h);
276 KLibWrapPrivate(KLibrary *l, QLibrary* h); 272 KLibWrapPrivate(KLibrary *l, QLibrary* h);
277 273
278 KLibrary *lib; 274 KLibrary *lib;
279 enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode; 275 enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode;
280 int ref_count; 276 int ref_count;
281//US lt_dlhandle handle; 277//US lt_dlhandle handle;
282 QLibrary *handle; 278 QLibrary *handle;
283 QString name; 279 QString name;
284 QString filename; 280 QString filename;
285}; 281};
286 282
287//US KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, lt_dlhandle h) 283//US KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, lt_dlhandle h)
288KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, QLibrary* h) 284KLibWrapPrivate::KLibWrapPrivate(KLibrary *l, QLibrary* h)
289 : lib(l), ref_count(1), handle(h), name(l->name()), filename(l->fileName()) 285 : lib(l), ref_count(1), handle(h), name(l->name()), filename(l->fileName())
290{ 286{
291 unload_mode = UNKNOWN; 287 unload_mode = UNKNOWN;
292/*US 288/*US
293 if (lt_dlsym(handle, "__kde_do_not_unload") != 0) { 289 if (lt_dlsym(handle, "__kde_do_not_unload") != 0) {
294// kdDebug(150) << "Will not unload " << name << endl; 290// kdDebug(150) << "Will not unload " << name << endl;
295 unload_mode = DONT_UNLOAD; 291 unload_mode = DONT_UNLOAD;
296 } else if (lt_dlsym(handle, "__kde_do_unload") != 0) { 292 } else if (lt_dlsym(handle, "__kde_do_unload") != 0) {
297 unload_mode = UNLOAD; 293 unload_mode = UNLOAD;
298 } 294 }
299*/ 295*/
300//US use instead: 296//US use instead:
301 if (h->resolve("__kde_do_not_unload") != 0) { 297 if (h->resolve("__kde_do_not_unload") != 0) {
302// kdDebug(150) << "Will not unload " << name << endl; 298// kdDebug(150) << "Will not unload " << name << endl;
303 unload_mode = DONT_UNLOAD; 299 unload_mode = DONT_UNLOAD;
304 } else if (h->resolve("__kde_do_unload") != 0) { 300 } else if (h->resolve("__kde_do_unload") != 0) {
305 unload_mode = UNLOAD; 301 unload_mode = UNLOAD;
306 } 302 }
307} 303}
308 304
309class KLibLoaderPrivate 305class KLibLoaderPrivate
310{ 306{
311public: 307public:
312 QPtrList<KLibWrapPrivate> loaded_stack; 308 QPtrList<KLibWrapPrivate> loaded_stack;
313 QPtrList<KLibWrapPrivate> pending_close; 309 QPtrList<KLibWrapPrivate> pending_close;
314 enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode; 310 enum {UNKNOWN, UNLOAD, DONT_UNLOAD} unload_mode;
315 311
316 QString errorMessage; 312 QString errorMessage;
317}; 313};
318 314
319KLibLoader* KLibLoader::s_self = 0; 315KLibLoader* KLibLoader::s_self = 0;
320 316
321KLibLoader* KLibLoader::self() 317KLibLoader* KLibLoader::self()
322{ 318{
323 if ( !s_self ) 319 if ( !s_self )
324 s_self = new KLibLoader; 320 s_self = new KLibLoader;
325 return s_self; 321 return s_self;
326} 322}
327 323
328void KLibLoader::cleanUp() 324void KLibLoader::cleanUp()
329{ 325{
330 if ( !s_self ) 326 if ( !s_self )
331 return; 327 return;
332 328
333 delete s_self; 329 delete s_self;
334 s_self = 0; 330 s_self = 0;
335} 331}
336 332
337KLibLoader::KLibLoader( QObject* parent, const char* name ) 333KLibLoader::KLibLoader( QObject* parent, const char* name )
338 : QObject( parent, name ) 334 : QObject( parent, name )
339{ 335{
340 s_self = this; 336 s_self = this;
341 d = new KLibLoaderPrivate; 337 d = new KLibLoaderPrivate;
342//US lt_dlinit(); 338//US lt_dlinit();
343 d->unload_mode = KLibLoaderPrivate::UNKNOWN; 339 d->unload_mode = KLibLoaderPrivate::UNKNOWN;
344 if (getenv("KDE_NOUNLOAD") != 0) 340 if (getenv("KDE_NOUNLOAD") != 0)
345 d->unload_mode = KLibLoaderPrivate::DONT_UNLOAD; 341 d->unload_mode = KLibLoaderPrivate::DONT_UNLOAD;
346 else if (getenv("KDE_DOUNLOAD") != 0) 342 else if (getenv("KDE_DOUNLOAD") != 0)
347 d->unload_mode = KLibLoaderPrivate::UNLOAD; 343 d->unload_mode = KLibLoaderPrivate::UNLOAD;
348 d->loaded_stack.setAutoDelete( true ); 344 d->loaded_stack.setAutoDelete( true );
349} 345}
350 346
351KLibLoader::~KLibLoader() 347KLibLoader::~KLibLoader()
352{ 348{
353// kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl; 349// kdDebug(150) << "Deleting KLibLoader " << this << " " << name() << endl;
354 350
355 QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); 351 QAsciiDictIterator<KLibWrapPrivate> it( m_libs );
356 for (; it.current(); ++it ) 352 for (; it.current(); ++it )
357 { 353 {
358 kdDebug(150) << "The KLibLoader contains the library " << it.current()->name 354 kdDebug(150) << "The KLibLoader contains the library " << it.current()->name
359 << " (" << it.current()->lib << ")" << endl; 355 << " (" << it.current()->lib << ")" << endl;
360 d->pending_close.append(it.current()); 356 d->pending_close.append(it.current());
361 } 357 }
362 358
363 close_pending(0); 359 close_pending(0);
364 360
365 delete d; 361 delete d;
366} 362}
367 363
368//static 364//static
369QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ ) 365QString KLibLoader::findLibrary( const char * name/*US , const KInstance * instance*/ )
370{ 366{
371 QCString libname( name ); 367 QCString libname( name );
372 368
373 // only append ".la" if there is no extension 369 // only append ".la" if there is no extension
374 // this allows to load non-libtool libraries as well 370 // this allows to load non-libtool libraries as well
375 // (mhk, 20000228) 371 // (mhk, 20000228)
376 int pos = libname.findRev('/'); 372 int pos = libname.findRev('/');
377 if (pos < 0) 373 if (pos < 0)
378 pos = 0; 374 pos = 0;
379/*US 375/*US
380 if (libname.find('.', pos) < 0) { 376 if (libname.find('.', pos) < 0) {
381 libname += ".la"; 377 libname += ".la";
382 } 378 }
383*/ 379*/
384//US in the microedition we work only with shared libraries. 380//US in the microedition we work only with shared libraries.
385 if (libname.find('.', pos) < 0) { 381 if (libname.find('.', pos) < 0) {
386 libname += ".so"; 382 libname += ".so";
387 } 383 }
388 384
389 // only look up the file if it is not an absolute filename 385 // only look up the file if it is not an absolute filename
390 // (mhk, 20000228) 386 // (mhk, 20000228)
391 QString libfile; 387 QString libfile;
392 if (libname[0] == '/') 388 if (libname[0] == '/')
393 libfile = libname; 389 libfile = libname;
394 else 390 else
395 { 391 {
396//US at this point the libname must exist as real filesname. No expansions will be made later 392//US at this point the libname must exist as real filesname. No expansions will be made later
397// in findResources. Because of that we prepend the lib prefix here to the name 393// in findResources. Because of that we prepend the lib prefix here to the name
398//US I add also the "lib" prefix. I do not how could this could have worked before without it? 394//US I add also the "lib" prefix. I do not how could this could have worked before without it?
399 libname.insert(pos, "lib"); 395 libname.insert(pos, "lib");
400 396
401 397
402//US libfile = instance->dirs()->findResource( "module", libname ); 398//US libfile = instance->dirs()->findResource( "module", libname );
403 libfile = KGlobal::dirs()->findResource( "module", libname ); 399 libfile = KGlobal::dirs()->findResource( "module", libname );
404 if ( libfile.isEmpty() ) 400 if ( libfile.isEmpty() )
405 { 401 {
406//US libfile = instance->dirs()->findResource( "lib", libname ); 402//US libfile = instance->dirs()->findResource( "lib", libname );
407 libfile = KGlobal::dirs()->findResource( "lib", libname ); 403 libfile = KGlobal::dirs()->findResource( "lib", libname );
408#ifndef NDEBUG 404#ifndef NDEBUG
409 if ( !libfile.isEmpty() && libname.left(3) == "lib" ) // don't warn for kdeinit modules 405 if ( !libfile.isEmpty() && libname.left(3) == "lib" ) // don't warn for kdeinit modules
410 kdDebug(150) << "library " << libname << " not found under 'module' but under 'lib'" << endl; 406 kdDebug(150) << "library " << libname << " not found under 'module' but under 'lib'" << endl;
411#endif 407#endif
412 } 408 }
413 if ( libfile.isEmpty() ) 409 if ( libfile.isEmpty() )
414 { 410 {
415#ifndef NDEBUG 411#ifndef NDEBUG
416 kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl; 412 kdDebug(150) << "library=" << libname << ": No file names " << libname.data() << " found in paths." << endl;
417 self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname); 413 self()->d->errorMessage = i18n("Library files for \"%1\" not found in paths").arg(libname);
418 414
419 qDebug("KLibLoader::library could not find library: %s", libname.data()); 415 qDebug("KLibLoader::library could not find library: %s", libname.data());
420#endif 416#endif
421 417
422 } 418 }
423 else 419 else
424 self()->d->errorMessage = QString::null; 420 self()->d->errorMessage = QString::null;
425 } 421 }
426 return libfile; 422 return libfile;
427} 423}
428 424
429 425
430KLibrary* KLibLoader::globalLibrary( const char *name ) 426KLibrary* KLibLoader::globalLibrary( const char *name )
431{ 427{
432KLibrary *tmp; 428KLibrary *tmp;
433/*US 429/*US
434int olt_dlopen_flag = lt_dlopen_flag; 430int 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*/
445return tmp; 441return tmp;
446} 442}
447 443
448 444
449KLibrary* KLibLoader::library( const char *name ) 445KLibrary* 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
514QString KLibLoader::lastErrorMessage() const 513QString KLibLoader::lastErrorMessage() const
515{ 514{
516 return d->errorMessage; 515 return d->errorMessage;
517} 516}
518 517
519void KLibLoader::unloadLibrary( const char *libname ) 518void 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 );
530 529
531 disconnect( wrap->lib, SIGNAL( destroyed() ), 530 disconnect( wrap->lib, SIGNAL( destroyed() ),
532 this, SLOT( slotLibraryDestroyed() ) ); 531 this, SLOT( slotLibraryDestroyed() ) );
533 close_pending( wrap ); 532 close_pending( wrap );
534} 533}
535 534
536KLibFactory* KLibLoader::factory( const char* name ) 535KLibFactory* KLibLoader::factory( const char* name )
537{ 536{
538 KLibrary* lib = library( name ); 537 KLibrary* lib = library( name );
539 if ( !lib ) 538 if ( !lib )
540 return 0; 539 return 0;
541 540
542 return lib->factory(); 541 return lib->factory();
543} 542}
544 543
545void KLibLoader::slotLibraryDestroyed() 544void KLibLoader::slotLibraryDestroyed()
546{ 545{
547 const KLibrary *lib = static_cast<const KLibrary *>( sender() ); 546 const KLibrary *lib = static_cast<const KLibrary *>( sender() );
548 547
549 QAsciiDictIterator<KLibWrapPrivate> it( m_libs ); 548 QAsciiDictIterator<KLibWrapPrivate> it( m_libs );
550 for (; it.current(); ++it ) 549 for (; it.current(); ++it )
551 if ( it.current()->lib == lib ) 550 if ( it.current()->lib == lib )
552 { 551 {
553 KLibWrapPrivate *wrap = it.current(); 552 KLibWrapPrivate *wrap = it.current();
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
561void KLibLoader::close_pending(KLibWrapPrivate *wrap) 560void 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
641void KLibLoader::virtual_hook( int, void* ) 642void KLibLoader::virtual_hook( int, void* )
642{ /*BASE::virtual_hook( id, data );*/ } 643{ /*BASE::virtual_hook( id, data );*/ }
643 644
644void KLibFactory::virtual_hook( int, void* ) 645void 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,238 +1,237 @@
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
57QString KStandardDirs::mAppDir = QString::null; 56QString KStandardDirs::mAppDir = QString::null;
58 57
59 58
60template class QDict<QStringList>; 59template class QDict<QStringList>;
61 60
62#if 0 61#if 0
63#include <qtextedit.h> 62#include <qtextedit.h>
64void ddd( QString op ) 63void 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
76class KStandardDirs::KStandardDirsPrivate 75class KStandardDirs::KStandardDirsPrivate
77{ 76{
78public: 77public:
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
91static const char* const types[] = {"html", "icon", "apps", "sound", 90static 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",
95 "module", "qtplugins", 94 "module", "qtplugins",
96 "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu", 0 }; 95 "xdgdata-apps", "xdgdata-dirs", "xdgconf-menu", 0 };
97 96
98static int tokenize( QStringList& token, const QString& str, 97static int tokenize( QStringList& token, const QString& str,
99 const QString& delim ); 98 const QString& delim );
100 99
101KStandardDirs::KStandardDirs( ) : addedCustoms(false) 100KStandardDirs::KStandardDirs( ) : addedCustoms(false)
102{ 101{
103 d = new KStandardDirsPrivate; 102 d = new KStandardDirsPrivate;
104 dircache.setAutoDelete(true); 103 dircache.setAutoDelete(true);
105 relatives.setAutoDelete(true); 104 relatives.setAutoDelete(true);
106 absolutes.setAutoDelete(true); 105 absolutes.setAutoDelete(true);
107 savelocations.setAutoDelete(true); 106 savelocations.setAutoDelete(true);
108 addKDEDefaults(); 107 addKDEDefaults();
109} 108}
110 109
111KStandardDirs::~KStandardDirs() 110KStandardDirs::~KStandardDirs()
112{ 111{
113 delete d; 112 delete d;
114} 113}
115 114
116bool KStandardDirs::isRestrictedResource(const char *type, const QString& relPath) const 115bool KStandardDirs::isRestrictedResource(const char *type, const QString& relPath) const
117{ 116{
118 if (!d || !d->restrictionsActive) 117 if (!d || !d->restrictionsActive)
119 return false; 118 return false;
120 119
121 if (d->restrictions[type]) 120 if (d->restrictions[type])
122 return true; 121 return true;
123 122
124 if (strcmp(type, "data")==0) 123 if (strcmp(type, "data")==0)
125 { 124 {
126 applyDataRestrictions(relPath); 125 applyDataRestrictions(relPath);
127 if (d->dataRestrictionActive) 126 if (d->dataRestrictionActive)
128 { 127 {
129 d->dataRestrictionActive = false; 128 d->dataRestrictionActive = false;
130 return true; 129 return true;
131 } 130 }
132 } 131 }
133 return false; 132 return false;
134} 133}
135 134
136void KStandardDirs::applyDataRestrictions(const QString &relPath) const 135void KStandardDirs::applyDataRestrictions(const QString &relPath) const
137{ 136{
138 QString key; 137 QString key;
139 int i = relPath.find('/'); 138 int i = relPath.find('/');
140 if (i != -1) 139 if (i != -1)
141 key = "data_"+relPath.left(i); 140 key = "data_"+relPath.left(i);
142 else 141 else
143 key = "data_"+relPath; 142 key = "data_"+relPath;
144 143
145 if (d && d->restrictions[key.latin1()]) 144 if (d && d->restrictions[key.latin1()])
146 d->dataRestrictionActive = true; 145 d->dataRestrictionActive = true;
147} 146}
148 147
149 148
150QStringList KStandardDirs::allTypes() const 149QStringList KStandardDirs::allTypes() const
151{ 150{
152 QStringList list; 151 QStringList list;
153 for (int i = 0; types[i] != 0; ++i) 152 for (int i = 0; types[i] != 0; ++i)
154 list.append(QString::fromLatin1(types[i])); 153 list.append(QString::fromLatin1(types[i]));
155 return list; 154 return list;
156} 155}
157 156
158void KStandardDirs::addPrefix( const QString& _dir ) 157void KStandardDirs::addPrefix( const QString& _dir )
159{ 158{
160 if (_dir.isNull()) 159 if (_dir.isNull())
161 return; 160 return;
162 161
163 QString dir = _dir; 162 QString dir = _dir;
164 if (dir.at(dir.length() - 1) != '/') 163 if (dir.at(dir.length() - 1) != '/')
165 dir += '/'; 164 dir += '/';
166 165
167 if (!prefixes.contains(dir)) { 166 if (!prefixes.contains(dir)) {
168 prefixes.append(dir); 167 prefixes.append(dir);
169 dircache.clear(); 168 dircache.clear();
170 } 169 }
171} 170}
172 171
173void KStandardDirs::addXdgConfigPrefix( const QString& _dir ) 172void KStandardDirs::addXdgConfigPrefix( const QString& _dir )
174{ 173{
175 if (_dir.isNull()) 174 if (_dir.isNull())
176 return; 175 return;
177 176
178 QString dir = _dir; 177 QString dir = _dir;
179 if (dir.at(dir.length() - 1) != '/') 178 if (dir.at(dir.length() - 1) != '/')
180 dir += '/'; 179 dir += '/';
181 180
182 if (!d->xdgconf_prefixes.contains(dir)) { 181 if (!d->xdgconf_prefixes.contains(dir)) {
183 d->xdgconf_prefixes.append(dir); 182 d->xdgconf_prefixes.append(dir);
184 dircache.clear(); 183 dircache.clear();
185 } 184 }
186} 185}
187 186
188void KStandardDirs::addXdgDataPrefix( const QString& _dir ) 187void KStandardDirs::addXdgDataPrefix( const QString& _dir )
189{ 188{
190 if (_dir.isNull()) 189 if (_dir.isNull())
191 return; 190 return;
192 191
193 QString dir = _dir; 192 QString dir = _dir;
194 if (dir.at(dir.length() - 1) != '/') 193 if (dir.at(dir.length() - 1) != '/')
195 dir += '/'; 194 dir += '/';
196 195
197 if (!d->xdgdata_prefixes.contains(dir)) { 196 if (!d->xdgdata_prefixes.contains(dir)) {
198 d->xdgdata_prefixes.append(dir); 197 d->xdgdata_prefixes.append(dir);
199 dircache.clear(); 198 dircache.clear();
200 } 199 }
201} 200}
202 201
203 202
204QString KStandardDirs::kfsstnd_prefixes() 203QString KStandardDirs::kfsstnd_prefixes()
205{ 204{
206 return prefixes.join(":"); 205 return prefixes.join(":");
207} 206}
208 207
209bool KStandardDirs::addResourceType( const char *type, 208bool KStandardDirs::addResourceType( const char *type,
210 const QString& relativename ) 209 const QString& relativename )
211{ 210{
212 if (relativename.isNull()) 211 if (relativename.isNull())
213 return false; 212 return false;
214 213
215 QStringList *rels = relatives.find(type); 214 QStringList *rels = relatives.find(type);
216 if (!rels) { 215 if (!rels) {
217 rels = new QStringList(); 216 rels = new QStringList();
218 relatives.insert(type, rels); 217 relatives.insert(type, rels);
219 } 218 }
220 QString copy = relativename; 219 QString copy = relativename;
221 if (copy.at(copy.length() - 1) != '/') 220 if (copy.at(copy.length() - 1) != '/')
222 copy += '/'; 221 copy += '/';
223 if (!rels->contains(copy)) { 222 if (!rels->contains(copy)) {
224 rels->prepend(copy); 223 rels->prepend(copy);
225 dircache.remove(type); // clean the cache 224 dircache.remove(type); // clean the cache
226 return true; 225 return true;
227 } 226 }
228 return false; 227 return false;
229} 228}
230 229
231bool KStandardDirs::addResourceDir( const char *type, 230bool KStandardDirs::addResourceDir( const char *type,
232 const QString& absdir) 231 const QString& absdir)
233{ 232{
234 QStringList *paths = absolutes.find(type); 233 QStringList *paths = absolutes.find(type);
235 if (!paths) { 234 if (!paths) {
236 paths = new QStringList(); 235 paths = new QStringList();
237 absolutes.insert(type, paths); 236 absolutes.insert(type, paths);
238 } 237 }
@@ -1036,385 +1035,385 @@ QString KStandardDirs::saveLocation(const char *type,
1036 if(!create) { 1035 if(!create) {
1037#ifndef NDEBUG 1036#ifndef NDEBUG
1038 qDebug("save location %s doesn't exist", fullPath.latin1()); 1037 qDebug("save location %s doesn't exist", fullPath.latin1());
1039#endif 1038#endif
1040 return fullPath; 1039 return fullPath;
1041 } 1040 }
1042 if(!makeDir(fullPath, 0700)) { 1041 if(!makeDir(fullPath, 0700)) {
1043 qWarning("failed to create %s", fullPath.latin1()); 1042 qWarning("failed to create %s", fullPath.latin1());
1044 return fullPath; 1043 return fullPath;
1045 } 1044 }
1046 dircache.remove(type); 1045 dircache.remove(type);
1047 } 1046 }
1048 return fullPath; 1047 return fullPath;
1049} 1048}
1050 1049
1051QString KStandardDirs::relativeLocation(const char *type, const QString &absPath) 1050QString KStandardDirs::relativeLocation(const char *type, const QString &absPath)
1052{ 1051{
1053 QString fullPath = absPath; 1052 QString fullPath = absPath;
1054 int i = absPath.findRev('/'); 1053 int i = absPath.findRev('/');
1055 if (i != -1) 1054 if (i != -1)
1056 { 1055 {
1057 fullPath = realPath(absPath.left(i+1))+absPath.mid(i+1); // Normalize 1056 fullPath = realPath(absPath.left(i+1))+absPath.mid(i+1); // Normalize
1058 } 1057 }
1059 1058
1060 QStringList candidates = resourceDirs(type); 1059 QStringList candidates = resourceDirs(type);
1061 1060
1062 for (QStringList::ConstIterator it = candidates.begin(); 1061 for (QStringList::ConstIterator it = candidates.begin();
1063 it != candidates.end(); it++) 1062 it != candidates.end(); it++)
1064 if (fullPath.startsWith(*it)) 1063 if (fullPath.startsWith(*it))
1065 { 1064 {
1066 return fullPath.mid((*it).length()); 1065 return fullPath.mid((*it).length());
1067 } 1066 }
1068 1067
1069 return absPath; 1068 return absPath;
1070} 1069}
1071 1070
1072 1071
1073bool KStandardDirs::makeDir(const QString& dir2, int mode) 1072bool KStandardDirs::makeDir(const QString& dir2, int mode)
1074{ 1073{
1075 QString dir = QDir::convertSeparators( dir2 ); 1074 QString dir = QDir::convertSeparators( dir2 );
1076#if 0 1075#if 0
1077 //LR 1076 //LR
1078 1077
1079 // we want an absolute path 1078 // we want an absolute path
1080 if (dir.at(0) != '/') 1079 if (dir.at(0) != '/')
1081 return false; 1080 return false;
1082 1081
1083 QString target = dir; 1082 QString target = dir;
1084 uint len = target.length(); 1083 uint len = target.length();
1085 1084
1086 // append trailing slash if missing 1085 // append trailing slash if missing
1087 if (dir.at(len - 1) != '/') 1086 if (dir.at(len - 1) != '/')
1088 target += '/'; 1087 target += '/';
1089 1088
1090 QString base(""); 1089 QString base("");
1091 uint i = 1; 1090 uint i = 1;
1092 1091
1093 while( i < len ) 1092 while( i < len )
1094 { 1093 {
1095//US struct stat st; 1094//US struct stat st;
1096 int pos = target.find('/', i); 1095 int pos = target.find('/', i);
1097 base += target.mid(i - 1, pos - i + 1); 1096 base += target.mid(i - 1, pos - i + 1);
1098 QCString baseEncoded = QFile::encodeName(base); 1097 QCString baseEncoded = QFile::encodeName(base);
1099 // bail out if we encountered a problem 1098 // bail out if we encountered a problem
1100//US if (stat(baseEncoded, &st) != 0) 1099//US if (stat(baseEncoded, &st) != 0)
1101 QFileInfo baseEncodedInfo(baseEncoded); 1100 QFileInfo baseEncodedInfo(baseEncoded);
1102 if (!baseEncodedInfo.exists()) 1101 if (!baseEncodedInfo.exists())
1103 { 1102 {
1104 // Directory does not exist.... 1103 // Directory does not exist....
1105 // Or maybe a dangling symlink ? 1104 // Or maybe a dangling symlink ?
1106//US if (lstat(baseEncoded, &st) == 0) 1105//US if (lstat(baseEncoded, &st) == 0)
1107 if (baseEncodedInfo.isSymLink()) { 1106 if (baseEncodedInfo.isSymLink()) {
1108//US (void)unlink(baseEncoded); // try removing 1107//US (void)unlink(baseEncoded); // try removing
1109 QFile(baseEncoded).remove(); 1108 QFile(baseEncoded).remove();
1110 } 1109 }
1111 1110
1112 //US if ( mkdir(baseEncoded, (mode_t) mode) != 0) 1111 //US if ( mkdir(baseEncoded, (mode_t) mode) != 0)
1113 QDir dirObj; 1112 QDir dirObj;
1114 if ( dirObj.mkdir(baseEncoded) != true ) 1113 if ( dirObj.mkdir(baseEncoded) != true )
1115 { 1114 {
1116 //US perror("trying to create local folder"); 1115 //US perror("trying to create local folder");
1117 return false; // Couldn't create it :-( 1116 return false; // Couldn't create it :-(
1118 } 1117 }
1119 } 1118 }
1120 i = pos + 1; 1119 i = pos + 1;
1121 } 1120 }
1122 return true; 1121 return true;
1123#endif 1122#endif
1124 1123
1125 // ******************************************** 1124 // ********************************************
1126 // new code for WIN32 1125 // new code for WIN32
1127 QDir dirObj; 1126 QDir dirObj;
1128 1127
1129 1128
1130 // we want an absolute path 1129 // we want an absolute path
1131#ifndef _WIN32_ 1130#ifndef _WIN32_
1132 if (dir.at(0) != '/') 1131 if (dir.at(0) != '/')
1133 return false; 1132 return false;
1134#endif 1133#endif
1135 1134
1136 QString target = dir; 1135 QString target = dir;
1137 uint len = target.length(); 1136 uint len = target.length();
1138#ifndef _WIN32_ 1137#ifndef _WIN32_
1139 // append trailing slash if missing 1138 // append trailing slash if missing
1140 if (dir.at(len - 1) != '/') 1139 if (dir.at(len - 1) != '/')
1141 target += '/'; 1140 target += '/';
1142#endif 1141#endif
1143 1142
1144 QString base(""); 1143 QString base("");
1145 uint i = 1; 1144 uint i = 1;
1146 1145
1147 while( i < len ) 1146 while( i < len )
1148 { 1147 {
1149//US struct stat st; 1148//US struct stat st;
1150#ifndef _WIN32_ 1149#ifndef _WIN32_
1151 int pos = target.find('/', i); 1150 int pos = target.find('/', i);
1152#else 1151#else
1153 int pos = target.find('\\', i); 1152 int pos = target.find('\\', i);
1154#endif 1153#endif
1155 if ( pos < 0 ) 1154 if ( pos < 0 )
1156 return true; 1155 return true;
1157 base += target.mid(i - 1, pos - i + 1); 1156 base += target.mid(i - 1, pos - i + 1);
1158 //QMessageBox::information( 0,"cap111", base, 1 ); 1157 //QMessageBox::information( 0,"cap111", base, 1 );
1159/*US 1158/*US
1160 QCString baseEncoded = QFile::encodeName(base); 1159 QCString baseEncoded = QFile::encodeName(base);
1161 // bail out if we encountered a problem 1160 // bail out if we encountered a problem
1162 if (stat(baseEncoded, &st) != 0) 1161 if (stat(baseEncoded, &st) != 0)
1163 { 1162 {
1164 // Directory does not exist.... 1163 // Directory does not exist....
1165 // Or maybe a dangling symlink ? 1164 // Or maybe a dangling symlink ?
1166 if (lstat(baseEncoded, &st) == 0) 1165 if (lstat(baseEncoded, &st) == 0)
1167 (void)unlink(baseEncoded); // try removing 1166 (void)unlink(baseEncoded); // try removing
1168 1167
1169 1168
1170 if ( mkdir(baseEncoded, (mode_t) mode) != 0) { 1169 if ( mkdir(baseEncoded, (mode_t) mode) != 0) {
1171 perror("trying to create local folder"); 1170 perror("trying to create local folder");
1172 return false; // Couldn't create it :-( 1171 return false; // Couldn't create it :-(
1173 } 1172 }
1174 } 1173 }
1175*/ 1174*/
1176 1175
1177 if (dirObj.exists(base) == false) 1176 if (dirObj.exists(base) == false)
1178 { 1177 {
1179 //qDebug("KStandardDirs::makeDir try to create : %s" , base.latin1()); 1178 //qDebug("KStandardDirs::makeDir try to create : %s" , base.latin1());
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
1193static QString readEnvPath(const char *env) 1192static 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
1205void KStandardDirs::addKDEDefaults() 1204void 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 {
1277 localKdeDir = KShell::tildeExpand(localKdeDir); 1276 localKdeDir = KShell::tildeExpand(localKdeDir);
1278 addPrefix(localKdeDir); 1277 addPrefix(localKdeDir);
1279 } 1278 }
1280 1279
1281 for (QStringList::ConstIterator it = kdedirList.begin(); 1280 for (QStringList::ConstIterator it = kdedirList.begin();
1282 it != kdedirList.end(); it++) 1281 it != kdedirList.end(); it++)
1283 { 1282 {
1284 QString dir = KShell::tildeExpand(*it); 1283 QString dir = KShell::tildeExpand(*it);
1285 addPrefix(dir); 1284 addPrefix(dir);
1286 } 1285 }
1287 // end KDEDIRS 1286 // end KDEDIRS
1288 1287
1289 // begin XDG_CONFIG_XXX 1288 // begin XDG_CONFIG_XXX
1290 QStringList xdgdirList; 1289 QStringList xdgdirList;
1291 QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS"); 1290 QString xdgdirs = readEnvPath("XDG_CONFIG_DIRS");
1292 if (!xdgdirs.isEmpty()) 1291 if (!xdgdirs.isEmpty())
1293 { 1292 {
1294 tokenize(xdgdirList, xdgdirs, ":"); 1293 tokenize(xdgdirList, xdgdirs, ":");
1295 } 1294 }
1296 else 1295 else
1297 { 1296 {
1298 xdgdirList.clear(); 1297 xdgdirList.clear();
1299 xdgdirList.append("/etc/xdg"); 1298 xdgdirList.append("/etc/xdg");
1300 } 1299 }
1301 1300
1302 QString localXdgDir = readEnvPath("XDG_CONFIG_HOME"); 1301 QString localXdgDir = readEnvPath("XDG_CONFIG_HOME");
1303 if (!localXdgDir.isEmpty()) 1302 if (!localXdgDir.isEmpty())
1304 { 1303 {
1305 if (localXdgDir.at(localXdgDir.length()-1) != '/') 1304 if (localXdgDir.at(localXdgDir.length()-1) != '/')
1306 localXdgDir += '/'; 1305 localXdgDir += '/';
1307 } 1306 }
1308 else 1307 else
1309 { 1308 {
1310//US if (getuid()) 1309//US if (getuid())
1311 if (true) 1310 if (true)
1312 { 1311 {
1313 localXdgDir = QDir::homeDirPath() + "/.config/"; 1312 localXdgDir = QDir::homeDirPath() + "/.config/";
1314 } 1313 }
1315 else 1314 else
1316 { 1315 {
1317//US struct passwd *pw = getpwuid(0); 1316//US struct passwd *pw = getpwuid(0);
1318//US localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.config/"; 1317//US localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.config/";
1319 qDebug("KStandardDirs::addKDEDefaults: 2 has to be fixed"); 1318 qDebug("KStandardDirs::addKDEDefaults: 2 has to be fixed");
1320 } 1319 }
1321 } 1320 }
1322 1321
1323 localXdgDir = KShell::tildeExpand(localXdgDir); 1322 localXdgDir = KShell::tildeExpand(localXdgDir);
1324 addXdgConfigPrefix(localXdgDir); 1323 addXdgConfigPrefix(localXdgDir);
1325 1324
1326 for (QStringList::ConstIterator it = xdgdirList.begin(); 1325 for (QStringList::ConstIterator it = xdgdirList.begin();
1327 it != xdgdirList.end(); it++) 1326 it != xdgdirList.end(); it++)
1328 { 1327 {
1329 QString dir = KShell::tildeExpand(*it); 1328 QString dir = KShell::tildeExpand(*it);
1330 addXdgConfigPrefix(dir); 1329 addXdgConfigPrefix(dir);
1331 } 1330 }
1332 // end XDG_CONFIG_XXX 1331 // end XDG_CONFIG_XXX
1333 1332
1334 // begin XDG_DATA_XXX 1333 // begin XDG_DATA_XXX
1335 xdgdirs = readEnvPath("XDG_DATA_DIRS"); 1334 xdgdirs = readEnvPath("XDG_DATA_DIRS");
1336 if (!xdgdirs.isEmpty()) 1335 if (!xdgdirs.isEmpty())
1337 { 1336 {
1338 tokenize(xdgdirList, xdgdirs, ":"); 1337 tokenize(xdgdirList, xdgdirs, ":");
1339 } 1338 }
1340 else 1339 else
1341 { 1340 {
1342 xdgdirList.clear(); 1341 xdgdirList.clear();
1343 for (QStringList::ConstIterator it = kdedirList.begin(); 1342 for (QStringList::ConstIterator it = kdedirList.begin();
1344 it != kdedirList.end(); it++) 1343 it != kdedirList.end(); it++)
1345 { 1344 {
1346 QString dir = *it; 1345 QString dir = *it;
1347 if (dir.at(dir.length()-1) != '/') 1346 if (dir.at(dir.length()-1) != '/')
1348 dir += '/'; 1347 dir += '/';
1349 xdgdirList.append(dir+"share/"); 1348 xdgdirList.append(dir+"share/");
1350 } 1349 }
1351 1350
1352 xdgdirList.append("/usr/local/share/"); 1351 xdgdirList.append("/usr/local/share/");
1353 xdgdirList.append("/usr/share/"); 1352 xdgdirList.append("/usr/share/");
1354 } 1353 }
1355 1354
1356 localXdgDir = readEnvPath("XDG_DATA_HOME"); 1355 localXdgDir = readEnvPath("XDG_DATA_HOME");
1357 if (!localXdgDir.isEmpty()) 1356 if (!localXdgDir.isEmpty())
1358 { 1357 {
1359 if (localXdgDir.at(localXdgDir.length()-1) != '/') 1358 if (localXdgDir.at(localXdgDir.length()-1) != '/')
1360 localXdgDir += '/'; 1359 localXdgDir += '/';
1361 } 1360 }
1362 else 1361 else
1363 { 1362 {
1364//US if (getuid()) 1363//US if (getuid())
1365 if (true) 1364 if (true)
1366 { 1365 {
1367 localXdgDir = QDir::homeDirPath() + "/.local/share/"; 1366 localXdgDir = QDir::homeDirPath() + "/.local/share/";
1368 } 1367 }
1369 else 1368 else
1370 { 1369 {
1371//US struct passwd *pw = getpwuid(0); 1370//US struct passwd *pw = getpwuid(0);
1372//US localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.local/share/"; 1371//US localXdgDir = QFile::decodeName((pw && pw->pw_dir) ? pw->pw_dir : "/root") + "/.local/share/";
1373 qDebug("KStandardDirs::addKDEDefaults: 3 has to be fixed"); 1372 qDebug("KStandardDirs::addKDEDefaults: 3 has to be fixed");
1374 } 1373 }
1375 } 1374 }
1376 1375
1377 localXdgDir = KShell::tildeExpand(localXdgDir); 1376 localXdgDir = KShell::tildeExpand(localXdgDir);
1378 addXdgDataPrefix(localXdgDir); 1377 addXdgDataPrefix(localXdgDir);
1379 1378
1380 for (QStringList::ConstIterator it = xdgdirList.begin(); 1379 for (QStringList::ConstIterator it = xdgdirList.begin();
1381 it != xdgdirList.end(); it++) 1380 it != xdgdirList.end(); it++)
1382 { 1381 {
1383 QString dir = KShell::tildeExpand(*it); 1382 QString dir = KShell::tildeExpand(*it);
1384 1383
1385 addXdgDataPrefix(dir); 1384 addXdgDataPrefix(dir);
1386 } 1385 }
1387 // end XDG_DATA_XXX 1386 // end XDG_DATA_XXX
1388 1387
1389 1388
1390 uint index = 0; 1389 uint index = 0;
1391 while (types[index] != 0) { 1390 while (types[index] != 0) {
1392 addResourceType(types[index], kde_default(types[index])); 1391 addResourceType(types[index], kde_default(types[index]));
1393 index++; 1392 index++;
1394 } 1393 }
1395 1394
1396 addResourceDir("home", QDir::homeDirPath()); 1395 addResourceDir("home", QDir::homeDirPath());
1397} 1396}
1398 1397
1399void KStandardDirs::checkConfig() const 1398void KStandardDirs::checkConfig() const
1400{ 1399{
1401/*US 1400/*US
1402 if (!addedCustoms && KGlobal::_instance && KGlobal::_instance->_config) 1401 if (!addedCustoms && KGlobal::_instance && KGlobal::_instance->_config)
1403 const_cast<KStandardDirs*>(this)->addCustomized(KGlobal::_instance->_config); 1402 const_cast<KStandardDirs*>(this)->addCustomized(KGlobal::_instance->_config);
1404*/ 1403*/
1405 if (!addedCustoms && KGlobal::config()) 1404 if (!addedCustoms && KGlobal::config())
1406 const_cast<KStandardDirs*>(this)->addCustomized(KGlobal::config()); 1405 const_cast<KStandardDirs*>(this)->addCustomized(KGlobal::config());
1407} 1406}
1408 1407
1409bool KStandardDirs::addCustomized(KConfig *config) 1408bool KStandardDirs::addCustomized(KConfig *config)
1410{ 1409{
1411 if (addedCustoms) // there are already customized entries 1410 if (addedCustoms) // there are already customized entries
1412 return false; // we just quite and hope they are the right ones 1411 return false; // we just quite and hope they are the right ones
1413 1412
1414 // save the numbers of config directories. If this changes, 1413 // save the numbers of config directories. If this changes,
1415 // we will return true to give KConfig a chance to reparse 1414 // we will return true to give KConfig a chance to reparse
1416 uint configdirs = resourceDirs("config").count(); 1415 uint configdirs = resourceDirs("config").count();
1417 1416
1418 // reading the prefixes in 1417 // reading the prefixes in
1419 QString oldGroup = config->group(); 1418 QString oldGroup = config->group();
1420 config->setGroup("Directories"); 1419 config->setGroup("Directories");
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
@@ -835,385 +835,385 @@ void KToolBar::hideItem (int id)
835 835
836 836
837void KToolBar::showItem (int id) 837void KToolBar::showItem (int id)
838{ 838{
839 QWidget *w = getWidget(id); 839 QWidget *w = getWidget(id);
840 if ( w ) 840 if ( w )
841 w->show(); 841 w->show();
842} 842}
843 843
844 844
845int KToolBar::itemIndex (int id) 845int KToolBar::itemIndex (int id)
846{ 846{
847 QWidget *w = getWidget(id); 847 QWidget *w = getWidget(id);
848 return w ? widgets.findRef(w) : -1; 848 return w ? widgets.findRef(w) : -1;
849} 849}
850 850
851 851
852void KToolBar::setFullSize(bool flag ) 852void KToolBar::setFullSize(bool flag )
853{ 853{
854 setHorizontalStretchable( flag ); 854 setHorizontalStretchable( flag );
855 setVerticalStretchable( flag ); 855 setVerticalStretchable( flag );
856} 856}
857 857
858 858
859bool KToolBar::fullSize() const 859bool KToolBar::fullSize() const
860{ 860{
861 return isHorizontalStretchable() || isVerticalStretchable(); 861 return isHorizontalStretchable() || isVerticalStretchable();
862} 862}
863 863
864 864
865void KToolBar::enableMoving(bool flag ) 865void KToolBar::enableMoving(bool flag )
866{ 866{
867//US setMovingEnabled(flag); 867//US setMovingEnabled(flag);
868 this->mainWindow()->setToolBarsMovable(flag); 868 this->mainWindow()->setToolBarsMovable(flag);
869} 869}
870 870
871 871
872void KToolBar::setBarPos (BarPosition bpos) 872void KToolBar::setBarPos (BarPosition bpos)
873{ 873{
874 if ( !mainWindow() ) 874 if ( !mainWindow() )
875 return; 875 return;
876//US mainWindow()->moveDockWindow( this, (Dock)bpos ); 876//US mainWindow()->moveDockWindow( this, (Dock)bpos );
877 mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos ); 877 mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos );
878} 878}
879 879
880 880
881KToolBar::BarPosition KToolBar::barPos() 881KToolBar::BarPosition KToolBar::barPos()
882{ 882{
883 if ( !(QMainWindow*)mainWindow() ) 883 if ( !(QMainWindow*)mainWindow() )
884 return KToolBar::Top; 884 return KToolBar::Top;
885//US Dock dock; 885//US Dock dock;
886 QMainWindow::ToolBarDock dock; 886 QMainWindow::ToolBarDock dock;
887 int dm1, dm2; 887 int dm1, dm2;
888 bool dm3; 888 bool dm3;
889 ((QMainWindow*)mainWindow())->getLocation( (QToolBar*)this, dock, dm1, dm3, dm2 ); 889 ((QMainWindow*)mainWindow())->getLocation( (QToolBar*)this, dock, dm1, dm3, dm2 );
890//US if ( dock == DockUnmanaged ) { 890//US if ( dock == DockUnmanaged ) {
891 if ( dock == QMainWindow::Unmanaged ) { 891 if ( dock == QMainWindow::Unmanaged ) {
892 return (KToolBar::BarPosition)Top; 892 return (KToolBar::BarPosition)Top;
893 } 893 }
894 return (BarPosition)dock; 894 return (BarPosition)dock;
895} 895}
896 896
897 897
898bool KToolBar::enable(BarStatus stat) 898bool KToolBar::enable(BarStatus stat)
899{ 899{
900 bool mystat = isVisible(); 900 bool mystat = isVisible();
901 901
902 if ( (stat == Toggle && mystat) || stat == Hide ) 902 if ( (stat == Toggle && mystat) || stat == Hide )
903 hide(); 903 hide();
904 else 904 else
905 show(); 905 show();
906 906
907 return isVisible() == mystat; 907 return isVisible() == mystat;
908} 908}
909 909
910 910
911void KToolBar::setMaxHeight ( int h ) 911void KToolBar::setMaxHeight ( int h )
912{ 912{
913 setMaximumHeight( h ); 913 setMaximumHeight( h );
914} 914}
915 915
916int KToolBar::maxHeight() 916int KToolBar::maxHeight()
917{ 917{
918 return maximumHeight(); 918 return maximumHeight();
919} 919}
920 920
921 921
922void KToolBar::setMaxWidth (int dw) 922void KToolBar::setMaxWidth (int dw)
923{ 923{
924 setMaximumWidth( dw ); 924 setMaximumWidth( dw );
925} 925}
926 926
927 927
928int KToolBar::maxWidth() 928int KToolBar::maxWidth()
929{ 929{
930 return maximumWidth(); 930 return maximumWidth();
931} 931}
932 932
933 933
934void KToolBar::setTitle (const QString& _title) 934void KToolBar::setTitle (const QString& _title)
935{ 935{
936 setLabel( _title ); 936 setLabel( _title );
937} 937}
938 938
939 939
940void KToolBar::enableFloating (bool ) 940void KToolBar::enableFloating (bool )
941{ 941{
942} 942}
943 943
944 944
945void KToolBar::setIconText(IconText it) 945void KToolBar::setIconText(IconText it)
946{ 946{
947 setIconText( it, true ); 947 setIconText( it, true );
948} 948}
949 949
950 950
951void KToolBar::setIconText(IconText icontext, bool update) 951void KToolBar::setIconText(IconText icontext, bool update)
952{ 952{
953 bool doUpdate=false; 953 bool doUpdate=false;
954 954
955 if (icontext != d->m_iconText) { 955 if (icontext != d->m_iconText) {
956 d->m_iconText = icontext; 956 d->m_iconText = icontext;
957 doUpdate=true; 957 doUpdate=true;
958 } 958 }
959 959
960 if (update == false) 960 if (update == false)
961 return; 961 return;
962 962
963 if (doUpdate) 963 if (doUpdate)
964 emit modechange(); // tell buttons what happened 964 emit modechange(); // tell buttons what happened
965 965
966 // ugly hack to force a QMainWindow::triggerLayout( TRUE ) 966 // ugly hack to force a QMainWindow::triggerLayout( TRUE )
967 if ( mainWindow() ) { 967 if ( mainWindow() ) {
968 QMainWindow *mw = mainWindow(); 968 QMainWindow *mw = mainWindow();
969 mw->setUpdatesEnabled( FALSE ); 969 mw->setUpdatesEnabled( FALSE );
970 mw->setToolBarsMovable( !mw->toolBarsMovable() ); 970 mw->setToolBarsMovable( !mw->toolBarsMovable() );
971 mw->setToolBarsMovable( !mw->toolBarsMovable() ); 971 mw->setToolBarsMovable( !mw->toolBarsMovable() );
972 mw->setUpdatesEnabled( TRUE ); 972 mw->setUpdatesEnabled( TRUE );
973 } 973 }
974} 974}
975 975
976 976
977KToolBar::IconText KToolBar::iconText() const 977KToolBar::IconText KToolBar::iconText() const
978{ 978{
979 return d->m_iconText; 979 return d->m_iconText;
980} 980}
981 981
982 982
983void KToolBar::setIconSize(int size) 983void KToolBar::setIconSize(int size)
984{ 984{
985 setIconSize( size, true ); 985 setIconSize( size, true );
986} 986}
987 987
988void KToolBar::setIconSize(int size, bool update) 988void 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
1014int KToolBar::iconSize() const 1014int 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
1033void KToolBar::setEnableContextMenu(bool enable ) 1033void KToolBar::setEnableContextMenu(bool enable )
1034{ 1034{
1035 d->m_enableContext = enable; 1035 d->m_enableContext = enable;
1036} 1036}
1037 1037
1038 1038
1039bool KToolBar::contextMenuEnabled() const 1039bool KToolBar::contextMenuEnabled() const
1040{ 1040{
1041 return d->m_enableContext; 1041 return d->m_enableContext;
1042} 1042}
1043 1043
1044 1044
1045void KToolBar::setItemNoStyle(int id, bool no_style ) 1045void 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
1057void KToolBar::setFlat (bool flag) 1057void 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
1075int KToolBar::count() const 1075int KToolBar::count() const
1076{ 1076{
1077 return id2widget.count(); 1077 return id2widget.count();
1078} 1078}
1079 1079
1080 1080
1081void KToolBar::saveState() 1081void KToolBar::saveState()
1082{ 1082{
1083/*US 1083/*US
1084 // first, try to save to the xml file 1084 // first, try to save to the xml file
1085 if ( d->m_xmlguiClient && !d->m_xmlguiClient->xmlFile().isEmpty() ) { 1085 if ( d->m_xmlguiClient && !d->m_xmlguiClient->xmlFile().isEmpty() ) {
1086 // go down one level to get to the right tags 1086 // go down one level to get to the right tags
1087 QDomElement elem = d->m_xmlguiClient->domDocument().documentElement().toElement(); 1087 QDomElement elem = d->m_xmlguiClient->domDocument().documentElement().toElement();
1088 elem = elem.firstChild().toElement(); 1088 elem = elem.firstChild().toElement();
1089 QString barname(!::qstrcmp(name(), "unnamed") ? "mainToolBar" : name()); 1089 QString barname(!::qstrcmp(name(), "unnamed") ? "mainToolBar" : name());
1090 QDomElement current; 1090 QDomElement current;
1091 // now try to find our toolbar 1091 // now try to find our toolbar
1092 d->modified = false; 1092 d->modified = false;
1093 for( ; !elem.isNull(); elem = elem.nextSibling().toElement() ) { 1093 for( ; !elem.isNull(); elem = elem.nextSibling().toElement() ) {
1094 current = elem; 1094 current = elem;
1095 1095
1096 if ( current.tagName().lower() != "toolbar" ) 1096 if ( current.tagName().lower() != "toolbar" )
1097 continue; 1097 continue;
1098 1098
1099 QString curname(current.attribute( "name" )); 1099 QString curname(current.attribute( "name" ));
1100 1100
1101 if ( curname == barname ) { 1101 if ( curname == barname ) {
1102 saveState( current ); 1102 saveState( current );
1103 break; 1103 break;
1104 } 1104 }
1105 } 1105 }
1106 // if we didn't make changes, then just return 1106 // if we didn't make changes, then just return
1107 if ( !d->modified ) 1107 if ( !d->modified )
1108 return; 1108 return;
1109 1109
1110 // now we load in the (non-merged) local file 1110 // now we load in the (non-merged) local file
1111 QString local_xml(KXMLGUIFactory::readConfigFile(d->m_xmlguiClient->xmlFile(), true, d->m_xmlguiClient->instance())); 1111 QString local_xml(KXMLGUIFactory::readConfigFile(d->m_xmlguiClient->xmlFile(), true, d->m_xmlguiClient->instance()));
1112 QDomDocument local; 1112 QDomDocument local;
1113 local.setContent(local_xml); 1113 local.setContent(local_xml);
1114 1114
1115 // make sure we don't append if this toolbar already exists locally 1115 // make sure we don't append if this toolbar already exists locally
1116 bool just_append = true; 1116 bool just_append = true;
1117 elem = local.documentElement().toElement(); 1117 elem = local.documentElement().toElement();
1118 KXMLGUIFactory::removeDOMComments( elem ); 1118 KXMLGUIFactory::removeDOMComments( elem );
1119 elem = elem.firstChild().toElement(); 1119 elem = elem.firstChild().toElement();
1120 for( ; !elem.isNull(); elem = elem.nextSibling().toElement() ) { 1120 for( ; !elem.isNull(); elem = elem.nextSibling().toElement() ) {
1121 if ( elem.tagName().lower() != "toolbar" ) 1121 if ( elem.tagName().lower() != "toolbar" )
1122 continue; 1122 continue;
1123 1123
1124 QString curname(elem.attribute( "name" )); 1124 QString curname(elem.attribute( "name" ));
1125 1125
1126 if ( curname == barname ) { 1126 if ( curname == barname ) {
1127 just_append = false; 1127 just_append = false;
1128 local.documentElement().replaceChild( current, elem ); 1128 local.documentElement().replaceChild( current, elem );
1129 break; 1129 break;
1130 } 1130 }
1131 } 1131 }
1132 1132
1133 if (just_append) 1133 if (just_append)
1134 local.documentElement().appendChild( current ); 1134 local.documentElement().appendChild( current );
1135 1135
1136 KXMLGUIFactory::saveConfigFile(local, d->m_xmlguiClient->localXMLFile(), d->m_xmlguiClient->instance() ); 1136 KXMLGUIFactory::saveConfigFile(local, d->m_xmlguiClient->localXMLFile(), d->m_xmlguiClient->instance() );
1137 1137
1138 return; 1138 return;
1139 } 1139 }
1140*/ 1140*/
1141 // if that didn't work, we save to the config file 1141 // if that didn't work, we save to the config file
1142 KConfig *config = KGlobal::config(); 1142 KConfig *config = KGlobal::config();
1143 saveSettings(config, QString::null); 1143 saveSettings(config, QString::null);
1144 config->sync(); 1144 config->sync();
1145} 1145}
1146 1146
1147QString KToolBar::settingsGroup() 1147QString KToolBar::settingsGroup()
1148{ 1148{
1149 QString configGroup; 1149 QString configGroup;
1150 if (!::qstrcmp(name(), "unnamed") || !::qstrcmp(name(), "mainToolBar")) 1150 if (!::qstrcmp(name(), "unnamed") || !::qstrcmp(name(), "mainToolBar"))
1151 configGroup = "Toolbar style"; 1151 configGroup = "Toolbar style";
1152 else 1152 else
1153 configGroup = QString(name()) + " Toolbar style"; 1153 configGroup = QString(name()) + " Toolbar style";
1154 if ( this->mainWindow() ) 1154 if ( this->mainWindow() )
1155 { 1155 {
1156 configGroup.prepend(" "); 1156 configGroup.prepend(" ");
1157 configGroup.prepend( this->mainWindow()->name() ); 1157 configGroup.prepend( this->mainWindow()->name() );
1158 } 1158 }
1159 return configGroup; 1159 return configGroup;
1160} 1160}
1161 1161
1162void KToolBar::saveSettings(KConfig *config, const QString &_configGroup) 1162void KToolBar::saveSettings(KConfig *config, const QString &_configGroup)
1163{ 1163{
1164 QString configGroup = _configGroup; 1164 QString configGroup = _configGroup;
1165 if (configGroup.isEmpty()) 1165 if (configGroup.isEmpty())
1166 configGroup = settingsGroup(); 1166 configGroup = settingsGroup();
1167 //kdDebug(220) << "KToolBar::saveSettings group=" << _configGroup << " -> " << configGroup << endl; 1167 //kdDebug(220) << "KToolBar::saveSettings group=" << _configGroup << " -> " << configGroup << endl;
1168 1168
1169 QString position, icontext; 1169 QString position, icontext;
1170 int index; 1170 int index;
1171 getAttributes( position, icontext, index ); 1171 getAttributes( position, icontext, index );
1172 1172
1173 //kdDebug(220) << "KToolBar::saveSettings " << name() << " newLine=" << newLine << endl; 1173 //kdDebug(220) << "KToolBar::saveSettings " << name() << " newLine=" << newLine << endl;
1174 1174
1175 KConfigGroupSaver saver(config, configGroup); 1175 KConfigGroupSaver saver(config, configGroup);
1176 1176
1177 if ( position != d->PositionDefault ) 1177 if ( position != d->PositionDefault )
1178 config->writeEntry("Position", position); 1178 config->writeEntry("Position", position);
1179 else 1179 else
1180 config->deleteEntry("Position"); 1180 config->deleteEntry("Position");
1181 1181
1182 if ( icontext != d->IconTextDefault ) 1182 if ( icontext != d->IconTextDefault )
1183 config->writeEntry("IconText", icontext); 1183 config->writeEntry("IconText", icontext);
1184 else 1184 else
1185 config->deleteEntry("IconText"); 1185 config->deleteEntry("IconText");
1186 1186
1187 if ( iconSize() != d->IconSizeDefault ) 1187 if ( iconSize() != d->IconSizeDefault )
1188 config->writeEntry("IconSize", iconSize()); 1188 config->writeEntry("IconSize", iconSize());
1189 else 1189 else
1190 config->deleteEntry("IconSize"); 1190 config->deleteEntry("IconSize");
1191 1191
1192 if ( isHidden() != d->HiddenDefault ) 1192 if ( isHidden() != d->HiddenDefault )
1193 config->writeEntry("Hidden", isHidden()); 1193 config->writeEntry("Hidden", isHidden());
1194 else 1194 else
1195 config->deleteEntry("Hidden"); 1195 config->deleteEntry("Hidden");
1196 1196
1197 if ( index != d->IndexDefault ) 1197 if ( index != d->IndexDefault )
1198 config->writeEntry( "Index", index ); 1198 config->writeEntry( "Index", index );
1199 else 1199 else
1200 config->deleteEntry("Index"); 1200 config->deleteEntry("Index");
1201//US the older version of KDE (used on the Zaurus) has no Offset property 1201//US the older version of KDE (used on the Zaurus) has no Offset property
1202/* if ( offset() != d->OffsetDefault ) 1202/* if ( offset() != d->OffsetDefault )
1203 config->writeEntry( "Offset", offset() ); 1203 config->writeEntry( "Offset", offset() );
1204 else 1204 else
1205*/ 1205*/
1206 config->deleteEntry("Offset"); 1206 config->deleteEntry("Offset");
1207 1207
1208//US the older version of KDE (used on the Zaurus) has no NewLine property 1208//US the older version of KDE (used on the Zaurus) has no NewLine property
1209/* 1209/*
1210 if ( newLine() != d->NewLineDefault ) 1210 if ( newLine() != d->NewLineDefault )
1211 config->writeEntry( "NewLine", newLine() ); 1211 config->writeEntry( "NewLine", newLine() );
1212 else 1212 else
1213*/ 1213*/
1214 config->deleteEntry("NewLine"); 1214 config->deleteEntry("NewLine");
1215} 1215}
1216 1216
1217void KToolBar::setXMLGUIClient( KXMLGUIClient *client ) 1217void KToolBar::setXMLGUIClient( KXMLGUIClient *client )
1218{ 1218{
1219 d->m_xmlguiClient = client; 1219 d->m_xmlguiClient = client;
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,222 +1,223 @@
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
36using namespace KRES; 37using namespace KRES;
37 38
38QDict<Factory> *Factory::mSelves = 0; 39QDict<Factory> *Factory::mSelves = 0;
39static KStaticDeleter< QDict<Factory> > staticDeleter; 40static KStaticDeleter< QDict<Factory> > staticDeleter;
40 41
41Factory *Factory::self( const QString& resourceFamily ) 42Factory *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
61Factory::Factory( const QString& resourceFamily ) : 62Factory::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
79 PluginInfo* info = new PluginInfo; 80 PluginInfo* info = new PluginInfo;
80 info->library = "microkabc_file"; 81 info->library = "microkabc_file";
81 info->nameLabel = i18n( "file" ); 82 info->nameLabel = i18n( "file" );
82 info->descriptionLabel = i18n( "Choose one file" ); 83 info->descriptionLabel = i18n( "Choose one file" );
83 mTypeMap.insert( "file", info ); 84 mTypeMap.insert( "file", info );
84 85
85 info = new PluginInfo; 86 info = new PluginInfo;
86 info->library = "microkabc_dir"; 87 info->library = "microkabc_dir";
87 info->nameLabel = i18n( "dir" ); 88 info->nameLabel = i18n( "dir" );
88 info->descriptionLabel = i18n( "Choose a directory with may files" ); 89 info->descriptionLabel = i18n( "Choose a directory with may files" );
89 mTypeMap.insert( "dir", info ); 90 mTypeMap.insert( "dir", info );
90 91
91 info = new PluginInfo; 92 info = new PluginInfo;
92 info->library = "microkabc_ldap"; 93 info->library = "microkabc_ldap";
93 info->nameLabel = i18n( "ldap" ); 94 info->nameLabel = i18n( "ldap" );
94 info->descriptionLabel = i18n( "No description available" ); 95 info->descriptionLabel = i18n( "No description available" );
95 mTypeMap.insert( "ldap", info ); 96 mTypeMap.insert( "ldap", info );
96 97
97 //US add opie plugin only, if the library exists 98 //US add opie plugin only, if the library exists
98 QString libname = "microkabc_opie"; 99 QString libname = "microkabc_opie";
99 QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); 100 QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) );
100 if ( !path.isEmpty() ) 101 if ( !path.isEmpty() )
101 { 102 {
102 info = new PluginInfo; 103 info = new PluginInfo;
103 info->library = libname; 104 info->library = libname;
104 info->nameLabel = i18n( "opie" ); 105 info->nameLabel = i18n( "opie" );
105 info->descriptionLabel = i18n( "Opie PIM Addressbook." ); 106 info->descriptionLabel = i18n( "Opie PIM Addressbook." );
106 mTypeMap.insert( "opie", info ); 107 mTypeMap.insert( "opie", info );
107 } 108 }
108 109
109 //US add qtopia plugin only, if the library exists 110 //US add qtopia plugin only, if the library exists
110 libname = "microkabc_qtopia"; 111 libname = "microkabc_qtopia";
111 path = KLibLoader::findLibrary( QFile::encodeName( libname ) ); 112 path = KLibLoader::findLibrary( QFile::encodeName( libname ) );
112 if ( !path.isEmpty() ) 113 if ( !path.isEmpty() )
113 { 114 {
114 info = new PluginInfo; 115 info = new PluginInfo;
115 info->library = libname; 116 info->library = libname;
116 info->nameLabel = i18n( "qtopia" ); 117 info->nameLabel = i18n( "qtopia" );
117 info->descriptionLabel = i18n( "Qtopia PIM Addressbook." ); 118 info->descriptionLabel = i18n( "Qtopia PIM Addressbook." );
118 mTypeMap.insert( "qtopia", info ); 119 mTypeMap.insert( "qtopia", info );
119 } 120 }
120 121
121 122
122} 123}
123 124
124Factory::~Factory() 125Factory::~Factory()
125{ 126{
126} 127}
127 128
128QStringList Factory::typeNames() const 129QStringList Factory::typeNames() const
129{ 130{
130//US method QMap::keys() not available yet. SO collect the data manually 131//US method QMap::keys() not available yet. SO collect the data manually
131//US return mTypeMap.keys(); 132//US return mTypeMap.keys();
132 133
133 QStringList result; 134 QStringList result;
134 135
135 QMap<QString, PluginInfo*>::ConstIterator it; 136 QMap<QString, PluginInfo*>::ConstIterator it;
136 for( it = mTypeMap.begin(); it != mTypeMap.end(); ++it ) { 137 for( it = mTypeMap.begin(); it != mTypeMap.end(); ++it ) {
137 result << it.key().latin1(); 138 result << it.key().latin1();
138// qDebug("Factory::typeNames() : %s ", it.key().latin1()); 139// qDebug("Factory::typeNames() : %s ", it.key().latin1());
139 140
140 } 141 }
141 return result; 142 return result;
142} 143}
143 144
144ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent ) 145ConfigWidget *Factory::configWidget( const QString& type, QWidget *parent )
145{ 146{
146 if ( type.isEmpty() || !mTypeMap.contains( type ) ) 147 if ( type.isEmpty() || !mTypeMap.contains( type ) )
147 return 0; 148 return 0;
148 149
149//US KService::Ptr ptr = mTypeMap[ type ]; 150//US KService::Ptr ptr = mTypeMap[ type ];
150//US KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() ); 151//US KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() );
151 PluginInfo* pi = mTypeMap[ type ]; 152 PluginInfo* pi = mTypeMap[ type ];
152 KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() ); 153 KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() );
153 if ( !factory ) { 154 if ( !factory ) {
154 qDebug("KRES::Factory::configWidget(): Factory creation failed for library %s", pi->library.latin1()); 155 qDebug("KRES::Factory::configWidget(): Factory creation failed for library %s", pi->library.latin1());
155 kdDebug() << "KRES::Factory::configWidget(): Factory creation failed" << endl; 156 kdDebug() << "KRES::Factory::configWidget(): Factory creation failed" << endl;
156 return 0; 157 return 0;
157 } 158 }
158 159
159 PluginFactoryBase *pluginFactory = static_cast<PluginFactoryBase *>( factory ); 160 PluginFactoryBase *pluginFactory = static_cast<PluginFactoryBase *>( factory );
160 161
161 if ( !pluginFactory ) { 162 if ( !pluginFactory ) {
162 qDebug("KRES::Factory::configWidget(): no plugin factory for library %s", pi->library.latin1()); 163 qDebug("KRES::Factory::configWidget(): no plugin factory for library %s", pi->library.latin1());
163 kdDebug() << "KRES::Factory::configWidget(): no plugin factory." << endl; 164 kdDebug() << "KRES::Factory::configWidget(): no plugin factory." << endl;
164 return 0; 165 return 0;
165 } 166 }
166 167
167 ConfigWidget *wdg = pluginFactory->configWidget( parent ); 168 ConfigWidget *wdg = pluginFactory->configWidget( parent );
168 if ( !wdg ) { 169 if ( !wdg ) {
169//US kdDebug() << "'" << ptr->library() << "' is not a " + mResourceFamily + " plugin." << endl; 170//US kdDebug() << "'" << ptr->library() << "' is not a " + mResourceFamily + " plugin." << endl;
170 qDebug("%s is not a %s plugin.", pi->library.latin1(), mResourceFamily.latin1()); 171 qDebug("%s is not a %s plugin.", pi->library.latin1(), mResourceFamily.latin1());
171 return 0; 172 return 0;
172 } 173 }
173 return wdg; 174 return wdg;
174 175
175} 176}
176 177
177QString Factory::typeName( const QString &type ) const 178QString Factory::typeName( const QString &type ) const
178{ 179{
179 if ( type.isEmpty() || !mTypeMap.contains( type ) ) 180 if ( type.isEmpty() || !mTypeMap.contains( type ) )
180 return QString(); 181 return QString();
181 182
182 183
183//US KService::Ptr ptr = mTypeMap[ type ]; 184//US KService::Ptr ptr = mTypeMap[ type ];
184//US return ptr->name(); 185//US return ptr->name();
185 PluginInfo* pi = mTypeMap[ type ]; 186 PluginInfo* pi = mTypeMap[ type ];
186 return pi->nameLabel; 187 return pi->nameLabel;
187 188
188} 189}
189 190
190QString Factory::typeDescription( const QString &type ) const 191QString Factory::typeDescription( const QString &type ) const
191{ 192{
192 if ( type.isEmpty() || !mTypeMap.contains( type ) ) 193 if ( type.isEmpty() || !mTypeMap.contains( type ) )
193 return QString(); 194 return QString();
194 195
195//US KService::Ptr ptr = mTypeMap[ type ]; 196//US KService::Ptr ptr = mTypeMap[ type ];
196//US return ptr->comment(); 197//US return ptr->comment();
197 PluginInfo* pi = mTypeMap[ type ]; 198 PluginInfo* pi = mTypeMap[ type ];
198 return pi->descriptionLabel; 199 return pi->descriptionLabel;
199} 200}
200 201
201Resource *Factory::resource( const QString& type, const KConfig *config ) 202Resource *Factory::resource( const QString& type, const KConfig *config )
202{ 203{
203 204
204 205
205 if ( type.isEmpty() || !mTypeMap.contains( type ) ) 206 if ( type.isEmpty() || !mTypeMap.contains( type ) )
206 return 0; 207 return 0;
207 208
208/*US load the lib not dynamicly. !! 209/*US load the lib not dynamicly. !!
209 KService::Ptr ptr = mTypeMap[ type ]; 210 KService::Ptr ptr = mTypeMap[ type ];
210 KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() ); 211 KLibFactory *factory = KLibLoader::self()->factory( ptr->library().latin1() );
211 if ( !factory ) { 212 if ( !factory ) {
212 kdDebug() << "KRES::Factory::resource(): Factory creation failed" << endl; 213 kdDebug() << "KRES::Factory::resource(): Factory creation failed" << endl;
213 return 0; 214 return 0;
214 } 215 }
215*/ 216*/
216 PluginInfo* pi = mTypeMap[ type ]; 217 PluginInfo* pi = mTypeMap[ type ];
217 KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() ); 218 KLibFactory *factory = (KLibFactory *)KLibLoader::self()->factory( pi->library.latin1() );
218 if ( !factory ) { 219 if ( !factory ) {
219 qDebug("KRES::Factory::resource(): Factory creation failed for library %s", pi->library.latin1()); 220 qDebug("KRES::Factory::resource(): Factory creation failed for library %s", pi->library.latin1());
220 kdDebug() << "KRES::Factory::resource(): Factory creation failed" << endl; 221 kdDebug() << "KRES::Factory::resource(): Factory creation failed" << endl;
221 return 0; 222 return 0;
222 } 223 }
diff --git a/microkde/microkde.pro b/microkde/microkde.pro
index 1e9b022..05833a9 100644
--- a/microkde/microkde.pro
+++ b/microkde/microkde.pro
@@ -1,170 +1,168 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3#INCLUDEPATH += $(QTDIR)/include . 3#INCLUDEPATH += $(QTDIR)/include .
4#DEPENDPATH += $(QTDIR)/include 4#DEPENDPATH += $(QTDIR)/include
5INCLUDEPATH += . ../ ../kabc ./kdecore ./kdeui ./kio/kfile 5INCLUDEPATH += . ../ ../kabc ./kdecore ./kdeui ./kio/kfile
6#LIBS += -lqtcompat 6#LIBS += -lqtcompat
7 7
8 TARGET = microkde 8 TARGET = microkde
9DESTDIR= ../bin 9DESTDIR= ../bin
10DEFINES += DESKTOP_VERSION KDE_QT_ONLY 10DEFINES += DESKTOP_VERSION KDE_QT_ONLY
11unix : { 11unix : {
12OBJECTS_DIR = obj/unix 12OBJECTS_DIR = obj/unix
13MOC_DIR = moc/unix 13MOC_DIR = moc/unix
14} 14}
15win32: { 15win32: {
16DEFINES += _WIN32_ 16DEFINES += _WIN32_
17OBJECTS_DIR = obj/win 17OBJECTS_DIR = obj/win
18MOC_DIR = moc/win 18MOC_DIR = moc/win
19} 19}
20include( ../variables.pri ) 20include( ../variables.pri )
21 21
22 22
23 23
24HEADERS = \ 24HEADERS = \
25qlayoutengine_p.h \ 25qlayoutengine_p.h \
26KDGanttMinimizeSplitter.h \ 26KDGanttMinimizeSplitter.h \
27 kapplication.h \ 27 kapplication.h \
28 kaudioplayer.h \ 28 kaudioplayer.h \
29 kcalendarsystem.h \ 29 kcalendarsystem.h \
30 kcalendarsystemgregorian.h \ 30 kcalendarsystemgregorian.h \
31 kcolorbutton.h \ 31 kcolorbutton.h \
32 kcolordialog.h \ 32 kcolordialog.h \
33 kcombobox.h \ 33 kcombobox.h \
34 kconfig.h \ 34 kconfig.h \
35 kdatetbl.h \ 35 kdatetbl.h \
36 kdebug.h \ 36 kdebug.h \
37 kdialog.h \ 37 kdialog.h \
38 kdialogbase.h \ 38 kdialogbase.h \
39 kdirwatch.h \ 39 kdirwatch.h \
40 keditlistbox.h \ 40 keditlistbox.h \
41 kemailsettings.h \ 41 kemailsettings.h \
42 kfiledialog.h \ 42 kfiledialog.h \
43 kfontdialog.h \ 43 kfontdialog.h \
44 kglobal.h \ 44 kglobal.h \
45 kglobalsettings.h \ 45 kglobalsettings.h \
46 kiconloader.h \ 46 kiconloader.h \
47 klineedit.h \ 47 klineedit.h \
48 klineeditdlg.h \ 48 klineeditdlg.h \
49 kmessagebox.h \ 49 kmessagebox.h \
50 knotifyclient.h \ 50 knotifyclient.h \
51 kprinter.h \ 51 kprinter.h \
52 kprocess.h \ 52 kprocess.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
107SOURCES = \ 108SOURCES = \
108KDGanttMinimizeSplitter.cpp \ 109KDGanttMinimizeSplitter.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