-rw-r--r-- | Rules.make | 1 | ||||
-rw-r--r-- | core/launcher/launcher.cpp | 27 |
2 files changed, 15 insertions, 13 deletions
@@ -1,190 +1,191 @@ | |||
1 | .phony: force | 1 | .phony: force |
2 | force: | 2 | force: |
3 | 3 | ||
4 | $(configs) : | 4 | $(configs) : |
5 | $(call makecfg,$@) | 5 | $(call makecfg,$@) |
6 | 6 | ||
7 | $(TOPDIR)/gen.pro : $(TOPDIR)/.config | 7 | $(TOPDIR)/gen.pro : $(TOPDIR)/.config |
8 | echo > $@ | 8 | echo > $@ |
9 | ifneq ($(CONFIG_DEBUG),) | 9 | ifneq ($(CONFIG_DEBUG),) |
10 | echo CONFIG += debug >> $@ | 10 | echo CONFIG += debug >> $@ |
11 | echo CONFIG -= release >> $@ | 11 | echo CONFIG -= release >> $@ |
12 | else | 12 | else |
13 | echo CONFIG -= debug >> $@ | 13 | echo CONFIG -= debug >> $@ |
14 | echo CONFIG += release >> $@ | 14 | echo CONFIG += release >> $@ |
15 | endif | 15 | endif |
16 | ifeq ($(filter 3.%,$(QTE_VERSION)),) # not qt3 | 16 | ifeq ($(filter 3.%,$(QTE_VERSION)),) # not qt3 |
17 | echo CONFIG -= qt3 >> $@ | 17 | echo CONFIG -= qt3 >> $@ |
18 | else | 18 | else |
19 | echo CONFIG += qt3 >> $@ | 19 | echo CONFIG += qt3 >> $@ |
20 | endif | 20 | endif |
21 | 21 | ||
22 | $(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages | 22 | $(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages |
23 | @echo Generating dependency information... | 23 | @echo Generating dependency information... |
24 | # add to subdir-y, and add descend rules | 24 | # add to subdir-y, and add descend rules |
25 | @cat $(TOPDIR)/packages | grep -v '^#' | \ | 25 | @cat $(TOPDIR)/packages | grep -v '^#' | \ |
26 | awk '{print \ | 26 | awk '{print \ |
27 | ".PHONY : " $$2 "\n" \ | 27 | ".PHONY : " $$2 "\n" \ |
28 | "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ | 28 | "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ |
29 | print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends | 29 | print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends |
30 | cat $(TOPDIR)/packages | grep -v '^#' | \ | 30 | cat $(TOPDIR)/packages | grep -v '^#' | \ |
31 | perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE) \$$(OPIEDIR)/gen.pro \$$(OPIEDIR)/.config\n\t\$$(call makefilegen,\$$@)\n\n"; }' \ | 31 | perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE) \$$(OPIEDIR)/gen.pro \$$(OPIEDIR)/.config\n\t\$$(call makefilegen,\$$@)\n\n"; }' \ |
32 | >> $(TOPDIR)/.depends | 32 | >> $(TOPDIR)/.depends |
33 | # interpackage dependency generation | 33 | # interpackage dependency generation |
34 | @cat $(TOPDIR)/packages | \ | 34 | @cat $(TOPDIR)/packages | \ |
35 | $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends | 35 | $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends |
36 | 36 | ||
37 | $(TOPDIR)/.depends.cfgs: | 37 | $(TOPDIR)/.depends.cfgs: |
38 | # config.in interdependencies | 38 | # config.in interdependencies |
39 | @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs | 39 | @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs |
40 | @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@ | 40 | @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@ |
41 | @-rm -f dirs | 41 | @-rm -f dirs |
42 | 42 | ||
43 | $(QTDIR)/stamp-headers : | 43 | $(QTDIR)/stamp-headers : |
44 | @-rm -f $(QTDIR)/stamp-headers* | 44 | @-rm -f $(QTDIR)/stamp-headers* |
45 | ( cd $(QTDIR)/include; \ | 45 | ( cd $(QTDIR)/include; \ |
46 | $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ | 46 | $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ |
47 | qcopchannel_qws.h qwindowsystem_qws.h \ | 47 | qcopchannel_qws.h qwindowsystem_qws.h \ |
48 | qfontmanager_qws.h qwsdefaultdecoration_qws.h)) | 48 | qfontmanager_qws.h qwsdefaultdecoration_qws.h)) |
49 | touch $@ | 49 | touch $@ |
50 | 50 | ||
51 | $(QTDIR)/stamp-headers-x11 : | 51 | $(QTDIR)/stamp-headers-x11 : |
52 | @-rm -f $(QTDIR)/stamp-headers* | 52 | @-rm -f $(QTDIR)/stamp-headers* |
53 | cd $(QTDIR)/include; $(patsubst %,ln -sf $(OPIEDIR)/x11/libqpe-x11/qt/%;,qgfx_qws.h qwsmouse_qws.h qcopchannel_qws.h qwindowsystem_qws.h qfontmanager_qws.h qwsdefaultdecoration_qws.h) | 53 | cd $(QTDIR)/include; $(patsubst %,ln -sf $(OPIEDIR)/x11/libqpe-x11/qt/%;,qgfx_qws.h qwsmouse_qws.h qcopchannel_qws.h qwindowsystem_qws.h qfontmanager_qws.h qwsdefaultdecoration_qws.h) |
54 | touch $@ | 54 | touch $@ |
55 | 55 | ||
56 | $(OPIEDIR)/stamp-headers : | 56 | $(OPIEDIR)/stamp-headers : |
57 | @-rm -f $(OPIEDIR)/stamp-headers* | 57 | @-rm -f $(OPIEDIR)/stamp-headers* |
58 | mkdir -p $(TOPDIR)/include/qpe \ | 58 | mkdir -p $(TOPDIR)/include/qpe \ |
59 | $(TOPDIR)/include/qtopia \ | 59 | $(TOPDIR)/include/qtopia \ |
60 | $(TOPDIR)/include/opie \ | 60 | $(TOPDIR)/include/opie \ |
61 | $(TOPDIR)/include/opie2 \ | ||
61 | $(TOPDIR)/include/qtopia/private | 62 | $(TOPDIR)/include/qtopia/private |
62 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) | 63 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) |
63 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) | 64 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) |
64 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) | 65 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) |
65 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) | 66 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) |
66 | ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) | 67 | ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) |
67 | ( cd include/opie2 && ln -sf ../../libopie2/opiecore/*.h .; ) | 68 | ( cd include/opie2 && ln -sf ../../libopie2/opiecore/*.h .; ) |
68 | ( cd include/opie2 && ln -sf ../../libopie2/opiemm/*.h .; ) | 69 | ( cd include/opie2 && ln -sf ../../libopie2/opiemm/*.h .; ) |
69 | ( cd include/opie2 && ln -sf ../../libopie2/opiedb/*.h .; ) | 70 | ( cd include/opie2 && ln -sf ../../libopie2/opiedb/*.h .; ) |
70 | ( cd include/opie2 && ln -sf ../../libopie2/opienet/*.h .; ) | 71 | ( cd include/opie2 && ln -sf ../../libopie2/opienet/*.h .; ) |
71 | #( cd include/opie2 && ln -sf ../../libopie2/opiepim/*.h .; ) | 72 | #( cd include/opie2 && ln -sf ../../libopie2/opiepim/*.h .; ) |
72 | ( cd include/opie2 && ln -sf ../../libopie2/opieui/*.h .; ) | 73 | ( cd include/opie2 && ln -sf ../../libopie2/opieui/*.h .; ) |
73 | ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ | 74 | ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ |
74 | ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) | 75 | ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) |
75 | ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h | 76 | ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h |
76 | touch $@ | 77 | touch $@ |
77 | 78 | ||
78 | $(OPIEDIR)/stamp-headers-x11 : | 79 | $(OPIEDIR)/stamp-headers-x11 : |
79 | @-rm -f $(OPIEDIR)/stamp-headers* | 80 | @-rm -f $(OPIEDIR)/stamp-headers* |
80 | mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ | 81 | mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ |
81 | $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private | 82 | $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private |
82 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) | 83 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) |
83 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) | 84 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) |
84 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) | 85 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) |
85 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) | 86 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) |
86 | ( cd include/opie && ln -sf ../../libsql/*.h .; ) | 87 | ( cd include/opie && ln -sf ../../libsql/*.h .; ) |
87 | ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) | 88 | ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) |
88 | ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ | 89 | ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ |
89 | ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) | 90 | ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) |
90 | ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h | 91 | ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h |
91 | ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; ) | 92 | ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; ) |
92 | touch $@ | 93 | touch $@ |
93 | 94 | ||
94 | $(TOPDIR)/library/custom.h : $(TOPDIR)/.config | 95 | $(TOPDIR)/library/custom.h : $(TOPDIR)/.config |
95 | @-rm -f $@ | 96 | @-rm -f $@ |
96 | @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\ | 97 | @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\ |
97 | ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@) | 98 | ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@) |
98 | @touch $@ | 99 | @touch $@ |
99 | 100 | ||
100 | $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf $(TOPDIR)/scripts/kconfig/conf $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/qmake/qmake: | 101 | $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf $(TOPDIR)/scripts/kconfig/conf $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/qmake/qmake: |
101 | @$(call descend,$(shell dirname $@),$(shell basename $@)) | 102 | @$(call descend,$(shell dirname $@),$(shell basename $@)) |
102 | 103 | ||
103 | menuconfig: $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf ./config.in | 104 | menuconfig: $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf ./config.in |
104 | $(TOPDIR)/scripts/kconfig/mconf ./config.in | 105 | $(TOPDIR)/scripts/kconfig/mconf ./config.in |
105 | @touch ./.config.stamp | 106 | @touch ./.config.stamp |
106 | 107 | ||
107 | xconfig: $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in | 108 | xconfig: $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in |
108 | $(TOPDIR)/scripts/kconfig/qconf ./config.in | 109 | $(TOPDIR)/scripts/kconfig/qconf ./config.in |
109 | @touch .config.stamp | 110 | @touch .config.stamp |
110 | 111 | ||
111 | gconfig: $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in | 112 | gconfig: $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in |
112 | $(TOPDIR)/scripts/kconfig/gconf ./config.in | 113 | $(TOPDIR)/scripts/kconfig/gconf ./config.in |
113 | @touch .config.stamp | 114 | @touch .config.stamp |
114 | 115 | ||
115 | config: $(TOPDIR)/scripts/kconfig/conf ./config.in | 116 | config: $(TOPDIR)/scripts/kconfig/conf ./config.in |
116 | $(TOPDIR)/scripts/kconfig/conf ./config.in | 117 | $(TOPDIR)/scripts/kconfig/conf ./config.in |
117 | @touch .config.stamp | 118 | @touch .config.stamp |
118 | 119 | ||
119 | oldconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 120 | oldconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
120 | $(TOPDIR)/scripts/kconfig/conf -o ./config.in | 121 | $(TOPDIR)/scripts/kconfig/conf -o ./config.in |
121 | @touch .config.stamp | 122 | @touch .config.stamp |
122 | 123 | ||
123 | randconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 124 | randconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
124 | $(TOPDIR)/scripts/kconfig/conf -r ./config.in | 125 | $(TOPDIR)/scripts/kconfig/conf -r ./config.in |
125 | @touch .config.stamp | 126 | @touch .config.stamp |
126 | 127 | ||
127 | allyesconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 128 | allyesconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
128 | $(TOPDIR)/scripts/kconfig/conf -y ./config.in | 129 | $(TOPDIR)/scripts/kconfig/conf -y ./config.in |
129 | @touch .config.stamp | 130 | @touch .config.stamp |
130 | 131 | ||
131 | allnoconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 132 | allnoconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
132 | $(TOPDIR)/scripts/kconfig/conf -n ./config.in | 133 | $(TOPDIR)/scripts/kconfig/conf -n ./config.in |
133 | @touch .config.stamp | 134 | @touch .config.stamp |
134 | 135 | ||
135 | defconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 136 | defconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
136 | $(TOPDIR)/scripts/kconfig/conf -d ./config.in | 137 | $(TOPDIR)/scripts/kconfig/conf -d ./config.in |
137 | @touch .config.stamp | 138 | @touch .config.stamp |
138 | 139 | ||
139 | $(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default | 140 | $(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default |
140 | 141 | ||
141 | $(TOPDIR)/mkspecs/default : | 142 | $(TOPDIR)/mkspecs/default : |
142 | ln -sf linux-g++ $@ | 143 | ln -sf linux-g++ $@ |
143 | 144 | ||
144 | $(TOPDIR)/scripts/subst : force | 145 | $(TOPDIR)/scripts/subst : force |
145 | @( \ | 146 | @( \ |
146 | echo 's,\$$QPE_VERSION,$(QPE_VERSION),g'; \ | 147 | echo 's,\$$QPE_VERSION,$(QPE_VERSION),g'; \ |
147 | echo 's,\$$OPIE_VERSION,$(OPIE_VERSION),g'; \ | 148 | echo 's,\$$OPIE_VERSION,$(OPIE_VERSION),g'; \ |
148 | echo 's,\$$QTE_VERSION,$(QTE_VERSION),g'; \ | 149 | echo 's,\$$QTE_VERSION,$(QTE_VERSION),g'; \ |
149 | echo 's,\$$QTE_REVISION,$(QTE_REVISION),g'; \ | 150 | echo 's,\$$QTE_REVISION,$(QTE_REVISION),g'; \ |
150 | echo 's,\$$SUB_VERSION,$(SUB_VERSION),g'; \ | 151 | echo 's,\$$SUB_VERSION,$(SUB_VERSION),g'; \ |
151 | echo 's,\$$EXTRAVERSION,$(EXTRAVERSION),g'; \ | 152 | echo 's,\$$EXTRAVERSION,$(EXTRAVERSION),g'; \ |
152 | echo 's,\$$QTE_BASEVERSION,$(QTE_BASEVERSION),g'; \ | 153 | echo 's,\$$QTE_BASEVERSION,$(QTE_BASEVERSION),g'; \ |
153 | ) > $@ || ( rm -f $@; exit 1 ) | 154 | ) > $@ || ( rm -f $@; exit 1 ) |
154 | 155 | ||
155 | $(TOPDIR)/scripts/filesubst : force | 156 | $(TOPDIR)/scripts/filesubst : force |
156 | @( \ | 157 | @( \ |
157 | echo 's,\$$OPIEDIR/root/,/,g'; \ | 158 | echo 's,\$$OPIEDIR/root/,/,g'; \ |
158 | echo 's,$(OPIEDIR)/root/,/,g'; \ | 159 | echo 's,$(OPIEDIR)/root/,/,g'; \ |
159 | echo 's,\$$OPIEDIR,$(prefix),g'; \ | 160 | echo 's,\$$OPIEDIR,$(prefix),g'; \ |
160 | echo 's,$(OPIEDIR),$(prefix),g'; \ | 161 | echo 's,$(OPIEDIR),$(prefix),g'; \ |
161 | echo 's,\$$QTDIR,$(prefix),g'; \ | 162 | echo 's,\$$QTDIR,$(prefix),g'; \ |
162 | echo 's,$(QTDIR),$(prefix),g'; \ | 163 | echo 's,$(QTDIR),$(prefix),g'; \ |
163 | echo 's,^\(\./\)*root/,/,g'; \ | 164 | echo 's,^\(\./\)*root/,/,g'; \ |
164 | echo 's,^\(\./\)*etc/,$(prefix)/etc/,g'; \ | 165 | echo 's,^\(\./\)*etc/,$(prefix)/etc/,g'; \ |
165 | echo 's,^\(\./\)*lib/,$(prefix)/lib/,g'; \ | 166 | echo 's,^\(\./\)*lib/,$(prefix)/lib/,g'; \ |
166 | echo 's,^\(\./\)*bin/,$(prefix)/bin/,g'; \ | 167 | echo 's,^\(\./\)*bin/,$(prefix)/bin/,g'; \ |
167 | echo 's,^\(\./\)*pics/,$(prefix)/pics/,g'; \ | 168 | echo 's,^\(\./\)*pics/,$(prefix)/pics/,g'; \ |
168 | echo 's,^\(\./\)*sounds/,$(prefix)/sounds/,g'; \ | 169 | echo 's,^\(\./\)*sounds/,$(prefix)/sounds/,g'; \ |
169 | echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ | 170 | echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ |
170 | echo 's,^\(\./\)*plugins/,$(prefix)/plugins/,g'; \ | 171 | echo 's,^\(\./\)*plugins/,$(prefix)/plugins/,g'; \ |
171 | echo 's,^\(\./\)*apps/,$(prefix)/apps/,g'; \ | 172 | echo 's,^\(\./\)*apps/,$(prefix)/apps/,g'; \ |
172 | echo 's,^\(\./\)*share/,$(prefix)/share/,g'; \ | 173 | echo 's,^\(\./\)*share/,$(prefix)/share/,g'; \ |
173 | echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ | 174 | echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ |
174 | echo 's,^\(\./\)*help/,$(prefix)/help/,g'; \ | 175 | echo 's,^\(\./\)*help/,$(prefix)/help/,g'; \ |
175 | ) > $@ || ( rm -f $@; exit 1 ) | 176 | ) > $@ || ( rm -f $@; exit 1 ) |
176 | 177 | ||
177 | ## general rules ## | 178 | ## general rules ## |
178 | 179 | ||
179 | define descend | 180 | define descend |
180 | $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2) | 181 | $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2) |
181 | endef | 182 | endef |
182 | 183 | ||
183 | define makefilegen | 184 | define makefilegen |
184 | cd $(if $(1),$(shell dirname $(1))); $(TOPDIR)/qmake/qmake $(3) -o $(if $(1),$(shell basename $(1))) `cat $(OPIEDIR)/packages | grep " \`echo $(1)|sed -e 's,/Makefile$$,,'\`" | \ | 185 | cd $(if $(1),$(shell dirname $(1))); $(TOPDIR)/qmake/qmake $(3) -o $(if $(1),$(shell basename $(1))) `cat $(OPIEDIR)/packages | grep " \`echo $(1)|sed -e 's,/Makefile$$,,'\`" | \ |
185 | head -1 | awk '{print $$3}'` | 186 | head -1 | awk '{print $$3}'` |
186 | endef | 187 | endef |
187 | 188 | ||
188 | define makecfg | 189 | define makecfg |
189 | $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR) | 190 | $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR) |
190 | endef | 191 | endef |
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 0205622..b612aa2 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -192,392 +192,393 @@ void CategoryTabWidget::addItem( const QString& linkfile ) | |||
192 | // return; | 192 | // return; |
193 | // } | 193 | // } |
194 | // i++; | 194 | // i++; |
195 | // } | 195 | // } |
196 | // } | 196 | // } |
197 | 197 | ||
198 | QCopEnvelope e("QPE/TaskBar","reloadApps()"); | 198 | QCopEnvelope e("QPE/TaskBar","reloadApps()"); |
199 | } | 199 | } |
200 | 200 | ||
201 | void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | 201 | void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, |
202 | AppLnkSet* /*docFolder*/, const QList<FileSystem> & /*fs*/) | 202 | AppLnkSet* /*docFolder*/, const QList<FileSystem> & /*fs*/) |
203 | { | 203 | { |
204 | QString current; | 204 | QString current; |
205 | if ( categoryBar ) { | 205 | if ( categoryBar ) { |
206 | int c = categoryBar->currentTab(); | 206 | int c = categoryBar->currentTab(); |
207 | if ( c >= 0 ) current = ids[c]; | 207 | if ( c >= 0 ) current = ids[c]; |
208 | } | 208 | } |
209 | 209 | ||
210 | delete categoryBar; | 210 | delete categoryBar; |
211 | categoryBar = new CategoryTabBar( this ); | 211 | categoryBar = new CategoryTabBar( this ); |
212 | QPalette pal = categoryBar->palette(); | 212 | QPalette pal = categoryBar->palette(); |
213 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); | 213 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); |
214 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); | 214 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); |
215 | categoryBar->setPalette( pal ); | 215 | categoryBar->setPalette( pal ); |
216 | 216 | ||
217 | delete stack; | 217 | delete stack; |
218 | stack = new QWidgetStack(this); | 218 | stack = new QWidgetStack(this); |
219 | tabs=0; | 219 | tabs=0; |
220 | 220 | ||
221 | ids.clear(); | 221 | ids.clear(); |
222 | 222 | ||
223 | Config cfg("Launcher"); | 223 | Config cfg("Launcher"); |
224 | 224 | ||
225 | QStringList types = rootFolder->types(); | 225 | QStringList types = rootFolder->types(); |
226 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { | 226 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { |
227 | if ( !(*it).isEmpty() ) { | 227 | if ( !(*it).isEmpty() ) { |
228 | (void)newView(*it,rootFolder->typePixmap(*it),rootFolder->typeName(*it)); | 228 | (void)newView(*it,rootFolder->typePixmap(*it),rootFolder->typeName(*it)); |
229 | setTabAppearance( *it, cfg ); | 229 | setTabAppearance( *it, cfg ); |
230 | } | 230 | } |
231 | } | 231 | } |
232 | QListIterator<AppLnk> it( rootFolder->children() ); | 232 | QListIterator<AppLnk> it( rootFolder->children() ); |
233 | AppLnk* l; | 233 | AppLnk* l; |
234 | while ( (l=it.current()) ) { | 234 | while ( (l=it.current()) ) { |
235 | if ( l->type() == "Separator" ) { // No tr | 235 | if ( l->type() == "Separator" ) { // No tr |
236 | rootFolder->remove(l); | 236 | rootFolder->remove(l); |
237 | delete l; | 237 | delete l; |
238 | } else { | 238 | } else { |
239 | int i=0; | 239 | int i=0; |
240 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { | 240 | for ( QStringList::Iterator it=types.begin(); it!=types.end(); ++it) { |
241 | if ( *it == l->type() ) | 241 | if ( *it == l->type() ) |
242 | ((LauncherView*)stack->widget(i))->addItem(l,FALSE); | 242 | ((LauncherView*)stack->widget(i))->addItem(l,FALSE); |
243 | i++; | 243 | i++; |
244 | } | 244 | } |
245 | } | 245 | } |
246 | ++it; | 246 | ++it; |
247 | } | 247 | } |
248 | rootFolder->detachChildren(); | 248 | rootFolder->detachChildren(); |
249 | for (int i=0; i<tabs; i++) | 249 | for (int i=0; i<tabs; i++) |
250 | ((LauncherView*)stack->widget(i))->sort(); | 250 | ((LauncherView*)stack->widget(i))->sort(); |
251 | 251 | ||
252 | // all documents | 252 | // all documents |
253 | QImage img( Resource::loadImage( "DocsIcon" ) ); | 253 | QImage img( Resource::loadImage( "DocsIcon" ) ); |
254 | QPixmap pm; | 254 | QPixmap pm; |
255 | pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | 255 | pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
256 | 256 | ||
257 | //ljpotter | 257 | //ljpotter |
258 | CategoryTab *catTab ; | 258 | CategoryTab *catTab ; |
259 | catTab = new CategoryTab( pm, "Documents" ); | 259 | catTab = new CategoryTab( pm, "Documents" ); |
260 | 260 | ||
261 | categoryBar->addTab( catTab ); | 261 | categoryBar->addTab( catTab ); |
262 | 262 | ||
263 | fileSel = new DocumentTab( stack, 4, 0, "/",""); | 263 | fileSel = new DocumentTab( stack, 4, 0, "/",""); |
264 | stack->addWidget( fileSel, tabs++ ); | 264 | stack->addWidget( fileSel, tabs++ ); |
265 | 265 | ||
266 | // fileSel->hide(); | 266 | // fileSel->hide(); |
267 | 267 | ||
268 | connect( fileSel, SIGNAL( fileSelected( const DocLnk & )), | 268 | connect( fileSel, SIGNAL( fileSelected( const DocLnk & )), |
269 | this, SLOT(clickie(const DocLnk&)) ); | 269 | this, SLOT(clickie(const DocLnk&)) ); |
270 | 270 | ||
271 | // connect( fileSel, SIGNAL( fileSelected( const QString & )), | 271 | // connect( fileSel, SIGNAL( fileSelected( const QString & )), |
272 | // this, SLOT(clickie(const QString&)) ); | 272 | // this, SLOT(clickie(const QString&)) ); |
273 | 273 | ||
274 | connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); | 274 | connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); |
275 | 275 | ||
276 | ((LauncherView*)stack->widget(0))->setFocus(); | 276 | ((LauncherView*)stack->widget(0))->setFocus(); |
277 | 277 | ||
278 | cfg. setGroup ( "GUI" ); | 278 | cfg. setGroup ( "GUI" ); |
279 | setBusyIndicatorType ( cfg. readEntry ( "BusyType", QString::null )); | 279 | setBusyIndicatorType ( cfg. readEntry ( "BusyType", QString::null )); |
280 | 280 | ||
281 | if ( !current.isNull() ) { | 281 | if ( !current.isNull() ) { |
282 | showTab(current); | 282 | showTab(current); |
283 | } | 283 | } |
284 | 284 | ||
285 | categoryBar->show(); | 285 | categoryBar->show(); |
286 | stack->show(); | 286 | stack->show(); |
287 | 287 | ||
288 | 288 | ||
289 | QCopEnvelope e("QPE/TaskBar","reloadApps()"); | 289 | QCopEnvelope e("QPE/TaskBar","reloadApps()"); |
290 | } | 290 | } |
291 | 291 | ||
292 | void CategoryTabWidget::clickie(const DocLnk &lnk) { | 292 | void CategoryTabWidget::clickie(const DocLnk &lnk) { |
293 | lnk.execute(); | 293 | lnk.execute(); |
294 | // fileSel->reparse(); | 294 | // fileSel->reparse(); |
295 | } | 295 | } |
296 | 296 | ||
297 | void CategoryTabWidget::clickie(const QString &appStr) { | 297 | void CategoryTabWidget::clickie(const QString &appStr) { |
298 | // DocLnk lnk(appStr); | 298 | // DocLnk lnk(appStr); |
299 | // lnk.execute(); | 299 | // lnk.execute(); |
300 | } | 300 | } |
301 | 301 | ||
302 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) | 302 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) |
303 | { | 303 | { |
304 | QString grp( "Tab %1" ); // No tr | 304 | QString grp( "Tab %1" ); // No tr |
305 | cfg.setGroup( grp.arg(id) ); | 305 | cfg.setGroup( grp.arg(id) ); |
306 | LauncherView *v = view( id ); | 306 | LauncherView *v = view( id ); |
307 | int idx = ids.findIndex( id ); | 307 | int idx = ids.findIndex( id ); |
308 | CategoryTab *tab = (CategoryTab *)categoryBar->tab( idx ); | 308 | CategoryTab *tab = (CategoryTab *)categoryBar->tab( idx ); |
309 | 309 | ||
310 | // View | 310 | // View |
311 | QString view = cfg.readEntry( "View", "Icon" ); | 311 | QString view = cfg.readEntry( "View", "Icon" ); |
312 | if ( view == "List" ) // No tr | 312 | if ( view == "List" ) // No tr |
313 | v->setViewMode( LauncherView::List ); | 313 | v->setViewMode( LauncherView::List ); |
314 | QString bgType = cfg.readEntry( "BackgroundType", "Image" ); | 314 | QString bgType = cfg.readEntry( "BackgroundType", "Image" ); |
315 | if ( bgType == "Image" ) { // No tr | 315 | if ( bgType == "Image" ) { // No tr |
316 | QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" ); | 316 | QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" ); |
317 | v->setBackgroundType( LauncherView::Image, pm ); | 317 | v->setBackgroundType( LauncherView::Image, pm ); |
318 | } else if ( bgType == "SolidColor" ) { | 318 | } else if ( bgType == "SolidColor" ) { |
319 | QString c = cfg.readEntry( "BackgroundColor" ); | 319 | QString c = cfg.readEntry( "BackgroundColor" ); |
320 | v->setBackgroundType( LauncherView::SolidColor, c ); | 320 | v->setBackgroundType( LauncherView::SolidColor, c ); |
321 | } | 321 | } |
322 | QString textCol = cfg.readEntry( "TextColor" ); | 322 | QString textCol = cfg.readEntry( "TextColor" ); |
323 | if ( textCol.isEmpty() ) | 323 | if ( textCol.isEmpty() ) |
324 | v->setTextColor( QColor() ); | 324 | v->setTextColor( QColor() ); |
325 | else | 325 | else |
326 | v->setTextColor( QColor(textCol) ); | 326 | v->setTextColor( QColor(textCol) ); |
327 | QStringList font = cfg.readListEntry( "Font", ',' ); | 327 | QStringList font = cfg.readListEntry( "Font", ',' ); |
328 | if ( font.count() == 4 ) | 328 | if ( font.count() == 4 ) |
329 | v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) ); | 329 | v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) ); |
330 | 330 | ||
331 | // Tabs | 331 | // Tabs |
332 | QString tabCol = cfg.readEntry( "TabColor" ); | 332 | QString tabCol = cfg.readEntry( "TabColor" ); |
333 | if ( tabCol.isEmpty() ) | 333 | if ( tabCol.isEmpty() ) |
334 | tab->bgColor = QColor(); | 334 | tab->bgColor = QColor(); |
335 | else | 335 | else |
336 | tab->bgColor = QColor(tabCol); | 336 | tab->bgColor = QColor(tabCol); |
337 | QString tabTextCol = cfg.readEntry( "TabTextColor" ); | 337 | QString tabTextCol = cfg.readEntry( "TabTextColor" ); |
338 | if ( tabTextCol.isEmpty() ) | 338 | if ( tabTextCol.isEmpty() ) |
339 | tab->fgColor = QColor(); | 339 | tab->fgColor = QColor(); |
340 | else | 340 | else |
341 | tab->fgColor = QColor(tabTextCol); | 341 | tab->fgColor = QColor(tabTextCol); |
342 | } | 342 | } |
343 | 343 | ||
344 | //void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> & /*fs*/) | 344 | //void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> & /*fs*/) |
345 | //{ | 345 | //{ |
346 | // docFolder->detachChildren(); | 346 | // docFolder->detachChildren(); |
347 | //} | 347 | //} |
348 | 348 | ||
349 | void CategoryTabWidget::tabProperties() | 349 | void CategoryTabWidget::tabProperties() |
350 | { | 350 | { |
351 | LauncherView *view = (LauncherView*)stack->widget( categoryBar->currentTab() ); | 351 | LauncherView *view = (LauncherView*)stack->widget( categoryBar->currentTab() ); |
352 | QPopupMenu *m = new QPopupMenu( this ); | 352 | QPopupMenu *m = new QPopupMenu( this ); |
353 | m->insertItem( tr("Icon View"), LauncherView::Icon ); | 353 | m->insertItem( tr("Icon View"), LauncherView::Icon ); |
354 | m->insertItem( tr("List View"), LauncherView::List ); | 354 | m->insertItem( tr("List View"), LauncherView::List ); |
355 | m->setItemChecked( (int)view->viewMode(), TRUE ); | 355 | m->setItemChecked( (int)view->viewMode(), TRUE ); |
356 | int rv = m->exec( QCursor::pos() ); | 356 | int rv = m->exec( QCursor::pos() ); |
357 | if ( rv >= 0 && rv != view->viewMode() ) { | 357 | if ( rv >= 0 && rv != view->viewMode() ) { |
358 | view->setViewMode( (LauncherView::ViewMode)rv ); | 358 | view->setViewMode( (LauncherView::ViewMode)rv ); |
359 | } | 359 | } |
360 | 360 | ||
361 | delete m; | 361 | delete m; |
362 | } | 362 | } |
363 | 363 | ||
364 | QString CategoryTabWidget::getAllDocLinkInfo() const | 364 | QString CategoryTabWidget::getAllDocLinkInfo() const |
365 | { | 365 | { |
366 | return ""; | 366 | return ""; |
367 | } | 367 | } |
368 | 368 | ||
369 | LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm, const QString& label ) | 369 | LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm, const QString& label ) |
370 | { | 370 | { |
371 | LauncherView* view = new LauncherView( stack ); | 371 | LauncherView* view = new LauncherView( stack ); |
372 | connect( view, SIGNAL(clicked(const AppLnk*)), | 372 | connect( view, SIGNAL(clicked(const AppLnk*)), |
373 | this, SIGNAL(clicked(const AppLnk*))); | 373 | this, SIGNAL(clicked(const AppLnk*))); |
374 | connect( view, SIGNAL(rightPressed(AppLnk*)), | 374 | connect( view, SIGNAL(rightPressed(AppLnk*)), |
375 | this, SIGNAL(rightPressed(AppLnk*))); | 375 | this, SIGNAL(rightPressed(AppLnk*))); |
376 | ids.append(id); | 376 | ids.append(id); |
377 | categoryBar->addTab( new CategoryTab( pm, label ) ); | 377 | categoryBar->addTab( new CategoryTab( pm, label ) ); |
378 | stack->addWidget( view, tabs++ ); | 378 | stack->addWidget( view, tabs++ ); |
379 | return view; | 379 | return view; |
380 | } | 380 | } |
381 | 381 | ||
382 | void CategoryTabWidget::updateLink(const QString& linkfile) | 382 | void CategoryTabWidget::updateLink(const QString& linkfile) |
383 | { | 383 | { |
384 | // LauncherView* view; | 384 | int i=0; |
385 | qApp->processEvents(); | 385 | LauncherView* view; |
386 | // while ((view = (LauncherView*)stack->widget(i++))) { | 386 | //qApp->processEvents(); |
387 | // if ( view->removeLink(linkfile) ) | 387 | while ((view = (LauncherView*)stack->widget(i++))) { |
388 | // break; | 388 | if ( view->removeLink(linkfile) ) |
389 | // } | 389 | break; |
390 | // addItem(linkfile); | 390 | } |
391 | fileSel->reparse(); | 391 | addItem(linkfile); |
392 | docview->updateTools(); | ||
392 | } | 393 | } |
393 | 394 | ||
394 | void CategoryTabWidget::paletteChange( const QPalette &p ) | 395 | void CategoryTabWidget::paletteChange( const QPalette &p ) |
395 | { | 396 | { |
396 | QVBox::paletteChange( p ); | 397 | QVBox::paletteChange( p ); |
397 | QPalette pal = palette(); | 398 | QPalette pal = palette(); |
398 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); | 399 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); |
399 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); | 400 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); |
400 | categoryBar->setPalette( pal ); | 401 | categoryBar->setPalette( pal ); |
401 | categoryBar->update(); | 402 | categoryBar->update(); |
402 | } | 403 | } |
403 | 404 | ||
404 | void CategoryTabWidget::setBusy(bool on) | 405 | void CategoryTabWidget::setBusy(bool on) |
405 | { | 406 | { |
406 | if ( on ) | 407 | if ( on ) |
407 | ((LauncherView*)stack->visibleWidget())->setBusy(TRUE); | 408 | ((LauncherView*)stack->visibleWidget())->setBusy(TRUE); |
408 | else | 409 | else |
409 | for (int i=0; i<tabs-1; i++) | 410 | for (int i=0; i<tabs-1; i++) |
410 | ((LauncherView*)stack->widget(i))->setBusy(FALSE); | 411 | ((LauncherView*)stack->widget(i))->setBusy(FALSE); |
411 | } | 412 | } |
412 | 413 | ||
413 | LauncherView *CategoryTabWidget::view( const QString &id ) | 414 | LauncherView *CategoryTabWidget::view( const QString &id ) |
414 | { | 415 | { |
415 | int idx = ids.findIndex( id ); | 416 | int idx = ids.findIndex( id ); |
416 | return (LauncherView *)stack->widget(idx); | 417 | return (LauncherView *)stack->widget(idx); |
417 | } | 418 | } |
418 | 419 | ||
419 | void CategoryTabWidget::setBusyIndicatorType ( const QString &type ) | 420 | void CategoryTabWidget::setBusyIndicatorType ( const QString &type ) |
420 | { | 421 | { |
421 | for ( QStringList::Iterator it = ids. begin ( ); it != ids. end ( ); ++it ) | 422 | for ( QStringList::Iterator it = ids. begin ( ); it != ids. end ( ); ++it ) |
422 | view ( *it )-> setBusyIndicatorType ( type ); | 423 | view ( *it )-> setBusyIndicatorType ( type ); |
423 | } | 424 | } |
424 | 425 | ||
425 | //=========================================================================== | 426 | //=========================================================================== |
426 | 427 | ||
427 | CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name ) | 428 | CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name ) |
428 | : QTabBar( parent, name ) | 429 | : QTabBar( parent, name ) |
429 | { | 430 | { |
430 | setFocusPolicy( NoFocus ); | 431 | setFocusPolicy( NoFocus ); |
431 | connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) ); | 432 | connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) ); |
432 | } | 433 | } |
433 | 434 | ||
434 | CategoryTabBar::~CategoryTabBar() | 435 | CategoryTabBar::~CategoryTabBar() |
435 | { | 436 | { |
436 | } | 437 | } |
437 | 438 | ||
438 | void CategoryTabBar::layoutTabs() | 439 | void CategoryTabBar::layoutTabs() |
439 | { | 440 | { |
440 | if ( !count() ) | 441 | if ( !count() ) |
441 | return; | 442 | return; |
442 | 443 | ||
443 | // int percentFalloffTable[] = { 100, 70, 40, 12, 6, 3, 1, 0 }; | 444 | // int percentFalloffTable[] = { 100, 70, 40, 12, 6, 3, 1, 0 }; |
444 | int available = width()-1; | 445 | int available = width()-1; |
445 | QFontMetrics fm = fontMetrics(); | 446 | QFontMetrics fm = fontMetrics(); |
446 | int hiddenTabWidth = -7; | 447 | int hiddenTabWidth = -7; |
447 | int middleTab = currentTab(); | 448 | int middleTab = currentTab(); |
448 | int hframe, vframe, overlap; | 449 | int hframe, vframe, overlap; |
449 | style().tabbarMetrics( this, hframe, vframe, overlap ); | 450 | style().tabbarMetrics( this, hframe, vframe, overlap ); |
450 | int x = 0; | 451 | int x = 0; |
451 | QRect r; | 452 | QRect r; |
452 | QTab *t; | 453 | QTab *t; |
453 | int required = 0; | 454 | int required = 0; |
454 | int eventabwidth = (width()-1)/count(); | 455 | int eventabwidth = (width()-1)/count(); |
455 | enum Mode { HideBackText, Pack, Even } mode=Even; | 456 | enum Mode { HideBackText, Pack, Even } mode=Even; |
456 | for ( int i = 0; i < count(); i++ ) { | 457 | for ( int i = 0; i < count(); i++ ) { |
457 | t = tab(i); | 458 | t = tab(i); |
458 | int iw = fm.width( t->text() ) + hframe - overlap; | 459 | int iw = fm.width( t->text() ) + hframe - overlap; |
459 | if ( i != middleTab ) { | 460 | if ( i != middleTab ) { |
460 | available -= hiddenTabWidth + hframe - overlap; | 461 | available -= hiddenTabWidth + hframe - overlap; |
461 | if ( t->iconSet() != 0 ) | 462 | if ( t->iconSet() != 0 ) |
462 | available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 463 | available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); |
463 | } | 464 | } |
464 | if ( t->iconSet() != 0 ) | 465 | if ( t->iconSet() != 0 ) |
465 | iw += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 466 | iw += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); |
466 | required += iw; | 467 | required += iw; |
467 | // As space gets tight, packed looks better than even. "10" must be at least 0. | 468 | // As space gets tight, packed looks better than even. "10" must be at least 0. |
468 | if ( iw >= eventabwidth-10 ) | 469 | if ( iw >= eventabwidth-10 ) |
469 | mode = Pack; | 470 | mode = Pack; |
470 | } | 471 | } |
471 | if ( mode == Pack && required > width()-1 ) | 472 | if ( mode == Pack && required > width()-1 ) |
472 | mode = HideBackText; | 473 | mode = HideBackText; |
473 | for ( int i = 0; i < count(); i++ ) { | 474 | for ( int i = 0; i < count(); i++ ) { |
474 | t = tab(i); | 475 | t = tab(i); |
475 | if ( mode != HideBackText ) { | 476 | if ( mode != HideBackText ) { |
476 | int w = fm.width( t->text() ); | 477 | int w = fm.width( t->text() ); |
477 | int ih = 0; | 478 | int ih = 0; |
478 | if ( t->iconSet() != 0 ) { | 479 | if ( t->iconSet() != 0 ) { |
479 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 480 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); |
480 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 481 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); |
481 | } | 482 | } |
482 | int h = QMAX( fm.height(), ih ); | 483 | int h = QMAX( fm.height(), ih ); |
483 | h = QMAX( h, QApplication::globalStrut().height() ); | 484 | h = QMAX( h, QApplication::globalStrut().height() ); |
484 | 485 | ||
485 | h += vframe; | 486 | h += vframe; |
486 | w += hframe; | 487 | w += hframe; |
487 | 488 | ||
488 | QRect tr(x, 0, | 489 | QRect tr(x, 0, |
489 | mode == Even ? eventabwidth : w * (width()-1)/required, h); | 490 | mode == Even ? eventabwidth : w * (width()-1)/required, h); |
490 | t->setRect(tr); | 491 | t->setRect(tr); |
491 | x += tr.width() - overlap; | 492 | x += tr.width() - overlap; |
492 | r = r.unite(tr); | 493 | r = r.unite(tr); |
493 | } else if ( i != middleTab ) { | 494 | } else if ( i != middleTab ) { |
494 | int w = hiddenTabWidth; | 495 | int w = hiddenTabWidth; |
495 | int ih = 0; | 496 | int ih = 0; |
496 | if ( t->iconSet() != 0 ) { | 497 | if ( t->iconSet() != 0 ) { |
497 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); | 498 | w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width(); |
498 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 499 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); |
499 | } | 500 | } |
500 | int h = QMAX( fm.height(), ih ); | 501 | int h = QMAX( fm.height(), ih ); |
501 | h = QMAX( h, QApplication::globalStrut().height() ); | 502 | h = QMAX( h, QApplication::globalStrut().height() ); |
502 | 503 | ||
503 | h += vframe; | 504 | h += vframe; |
504 | w += hframe; | 505 | w += hframe; |
505 | 506 | ||
506 | t->setRect( QRect(x, 0, w, h) ); | 507 | t->setRect( QRect(x, 0, w, h) ); |
507 | x += t->rect().width() - overlap; | 508 | x += t->rect().width() - overlap; |
508 | r = r.unite( t->rect() ); | 509 | r = r.unite( t->rect() ); |
509 | } else { | 510 | } else { |
510 | int ih = 0; | 511 | int ih = 0; |
511 | if ( t->iconSet() != 0 ) { | 512 | if ( t->iconSet() != 0 ) { |
512 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 513 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); |
513 | } | 514 | } |
514 | int h = QMAX( fm.height(), ih ); | 515 | int h = QMAX( fm.height(), ih ); |
515 | h = QMAX( h, QApplication::globalStrut().height() ); | 516 | h = QMAX( h, QApplication::globalStrut().height() ); |
516 | 517 | ||
517 | h += vframe; | 518 | h += vframe; |
518 | 519 | ||
519 | t->setRect( QRect(x, 0, available, h) ); | 520 | t->setRect( QRect(x, 0, available, h) ); |
520 | x += t->rect().width() - overlap; | 521 | x += t->rect().width() - overlap; |
521 | r = r.unite( t->rect() ); | 522 | r = r.unite( t->rect() ); |
522 | } | 523 | } |
523 | } | 524 | } |
524 | 525 | ||
525 | QRect rr = tab(count()-1)->rect(); | 526 | QRect rr = tab(count()-1)->rect(); |
526 | rr.setRight(width()-1); | 527 | rr.setRight(width()-1); |
527 | tab(count()-1)->setRect( rr ); | 528 | tab(count()-1)->setRect( rr ); |
528 | 529 | ||
529 | for ( t = tabList()->first(); t; t = tabList()->next() ) { | 530 | for ( t = tabList()->first(); t; t = tabList()->next() ) { |
530 | QRect tr = t->rect(); | 531 | QRect tr = t->rect(); |
531 | tr.setHeight( r.height() ); | 532 | tr.setHeight( r.height() ); |
532 | t->setRect( tr ); | 533 | t->setRect( tr ); |
533 | } | 534 | } |
534 | 535 | ||
535 | update(); | 536 | update(); |
536 | } | 537 | } |
537 | 538 | ||
538 | 539 | ||
539 | void CategoryTabBar::paint( QPainter * p, QTab * t, bool selected ) const | 540 | void CategoryTabBar::paint( QPainter * p, QTab * t, bool selected ) const |
540 | { | 541 | { |
541 | CategoryTabBar *that = (CategoryTabBar *) this; | 542 | CategoryTabBar *that = (CategoryTabBar *) this; |
542 | CategoryTab *ct = (CategoryTab *)t; | 543 | CategoryTab *ct = (CategoryTab *)t; |
543 | QPalette pal = palette(); | 544 | QPalette pal = palette(); |
544 | bool setPal = FALSE; | 545 | bool setPal = FALSE; |
545 | if ( ct->bgColor.isValid() ) { | 546 | if ( ct->bgColor.isValid() ) { |
546 | pal.setColor( QPalette::Active, QColorGroup::Background, ct->bgColor ); | 547 | pal.setColor( QPalette::Active, QColorGroup::Background, ct->bgColor ); |
547 | pal.setColor( QPalette::Active, QColorGroup::Button, ct->bgColor ); | 548 | pal.setColor( QPalette::Active, QColorGroup::Button, ct->bgColor ); |
548 | pal.setColor( QPalette::Inactive, QColorGroup::Background, ct->bgColor ); | 549 | pal.setColor( QPalette::Inactive, QColorGroup::Background, ct->bgColor ); |
549 | pal.setColor( QPalette::Inactive, QColorGroup::Button, ct->bgColor ); | 550 | pal.setColor( QPalette::Inactive, QColorGroup::Button, ct->bgColor ); |
550 | that->setUpdatesEnabled( FALSE ); | 551 | that->setUpdatesEnabled( FALSE ); |
551 | that->setPalette( pal ); | 552 | that->setPalette( pal ); |
552 | setPal = TRUE; | 553 | setPal = TRUE; |
553 | } | 554 | } |
554 | #if QT_VERSION >= 300 | 555 | #if QT_VERSION >= 300 |
555 | QStyle::SFlags flags = QStyle::Style_Default; | 556 | QStyle::SFlags flags = QStyle::Style_Default; |
556 | if ( selected ) | 557 | if ( selected ) |
557 | flags |= QStyle::Style_Selected; | 558 | flags |= QStyle::Style_Selected; |
558 | style().drawControl( QStyle::CE_TabBarTab, p, this, t->rect(), | 559 | style().drawControl( QStyle::CE_TabBarTab, p, this, t->rect(), |
559 | colorGroup(), flags, QStyleOption(t) ); | 560 | colorGroup(), flags, QStyleOption(t) ); |
560 | #else | 561 | #else |
561 | style().drawTab( p, this, t, selected ); | 562 | style().drawTab( p, this, t, selected ); |
562 | #endif | 563 | #endif |
563 | 564 | ||
564 | QRect r( t->rect() ); | 565 | QRect r( t->rect() ); |
565 | QFont f( font() ); | 566 | QFont f( font() ); |
566 | if ( selected ) | 567 | if ( selected ) |
567 | f.setBold( TRUE ); | 568 | f.setBold( TRUE ); |
568 | p->setFont( f ); | 569 | p->setFont( f ); |
569 | 570 | ||
570 | if ( ct->fgColor.isValid() ) { | 571 | if ( ct->fgColor.isValid() ) { |
571 | pal.setColor( QPalette::Active, QColorGroup::Foreground, ct->fgColor ); | 572 | pal.setColor( QPalette::Active, QColorGroup::Foreground, ct->fgColor ); |
572 | pal.setColor( QPalette::Inactive, QColorGroup::Foreground, ct->fgColor ); | 573 | pal.setColor( QPalette::Inactive, QColorGroup::Foreground, ct->fgColor ); |
573 | that->setUpdatesEnabled( FALSE ); | 574 | that->setUpdatesEnabled( FALSE ); |
574 | that->setPalette( pal ); | 575 | that->setPalette( pal ); |
575 | setPal = TRUE; | 576 | setPal = TRUE; |
576 | } | 577 | } |
577 | int iw = 0; | 578 | int iw = 0; |
578 | int ih = 0; | 579 | int ih = 0; |
579 | if ( t->iconSet() != 0 ) { | 580 | if ( t->iconSet() != 0 ) { |
580 | iw = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 2; | 581 | iw = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 2; |
581 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); | 582 | ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height(); |
582 | } | 583 | } |
583 | int w = iw + p->fontMetrics().width( t->text() ) + 4; | 584 | int w = iw + p->fontMetrics().width( t->text() ) + 4; |
@@ -1152,204 +1153,204 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | |||
1152 | // Categories cats; | 1153 | // Categories cats; |
1153 | for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) { | 1154 | for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) { |
1154 | DocLnk *doc = it.current(); | 1155 | DocLnk *doc = it.current(); |
1155 | QFileInfo fi( doc->file() ); | 1156 | QFileInfo fi( doc->file() ); |
1156 | if ( !fi.exists() ) | 1157 | if ( !fi.exists() ) |
1157 | continue; | 1158 | continue; |
1158 | 1159 | ||
1159 | bool fake = !doc->linkFileKnown(); | 1160 | bool fake = !doc->linkFileKnown(); |
1160 | if ( !fake ) { | 1161 | if ( !fake ) { |
1161 | QFile f( doc->linkFile() ); | 1162 | QFile f( doc->linkFile() ); |
1162 | if ( f.open( IO_ReadOnly ) ) { | 1163 | if ( f.open( IO_ReadOnly ) ) { |
1163 | QTextStream ts( &f ); | 1164 | QTextStream ts( &f ); |
1164 | ts.setEncoding( QTextStream::UnicodeUTF8 ); | 1165 | ts.setEncoding( QTextStream::UnicodeUTF8 ); |
1165 | contents += ts.read(); | 1166 | contents += ts.read(); |
1166 | f.close(); | 1167 | f.close(); |
1167 | } else | 1168 | } else |
1168 | fake = TRUE; | 1169 | fake = TRUE; |
1169 | } | 1170 | } |
1170 | if (fake) { | 1171 | if (fake) { |
1171 | contents += "[Desktop Entry]\n"; | 1172 | contents += "[Desktop Entry]\n"; |
1172 | contents += "Categories = " + // No tr | 1173 | contents += "Categories = " + // No tr |
1173 | // cats.labels("Document View",doc->categories()).join(";") + "\n"; // No tr | 1174 | // cats.labels("Document View",doc->categories()).join(";") + "\n"; // No tr |
1174 | Qtopia::Record::idsToString( doc->categories() ) + "\n"; | 1175 | Qtopia::Record::idsToString( doc->categories() ) + "\n"; |
1175 | contents += "Name = "+doc->name()+"\n"; // No tr | 1176 | contents += "Name = "+doc->name()+"\n"; // No tr |
1176 | contents += "Type = "+doc->type()+"\n"; // No tr | 1177 | contents += "Type = "+doc->type()+"\n"; // No tr |
1177 | } | 1178 | } |
1178 | contents += "File = "+doc->file()+"\n"; // No tr // (resolves path) | 1179 | contents += "File = "+doc->file()+"\n"; // No tr // (resolves path) |
1179 | contents += QString("Size = %1\n").arg( fi.size() ); // No tr | 1180 | contents += QString("Size = %1\n").arg( fi.size() ); // No tr |
1180 | } | 1181 | } |
1181 | 1182 | ||
1182 | //qDebug( "sending length %d", contents.length() ); | 1183 | //qDebug( "sending length %d", contents.length() ); |
1183 | #ifndef QT_NO_COP | 1184 | #ifndef QT_NO_COP |
1184 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); | 1185 | QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" ); |
1185 | e << contents; | 1186 | e << contents; |
1186 | #endif | 1187 | #endif |
1187 | 1188 | ||
1188 | //qDebug( "================ \n\n%s\n\n===============", | 1189 | //qDebug( "================ \n\n%s\n\n===============", |
1189 | //contents.latin1() ); | 1190 | //contents.latin1() ); |
1190 | 1191 | ||
1191 | delete docsFolder; | 1192 | delete docsFolder; |
1192 | docsFolder = 0; | 1193 | docsFolder = 0; |
1193 | #ifdef QWS | 1194 | #ifdef QWS |
1194 | } else if ( msg == "setMouseProto(QString)" ) { | 1195 | } else if ( msg == "setMouseProto(QString)" ) { |
1195 | QString mice; | 1196 | QString mice; |
1196 | stream >> mice; | 1197 | stream >> mice; |
1197 | setenv("QWS_MOUSE_PROTO",mice.latin1(),1); | 1198 | setenv("QWS_MOUSE_PROTO",mice.latin1(),1); |
1198 | qwsServer->openMouse(); | 1199 | qwsServer->openMouse(); |
1199 | } else if ( msg == "setKeyboard(QString)" ) { | 1200 | } else if ( msg == "setKeyboard(QString)" ) { |
1200 | QString kb; | 1201 | QString kb; |
1201 | stream >> kb; | 1202 | stream >> kb; |
1202 | setenv("QWS_KEYBOARD",kb.latin1(),1); | 1203 | setenv("QWS_KEYBOARD",kb.latin1(),1); |
1203 | qwsServer->openKeyboard(); | 1204 | qwsServer->openKeyboard(); |
1204 | #endif | 1205 | #endif |
1205 | } | 1206 | } |
1206 | } | 1207 | } |
1207 | 1208 | ||
1208 | void Launcher::cancelSync() | 1209 | void Launcher::cancelSync() |
1209 | { | 1210 | { |
1210 | #ifndef QT_NO_COP | 1211 | #ifndef QT_NO_COP |
1211 | QCopEnvelope e( "QPE/Desktop", "cancelSync()" ); | 1212 | QCopEnvelope e( "QPE/Desktop", "cancelSync()" ); |
1212 | #endif | 1213 | #endif |
1213 | } | 1214 | } |
1214 | 1215 | ||
1215 | void Launcher::launcherMessage( const QCString &msg, const QByteArray &data) | 1216 | void Launcher::launcherMessage( const QCString &msg, const QByteArray &data) |
1216 | { | 1217 | { |
1217 | QDataStream stream( data, IO_ReadOnly ); | 1218 | QDataStream stream( data, IO_ReadOnly ); |
1218 | if ( msg == "setTabView(QString,int)" ) { | 1219 | if ( msg == "setTabView(QString,int)" ) { |
1219 | QString id; | 1220 | QString id; |
1220 | stream >> id; | 1221 | stream >> id; |
1221 | int mode; | 1222 | int mode; |
1222 | stream >> mode; | 1223 | stream >> mode; |
1223 | if ( tabs->view(id) ) | 1224 | if ( tabs->view(id) ) |
1224 | tabs->view(id)->setViewMode( (LauncherView::ViewMode)mode ); | 1225 | tabs->view(id)->setViewMode( (LauncherView::ViewMode)mode ); |
1225 | } else if ( msg == "setTabBackground(QString,int,QString)" ) { | 1226 | } else if ( msg == "setTabBackground(QString,int,QString)" ) { |
1226 | QString id; | 1227 | QString id; |
1227 | stream >> id; | 1228 | stream >> id; |
1228 | int mode; | 1229 | int mode; |
1229 | stream >> mode; | 1230 | stream >> mode; |
1230 | QString pixmapOrColor; | 1231 | QString pixmapOrColor; |
1231 | stream >> pixmapOrColor; | 1232 | stream >> pixmapOrColor; |
1232 | if ( tabs->view(id) ) | 1233 | if ( tabs->view(id) ) |
1233 | tabs->view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); | 1234 | tabs->view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); |
1234 | } else if ( msg == "setTextColor(QString,QString)" ) { | 1235 | } else if ( msg == "setTextColor(QString,QString)" ) { |
1235 | QString id; | 1236 | QString id; |
1236 | stream >> id; | 1237 | stream >> id; |
1237 | QString color; | 1238 | QString color; |
1238 | stream >> color; | 1239 | stream >> color; |
1239 | if ( tabs->view(id) ) | 1240 | if ( tabs->view(id) ) |
1240 | tabs->view(id)->setTextColor( QColor(color) ); | 1241 | tabs->view(id)->setTextColor( QColor(color) ); |
1241 | } else if ( msg == "setFont(QString,QString,int,int,int)" ) { | 1242 | } else if ( msg == "setFont(QString,QString,int,int,int)" ) { |
1242 | QString id; | 1243 | QString id; |
1243 | stream >> id; | 1244 | stream >> id; |
1244 | QString fam; | 1245 | QString fam; |
1245 | stream >> fam; | 1246 | stream >> fam; |
1246 | int size; | 1247 | int size; |
1247 | stream >> size; | 1248 | stream >> size; |
1248 | int weight; | 1249 | int weight; |
1249 | stream >> weight; | 1250 | stream >> weight; |
1250 | int italic; | 1251 | int italic; |
1251 | stream >> italic; | 1252 | stream >> italic; |
1252 | if ( tabs->view(id) ) | 1253 | if ( tabs->view(id) ) |
1253 | if ( !fam. isEmpty ( )) | 1254 | if ( !fam. isEmpty ( )) |
1254 | tabs->view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); | 1255 | tabs->view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); |
1255 | else | 1256 | else |
1256 | tabs->view(id)->unsetViewFont(); | 1257 | tabs->view(id)->unsetViewFont(); |
1257 | qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic ); | 1258 | qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic ); |
1258 | } | 1259 | } |
1259 | else if ( msg == "setBusyIndicatorType(QString)" ) { | 1260 | else if ( msg == "setBusyIndicatorType(QString)" ) { |
1260 | QString type; | 1261 | QString type; |
1261 | stream >> type; | 1262 | stream >> type; |
1262 | tabs->setBusyIndicatorType(type); | 1263 | tabs->setBusyIndicatorType(type); |
1263 | } | 1264 | } |
1264 | else if ( msg == "home()" ) { | 1265 | else if ( msg == "home()" ) { |
1265 | if ( isVisibleWindow( winId ( ))) | 1266 | if ( isVisibleWindow( winId ( ))) |
1266 | nextView ( ); | 1267 | nextView ( ); |
1267 | else | 1268 | else |
1268 | raise ( ); | 1269 | raise ( ); |
1269 | 1270 | ||
1270 | } | 1271 | } |
1271 | } | 1272 | } |
1272 | 1273 | ||
1273 | void Launcher::storageChanged() | 1274 | void Launcher::storageChanged() |
1274 | { | 1275 | { |
1275 | if ( in_lnk_props ) { | 1276 | if ( in_lnk_props ) { |
1276 | got_lnk_change = TRUE; | 1277 | got_lnk_change = TRUE; |
1277 | lnk_change = QString::null; | 1278 | lnk_change = QString::null; |
1278 | } else { | 1279 | } else { |
1279 | updateLink( QString::null ); | 1280 | updateLink( QString::null ); |
1280 | } | 1281 | } |
1281 | } | 1282 | } |
1282 | 1283 | ||
1283 | 1284 | ||
1284 | bool Launcher::mkdir(const QString &localPath) | 1285 | bool Launcher::mkdir(const QString &localPath) |
1285 | { | 1286 | { |
1286 | QDir fullDir(localPath); | 1287 | QDir fullDir(localPath); |
1287 | if (fullDir.exists()) | 1288 | if (fullDir.exists()) |
1288 | return true; | 1289 | return true; |
1289 | 1290 | ||
1290 | // at this point the directory doesn't exist | 1291 | // at this point the directory doesn't exist |
1291 | // go through the directory tree and start creating the direcotories | 1292 | // go through the directory tree and start creating the direcotories |
1292 | // that don't exist; if we can't create the directories, return false | 1293 | // that don't exist; if we can't create the directories, return false |
1293 | 1294 | ||
1294 | QString dirSeps = "/"; | 1295 | QString dirSeps = "/"; |
1295 | int dirIndex = localPath.find(dirSeps); | 1296 | int dirIndex = localPath.find(dirSeps); |
1296 | QString checkedPath; | 1297 | QString checkedPath; |
1297 | 1298 | ||
1298 | // didn't find any seps; weird, use the cur dir instead | 1299 | // didn't find any seps; weird, use the cur dir instead |
1299 | if (dirIndex == -1) { | 1300 | if (dirIndex == -1) { |
1300 | //qDebug("No seperators found in path %s", localPath.latin1()); | 1301 | //qDebug("No seperators found in path %s", localPath.latin1()); |
1301 | checkedPath = QDir::currentDirPath(); | 1302 | checkedPath = QDir::currentDirPath(); |
1302 | } | 1303 | } |
1303 | 1304 | ||
1304 | while (checkedPath != localPath) { | 1305 | while (checkedPath != localPath) { |
1305 | // no more seperators found, use the local path | 1306 | // no more seperators found, use the local path |
1306 | if (dirIndex == -1) | 1307 | if (dirIndex == -1) |
1307 | checkedPath = localPath; | 1308 | checkedPath = localPath; |
1308 | else { | 1309 | else { |
1309 | // the next directory to check | 1310 | // the next directory to check |
1310 | checkedPath = localPath.left(dirIndex) + "/"; | 1311 | checkedPath = localPath.left(dirIndex) + "/"; |
1311 | // advance the iterator; the next dir seperator | 1312 | // advance the iterator; the next dir seperator |
1312 | dirIndex = localPath.find(dirSeps, dirIndex+1); | 1313 | dirIndex = localPath.find(dirSeps, dirIndex+1); |
1313 | } | 1314 | } |
1314 | 1315 | ||
1315 | QDir checkDir(checkedPath); | 1316 | QDir checkDir(checkedPath); |
1316 | if (!checkDir.exists()) { | 1317 | if (!checkDir.exists()) { |
1317 | //qDebug("mkdir making dir %s", checkedPath.latin1()); | 1318 | //qDebug("mkdir making dir %s", checkedPath.latin1()); |
1318 | 1319 | ||
1319 | if (!checkDir.mkdir(checkedPath)) { | 1320 | if (!checkDir.mkdir(checkedPath)) { |
1320 | qDebug("Unable to make directory %s", checkedPath.latin1()); | 1321 | qDebug("Unable to make directory %s", checkedPath.latin1()); |
1321 | return FALSE; | 1322 | return FALSE; |
1322 | } | 1323 | } |
1323 | } | 1324 | } |
1324 | 1325 | ||
1325 | } | 1326 | } |
1326 | return TRUE; | 1327 | return TRUE; |
1327 | } | 1328 | } |
1328 | 1329 | ||
1329 | void Launcher::preloadApps() | 1330 | void Launcher::preloadApps() |
1330 | { | 1331 | { |
1331 | Config cfg("Launcher"); | 1332 | Config cfg("Launcher"); |
1332 | cfg.setGroup("Preload"); | 1333 | cfg.setGroup("Preload"); |
1333 | QStringList apps = cfg.readListEntry("Apps",','); | 1334 | QStringList apps = cfg.readListEntry("Apps",','); |
1334 | for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) { | 1335 | for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) { |
1335 | #ifndef QT_NO_COP | 1336 | #ifndef QT_NO_COP |
1336 | QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()"); | 1337 | QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()"); |
1337 | #endif | 1338 | #endif |
1338 | } | 1339 | } |
1339 | } | 1340 | } |
1340 | 1341 | ||
1341 | DocumentTab::DocumentTab( QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName) | 1342 | DocumentTab::DocumentTab( QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName) |
1342 | : OFileSelector(parent,mode,selector,dirName,fileName) | 1343 | : OFileSelector(parent,mode,selector,dirName,fileName) |
1343 | { | 1344 | { |
1344 | setYesCancelVisible(false); | 1345 | //setYesCancelVisible(false); |
1345 | setToolbarVisible(false); | 1346 | //setToolbarVisible(false); |
1346 | setPermissionBarVisible(false); | 1347 | //setPermissionBarVisible(false); |
1347 | setLineEditVisible(false) ; | 1348 | //setLineEditVisible(false) ; |
1348 | //setChooserVisible( bool chooser ); | 1349 | //setChooserVisible( bool chooser ); |
1349 | 1350 | ||
1350 | } | 1351 | } |
1351 | 1352 | ||
1352 | DocumentTab::~DocumentTab() { | 1353 | DocumentTab::~DocumentTab() { |
1353 | 1354 | ||
1354 | } | 1355 | } |
1355 | 1356 | ||