summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-07-08 11:20:17 (UTC)
committer zautrix <zautrix>2004-07-08 11:20:17 (UTC)
commit3f84322a2da502f95be386372da9f75ed17df574 (patch) (unidiff)
tree9a4ccd4568c38d60bb1efa7a6713f4d0914aae86
parent40cf8102d2f38b5e952b889ffbd19cb1d428fc9b (diff)
downloadkdepimpi-3f84322a2da502f95be386372da9f75ed17df574.zip
kdepimpi-3f84322a2da502f95be386372da9f75ed17df574.tar.gz
kdepimpi-3f84322a2da502f95be386372da9f75ed17df574.tar.bz2
Fixes for resource plugin handling on wintendo
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile263
-rw-r--r--microkde/kconfig.cpp22
-rw-r--r--microkde/kconfig.h4
-rw-r--r--microkde/kresources/managerimpl.cpp11
-rw-r--r--microkde/kresources/resource.cpp7
5 files changed, 153 insertions, 154 deletions
diff --git a/Makefile b/Makefile
index 6eb89e7..d770a05 100644
--- a/Makefile
+++ b/Makefile
@@ -1,147 +1,118 @@
1############################################################################# 1DISTPATH = $(shell pwd)
2# Makefile for building: kopi-desktop 2DISTDIR = $(shell basename $(DISTPATH))
3# Generated by qmake (1.07a) (Qt 3.3.2) on: Wed Jul 7 14:00:48 2004 3
4# Project: kopi-desktop.pro 4SUBDIRS = libical/src/libical libical/src/libicalss qtcompat microkde \
5# Template: subdirs 5 libkcal libkdepim kabc kabc/converter/opie kabc/formats/binary kabc/plugins/file kabc/plugins/dir \
6# Command: $(QMAKE) "CONFIG+=thread" "CONFIG+=debug" -o Makefile kopi-desktop.pro 6 kabc/plugins/opie \
7############################################################################# 7 korganizer kalarmd kaddressbook kmicromail/libetpan kmicromail/libmailwrapper kmicromail
8 8all: tmake
9 MAKEFILE =Makefile 9 for i in $(SUBDIRS); do pushd $$i; \
10 QMAKE =qmake 10 make -f Makefile$(PLATFORM) || exit 1; popd; \
11DEL_FILE = rm -f 11 done
12CHK_DIR_EXISTS= test -d 12
13MKDIR = mkdir -p 13objects:
14INSTALL_FILE= 14 for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done
15INSTALL_DIR = 15 for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done
16 SUBTARGETS = \ 16 mkdir -p libical/lib/$(PLATFORM)
17 sub-libical \ 17
18 sub-libkcal \ 18clean:
19 sub-microkde \ 19 rm -f libical/lib/$(PLATFORM)/*;
20 sub-libkdepim \ 20 for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\
21 sub-kabc \ 21 rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \
22 sub-korganizer \ 22 done
23 sub-kaddressbook \ 23install:
24 sub-kabc-plugins-file \ 24 cd bin/kdepim; make install
25 sub-kabc-plugins-dir 25 cp db2file/db2file $(QPEDIR)/bin/db2file
26 26 cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop
27first: all 27 cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kmicromail.desktop
28 28 cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop
29all: Makefile $(SUBTARGETS) 29
30 30dist:
31libical/$(MAKEFILE): 31 @echo Dont forget to do "make install" before "make dist"
32 @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical" 32 rm -f *arm.ipk
33 cd libical && $(QMAKE) libical.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) 33 rm -f *~
34sub-libical: libical/$(MAKEFILE) FORCE 34 cd ..; tar czf kdepim.src.tar.gz --exclude=obj --exclude=moc kdepim
35 cd libical && $(MAKE) -f $(MAKEFILE) 35 mkipks kmicrokdelibs.control
36 36 mkipks korganizer.control
37libkcal/$(MAKEFILE): 37 mkipks kaddressbook.control
38 @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal" 38 mkipks kopiemail.control
39 cd libkcal && $(QMAKE) libkcal.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) 39 mkipks korganizer-alarm.control
40sub-libkcal: libkcal/$(MAKEFILE) FORCE 40
41 cd libkcal && $(MAKE) -f $(MAKEFILE) 41tmake: objects qtcompat/Makefile$(PLATFORM) microkde/Makefile$(PLATFORM) \
42 42 libkcal/Makefile$(PLATFORM) \
43microkde/$(MAKEFILE): 43 libkdepim/Makefile$(PLATFORM) korganizer/Makefile$(PLATFORM) \
44 @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde" 44 kalarmd/Makefile$(PLATFORM) \
45 cd microkde && $(QMAKE) microkde.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) 45 libical/src/libical/Makefile$(PLATFORM) \
46sub-microkde: microkde/$(MAKEFILE) FORCE 46 libical/src/libicalss/Makefile$(PLATFORM) \
47 cd microkde && $(MAKE) -f $(MAKEFILE) 47 kabc/Makefile$(PLATFORM) \
48 48 kabc/converter/opie/Makefile$(PLATFORM) \
49libkdepim/$(MAKEFILE): 49 kabc/formats/binary/Makefile$(PLATFORM) \
50 @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim" 50 kabc/plugins/file/Makefile$(PLATFORM) \
51 cd libkdepim && $(QMAKE) libkdepim.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) 51 kabc/plugins/dir/Makefile$(PLATFORM) \
52sub-libkdepim: libkdepim/$(MAKEFILE) FORCE 52 kabc/plugins/ldap/Makefile$(PLATFORM) \
53 cd libkdepim && $(MAKE) -f $(MAKEFILE) 53 kabc/plugins/opie/Makefile$(PLATFORM) \
54 54 kaddressbook/Makefile$(PLATFORM) \
55kabc/$(MAKEFILE): 55 kmicromail/Makefile$(PLATFORM) \
56 @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc" 56 kmicromail/libetpan/Makefile$(PLATFORM) \
57 cd kabc && $(QMAKE) kabc.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) 57 kmicromail/libmailwrapper/Makefile$(PLATFORM)
58sub-kabc: kabc/$(MAKEFILE) FORCE 58
59 cd kabc && $(MAKE) -f $(MAKEFILE) 59
60 60
61korganizer/$(MAKEFILE): 61qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro
62 @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer" 62 cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" qtcompat.pro -o Makefile$(PLATFORM)
63 cd korganizer && $(QMAKE) korganizer.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) 63
64sub-korganizer: korganizer/$(MAKEFILE) FORCE 64microkde/Makefile$(PLATFORM): microkde/microkdeE.pro
65 cd korganizer && $(MAKE) -f $(MAKEFILE) 65 cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" microkdeE.pro -o Makefile$(PLATFORM)
66 66
67kaddressbook/$(MAKEFILE): 67libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro
68 @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook" 68 cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" libkcalE.pro -o Makefile$(PLATFORM)
69 cd kaddressbook && $(QMAKE) kaddressbook.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) 69
70sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE 70
71 cd kaddressbook && $(MAKE) -f $(MAKEFILE) 71libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro
72 72 cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" libkdepimE.pro -o Makefile$(PLATFORM)
73kabc/plugins/file/$(MAKEFILE): 73
74 @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file" 74kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro
75 cd kabc/plugins/file && $(QMAKE) file.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) 75 cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" kalarmdE.pro -o Makefile$(PLATFORM)
76sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE 76
77 cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE) 77korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro
78 78 cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" korganizerE.pro -o Makefile$(PLATFORM)
79kabc/plugins/dir/$(MAKEFILE): 79
80 @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir" 80libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro
81 cd kabc/plugins/dir && $(QMAKE) dir.pro "CONFIG+=thread" "CONFIG+=debug" -o $(MAKEFILE) 81 cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" libicalE.pro -o Makefile$(PLATFORM)
82sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE 82
83 cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE) 83libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro
84 84 cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" libicalssE.pro -o Makefile$(PLATFORM)
85Makefile: kopi-desktop.pro /usr/local/qtgcc/mkspecs/default/qmake.conf 85
86 $(QMAKE) "CONFIG+=thread" "CONFIG+=debug" -o Makefile kopi-desktop.pro 86kabc/Makefile$(PLATFORM): kabc/kabcE.pro
87qmake: qmake_all 87 cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" kabcE.pro -o Makefile$(PLATFORM)
88 @$(QMAKE) "CONFIG+=thread" "CONFIG+=debug" -o Makefile kopi-desktop.pro 88
89 89kabc/converter/opie/Makefile$(PLATFORM): kabc/converter/opie/opieconverterE.pro
90all: $(SUBTARGETS) 90 cd kabc/converter/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" opieconverterE.pro -o Makefile$(PLATFORM)
91qmake_all: libical/$(MAKEFILE) libkcal/$(MAKEFILE) microkde/$(MAKEFILE) libkdepim/$(MAKEFILE) kabc/$(MAKEFILE) korganizer/$(MAKEFILE) kaddressbook/$(MAKEFILE) kabc/plugins/file/$(MAKEFILE) kabc/plugins/dir/$(MAKEFILE) 91
92 ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 92kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro
93 ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 93 cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" kabcformat_binaryE.pro -o Makefile$(PLATFORM)
94 ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 94
95 ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 95kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/kabc_fileE.pro
96 ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 96 cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" kabc_fileE.pro -o Makefile$(PLATFORM)
97 ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 97
98 ( [ -d kaddressbook ] && cd kaddressbook ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 98kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/kabc_dirE.pro
99 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 99 cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" kabc_dirE.pro -o Makefile$(PLATFORM)
100 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 100
101clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE 101kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/kabc_ldapE.pro
102 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true 102 cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" kabc_ldapE.pro -o Makefile$(PLATFORM)
103 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; ) || true 103
104 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true 104kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/kabc_opieE.pro
105 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true 105 cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" kabc_opieE.pro -o Makefile$(PLATFORM)
106 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true 106
107 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true 107
108 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; ) || true 108kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro
109 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true 109 cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" kaddressbookE.pro -o Makefile$(PLATFORM)
110 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true 110
111uninstall_subdirs: qmake_all FORCE 111
112 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 112kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro
113 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 113 cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" kmicromailE.pro -o Makefile$(PLATFORM)
114 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 114kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro
115 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 115 cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" libetpanE.pro -o Makefile$(PLATFORM)
116 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 116kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro
117 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 117 cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" libmailwrapperE.pro -o Makefile$(PLATFORM)
118 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
119 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
120 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
121install_subdirs: qmake_all FORCE
122 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true
123 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true
124 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true
125 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true
126 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true
127 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true
128 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true
129 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true
130 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true
131distclean: qmake_all FORCE
132 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
133 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
134 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
135 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
136 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
137 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
138 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
139 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
140 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
141
142install: install_subdirs
143
144uninstall: uninstall_subdirs
145
146FORCE:
147 118
diff --git a/microkde/kconfig.cpp b/microkde/kconfig.cpp
index 737b3f2..4cbec94 100644
--- a/microkde/kconfig.cpp
+++ b/microkde/kconfig.cpp
@@ -1,104 +1,116 @@
1#include <qfile.h> 1#include <qfile.h>
2#include <qtextstream.h> 2#include <qtextstream.h>
3#include <qwidget.h> 3#include <qwidget.h>
4 4
5#include "kdebug.h" 5#include "kdebug.h"
6 6
7#include "kurl.h" 7#include "kurl.h"
8#include "kstandarddirs.h" 8#include "kstandarddirs.h"
9#include "kconfig.h" 9#include "kconfig.h"
10 10
11QString KConfig::mGroup = ""; 11QString KConfig::mGroup = "";
12//QString KConfig::mGroup = "General"; 12//QString KConfig::mGroup = "General";
13 13
14KConfig::KConfig( const QString &fileName ) 14KConfig::KConfig( const QString &fileName )
15 : mFileName( fileName ), mDirty( false ) 15 : mFileName( fileName ), mDirty( false )
16{ 16{
17 kdDebug() << "KConfig::KConfig(): '" << fileName << "'" << endl; 17
18 18 mTempGroup = "";
19 load(); 19 load();
20 20
21} 21}
22 22
23 23
24KConfig::~KConfig() 24KConfig::~KConfig()
25{ 25{
26 sync(); 26 sync();
27} 27}
28// we need the temp group for plugins on windows
29void KConfig::setTempGroup( const QString &group )
30{
31 mTempGroup = group;
32
33 if ( mTempGroup.right( 1 ) != "/" ) mTempGroup += "/";
34}
35
36
37QString KConfig::tempGroup() const {
38 return mTempGroup;
39}
28 40
29void KConfig::setGroup( const QString &group ) 41void KConfig::setGroup( const QString &group )
30{ 42{
31 kdDebug() << "KConfig::setGroup(): '" << group << "'" << endl; 43
32 44
33 mGroup = group; 45 mGroup = group;
34 46
35 if ( mGroup.right( 1 ) != "/" ) mGroup += "/"; 47 if ( mGroup.right( 1 ) != "/" ) mGroup += "/";
36} 48}
37 49
38//US 50//US
39QString KConfig::group() const { 51QString KConfig::group() const {
40 return mGroup; 52 return mGroup;
41} 53}
42 54
43//US added method 55//US added method
44QValueList<int> KConfig::readIntListEntry( const QString & key) 56QValueList<int> KConfig::readIntListEntry( const QString & key)
45{ 57{
46// qDebug("KConfig::readIntListEntry key=%s:", key.latin1()); 58// qDebug("KConfig::readIntListEntry key=%s:", key.latin1());
47 59
48 QValueList<int> result; 60 QValueList<int> result;
49 61
50 QMap<QString,QString>::ConstIterator mit = mStringMap.find( mGroup + key ); 62 QMap<QString,QString>::ConstIterator mit = mStringMap.find( mGroup + key );
51 63
52 if ( mit == mStringMap.end() ) { 64 if ( mit == mStringMap.end() ) {
53 return result; 65 return result;
54 } 66 }
55 67
56 QStringList valuesAsStrings = QStringList::split(":", *mit ); 68 QStringList valuesAsStrings = QStringList::split(":", *mit );
57 bool ok = false; 69 bool ok = false;
58 bool ok2 = true; 70 bool ok2 = true;
59 int val; 71 int val;
60 72
61 for ( QStringList::Iterator sit = valuesAsStrings.begin(); sit != valuesAsStrings.end(); ++sit ) { 73 for ( QStringList::Iterator sit = valuesAsStrings.begin(); sit != valuesAsStrings.end(); ++sit ) {
62 val = (*sit).toInt(&ok); 74 val = (*sit).toInt(&ok);
63 result << val; 75 result << val;
64 if (ok == false) { 76 if (ok == false) {
65 qDebug("KConfig::readIntListEntry str=%s , int=%n:", (*sit).latin1(), &val); 77 qDebug("KConfig::readIntListEntry str=%s , int=%n:", (*sit).latin1(), &val);
66 ok2 = false; 78 ok2 = false;
67 } 79 }
68 } 80 }
69 81
70 if (ok2 == false) 82 if (ok2 == false)
71 { 83 {
72 kdDebug() << "KConfig::readIntListEntry: error while reading one of the intvalues." << endl; 84
73 qDebug("KConfig::readIntListEntry: error while reading one of the intvalues."); 85 qDebug("KConfig::readIntListEntry: error while reading one of the intvalues.");
74 } 86 }
75 87
76 return result; 88 return result;
77} 89}
78 90
79int KConfig::readNumEntry( const QString & key, int def ) 91int KConfig::readNumEntry( const QString & key, int def )
80{ 92{
81 QString res = readEntry(key, QString::number(def ) ); 93 QString res = readEntry(key, QString::number(def ) );
82 bool ok = false; 94 bool ok = false;
83 int result = res.toInt(&ok); 95 int result = res.toInt(&ok);
84 if ( ok ) 96 if ( ok )
85 return result; 97 return result;
86 return def; 98 return def;
87} 99}
88 100
89QString KConfig::readEntry( const QString &key, const QString &def ) 101QString KConfig::readEntry( const QString &key, const QString &def )
90{ 102{
91 QMap<QString,QString>::ConstIterator it = mStringMap.find( mGroup + key ); 103 QMap<QString,QString>::ConstIterator it = mStringMap.find( mGroup + key );
92 104
93 if ( it == mStringMap.end() ) { 105 if ( it == mStringMap.end() ) {
94 return def; 106 return def;
95 } 107 }
96 108
97 return *it; 109 return *it;
98} 110}
99 111
100QStringList KConfig::readListEntry( const QString &key ) 112QStringList KConfig::readListEntry( const QString &key )
101{ 113{
102 QMap<QString,QString>::ConstIterator it = mStringMap.find( mGroup + key ); 114 QMap<QString,QString>::ConstIterator it = mStringMap.find( mGroup + key );
103 115
104 if ( it == mStringMap.end() ) { 116 if ( it == mStringMap.end() ) {
@@ -198,65 +210,65 @@ void KConfig::writeEntry( const QString &key, bool value)
198{ 210{
199 mBoolMap.insert( mGroup + key, value ); 211 mBoolMap.insert( mGroup + key, value );
200 212
201 mDirty = true; 213 mDirty = true;
202} 214}
203 215
204void KConfig::writeEntry( const QString & e, const QColor & c ) 216void KConfig::writeEntry( const QString & e, const QColor & c )
205{ 217{
206 QStringList l; 218 QStringList l;
207 l.append( QString::number ( c.red() ) ); 219 l.append( QString::number ( c.red() ) );
208 l.append( QString::number ( c.green() ) ); 220 l.append( QString::number ( c.green() ) );
209 l.append( QString::number ( c.blue() ) ); 221 l.append( QString::number ( c.blue() ) );
210 writeEntry( e, l ); 222 writeEntry( e, l );
211} 223}
212 224
213void KConfig::writeEntry( const QString & e , const QFont & f ) 225void KConfig::writeEntry( const QString & e , const QFont & f )
214{ 226{
215 QStringList font; 227 QStringList font;
216 font.append( f.family()); 228 font.append( f.family());
217 font.append( (!f.bold ()?"nonbold":"bold") ); 229 font.append( (!f.bold ()?"nonbold":"bold") );
218 font.append( QString::number ( f.pointSize () ) ); 230 font.append( QString::number ( f.pointSize () ) );
219 font.append( !f.italic ()?"nonitalic":"italic" ); 231 font.append( !f.italic ()?"nonitalic":"italic" );
220 writeEntry( e, font ); 232 writeEntry( e, font );
221} 233}
222 234
223void KConfig::writeEntry( const QString &key, const QDateTime &dt ) 235void KConfig::writeEntry( const QString &key, const QDateTime &dt )
224{ 236{
225 mDateTimeMap.insert( mGroup + key, dt ); 237 mDateTimeMap.insert( mGroup + key, dt );
226} 238}
227 239
228void KConfig::load() 240void KConfig::load()
229{ 241{
230 kdDebug() << "KConfig::load(): " << mFileName << endl; 242
231 243
232 QFile f( mFileName ); 244 QFile f( mFileName );
233 if ( !f.open( IO_ReadOnly ) ) { 245 if ( !f.open( IO_ReadOnly ) ) {
234 qDebug("KConfig: could not open file %s ",mFileName.latin1() ); 246 qDebug("KConfig: could not open file %s ",mFileName.latin1() );
235 return; 247 return;
236 } 248 }
237 249
238 mBoolMap.clear(); 250 mBoolMap.clear();
239 mStringMap.clear(); 251 mStringMap.clear();
240 252
241 QTextStream t( &f ); 253 QTextStream t( &f );
242 254
243 QString line = t.readLine(); 255 QString line = t.readLine();
244 256
245 while ( !line.isNull() ) { 257 while ( !line.isNull() ) {
246 QStringList tokens = QStringList::split( ",", line ); 258 QStringList tokens = QStringList::split( ",", line );
247 if ( tokens[0] == "bool" ) { 259 if ( tokens[0] == "bool" ) {
248 bool value = false; 260 bool value = false;
249 if ( tokens[2] == "1" ) value = true; 261 if ( tokens[2] == "1" ) value = true;
250 mBoolMap.insert( tokens[1], value ); 262 mBoolMap.insert( tokens[1], value );
251 } else if ( tokens[0] == "QString" ) { 263 } else if ( tokens[0] == "QString" ) {
252 QString value = tokens[2]; 264 QString value = tokens[2];
253 mStringMap.insert( tokens[1], value ); 265 mStringMap.insert( tokens[1], value );
254 } else if ( tokens[0] == "QDateTime" ) { 266 } else if ( tokens[0] == "QDateTime" ) {
255#if 0 267#if 0
256 int year = tokens[2].toInt(); 268 int year = tokens[2].toInt();
257 QDateTime dt( QDate( year, 269 QDateTime dt( QDate( year,
258 tokens[3].toInt(), 270 tokens[3].toInt(),
259 tokens[4].toInt() ), 271 tokens[4].toInt() ),
260 QTime( tokens[5].toInt(), tokens[6].toInt(), 272 QTime( tokens[5].toInt(), tokens[6].toInt(),
261 tokens[7].toInt() ) ); 273 tokens[7].toInt() ) );
262 mDateTimeMap.insert( tokens[1], dt ); 274 mDateTimeMap.insert( tokens[1], dt );
diff --git a/microkde/kconfig.h b/microkde/kconfig.h
index bfedf53..a01b1a5 100644
--- a/microkde/kconfig.h
+++ b/microkde/kconfig.h
@@ -1,49 +1,52 @@
1#ifndef MINIKDE_KCONFIG_H 1#ifndef MINIKDE_KCONFIG_H
2#define MINIKDE_KCONFIG_H 2#define MINIKDE_KCONFIG_H
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qstringlist.h> 5#include <qstringlist.h>
6#include <qvaluelist.h> 6#include <qvaluelist.h>
7#include <qcolor.h> 7#include <qcolor.h>
8#include <qfont.h> 8#include <qfont.h>
9#include <qmap.h> 9#include <qmap.h>
10#include <qdatetime.h> 10#include <qdatetime.h>
11 11
12class KConfig 12class KConfig
13{ 13{
14 public: 14 public:
15 KConfig( const QString & ); 15 KConfig( const QString & );
16 ~KConfig(); 16 ~KConfig();
17 17
18 void setTempGroup( const QString &group );
19 QString tempGroup() const;
20
18 void setGroup( const QString & ); 21 void setGroup( const QString & );
19 22
20//US 23//US
21 /** 24 /**
22 * Returns the name of the group in which we are 25 * Returns the name of the group in which we are
23 * searching for keys and from which we are retrieving entries. 26 * searching for keys and from which we are retrieving entries.
24 * 27 *
25 * @return The current group. 28 * @return The current group.
26 */ 29 */
27 QString group() const; 30 QString group() const;
28 31
29//US I took the following deleteGroup method from a newer version from KDE. 32//US I took the following deleteGroup method from a newer version from KDE.
30/** 33/**
31 * Deletes a configuration entry group 34 * Deletes a configuration entry group
32 * 35 *
33 * If the group is not empty and bDeep is false, nothing gets 36 * If the group is not empty and bDeep is false, nothing gets
34 * deleted and false is returned. 37 * deleted and false is returned.
35 * If this group is the current group and it is deleted, the 38 * If this group is the current group and it is deleted, the
36 * current group is undefined and should be set with setGroup() 39 * current group is undefined and should be set with setGroup()
37 * before the next operation on the configuration object. 40 * before the next operation on the configuration object.
38 * 41 *
39 * @param group The name of the group 42 * @param group The name of the group
40 * returns true if we deleted at least one entry. 43 * returns true if we deleted at least one entry.
41 */ 44 */
42 bool deleteGroup( const QString& group); 45 bool deleteGroup( const QString& group);
43 46
44//US I took the following hasGroup method from a newer version from KDE. 47//US I took the following hasGroup method from a newer version from KDE.
45 /** 48 /**
46 * Returns true if the specified group is known about. 49 * Returns true if the specified group is known about.
47 * 50 *
48 * @param group The group to search for. 51 * @param group The group to search for.
49 * @return Whether the group exists. 52 * @return Whether the group exists.
@@ -58,43 +61,44 @@ class KConfig
58 61
59 int readNumEntry( const QString &, int def=0 ); 62 int readNumEntry( const QString &, int def=0 );
60 QString readEntry( const QString &, const QString &def=QString::null ); 63 QString readEntry( const QString &, const QString &def=QString::null );
61 QStringList readListEntry( const QString & ); 64 QStringList readListEntry( const QString & );
62 bool readBoolEntry( const QString &, bool def=false ); 65 bool readBoolEntry( const QString &, bool def=false );
63 QColor readColorEntry( const QString &, QColor * ); 66 QColor readColorEntry( const QString &, QColor * );
64 QFont readFontEntry( const QString &, QFont * ); 67 QFont readFontEntry( const QString &, QFont * );
65 QDateTime readDateTimeEntry( const QString &, const QDateTime *pDefault = 0 ); 68 QDateTime readDateTimeEntry( const QString &, const QDateTime *pDefault = 0 );
66 69
67 bool hasKey( const QString &); 70 bool hasKey( const QString &);
68 71
69 void writeEntry( const QString &, const QValueList<int>& ); 72 void writeEntry( const QString &, const QValueList<int>& );
70 void writeEntry( const QString &, int ); 73 void writeEntry( const QString &, int );
71 void writeEntry( const QString &key , unsigned int value) { writeEntry( key, int( value ) ); } 74 void writeEntry( const QString &key , unsigned int value) { writeEntry( key, int( value ) ); }
72 void writeEntry( const char *key , unsigned int value) { writeEntry( QString( key ), value ); } 75 void writeEntry( const char *key , unsigned int value) { writeEntry( QString( key ), value ); }
73 void writeEntry( const char *key, int value ) { writeEntry( QString( key ), value ); } 76 void writeEntry( const char *key, int value ) { writeEntry( QString( key ), value ); }
74 void writeEntry( const QString &, const QString & ); 77 void writeEntry( const QString &, const QString & );
75 void writeEntry( const char *key, const QString &value ) { writeEntry( QString( key ), value ); } 78 void writeEntry( const char *key, const QString &value ) { writeEntry( QString( key ), value ); }
76 void writeEntry( const QString &, const QStringList & ); 79 void writeEntry( const QString &, const QStringList & );
77 void writeEntry( const QString &, bool ); 80 void writeEntry( const QString &, bool );
78 void writeEntry( const char *key, bool value ) { writeEntry( QString( key ), value ); } 81 void writeEntry( const char *key, bool value ) { writeEntry( QString( key ), value ); }
79 void writeEntry( const QString &, const QColor & ); 82 void writeEntry( const QString &, const QColor & );
80 void writeEntry( const QString &, const QFont & ); 83 void writeEntry( const QString &, const QFont & );
81 void writeEntry( const QString &, const QDateTime & ); 84 void writeEntry( const QString &, const QDateTime & );
82 85
83 void deleteEntry( const QString &); 86 void deleteEntry( const QString &);
84 87
85 void load(); 88 void load();
86 void sync(); 89 void sync();
87 90
88 private: 91 private:
89 static QString mGroup; 92 static QString mGroup;
93 QString mTempGroup;
90 94
91 QString mFileName; 95 QString mFileName;
92 96
93 QMap<QString,bool> mBoolMap; 97 QMap<QString,bool> mBoolMap;
94 QMap<QString,QString> mStringMap; 98 QMap<QString,QString> mStringMap;
95 QMap<QString,QDateTime> mDateTimeMap; 99 QMap<QString,QDateTime> mDateTimeMap;
96 100
97 bool mDirty; 101 bool mDirty;
98}; 102};
99 103
100#endif 104#endif
diff --git a/microkde/kresources/managerimpl.cpp b/microkde/kresources/managerimpl.cpp
index 1baa6be..785b6b4 100644
--- a/microkde/kresources/managerimpl.cpp
+++ b/microkde/kresources/managerimpl.cpp
@@ -224,71 +224,76 @@ QPtrList<Resource> ManagerImpl::resources()
224 for ( it = mResources.begin(); it != mResources.end(); ++it ) { 224 for ( it = mResources.begin(); it != mResources.end(); ++it ) {
225 result.append( *it ); 225 result.append( *it );
226 } 226 }
227 return result; 227 return result;
228} 228}
229 229
230QPtrList<Resource> ManagerImpl::resources( bool active ) 230QPtrList<Resource> ManagerImpl::resources( bool active )
231{ 231{
232 QPtrList<Resource> result; 232 QPtrList<Resource> result;
233 233
234 Resource::List::ConstIterator it; 234 Resource::List::ConstIterator it;
235 for ( it = mResources.begin(); it != mResources.end(); ++it ) { 235 for ( it = mResources.begin(); it != mResources.end(); ++it ) {
236 if ( (*it)->isActive() == active ) { 236 if ( (*it)->isActive() == active ) {
237 result.append( *it ); 237 result.append( *it );
238 } 238 }
239 } 239 }
240 return result; 240 return result;
241} 241}
242 242
243void ManagerImpl::setListener( ManagerImplListener *listener ) 243void ManagerImpl::setListener( ManagerImplListener *listener )
244{ 244{
245 mListener = listener; 245 mListener = listener;
246} 246}
247 247
248Resource* ManagerImpl::readResourceConfig( const QString& identifier, 248Resource* ManagerImpl::readResourceConfig( const QString& identifier,
249 bool checkActive ) 249 bool checkActive )
250{ 250{
251 kdDebug() << "ManagerImpl::readResourceConfig() " << identifier << endl; 251 kdDebug() << "ManagerImpl::readResourceConfig() " << identifier << endl;
252 252
253// qDebug("ManagerImpl::readResourceConfig() %s", identifier.latin1()); 253// qDebug("ManagerImpl::readResourceConfig() %s", identifier.latin1());
254 254
255 mConfig->setGroup( "Resource_" + identifier ); 255 mConfig->setGroup( "Resource_" + identifier );
256 256#ifdef _WIN32_
257 // we use plugins on win32. the group is stored in a static variable
258 // such that gourp info not avail on win32 plugins
259 // to fix that, it would be a looooot of work
260 mConfig->setTempGroup( "Resource_" + identifier );
261#endif
257 QString type = mConfig->readEntry( "ResourceType" ); 262 QString type = mConfig->readEntry( "ResourceType" );
258 QString name = mConfig->readEntry( "ResourceName" ); 263 QString name = mConfig->readEntry( "ResourceName" );
259 Resource *resource = mFactory->resource( type, mConfig ); 264 Resource *resource = mFactory->resource( type, mConfig );
260 if ( !resource ) { 265 if ( !resource ) {
261 kdDebug(5650) << "Failed to create resource with id " << identifier << endl; 266 qDebug("Failed to create resource with id %s ",identifier.latin1() );
262 return 0; 267 return 0;
263 } 268 }
264 269
265 if ( resource->identifier().isEmpty() ) 270 if ( resource->identifier().isEmpty() )
266 resource->setIdentifier( identifier ); 271 resource->setIdentifier( identifier );
267 272
268 mConfig->setGroup( "General" ); 273 mConfig->setGroup( "General" );
269 274
270 QString standardKey = mConfig->readEntry( "Standard" ); 275 QString standardKey = mConfig->readEntry( "Standard" );
271 if ( standardKey == identifier ) { 276 if ( standardKey == identifier ) {
272 mStandard = resource; 277 mStandard = resource;
273 } 278 }
274 279
275 if ( checkActive ) { 280 if ( checkActive ) {
276 QStringList activeKeys = mConfig->readListEntry( "ResourceKeys" ); 281 QStringList activeKeys = mConfig->readListEntry( "ResourceKeys" );
277 resource->setActive( activeKeys.contains( identifier ) ); 282 resource->setActive( activeKeys.contains( identifier ) );
278 } 283 }
279 mResources.append( resource ); 284 mResources.append( resource );
280 285
281 return resource; 286 return resource;
282} 287}
283 288
284void ManagerImpl::writeResourceConfig( Resource *resource, 289void ManagerImpl::writeResourceConfig( Resource *resource,
285 bool checkActive ) 290 bool checkActive )
286{ 291{
287 QString key = resource->identifier(); 292 QString key = resource->identifier();
288 293
289 kdDebug(5650) << "Saving resource " << key << endl; 294 kdDebug(5650) << "Saving resource " << key << endl;
290 295
291 if ( !mConfig ) createStandardConfig(); 296 if ( !mConfig ) createStandardConfig();
292 297
293 mConfig->setGroup( "Resource_" + key ); 298 mConfig->setGroup( "Resource_" + key );
294 resource->writeConfig( mConfig ); 299 resource->writeConfig( mConfig );
diff --git a/microkde/kresources/resource.cpp b/microkde/kresources/resource.cpp
index 7827a67..991d53d 100644
--- a/microkde/kresources/resource.cpp
+++ b/microkde/kresources/resource.cpp
@@ -24,64 +24,71 @@
24#include <kdebug.h> 24#include <kdebug.h>
25#include <kapplication.h> 25#include <kapplication.h>
26#include <kconfig.h> 26#include <kconfig.h>
27 27
28#include "resource.h" 28#include "resource.h"
29 29
30using namespace KRES; 30using namespace KRES;
31 31
32class Resource::ResourcePrivate 32class Resource::ResourcePrivate
33{ 33{
34 public: 34 public:
35#ifdef QT_THREAD_SUPPORT 35#ifdef QT_THREAD_SUPPORT
36 QMutex mMutex; 36 QMutex mMutex;
37#endif 37#endif
38 int mOpenCount; 38 int mOpenCount;
39 QString mType; 39 QString mType;
40 QString mIdentifier; 40 QString mIdentifier;
41 bool mReadOnly; 41 bool mReadOnly;
42 QString mName; 42 QString mName;
43 bool mActive; 43 bool mActive;
44 bool mIsOpen; 44 bool mIsOpen;
45}; 45};
46 46
47Resource::Resource( const KConfig* config ) 47Resource::Resource( const KConfig* config )
48 : QObject( 0, "" ), d( new ResourcePrivate ) 48 : QObject( 0, "" ), d( new ResourcePrivate )
49{ 49{
50 d->mOpenCount = 0; 50 d->mOpenCount = 0;
51 d->mIsOpen = false; 51 d->mIsOpen = false;
52 52
53 //US compiler claimed that const discards qualifier 53 //US compiler claimed that const discards qualifier
54 KConfig* cfg = (KConfig*)config; 54 KConfig* cfg = (KConfig*)config;
55 if ( cfg ) { 55 if ( cfg ) {
56#ifdef _WIN32_
57 // we use plugins on win32. the group is stored in a static variable
58 // such that group info not available on win32 plugins
59 // to fix that, it would be a looooot of work
60 if ( !cfg->tempGroup().isEmpty() )
61 cfg->setGroup( cfg->tempGroup() );
62#endif
56 d->mType = cfg->readEntry( "ResourceType" ); 63 d->mType = cfg->readEntry( "ResourceType" );
57 d->mName = cfg->readEntry( "ResourceName" ); 64 d->mName = cfg->readEntry( "ResourceName" );
58 d->mReadOnly = cfg->readBoolEntry( "ResourceIsReadOnly", false ); 65 d->mReadOnly = cfg->readBoolEntry( "ResourceIsReadOnly", false );
59 d->mActive = cfg->readBoolEntry( "ResourceIsActive", true ); 66 d->mActive = cfg->readBoolEntry( "ResourceIsActive", true );
60 d->mIdentifier = cfg->readEntry( "ResourceIdentifier" ); 67 d->mIdentifier = cfg->readEntry( "ResourceIdentifier" );
61 } else { 68 } else {
62 d->mType = "type"; 69 d->mType = "type";
63 d->mName = "resource-name"; 70 d->mName = "resource-name";
64 d->mReadOnly = false; 71 d->mReadOnly = false;
65 d->mActive = true; 72 d->mActive = true;
66 d->mIdentifier = KApplication::randomString( 10 ); 73 d->mIdentifier = KApplication::randomString( 10 );
67 } 74 }
68} 75}
69 76
70Resource::~Resource() 77Resource::~Resource()
71{ 78{
72 delete d; 79 delete d;
73 d = 0; 80 d = 0;
74} 81}
75 82
76void Resource::writeConfig( KConfig* config ) 83void Resource::writeConfig( KConfig* config )
77{ 84{
78 85
79 86
80 config->writeEntry( "ResourceType", d->mType ); 87 config->writeEntry( "ResourceType", d->mType );
81 config->writeEntry( "ResourceName", d->mName ); 88 config->writeEntry( "ResourceName", d->mName );
82 config->writeEntry( "ResourceIsReadOnly", d->mReadOnly ); 89 config->writeEntry( "ResourceIsReadOnly", d->mReadOnly );
83 config->writeEntry( "ResourceIsActive", d->mActive ); 90 config->writeEntry( "ResourceIsActive", d->mActive );
84 config->writeEntry( "ResourceIdentifier", d->mIdentifier ); 91 config->writeEntry( "ResourceIdentifier", d->mIdentifier );
85} 92}
86 93
87bool Resource::open() 94bool Resource::open()