summaryrefslogtreecommitdiff
authorzecke <zecke>2004-01-05 14:39:29 (UTC)
committer zecke <zecke>2004-01-05 14:39:29 (UTC)
commitc127e5d582b1ae4033eca1c8454bee75d510b9e8 (patch) (unidiff)
treee4f6e610969f35e1e0954f762f317c0e9ccf76b3
parent7fb9bc93eae8007a6eb298fc743bbf70dc50fbc5 (diff)
downloadopie-c127e5d582b1ae4033eca1c8454bee75d510b9e8.zip
opie-c127e5d582b1ae4033eca1c8454bee75d510b9e8.tar.gz
opie-c127e5d582b1ae4033eca1c8454bee75d510b9e8.tar.bz2
Spelling fixes by Michael Opdenacker <zumbi2@netcourrier.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--README2
-rw-r--r--core/opiealarm/opiealarm.c2
-rw-r--r--etc/dict/words2
-rw-r--r--help/opie-sh/node3.html2
-rw-r--r--help/opie-sh/node9.html2
-rw-r--r--noncore/apps/odict/eng_ita.dic2
-rw-r--r--noncore/apps/opie-console/filereceive.cpp2
-rw-r--r--noncore/apps/opie-console/filetransfer.cpp2
-rw-r--r--noncore/net/opieftp/opieftp.cpp2
-rw-r--r--noncore/settings/backup/backuprestore.cpp4
-rw-r--r--noncore/settings/networksettings/interfaces/interface.cpp8
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.cpp44
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp2
-rw-r--r--noncore/settings/networksettings/module.h2
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wextensions.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp2
-rw-r--r--noncore/settings/tabmanager/tabmanager.cpp12
-rw-r--r--noncore/unsupported/mail2/TODO2
-rw-r--r--noncore/unsupported/mail2/folderwidget.cpp6
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp2
-rw-r--r--x11/ipc/server/ocopserver.cpp2
22 files changed, 53 insertions, 55 deletions
diff --git a/README b/README
index 0075bde..cb7d5d4 100644
--- a/README
+++ b/README
@@ -1,86 +1,86 @@
11. How to use the Opie build system 11. How to use the Opie build system
2==================================== 2====================================
3There's a tutorial document at: 3There's a tutorial document at:
4http://www.uv-ac.de/opiedev/opiedev.html 4http://www.uv-ac.de/opiedev/opiedev.html
5 5
6The API reference currently is at: 6The API reference currently is at:
7http://handhelds.org/~zecke/apidocs/index.html 7http://handhelds.org/~zecke/apidocs/index.html
8 8
9You will need qvfb, uic and 9You will need qvfb, uic and
10(if you want to develop applications) designer 10(if you want to develop applications) designer
11compiled and linked against qt-x11. 11compiled and linked against qt-x11.
12That means you must download and configure/make it. 12That means you must download and configure/make it.
13wget ftp://ftp.trolltech.com/qt/source/qt-x11-2.3.2.tar.gz 13wget ftp://ftp.trolltech.com/qt/source/qt-x11-2.3.2.tar.gz
14(Alternatively, you can get static binaries from http://www.vanille.de/tools) 14(Alternatively, you can get static binaries from http://www.vanille.de/tools)
15 15
16The recommended version of Qt embedded is qt-embedded-2.3.7 16The recommended version of Qt embedded is qt-embedded-2.3.7
17 17
18You can get it from: 18You can get it from:
19ftp://ftp.trolltech.com/qt/source/qt-embedded-2.3.7.tar.bz2 19ftp://ftp.trolltech.com/qt/source/qt-embedded-2.3.7.tar.bz2
20 20
21Set QTDIR to point to your qt/embedded source tree, such as: 21Set QTDIR to point to your qt/embedded source tree, such as:
22export QTDIR=/opt/qt-2.3.7 22export QTDIR=/opt/qt-2.3.7
23 23
24You need to do set the OPIEDIR environment variable: 24You need to do set the OPIEDIR environment variable:
25export OPIEDIR=`pwd` 25export OPIEDIR=`pwd`
26or 26or
27export OPIEDIR=~/projects/sources/opie 27export OPIEDIR=~/projects/sources/opie
28or whereever you placed the Opie sources. 28or whereever you placed the Opie sources.
29 29
30You need to adjust your runtime library search path, 30You need to adjust your runtime library search path,
31so that the Qt/Embedded and Opie libraries can be found: 31so that the Qt/Embedded and Opie libraries can be found:
32export LD_LIBRARY_PATH=$OPIEDIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH 32export LD_LIBRARY_PATH=$OPIEDIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH
33 33
34You have to apply the qte<version>-all.patch to the Qt/Embedded 34You have to apply the qte<version>-all.patch to the Qt/Embedded
35sources and copy the qconfig-qpe.h file to $QTDIR/src/tools: 35sources and copy the qconfig-qpe.h file to $QTDIR/src/tools:
36cd $QTDIR; cat $OPIEDIR/qt/qte<version>*.patch | patch -p0 36cd $QTDIR; cat $OPIEDIR/qt/qte<version>*.patch | patch -p0
37cp $OPIEDIR/qt/qpe-config.h $QTDIR/src/tools 37cp $OPIEDIR/qt/qpe-config.h $QTDIR/src/tools
38 38
39You are now ready to configure and build Qt/Embedded 39You are now ready to configure and build Qt/Embedded
40 40
41cd $QTDIR 41cd $QTDIR
42echo 'yes' | ./configure -qconfig qpe -depths 4,16,24,32 -system-jpeg -system-libpng -system-zlib -no-xft -qvfb 42echo 'yes' | ./configure -qconfig qpe -depths 4,16,24,32 -system-jpeg -system-libpng -system-zlib -no-xft -qvfb
43make 43make
44 44
45Once you have these compiled, be sure to set the PATH to ensure your (cross)compiler 45Once you have these compiled, be sure to set the PATH to ensure your (cross)compiler
46is available. 46is available.
47 47
48Then do the following in the opie source tree: 48Then do the following in the opie source tree:
49 49
50make clean 50make clean
51make menuconfig 51make menuconfig
52 52
53Now you can move through the menu and select or deselect anything.. 53Now you can move through the menu and select or deselect anything..
54Exit and save the configuration and enter "make" to create opie... 54Exit and save the configuration and enter "make" to create opie...
55 55
56Have fun with it ! 56Have fun with it !
57 57
58If you get into trouble there are other makefile targets 58If you get into trouble there are other makefile targets
59 59
60make clean-configs 60make clean-configs
61is a useful one. 61is a useful one.
62 62
632. Used Libraries 632. Used Libraries
64================ 64================
65 65
66The following Libraries are used in Opie. 66The following Libraries are used in Opie.
67For a successfull build you must install these librarys and headers. 67For a successful build you must install these librarys and headers.
68The versions are known-good versions. If you successfully try newer ones, 68The versions are known-good versions. If you successfully try newer ones,
69commit a new README or send a mail to opie-devel@handhelds.org 69commit a new README or send a mail to opie-devel@handhelds.org
70 70
71* libsdl 1.2 71* libsdl 1.2
72 http://www.libsdl.org/download-1.2.php 72 http://www.libsdl.org/download-1.2.php
73 73
74* libxine 1.0 beta 11 74* libxine 1.0 beta 11
75 http://prdownloads.sourceforge.net/xine/ 75 http://prdownloads.sourceforge.net/xine/
76 76
77* libpcap 0.7.2 77* libpcap 0.7.2
78 http://www.tcpdump.org/release/ 78 http://www.tcpdump.org/release/
79 79
80* libetpan 0.31 80* libetpan 0.31
81 http://prdownloads.sourceforge.net/libetpan/ + patch in noncore/net/mail/libetpanstuff 81 http://prdownloads.sourceforge.net/libetpan/ + patch in noncore/net/mail/libetpanstuff
82 82
83* libsqlite 2.8.6 83* libsqlite 2.8.6
84 http://www.sqlite.org/download.html 84 http://www.sqlite.org/download.html
85 85
86 86
diff --git a/core/opiealarm/opiealarm.c b/core/opiealarm/opiealarm.c
index 90a743f..422865c 100644
--- a/core/opiealarm/opiealarm.c
+++ b/core/opiealarm/opiealarm.c
@@ -1,384 +1,384 @@
1/* 1/*
2 * opiealarm.c 2 * opiealarm.c
3 * 3 *
4 * This program is for extracting the event time/date out 4 * This program is for extracting the event time/date out
5 * of /var/run/resumeat and setting the RTC alarm to that time/date. 5 * of /var/run/resumeat and setting the RTC alarm to that time/date.
6 * It is designed to run via a script just before the iPAQ 6 * It is designed to run via a script just before the iPAQ
7 * is suspended and right after the iPAQ resumes operation. 7 * is suspended and right after the iPAQ resumes operation.
8 * 8 *
9 * written and copyrighted by Robert Griebl <sandman@handhelds.org> 9 * written and copyrighted by Robert Griebl <sandman@handhelds.org>
10 */ 10 */
11 11
12#include <stdio.h> 12#include <stdio.h>
13#include <linux/rtc.h> 13#include <linux/rtc.h>
14#include <sys/ioctl.h> 14#include <sys/ioctl.h>
15#include <sys/time.h> 15#include <sys/time.h>
16#include <sys/types.h> 16#include <sys/types.h>
17#include <fcntl.h> 17#include <fcntl.h>
18#include <unistd.h> 18#include <unistd.h>
19#include <errno.h> 19#include <errno.h>
20#include <time.h> 20#include <time.h>
21#include <stdlib.h> 21#include <stdlib.h>
22#include <syslog.h> 22#include <syslog.h>
23#include <signal.h> 23#include <signal.h>
24#include <errno.h> 24#include <errno.h>
25#include <string.h> 25#include <string.h>
26 26
27 27
28 #define PIDFILE "/var/run/opiealarm.pid" 28 #define PIDFILE "/var/run/opiealarm.pid"
29#define TIMEFILE "/var/run/resumeat" 29#define TIMEFILE "/var/run/resumeat"
30 #define APMFILE "/proc/apm" 30 #define APMFILE "/proc/apm"
31 31
32int resume ( int resuspend ); 32int resume ( int resuspend );
33int suspend ( int fix_rtc ); 33int suspend ( int fix_rtc );
34int main ( int argc, char **argv ); 34int main ( int argc, char **argv );
35int fork_with_pidfile ( void ); 35int fork_with_pidfile ( void );
36int kill_with_pidfile ( void ); 36int kill_with_pidfile ( void );
37void remove_pidfile ( void ); 37void remove_pidfile ( void );
38void usage ( void ); 38void usage ( void );
39void sig_handler_child ( int sig ); 39void sig_handler_child ( int sig );
40void sig_handler_parent ( int sig ); 40void sig_handler_parent ( int sig );
41int onac ( void ); 41int onac ( void );
42 42
43static int opiealarm_was_running; 43static int opiealarm_was_running;
44static pid_t parent_pid = 0; 44static pid_t parent_pid = 0;
45 45
46 46
47 47
48void sig_handler_child ( int sig ) 48void sig_handler_child ( int sig )
49{ 49{
50 // child got SIGUSR2 -> cleanup pidfile and exit 50 // child got SIGUSR2 -> cleanup pidfile and exit
51 51
52 remove_pidfile ( ); 52 remove_pidfile ( );
53 exit ( 0 ); 53 exit ( 0 );
54} 54}
55 55
56void sig_handler_parent ( int sig ) 56void sig_handler_parent ( int sig )
57{ 57{
58 // parent got SIGUSR1 -> safe to exit now 58 // parent got SIGUSR1 -> safe to exit now
59 59
60 parent_pid = 0; 60 parent_pid = 0;
61 exit ( 0 ); 61 exit ( 0 );
62} 62}
63 63
64void usage ( void ) 64void usage ( void )
65{ 65{
66 fprintf ( stderr, "Usage: opiealarm -s [-f] | -r [-a]\n\n" ); 66 fprintf ( stderr, "Usage: opiealarm -s [-f] | -r [-a]\n\n" );
67 fprintf ( stderr, "\t-s\tSuspend mode: set RTC alarm\n" ); 67 fprintf ( stderr, "\t-s\tSuspend mode: set RTC alarm\n" );
68 fprintf ( stderr, "\t-f \tFix RTC, if RTC and system have more than 5sec difference (suspend mode)\n" ); 68 fprintf ( stderr, "\t-f \tFix RTC, if RTC and system have more than 5sec difference (suspend mode)\n" );
69 fprintf ( stderr, "\t-r\tResume mode: kill running opiealarm\n" ); 69 fprintf ( stderr, "\t-r\tResume mode: kill running opiealarm\n" );
70 fprintf ( stderr, "\t-a <x>\tResuspend in <x> seconds (resume mode)\n\n" ); 70 fprintf ( stderr, "\t-a <x>\tResuspend in <x> seconds (resume mode)\n\n" );
71 exit ( 1 ); 71 exit ( 1 );
72} 72}
73 73
74int fork_with_pidfile ( void ) 74int fork_with_pidfile ( void )
75{ 75{
76 FILE *fp; 76 FILE *fp;
77 pid_t pid; 77 pid_t pid;
78 78
79 pid = fork ( ); 79 pid = fork ( );
80 80
81 if ( pid > 0 ) { 81 if ( pid > 0 ) {
82 // We can not just exit now, because the kernel could suspend 82 // We can not just exit now, because the kernel could suspend
83 // the iPAQ just before the child process sets the RTC. 83 // the iPAQ just before the child process sets the RTC.
84 // Solution: just wait for SIGUSR1 - the child process will 84 // Solution: just wait for SIGUSR1 - the child process will
85 // signal this when it thinks it is safe to exit. 85 // signal this when it thinks it is safe to exit.
86 86
87 signal ( SIGUSR1, sig_handler_parent ); 87 signal ( SIGUSR1, sig_handler_parent );
88 while ( 1 ) 88 while ( 1 )
89 sleep ( 1000 ); 89 sleep ( 1000 );
90 exit ( 0 ); 90 exit ( 0 );
91 } 91 }
92 else if ( pid < 0 ) { 92 else if ( pid < 0 ) {
93 perror ( "forking failed" ); 93 perror ( "forking failed" );
94 return 0; 94 return 0;
95 } 95 }
96 //sleep( 60 ); 96 //sleep( 60 );
97 97
98 // child process needs to react to SIGUSR2. This is sent when 98 // child process needs to react to SIGUSR2. This is sent when
99 // a new opiealarm process is started. 99 // a new opiealarm process is started.
100 100
101 signal ( SIGUSR2, sig_handler_child ); 101 signal ( SIGUSR2, sig_handler_child );
102 102
103 // save pid 103 // save pid
104 if (( fp = fopen ( PIDFILE, "w" ))) { 104 if (( fp = fopen ( PIDFILE, "w" ))) {
105 fprintf ( fp, "%d", getpid ( )); 105 fprintf ( fp, "%d", getpid ( ));
106 fclose ( fp ); 106 fclose ( fp );
107 107
108 // detach 108 // detach
109 close ( 0 ); 109 close ( 0 );
110 close ( 1 ); 110 close ( 1 );
111 close ( 2 ); 111 close ( 2 );
112 112
113 setpgid ( 0, 0 ); 113 setpgid ( 0, 0 );
114 114
115 return 1; 115 return 1;
116 } 116 }
117 else { 117 else {
118 perror ( PIDFILE ); 118 perror ( PIDFILE );
119 return 0; 119 return 0;
120 } 120 }
121} 121}
122 122
123int kill_with_pidfile ( void ) 123int kill_with_pidfile ( void )
124{ 124{
125 FILE *fp; 125 FILE *fp;
126 pid_t pid; 126 pid_t pid;
127 int res = 0; 127 int res = 0;
128 128
129 // terminate a running opiealarm child process 129 // terminate a running opiealarm child process
130 // return 1 if we really killed one 130 // return 1 if we really killed one
131 131
132 if (( fp = fopen ( PIDFILE, "r" ))) { 132 if (( fp = fopen ( PIDFILE, "r" ))) {
133 if ( fscanf ( fp, "%d", &pid ) == 1 ) 133 if ( fscanf ( fp, "%d", &pid ) == 1 )
134 res = ( kill ( pid, SIGUSR2 ) == 0 ) ? 1 : 0; 134 res = ( kill ( pid, SIGUSR2 ) == 0 ) ? 1 : 0;
135 fclose ( fp ); 135 fclose ( fp );
136 } 136 }
137 return res; 137 return res;
138} 138}
139 139
140void remove_pidfile ( void ) 140void remove_pidfile ( void )
141{ 141{
142 // child is about to exit - cleanup 142 // child is about to exit - cleanup
143 143
144 unlink ( PIDFILE ); 144 unlink ( PIDFILE );
145 signal ( SIGUSR2, SIG_DFL ); 145 signal ( SIGUSR2, SIG_DFL );
146} 146}
147 147
148 148
149int main ( int argc, char **argv ) 149int main ( int argc, char **argv )
150{ 150{
151 int mode = 0; 151 int mode = 0;
152 int ac_resusp = 0; 152 int ac_resusp = 0;
153 int fix_rtc = 0; 153 int fix_rtc = 0;
154 int opt; 154 int opt;
155 155
156 while (( opt = getopt ( argc, argv, "a:frs" )) != EOF ) { 156 while (( opt = getopt ( argc, argv, "a:frs" )) != EOF ) {
157 switch ( opt ) { 157 switch ( opt ) {
158 case 's': 158 case 's':
159 mode = 's'; 159 mode = 's';
160 break; 160 break;
161 case 'r': 161 case 'r':
162 mode = 'r'; 162 mode = 'r';
163 break; 163 break;
164 case 'a': 164 case 'a':
165 ac_resusp = atoi ( optarg ); 165 ac_resusp = atoi ( optarg );
166 if ( ac_resusp < 30 ) { 166 if ( ac_resusp < 30 ) {
167 ac_resusp = 120; 167 ac_resusp = 120;
168 168
169 fprintf ( stderr, "Warning: resuspend timeout must be >= 30 sec. -- now set to 120 sec\n" ); 169 fprintf ( stderr, "Warning: resuspend timeout must be >= 30 sec. -- now set to 120 sec\n" );
170 } 170 }
171 break; 171 break;
172 case 'f': 172 case 'f':
173 fix_rtc = 1; 173 fix_rtc = 1;
174 break; 174 break;
175 default: 175 default:
176 usage ( ); 176 usage ( );
177 } 177 }
178 } 178 }
179 179
180 if ( geteuid ( ) != 0 ) { 180 if ( geteuid ( ) != 0 ) {
181 fprintf ( stderr, "You need root priviledges to run opiealarm." ); 181 fprintf ( stderr, "You need root priviledges to run opiealarm." );
182 return 2; 182 return 2;
183 } 183 }
184 184
185 if ( !mode ) 185 if ( !mode )
186 usage ( ); 186 usage ( );
187 187
188 188
189 parent_pid = getpid ( ); 189 parent_pid = getpid ( );
190 190
191 // kill running opiealarm 191 // kill running opiealarm
192 opiealarm_was_running = kill_with_pidfile ( ); 192 opiealarm_was_running = kill_with_pidfile ( );
193 remove_pidfile ( ); 193 remove_pidfile ( );
194 194
195 switch ( mode ) { 195 switch ( mode ) {
196 case 'r': opt = resume ( ac_resusp ); 196 case 'r': opt = resume ( ac_resusp );
197 break; 197 break;
198 case 's': 198 case 's':
199 default : opt = suspend ( fix_rtc ); 199 default : opt = suspend ( fix_rtc );
200 break; 200 break;
201 } 201 }
202 202
203 parent_pid = 0; 203 parent_pid = 0;
204 return opt; 204 return opt;
205 } 205 }
206 206
207 207
208int suspend ( int fix_rtc ) 208int suspend ( int fix_rtc )
209{ 209{
210 FILE *fp = NULL; 210 FILE *fp = NULL;
211 char buf [64]; 211 char buf [64];
212 time_t alrt, syst, rtct; 212 time_t alrt, syst, rtct;
213 struct tm alr, sys, rtc; 213 struct tm alr, sys, rtc;
214 int fd; 214 int fd;
215 int rtc_sys_diff; 215 int rtc_sys_diff;
216 216
217 217
218 if ( !fork_with_pidfile ( )) 218 if ( !fork_with_pidfile ( ))
219 return 3; 219 return 3;
220 220
221 // we are the child process from here on ... 221 // we are the child process from here on ...
222 222
223 tzset ( ); // not sure if it is really needed -- it probably doesn't hurt ... 223 tzset ( ); // not sure if it is really needed -- it probably doesn't hurt ...
224 224
225 time ( &syst );// get the UNIX system time 225 time ( &syst );// get the UNIX system time
226 sys = *localtime ( &syst ); 226 sys = *localtime ( &syst );
227 227
228 do { 228 do {
229 229
230 if (( fd = open ( "/dev/misc/rtc", O_RDWR )) < 0 ) 230 if (( fd = open ( "/dev/misc/rtc", O_RDWR )) < 0 )
231 if (( fd = open ( "/dev/rtc", O_RDWR )) < 0 ) 231 if (( fd = open ( "/dev/rtc", O_RDWR )) < 0 )
232 break; // ( 1, "rtc" ); 232 break; // ( 1, "rtc" );
233 233
234 memset ( &rtc, 0, sizeof ( struct tm )); // get the RTC time 234 memset ( &rtc, 0, sizeof ( struct tm )); // get the RTC time
235 235
236 if ( ioctl ( fd, RTC_RD_TIME, &rtc ) < 0 ) 236 if ( ioctl ( fd, RTC_RD_TIME, &rtc ) < 0 )
237 break; // ( 1, "ioctl RTC_RD_TIME" ); 237 break; // ( 1, "ioctl RTC_RD_TIME" );
238 238
239 rtct = mktime ( &rtc ); 239 rtct = mktime ( &rtc );
240 240
241 rtc_sys_diff = ( syst - rtct ) - sys. tm_gmtoff; // calculate the difference between system and hardware time 241 rtc_sys_diff = ( syst - rtct ) - sys. tm_gmtoff; // calculate the difference between system and hardware time
242 242
243 if ( fix_rtc && (( rtc_sys_diff < -3 ) || ( rtc_sys_diff > 3 ))) { 243 if ( fix_rtc && (( rtc_sys_diff < -3 ) || ( rtc_sys_diff > 3 ))) {
244 struct tm set; 244 struct tm set;
245 set = *gmtime ( &syst ); 245 set = *gmtime ( &syst );
246 246
247 // if the difference between system and hardware time is more than 3 seconds, 247 // if the difference between system and hardware time is more than 3 seconds,
248 // we have to set the RTC (hwclock --systohc), or alarms won't work reliably. 248 // we have to set the RTC (hwclock --systohc), or alarms won't work reliably.
249 249
250 if ( ioctl ( fd, RTC_SET_TIME, &set ) < 0 ) 250 if ( ioctl ( fd, RTC_SET_TIME, &set ) < 0 )
251 break; // ( 1, "ioctl RTC_SET_TIME" ); 251 break; // ( 1, "ioctl RTC_SET_TIME" );
252 } 252 }
253 253
254 // read the wakeup time from TIMEFILE 254 // read the wakeup time from TIMEFILE
255 if (!( fp = fopen ( TIMEFILE, "r" ))) 255 if (!( fp = fopen ( TIMEFILE, "r" )))
256 break; // ( 1, TIMEFILE ); 256 break; // ( 1, TIMEFILE );
257 257
258 if ( !fgets ( buf, sizeof( buf ) - 1, fp )) 258 if ( !fgets ( buf, sizeof( buf ) - 1, fp ))
259 break; // ( 1, TIMEFILE ); 259 break; // ( 1, TIMEFILE );
260 260
261 fclose ( fp ); 261 fclose ( fp );
262 fp = NULL; 262 fp = NULL;
263 263
264 alrt = atoi ( buf ); // get the alarm time 264 alrt = atoi ( buf ); // get the alarm time
265 265
266 if ( alrt == 0 ) 266 if ( alrt == 0 )
267 break; // ( 0, TIMEFILE " contains an invalid time description" ); 267 break; // ( 0, TIMEFILE " contains an invalid time description" );
268 alrt -= 5; // wake up 5 sec before the specified time 268 alrt -= 5; // wake up 5 sec before the specified time
269 269
270 alr = *gmtime ( &alrt ); 270 alr = *gmtime ( &alrt );
271 271
272 if ( ioctl ( fd, RTC_ALM_SET, &alr ) < 0 ) // set RTC alarm time 272 if ( ioctl ( fd, RTC_ALM_SET, &alr ) < 0 ) // set RTC alarm time
273 break; // ( 1, "ioctl RTC_ALM_SET" ); 273 break; // ( 1, "ioctl RTC_ALM_SET" );
274 274
275 if ( ioctl ( fd, RTC_AIE_ON, 0 ) < 0 ) 275 if ( ioctl ( fd, RTC_AIE_ON, 0 ) < 0 )
276 break; // ( 1, "ioctl RTC_AIE_ON" ); // enable RTC alarm irq 276 break; // ( 1, "ioctl RTC_AIE_ON" ); // enable RTC alarm irq
277 277
278 // tell the parent it is safe to exit now .. we have set the RTC alarm 278 // tell the parent it is safe to exit now .. we have set the RTC alarm
279 kill ( parent_pid, SIGUSR1 ); 279 kill ( parent_pid, SIGUSR1 );
280 280
281 if ( read ( fd, buf, sizeof( unsigned long )) < 0 ) // wait for the RTC alarm irq 281 if ( read ( fd, buf, sizeof( unsigned long )) < 0 ) // wait for the RTC alarm irq
282 break; // ( 1, "read rtc alarm" ); 282 break; // ( 1, "read rtc alarm" );
283 283
284 // iPAQ woke up via RTC irq -- otherwise we would have received a SIGUSR2 284 // iPAQ woke up via RTC irq -- otherwise we would have received a SIGUSR2
285 // from the "resume instance" of opiealarm. 285 // from the "resume instance" of opiealarm.
286 286
287 if ( ioctl ( fd, RTC_AIE_OFF, 0 ) < 0 ) // disable RTC alarm irq 287 if ( ioctl ( fd, RTC_AIE_OFF, 0 ) < 0 ) // disable RTC alarm irq
288 break; // ( 1, "ioctl RTC_AIE_OFF" ); 288 break; // ( 1, "ioctl RTC_AIE_OFF" );
289 289
290 close ( fd ); 290 close ( fd );
291 fd = -1; 291 fd = -1;
292 292
293 remove_pidfile ( ); 293 remove_pidfile ( );
294 294
295 return 0; 295 return 0;
296 296
297 } while ( 0 ); 297 } while ( 0 );
298 298
299 if ( fp != NULL ) 299 if ( fp != NULL )
300 fclose ( fp ); 300 fclose ( fp );
301 301
302 if ( fd != -1 ) 302 if ( fd != -1 )
303 close ( fd ); 303 close ( fd );
304 304
305 kill ( parent_pid, SIGUSR1 ); 305 kill ( parent_pid, SIGUSR1 );
306 306
307 while ( 1 ) // pretend that we are waiting on RTC, so opiealarm -r can kill us 307 while ( 1 ) // pretend that we are waiting on RTC, so opiealarm -r can kill us
308 sleep ( 1000 ); // if we don't do this, the "resuspend on AC" would be triggerd 308 sleep ( 1000 ); // if we don't do this, the "resuspend on AC" would be triggerd
309 return 0; 309 return 0;
310} 310}
311 311
312int onac ( void ) 312int onac ( void )
313{ 313{
314 FILE *fp; 314 FILE *fp;
315 int on = 0; 315 int on = 0;
316 316
317 // check the apm proc interface for AC status 317 // check the apm proc interface for AC status
318 318
319 if (( fp = fopen ( APMFILE, "r" ))) { 319 if (( fp = fopen ( APMFILE, "r" ))) {
320 int ac = 0; 320 int ac = 0;
321 321
322 if ( fscanf ( fp, "%*[^ ] %*d.%*d 0x%*x 0x%x 0x%*x 0x%*x %*d%% %*i %*c", &ac ) == 1 ) 322 if ( fscanf ( fp, "%*[^ ] %*d.%*d 0x%*x 0x%x 0x%*x 0x%*x %*d%% %*i %*c", &ac ) == 1 )
323 on = ( ac == 0x01 ) ? 1 : 0; 323 on = ( ac == 0x01 ) ? 1 : 0;
324 324
325 fclose ( fp ); 325 fclose ( fp );
326 } 326 }
327 return on; 327 return on;
328} 328}
329 329
330int resume ( int resuspend ) 330int resume ( int resuspend )
331{ 331{
332 FILE *fp; 332 FILE *fp;
333 333
334 // re-suspend when on AC (optional) when woken up via RTC 334 // re-suspend when on AC (optional) when woken up via RTC
335 335
336 if ( !opiealarm_was_running ) { 336 if ( !opiealarm_was_running ) {
337 // if opiealarm -s didn't wake up via RTC, the old process gets killed 337 // if opiealarm -s didn't wake up via RTC, the old process gets killed
338 // by kill_by_pidfile(), which is recorded in opiealarm_was_running 338 // by kill_by_pidfile(), which is recorded in opiealarm_was_running
339 339
340 if ( resuspend && onac ( )) { 340 if ( resuspend && onac ( )) {
341 time_t start, now; 341 time_t start, now;
342 char *argv [4]; 342 char *argv [4];
343 343
344 if ( !fork_with_pidfile ( )) 344 if ( !fork_with_pidfile ( ))
345 return 4; 345 return 4;
346 346
347 // we can't wait for the resuspend timeout in the parent process. 347 // we can't wait for the resuspend timeout in the parent process.
348 // so we fork and tell the parent it can exit immediatly 348 // so we fork and tell the parent it can exit immediatly
349 349
350 kill ( parent_pid, SIGUSR1 ); 350 kill ( parent_pid, SIGUSR1 );
351 351
352 // sleep <resuspend> seconds - this method is much more precise than sleep() ! 352 // sleep <resuspend> seconds - this method is much more precise than sleep() !
353 time ( &start ); 353 time ( &start );
354 do { 354 do {
355 sleep ( 1 ); 355 sleep ( 1 );
356 time ( &now ); 356 time ( &now );
357 } while (( now - start ) < resuspend ); 357 } while (( now - start ) < resuspend );
358 358
359 if ( onac ( )) { // still on ac ? 359 if ( onac ( )) { // still on ac ?
360 argv[0] = "qcop"; 360 argv[0] = "qcop";
361 argv[1] = "QPE/Desktop"; 361 argv[1] = "QPE/Desktop";
362 argv[2] = "suspend()"; 362 argv[2] = "suspend()";
363 argv[3] = 0; 363 argv[3] = 0;
364 364
365 // hard coded for now ...but needed 365 // hard coded for now ...but needed
366 // another way would be to simulate a power-button press 366 // another way would be to simulate a power-button press
367 367
368 setenv ( "LOGNAME", "root", 1 ); 368 setenv ( "LOGNAME", "root", 1 );
369 setenv ( "HOME", "/root", 1 ); 369 setenv ( "HOME", "/root", 1 );
370 setenv ( "LD_LIBRARY_PATH", "/opt/QtPalmtop/lib", 1 ); 370 setenv ( "LD_LIBRARY_PATH", "/opt/QtPalmtop/lib", 1 );
371 setenv ( "QTDIR", "/opt/QtPalmtop", 1 ); 371 setenv ( "QTDIR", "/opt/QtPalmtop", 1 );
372 372
373 remove_pidfile ( ); 373 remove_pidfile ( );
374 374
375 // no need for system() since this process is no longer usefull anyway 375 // no need for system() since this process is no longer useful anyway
376 execv ( "/opt/QtPalmtop/bin/qcop", argv ); 376 execv ( "/opt/QtPalmtop/bin/qcop", argv );
377 377
378 perror ( "exec for qcop failed" ); 378 perror ( "exec for qcop failed" );
379 return 5; 379 return 5;
380 } 380 }
381 } 381 }
382 } 382 }
383 return 0; 383 return 0;
384} 384}
diff --git a/etc/dict/words b/etc/dict/words
index 1568032..0f14205 100644
--- a/etc/dict/words
+++ b/etc/dict/words
@@ -3776,1537 +3776,1537 @@ balk
3776Balkan 3776Balkan
3777Balkanization 3777Balkanization
3778Balkanizations 3778Balkanizations
3779Balkanize 3779Balkanize
3780balkanized 3780balkanized
3781Balkanizes 3781Balkanizes
3782balkanizing 3782balkanizing
3783Balkans 3783Balkans
3784balked 3784balked
3785balkiness 3785balkiness
3786balking 3786balking
3787balks 3787balks
3788balky 3788balky
3789ball 3789ball
3790ballad 3790ballad
3791ballads 3791ballads
3792Ballard 3792Ballard
3793Ballards 3793Ballards
3794ballast 3794ballast
3795ballasts 3795ballasts
3796balled 3796balled
3797baller 3797baller
3798ballerina 3798ballerina
3799ballerinas 3799ballerinas
3800ballers 3800ballers
3801ballet 3801ballet
3802ballets 3802ballets
3803ballgown 3803ballgown
3804balling 3804balling
3805ballistic 3805ballistic
3806ballistics 3806ballistics
3807balloon 3807balloon
3808ballooned 3808ballooned
3809ballooner 3809ballooner
3810ballooners 3810ballooners
3811ballooning 3811ballooning
3812balloons 3812balloons
3813ballot 3813ballot
3814ballots 3814ballots
3815ballpark 3815ballpark
3816ballparks 3816ballparks
3817ballplayer 3817ballplayer
3818ballplayers 3818ballplayers
3819ballroom 3819ballroom
3820ballrooms 3820ballrooms
3821balls 3821balls
3822ballyhoo 3822ballyhoo
3823balm 3823balm
3824balms 3824balms
3825balmy 3825balmy
3826balsa 3826balsa
3827balsam 3827balsam
3828Baltic 3828Baltic
3829Baltimore 3829Baltimore
3830Baltimorean 3830Baltimorean
3831balustrade 3831balustrade
3832balustrades 3832balustrades
3833Balzac 3833Balzac
3834Bamako 3834Bamako
3835Bamberger 3835Bamberger
3836Bambi 3836Bambi
3837bamboo 3837bamboo
3838ban 3838ban
3839Banach 3839Banach
3840banal 3840banal
3841banally 3841banally
3842banana 3842banana
3843bananas 3843bananas
3844Banbury 3844Banbury
3845Bancroft 3845Bancroft
3846band 3846band
3847bandage 3847bandage
3848bandaged 3848bandaged
3849bandages 3849bandages
3850bandaging 3850bandaging
3851banded 3851banded
3852bandied 3852bandied
3853bandies 3853bandies
3854banding 3854banding
3855bandit 3855bandit
3856bandits 3856bandits
3857bandpass 3857bandpass
3858bands 3858bands
3859bandstand 3859bandstand
3860bandstands 3860bandstands
3861bandwagon 3861bandwagon
3862bandwagons 3862bandwagons
3863bandwidth 3863bandwidth
3864bandwidths 3864bandwidths
3865bandy 3865bandy
3866bandying 3866bandying
3867bane 3867bane
3868baneful 3868baneful
3869bang 3869bang
3870banged 3870banged
3871banging 3871banging
3872Bangladesh 3872Bangladesh
3873bangle 3873bangle
3874bangles 3874bangles
3875Bangor 3875Bangor
3876bangs 3876bangs
3877Bangui 3877Bangui
3878banish 3878banish
3879banished 3879banished
3880banishes 3880banishes
3881banishing 3881banishing
3882banishment 3882banishment
3883banister 3883banister
3884banisters 3884banisters
3885banjo 3885banjo
3886banjos 3886banjos
3887bank 3887bank
3888banked 3888banked
3889banker 3889banker
3890bankers 3890bankers
3891banking 3891banking
3892bankrupt 3892bankrupt
3893bankruptcies 3893bankruptcies
3894bankruptcy 3894bankruptcy
3895bankrupted 3895bankrupted
3896bankrupting 3896bankrupting
3897bankrupts 3897bankrupts
3898Banks 3898Banks
3899banned 3899banned
3900banner 3900banner
3901banners 3901banners
3902banning 3902banning
3903banquet 3903banquet
3904banqueting 3904banqueting
3905banquetings 3905banquetings
3906banquets 3906banquets
3907bans 3907bans
3908banshee 3908banshee
3909banshees 3909banshees
3910bantam 3910bantam
3911banter 3911banter
3912bantered 3912bantered
3913bantering 3913bantering
3914banters 3914banters
3915Bantu 3915Bantu
3916Bantus 3916Bantus
3917baptism 3917baptism
3918baptismal 3918baptismal
3919baptisms 3919baptisms
3920Baptist 3920Baptist
3921Baptiste 3921Baptiste
3922baptistery 3922baptistery
3923baptistries 3923baptistries
3924baptistry 3924baptistry
3925Baptists 3925Baptists
3926baptize 3926baptize
3927baptized 3927baptized
3928baptizes 3928baptizes
3929baptizing 3929baptizing
3930bar 3930bar
3931barb 3931barb
3932Barbados 3932Barbados
3933Barbara 3933Barbara
3934barbarian 3934barbarian
3935barbarians 3935barbarians
3936barbaric 3936barbaric
3937barbarism 3937barbarism
3938barbarities 3938barbarities
3939barbarity 3939barbarity
3940barbarous 3940barbarous
3941barbarously 3941barbarously
3942barbecue 3942barbecue
3943barbecued 3943barbecued
3944barbecues 3944barbecues
3945barbed 3945barbed
3946barbell 3946barbell
3947barbells 3947barbells
3948barber 3948barber
3949barbital 3949barbital
3950barbiturate 3950barbiturate
3951barbiturates 3951barbiturates
3952Barbour 3952Barbour
3953barbs 3953barbs
3954Barcelona 3954Barcelona
3955Barclay 3955Barclay
3956bard 3956bard
3957bards 3957bards
3958bare 3958bare
3959bared 3959bared
3960barefaced 3960barefaced
3961barefoot 3961barefoot
3962barefooted 3962barefooted
3963barely 3963barely
3964bareness 3964bareness
3965barer 3965barer
3966bares 3966bares
3967barest 3967barest
3968barflies 3968barflies
3969barfly 3969barfly
3970bargain 3970bargain
3971bargained 3971bargained
3972bargaining 3972bargaining
3973bargains 3973bargains
3974barge 3974barge
3975barges 3975barges
3976barging 3976barging
3977Barhop 3977Barhop
3978baring 3978baring
3979baritone 3979baritone
3980baritones 3980baritones
3981barium 3981barium
3982bark 3982bark
3983barked 3983barked
3984barker 3984barker
3985barkers 3985barkers
3986barking 3986barking
3987barks 3987barks
3988barley 3988barley
3989Barlow 3989Barlow
3990barn 3990barn
3991Barnabas 3991Barnabas
3992Barnard 3992Barnard
3993Barnes 3993Barnes
3994Barnet 3994Barnet
3995Barnett 3995Barnett
3996Barney 3996Barney
3997Barnhard 3997Barnhard
3998barns 3998barns
3999barnstorm 3999barnstorm
4000barnstormed 4000barnstormed
4001barnstorming 4001barnstorming
4002barnstorms 4002barnstorms
4003Barnum 4003Barnum
4004barnyard 4004barnyard
4005barnyards 4005barnyards
4006barometer 4006barometer
4007barometers 4007barometers
4008barometric 4008barometric
4009baron 4009baron
4010baroness 4010baroness
4011baronial 4011baronial
4012baronies 4012baronies
4013barons 4013barons
4014barony 4014barony
4015baroque 4015baroque
4016baroqueness 4016baroqueness
4017Barr 4017Barr
4018barrack 4018barrack
4019barracks 4019barracks
4020barrage 4020barrage
4021barrages 4021barrages
4022barred 4022barred
4023barrel 4023barrel
4024barrelled 4024barrelled
4025barrelling 4025barrelling
4026barrels 4026barrels
4027barren 4027barren
4028barrenness 4028barrenness
4029Barrett 4029Barrett
4030barricade 4030barricade
4031barricades 4031barricades
4032barrier 4032barrier
4033barriers 4033barriers
4034barring 4034barring
4035barringer 4035barringer
4036Barrington 4036Barrington
4037Barron 4037Barron
4038barrow 4038barrow
4039Barry 4039Barry
4040Barrymore 4040Barrymore
4041Barrymores 4041Barrymores
4042bars 4042bars
4043Barstow 4043Barstow
4044Bart 4044Bart
4045bartender 4045bartender
4046bartenders 4046bartenders
4047barter 4047barter
4048bartered 4048bartered
4049bartering 4049bartering
4050barters 4050barters
4051Barth 4051Barth
4052Bartholomew 4052Bartholomew
4053Bartlett 4053Bartlett
4054Bartok 4054Bartok
4055Barton 4055Barton
4056basal 4056basal
4057basalt 4057basalt
4058Bascom 4058Bascom
4059base 4059base
4060baseball 4060baseball
4061baseballs 4061baseballs
4062baseband 4062baseband
4063baseboard 4063baseboard
4064baseboards 4064baseboards
4065based 4065based
4066Basel 4066Basel
4067baseless 4067baseless
4068baseline 4068baseline
4069baselines 4069baselines
4070basely 4070basely
4071baseman 4071baseman
4072basement 4072basement
4073basements 4073basements
4074baseness 4074baseness
4075baser 4075baser
4076bases 4076bases
4077bash 4077bash
4078bashed 4078bashed
4079bashes 4079bashes
4080bashful 4080bashful
4081bashfulness 4081bashfulness
4082bashing 4082bashing
4083BASIC 4083BASIC
4084Basic 4084Basic
4085basic 4085basic
4086basically 4086basically
4087basics 4087basics
4088Basie 4088Basie
4089basil 4089basil
4090basin 4090basin
4091basing 4091basing
4092basins 4092basins
4093basis 4093basis
4094bask 4094bask
4095basked 4095basked
4096basket 4096basket
4097basketball 4097basketball
4098basketballs 4098basketballs
4099baskets 4099baskets
4100basking 4100basking
4101Basque 4101Basque
4102bass 4102bass
4103basses 4103basses
4104basset 4104basset
4105Bassett 4105Bassett
4106bassinet 4106bassinet
4107bassinets 4107bassinets
4108bastard 4108bastard
4109bastards 4109bastards
4110baste 4110baste
4111basted 4111basted
4112bastes 4112bastes
4113basting 4113basting
4114bastion 4114bastion
4115bastions 4115bastions
4116bat 4116bat
4117Batavia 4117Batavia
4118batch 4118batch
4119batched 4119batched
4120Batchelder 4120Batchelder
4121batches 4121batches
4122Bateman 4122Bateman
4123Bates 4123Bates
4124bath 4124bath
4125bathe 4125bathe
4126bathed 4126bathed
4127bather 4127bather
4128bathers 4128bathers
4129bathes 4129bathes
4130bathing 4130bathing
4131bathos 4131bathos
4132bathrobe 4132bathrobe
4133bathrobes 4133bathrobes
4134bathroom 4134bathroom
4135bathrooms 4135bathrooms
4136baths 4136baths
4137bathtub 4137bathtub
4138bathtubs 4138bathtubs
4139Bathurst 4139Bathurst
4140Batista 4140Batista
4141baton 4141baton
4142batons 4142batons
4143Bator 4143Bator
4144bats 4144bats
4145battalion 4145battalion
4146battalions 4146battalions
4147batted 4147batted
4148Battelle 4148Battelle
4149batten 4149batten
4150battens 4150battens
4151batter 4151batter
4152battered 4152battered
4153batteries 4153batteries
4154battering 4154battering
4155batters 4155batters
4156battery 4156battery
4157batting 4157batting
4158battle 4158battle
4159battled 4159battled
4160battlefield 4160battlefield
4161battlefields 4161battlefields
4162battlefront 4162battlefront
4163battlefronts 4163battlefronts
4164battleground 4164battleground
4165battlegrounds 4165battlegrounds
4166battlement 4166battlement
4167battlements 4167battlements
4168battler 4168battler
4169battlers 4169battlers
4170battles 4170battles
4171battleship 4171battleship
4172battleships 4172battleships
4173battling 4173battling
4174bauble 4174bauble
4175baubles 4175baubles
4176baud 4176baud
4177Baudelaire 4177Baudelaire
4178Bauer 4178Bauer
4179Bauhaus 4179Bauhaus
4180Bausch 4180Bausch
4181bauxite 4181bauxite
4182Bavaria 4182Bavaria
4183Bavarian 4183Bavarian
4184bawdy 4184bawdy
4185bawl 4185bawl
4186bawled 4186bawled
4187bawling 4187bawling
4188bawls 4188bawls
4189Baxter 4189Baxter
4190bay 4190bay
4191Bayda 4191Bayda
4192bayed 4192bayed
4193Bayes 4193Bayes
4194Bayesian 4194Bayesian
4195baying 4195baying
4196Baylor 4196Baylor
4197bayonet 4197bayonet
4198bayonets 4198bayonets
4199Bayonne 4199Bayonne
4200bayou 4200bayou
4201bayous 4201bayous
4202Bayport 4202Bayport
4203Bayreuth 4203Bayreuth
4204bays 4204bays
4205bazaar 4205bazaar
4206bazaars 4206bazaars
4207be 4207be
4208beach 4208beach
4209beached 4209beached
4210beaches 4210beaches
4211beachhead 4211beachhead
4212beachheads 4212beachheads
4213beaching 4213beaching
4214beacon 4214beacon
4215beacons 4215beacons
4216bead 4216bead
4217beaded 4217beaded
4218beading 4218beading
4219beadle 4219beadle
4220beadles 4220beadles
4221beads 4221beads
4222beady 4222beady
4223beagle 4223beagle
4224beagles 4224beagles
4225beak 4225beak
4226beaked 4226beaked
4227beaker 4227beaker
4228beakers 4228beakers
4229beaks 4229beaks
4230beam 4230beam
4231beamed 4231beamed
4232beamer 4232beamer
4233beamers 4233beamers
4234beaming 4234beaming
4235beams 4235beams
4236bean 4236bean
4237beanbag 4237beanbag
4238beaned 4238beaned
4239beaner 4239beaner
4240beaners 4240beaners
4241beaning 4241beaning
4242beans 4242beans
4243bear 4243bear
4244bearable 4244bearable
4245bearably 4245bearably
4246beard 4246beard
4247bearded 4247bearded
4248beardless 4248beardless
4249beards 4249beards
4250Beardsley 4250Beardsley
4251bearer 4251bearer
4252bearers 4252bearers
4253bearing 4253bearing
4254bearings 4254bearings
4255bearish 4255bearish
4256bears 4256bears
4257beast 4257beast
4258beastly 4258beastly
4259beasts 4259beasts
4260beat 4260beat
4261beatable 4261beatable
4262beatably 4262beatably
4263beaten 4263beaten
4264beater 4264beater
4265beaters 4265beaters
4266beatific 4266beatific
4267beatification 4267beatification
4268beatify 4268beatify
4269beating 4269beating
4270beatings 4270beatings
4271beatitude 4271beatitude
4272beatitudes 4272beatitudes
4273beatnik 4273beatnik
4274beatniks 4274beatniks
4275Beatrice 4275Beatrice
4276beats 4276beats
4277beau 4277beau
4278Beauchamps 4278Beauchamps
4279Beaujolais 4279Beaujolais
4280Beaumont 4280Beaumont
4281Beauregard 4281Beauregard
4282beaus 4282beaus
4283beauteous 4283beauteous
4284beauteously 4284beauteously
4285beauties 4285beauties
4286beautifications 4286beautifications
4287beautified 4287beautified
4288beautifier 4288beautifier
4289beautifiers 4289beautifiers
4290beautifies 4290beautifies
4291beautiful 4291beautiful
4292beautifully 4292beautifully
4293beautify 4293beautify
4294beautifying 4294beautifying
4295beauty 4295beauty
4296beaver 4296beaver
4297beavers 4297beavers
4298Beaverton 4298Beaverton
4299becalm 4299becalm
4300becalmed 4300becalmed
4301becalming 4301becalming
4302becalms 4302becalms
4303became 4303became
4304because 4304because
4305Bechtel 4305Bechtel
4306beck 4306beck
4307Becker 4307Becker
4308Beckman 4308Beckman
4309beckon 4309beckon
4310beckoned 4310beckoned
4311beckoning 4311beckoning
4312beckons 4312beckons
4313Becky 4313Becky
4314become 4314become
4315becomes 4315becomes
4316becoming 4316becoming
4317becomingly 4317becomingly
4318bed 4318bed
4319bedazzle 4319bedazzle
4320bedazzled 4320bedazzled
4321bedazzlement 4321bedazzlement
4322bedazzles 4322bedazzles
4323bedazzling 4323bedazzling
4324bedbug 4324bedbug
4325bedbugs 4325bedbugs
4326bedded 4326bedded
4327bedder 4327bedder
4328bedders 4328bedders
4329bedding 4329bedding
4330bedevil 4330bedevil
4331bedeviled 4331bedeviled
4332bedeviling 4332bedeviling
4333bedevils 4333bedevils
4334bedfast 4334bedfast
4335Bedford 4335Bedford
4336bedlam 4336bedlam
4337bedpost 4337bedpost
4338bedposts 4338bedposts
4339bedraggle 4339bedraggle
4340bedraggled 4340bedraggled
4341bedridden 4341bedridden
4342bedrock 4342bedrock
4343bedroom 4343bedroom
4344bedrooms 4344bedrooms
4345beds 4345beds
4346bedside 4346bedside
4347bedspread 4347bedspread
4348bedspreads 4348bedspreads
4349bedspring 4349bedspring
4350bedsprings 4350bedsprings
4351bedstead 4351bedstead
4352bedsteads 4352bedsteads
4353bedtime 4353bedtime
4354bee 4354bee
4355Beebe 4355Beebe
4356beech 4356beech
4357Beecham 4357Beecham
4358beechen 4358beechen
4359beecher 4359beecher
4360beef 4360beef
4361beefed 4361beefed
4362beefer 4362beefer
4363beefers 4363beefers
4364beefing 4364beefing
4365beefs 4365beefs
4366beefsteak 4366beefsteak
4367beefy 4367beefy
4368beehive 4368beehive
4369beehives 4369beehives
4370been 4370been
4371beep 4371beep
4372beeps 4372beeps
4373beer 4373beer
4374beers 4374beers
4375bees 4375bees
4376beet 4376beet
4377Beethoven 4377Beethoven
4378beetle 4378beetle
4379beetled 4379beetled
4380beetles 4380beetles
4381beetling 4381beetling
4382beets 4382beets
4383befall 4383befall
4384befallen 4384befallen
4385befalling 4385befalling
4386befalls 4386befalls
4387befell 4387befell
4388befit 4388befit
4389befits 4389befits
4390befitted 4390befitted
4391befitting 4391befitting
4392befog 4392befog
4393befogged 4393befogged
4394befogging 4394befogging
4395before 4395before
4396beforehand 4396beforehand
4397befoul 4397befoul
4398befouled 4398befouled
4399befouling 4399befouling
4400befouls 4400befouls
4401befriend 4401befriend
4402befriended 4402befriended
4403befriending 4403befriending
4404befriends 4404befriends
4405befuddle 4405befuddle
4406befuddled 4406befuddled
4407befuddles 4407befuddles
4408befuddling 4408befuddling
4409beg 4409beg
4410began 4410began
4411beget 4411beget
4412begets 4412begets
4413begetting 4413begetting
4414beggar 4414beggar
4415beggarly 4415beggarly
4416beggars 4416beggars
4417beggary 4417beggary
4418begged 4418begged
4419begging 4419begging
4420begin 4420begin
4421beginner 4421beginner
4422beginners 4422beginners
4423beginning 4423beginning
4424beginnings 4424beginnings
4425begins 4425begins
4426begot 4426begot
4427begotten 4427begotten
4428begrudge 4428begrudge
4429begrudged 4429begrudged
4430begrudges 4430begrudges
4431begrudging 4431begrudging
4432begrudgingly 4432begrudgingly
4433begs 4433begs
4434beguile 4434beguile
4435beguiled 4435beguiled
4436beguiles 4436beguiles
4437beguiling 4437beguiling
4438begun 4438begun
4439behalf 4439behalf
4440behave 4440behave
4441behaved 4441behaved
4442behaves 4442behaves
4443behaving 4443behaving
4444behavior 4444behavior
4445behavioral 4445behavioral
4446behaviorally 4446behaviorally
4447behaviorism 4447behaviorism
4448behavioristic 4448behavioristic
4449behaviors 4449behaviors
4450behead 4450behead
4451beheading 4451beheading
4452beheld 4452beheld
4453behemoth 4453behemoth
4454behemoths 4454behemoths
4455behest 4455behest
4456behind 4456behind
4457behold 4457behold
4458beholden 4458beholden
4459beholder 4459beholder
4460beholders 4460beholders
4461beholding 4461beholding
4462beholds 4462beholds
4463behoove 4463behoove
4464behooves 4464behooves
4465beige 4465beige
4466Beijing 4466Beijing
4467being 4467being
4468beings 4468beings
4469Beirut 4469Beirut
4470Bela 4470Bela
4471belabor 4471belabor
4472belabored 4472belabored
4473belaboring 4473belaboring
4474belabors 4474belabors
4475belated 4475belated
4476belatedly 4476belatedly
4477belay 4477belay
4478belayed 4478belayed
4479belaying 4479belaying
4480belays 4480belays
4481belch 4481belch
4482belched 4482belched
4483belches 4483belches
4484belching 4484belching
4485Belfast 4485Belfast
4486belfries 4486belfries
4487belfry 4487belfry
4488Belgian 4488Belgian
4489Belgians 4489Belgians
4490Belgium 4490Belgium
4491Belgrade 4491Belgrade
4492belie 4492belie
4493belied 4493belied
4494belief 4494belief
4495beliefs 4495beliefs
4496belies 4496belies
4497believable 4497believable
4498believably 4498believably
4499believe 4499believe
4500believed 4500believed
4501believer 4501believer
4502believers 4502believers
4503believes 4503believes
4504believing 4504believing
4505belittle 4505belittle
4506belittled 4506belittled
4507belittles 4507belittles
4508belittling 4508belittling
4509Belize 4509Belize
4510bell 4510bell
4511Bella 4511Bella
4512Bellamy 4512Bellamy
4513Bellatrix 4513Bellatrix
4514bellboy 4514bellboy
4515bellboys 4515bellboys
4516belle 4516belle
4517belles 4517belles
4518Belleville 4518Belleville
4519bellhop 4519bellhop
4520bellhops 4520bellhops
4521bellicose 4521bellicose
4522bellicosity 4522bellicosity
4523bellies 4523bellies
4524belligerence 4524belligerence
4525belligerent 4525belligerent
4526belligerently 4526belligerently
4527belligerents 4527belligerents
4528Bellingham 4528Bellingham
4529Bellini 4529Bellini
4530bellman 4530bellman
4531bellmen 4531bellmen
4532Bellovin 4532Bellovin
4533bellow 4533bellow
4534bellowed 4534bellowed
4535bellowing 4535bellowing
4536bellows 4536bellows
4537bells 4537bells
4538bellum 4538bellum
4539bellwether 4539bellwether
4540bellwethers 4540bellwethers
4541Bellwood 4541Bellwood
4542belly 4542belly
4543bellyache 4543bellyache
4544bellyfull 4544bellyful
4545Belmont 4545Belmont
4546Beloit 4546Beloit
4547belong 4547belong
4548belonged 4548belonged
4549belonging 4549belonging
4550belongings 4550belongings
4551belongs 4551belongs
4552beloved 4552beloved
4553below 4553below
4554Belshazzar 4554Belshazzar
4555belt 4555belt
4556belted 4556belted
4557belting 4557belting
4558Belton 4558Belton
4559belts 4559belts
4560Beltsville 4560Beltsville
4561Belushi 4561Belushi
4562bely 4562bely
4563belying 4563belying
4564bemoan 4564bemoan
4565bemoaned 4565bemoaned
4566bemoaning 4566bemoaning
4567bemoans 4567bemoans
4568Ben 4568Ben
4569Benares 4569Benares
4570bench 4570bench
4571benched 4571benched
4572benches 4572benches
4573benchmark 4573benchmark
4574benchmarking 4574benchmarking
4575benchmarks 4575benchmarks
4576bend 4576bend
4577bendable 4577bendable
4578Bender 4578Bender
4579benders 4579benders
4580bending 4580bending
4581Bendix 4581Bendix
4582bends 4582bends
4583beneath 4583beneath
4584Benedict 4584Benedict
4585Benedictine 4585Benedictine
4586benediction 4586benediction
4587benedictions 4587benedictions
4588Benedikt 4588Benedikt
4589benefactor 4589benefactor
4590benefactors 4590benefactors
4591beneficence 4591beneficence
4592beneficences 4592beneficences
4593beneficent 4593beneficent
4594beneficial 4594beneficial
4595beneficially 4595beneficially
4596beneficiaries 4596beneficiaries
4597beneficiary 4597beneficiary
4598benefit 4598benefit
4599benefited 4599benefited
4600benefiting 4600benefiting
4601benefits 4601benefits
4602benefitted 4602benefitted
4603benefitting 4603benefitting
4604Benelux 4604Benelux
4605benevolence 4605benevolence
4606benevolent 4606benevolent
4607Bengal 4607Bengal
4608Bengali 4608Bengali
4609benighted 4609benighted
4610benign 4610benign
4611benignly 4611benignly
4612Benjamin 4612Benjamin
4613Bennett 4613Bennett
4614Bennington 4614Bennington
4615Benny 4615Benny
4616Benson 4616Benson
4617bent 4617bent
4618Bentham 4618Bentham
4619Bentley 4619Bentley
4620Bentleys 4620Bentleys
4621Benton 4621Benton
4622Benz 4622Benz
4623Benzedrine 4623Benzedrine
4624benzene 4624benzene
4625Beograd 4625Beograd
4626Beowulf 4626Beowulf
4627bequeath 4627bequeath
4628bequeathal 4628bequeathal
4629bequeathed 4629bequeathed
4630bequeathing 4630bequeathing
4631bequeaths 4631bequeaths
4632bequest 4632bequest
4633bequests 4633bequests
4634berate 4634berate
4635berated 4635berated
4636berates 4636berates
4637berating 4637berating
4638Berea 4638Berea
4639bereave 4639bereave
4640bereaved 4640bereaved
4641bereavement 4641bereavement
4642bereavements 4642bereavements
4643bereaves 4643bereaves
4644bereaving 4644bereaving
4645bereft 4645bereft
4646Berenices 4646Berenices
4647Beresford 4647Beresford
4648beret 4648beret
4649berets 4649berets
4650Bergen 4650Bergen
4651Bergland 4651Bergland
4652Berglund 4652Berglund
4653Bergman 4653Bergman
4654Bergson 4654Bergson
4655Bergsten 4655Bergsten
4656Bergstrom 4656Bergstrom
4657beribboned 4657beribboned
4658beriberi 4658beriberi
4659Beringer 4659Beringer
4660Berkeley 4660Berkeley
4661berkelium 4661berkelium
4662Berkowitz 4662Berkowitz
4663Berkshire 4663Berkshire
4664Berkshires 4664Berkshires
4665Berlin 4665Berlin
4666Berliner 4666Berliner
4667Berliners 4667Berliners
4668Berlinize 4668Berlinize
4669Berlinizes 4669Berlinizes
4670Berlioz 4670Berlioz
4671Berlitz 4671Berlitz
4672Berman 4672Berman
4673Bermuda 4673Bermuda
4674Bern 4674Bern
4675Bernadine 4675Bernadine
4676Bernard 4676Bernard
4677Bernardine 4677Bernardine
4678Bernardino 4678Bernardino
4679Bernardo 4679Bernardo
4680berne 4680berne
4681Bernet 4681Bernet
4682Bernhard 4682Bernhard
4683Bernice 4683Bernice
4684Bernie 4684Bernie
4685Berniece 4685Berniece
4686Bernini 4686Bernini
4687Bernoulli 4687Bernoulli
4688Bernstein 4688Bernstein
4689Berra 4689Berra
4690berries 4690berries
4691berry 4691berry
4692berserk 4692berserk
4693Bert 4693Bert
4694berth 4694berth
4695Bertha 4695Bertha
4696berths 4696berths
4697Bertie 4697Bertie
4698Bertram 4698Bertram
4699Bertrand 4699Bertrand
4700Berwick 4700Berwick
4701beryl 4701beryl
4702beryllium 4702beryllium
4703beseech 4703beseech
4704beseeches 4704beseeches
4705beseeching 4705beseeching
4706beset 4706beset
4707besets 4707besets
4708besetting 4708besetting
4709beside 4709beside
4710besides 4710besides
4711besiege 4711besiege
4712besieged 4712besieged
4713besieger 4713besieger
4714besiegers 4714besiegers
4715besieging 4715besieging
4716besmirch 4716besmirch
4717besmirched 4717besmirched
4718besmirches 4718besmirches
4719besmirching 4719besmirching
4720besotted 4720besotted
4721besotter 4721besotter
4722besotting 4722besotting
4723besought 4723besought
4724bespeak 4724bespeak
4725bespeaks 4725bespeaks
4726bespectacled 4726bespectacled
4727bespoke 4727bespoke
4728Bess 4728Bess
4729Bessel 4729Bessel
4730Bessemer 4730Bessemer
4731Bessemerize 4731Bessemerize
4732Bessemerizes 4732Bessemerizes
4733Bessie 4733Bessie
4734best 4734best
4735bested 4735bested
4736bestial 4736bestial
4737besting 4737besting
4738bestir 4738bestir
4739bestirring 4739bestirring
4740bestow 4740bestow
4741bestowal 4741bestowal
4742bestowed 4742bestowed
4743bests 4743bests
4744bestseller 4744bestseller
4745bestsellers 4745bestsellers
4746bestselling 4746bestselling
4747bet 4747bet
4748beta 4748beta
4749betatron 4749betatron
4750betel 4750betel
4751Betelgeuse 4751Betelgeuse
4752Bethesda 4752Bethesda
4753Bethlehem 4753Bethlehem
4754betide 4754betide
4755betray 4755betray
4756betrayal 4756betrayal
4757betrayed 4757betrayed
4758betrayer 4758betrayer
4759betraying 4759betraying
4760betrays 4760betrays
4761betroth 4761betroth
4762betrothal 4762betrothal
4763betrothed 4763betrothed
4764bets 4764bets
4765Betsey 4765Betsey
4766Betsy 4766Betsy
4767Bette 4767Bette
4768better 4768better
4769bettered 4769bettered
4770bettering 4770bettering
4771betterment 4771betterment
4772betterments 4772betterments
4773betters 4773betters
4774Betties 4774Betties
4775betting 4775betting
4776Betty 4776Betty
4777between 4777between
4778betwixt 4778betwixt
4779bevel 4779bevel
4780beveled 4780beveled
4781beveling 4781beveling
4782bevels 4782bevels
4783beverage 4783beverage
4784beverages 4784beverages
4785Beverly 4785Beverly
4786bevy 4786bevy
4787bewail 4787bewail
4788bewailed 4788bewailed
4789bewailing 4789bewailing
4790bewails 4790bewails
4791beware 4791beware
4792bewhiskered 4792bewhiskered
4793bewilder 4793bewilder
4794bewildered 4794bewildered
4795bewildering 4795bewildering
4796bewilderingly 4796bewilderingly
4797bewilderment 4797bewilderment
4798bewilders 4798bewilders
4799bewitch 4799bewitch
4800bewitched 4800bewitched
4801bewitches 4801bewitches
4802bewitching 4802bewitching
4803beyond 4803beyond
4804Bhagavad-Gita 4804Bhagavad-Gita
4805Bhutan 4805Bhutan
4806Bialystok 4806Bialystok
4807Bianco 4807Bianco
4808biannual 4808biannual
4809bias 4809bias
4810biased 4810biased
4811biases 4811biases
4812biasing 4812biasing
4813bib 4813bib
4814bibbed 4814bibbed
4815bibbing 4815bibbing
4816Bible 4816Bible
4817bibles 4817bibles
4818biblical 4818biblical
4819biblically 4819biblically
4820bibliographic 4820bibliographic
4821bibliographical 4821bibliographical
4822bibliographies 4822bibliographies
4823bibliography 4823bibliography
4824bibliophile 4824bibliophile
4825bibs 4825bibs
4826bicameral 4826bicameral
4827bicarbonate 4827bicarbonate
4828bicentennial 4828bicentennial
4829bicep 4829bicep
4830biceps 4830biceps
4831bicker 4831bicker
4832bickered 4832bickered
4833bickering 4833bickering
4834bickers 4834bickers
4835biconcave 4835biconcave
4836biconnected 4836biconnected
4837biconvex 4837biconvex
4838bicycle 4838bicycle
4839bicycled 4839bicycled
4840bicycler 4840bicycler
4841bicyclers 4841bicyclers
4842bicycles 4842bicycles
4843bicycling 4843bicycling
4844bid 4844bid
4845biddable 4845biddable
4846bidden 4846bidden
4847bidder 4847bidder
4848bidders 4848bidders
4849biddies 4849biddies
4850bidding 4850bidding
4851Biddle 4851Biddle
4852biddy 4852biddy
4853bide 4853bide
4854bidirectional 4854bidirectional
4855bids 4855bids
4856Bien 4856Bien
4857biennial 4857biennial
4858biennium 4858biennium
4859Bienville 4859Bienville
4860bier 4860bier
4861Bierce 4861Bierce
4862bifocal 4862bifocal
4863bifocals 4863bifocals
4864bifurcate 4864bifurcate
4865big 4865big
4866Bigelow 4866Bigelow
4867bigger 4867bigger
4868biggest 4868biggest
4869Biggs 4869Biggs
4870bight 4870bight
4871bights 4871bights
4872bigness 4872bigness
4873bigot 4873bigot
4874bigoted 4874bigoted
4875bigotry 4875bigotry
4876bigots 4876bigots
4877biharmonic 4877biharmonic
4878bijection 4878bijection
4879bijections 4879bijections
4880bijective 4880bijective
4881bijectively 4881bijectively
4882bike 4882bike
4883bikes 4883bikes
4884biking 4884biking
4885bikini 4885bikini
4886bikinis 4886bikinis
4887bilabial 4887bilabial
4888bilateral 4888bilateral
4889bilaterally 4889bilaterally
4890Bilbao 4890Bilbao
4891Bilbo 4891Bilbo
4892bile 4892bile
4893bilge 4893bilge
4894bilges 4894bilges
4895bilinear 4895bilinear
4896bilingual 4896bilingual
4897bilk 4897bilk
4898bilked 4898bilked
4899bilking 4899bilking
4900bilks 4900bilks
4901bill 4901bill
4902billboard 4902billboard
4903billboards 4903billboards
4904billed 4904billed
4905biller 4905biller
4906billers 4906billers
4907billet 4907billet
4908billeted 4908billeted
4909billeting 4909billeting
4910billets 4910billets
4911billiard 4911billiard
4912billiards 4912billiards
4913Billie 4913Billie
4914Billiken 4914Billiken
4915Billikens 4915Billikens
4916billing 4916billing
4917Billings 4917Billings
4918billion 4918billion
4919billions 4919billions
4920billionth 4920billionth
4921billow 4921billow
4922billowed 4922billowed
4923billows 4923billows
4924bills 4924bills
4925Biltmore 4925Biltmore
4926bimetallic 4926bimetallic
4927bimetallism 4927bimetallism
4928Bimini 4928Bimini
4929bimodal 4929bimodal
4930bimolecular 4930bimolecular
4931bimonthlies 4931bimonthlies
4932bimonthly 4932bimonthly
4933bin 4933bin
4934binaries 4934binaries
4935binary 4935binary
4936binaural 4936binaural
4937bind 4937bind
4938binder 4938binder
4939binders 4939binders
4940binding 4940binding
4941bindings 4941bindings
4942binds 4942binds
4943bing 4943bing
4944binge 4944binge
4945binges 4945binges
4946Bingham 4946Bingham
4947Binghamton 4947Binghamton
4948bingo 4948bingo
4949Bini 4949Bini
4950binocular 4950binocular
4951binoculars 4951binoculars
4952binomial 4952binomial
4953bins 4953bins
4954binuclear 4954binuclear
4955biochemical 4955biochemical
4956biochemist 4956biochemist
4957biochemistry 4957biochemistry
4958biofeedback 4958biofeedback
4959biographer 4959biographer
4960biographers 4960biographers
4961biographic 4961biographic
4962biographical 4962biographical
4963biographically 4963biographically
4964biographies 4964biographies
4965biography 4965biography
4966biological 4966biological
4967biologically 4967biologically
4968biologist 4968biologist
4969biologists 4969biologists
4970biology 4970biology
4971biomedical 4971biomedical
4972biomedicine 4972biomedicine
4973biophysical 4973biophysical
4974biophysicist 4974biophysicist
4975biophysics 4975biophysics
4976biopsies 4976biopsies
4977biopsy 4977biopsy
4978bioscience 4978bioscience
4979biosphere 4979biosphere
4980biostatistic 4980biostatistic
4981biosynthesize 4981biosynthesize
4982biota 4982biota
4983biotic 4983biotic
4984bipartisan 4984bipartisan
4985bipartite 4985bipartite
4986biped 4986biped
4987bipeds 4987bipeds
4988biplane 4988biplane
4989biplanes 4989biplanes
4990bipolar 4990bipolar
4991biracial 4991biracial
4992birch 4992birch
4993birchen 4993birchen
4994birches 4994birches
4995bird 4995bird
4996birdbath 4996birdbath
4997birdbaths 4997birdbaths
4998birdie 4998birdie
4999birdied 4999birdied
5000birdies 5000birdies
5001birdlike 5001birdlike
5002birds 5002birds
5003birefringence 5003birefringence
5004birefringent 5004birefringent
5005Birgit 5005Birgit
5006Birmingham 5006Birmingham
5007Birminghamize 5007Birminghamize
5008Birminghamizes 5008Birminghamizes
5009birth 5009birth
5010birthday 5010birthday
5011birthdays 5011birthdays
5012birthed 5012birthed
5013birthplace 5013birthplace
5014birthplaces 5014birthplaces
5015birthright 5015birthright
5016birthrights 5016birthrights
5017births 5017births
5018Biscayne 5018Biscayne
5019biscuit 5019biscuit
5020biscuits 5020biscuits
5021bisect 5021bisect
5022bisected 5022bisected
5023bisecting 5023bisecting
5024bisection 5024bisection
5025bisections 5025bisections
5026bisector 5026bisector
5027bisectors 5027bisectors
5028bisects 5028bisects
5029bishop 5029bishop
5030bishops 5030bishops
5031Bismarck 5031Bismarck
5032Bismark 5032Bismark
5033bismuth 5033bismuth
5034bison 5034bison
5035bisons 5035bisons
5036bisque 5036bisque
5037bisques 5037bisques
5038Bissau 5038Bissau
5039bistable 5039bistable
5040bistate 5040bistate
5041bit 5041bit
5042bitch 5042bitch
5043bitches 5043bitches
5044bite 5044bite
5045biter 5045biter
5046biters 5046biters
5047bites 5047bites
5048biting 5048biting
5049bitingly 5049bitingly
5050bitmap 5050bitmap
5051BITNET 5051BITNET
5052bits 5052bits
5053bitten 5053bitten
5054bitter 5054bitter
5055bitterer 5055bitterer
5056bitterest 5056bitterest
5057bitterly 5057bitterly
5058bitterness 5058bitterness
5059bitternut 5059bitternut
5060bitterroot 5060bitterroot
5061bitters 5061bitters
5062bittersweet 5062bittersweet
5063bitumen 5063bitumen
5064bituminous 5064bituminous
5065bitwise 5065bitwise
5066bivalve 5066bivalve
5067bivalves 5067bivalves
5068bivariate 5068bivariate
5069bivouac 5069bivouac
5070bivouacs 5070bivouacs
5071biweekly 5071biweekly
5072bizarre 5072bizarre
5073Bizet 5073Bizet
5074blab 5074blab
5075blabbed 5075blabbed
5076blabbermouth 5076blabbermouth
5077blabbermouths 5077blabbermouths
5078blabbing 5078blabbing
5079blabs 5079blabs
5080black 5080black
5081blackberries 5081blackberries
5082blackberry 5082blackberry
5083blackbird 5083blackbird
5084blackbirds 5084blackbirds
5085blackboard 5085blackboard
5086blackboards 5086blackboards
5087Blackburn 5087Blackburn
5088blacked 5088blacked
5089blacken 5089blacken
5090blackened 5090blackened
5091blackening 5091blackening
5092blackens 5092blackens
5093blacker 5093blacker
5094blackest 5094blackest
5095Blackfeet 5095Blackfeet
5096Blackfoot 5096Blackfoot
5097Blackfoots 5097Blackfoots
5098blacking 5098blacking
5099blackjack 5099blackjack
5100blackjacks 5100blackjacks
5101blacklist 5101blacklist
5102blacklisted 5102blacklisted
5103blacklisting 5103blacklisting
5104blacklists 5104blacklists
5105blackly 5105blackly
5106blackmail 5106blackmail
5107blackmailed 5107blackmailed
5108blackmailer 5108blackmailer
5109blackmailers 5109blackmailers
5110blackmailing 5110blackmailing
5111blackmails 5111blackmails
5112Blackman 5112Blackman
5113Blackmer 5113Blackmer
5114blackness 5114blackness
5115blackout 5115blackout
5116blackouts 5116blackouts
5117blacks 5117blacks
5118blacksmith 5118blacksmith
5119blacksmiths 5119blacksmiths
5120Blackstone 5120Blackstone
5121Blackwell 5121Blackwell
5122Blackwells 5122Blackwells
5123bladder 5123bladder
5124bladders 5124bladders
5125blade 5125blade
5126blades 5126blades
5127Blaine 5127Blaine
5128Blair 5128Blair
5129Blake 5129Blake
5130Blakey 5130Blakey
5131blamable 5131blamable
5132blame 5132blame
5133blamed 5133blamed
5134blameless 5134blameless
5135blamelessness 5135blamelessness
5136blamer 5136blamer
5137blamers 5137blamers
5138blames 5138blames
5139blameworthy 5139blameworthy
5140blaming 5140blaming
5141blanch 5141blanch
5142Blanchard 5142Blanchard
5143Blanche 5143Blanche
5144blanched 5144blanched
5145blanches 5145blanches
5146blanching 5146blanching
5147bland 5147bland
5148blandly 5148blandly
5149blandness 5149blandness
5150blank 5150blank
5151blanked 5151blanked
5152blanker 5152blanker
5153blankest 5153blankest
5154blanket 5154blanket
5155blanketed 5155blanketed
5156blanketer 5156blanketer
5157blanketers 5157blanketers
5158blanketing 5158blanketing
5159blankets 5159blankets
5160blanking 5160blanking
5161blankly 5161blankly
5162blankness 5162blankness
5163blanks 5163blanks
5164Blanton 5164Blanton
5165blare 5165blare
5166blared 5166blared
5167blares 5167blares
5168blaring 5168blaring
5169blase 5169blase
5170blaspheme 5170blaspheme
5171blasphemed 5171blasphemed
5172blasphemes 5172blasphemes
5173blasphemies 5173blasphemies
5174blaspheming 5174blaspheming
5175blasphemous 5175blasphemous
5176blasphemously 5176blasphemously
5177blasphemousness 5177blasphemousness
5178blasphemy 5178blasphemy
5179blast 5179blast
5180blasted 5180blasted
5181blaster 5181blaster
5182blasters 5182blasters
5183blasting 5183blasting
5184blasts 5184blasts
5185blatant 5185blatant
5186blatantly 5186blatantly
5187Blatz 5187Blatz
5188blaze 5188blaze
5189blazed 5189blazed
5190blazer 5190blazer
5191blazers 5191blazers
5192blazes 5192blazes
5193blazing 5193blazing
5194bleach 5194bleach
5195bleached 5195bleached
5196bleacher 5196bleacher
5197bleachers 5197bleachers
5198bleaches 5198bleaches
5199bleaching 5199bleaching
5200bleak 5200bleak
5201bleaker 5201bleaker
5202bleakly 5202bleakly
5203bleakness 5203bleakness
5204blear 5204blear
5205bleary 5205bleary
5206bleat 5206bleat
5207bleating 5207bleating
5208bleats 5208bleats
5209bled 5209bled
5210bleed 5210bleed
5211bleeder 5211bleeder
5212bleeding 5212bleeding
5213bleedings 5213bleedings
5214bleeds 5214bleeds
5215Bleeker 5215Bleeker
5216blemish 5216blemish
5217blemishes 5217blemishes
5218blend 5218blend
5219blended 5219blended
5220blender 5220blender
5221blending 5221blending
5222blends 5222blends
5223Blenheim 5223Blenheim
5224bless 5224bless
5225blessed 5225blessed
5226blessing 5226blessing
5227blessings 5227blessings
5228blew 5228blew
5229blight 5229blight
5230blighted 5230blighted
5231blimp 5231blimp
5232blimps 5232blimps
5233blind 5233blind
5234blinded 5234blinded
5235blinder 5235blinder
5236blinders 5236blinders
5237blindfold 5237blindfold
5238blindfolded 5238blindfolded
5239blindfolding 5239blindfolding
5240blindfolds 5240blindfolds
5241blinding 5241blinding
5242blindingly 5242blindingly
5243blindly 5243blindly
5244blindness 5244blindness
5245blinds 5245blinds
5246blink 5246blink
5247blinked 5247blinked
5248blinker 5248blinker
5249blinkers 5249blinkers
5250blinking 5250blinking
5251blinks 5251blinks
5252Blinn 5252Blinn
5253blip 5253blip
5254blips 5254blips
5255bliss 5255bliss
5256blissful 5256blissful
5257blissfully 5257blissfully
5258blister 5258blister
5259blistered 5259blistered
5260blistering 5260blistering
5261blisters 5261blisters
5262blithe 5262blithe
5263blithely 5263blithely
5264blitz 5264blitz
5265blitzes 5265blitzes
5266blitzkrieg 5266blitzkrieg
5267blizzard 5267blizzard
5268blizzards 5268blizzards
5269bloat 5269bloat
5270bloated 5270bloated
5271bloater 5271bloater
5272bloating 5272bloating
5273bloats 5273bloats
5274blob 5274blob
5275blobs 5275blobs
5276bloc 5276bloc
5277Bloch 5277Bloch
5278block 5278block
5279blockade 5279blockade
5280blockaded 5280blockaded
5281blockades 5281blockades
5282blockading 5282blockading
5283blockage 5283blockage
5284blockages 5284blockages
5285blocked 5285blocked
5286blocker 5286blocker
5287blockers 5287blockers
5288blockhouse 5288blockhouse
5289blockhouses 5289blockhouses
5290blocking 5290blocking
5291blocks 5291blocks
5292blocs 5292blocs
5293bloke 5293bloke
5294blokes 5294blokes
5295Blomberg 5295Blomberg
5296Blomquist 5296Blomquist
5297blond 5297blond
5298blonde 5298blonde
5299blondes 5299blondes
5300blonds 5300blonds
5301blood 5301blood
5302bloodbath 5302bloodbath
5303blooded 5303blooded
5304bloodhound 5304bloodhound
5305bloodhounds 5305bloodhounds
5306bloodied 5306bloodied
5307bloodiest 5307bloodiest
5308bloodless 5308bloodless
5309bloods 5309bloods
5310bloodshed 5310bloodshed
5311bloodshot 5311bloodshot
5312bloodstain 5312bloodstain
diff --git a/help/opie-sh/node3.html b/help/opie-sh/node3.html
index 8d16696..f3f1e73 100644
--- a/help/opie-sh/node3.html
+++ b/help/opie-sh/node3.html
@@ -1,71 +1,71 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 2
3<!--Converted with LaTeX2HTML 2002-1 (1.68) 3<!--Converted with LaTeX2HTML 2002-1 (1.68)
4original version by: Nikos Drakos, CBLU, University of Leeds 4original version by: Nikos Drakos, CBLU, University of Leeds
5* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan 5* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
6* with significant contributions from: 6* with significant contributions from:
7 Jens Lippmann, Marek Rouchal, Martin Wilck and others --> 7 Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8<HTML> 8<HTML>
9<HEAD> 9<HEAD>
10<TITLE>What it is for</TITLE> 10<TITLE>What it is for</TITLE>
11<META NAME="description" CONTENT="What it is for"> 11<META NAME="description" CONTENT="What it is for">
12<META NAME="keywords" CONTENT="opie-sh-howto"> 12<META NAME="keywords" CONTENT="opie-sh-howto">
13<META NAME="resource-type" CONTENT="document"> 13<META NAME="resource-type" CONTENT="document">
14<META NAME="distribution" CONTENT="global"> 14<META NAME="distribution" CONTENT="global">
15 15
16<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> 16<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
17<META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> 17<META NAME="Generator" CONTENT="LaTeX2HTML v2002-1">
18<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> 18<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
19 19
20<LINK REL="STYLESHEET" HREF="opie-sh-howto.css"> 20<LINK REL="STYLESHEET" HREF="opie-sh-howto.css">
21 21
22<LINK REL="next" HREF="node4.html"> 22<LINK REL="next" HREF="node4.html">
23<LINK REL="previous" HREF="node2.html"> 23<LINK REL="previous" HREF="node2.html">
24<LINK REL="up" HREF="node2.html"> 24<LINK REL="up" HREF="node2.html">
25<LINK REL="next" HREF="node4.html"> 25<LINK REL="next" HREF="node4.html">
26</HEAD> 26</HEAD>
27 27
28<BODY > 28<BODY >
29<!--Navigation Panel--> 29<!--Navigation Panel-->
30<A NAME="tex2html71" 30<A NAME="tex2html71"
31 HREF="node4.html"> 31 HREF="node4.html">
32<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" 32<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
33 SRC="file:/usr/local/share/lib/latex2html/icons/next.gif"></A> 33 SRC="file:/usr/local/share/lib/latex2html/icons/next.gif"></A>
34<A NAME="tex2html67" 34<A NAME="tex2html67"
35 HREF="node2.html"> 35 HREF="node2.html">
36<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" 36<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
37 SRC="file:/usr/local/share/lib/latex2html/icons/up.gif"></A> 37 SRC="file:/usr/local/share/lib/latex2html/icons/up.gif"></A>
38<A NAME="tex2html61" 38<A NAME="tex2html61"
39 HREF="node2.html"> 39 HREF="node2.html">
40<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" 40<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
41 SRC="file:/usr/local/share/lib/latex2html/icons/prev.gif"></A> 41 SRC="file:/usr/local/share/lib/latex2html/icons/prev.gif"></A>
42<A NAME="tex2html69" 42<A NAME="tex2html69"
43 HREF="node1.html"> 43 HREF="node1.html">
44<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" 44<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
45 SRC="file:/usr/local/share/lib/latex2html/icons/contents.gif"></A> 45 SRC="file:/usr/local/share/lib/latex2html/icons/contents.gif"></A>
46<BR> 46<BR>
47<B> Next:</B> <A NAME="tex2html72" 47<B> Next:</B> <A NAME="tex2html72"
48 HREF="node4.html">What it can do</A> 48 HREF="node4.html">What it can do</A>
49<B> Up:</B> <A NAME="tex2html68" 49<B> Up:</B> <A NAME="tex2html68"
50 HREF="node2.html">Introduction</A> 50 HREF="node2.html">Introduction</A>
51<B> Previous:</B> <A NAME="tex2html62" 51<B> Previous:</B> <A NAME="tex2html62"
52 HREF="node2.html">Introduction</A> 52 HREF="node2.html">Introduction</A>
53 &nbsp <B> <A NAME="tex2html70" 53 &nbsp <B> <A NAME="tex2html70"
54 HREF="node1.html">Contents</A></B> 54 HREF="node1.html">Contents</A></B>
55<BR> 55<BR>
56<BR> 56<BR>
57<!--End of Navigation Panel--> 57<!--End of Navigation Panel-->
58 58
59<H2><A NAME="SECTION00021000000000000000"> 59<H2><A NAME="SECTION00021000000000000000">
60What it is for</A> 60What it is for</A>
61</H2> 61</H2>
62Opie-sh is designed to be a frontend to Opie that can be used from the console. This is especially usefull for creating interactive shell scripts, as it will use the Opie interface (which is presumably familiar to the user) instead of a text based interface (which can be confusing). It can also be convinient for prototyping an app that you want to write for Opie without actually bothering to break out the cross compiler. Opie-sh does not use an Opie specific libs, so you can just as easily use it with Qtopia. 62Opie-sh is designed to be a frontend to Opie that can be used from the console. This is especially useful for creating interactive shell scripts, as it will use the Opie interface (which is presumably familiar to the user) instead of a text based interface (which can be confusing). It can also be convinient for prototyping an app that you want to write for Opie without actually bothering to break out the cross compiler. Opie-sh does not use an Opie specific libs, so you can just as easily use it with Qtopia.
63 63
64<P> 64<P>
65<BR><HR> 65<BR><HR>
66<ADDRESS> 66<ADDRESS>
67 67
682002-05-15 682002-05-15
69</ADDRESS> 69</ADDRESS>
70</BODY> 70</BODY>
71</HTML> 71</HTML>
diff --git a/help/opie-sh/node9.html b/help/opie-sh/node9.html
index b047cf9..e4358ad 100644
--- a/help/opie-sh/node9.html
+++ b/help/opie-sh/node9.html
@@ -1,121 +1,121 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> 1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 2
3<!--Converted with LaTeX2HTML 2002-1 (1.68) 3<!--Converted with LaTeX2HTML 2002-1 (1.68)
4original version by: Nikos Drakos, CBLU, University of Leeds 4original version by: Nikos Drakos, CBLU, University of Leeds
5* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan 5* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
6* with significant contributions from: 6* with significant contributions from:
7 Jens Lippmann, Marek Rouchal, Martin Wilck and others --> 7 Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8<HTML> 8<HTML>
9<HEAD> 9<HEAD>
10<TITLE>Icons</TITLE> 10<TITLE>Icons</TITLE>
11<META NAME="description" CONTENT="Icons"> 11<META NAME="description" CONTENT="Icons">
12<META NAME="keywords" CONTENT="opie-sh-howto"> 12<META NAME="keywords" CONTENT="opie-sh-howto">
13<META NAME="resource-type" CONTENT="document"> 13<META NAME="resource-type" CONTENT="document">
14<META NAME="distribution" CONTENT="global"> 14<META NAME="distribution" CONTENT="global">
15 15
16<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> 16<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
17<META NAME="Generator" CONTENT="LaTeX2HTML v2002-1"> 17<META NAME="Generator" CONTENT="LaTeX2HTML v2002-1">
18<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> 18<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
19 19
20<LINK REL="STYLESHEET" HREF="opie-sh-howto.css"> 20<LINK REL="STYLESHEET" HREF="opie-sh-howto.css">
21 21
22<LINK REL="previous" HREF="node8.html"> 22<LINK REL="previous" HREF="node8.html">
23<LINK REL="up" HREF="node6.html"> 23<LINK REL="up" HREF="node6.html">
24<LINK REL="next" HREF="node10.html"> 24<LINK REL="next" HREF="node10.html">
25</HEAD> 25</HEAD>
26 26
27<BODY > 27<BODY >
28<!--Navigation Panel--> 28<!--Navigation Panel-->
29<A NAME="tex2html144" 29<A NAME="tex2html144"
30 HREF="node10.html"> 30 HREF="node10.html">
31<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" 31<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
32 SRC="file:/usr/local/share/lib/latex2html/icons/next.gif"></A> 32 SRC="file:/usr/local/share/lib/latex2html/icons/next.gif"></A>
33<A NAME="tex2html140" 33<A NAME="tex2html140"
34 HREF="node6.html"> 34 HREF="node6.html">
35<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" 35<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
36 SRC="file:/usr/local/share/lib/latex2html/icons/up.gif"></A> 36 SRC="file:/usr/local/share/lib/latex2html/icons/up.gif"></A>
37<A NAME="tex2html136" 37<A NAME="tex2html136"
38 HREF="node8.html"> 38 HREF="node8.html">
39<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" 39<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
40 SRC="file:/usr/local/share/lib/latex2html/icons/prev.gif"></A> 40 SRC="file:/usr/local/share/lib/latex2html/icons/prev.gif"></A>
41<A NAME="tex2html142" 41<A NAME="tex2html142"
42 HREF="node1.html"> 42 HREF="node1.html">
43<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" 43<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
44 SRC="file:/usr/local/share/lib/latex2html/icons/contents.gif"></A> 44 SRC="file:/usr/local/share/lib/latex2html/icons/contents.gif"></A>
45<BR> 45<BR>
46<B> Next:</B> <A NAME="tex2html145" 46<B> Next:</B> <A NAME="tex2html145"
47 HREF="node10.html">Fileviewer</A> 47 HREF="node10.html">Fileviewer</A>
48<B> Up:</B> <A NAME="tex2html141" 48<B> Up:</B> <A NAME="tex2html141"
49 HREF="node6.html">Usage</A> 49 HREF="node6.html">Usage</A>
50<B> Previous:</B> <A NAME="tex2html137" 50<B> Previous:</B> <A NAME="tex2html137"
51 HREF="node8.html">Buttons</A> 51 HREF="node8.html">Buttons</A>
52 &nbsp <B> <A NAME="tex2html143" 52 &nbsp <B> <A NAME="tex2html143"
53 HREF="node1.html">Contents</A></B> 53 HREF="node1.html">Contents</A></B>
54<BR> 54<BR>
55<BR> 55<BR>
56<!--End of Navigation Panel--> 56<!--End of Navigation Panel-->
57 57
58<H3><A NAME="SECTION00031300000000000000"> 58<H3><A NAME="SECTION00031300000000000000">
59Icons</A> 59Icons</A>
60</H3> 60</H3>
61There are three icons that you can display with a message box: information, warning, and error. These are designed to help inform the user what type of message you are giving them. 61There are three icons that you can display with a message box: information, warning, and error. These are designed to help inform the user what type of message you are giving them.
62 62
63<P> 63<P>
64An information icon is specified with the ``-I'' flag, and should be used for outputing non-critical information to the user, or asking them a simple question. It is also the default icon, and will be used if you do not specify another one. Example: 64An information icon is specified with the ``-I'' flag, and should be used for outputing non-critical information to the user, or asking them a simple question. It is also the default icon, and will be used if you do not specify another one. Example:
65 65
66<P> 66<P>
67<PRE> 67<PRE>
68opie-sh -m -I 68opie-sh -m -I
69</PRE> 69</PRE>
70 70
71<P> 71<P>
72A warning icon is specified with the ``-w'' flag, and should be used for problems that the user should know about, but that will not necessarily cause the program to stop working. For example, if the program cannot find a configureation file, you might pop up a warning, notifying the user that the default configuration will be used. This is also usefull for asking the user if they want to continue doing something that might damage the system (editing rc scripts, for instance). Example: 72A warning icon is specified with the ``-w'' flag, and should be used for problems that the user should know about, but that will not necessarily cause the program to stop working. For example, if the program cannot find a configureation file, you might pop up a warning, notifying the user that the default configuration will be used. This is also useful for asking the user if they want to continue doing something that might damage the system (editing rc scripts, for instance). Example:
73 73
74<P> 74<P>
75<PRE> 75<PRE>
76opie-sh -m -w 76opie-sh -m -w
77</PRE> 77</PRE>
78 78
79<P> 79<P>
80An error icon is specified with the ``-e'' flag, and should be used for problems that will cause the program to stop running, or otherwise do the wrong thing. It should be used sparingly, as it signifies that something is seriously wrong. Example: 80An error icon is specified with the ``-e'' flag, and should be used for problems that will cause the program to stop running, or otherwise do the wrong thing. It should be used sparingly, as it signifies that something is seriously wrong. Example:
81 81
82<P> 82<P>
83<PRE> 83<PRE>
84opie-sh -m -e 84opie-sh -m -e
85</PRE> 85</PRE>
86 86
87<P> 87<P>
88<HR> 88<HR>
89<!--Navigation Panel--> 89<!--Navigation Panel-->
90<A NAME="tex2html144" 90<A NAME="tex2html144"
91 HREF="node10.html"> 91 HREF="node10.html">
92<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" 92<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
93 SRC="file:/usr/local/share/lib/latex2html/icons/next.gif"></A> 93 SRC="file:/usr/local/share/lib/latex2html/icons/next.gif"></A>
94<A NAME="tex2html140" 94<A NAME="tex2html140"
95 HREF="node6.html"> 95 HREF="node6.html">
96<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" 96<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
97 SRC="file:/usr/local/share/lib/latex2html/icons/up.gif"></A> 97 SRC="file:/usr/local/share/lib/latex2html/icons/up.gif"></A>
98<A NAME="tex2html136" 98<A NAME="tex2html136"
99 HREF="node8.html"> 99 HREF="node8.html">
100<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" 100<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
101 SRC="file:/usr/local/share/lib/latex2html/icons/prev.gif"></A> 101 SRC="file:/usr/local/share/lib/latex2html/icons/prev.gif"></A>
102<A NAME="tex2html142" 102<A NAME="tex2html142"
103 HREF="node1.html"> 103 HREF="node1.html">
104<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" 104<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
105 SRC="file:/usr/local/share/lib/latex2html/icons/contents.gif"></A> 105 SRC="file:/usr/local/share/lib/latex2html/icons/contents.gif"></A>
106<BR> 106<BR>
107<B> Next:</B> <A NAME="tex2html145" 107<B> Next:</B> <A NAME="tex2html145"
108 HREF="node10.html">Fileviewer</A> 108 HREF="node10.html">Fileviewer</A>
109<B> Up:</B> <A NAME="tex2html141" 109<B> Up:</B> <A NAME="tex2html141"
110 HREF="node6.html">Usage</A> 110 HREF="node6.html">Usage</A>
111<B> Previous:</B> <A NAME="tex2html137" 111<B> Previous:</B> <A NAME="tex2html137"
112 HREF="node8.html">Buttons</A> 112 HREF="node8.html">Buttons</A>
113 &nbsp <B> <A NAME="tex2html143" 113 &nbsp <B> <A NAME="tex2html143"
114 HREF="node1.html">Contents</A></B> 114 HREF="node1.html">Contents</A></B>
115<!--End of Navigation Panel--> 115<!--End of Navigation Panel-->
116<ADDRESS> 116<ADDRESS>
117 117
1182002-05-15 1182002-05-15
119</ADDRESS> 119</ADDRESS>
120</BODY> 120</BODY>
121</HTML> 121</HTML>
diff --git a/noncore/apps/odict/eng_ita.dic b/noncore/apps/odict/eng_ita.dic
index f338faa..6db2389 100644
--- a/noncore/apps/odict/eng_ita.dic
+++ b/noncore/apps/odict/eng_ita.dic
@@ -9835,1537 +9835,1536 @@ ruination\distruzione
9835ruined\distrussi 9835ruined\distrussi
9836rule\prescrizione, norma, dominio, regnare, criterio 9836rule\prescrizione, norma, dominio, regnare, criterio
9837ruler\regolo, regolatore, sovrano 9837ruler\regolo, regolatore, sovrano
9838rules\regolare, dominato 9838rules\regolare, dominato
9839rumble\rumoreggiare 9839rumble\rumoreggiare
9840ruminative\pensieroso 9840ruminative\pensieroso
9841rumor\vociferare 9841rumor\vociferare
9842rumour\fama 9842rumour\fama
9843rump\torso 9843rump\torso
9844rumpus\sommossa 9844rumpus\sommossa
9845run\esercitare, circolare, affiuenza, fuga, correre 9845run\esercitare, circolare, affiuenza, fuga, correre
9846run away\scappare 9846run away\scappare
9847run over\travolto 9847run over\travolto
9848runaround\schivare 9848runaround\schivare
9849rundown\decorrere, spiegazione 9849rundown\decorrere, spiegazione
9850rung\suonato, gradino 9850rung\suonato, gradino
9851runner\corridore 9851runner\corridore
9852running\decollare, corro, corre 9852running\decollare, corro, corre
9853running start\abbrivo 9853running start\abbrivo
9854runt\nano 9854runt\nano
9855runts\nani 9855runts\nani
9856runty\minuscolo 9856runty\minuscolo
9857rupee\rupia 9857rupee\rupia
9858rupture\frantumare, frattura 9858rupture\frantumare, frattura
9859rupturing\lacerante 9859rupturing\lacerante
9860rural\villereccio 9860rural\villereccio
9861ruse\pizzicotto 9861ruse\pizzicotto
9862rush\affiuenza, furia, spingere, smaniare, pigiare 9862rush\affiuenza, furia, spingere, smaniare, pigiare
9863rush mat\stuoia 9863rush mat\stuoia
9864rush order\commissione urgente 9864rush order\commissione urgente
9865rusk\biscotto 9865rusk\biscotto
9866Russia\Russia 9866Russia\Russia
9867Russian\Russo 9867Russian\Russo
9868rust\arrugginire, griglia 9868rust\arrugginire, griglia
9869rusted\arrugginito, arrugginito 9869rusted\arrugginito, arrugginito
9870rustic\rurale, semplice, villereccio 9870rustic\rurale, semplice, villereccio
9871rustily\rugginoso 9871rustily\rugginoso
9872rusting\arrugginire 9872rusting\arrugginire
9873rustle\crepitìo, rubare 9873rustle\crepitìo, rubare
9874rustled\acciaio 9874rustled\acciaio
9875rustles\ruba 9875rustles\ruba
9876rustless\inossidabile 9876rustless\inossidabile
9877rustproof\inossidabile 9877rustproof\inossidabile
9878rusts\arrugginito 9878rusts\arrugginito
9879rusty\rugginoso 9879rusty\rugginoso
9880rutabaga\navone 9880rutabaga\navone
9881ruth\compassione 9881ruth\compassione
9882rye\segale 9882rye\segale
9883sabdwich\pane imburrato 9883sabdwich\pane imburrato
9884sable\zibellino 9884sable\zibellino
9885sables\zibellino 9885sables\zibellino
9886sabot\zoccolo 9886sabot\zoccolo
9887sabotage\sabotaggio, sabotare 9887sabotage\sabotaggio, sabotare
9888sabre\sciabola 9888sabre\sciabola
9889sac\sacchetto 9889sac\sacchetto
9890saccharated\zuccherino 9890saccharated\zuccherino
9891sack\licenziare, buttare fuori, sacco 9891sack\licenziare, buttare fuori, sacco
9892sackful\sacco 9892sackful\sacco
9893sackfuls\sacco, sacchi 9893sackfuls\sacco, sacchi
9894sacred\santo 9894sacred\santo
9895sacredly\santa 9895sacredly\santa
9896sacredness\santità 9896sacredness\santità
9897sacrifice\sacrificio, sacrificare 9897sacrifice\sacrificio, sacrificare
9898sacrilege\sacrilegio 9898sacrilege\sacrilegio
9899sacrileges\sacrilegio 9899sacrileges\sacrilegio
9900sacrilegious\scellerato 9900sacrilegious\scellerato
9901sacristan\sagrestano 9901sacristan\sagrestano
9902sacs\sacchetto 9902sacs\sacchetto
9903sad\afflitto, lugubre 9903sad\afflitto, lugubre
9904saddle\sella 9904saddle\sella
9905saddle fast\saldo in sella 9905saddle fast\saldo in sella
9906saddler\sellaio 9906saddler\sellaio
9907saddles\sella 9907saddles\sella
9908sadism\sadismo 9908sadism\sadismo
9909sadly\lugubre 9909sadly\lugubre
9910sadness\tristezza 9910sadness\tristezza
9911safe\sicuramente 9911safe\sicuramente
9912safe keeping\preservamento 9912safe keeping\preservamento
9913safeguard\valvola 9913safeguard\valvola
9914safeguarded\assicurai 9914safeguarded\assicurai
9915safeguards\assicurato 9915safeguards\assicurato
9916safekeeping\preservamento 9916safekeeping\preservamento
9917safely\sicuramente 9917safely\sicuramente
9918safeness\fidatezza, sicurezza 9918safeness\fidatezza, sicurezza
9919safety\sicurezza 9919safety\sicurezza
9920safety belt\cintura di sicurezza 9920safety belt\cintura di sicurezza
9921safety lock\antifurto 9921safety lock\antifurto
9922saffron\zafferano 9922saffron\zafferano
9923sag\depressione 9923sag\depressione
9924sagacious\saggio 9924sagacious\saggio
9925sagaciously\furba 9925sagaciously\furba
9926sagaciousness\saggezza 9926sagaciousness\saggezza
9927sage\salvia 9927sage\salvia
9928sageness\saggezza 9928sageness\saggezza
9929sagittarius\tiratore 9929sagittarius\tiratore
9930sail\veleggiare 9930sail\veleggiare
9931sailer\veliero 9931sailer\veliero
9932sailing\veleggiare 9932sailing\veleggiare
9933sailing boat\barca a vela 9933sailing boat\barca a vela
9934sailing ship\nave a vela 9934sailing ship\nave a vela
9935sailor\navigatore, marinaio 9935sailor\navigatore, marinaio
9936sails\veleggiare, vela 9936sails\veleggiare, vela
9937saint\santa 9937saint\santa
9938sainthood\santuario 9938sainthood\santuario
9939saintliness\santità 9939saintliness\santità
9940saints\santificare 9940saints\santificare
9941salacious\lussurioso 9941salacious\lussurioso
9942salaciousness\voluttà 9942salaciousness\voluttà
9943salad\insalata 9943salad\insalata
9944salads\insalate 9944salads\insalate
9945salary\stipendio 9945salary\stipendio
9946sale\registro, véndita 9946sale\registro, véndita
9947saleable\esitabile 9947saleable\esitabile
9948sales clerk\venditore 9948sales clerk\venditore
9949sales price\prezzo di vendita 9949sales price\prezzo di vendita
9950sales terms\condizioni di vendita 9950sales terms\condizioni di vendita
9951salesgirl\venditrice 9951salesgirl\venditrice
9952salesman\venditore 9952salesman\venditore
9953saline\salina 9953saline\salina
9954saliva\saliva, raggio 9954saliva\saliva, raggio
9955salivary\glàndola salivale 9955salivary\glàndola salivale
9956salivary gland\glàndola salivale 9956salivary gland\glàndola salivale
9957sallow\pallido, pallido, scolorato 9957sallow\pallido, pallido, scolorato
9958sallowness\pallore 9958sallowness\pallore
9959salmon\salmone 9959salmon\salmone
9960salon\salotto, negozio da parrucchiere 9960salon\salotto, negozio da parrucchiere
9961saloon\bètvola 9961saloon\bètvola
9962salt\sale 9962salt\sale
9963salt water\acqua salsa 9963salt water\acqua salsa
9964saltily\salato 9964saltily\salato
9965saltpeter\nitro 9965saltpeter\nitro
9966salts\sali, salare 9966salts\sali, salare
9967saltwater\acqua salsa 9967saltwater\acqua salsa
9968salty\salato 9968salty\salato
9969salubriously\sana 9969salubriously\sana
9970salute\salutare 9970salute\salutare
9971salvages\salva 9971salvages\salva
9972salvation\salvataggio 9972salvation\salvataggio
9973salver\vassoio 9973salver\vassoio
9974salves\unguentare 9974salves\unguentare
9975same\pari 9975same\pari
9976sammy\pasta 9976sammy\pasta
9977sample\prova, esemplare 9977sample\prova, esemplare
9978sanatorium\casa di salute 9978sanatorium\casa di salute
9979sanctify\santificare 9979sanctify\santificare
9980sanctimonious\ipocrita 9980sanctimonious\ipocrita
9981sanctity\santità 9981sanctity\santità
9982sanctuary\santuario 9982sanctuary\santuario
9983sand\sabbia 9983sand\sabbia
9984sand bank\banco di sabbia 9984sand bank\banco di sabbia
9985sand glass\clessidra 9985sand glass\clessidra
9986sand paper\carta smeriglio 9986sand paper\carta smeriglio
9987sand pit\cava di sabbia 9987sand pit\cava di sabbia
9988sandal\sandalo 9988sandal\sandalo
9989sandpaper\carta vetrata 9989sandpaper\carta vetrata
9990sandstorm\tempesta di sabbia 9990sandstorm\tempesta di sabbia
9991sandy\arenoso 9991sandy\arenoso
9992sane\sano di mente 9992sane\sano di mente
9993sanguinary\crudele 9993sanguinary\crudele
9994sanguineous\insanguinato 9994sanguineous\insanguinato
9995sanitarium\luogo climatico 9995sanitarium\luogo climatico
9996sanitary\igiènico 9996sanitary\igiènico
9997sanitary towel\fascia assorbente 9997sanitary towel\fascia assorbente
9998sanitation\risanamento 9998sanitation\risanamento
9999sanity\ragione 9999sanity\ragione
10000sap\succo 10000sap\succo
10001saphire\zaffiro 10001saphire\zaffiro
10002sapience\saggezza 10002sapience\saggezza
10003sapless\scipito 10003sapless\scipito
10004sapphire\zaffiro 10004sapphire\zaffiro
10005sappy\succoso 10005sappy\succoso
10006sartorial\sarto 10006sartorial\sarto
10007sash\ciarpa 10007sash\ciarpa
10008sash window\finestra scorrevole 10008sash window\finestra scorrevole
10009sashayed\scivolai 10009sashayed\scivolai
10010sashays\scivolo 10010sashays\scivolo
10011sassed\inveii 10011sassed\inveii
10012sasses\inveisce 10012sasses\inveisce
10013sassiness\impertinenza 10013sassiness\impertinenza
10014sassy\insolente, sfacciato 10014sassy\insolente, sfacciato
10015sat\sedei 10015sat\sedei
10016sateen\raso 10016sateen\raso
10017satellite\satellite 10017satellite\satellite
10018satiable\saziante 10018satiable\saziante
10019satiably\saziante 10019satiably\saziante
10020satiate\saziare 10020satiate\saziare
10021satiated\saziato 10021satiated\saziato
10022satiating\saziante 10022satiating\saziante
10023satiation\satollamento 10023satiation\satollamento
10024satiety\sazietà 10024satiety\sazietà
10025satin\raso 10025satin\raso
10026satirize\canzonare 10026satirize\canzonare
10027satisfaction\contentezza, soddisfazione 10027satisfaction\contentezza, soddisfazione
10028satisfactory\soddisfacente 10028satisfactory\soddisfacente
10029satisfiable\soddisfacente 10029satisfiable\soddisfacente
10030satisfied\soddisfatto 10030satisfied\soddisfatto
10031satisfies\accontentato 10031satisfies\accontentato
10032satisfy\accontentare 10032satisfy\accontentare
10033sattelite\satellite 10033sattelite\satellite
10034saturate\saziare 10034saturate\saziare
10035saturating\saziante 10035saturating\saziante
10036saturation\satollamento 10036saturation\satollamento
10037Saturday\sabato 10037Saturday\sabato
10038saturday\sabato 10038saturday\sabato
10039saturnine\fosco 10039saturnine\fosco
10040sauce\guazzetto 10040sauce\guazzetto
10041saucepan\pentola 10041saucepan\pentola
10042saucer\sottocoppa 10042saucer\sottocoppa
10043saucer eyed\occhioni 10043saucer eyed\occhioni
10044saucily\insolente 10044saucily\insolente
10045sauciness\esosità 10045sauciness\esosità
10046saucy\sfacciato, gioielli, saccente 10046saucy\sfacciato, gioielli, saccente
10047sauna\sauna 10047sauna\sauna
10048saunter\gironzolare 10048saunter\gironzolare
10049sausage\salsiccia, salsiccia arrosto 10049sausage\salsiccia, salsiccia arrosto
10050sausages\salsicce 10050sausages\salsicce
10051savable\durevole 10051savable\durevole
10052savage\crudele 10052savage\crudele
10053savannah\savana 10053savannah\savana
10054save\salvare, assicurare, serbare, risparmiare 10054save\salvare, assicurare, serbare, risparmiare
10055saved\sicuro 10055saved\sicuro
10056saver\risparmiatore 10056saver\risparmiatore
10057savers\risparmiatore 10057savers\risparmiatore
10058saving\immagazzinare 10058saving\immagazzinare
10059savings\libretto di risparmio, risparmio 10059savings\libretto di risparmio, risparmio
10060savings account\conto di risparmio 10060savings account\conto di risparmio
10061savings bank\cassa di risparmio 10061savings bank\cassa di risparmio
10062savior\Redentore 10062savior\Redentore
10063savor\degnare, gustare, usufruire 10063savor\degnare, gustare, usufruire
10064savored\godei 10064savored\godei
10065savors\godi 10065savors\godi
10066savour\costare, usufruire 10066savour\costare, usufruire
10067savoy\verza 10067savoy\verza
10068savvied\giudizio 10068savvied\giudizio
10069savvier\più furbo 10069savvier\più furbo
10070savvies\comprende 10070savvies\comprende
10071saw\segare, sega 10071saw\segare, sega
10072sawed\segato 10072sawed\segato
10073sawn\segato 10073sawn\segato
10074saws\segare 10074saws\segare
10075sax\sassofono 10075sax\sassofono
10076saxon\sassone 10076saxon\sassone
10077saxophone\sassofono 10077saxophone\sassofono
10078say goodbye\promulgare, licenziarsi 10078say goodbye\promulgare, licenziarsi
10079say thank you\ringraziare 10079say thank you\ringraziare
10080sayings\detti 10080sayings\detti
10081scabies\scabbia 10081scabies\scabbia
10082scabiesious\rognoso 10082scabiesious\rognoso
10083scaffold\patibolo 10083scaffold\patibolo
10084scaffolding\intelaiatura, base 10084scaffolding\intelaiatura, base
10085scale\criterio, squama, piatto della bilancia 10085scale\criterio, squama, piatto della bilancia
10086scales\hangar 10086scales\hangar
10087scandal\scandalo 10087scandal\scandalo
10088scans\esamina 10088scans\esamina
10089scant\scarso 10089scant\scarso
10090scantily\scarso 10090scantily\scarso
10091scantiness\spilorceria 10091scantiness\spilorceria
10092scantness\strettezza 10092scantness\strettezza
10093scanty\scarso, scarso 10093scanty\scarso, scarso
10094scapegoat\espiatorio 10094scapegoat\espiatorio
10095scapula\scapola 10095scapula\scapola
10096scapular\spalla 10096scapular\spalla
10097scar\strato erboso 10097scar\strato erboso
10098scarce\raro, scarso, raro 10098scarce\raro, scarso, raro
10099scarce goods\scarseggiante 10099scarce goods\scarseggiante
10100scarcely\paggio, appena 10100scarcely\paggio, appena
10101scarcity\strettezza 10101scarcity\strettezza
10102scare\spaventi 10102scare\spaventi
10103scarf\scialle, fazzoletto da collo 10103scarf\scialle, fazzoletto da collo
10104scarify\scalfire 10104scarify\scalfire
10105scariness\spavento 10105scariness\spavento
10106scarlet\scarlattina 10106scarlet\scarlattina
10107scarped\dirupato 10107scarped\dirupato
10108scary\angoscioso 10108scary\angoscioso
10109scathe\affronto 10109scathe\affronto
10110scathing\offensivo 10110scathing\offensivo
10111scavenging\lustrale 10111scavenging\lustrale
10112sceened\riparato 10112sceened\riparato
10113scenario\copione 10113scenario\copione
10114scene\scena, scena, tribuna, svolgimento 10114scene\scena, scena, tribuna, svolgimento
10115scenery\ornamento 10115scenery\ornamento
10116scenic\del paesaggio 10116scenic\del paesaggio
10117scent\sostanza odorosa, odore 10117scent\sostanza odorosa, odore
10118scented\subdorato 10118scented\subdorato
10119scepticism\scetticismo 10119scepticism\scetticismo
10120scewed\avvitato 10120scewed\avvitato
10121schedele\ordito 10121schedele\ordito
10122schedule\tabella, registro 10122schedule\tabella, registro
10123schema\schema 10123schema\schema
10124schematic\schematico 10124schematic\schematico
10125schematically\schematico 10125schematically\schematico
10126scheme\disegno, schema 10126scheme\disegno, schema
10127schist\ardesia 10127schist\ardesia
10128schists\ardesia 10128schists\ardesia
10129schlep\trascinare 10129schlep\trascinare
10130schnapps\acquavite 10130schnapps\acquavite
10131schnooks\idioti 10131schnooks\idioti
10132scholarliness\erudizione 10132scholarliness\erudizione
10133scholarly\erudito 10133scholarly\erudito
10134scholarship\erudizione, borsa di studio 10134scholarship\erudizione, borsa di studio
10135school\scuola 10135school\scuola
10136school day friend\amico della gioventù 10136school day friend\amico della gioventù
10137school leaving examination\maturità classica 10137school leaving examination\maturità classica
10138school year\anno scolastico 10138school year\anno scolastico
10139schoolhouses\istruire 10139schoolhouses\istruire
10140schooling\istruzione 10140schooling\istruzione
10141schoolmate\amico scolastico 10141schoolmate\amico scolastico
10142schools\istruire 10142schools\istruire
10143sciatic\sciatica 10143sciatic\sciatica
10144sciatica\sciatica 10144sciatica\sciatica
10145science\scienza 10145science\scienza
10146scientific\scientifico 10146scientific\scientifico
10147scientifical\scientifico 10147scientifical\scientifico
10148scientist\scienziato 10148scientist\scienziato
10149scintillate\fiammeggiare 10149scintillate\fiammeggiare
10150scintillating\lampante 10150scintillating\lampante
10151scission\fenditura 10151scission\fenditura
10152scissors\forbice 10152scissors\forbice
10153scoff\scherno 10153scoff\scherno
10154scoffer\beffatore 10154scoffer\beffatore
10155scold\inveire, sgridare 10155scold\inveire, sgridare
10156scoop\mestola, attìngere 10156scoop\mestola, attìngere
10157scoopful\badile 10157scoopful\badile
10158scoot\mozzare 10158scoot\mozzare
10159scooter\motoretta 10159scooter\motoretta
10160scope\orbita, portata 10160scope\orbita, portata
10161scopes\zone 10161scopes\zone
10162scorch\bruciare 10162scorch\bruciare
10163scorched\arsi 10163scorched\arsi
10164scorcher\senzazione 10164scorcher\senzazione
10165scorches\arde 10165scorches\arde
10166scorching\cocente 10166scorching\cocente
10167score\sparare, partitura 10167score\sparare, partitura
10168scorers\proteggere 10168scorers\proteggere
10169scorn\disprezzare, vilipendi, scherno 10169scorn\disprezzare, vilipendi, scherno
10170scornful\beffardo, sprezzante 10170scornful\beffardo, sprezzante
10171scornfulness\vilipendi 10171scornfulness\vilipendi
10172scorns\disprezzato 10172scorns\disprezzato
10173scorpion\scorpione 10173scorpion\scorpione
10174scorpios\scorpioni 10174scorpios\scorpioni
10175Scot\Scozzese 10175Scot\Scozzese
10176scot\paratia 10176scot\paratia
10177Scotland\Scozia 10177Scotland\Scozia
10178Scotsman\Scozzese 10178Scotsman\Scozzese
10179scoundrel\furfante, mascalzone 10179scoundrel\furfante, mascalzone
10180scour\vagare 10180scour\vagare
10181scourge\frustare 10181scourge\frustare
10182scouring\vagabondo 10182scouring\vagabondo
10183scout\ricognitore 10183scout\ricognitore
10184scoutmaster\guida 10184scoutmaster\guida
10185scow\più leggero 10185scow\più leggero
10186scrabble\strisciare 10186scrabble\strisciare
10187scragg\scheletro 10187scragg\scheletro
10188scram\mozzare 10188scram\mozzare
10189scrambled\uovo strapazzato 10189scrambled\uovo strapazzato
10190scrambling\rampicante 10190scrambling\rampicante
10191scrap\ferraglia 10191scrap\ferraglia
10192scrape\raschiare, graffiare 10192scrape\raschiare, graffiare
10193scrape off\grattare 10193scrape off\grattare
10194scraper\scarafaggio 10194scraper\scarafaggio
10195scrapers\raschiare 10195scrapers\raschiare
10196scratch\graffio, verniciare, graffiare, scalfire 10196scratch\graffio, verniciare, graffiare, scalfire
10197scratch oneself\graffiare 10197scratch oneself\graffiare
10198scratched\grattato 10198scratched\grattato
10199scrawniest\piccolissimo 10199scrawniest\piccolissimo
10200scrawny\snello 10200scrawny\snello
10201scream\gridare 10201scream\gridare
10202screamed\gridai 10202screamed\gridai
10203screaming\urlante 10203screaming\urlante
10204screams\grida 10204screams\grida
10205scree\pietrisco 10205scree\pietrisco
10206screech\stridere 10206screech\stridere
10207screeching\stridente 10207screeching\stridente
10208screen\schermo, reticolo, schermo 10208screen\schermo, reticolo, schermo
10209screened\riparato 10209screened\riparato
10210screenplay\copione 10210screenplay\copione
10211screw driver\cacciavite 10211screw driver\cacciavite
10212screwball\mattoide 10212screwball\mattoide
10213screwdriver\cacciavite 10213screwdriver\cacciavite
10214screwiness\pazzia 10214screwiness\pazzia
10215screws\avvitato 10215screws\avvitato
10216screwy\pazzo 10216screwy\pazzo
10217scribal error\errore ortografico 10217scribal error\errore ortografico
10218scribe\scalfire 10218scribe\scalfire
10219scribed\scrivei 10219scribed\scrivei
10220scribing\scalfire 10220scribing\scalfire
10221script\copione 10221script\copione
10222scripture\documento 10222scripture\documento
10223scroll\sfogliare 10223scroll\sfogliare
10224scrolls\spostare 10224scrolls\spostare
10225scrounge\scroccare 10225scrounge\scroccare
10226scroungers\ladri 10226scroungers\ladri
10227scrub\strofinare, strofinare 10227scrub\strofinare, strofinare
10228scrubbed\strofinato 10228scrubbed\strofinato
10229scrubber\spazzola 10229scrubber\spazzola
10230scruff\sporco 10230scruff\sporco
10231scruffiness\sudiciume 10231scruffiness\sudiciume
10232scruple\scupolo 10232scruple\scupolo
10233scruples\scupolo 10233scruples\scupolo
10234scrupulous\diffidgnte 10234scrupulous\diffidgnte
10235scruter\esplorare 10235scruter\esplorare
10236scrutinize\assaggiare 10236scrutinize\assaggiare
10237scrutinized\esaminai 10237scrutinized\esaminai
10238scrutinizes\esamina 10238scrutinizes\esamina
10239scud\volare 10239scud\volare
10240scuff\logorio 10240scuff\logorio
10241scuffproof\indistruttibile 10241scuffproof\indistruttibile
10242sculler\vogatore 10242sculler\vogatore
10243scullers\vogatore 10243scullers\vogatore
10244sculpt\formare 10244sculpt\formare
10245sculpting\formante 10245sculpting\formante
10246sculptor\scultore 10246sculptor\scultore
10247sculptors\scultore 10247sculptors\scultore
10248scurf\crosta 10248scurf\crosta
10249scurvier\infame 10249scurvier\infame
10250scurvily\infame 10250scurvily\infame
10251scuttle\rovinare 10251scuttle\rovinare
10252se\ipotesi 10252se\ipotesi
10253sea\navale, mare 10253sea\navale, mare
10254seaboard\riviera 10254seaboard\riviera
10255seacoasts\littoraneo 10255seacoasts\littoraneo
10256seafarer\navigatore 10256seafarer\navigatore
10257seagull\gabbiano 10257seagull\gabbiano
10258seal\siggillare, sigillo, foca, guarnizione 10258seal\siggillare, sigillo, foca, guarnizione
10259sealing gasket\guarnizione 10259sealing gasket\guarnizione
10260seals\strisciare, foche 10260seals\strisciare, foche
10261seam\vivagno, scanalatura 10261seam\vivagno, scanalatura
10262seaman\marinaio 10262seaman\marinaio
10263seamen\marinai 10263seamen\marinai
10264seamstress\cucitrice 10264seamstress\cucitrice
10265sear\abbronzare 10265sear\abbronzare
10266search\cerco, indagare 10266search\cerco, indagare
10267searcher\cercatore 10267searcher\cercatore
10268searches\mania 10268searches\mania
10269searchingly\verdastro 10269searchingly\verdastro
10270sears\arsiccio 10270sears\arsiccio
10271seas\mari 10271seas\mari
10272seashell\coccia 10272seashell\coccia
10273seasick\malato di mare 10273seasick\malato di mare
10274seaside\riviera, costa 10274seaside\riviera, costa
10275seaside resort\stazione balneare, località balneare 10275seaside resort\stazione balneare, località balneare
10276season\stagione, stagione, aromatizzare 10276season\stagione, stagione, aromatizzare
10277seasonable\stagionale 10277seasonable\stagionale
10278seasonal surcharge\aumento stagionale 10278seasonal surcharge\aumento stagionale
10279seasoned\maturo 10279seasoned\maturo
10280seasoning\condimento 10280seasoning\condimento
10281seasonings\aromatizzare 10281seasonings\aromatizzare
10282seat\seggio 10282seat\seggio
10283seaweed\alga 10283seaweed\alga
10284second\secondo 10284second\secondo
10285secondary\accidentale, secondario 10285secondary\accidentale, secondario
10286secret\riservato, segreto, segreto 10286secret\riservato, segreto, segreto
10287secretariat\segretariato 10287secretariat\segretariato
10288secretary\segretaria, segretario 10288secretary\segretaria, segretario
10289secretion\eliminazione 10289secretion\eliminazione
10290secrets\segreti 10290secrets\segreti
10291sect\setta 10291sect\setta
10292section\taglio 10292section\taglio
10293sector\settore, area 10293sector\settore, area
10294security\sicurezza 10294security\sicurezza
10295seduce\sedurre 10295seduce\sedurre
10296seduction\seduzione 10296seduction\seduzione
10297seductress\seduttrice 10297seductress\seduttrice
10298sedulous\assiduo 10298sedulous\assiduo
10299see\vedere, visitare 10299see\vedere, visitare
10300seed\germe, seme, seme 10300seed\germe, seme, seme
10301seek\cercare, cerco 10301seek\cercare, cerco
10302seer\profeta 10302seer\profeta
10303seize\confiscare, prendere, impaccare, acchiappare 10303seize\confiscare, prendere, impaccare, acchiappare
10304seldom\raramente 10304seldom\raramente
10305select\selezionare 10305select\selezionare
10306selection\selezione, eletta 10306selection\selezione, eletta
10307self acting\automàtico 10307self acting\automàtico
10308self confidence\fiducia in sê 10308self confidence\fiducia in sê
10309sell out\esaurire 10309sell out\esaurire
10310semi\mezzo 10310semi\mezzo
10311semi automatical\semiautomatico 10311semi automatical\semiautomatico
10312semicolon\punto e virgola 10312semicolon\punto e virgola
10313senate\senato, consiglio federale 10313senate\senato, consiglio federale
10314send\mando, mandare 10314send\mando, mandare
10315sender\mittente 10315sender\mittente
10316senior\superiore 10316senior\superiore
10317sensation\sensazione 10317sensation\sensazione
10318sense\levatura, accezione 10318sense\levatura, accezione
10319senselessly\senza senso 10319senselessly\senza senso
10320senses\giudizio 10320senses\giudizio
10321sensible\ragionevole, ragionevole 10321sensible\ragionevole, ragionevole
10322sensitive\sensibile, sensibile 10322sensitive\sensibile, sensibile
10323sensitivity\sensibilità 10323sensitivity\sensibilità
10324sensual\sensuale 10324sensual\sensuale
10325sensuality\sensualità 10325sensuality\sensualità
10326sensuously\libidine 10326sensuously\libidine
10327sentence\punizione, condannare, frase 10327sentence\punizione, condannare, frase
10328sentiments\emozioni 10328sentiments\emozioni
10329sentinels\custodito 10329sentinels\custodito
10330separate\separato, separato, separare 10330separate\separato, separato, separare
10331separating\singola 10331separating\singola
10332September\settembre 10332September\settembre
10333sequence\successione 10333sequence\successione
10334serendipity\scoperta 10334serendipity\scoperta
10335serene\sereno 10335serene\sereno
10336serenity\ilarità 10336serenity\ilarità
10337serializing\ordinatore 10337serializing\ordinatore
10338serials\in fila 10338serials\in fila
10339series\seria 10339series\seria
10340series of reactions\reazione a catena 10340series of reactions\reazione a catena
10341serious\pesante, serio, grave 10341serious\pesante, serio, grave
10342seriously\serio, serio 10342seriously\serio, serio
10343serpent\serpente 10343serpent\serpente
10344serpentine\contorto 10344serpentine\contorto
10345servant\domèstica, famulo 10345servant\domèstica, famulo
10346serve\servire, servire, servire 10346serve\servire, servire, servire
10347service\attèndere, servizio, funzione, manutenzione 10347service\attèndere, servizio, funzione, manutenzione
10348service station\distributore di benzina 10348service station\distributore di benzina
10349serviceman\soldato 10349serviceman\soldato
10350serving\porzione 10350serving\porzione
10351session\seduta 10351session\seduta
10352set\assortimento, stabilito, mettere, apparecchio 10352set\assortimento, stabilito, mettere, apparecchio
10353set up\allineare, sè, fondare 10353set up\allineare, sè, fondare
10354setting\naufragio, missione 10354setting\naufragio, missione
10355setting up\succursale 10355setting up\succursale
10356settle\fissare, liquidare 10356settle\fissare, liquidare
10357settlement\accordo 10357settlement\accordo
10358seven\sette 10358seven\sette
10359seventeen\diciassette, diciasette 10359seventeen\diciassette, diciasette
10360seventieth\settantesimo 10360seventieth\settantesimo
10361seventy\settanta 10361seventy\settanta
10362several\alquanti, parecchi 10362several\alquanti, parecchi
10363several times\talvolta 10363several times\talvolta
10364severe\severo 10364severe\severo
10365sew\cucire 10365sew\cucire
10366sewage\acqua di scarico 10366sewage\acqua di scarico
10367sewing\saldatura 10367sewing\saldatura
10368sex\sesso 10368sex\sesso
10369sexual\storico 10369sexual\storico
10370shack\capanna 10370shack\capanna
10371shade\ombra, tinta 10371shade\ombra, tinta
10372shadow\ombrosità, ombra 10372shadow\ombrosità, ombra
10373shadowy\incerto 10373shadowy\incerto
10374shake\scuotere 10374shake\scuotere
10375shale\sasso 10375shale\sasso
10376shall\dovere 10376shall\dovere
10377shallop\scialuppa 10377shallop\scialuppa
10378sham\simulare 10378sham\simulare
10379shame\pudore, disonore 10379shame\pudore, disonore
10380shape\formare, formare, forma 10380shape\formare, formare, forma
10381share\partecipazione, spartire, parte 10381share\partecipazione, spartire, parte
10382shareholder\azionista 10382shareholder\azionista
10383shark\pescecane 10383shark\pescecane
10384sharp\nitido, acuto, stridulo, elevato 10384sharp\nitido, acuto, stridulo, elevato
10385sharp witted\perspicace 10385sharp witted\perspicace
10386sharpen\acuire, trascinare 10386sharpen\acuire, trascinare
10387she\lei 10387she\lei
10388sheaf\covone 10388sheaf\covone
10389shears\forbice 10389shears\forbice
10390sheath\involucro 10390sheath\involucro
10391shed\granaio, hangar 10391shed\granaio, hangar
10392sheep\pecora 10392sheep\pecora
10393sheepherders\pecoraio 10393sheepherders\pecoraio
10394sheerly\solamente 10394sheerly\solamente
10395sheet\lenzuolo, falda, foglia 10395sheet\lenzuolo, falda, foglia
10396sheet metal\latta, lamiera 10396sheet metal\latta, lamiera
10397shelf\scaffale 10397shelf\scaffale
10398shell\conchiglia, proiettile 10398shell\conchiglia, proiettile
10399shelter\protezione, riparare, ricovero, riparo, rifugio 10399shelter\protezione, riparare, ricovero, riparo, rifugio
10400shepherd\pecoraio 10400shepherd\pecoraio
10401shift\muovere 10401shift\muovere
10402shifting\trasferimento 10402shifting\trasferimento
10403shine\splendere, brillare 10403shine\splendere, brillare
10404shiners\far lume 10404shiners\far lume
10405shining\brillante, fulgente 10405shining\brillante, fulgente
10406ship\vascello, spedire, trasportare 10406ship\vascello, spedire, trasportare
10407shipboy\mozzo 10407shipboy\mozzo
10408shipes\navi 10408shipes\navi
10409shipment\spedizione 10409shipment\spedizione
10410shirt\camicia 10410shirt\camicia
10411shit\merda 10411shit\merda
10412shiver\aver dei brividi 10412shiver\aver dei brividi
10413shock\scandalizzare, crollo 10413shock\scandalizzare, crollo
10414shock absorber\ammortizzatore 10414shock absorber\ammortizzatore
10415shoe\scarpa 10415shoe\scarpa
10416shoot\sparare 10416shoot\sparare
10417shooting\sparare 10417shooting\sparare
10418shop\impresa 10418shop\impresa
10419shop-window\vetrina 10419shop-window\vetrina
10420shop assistant\venditore 10420shop assistant\venditore
10421shop operation\fase di lavorazione 10421shop operation\fase di lavorazione
10422shopping\comperare, compera 10422shopping\comperare, compera
10423shopping street\via dei negozi 10423shopping street\via dei negozi
10424shore\sponda, costa 10424shore\sponda, costa
10425short\breve 10425short\breve
10426short-sighted\miope 10426short-sighted\miope
10427short-term\sollecito 10427short-term\sollecito
10428short circuit\corto circuito 10428short circuit\corto circuito
10429shortage\strettezza, difetto 10429shortage\strettezza, difetto
10430shorten\abbreviare 10430shorten\abbreviare
10431shortfall\deficit 10431shortfall\deficit
10432shortly\prossimamente 10432shortly\prossimamente
10433shot\sparo 10433shot\sparo
10434shoulder\spalla 10434shoulder\spalla
10435shout\esclamare, gridare, grido 10435shout\esclamare, gridare, grido
10436shovel\vanga, badile 10436shovel\vanga, badile
10437show\indicare, espongo, messa 10437show\indicare, espongo, messa
10438shower\doccia, rovescio 10438shower\doccia, rovescio
10439shrill\elevato, stridulo 10439shrill\elevato, stridulo
10440shrimp\granchiolino 10440shrimp\granchiolino
10441shrink\restringere 10441shrink\restringere
10442shrub\arbusto 10442shrub\arbusto
10443shut\chiudere 10443shut\chiudere
10444shutout\esclusivo 10444shutout\esclusivo
10445shutter\imposta 10445shutter\imposta
10446shy\timido, timido 10446shy\timido, timido
10447sick\egro, malato 10447sick\egro, malato
10448sick person\malata 10448sick person\malata
10449sickle\falce 10449sickle\falce
10450sickness\malattia 10450sickness\malattia
10451side\lato 10451side\lato
10452sideboard\armadio 10452sideboard\armadio
10453sides\laterale 10453sides\laterale
10454sideshow\questione secondaria 10454sideshow\questione secondaria
10455sidewards\a lato 10455sidewards\a lato
10456siege\assedio 10456siege\assedio
10457sieve\cola 10457sieve\cola
10458sieved\settimo 10458sieved\settimo
10459sifter\cola 10459sifter\cola
10460sigh\sospirare 10460sigh\sospirare
10461sight\cosa notevole, aspetto 10461sight\cosa notevole, aspetto
10462sightless\cieco 10462sightless\cieco
10463sightlessly\cieca 10463sightlessly\cieca
10464sightliness\cospicuità 10464sightliness\cospicuità
10465sightseeing\curioso, ispezione 10465sightseeing\curioso, ispezione
10466sightseer\escursionista 10466sightseer\escursionista
10467sign\affisso, scudo, firmare, simbolo 10467sign\affisso, scudo, firmare, simbolo
10468sign over\volturare, volturare 10468sign over\volturare, volturare
10469signal\segnale 10469signal\segnale
10470signaling\denunciante 10470signaling\denunciante
10471signalize\segnalare 10471signalize\segnalare
10472signatories\firmatario 10472signatories\firmatario
10473signature\firma 10473signature\firma
10474signed\marcato 10474signed\marcato
10475signer\firmatario 10475signer\firmatario
10476signets\sigillo 10476signets\sigillo
10477significant\importante 10477significant\importante
10478signification\accezione, levatura 10478signification\accezione, levatura
10479signify\volere dire 10479signify\volere dire
10480signifying\importante 10480signifying\importante
10481signor\signore 10481signor\signore
10482signora\signora 10482signora\signora
10483signoras\donne 10483signoras\donne
10484signorina\signorina 10484signorina\signorina
10485signors\signori 10485signors\signori
10486signpost\segnavia, scudo 10486signpost\segnavia, scudo
10487signposts\insegne 10487signposts\insegne
10488signs\simbolo 10488signs\simbolo
10489signs and symbols\leggenda 10489signs and symbols\leggenda
10490silence\calma, tacere, ristoro 10490silence\calma, tacere, ristoro
10491silencer\silenziatore 10491silencer\silenziatore
10492silences\tace 10492silences\tace
10493silent\sommesso, muto, calma, equilibrato, calmo 10493silent\sommesso, muto, calma, equilibrato, calmo
10494silently\calmo 10494silently\calmo
10495silentness\calma 10495silentness\calma
10496silicic\ciottolo 10496silicic\ciottolo
10497silk\seta 10497silk\seta
10498silkily\serico 10498silkily\serico
10499silkiness\dolcezza 10499silkiness\dolcezza
10500silks\di seta 10500silks\di seta
10501silkworm\baco da seta 10501silkworm\baco da seta
10502sill\soglia 10502sill\soglia
10503silliness\ocaggine 10503silliness\ocaggine
10504silly\stolto, sciocco 10504silly\stolto, sciocco
10505silt\insabbiare 10505silt\insabbiare
10506silver\argènteo, argento 10506silver\argènteo, argento
10507similar\pari, consimile, simile 10507similar\pari, consimile, simile
10508similarity\omogeneità 10508similarity\omogeneità
10509similarly\simile 10509similarly\simile
10510simile\paragone 10510simile\paragone
10511similitude\assomiglianza 10511similitude\assomiglianza
10512simmer\bollore 10512simmer\bollore
10513simpatico\simpatico 10513simpatico\simpatico
10514simper\sciocco 10514simper\sciocco
10515simple\semplice 10515simple\semplice
10516simple minded\ingenuo 10516simple minded\ingenuo
10517simpleminded\semplice 10517simpleminded\semplice
10518simplemindedness\semplicità 10518simplemindedness\semplicità
10519simpleness\semplicità 10519simpleness\semplicità
10520simpletons\pennellare 10520simpletons\pennellare
10521simplicity\semplicità 10521simplicity\semplicità
10522simplification\semplificazione 10522simplification\semplificazione
10523simplify\semplificare 10523simplify\semplificare
10524simply\semplice 10524simply\semplice
10525simular\simile 10525simular\simile
10526simulate\simulare, simulare 10526simulate\simulare, simulare
10527simulated\artefatto 10527simulated\artefatto
10528simultaneous\simultaneo 10528simultaneous\simultaneo
10529simultaneously\simultaneo 10529simultaneously\simultaneo
10530sin\peccato 10530sin\peccato
10531since\da, da allora, perchè 10531since\da, da allora, perchè
10532since then\da allora 10532since then\da allora
10533sincere\sincero 10533sincere\sincero
10534sincerely\umilissimo, sincera 10534sincerely\umilissimo, sincera
10535sinful\peccaminoso 10535sinful\peccaminoso
10536sing\cantare 10536sing\cantare
10537singable\cantàbile 10537singable\cantàbile
10538singer\cantante 10538singer\cantante
10539singing\canto 10539singing\canto
10540singings\canti 10540singings\canti
10541single\nubile, singolo 10541single\nubile, singolo
10542single lane\a senso unico 10542single lane\a senso unico
10543single phase\monofase 10543single phase\monofase
10544single room\càmera sìngola 10544single room\càmera sìngola
10545single ticket\biglietto sémplice 10545single ticket\biglietto sémplice
10546singled\divorziato 10546singled\divorziato
10547singly\singolo 10547singly\singolo
10548sings\canta 10548sings\canta
10549singular\singolare 10549singular\singolare
10550singularness\stranezza 10550singularness\stranezza
10551sinister\nefasto 10551sinister\nefasto
10552sink\abbassarsi, catinella, abbassarsi, lavello 10552sink\abbassarsi, catinella, abbassarsi, lavello
10553sinking\affondamento 10553sinking\affondamento
10554sinks\abbassa 10554sinks\abbassa
10555sinned\peccato 10555sinned\peccato
10556sinner\peccatore 10556sinner\peccatore
10557sins\peccati 10557sins\peccati
10558sinuous\contorto 10558sinuous\contorto
10559sip\sorso 10559sip\sorso
10560sir\signore 10560sir\signore
10561sire\testimoniare 10561sire\testimoniare
10562sirloin\lonza 10562sirloin\lonza
10563sissy\effeminato 10563sissy\effeminato
10564sister\sorella 10564sister\sorella
10565sister in law\cognata 10565sister in law\cognata
10566sit\star seduto 10566sit\star seduto
10567sit down\accomodarsi 10567sit down\accomodarsi
10568site\posto, circostanza 10568site\posto, circostanza
10569site of crime\luogo del fatto 10569site of crime\luogo del fatto
10570sits\siede 10570sits\siede
10571sitting\seduto 10571sitting\seduto
10572sitting room\salotto 10572sitting room\salotto
10573situate\allineare, mettere, mettere 10573situate\allineare, mettere, mettere
10574situated\posto 10574situated\posto
10575situation\situazione, posizione, circostanza 10575situation\situazione, posizione, circostanza
10576six\sei 10576six\sei
10577sixfold\sestuplo 10577sixfold\sestuplo
10578sixteen\sedici 10578sixteen\sedici
10579sixteenth\sedicesimo, sedicesima 10579sixteenth\sedicesimo, sedicesima
10580sixth\sesto, sesta 10580sixth\sesto, sesta
10581sixty\sessanta 10581sixty\sessanta
10582size\grossezza 10582size\grossezza
10583size of shoe\numero di scarpa 10583size of shoe\numero di scarpa
10584sizzle\grillare 10584sizzle\grillare
10585skating\pattinaggio artistico 10585skating\pattinaggio artistico
10586skating ring\pista di ghiaccio 10586skating ring\pista di ghiaccio
10587skating rink\pista di ghiaccio 10587skating rink\pista di ghiaccio
10588skein\capestro 10588skein\capestro
10589skeins\capestri 10589skeins\capestri
10590skeleton\scheletro 10590skeleton\scheletro
10591skeletons\scheletri 10591skeletons\scheletri
10592skepticalness\scetticismo 10592skepticalness\scetticismo
10593skepticism\scetticismo 10593skepticism\scetticismo
10594sketch\abbozzo, abbozzare 10594sketch\abbozzo, abbozzare
10595sketchily\volatile, abbozzaticcio, superficiale 10595sketchily\volatile, abbozzaticcio, superficiale
10596sketchiness\poca chiarezza 10596sketchiness\poca chiarezza
10597sketchy\torbido 10597sketchy\torbido
10598skews\storto 10598skews\storto
10599ski\sci 10599ski\sci
10600skid\discesa a valle, avventare 10600skid\discesa a valle, avventare
10601skiful\esperto 10601skiful\esperto
10602skilful\apprèndere, azzeccato 10602skilful\apprèndere, azzeccato
10603skilfull\apprèndere
10604skill\sorte, disinvoltura 10603skill\sorte, disinvoltura
10605skilled\versato 10604skilled\versato
10606skilled worker\operaio specializzato 10605skilled worker\operaio specializzato
10607skillet\tegame 10606skillet\tegame
10608skillful\lesto, sveglio, esperto 10607skillful\lesto, sveglio, esperto
10609skillfulness\disinvoltura 10608skillfulness\disinvoltura
10610skimp\lesinare 10609skimp\lesinare
10611skimpiest\piccolissimo 10610skimpiest\piccolissimo
10612skimpily\scarso 10611skimpily\scarso
10613skimpiness\strettezza 10612skimpiness\strettezza
10614skimpy\scarso 10613skimpy\scarso
10615skin\epidèrmide, epidermide 10614skin\epidèrmide, epidermide
10616skinny\scremato, magro, secco 10615skinny\scremato, magro, secco
10617skins\pelli, pelli 10616skins\pelli, pelli
10618skip\saltellare, lancio 10617skip\saltellare, lancio
10619skipper\marinaio 10618skipper\marinaio
10620skirt\gonna 10619skirt\gonna
10621skirting board\battiscopa 10620skirting board\battiscopa
10622skit\satira 10621skit\satira
10623skittle\birillo 10622skittle\birillo
10624skittle alley\gioco dei birilli 10623skittle alley\gioco dei birilli
10625skivvy\biancherìa ìntima 10624skivvy\biancherìa ìntima
10626skulker\lima sorda 10625skulker\lima sorda
10627skunk\puzzola 10626skunk\puzzola
10628sky\cielo 10627sky\cielo
10629skylark\lodola 10628skylark\lodola
10630skyrocket\razzo 10629skyrocket\razzo
10631skyscraper\grattacielo, grattacielo 10630skyscraper\grattacielo, grattacielo
10632skyscrapers\grattacielo 10631skyscrapers\grattacielo
10633slab\frantumare 10632slab\frantumare
10634slack\lasco, floscio 10633slack\lasco, floscio
10635slack joint\contatto lasco 10634slack joint\contatto lasco
10636slack period\ristagno 10635slack period\ristagno
10637slacken\rilassare, rilassare 10636slacken\rilassare, rilassare
10638slackens\rilassato 10637slackens\rilassato
10639slacker\scansafatiche 10638slacker\scansafatiche
10640slacks\pantaloni 10639slacks\pantaloni
10641slake\allattamento 10640slake\allattamento
10642slam\sbattere 10641slam\sbattere
10643slammed\sbattuto 10642slammed\sbattuto
10644slander\calunniare 10643slander\calunniare
10645slanderer\calunniatore 10644slanderer\calunniatore
10646slanderous\calunnioso 10645slanderous\calunnioso
10647slanderousness\calunnia 10646slanderousness\calunnia
10648slant\declinazione 10647slant\declinazione
10649slanting\obliquo, obliquo 10648slanting\obliquo, obliquo
10650slantingly\obliqua 10649slantingly\obliqua
10651slap\picchiare, ceffone 10650slap\picchiare, ceffone
10652slap in the face\ceffone 10651slap in the face\ceffone
10653slaphappy\avventurato 10652slaphappy\avventurato
10654slaps in the face\schiaffeggiare 10653slaps in the face\schiaffeggiare
10655slash\taglio 10654slash\taglio
10656slat\picchiare 10655slat\picchiare
10657slate\ardesia, abusare 10656slate\ardesia, abusare
10658slatted\picchiai 10657slatted\picchiai
10659slattern\donnaccia 10658slattern\donnaccia
10660slaughter\macellare 10659slaughter\macellare
10661slaughter cattle\bestiame da macello 10660slaughter cattle\bestiame da macello
10662slaughter house\mattatoio 10661slaughter house\mattatoio
10663slaughtered\macellato 10662slaughtered\macellato
10664slaughterhouse\mattatoio 10663slaughterhouse\mattatoio
10665slave\schiava, schiavo 10664slave\schiava, schiavo
10666slave trader\negriere 10665slave trader\negriere
10667slavered\sbavato 10666slavered\sbavato
10668slavery\schiavitù 10667slavery\schiavitù
10669slay\uccidere 10668slay\uccidere
10670slayer\strangolatore, uccisore 10669slayer\strangolatore, uccisore
10671slays\uccide 10670slays\uccide
10672sleazily\sciatto 10671sleazily\sciatto
10673sleazy\untuoso 10672sleazy\untuoso
10674sleek\netto 10673sleek\netto
10675sleekly\liscia 10674sleekly\liscia
10676sleep\dormire, sonno, dormicchiare 10675sleep\dormire, sonno, dormicchiare
10677sleeper\vagone letto 10676sleeper\vagone letto
10678sleeping car\vagone letto 10677sleeping car\vagone letto
10679sleeping pill\sonnifero 10678sleeping pill\sonnifero
10680sleepless\insonne 10679sleepless\insonne
10681sleeplessness\insonnia 10680sleeplessness\insonnia
10682sleeps\dorme 10681sleeps\dorme
10683sleeve\manica 10682sleeve\manica
10684sleight\disinvoltura 10683sleight\disinvoltura
10685slender\esile, snello, snello 10684slender\esile, snello, snello
10686slice\tagliare, pezzo, fetta 10685slice\tagliare, pezzo, fetta
10687sliced\taglio 10686sliced\taglio
10688slicing\tagliente 10687slicing\tagliente
10689slick\brunire 10688slick\brunire
10690slicker\imbroglione 10689slicker\imbroglione
10691slickness\disinvoltura 10690slickness\disinvoltura
10692slide\spingere 10691slide\spingere
10693slides\spinge 10692slides\spinge
10694sliding roof\tetto scorrevole 10693sliding roof\tetto scorrevole
10695sliding window\finestra scorrevole 10694sliding window\finestra scorrevole
10696slight\magro, scarso, oltraggiare, labkle 10695slight\magro, scarso, oltraggiare, labkle
10697slightness\esiguità 10696slightness\esiguità
10698slim\togliere, snello 10697slim\togliere, snello
10699slime\muco 10698slime\muco
10700sling\avventare 10699sling\avventare
10701slingshot\fionda 10700slingshot\fionda
10702slingshots\avventare 10701slingshots\avventare
10703slink\strisciare 10702slink\strisciare
10704slinks\striscia 10703slinks\striscia
10705slip\scivolare, ordito, vizio 10704slip\scivolare, ordito, vizio
10706slip of paper\ordito 10705slip of paper\ordito
10707slipcover\involucro protettivo 10706slipcover\involucro protettivo
10708slipper\pantofola, ciabatta 10707slipper\pantofola, ciabatta
10709slippery\lubrico 10708slippery\lubrico
10710slippy\agile 10709slippy\agile
10711slipshod\sciatto 10710slipshod\sciatto
10712slipup\vizio 10711slipup\vizio
10713slithery\lubrico 10712slithery\lubrico
10714slits\fessure 10713slits\fessure
10715sliver\scheggiare 10714sliver\scheggiare
10716slob\donnaccia, balordo 10715slob\donnaccia, balordo
10717slobber\poltiglia 10716slobber\poltiglia
10718slobbery\sdolcinato 10717slobbery\sdolcinato
10719slogs\bastonato 10718slogs\bastonato
10720sloop\scialuppa 10719sloop\scialuppa
10721slope\discesa, pendio, pista 10720slope\discesa, pendio, pista
10722sloped\obliquo 10721sloped\obliquo
10723sloping\obliquo 10722sloping\obliquo
10724slopingly\obliquo 10723slopingly\obliquo
10725sloppiness\sciatteria 10724sloppiness\sciatteria
10726sloppy\sciatto 10725sloppy\sciatto
10727slosh\spruzzare 10726slosh\spruzzare
10728slot\fèndere 10727slot\fèndere
10729sloth\pigrizia 10728sloth\pigrizia
10730slothful\pigro 10729slothful\pigro
10731slothfulness\pigrizia 10730slothfulness\pigrizia
10732slouchily\strascicato 10731slouchily\strascicato
10733slouchy\strascicato 10732slouchy\strascicato
10734slow\fiacco, guardingo, lungo 10733slow\fiacco, guardingo, lungo
10735slow down\tardare, allentare 10734slow down\tardare, allentare
10736slow match\miccia 10735slow match\miccia
10737slow motion\rallentatore 10736slow motion\rallentatore
10738slow motion apparatur\rallentatore 10737slow motion apparatur\rallentatore
10739slow worm\orbettino 10738slow worm\orbettino
10740slowdown\allentare 10739slowdown\allentare
10741slower\più lento 10740slower\più lento
10742slowly\placido, lungo, lenta 10741slowly\placido, lungo, lenta
10743slowness\lentezza 10742slowness\lentezza
10744slue\voltare 10743slue\voltare
10745slug\picchiare, lumaca 10744slug\picchiare, lumaca
10746sluggard\pigro 10745sluggard\pigro
10747slugged\picchiai 10746slugged\picchiai
10748sluice\cateratta, emanare 10747sluice\cateratta, emanare
10749slum\catapecchia 10748slum\catapecchia
10750slumber\dormicchiare, sopore 10749slumber\dormicchiare, sopore
10751slumbered\pisolato 10750slumbered\pisolato
10752slumberous\assonnato 10751slumberous\assonnato
10753slumberously\assonnato 10752slumberously\assonnato
10754slump\crollo dei prezzi 10753slump\crollo dei prezzi
10755slunk\strisciato 10754slunk\strisciato
10756slur\calunniare 10755slur\calunniare
10757slush\neve bagnata 10756slush\neve bagnata
10758slut\donnaccia 10757slut\donnaccia
10759sluttish\sciatto 10758sluttish\sciatto
10760sly\furbo 10759sly\furbo
10761slyness\astuzia 10760slyness\astuzia
10762slynesses\astuzia 10761slynesses\astuzia
10763smack\schioccare un bacio 10762smack\schioccare un bacio
10764small\piccolo, minuscolo 10763small\piccolo, minuscolo
10765small blister\vescicola 10764small blister\vescicola
10766small bottle\flacone 10765small bottle\flacone
10767small box\cassettino 10766small box\cassettino
10768small car\vetturetta 10767small car\vetturetta
10769small crumb\briciola 10768small crumb\briciola
10770small house\casetta 10769small house\casetta
10771small intestine\intestino 10770small intestine\intestino
10772small letter\lettera minuscola 10771small letter\lettera minuscola
10773small parcel\pacchetto 10772small parcel\pacchetto
10774small piece\pezzettino 10773small piece\pezzettino
10775small ship\navicella 10774small ship\navicella
10776small wheel\rotellina 10775small wheel\rotellina
10777smallpox\vaioloso 10776smallpox\vaioloso
10778smart\furbo, stile 10777smart\furbo, stile
10779smartly\furbo 10778smartly\furbo
10780smartness\scaltrezza 10779smartness\scaltrezza
10781smash\schiacciare 10780smash\schiacciare
10782smashed\sfracellato 10781smashed\sfracellato
10783smashup\fallimento 10782smashup\fallimento
10784smear\ingrassare 10783smear\ingrassare
10785smeary\untuoso 10784smeary\untuoso
10786smell\profumo, odorato, odoro 10785smell\profumo, odorato, odoro
10787smelling\odorifero 10786smelling\odorifero
10788smells\profuma, odora 10787smells\profuma, odora
10789smelly\muffaticcio 10788smelly\muffaticcio
10790smelt\fusione 10789smelt\fusione
10791smelting\fondente 10790smelting\fondente
10792smile\sorridere 10791smile\sorridere
10793smile at\sorridere 10792smile at\sorridere
10794smirkingly\leccato 10793smirkingly\leccato
10795smith\fabbro 10794smith\fabbro
10796smithereens\brandello 10795smithereens\brandello
10797smithies\forgiare 10796smithies\forgiare
10798smithy\fucina 10797smithy\fucina
10799smock\camice 10798smock\camice
10800smoke\fumo, fumare 10799smoke\fumo, fumare
10801smoked\fumato, affumicato 10800smoked\fumato, affumicato
10802smoker\fumatore 10801smoker\fumatore
10803smokers\fumatore 10802smokers\fumatore
10804smokestack\fumaiuolo 10803smokestack\fumaiuolo
10805smokily\fumoso 10804smokily\fumoso
10806smoking\affumicare 10805smoking\affumicare
10807smooch\pomiciare 10806smooch\pomiciare
10808smooth\levigare, netto 10807smooth\levigare, netto
10809smoothed\lisciato 10808smoothed\lisciato
10810smoothly\equilibrato 10809smoothly\equilibrato
10811smother\affogare 10810smother\affogare
10812smudge\insudiciare 10811smudge\insudiciare
10813smudginess\lordura 10812smudginess\lordura
10814smudgy\untuoso 10813smudgy\untuoso
10815smuggle\contrabbandare 10814smuggle\contrabbandare
10816smuggled\contrabbandato 10815smuggled\contrabbandato
10817smuggler\contrabbandiere 10816smuggler\contrabbandiere
10818smuggling\contrabbando 10817smuggling\contrabbando
10819smutty\fangoso 10818smutty\fangoso
10820snack\spuntino 10819snack\spuntino
10821snag\nocchio 10820snag\nocchio
10822snaggy\nocchieruto 10821snaggy\nocchieruto
10823snail\chiocciola 10822snail\chiocciola
10824snake\serpente 10823snake\serpente
10825snake bite\morso di serpe 10824snake bite\morso di serpe
10826snake venom\veleno di serpente 10825snake venom\veleno di serpente
10827snaky\perfido 10826snaky\perfido
10828snap\dipinto, accertare, accettazione 10827snap\dipinto, accertare, accettazione
10829snapping\accertamento 10828snapping\accertamento
10830snappish\dentellato 10829snappish\dentellato
10831snaps\acchiappa 10830snaps\acchiappa
10832snare\accalappiare, tranello 10831snare\accalappiare, tranello
10833snared\acchiappai 10832snared\acchiappai
10834snares\acchiappa 10833snares\acchiappa
10835snarl\ringhiare 10834snarl\ringhiare
10836snarling\ringhiante 10835snarling\ringhiante
10837snatched up\accogliticcio 10836snatched up\accogliticcio
10838sneak\strisciare 10837sneak\strisciare
10839sneerer\beffatore 10838sneerer\beffatore
10840sneeze\starnutire 10839sneeze\starnutire
10841snicker\ridacchiare 10840snicker\ridacchiare
10842snickering\ridacchiante 10841snickering\ridacchiante
10843sniff\sbuffare 10842sniff\sbuffare
10844sniffy\sdegnoso, muffaticcio 10843sniffy\sdegnoso, muffaticcio
10845snigger\ridacchiare, ghigno 10844snigger\ridacchiare, ghigno
10846snipe\beccaccia 10845snipe\beccaccia
10847sniper\bersagliere 10846sniper\bersagliere
10848snivel\singhiozzare 10847snivel\singhiozzare
10849snobbish\borioso 10848snobbish\borioso
10850snooper\ficcanaso 10849snooper\ficcanaso
10851snoopy\curioso 10850snoopy\curioso
10852snoozing\sonnecchiante 10851snoozing\sonnecchiante
10853snore\russare 10852snore\russare
10854snort\sbuffare 10853snort\sbuffare
10855snot\moccio 10854snot\moccio
10856snottily\moccioso 10855snottily\moccioso
10857snottiness\vigliaccheria 10856snottiness\vigliaccheria
10858snotty\moccioso 10857snotty\moccioso
10859snout\ceffo 10858snout\ceffo
10860snow\nevicare, neve 10859snow\nevicare, neve
10861snow chains\catene da neve 10860snow chains\catene da neve
10862snow covered\nevoso 10861snow covered\nevoso
10863snow flake\fiocco di neve 10862snow flake\fiocco di neve
10864snow flurry\nevischio 10863snow flurry\nevischio
10865snow plough\spazzaneve 10864snow plough\spazzaneve
10866snow storm\tempesta di neve 10865snow storm\tempesta di neve
10867snow white\niveo 10866snow white\niveo
10868snowball\palla di neve 10867snowball\palla di neve
10869snowballing\accelerativo 10868snowballing\accelerativo
10870snowcap\colibri 10869snowcap\colibri
10871snowcapped\nevoso 10870snowcapped\nevoso
10872snowfall\nevata 10871snowfall\nevata
10873snowflake\fiocco di neve 10872snowflake\fiocco di neve
10874snowily\nevoso 10873snowily\nevoso
10875snowing\nevicare 10874snowing\nevicare
10876snowman\pupazzo di neve 10875snowman\pupazzo di neve
10877snowstorm\tempesta di neve 10876snowstorm\tempesta di neve
10878snowy\nevoso 10877snowy\nevoso
10879snuff\raffreddore 10878snuff\raffreddore
10880snuffler\ficcanaso 10879snuffler\ficcanaso
10881snuggle\accarezzare 10880snuggle\accarezzare
10882snugly\accogliente 10881snugly\accogliente
10883so\orbene, cosi, cosiffatto 10882so\orbene, cosi, cosiffatto
10884so far\finora 10883so far\finora
10885so long\arrivederci 10884so long\arrivederci
10886soak\ammollare 10885soak\ammollare
10887soaker\sbevazzatore 10886soaker\sbevazzatore
10888soap\sapone 10887soap\sapone
10889soap bubble\bolla di sapone 10888soap bubble\bolla di sapone
10890soaps\insaponare 10889soaps\insaponare
10891soapstone\lardite 10890soapstone\lardite
10892soar\esalare 10891soar\esalare
10893soaring\ascendente 10892soaring\ascendente
10894sob\singhiozzare 10893sob\singhiozzare
10895sober\digiuno 10894sober\digiuno
10896soberingly\realistico 10895soberingly\realistico
10897soberly\digiuno 10896soberly\digiuno
10898sobriquet\nomignolo 10897sobriquet\nomignolo
10899soccer\pallone 10898soccer\pallone
10900sociable\socievole 10899sociable\socievole
10901sociably\socievole 10900sociably\socievole
10902social\sociale, socievole 10901social\sociale, socievole
10903society\comitiva 10902society\comitiva
10904sock\picchiare, calzetta 10903sock\picchiare, calzetta
10905socked\picchiai 10904socked\picchiai
10906socket\legatura, presa di corrente 10905socket\legatura, presa di corrente
10907sofa\sofà 10906sofa\sofà
10908soft\placido, soffice, dolce 10907soft\placido, soffice, dolce
10909soft boiled\bazzotto 10908soft boiled\bazzotto
10910soft parts\parti molli 10909soft parts\parti molli
10911softies\imbecille 10910softies\imbecille
10912softly\soffice 10911softly\soffice
10913softness\flessibilità, dolcezza 10912softness\flessibilità, dolcezza
10914soggily\umido 10913soggily\umido
10915sogginess\umidità 10914sogginess\umidità
10916soggy\umido 10915soggy\umido
10917soigne\coltivare 10916soigne\coltivare
10918soil\terra, insudiciare, suolo 10917soil\terra, insudiciare, suolo
10919soils\insudiciato 10918soils\insudiciato
10920sojourner\ospite 10919sojourner\ospite
10921sojourners\ospiti 10920sojourners\ospiti
10922solace\consolare 10921solace\consolare
10923solaces\consola 10922solaces\consola
10924solar eclipse\eclissi solare 10923solar eclipse\eclissi solare
10925solar energy\energia solare 10924solar energy\energia solare
10926solar system\sistema solare 10925solar system\sistema solare
10927sold\vende 10926sold\vende
10928solder\ferruminare 10927solder\ferruminare
10929solder joint\saldatura 10928solder joint\saldatura
10930solderable\saldabile 10929solderable\saldabile
10931soldering iron\saldatoio 10930soldering iron\saldatoio
10932soldier\soldato 10931soldier\soldato
10933sole\solo, suola, sogliola 10932sole\solo, suola, sogliola
10934sole distributors\esclusività di spaccio 10933sole distributors\esclusività di spaccio
10935solemn\solenne 10934solemn\solenne
10936solemnity\solennità 10935solemnity\solennità
10937solemnness\solennità 10936solemnness\solennità
10938solenoid\bobina 10937solenoid\bobina
10939solicitor\legale 10938solicitor\legale
10940solid\compatto, fisso, solido, attendìbile 10939solid\compatto, fisso, solido, attendìbile
10941solidness\fermezza 10940solidness\fermezza
10942solitary\singolo, solo 10941solitary\singolo, solo
10943soloist\solista 10942soloist\solista
10944soluble\solubile 10943soluble\solubile
10945solution\dissoluzione 10944solution\dissoluzione
10946solve\sciogliere, chiarire 10945solve\sciogliere, chiarire
10947solvent\solvente 10946solvent\solvente
10948somber\fosco 10947somber\fosco
10949some\qualche, alquanti, qualcosa, parecchio 10948some\qualche, alquanti, qualcosa, parecchio
10950somebody\qualcheduno, alcuno 10949somebody\qualcheduno, alcuno
10951someplace\in qualche luogo 10950someplace\in qualche luogo
10952somersault\salto 10951somersault\salto
10953something\qualcosa, qualcosa 10952something\qualcosa, qualcosa
10954sometimes\talvolta 10953sometimes\talvolta
10955somewhere\in qualche luogo 10954somewhere\in qualche luogo
10956son\figlio, figliuolo 10955son\figlio, figliuolo
10957son-in-law\gènero 10956son-in-law\gènero
10958sonata\sonata 10957sonata\sonata
10959song\canzone 10958song\canzone
10960soon\prossimamente 10959soon\prossimamente
10961soothe\calmare 10960soothe\calmare
10962soothsayer\chiromante 10961soothsayer\chiromante
10963sophomore\allievo 10962sophomore\allievo
10964soprano\soprano 10963soprano\soprano
10965sorb\sorbo 10964sorb\sorbo
10966sore throat\angina 10965sore throat\angina
10967sorenesses\dolere 10966sorenesses\dolere
10968sorrow\pena, fastidio 10967sorrow\pena, fastidio
10969sorrowful\afflitto, disgraziato 10968sorrowful\afflitto, disgraziato
10970sorry\scusa, afflitto, purtroppo 10969sorry\scusa, afflitto, purtroppo
10971sort\fare, sorta, razza, assortire 10970sort\fare, sorta, razza, assortire
10972sortie\perdita 10971sortie\perdita
10973sorties\perdite 10972sorties\perdite
10974sot\sbevazzatore 10973sot\sbevazzatore
10975sound\sano, solido, suono, secondo, rumore, suono 10974sound\sano, solido, suono, secondo, rumore, suono
10976sound-proof\isolamento acustico 10975sound-proof\isolamento acustico
10977soup\minestra 10976soup\minestra
10978sour\acido 10977sour\acido
10979source\sorgente, origine, fonte 10978source\sorgente, origine, fonte
10980south\ostro, sud 10979south\ostro, sud
10981southwester\libeccio 10980southwester\libeccio
10982souvenir\ricordo 10981souvenir\ricordo
10983Soviet Union\unione Sovietica 10982Soviet Union\unione Sovietica
10984sow\seminare 10983sow\seminare
10985sown\seminato 10984sown\seminato
10986sox\calzetta 10985sox\calzetta
10987spa\località balneare 10986spa\località balneare
10988space\spazio, buca 10987space\spazio, buca
10989spaceship\veicolo spaziale 10988spaceship\veicolo spaziale
10990spacious\ampio 10989spacious\ampio
10991spade\vanga, badile 10990spade\vanga, badile
10992Spain\Spagna 10991Spain\Spagna
10993spangle\fronzoli 10992spangle\fronzoli
10994Spaniard\Spagnuolo 10993Spaniard\Spagnuolo
10995spare\tempo libero 10994spare\tempo libero
10996spare part\pezzo di ricambio 10995spare part\pezzo di ricambio
10997spark\trasmettere alla radio 10996spark\trasmettere alla radio
10998sparkle\sfavillare 10997sparkle\sfavillare
10999sparklers\diamanti 10998sparklers\diamanti
11000sparkling wine\spumante 10999sparkling wine\spumante
11001sparrow\passero, astore 11000sparrow\passero, astore
11002spasm\spasma 11001spasm\spasma
11003spatula\spatola 11002spatula\spatola
11004speak\discorrere, favellare 11003speak\discorrere, favellare
11005speak to\rivolgere la parola 11004speak to\rivolgere la parola
11006speaker\altoparlante 11005speaker\altoparlante
11007speaking\parla 11006speaking\parla
11008spear\lancia 11007spear\lancia
11009special field\ramo di competenza 11008special field\ramo di competenza
11010special language\linguaggio tecnico 11009special language\linguaggio tecnico
11011special offer\offerta speciale 11010special offer\offerta speciale
11012specialist\specialista, specialista 11011specialist\specialista, specialista
11013specialist shop\negozio specializzato 11012specialist shop\negozio specializzato
11014specialize\specializzare 11013specialize\specializzare
11015species\fare 11014species\fare
11016specimen\esemplare 11015specimen\esemplare
11017spectacles\occhiali, lente 11016spectacles\occhiali, lente
11018spectator\spettatore 11017spectator\spettatore
11019spectators\spettatore 11018spectators\spettatore
11020speech\idioma, orazione 11019speech\idioma, orazione
11021speed\numero dei giri, volare, andatura, velocità 11020speed\numero dei giri, volare, andatura, velocità
11022speed limit\limite di velocità 11021speed limit\limite di velocità
11023speed up\accelerare 11022speed up\accelerare
11024spell\compitare 11023spell\compitare
11025spend\emettere, passare, largire 11024spend\emettere, passare, largire
11026sperm\sperma 11025sperm\sperma
11027spice\aromatizzare, spezie 11026spice\aromatizzare, spezie
11028spicule\spilla 11027spicule\spilla
11029spider\ragno 11028spider\ragno
11030spiders\filare 11029spiders\filare
11031spill\versamtento 11030spill\versamtento
11032spinach\spinaci, spinacci 11031spinach\spinaci, spinacci
11033spinner\mattoide 11032spinner\mattoide
11034spirit\mente 11033spirit\mente
11035spirit level\livella 11034spirit level\livella
11036spiritlessness\insulsaggine 11035spiritlessness\insulsaggine
11037spirits\acquavite 11036spirits\acquavite
11038spit\spiedo, saliva 11037spit\spiedo, saliva
11039spite\nonostante, rancore 11038spite\nonostante, rancore
11040spitefulness\malignità 11039spitefulness\malignità
11041splendit\brillante 11040splendit\brillante
11042splendor\magnificenza 11041splendor\magnificenza
11043split\fèndere 11042split\fèndere
11044spoil\viziare 11043spoil\viziare
11045spoils\bottino 11044spoils\bottino
11046spoke\raggio 11045spoke\raggio
11047spokeswoman\oratrice 11046spokeswoman\oratrice
11048sponge\spugna 11047sponge\spugna
11049spongy\spugnoso 11048spongy\spugnoso
11050spontaneous\spontaneo 11049spontaneous\spontaneo
11051spook\apparizione 11050spook\apparizione
11052spoon\cucchiaio 11051spoon\cucchiaio
11053spoor\traccia 11052spoor\traccia
11054sports\sport 11053sports\sport
11055sports car\vettura sportiva 11054sports car\vettura sportiva
11056sports ground\campo sportivo 11055sports ground\campo sportivo
11057sports shirt\camicia sportiva 11056sports shirt\camicia sportiva
11058sportsman\sportivo 11057sportsman\sportivo
11059spot\posto, macchia 11058spot\posto, macchia
11060sprawl\espandersi 11059sprawl\espandersi
11061spray\raggio, nebulizzare 11060spray\raggio, nebulizzare
11062spread\espandersi, verniciare, spargere 11061spread\espandersi, verniciare, spargere
11063spreads\allarghi 11062spreads\allarghi
11064spring\piuma, sorgente, abbrivo, saltare, slancio, fonte 11063spring\piuma, sorgente, abbrivo, saltare, slancio, fonte
11065springiness\elasticità 11064springiness\elasticità
11066springtime\primavera 11065springtime\primavera
11067spur\sprone 11066spur\sprone
11068spurt\spruzzare 11067spurt\spruzzare
11069spy\spia 11068spy\spia
11070spying\spionaggio 11069spying\spionaggio
11071squabblers\attaccabriche 11070squabblers\attaccabriche
11072square\quadrangolo, quadrato, quadro, spigoloso, piazza 11071square\quadrangolo, quadrato, quadro, spigoloso, piazza
11073square metre\metro quadrato 11072square metre\metro quadrato
11074squash\succo 11073squash\succo
11075squeal\tradire 11074squeal\tradire
11076squeeze\premere 11075squeeze\premere
11077squid\calamaro 11076squid\calamaro
11078squint\strabico 11077squint\strabico
11079squirrel\scoiattolo 11078squirrel\scoiattolo
11080squirt\spruzzare 11079squirt\spruzzare
11081stable\stanla, stalla 11080stable\stanla, stalla
11082stable in value\di valore fisso 11081stable in value\di valore fisso
11083stadium\stadio 11082stadium\stadio
11084staff\personale, redazione 11083staff\personale, redazione
11085staffer\impiegato 11084staffer\impiegato
11086stage\fase, tribuna, scena, piedistallo 11085stage\fase, tribuna, scena, piedistallo
11087staggers\oscilla 11086staggers\oscilla
11088stain\macchia, insudiciare, imbrattare 11087stain\macchia, insudiciare, imbrattare
11089staircase\scala 11088staircase\scala
11090stairs\scala 11089stairs\scala
11091stake\stanga, missione 11090stake\stanga, missione
11092stall\posizione, stalla 11091stall\posizione, stalla
11093stamp\bollo, bollare, francobollo 11092stamp\bollo, bollare, francobollo
11094stand\stare, granaio, continuare 11093stand\stare, granaio, continuare
11095standalone\indipendente 11094standalone\indipendente
11096standing\in piedi 11095standing\in piedi
11097standing order\incarico permanente 11096standing order\incarico permanente
11098staple\affissare 11097staple\affissare
11099star\stella, vedette 11098star\stella, vedette
11100stardom\vanto 11099stardom\vanto
11101starling\vedette 11100starling\vedette
11102stars\stelle 11101stars\stelle
11103start\esordire, decollare, principio, comincio, inizio 11102start\esordire, decollare, principio, comincio, inizio
11104start up\decollare 11103start up\decollare
11105starter\avviamento 11104starter\avviamento
11106state\esporre, posizione, asserzioni 11105state\esporre, posizione, asserzioni
11107statedly\stabilito 11106statedly\stabilito
11108stately\prestante 11107stately\prestante
11109statement\asserzione, estratto di conto, costatazione 11108statement\asserzione, estratto di conto, costatazione
11110statue\statua 11109statue\statua
11111stay\soggiorno 11110stay\soggiorno
11112stay here\rimanere 11111stay here\rimanere
11113stays\rimane, stà 11112stays\rimane, stà
11114steady\continuo, proporzionato 11113steady\continuo, proporzionato
11115steak\bistecca 11114steak\bistecca
11116steal\sotrarre, rubare 11115steal\sotrarre, rubare
11117steam\vapore 11116steam\vapore
11118steamer\vapore 11117steamer\vapore
11119steamership\vapore 11118steamership\vapore
11120steel\acciao, acciaio 11119steel\acciao, acciaio
11121steelwork\acciaieria 11120steelwork\acciaieria
11122steep\erto 11121steep\erto
11123steer\dirigere 11122steer\dirigere
11124steering wheel\volante 11123steering wheel\volante
11125stem\tronco, sollevare 11124stem\tronco, sollevare
11126stench\lezzo 11125stench\lezzo
11127step\passo, procedere, gradino 11126step\passo, procedere, gradino
11128step by step\graduale 11127step by step\graduale
11129stern\poppa 11128stern\poppa
11130stewards\fattore 11129stewards\fattore
11131stewed fruit\composta 11130stewed fruit\composta
11132stick\incollare, bastone, ficcare 11131stick\incollare, bastone, ficcare
11133sticky\glutinoso 11132sticky\glutinoso
11134stiff\rigido 11133stiff\rigido
11135still\pari, però, calmo, ancora 11134still\pari, però, calmo, ancora
11136stillborn\nato morto 11135stillborn\nato morto
11137stimulate\eccitare, esacerbare 11136stimulate\eccitare, esacerbare
11138sting\colpo, pungere 11137sting\colpo, pungere
11139stingy\avareggiare 11138stingy\avareggiare
11140stink\puzzare, lezzo 11139stink\puzzare, lezzo
11141stipulate\fissare 11140stipulate\fissare
11142stir\muovere, commuòvere 11141stir\muovere, commuòvere
11143stock\immagazzinare 11142stock\immagazzinare
11144Stock Exchange\borsellino 11143Stock Exchange\borsellino
11145stockfish\baccalà 11144stockfish\baccalà
11146stocking\calza, calza maglia 11145stocking\calza, calza maglia
11147stole\acciaio 11146stole\acciaio
11148stomach\ventricolo 11147stomach\ventricolo
11149stomp\beccheggiare 11148stomp\beccheggiare
11150stone\sasso, pierra 11149stone\sasso, pierra
11151stoniness\durezza 11150stoniness\durezza
11152stool\sgabello 11151stool\sgabello
11153stop\ostruire, alt, fermare, fermarsi, fermata, finire 11152stop\ostruire, alt, fermare, fermarsi, fermata, finire
11154storage\immagazzinaggio, deposito, immagazzinamento 11153storage\immagazzinaggio, deposito, immagazzinamento
11155storage battery\accumulatore 11154storage battery\accumulatore
11156store\immagazzinare, campeggio, immagazzinare 11155store\immagazzinare, campeggio, immagazzinare
11157storefront\facciata 11156storefront\facciata
11158storing\accampato 11157storing\accampato
11159stork\cicogna 11158stork\cicogna
11160storm\tempesta, burrasca 11159storm\tempesta, burrasca
11161story\farsa, rapporto, fiaba, racconto, storia 11160story\farsa, rapporto, fiaba, racconto, storia
11162storybook\libro di fiabe 11161storybook\libro di fiabe
11163stove\stufa 11162stove\stufa
11164strabismus\strabico 11163strabismus\strabico
11165straight\pari 11164straight\pari
11166straight away\subito 11165straight away\subito
11167straighten out\drizzare 11166straighten out\drizzare
11168strain\aggravio, fatica 11167strain\aggravio, fatica
11169strait\stretto 11168strait\stretto
11170strange\strano, caratteristico, straniero, estroso 11169strange\strano, caratteristico, straniero, estroso
11171strangling\strozzare 11170strangling\strozzare
11172strap\cinghia 11171strap\cinghia
11173straw\paglia 11172straw\paglia
11174strawbeery\fràgola 11173strawbeery\fràgola
11175strawberry\fragola, fràgola 11174strawberry\fragola, fràgola
11176stream\corrente, ruscello 11175stream\corrente, ruscello
11177streamline\modernizzare 11176streamline\modernizzare
11178street\via, contrada 11177street\via, contrada
11179streets\strade 11178streets\strade
11180strengh\forza, potenza 11179strengh\forza, potenza
11181strenght\forza 11180strenght\forza
11182strength\forza, vigoria 11181strength\forza, vigoria
11183strengthen\amplificare 11182strengthen\amplificare
11184stress\accentuare, accento 11183stress\accentuare, accento
11185stretch\estendersi, stirato, espandere, stendere 11184stretch\estendersi, stirato, espandere, stendere
11186stretcher\bara 11185stretcher\bara
11187strews\sparge 11186strews\sparge
11188strict\severo 11187strict\severo
11189stride\passo 11188stride\passo
11190stridently\tagliente 11189stridently\tagliente
11191strike\affìggere, sciopero, picchiare, scioperare 11190strike\affìggere, sciopero, picchiare, scioperare
11192striked\scioperai 11191striked\scioperai
11193string\spago, cordicella 11192string\spago, cordicella
11194strip\lista, denudare, smontare 11193strip\lista, denudare, smontare
11195striped\zebrato 11194striped\zebrato
11196stroke\accarezzare, riga 11195stroke\accarezzare, riga
11197stroll\passeggiare 11196stroll\passeggiare
11198strong\poderoso, benportante 11197strong\poderoso, benportante
11199strongest\fortissima 11198strongest\fortissima
11200struggle\combattimento 11199struggle\combattimento
11201student\studente 11200student\studente
11202study\fare gli studi superiori 11201study\fare gli studi superiori
11203stuff\stoffa, materiale 11202stuff\stoffa, materiale
11204stuffed\farcito 11203stuffed\farcito
11205stuffing\otturazione 11204stuffing\otturazione
11206stuffs\inzeppa 11205stuffs\inzeppa
11207stuffy\muffaticcio 11206stuffy\muffaticcio
11208stumble\incespicare 11207stumble\incespicare
11209stumps\sbalordito 11208stumps\sbalordito
11210stun\assordare 11209stun\assordare
11211stupefy\ottundere 11210stupefy\ottundere
11212stupefying\assordante 11211stupefying\assordante
11213stupid\stupido, idiotico, balordo 11212stupid\stupido, idiotico, balordo
11214stupid thing\ocaggine 11213stupid thing\ocaggine
11215stupide\stupido 11214stupide\stupido
11216stupidity\ocaggine 11215stupidity\ocaggine
11217stupor\stupirsi 11216stupor\stupirsi
11218sturdy\valido 11217sturdy\valido
11219stutter\tartagliare 11218stutter\tartagliare
11220sty\stalla 11219sty\stalla
11221style\taglio, eloquio 11220style\taglio, eloquio
11222subject\oggetti, casella, assoggettato, soggetto, tema 11221subject\oggetti, casella, assoggettato, soggetto, tema
11223subject matter\tema 11222subject matter\tema
11224subjected\assoggetai 11223subjected\assoggetai
11225subjects\assogetta 11224subjects\assogetta
11226subjugating\vincente 11225subjugating\vincente
11227sublime\elevato 11226sublime\elevato
11228submarine\sommergibile 11227submarine\sommergibile
11229submission\soggiogamento 11228submission\soggiogamento
11230submit\sottoporre, soggiogare 11229submit\sottoporre, soggiogare
11231subscribe\abbonarsi 11230subscribe\abbonarsi
11232subscriber\partecipante, abbonato 11231subscriber\partecipante, abbonato
11233subscription\abbonamento 11232subscription\abbonamento
11234subsidy\sovvenzione 11233subsidy\sovvenzione
11235subsist\esistere 11234subsist\esistere
11236subsribe\firmare 11235subsribe\firmare
11237substance\sostanza 11236substance\sostanza
11238substandard\di valore scadente 11237substandard\di valore scadente
11239substitute\facente funzione 11238substitute\facente funzione
11240substitution\indennizzo 11239substitution\indennizzo
11241subsume\prendere 11240subsume\prendere
11242subterfuge\scusa 11241subterfuge\scusa
11243subtle\astuto, perspicace 11242subtle\astuto, perspicace
11244subtract\falcidiare 11243subtract\falcidiare
11245suburb\sobborgo 11244suburb\sobborgo
11246suburbia\borgo 11245suburbia\borgo
11247subverts\rovinato 11246subverts\rovinato
11248succeed\seguire, riuscire 11247succeed\seguire, riuscire
11249success\successo 11248success\successo
11250successful\correttamente 11249successful\correttamente
11251successfully\correttamente 11250successfully\correttamente
11252successive\consecutivo 11251successive\consecutivo
11253successor\seguace 11252successor\seguace
11254succumb\soccombere 11253succumb\soccombere
11255such\cosiffatto 11254such\cosiffatto
11256such as\come 11255such as\come
11257suck\succhiare, succhiare 11256suck\succhiare, succhiare
11258suck in\aspirare, succhiare 11257suck in\aspirare, succhiare
11259suckle\allattare 11258suckle\allattare
11260suddenly\improvvisamente 11259suddenly\improvvisamente
11261suffer\soffrire, patire 11260suffer\soffrire, patire
11262suffering\soffrire 11261suffering\soffrire
11263suffice\bastare 11262suffice\bastare
11264sufficiently\abbastanza 11263sufficiently\abbastanza
11265suffix\aggiunta 11264suffix\aggiunta
11266suffocate\affogare 11265suffocate\affogare
11267suffocation\affogare 11266suffocation\affogare
11268sugar\zucchero 11267sugar\zucchero
11269sugar bowl\zuccheriera 11268sugar bowl\zuccheriera
11270suggestion\appoggiatura 11269suggestion\appoggiatura
11271suggestions\proposte 11270suggestions\proposte
11272suicide\suicidio 11271suicide\suicidio
11273suit\procedimento, vestito 11272suit\procedimento, vestito
11274suitable\appropriato 11273suitable\appropriato
11275suitcase\valigia 11274suitcase\valigia
11276suitor\pretendente 11275suitor\pretendente
11277sulfurous\fervoroso 11276sulfurous\fervoroso
11278sulk\ammusare 11277sulk\ammusare
11279sulkiness\capriccio 11278sulkiness\capriccio
11280sum up\addizionare 11279sum up\addizionare
11281summary\raccolta 11280summary\raccolta
11282summation\addizione 11281summation\addizione
11283summer\estate, estivo 11282summer\estate, estivo
11284summer holidays\vacanze estive 11283summer holidays\vacanze estive
11285summerly\estivo 11284summerly\estivo
11286summit\cùlmine 11285summit\cùlmine
11287summon\chiamare 11286summon\chiamare
11288summoner\fattorino 11287summoner\fattorino
11289sumptuous\fastoso, lussuoso 11288sumptuous\fastoso, lussuoso
11290sun\sole 11289sun\sole
11291sunbathing\bagno di sole 11290sunbathing\bagno di sole
11292sunburned\abbronzito 11291sunburned\abbronzito
11293Sunday\doménica, domenica 11292Sunday\doménica, domenica
11294sunflower\elianto 11293sunflower\elianto
11295sunny\soleggiato 11294sunny\soleggiato
11296sunstroke\insolazione 11295sunstroke\insolazione
11297super\favolosamente 11296super\favolosamente
11298supercharger\mantice 11297supercharger\mantice
11299supercilious\orgoglioso 11298supercilious\orgoglioso
11300superficial\superficiale 11299superficial\superficiale
11301superior\migliore, più alto, superiore 11300superior\migliore, più alto, superiore
11302superlarge\grossissimo 11301superlarge\grossissimo
11303supernal\ultraterreno 11302supernal\ultraterreno
11304supernatural\ultraterreno 11303supernatural\ultraterreno
11305supervise\vigilare 11304supervise\vigilare
11306supervision\supervisione 11305supervision\supervisione
11307supplement\completamento, integrare 11306supplement\completamento, integrare
11308supplier\fornitore 11307supplier\fornitore
11309supply\fornitura, rifornimento, provvedere, fornire 11308supply\fornitura, rifornimento, provvedere, fornire
11310support\sostenere, appogiare, appoggio, poggiare, sostegno 11309support\sostenere, appogiare, appoggio, poggiare, sostegno
11311supporte\fiancheggiare 11310supporte\fiancheggiare
11312supposable\supposto 11311supposable\supposto
11313suppose\assùmere, supporre 11312suppose\assùmere, supporre
11314supposition\supposizione 11313supposition\supposizione
11315suppository\ugola 11314suppository\ugola
11316suppression\vuoto di cassa 11315suppression\vuoto di cassa
11317sure\sicuramente 11316sure\sicuramente
11318sureness\certezza 11317sureness\certezza
11319surer\più sicuro 11318surer\più sicuro
11320surface\superficie, superficie 11319surface\superficie, superficie
11321surge\frangenti 11320surge\frangenti
11322surgeon\chirurgo 11321surgeon\chirurgo
11323surgery\chirurgìa, pratica 11322surgery\chirurgìa, pratica
11324surmount\eccedere, eccedere 11323surmount\eccedere, eccedere
11325surprise\sorprendere, sorprendere 11324surprise\sorprendere, sorprendere
11326surprised\sorprende, sorprende 11325surprised\sorprende, sorprende
11327surprising\strano, sorprendente 11326surprising\strano, sorprendente
11328surrender\consegnare 11327surrender\consegnare
11329surround\circondare 11328surround\circondare
11330surroundings\dintorni 11329surroundings\dintorni
11331survival\sopportare, sopportare 11330survival\sopportare, sopportare
11332survive\sopravvivere 11331survive\sopravvivere
11333survives\sopravvive 11332survives\sopravvive
11334suspect\dubitare, supporre, presentire 11333suspect\dubitare, supporre, presentire
11335suspence\rinvio 11334suspence\rinvio
11336suspended\interrotto 11335suspended\interrotto
11337suspension\molleggio 11336suspension\molleggio
11338suspicion\sospetto, ombrosità 11337suspicion\sospetto, ombrosità
11339suspicious\sospetto, diffidgnte 11338suspicious\sospetto, diffidgnte
11340sustain\poggiare, appogiare, sostenere 11339sustain\poggiare, appogiare, sostenere
11341swabian\svevo 11340swabian\svevo
11342swallow\rondine, ingoio, divorare 11341swallow\rondine, ingoio, divorare
11343swamp\palude 11342swamp\palude
11344swan\cigno 11343swan\cigno
11345swarthy\farsi scuro 11344swarthy\farsi scuro
11346swatter\ammazzamosche 11345swatter\ammazzamosche
11347sweat\sudare, sudore 11346sweat\sudare, sudore
11348sweater\maglia, pullover 11347sweater\maglia, pullover
11349Swede\Svedese 11348Swede\Svedese
11350Sweden\Svezia 11349Sweden\Svezia
11351sweep\scopare, spazzare, ribaltabile 11350sweep\scopare, spazzare, ribaltabile
11352sweet\caramella, dolce, dessert, abboccato 11351sweet\caramella, dolce, dessert, abboccato
11353sweetness\dolciume 11352sweetness\dolciume
11354sweets\dolci 11353sweets\dolci
11355swell\enfiare, frangenti 11354swell\enfiare, frangenti
11356swiftly\presto 11355swiftly\presto
11357swill\risciacquare 11356swill\risciacquare
11358swim\nuotare, fanno il bagno 11357swim\nuotare, fanno il bagno
11359swimmer\nuoto 11358swimmer\nuoto
11360swimming\nuotare, fanno il bagno 11359swimming\nuotare, fanno il bagno
11361swimming-pool\piscina 11360swimming-pool\piscina
11362swimming trunks\calzoncini da bagno 11361swimming trunks\calzoncini da bagno
11363swims\nuota 11362swims\nuota
11364swindle\capogiro, marioleria 11363swindle\capogiro, marioleria
11365swindler\lestofante 11364swindler\lestofante
11366swing\altalena, brandire 11365swing\altalena, brandire
11367swings\dondolare 11366swings\dondolare
11368Swiss\Svizzero 11367Swiss\Svizzero
11369switch\interruttore 11368switch\interruttore
11370switch off\spegnere, posare, estinguere 11369switch off\spegnere, posare, estinguere
11371switch on\accèndere 11370switch on\accèndere
@@ -11884,1537 +11883,1536 @@ tobacco\tabacco
11884tobacco pouch\borsa del tabacco 11883tobacco pouch\borsa del tabacco
11885tobacconist's\tabaccheria 11884tobacconist's\tabaccheria
11886today\oggi 11885today\oggi
11887toddle\trotterellare 11886toddle\trotterellare
11888toddy\grog 11887toddy\grog
11889toes\dita dei piedi 11888toes\dita dei piedi
11890tog\vestire 11889tog\vestire
11891together\contemporaneamente, unitamente, insieme, comune 11890together\contemporaneamente, unitamente, insieme, comune
11892together with\velluto 11891together with\velluto
11893toggle\bavaglio, verificare 11892toggle\bavaglio, verificare
11894toiled\tormentò 11893toiled\tormentò
11895toiler\lavorante 11894toiler\lavorante
11896toilet\gabinetto, abbigliatura 11895toilet\gabinetto, abbigliatura
11897toilet paper\carta igiènica 11896toilet paper\carta igiènica
11898toils\tormenta 11897toils\tormenta
11899toilsome\faticoso 11898toilsome\faticoso
11900tolerance\tolleranza 11899tolerance\tolleranza
11901tolerate\amméttere, tollerare, sopportare 11900tolerate\amméttere, tollerare, sopportare
11902tolerated\ammesso 11901tolerated\ammesso
11903tolerates\sopporta 11902tolerates\sopporta
11904tolerating\indulgente 11903tolerating\indulgente
11905toleration\sopportazione 11904toleration\sopportazione
11906tollable\soggetto a dogana 11905tollable\soggetto a dogana
11907tolled\picchiai 11906tolled\picchiai
11908tolling\convincente 11907tolling\convincente
11909tomato\pomodoro 11908tomato\pomodoro
11910tomb\sepolcro 11909tomb\sepolcro
11911tomboyish\selvaggio 11910tomboyish\selvaggio
11912tombstone\lapide 11911tombstone\lapide
11913tomfoolery\ocaggine 11912tomfoolery\ocaggine
11914tomorrow\domani, oriente 11913tomorrow\domani, oriente
11915tomorrow morning\domattina 11914tomorrow morning\domattina
11916tomtit\cincia 11915tomtit\cincia
11917tone\suono 11916tone\suono
11918toneless\afono 11917toneless\afono
11919tones\voce, pronuncia 11918tones\voce, pronuncia
11920tongue\idioma, lingua 11919tongue\idioma, lingua
11921tongues\linguale 11920tongues\linguale
11922tonicity\elasticità 11921tonicity\elasticità
11923toning bath\viraggio 11922toning bath\viraggio
11924tonque\lingua 11923tonque\lingua
11925tony\stile 11924tony\stile
11926too\anche, a tavola, troppo, oltremodo 11925too\anche, a tavola, troppo, oltremodo
11927too expensive\impagabile 11926too expensive\impagabile
11928too little\troppo poco 11927too little\troppo poco
11929too much\troppo 11928too much\troppo
11930took\prese 11929took\prese
11931took over\mi incaricai, mi incaricai 11930took over\mi incaricai, mi incaricai
11932toolmaker\attrezzista 11931toolmaker\attrezzista
11933tooth\dente 11932tooth\dente
11934tooth decay\carie 11933tooth decay\carie
11935toothbrush\spazzolino da denti 11934toothbrush\spazzolino da denti
11936toothless\sdentata, sdentato 11935toothless\sdentata, sdentato
11937toothpaste\dentifricio 11936toothpaste\dentifricio
11938toothpick\stuzzicadenti 11937toothpick\stuzzicadenti
11939toothsome\gustoso 11938toothsome\gustoso
11940top\principio, cùlmine, sù, fermatura, cappotta 11939top\principio, cùlmine, sù, fermatura, cappotta
11941top floor\soffitta 11940top floor\soffitta
11942topic\volume, tema 11941topic\volume, tema
11943topical\conforme al tempo 11942topical\conforme al tempo
11944topmast\severità 11943topmast\severità
11945topmost\colonello 11944topmost\colonello
11946topples\cade 11945topples\cade
11947torch\fiàccola 11946torch\fiàccola
11948torches\fiaccole 11947torches\fiaccole
11949tormented\inquieto 11948tormented\inquieto
11950torn off\stracciato 11949torn off\stracciato
11951torn up\stracciato 11950torn up\stracciato
11952torpedo boat\lanciasiluri 11951torpedo boat\lanciasiluri
11953torpid\assordato 11952torpid\assordato
11954torpidity\anestesia 11953torpidity\anestesia
11955torpidness\accidia 11954torpidness\accidia
11956torridness\ustione 11955torridness\ustione
11957tortoise\tartaruga 11956tortoise\tartaruga
11958torture\tortura, tormento 11957torture\tortura, tormento
11959torture chamber\stanza di tortura 11958torture chamber\stanza di tortura
11960torus\circolo 11959torus\circolo
11961toss\avventare 11960toss\avventare
11962total\intero, completo, tutta 11961total\intero, completo, tutta
11963total weight\peso complessivo 11962total weight\peso complessivo
11964totaled\contai 11963totaled\contai
11965totality\complesso 11964totality\complesso
11966totally\completo 11965totally\completo
11967totals\conta 11966totals\conta
11968tots\conta 11967tots\conta
11969totter\barcollare 11968totter\barcollare
11970touch\affisso, inpugnare, toccare 11969touch\affisso, inpugnare, toccare
11971touchdown\ottenere 11970touchdown\ottenere
11972touched\afferrato 11971touched\afferrato
11973touchiness\suscettibilità 11972touchiness\suscettibilità
11974touching\afferrante 11973touching\afferrante
11975touchy\irritabile, sensibile 11974touchy\irritabile, sensibile
11976tough\ostinato 11975tough\ostinato
11977tougher\più duro 11976tougher\più duro
11978toughing\commovente 11977toughing\commovente
11979toughly\solido 11978toughly\solido
11980toughs\lestofante 11979toughs\lestofante
11981tour\circolazione, giro turistico, giro turìstico 11980tour\circolazione, giro turistico, giro turìstico
11982tourism\escursionismo 11981tourism\escursionismo
11983tourist\escursionista, escursionista 11982tourist\escursionista, escursionista
11984tourist class\classe turìstica 11983tourist class\classe turìstica
11985tourist party\gruppo turìstico 11984tourist party\gruppo turìstico
11986tourist traffic\movimento turistico 11985tourist traffic\movimento turistico
11987tournament\competizione, giostra 11986tournament\competizione, giostra
11988tourney\giostra 11987tourney\giostra
11989tousles\arruffato 11988tousles\arruffato
11990tout\arruolare 11989tout\arruolare
11991tow\trascinare, trascinare, estrassi 11990tow\trascinare, trascinare, estrassi
11992tow off\trascinare 11991tow off\trascinare
11993tow rope\cavo di rimorchio 11992tow rope\cavo di rimorchio
11994toward\arrendevole 11993toward\arrendevole
11995towards\in, a tavola, inverso 11994towards\in, a tavola, inverso
11996towel\asciugamano 11995towel\asciugamano
11997toweled\asciugato 11996toweled\asciugato
11998towels\asciugamani 11997towels\asciugamani
11999tower\torre 11998tower\torre
12000towering\poderoso 11999towering\poderoso
12001town\città 12000town\città
12002town-hall\municipio 12001town-hall\municipio
12003town-planing\urbanistica 12002town-planing\urbanistica
12004town council\assessore municipale 12003town council\assessore municipale
12005townplan\piantina 12004townplan\piantina
12006township\congreguari 12005township\congreguari
12007towrope\cavo di rimorchio 12006towrope\cavo di rimorchio
12008toxic\virulento 12007toxic\virulento
12009toxin\veleno 12008toxin\veleno
12010toxins\veleni 12009toxins\veleni
12011toy\giocàttolo 12010toy\giocàttolo
12012toyed\giocai 12011toyed\giocai
12013track\binario 12012track\binario
12014track hound\segugio 12013track hound\segugio
12015tracking\inseguire 12014tracking\inseguire
12016trackless\senza traccia 12015trackless\senza traccia
12017tract\territorio 12016tract\territorio
12018tractive\boccata 12017tractive\boccata
12019trade\impresa, arte, ramo di commercio, commercio 12018trade\impresa, arte, ramo di commercio, commercio
12020trade union\sindacato 12019trade union\sindacato
12021trade unionist\sindacalista 12020trade unionist\sindacalista
12022tradeoff\cambio 12021tradeoff\cambio
12023tradeoffs\scambio 12022tradeoffs\scambio
12024tradesman\omo, signora 12023tradesman\omo, signora
12025tradeunion\sindacato 12024tradeunion\sindacato
12026tradeunionist\sindacalista 12025tradeunionist\sindacalista
12027tradition\tradizione, tradizione 12026tradition\tradizione, tradizione
12028traduce\calunniare 12027traduce\calunniare
12029traffic\traffico 12028traffic\traffico
12030traffic light\semaforo 12029traffic light\semaforo
12031traffic lights\semaforo, semafori, semaforo 12030traffic lights\semaforo, semafori, semaforo
12032traffic sign\cartello stradale 12031traffic sign\cartello stradale
12033trafficking\commercio 12032trafficking\commercio
12034tragedy\tragedia, tragedia 12033tragedy\tragedia, tragedia
12035tragic\tragico 12034tragic\tragico
12036trailer\nudista 12035trailer\nudista
12037train\ammaestrare, educare, allenamento, ferroviario 12036train\ammaestrare, educare, allenamento, ferroviario
12038train of thought\ragionamento 12037train of thought\ragionamento
12039trained\esercitato 12038trained\esercitato
12040trainee\apprendista 12039trainee\apprendista
12041trainer\allenatore 12040trainer\allenatore
12042trainers\allenatore 12041trainers\allenatore
12043training\istruzione, educazione 12042training\istruzione, educazione
12044training ship\nave scuola 12043training ship\nave scuola
12045trains\treni 12044trains\treni
12046traipse\strascicare 12045traipse\strascicare
12047tram\tram 12046tram\tram
12048tramp\vagabondaggio 12047tramp\vagabondaggio
12049transaction\evasione 12048transaction\evasione
12050transcendence\elevatezza 12049transcendence\elevatezza
12051transfer\trasferire, imbarazzato, cessione, trasportare 12050transfer\trasferire, imbarazzato, cessione, trasportare
12052transform\convertire, commutare, alterare 12051transform\convertire, commutare, alterare
12053transient\corruttìbile 12052transient\corruttìbile
12054transit\tragitto 12053transit\tragitto
12055translate\tradurre, tradurre 12054translate\tradurre, tradurre
12056translation\traduzione, traduzione 12055translation\traduzione, traduzione
12057transmarine\oltremarino, oltremarino 12056transmarine\oltremarino, oltremarino
12058transmission\spedizione 12057transmission\spedizione
12059transmit\cèdere, cèdere 12058transmit\cèdere, cèdere
12060transmitter\trasmettitore 12059transmitter\trasmettitore
12061transparent\vaporoso 12060transparent\vaporoso
12062transplant\trapiantare 12061transplant\trapiantare
12063transport\avanzamento, trasporto, trasportare 12062transport\avanzamento, trasporto, trasportare
12064transubstantiate\commutare 12063transubstantiate\commutare
12065transversal\obliquo 12064transversal\obliquo
12066trap\tranello 12065trap\tranello
12067trascan\secchio delle immondizie 12066trascan\secchio delle immondizie
12068trashcan\cestino 12067trashcan\cestino
12069travel\andara 12068travel\andara
12070travel agency\ufficio viaggi 12069travel agency\ufficio viaggi
12071travel office\ufficio viaggi 12070travel office\ufficio viaggi
12072traveler\viaggiatore 12071traveler\viaggiatore
12073traveller\viaggiatore, viaggiatore 12072traveller\viaggiatore, viaggiatore
12074travelling bag\borsa da viaggio 12073travelling bag\borsa da viaggio
12075travelling expenses\spese di viaggio 12074travelling expenses\spese di viaggio
12076tray\vassoio 12075tray\vassoio
12077tread\pedata 12076tread\pedata
12078treasure\tesoro 12077treasure\tesoro
12079treat\coltivare 12078treat\coltivare
12080treatment\elettorale, cura 12079treatment\elettorale, cura
12081tree\albero, àlbero 12080tree\albero, àlbero
12082tree-trunk\tronco 12081tree-trunk\tronco
12083tremendous\grandioso, poderoso 12082tremendous\grandioso, poderoso
12084tremulously\tremante 12083tremulously\tremante
12085trend\declinazione 12084trend\declinazione
12086trial\esperimento, procedimento 12085trial\esperimento, procedimento
12087triangle\triangolo 12086triangle\triangolo
12088tribulation\tormento 12087tribulation\tormento
12089trick\trucco, furberia 12088trick\trucco, furberia
12090tricky\intricato 12089tricky\intricato
12091tricolors\tricolore 12090tricolors\tricolore
12092trifles\quisquilie 12091trifles\quisquilie
12093trimly\curato 12092trimly\curato
12094tringing\tinntinnare, sonare il campanello 12093tringing\tinntinnare, sonare il campanello
12095trip\escursione, tratto, incespicare 12094trip\escursione, tratto, incespicare
12096tripod\cavalletto 12095tripod\cavalletto
12097triviality\insulsaggine 12096triviality\insulsaggine
12098troop\truppa 12097troop\truppa
12099trot\trottare 12098trot\trottare
12100trouble\fastidio, disturbo, fatica, penuria, problema 12099trouble\fastidio, disturbo, fatica, penuria, problema
12101troublesome\noioso 12100troublesome\noioso
12102trough\per mezzo di ciò 12101trough\per mezzo di ciò
12103trousers\pantaloni 12102trousers\pantaloni
12104trout\trota 12103trout\trota
12105truck\camion 12104truck\camion
12106true\vero 12105true\vero
12107trump\brìscola 12106trump\brìscola
12108trumpet\tromba 12107trumpet\tromba
12109trunk\tronco, torso 12108trunk\tronco, torso
12110trust\confidenza 12109trust\confidenza
12111trusted\fidai 12110trusted\fidai
12112truth\verità 12111truth\verità
12113try\esperimentare, provare 12112try\esperimentare, provare
12114tube\tubetto, tubo, tubo 12113tube\tubetto, tubo, tubo
12115Tuesday\martedì, martedí 12114Tuesday\martedì, martedí
12116tug\trascinare 12115tug\trascinare
12117tulip\tulipano 12116tulip\tulipano
12118tumour\tumore 12117tumour\tumore
12119tuna\tonno 12118tuna\tonno
12120tuna-fish\tonno 12119tuna-fish\tonno
12121tune\melodia 12120tune\melodia
12122tunes\esatto 12121tunes\esatto
12123tuning\votazione 12122tuning\votazione
12124tunnel\galleria 12123tunnel\galleria
12125tunny\tonno 12124tunny\tonno
12126turbine\turbina 12125turbine\turbina
12127Turk\Turco 12126Turk\Turco
12128turkey\tacchino 12127turkey\tacchino
12129Turkey\Turchia 12128Turkey\Turchia
12130turn\fila, girata, voltarsi, girare 12129turn\fila, girata, voltarsi, girare
12131turn around\voltare 12130turn around\voltare
12132turn off\posare 12131turn off\posare
12133turn on\accèndere 12132turn on\accèndere
12134turn round\ritornare 12133turn round\ritornare
12135turn screw\cacciavite 12134turn screw\cacciavite
12136turnings\trucioli 12135turnings\trucioli
12137turnip\rapa 12136turnip\rapa
12138turnover\movimento degli affari 12137turnover\movimento degli affari
12139turret\torretta 12138turret\torretta
12140turtle\tartaruga 12139turtle\tartaruga
12141TV\televisione 12140TV\televisione
12142twain\paio 12141twain\paio
12143twelve\dodici 12142twelve\dodici
12144twenty\venti 12143twenty\venti
12145twenty-three\ventitré 12144twenty-three\ventitré
12146twerps\uomini 12145twerps\uomini
12147twiddled\giocai 12146twiddled\giocai
12148twiddles\gioca 12147twiddles\gioca
12149twins\gemelli 12148twins\gemelli
12150twirl\girare 12149twirl\girare
12151twist\storcere, girata 12150twist\storcere, girata
12152twitch\ticchio 12151twitch\ticchio
12153two\due 12152two\due
12154two hundred\duecento 12153two hundred\duecento
12155twofold\dùplice 12154twofold\dùplice
12156twoseater\biposto 12155twoseater\biposto
12157tympanum\timpano 12156tympanum\timpano
12158type\fare, scommettere, tipo, sorta, vergare 12157type\fare, scommettere, tipo, sorta, vergare
12159typhoon\tifone 12158typhoon\tifone
12160typical\tipico 12159typical\tipico
12161tyran\tiranno 12160tyran\tiranno
12162tyrant\tiranno 12161tyrant\tiranno
12163udder\mammella 12162udder\mammella
12164ugly\laido 12163ugly\laido
12165ulcers\ulcere 12164ulcers\ulcere
12166ultimate\alla fin fine 12165ultimate\alla fin fine
12167ultimately\finalmente 12166ultimately\finalmente
12168ultrared\ultrarosso 12167ultrared\ultrarosso
12169umbrageous\ombreggiato 12168umbrageous\ombreggiato
12170umbrella\parapioggia, ombrello 12169umbrella\parapioggia, ombrello
12171umpire\arbitro 12170umpire\arbitro
12172unabating\incessante 12171unabating\incessante
12173unable\inadatto, incapace 12172unable\inadatto, incapace
12174unable to work\inabile al lavoro 12173unable to work\inabile al lavoro
12175unaltered\immutato 12174unaltered\immutato
12176unanimous\a una voce 12175unanimous\a una voce
12177unanimously\a una voce 12176unanimously\a una voce
12178unattempted\intentato 12177unattempted\intentato
12179unauthorized\non autorizzato 12178unauthorized\non autorizzato
12180unavailable\trasceso 12179unavailable\trasceso
12181unavoidable\inevitabile 12180unavoidable\inevitabile
12182unbeknownst\sconosciuto 12181unbeknownst\sconosciuto
12183unbelievable\incredibile 12182unbelievable\incredibile
12184unboundedly\illimitato 12183unboundedly\illimitato
12185unburdened\licenziato 12184unburdened\licenziato
12186uncertain\incerto, malsicuro 12185uncertain\incerto, malsicuro
12187uncertainty\incertezza 12186uncertainty\incertezza
12188unchallengeable\irrefutabile 12187unchallengeable\irrefutabile
12189uncle\zio 12188uncle\zio
12190uncloaking\svelante 12189uncloaking\svelante
12191uncomfortable\scomodo 12190uncomfortable\scomodo
12192unconditional\incondizionato 12191unconditional\incondizionato
12193unconscious\inconsapevole 12192unconscious\inconsapevole
12194unconstitutional\anticostituzionale 12193unconstitutional\anticostituzionale
12195uncork\stappare 12194uncork\stappare
12196unction\unzione 12195unction\unzione
12197unctious\untuoso 12196unctious\untuoso
12198unctuous\cremoso 12197unctuous\cremoso
12199unctuousness\unzione 12198unctuousness\unzione
12200uncurable\inguaribile 12199uncurable\inguaribile
12201uncurbed\sbrogliato 12200uncurbed\sbrogliato
12202undate\ondulato 12201undate\ondulato
12203undazzled\intatto 12202undazzled\intatto
12204undecent\indecente 12203undecent\indecente
12205undecided\incerto 12204undecided\incerto
12206undeck\scoprire 12205undeck\scoprire
12207undefeated\inbattuto 12206undefeated\inbattuto
12208undefiled\pulito 12207undefiled\pulito
12209undefined\vago 12208undefined\vago
12210undeliberate\senza volere 12209undeliberate\senza volere
12211undelightful\mostruoso 12210undelightful\mostruoso
12212undemanding\senza esigenza 12211undemanding\senza esigenza
12213undeniably\incontestabile 12212undeniably\incontestabile
12214under\là sotto, sotto, abbasso 12213under\là sotto, sotto, abbasso
12215under age\minorenne 12214under age\minorenne
12216under carriage\carrello 12215under carriage\carrello
12217under developed\arretrato 12216under developed\arretrato
12218under it\là sotto 12217under it\là sotto
12219underage\minorenne 12218underage\minorenne
12220underarm\avambraccio 12219underarm\avambraccio
12221underbid\offrire sotto costo 12220underbid\offrire sotto costo
12222undercarriage\carrello 12221undercarriage\carrello
12223undercover\riservato 12222undercover\riservato
12224undercut\offrire sotto costo 12223undercut\offrire sotto costo
12225underestimate\sottovalutare 12224underestimate\sottovalutare
12226undergo\vissi 12225undergo\vissi
12227undergraduate\studente 12226undergraduate\studente
12228underground\sotterraneo, sottosuolo 12227underground\sotterraneo, sottosuolo
12229underground railway\ferrovia sotterranea 12228underground railway\ferrovia sotterranea
12230undergrowth\sterpaglia 12229undergrowth\sterpaglia
12231underhand\segreto 12230underhand\segreto
12232underlie\soccombere 12231underlie\soccombere
12233underline\sottolineare 12232underline\sottolineare
12234undermine\minare 12233undermine\minare
12235underneath\sotto 12234underneath\sotto
12236underpants\mutande 12235underpants\mutande
12237underrate\sottovalutare 12236underrate\sottovalutare
12238underscore\sottolineare 12237underscore\sottolineare
12239undersell\offrire sotto costo 12238undersell\offrire sotto costo
12240undershirt\maglia 12239undershirt\maglia
12241underside\parte inferiore 12240underside\parte inferiore
12242undersigned\firmato 12241undersigned\firmato
12243undersized\minuscolo 12242undersized\minuscolo
12244underskirt\sottana 12243underskirt\sottana
12245understand\capire, comprendere 12244understand\capire, comprendere
12246understanded\giudizio, nozione 12245understanded\giudizio, nozione
12247understanding\comprensione 12246understanding\comprensione
12248understands\comprende 12247understands\comprende
12249undertake\intraprendere 12248undertake\intraprendere
12250undertaken\intrapreso 12249undertaken\intrapreso
12251undertakes\intraprende 12250undertakes\intraprende
12252undertaking\intraprendere 12251undertaking\intraprendere
12253undertakings\esercizi 12252undertakings\esercizi
12254undertook\intrapresi 12253undertook\intrapresi
12255undervalue\sottovalutare 12254undervalue\sottovalutare
12256underwear\biancherìa ìntima 12255underwear\biancherìa ìntima
12257underworld\regno dei morti 12256underworld\regno dei morti
12258underwrite\garantire, firmare 12257underwrite\garantire, firmare
12259underwrites\garantito 12258underwrites\garantito
12260underwriting\assicurazione 12259underwriting\assicurazione
12261underwritten\garantito 12260underwritten\garantito
12262undesignated\vago 12261undesignated\vago
12263undesigning\sincero 12262undesigning\sincero
12264undetermined\vago 12263undetermined\vago
12265undeveloped\embrionale 12264undeveloped\embrionale
12266undies\biancherìa ìntima 12265undies\biancherìa ìntima
12267undigested\non digerito 12266undigested\non digerito
12268undilated\non diluito 12267undilated\non diluito
12269undischarged\non pagato 12268undischarged\non pagato
12270undisclosed\anònimo 12269undisclosed\anònimo
12271undistinguishable\indistinto 12270undistinguishable\indistinto
12272undisturbed\indisturbato 12271undisturbed\indisturbato
12273undivorced\sposato 12272undivorced\sposato
12274undoable\solubile 12273undoable\solubile
12275undreamt\inaudito 12274undreamt\inaudito
12276undubbed\anònimo 12275undubbed\anònimo
12277undue\insufficiente 12276undue\insufficiente
12278undulated\ondulatorio 12277undulated\ondulatorio
12279undying\immortale 12278undying\immortale
12280unearth\disotterrare 12279unearth\disotterrare
12281unease\inquietudine 12280unease\inquietudine
12282uneasily\sconfortevole 12281uneasily\sconfortevole
12283uneasy\sconfortevole 12282uneasy\sconfortevole
12284uneatable\immangiabile 12283uneatable\immangiabile
12285uneligible\disadatto 12284uneligible\disadatto
12286unembarrassed\spudorato 12285unembarrassed\spudorato
12287unemphatic\indistinto 12286unemphatic\indistinto
12288unemployable\inservibile 12287unemployable\inservibile
12289unemployed\senza lavoro 12288unemployed\senza lavoro
12290unemployment\disoccupazione 12289unemployment\disoccupazione
12291unendurable\insopportabile 12290unendurable\insopportabile
12292unenjoyable\immangiabile 12291unenjoyable\immangiabile
12293unenriched\non annunciato 12292unenriched\non annunciato
12294unenslaved\esente 12293unenslaved\esente
12295unequable\sleale 12294unequable\sleale
12296unequably\sleale 12295unequably\sleale
12297unequal\ineguale 12296unequal\ineguale
12298unequaled\senza esempio 12297unequaled\senza esempio
12299unequivocal\univoco 12298unequivocal\univoco
12300unescorted\unico 12299unescorted\unico
12301unessential\accidentale 12300unessential\accidentale
12302unestimable\inestimabile 12301unestimable\inestimabile
12303unethical\senza scrupoli 12302unethical\senza scrupoli
12304uneven\ineguale 12303uneven\ineguale
12305unexcelled\insuperato 12304unexcelled\insuperato
12306unexceptional\senza eccezione 12305unexceptional\senza eccezione
12307unexpected\inatteso 12306unexpected\inatteso
12308unexperienced\novizio 12307unexperienced\novizio
12309unexplicit\indistinto 12308unexplicit\indistinto
12310unfailing\senza errori, attendìbile 12309unfailing\senza errori, attendìbile
12311unfairly\sleale 12310unfairly\sleale
12312unfaithful\infedele, infedele 12311unfaithful\infedele, infedele
12313unfaltering\inflessibile 12312unfaltering\inflessibile
12314unfathomable\inpenetrabile 12313unfathomable\inpenetrabile
12315unfatiguing\instancabile 12314unfatiguing\instancabile
12316unfavorable\sfavorevole 12315unfavorable\sfavorevole
12317unfavourable\sfavorevole 12316unfavourable\sfavorevole
12318unfeeling\insensibile 12317unfeeling\insensibile
12319unfeigned\vero 12318unfeigned\vero
12320unfeminine\maschile 12319unfeminine\maschile
12321unfertile\sterile 12320unfertile\sterile
12322unfetter\esimere 12321unfetter\esimere
12323unfinished\incompiuta 12322unfinished\incompiuta
12324unfirm\malfermo 12323unfirm\malfermo
12325unfit\inadatto, inabile al lavoro, disadatto 12324unfit\inadatto, inabile al lavoro, disadatto
12326unfit for work\incapace al lavoro 12325unfit for work\incapace al lavoro
12327unfitness\inattitudine 12326unfitness\inattitudine
12328unfitted\disadatto 12327unfitted\disadatto
12329unfitting\sconveniente 12328unfitting\sconveniente
12330unfix\sciogliere 12329unfix\sciogliere
12331unflagging\instancabile 12330unflagging\instancabile
12332unflavored\senza gusto 12331unflavored\senza gusto
12333unflinching\deciso 12332unflinching\deciso
12334unflustered\equilibrato 12333unflustered\equilibrato
12335unfold\esplicare 12334unfold\esplicare
12336unforced\spontaneo 12335unforced\spontaneo
12337unforeseen\imprevisto 12336unforeseen\imprevisto
12338unforgettable\indimenticabile 12337unforgettable\indimenticabile
12339unforgivable\inperdonabile 12338unforgivable\inperdonabile
12340unforgivably\inperdonabile 12339unforgivably\inperdonabile
12341unforgotten\indimenticato 12340unforgotten\indimenticato
12342unformal\poco stretto 12341unformal\poco stretto
12343unfortunately\per disgrazia, purtroppo 12342unfortunately\per disgrazia, purtroppo
12344unfrank\disonesto 12343unfrank\disonesto
12345unfrequent\raro 12344unfrequent\raro
12346unfrequently\rara 12345unfrequently\rara
12347unfriendly\scortese 12346unfriendly\scortese
12348unfruitful\infecondo 12347unfruitful\infecondo
12349ungainliness\zoticaggine 12348ungainliness\zoticaggine
12350ungentlemanly\sconveniente 12349ungentlemanly\sconveniente
12351ungirt\poco stretto 12350ungirt\poco stretto
12352ungiving\insensibile 12351ungiving\insensibile
12353ungraceful\grossolano 12352ungraceful\grossolano
12354ungracefully\goffa 12353ungracefully\goffa
12355ungraciousness\sfavore 12354ungraciousness\sfavore
12356ungrateful\ingrato 12355ungrateful\ingrato
12357ungratefully\ingrato 12356ungratefully\ingrato
12358ungratefulness\ingratitudine, ingratitudine 12357ungratefulness\ingratitudine, ingratitudine
12359ungrudging\senza invidia 12358ungrudging\senza invidia
12360unhalted\sbrogliato 12359unhalted\sbrogliato
12361unhappily\per disgrazia 12360unhappily\per disgrazia
12362unhappiness\miserabile 12361unhappiness\miserabile
12363unhappy\disgraziato, afflitto 12362unhappy\disgraziato, afflitto
12364unharbored\scoperto 12363unharbored\scoperto
12365unharmed\illeso 12364unharmed\illeso
12366unharmfully\sicura 12365unharmfully\sicura
12367unheated\inosservato 12366unheated\inosservato
12368unhesitant\volonteroso 12367unhesitant\volonteroso
12369unhesitating\immediato 12368unhesitating\immediato
12370unhomogeneous\ineguale 12369unhomogeneous\ineguale
12371unhuman\disumano 12370unhuman\disumano
12372unicellular\unicellulare 12371unicellular\unicellulare
12373unicoloured\unicolore 12372unicoloured\unicolore
12374unicorn\liocorno 12373unicorn\liocorno
12375unidentified\sconosciuto 12374unidentified\sconosciuto
12376unidimensional\lineare 12375unidimensional\lineare
12377unification\unificazione 12376unification\unificazione
12378unified\uniti 12377unified\uniti
12379unifies\unito 12378unifies\unito
12380uniform\unito 12379uniform\unito
12381uniformity\uniformità 12380uniformity\uniformità
12382unilateral\unilaterale 12381unilateral\unilaterale
12383unillumined\ignorante 12382unillumined\ignorante
12384unimaginable\inimmaginabile 12383unimaginable\inimmaginabile
12385unimaginative\senza immagginazione 12384unimaginative\senza immagginazione
12386unimagined\imprevisto 12385unimagined\imprevisto
12387unimpeachable\intoccabile 12386unimpeachable\intoccabile
12388unimpeded\indisturbato 12387unimpeded\indisturbato
12389unimportance\cosa di nessuna importanza 12388unimportance\cosa di nessuna importanza
12390unimportant\senza importanza 12389unimportant\senza importanza
12391unimportntant\senza importanza 12390unimportntant\senza importanza
12392uninformed\ignorante 12391uninformed\ignorante
12393uninhabited\disabitato 12392uninhabited\disabitato
12394unintelligently\insulso 12393unintelligently\insulso
12395unintended\senza volere 12394unintended\senza volere
12396unintentional\senza volere 12395unintentional\senza volere
12397uninterrupted\durabile, incessante 12396uninterrupted\durabile, incessante
12398unintimate\scomodo 12397unintimate\scomodo
12399union\unione, unione, sindacato, lega 12398union\unione, unione, sindacato, lega
12400unique\singolo, unico, straordinario, eccezzionale 12399unique\singolo, unico, straordinario, eccezzionale
12401unison\unisono 12400unison\unisono
12402unisonous\congruente 12401unisonous\congruente
12403unit\meccanismo, elemento, semplice 12402unit\meccanismo, elemento, semplice
12404unitary\unito 12403unitary\unito
12405unite\unificare, unirsi 12404unite\unificare, unirsi
12406united\uniti, in comune 12405united\uniti, in comune
12407unites\unito 12406unites\unito
12408unity\elemento, concordia 12407unity\elemento, concordia
12409universalize\generalizzare 12408universalize\generalizzare
12410universally\notorio 12409universally\notorio
12411universally known\notorio 12410universally known\notorio
12412universe\universo 12411universe\universo
12413university\università, accademia 12412university\università, accademia
12414university graduate\accadèmico 12413university graduate\accadèmico
12415unkind\scortese, insensibile 12414unkind\scortese, insensibile
12416unkindly\insensibile 12415unkindly\insensibile
12417unkindness\insensibilità 12416unkindness\insensibilità
12418unknowable\ignorante 12417unknowable\ignorante
12419unknown\sconosciuto 12418unknown\sconosciuto
12420unlabored\facilmente 12419unlabored\facilmente
12421unlade\scaricare 12420unlade\scaricare
12422unlawful\illegale 12421unlawful\illegale
12423unleaded\senza piombo 12422unleaded\senza piombo
12424unlearn\disimparare 12423unlearn\disimparare
12425unless\tranne che 12424unless\tranne che
12426unlettered\incolto 12425unlettered\incolto
12427unlevel\dìspari 12426unlevel\dìspari
12428unlicensed\non permesso 12427unlicensed\non permesso
12429unlifelike\imitato 12428unlifelike\imitato
12430unlimited\illimitato 12429unlimited\illimitato
12431unlink\separare 12430unlink\separare
12432unlinked\sciolto 12431unlinked\sciolto
12433unliquidated\non pagato 12432unliquidated\non pagato
12434unliteral\figurato 12433unliteral\figurato
12435unload\scaricare, scaricare 12434unload\scaricare, scaricare
12436unloaded\scaricato 12435unloaded\scaricato
12437unloading\scaricare 12436unloading\scaricare
12438unloading point\deposito 12437unloading point\deposito
12439unlock\disserrare 12438unlock\disserrare
12440unloving\frigido 12439unloving\frigido
12441unluckily\per disgrazia 12440unluckily\per disgrazia
12442unlucky\disgraziato, infelice 12441unlucky\disgraziato, infelice
12443unlucky fellow\corvo del malaugurio 12442unlucky fellow\corvo del malaugurio
12444unmagical\insipido 12443unmagical\insipido
12445unmake\levatura 12444unmake\levatura
12446unmannerly\screanzato 12445unmannerly\screanzato
12447unmarried\nubile 12446unmarried\nubile
12448unmasculine\femminino 12447unmasculine\femminino
12449unmask\comprométtere 12448unmask\comprométtere
12450unmasking\smascherante 12449unmasking\smascherante
12451unmerciful\spietato 12450unmerciful\spietato
12452unmindful\sconsiderato 12451unmindful\sconsiderato
12453unmistakably\inconfondibile 12452unmistakably\inconfondibile
12454unmistaken\sicuramente 12453unmistaken\sicuramente
12455unmodified\immutato 12454unmodified\immutato
12456unmovable\immobile 12455unmovable\immobile
12457unmoved\impassibile 12456unmoved\impassibile
12458unnecessary\inutile 12457unnecessary\inutile
12459unneighborly\scortese 12458unneighborly\scortese
12460unnoted\inosservato 12459unnoted\inosservato
12461unnoticeable\inosservato 12460unnoticeable\inosservato
12462unnoticed\inosservato 12461unnoticed\inosservato
12463unobjectionable\legittimo 12462unobjectionable\legittimo
12464unobscured\sereno 12463unobscured\sereno
12465unobservant\disattento 12464unobservant\disattento
12466unobtainable\irraggiungibile 12465unobtainable\irraggiungibile
12467unoccupied\vacante 12466unoccupied\vacante
12468unoffending\innocuo 12467unoffending\innocuo
12469unofficial\ufficioso 12468unofficial\ufficioso
12470unostentatious\senza esigenza 12469unostentatious\senza esigenza
12471unpaid\non pagato 12470unpaid\non pagato
12472unpalatably\cattiva 12471unpalatably\cattiva
12473unparallel\eccezzionale 12472unparallel\eccezzionale
12474unpassable\sconveniente 12473unpassable\sconveniente
12475unperceived\inosservato 12474unperceived\inosservato
12476unpitying\spietato 12475unpitying\spietato
12477unpleasant\laido, dispiacévole 12476unpleasant\laido, dispiacévole
12478unpleasantness\spiacevolezza 12477unpleasantness\spiacevolezza
12479unpleasing\dispiacévole 12478unpleasing\dispiacévole
12480unpredictable\imprevedibile 12479unpredictable\imprevedibile
12481unpremeditated\estemporàneo 12480unpremeditated\estemporàneo
12482unpretentious\senza esigenza 12481unpretentious\senza esigenza
12483unpreventable\inevitabile, estemporàneo 12482unpreventable\inevitabile, estemporàneo
12484unprimitive\colto 12483unprimitive\colto
12485unprincipled\incostante 12484unprincipled\incostante
12486unprofessional\incompetente 12485unprofessional\incompetente
12487unpromising\fallito 12486unpromising\fallito
12488unpromisingly\fallito 12487unpromisingly\fallito
12489unpropitious\sfavorevole 12488unpropitious\sfavorevole
12490unprotected\indifeso 12489unprotected\indifeso
12491unprotected game\libera cacciagione 12490unprotected game\libera cacciagione
12492unquestionable\indiscutibile 12491unquestionable\indiscutibile
12493unquiet\secondo 12492unquiet\secondo
12494unquietly\liuto 12493unquietly\liuto
12495unreachable\irraggiungibile 12494unreachable\irraggiungibile
12496unreadably\illeggìbile 12495unreadably\illeggìbile
12497unreal\fantomatico, spettrale 12496unreal\fantomatico, spettrale
12498unrealistic\irrealistico 12497unrealistic\irrealistico
12499unreasonable\irragionevole 12498unreasonable\irragionevole
12500unreasonableness\insensatezza 12499unreasonableness\insensatezza
12501unreckonable\imprevedibile 12500unreckonable\imprevedibile
12502unrecognized\non riconosciuto 12501unrecognized\non riconosciuto
12503unreflecting\sbadato 12502unreflecting\sbadato
12504unregulated\non regolato 12503unregulated\non regolato
12505unrelenting\inflessibile 12504unrelenting\inflessibile
12506unremitting\incessante 12505unremitting\incessante
12507unremorseful\spietato 12506unremorseful\spietato
12508unrepentant\impenitente 12507unrepentant\impenitente
12509unresting\incessante 12508unresting\incessante
12510unrestrained\sbrogliato 12509unrestrained\sbrogliato
12511unrestricted\illimitato 12510unrestricted\illimitato
12512unright\sleale 12511unright\sleale
12513unrighteous\abietto 12512unrighteous\abietto
12514unripe\acerbo 12513unripe\acerbo
12515unrude\educato 12514unrude\educato
12516unruffled\netto 12515unruffled\netto
12517unruly\disattento 12516unruly\disattento
12518unsalaried\non pagato 12517unsalaried\non pagato
12519unsatisfied\insoddisfatto 12518unsatisfied\insoddisfatto
12520unschooled\incolto 12519unschooled\incolto
12521unscrew\avvitare 12520unscrew\avvitare
12522unscrupulous\senza scrupoli, scoscenziato 12521unscrupulous\senza scrupoli, scoscenziato
12523unseat\esonerare 12522unseat\esonerare
12524unseeable\invisibile 12523unseeable\invisibile
12525unseeing\cieco 12524unseeing\cieco
12526unselfish\altruista 12525unselfish\altruista
12527unselfishness\altruismo 12526unselfishness\altruismo
12528unsettle\inquietare 12527unsettle\inquietare
12529unsettles\inquieto 12528unsettles\inquieto
12530unsettling\inquietante 12529unsettling\inquietante
12531unshackle\esimere 12530unshackle\esimere
12532unshackles\liberato 12531unshackles\liberato
12533unshackling\liberante 12532unshackling\liberante
12534unshapely\deforme 12533unshapely\deforme
12535unsheltered\senza tetto 12534unsheltered\senza tetto
12536unshrinking\intrepido 12535unshrinking\intrepido
12537unskimmed milk\latte integrale 12536unskimmed milk\latte integrale
12538unsmiling\grave 12537unsmiling\grave
12539unsoiled\lindo 12538unsoiled\lindo
12540unsolicited\non richiesto 12539unsolicited\non richiesto
12541unsolicitous\volontario 12540unsolicitous\volontario
12542unsophisticatedly\ingenua 12541unsophisticatedly\ingenua
12543unsounded\fasullo 12542unsounded\fasullo
12544unstable\labile, volubile 12543unstable\labile, volubile
12545unstableness\incertezza 12544unstableness\incertezza
12546unstably\malsicuro 12545unstably\malsicuro
12547unsteadily\malfermo 12546unsteadily\malfermo
12548unsteadiness\incertezza 12547unsteadiness\incertezza
12549unsteady\volubile 12548unsteady\volubile
12550unstopping\aprente 12549unstopping\aprente
12551unstudied\natura secondo 12550unstudied\natura secondo
12552unsubstantiated\infondato 12551unsubstantiated\infondato
12553unsubtle\rozzo, zotico 12552unsubtle\rozzo, zotico
12554unsuitable\disadatto 12553unsuitable\disadatto
12555unsuited\disadatto 12554unsuited\disadatto
12556unsure\malsicuro 12555unsure\malsicuro
12557unsureness\incertezza 12556unsureness\incertezza
12558unsurpassed\insuperato 12557unsurpassed\insuperato
12559unsympathetic\antipàtico 12558unsympathetic\antipàtico
12560untainted\senza macchia 12559untainted\senza macchia
12561untarnished\immacolato 12560untarnished\immacolato
12562unthankful\ingrato 12561unthankful\ingrato
12563unthankfulness\ingratitudine 12562unthankfulness\ingratitudine
12564unthinkable\impensabile 12563unthinkable\impensabile
12565unthought\sconsiderato 12564unthought\sconsiderato
12566untimeliness\tempo inopportuno 12565untimeliness\tempo inopportuno
12567untimely\prematuro 12566untimely\prematuro
12568untirable\instancabile 12567untirable\instancabile
12569unto\a tavola 12568unto\a tavola
12570untrapped\esente 12569untrapped\esente
12571untried\intentato 12570untried\intentato
12572untroubled\indisturbato 12571untroubled\indisturbato
12573untruth\menzogna 12572untruth\menzogna
12574untwine\lievitazione 12573untwine\lievitazione
12575unusable\inservibile 12574unusable\inservibile
12576unusual\strano, inconsueto 12575unusual\strano, inconsueto
12577unusually\raro 12576unusually\raro
12578unusualness\stranezza 12577unusualness\stranezza
12579unutterable\indicibile 12578unutterable\indicibile
12580unvaried\immutato 12579unvaried\immutato
12581unveil\svelare 12580unveil\svelare
12582unveiling\svelante 12581unveiling\svelante
12583unventilated\muffaticcio 12582unventilated\muffaticcio
12584unversed\novizio 12583unversed\novizio
12585unwarily\incauto 12584unwarily\incauto
12586unwarped\spassionato 12585unwarped\spassionato
12587unwarranted\non autorizzato 12586unwarranted\non autorizzato
12588unwary\incauto 12587unwary\incauto
12589unwavering\incrollabile 12588unwavering\incrollabile
12590unwearable\intollerabile 12589unwearable\intollerabile
12591unweary\instancabile 12590unweary\instancabile
12592unwed\nubile 12591unwed\nubile
12593unwell\indisposto 12592unwell\indisposto
12594unwillingly\malvolentieri 12593unwillingly\malvolentieri
12595unwillingness\disgusto 12594unwillingness\disgusto
12596unwind\dipanare 12595unwind\dipanare
12597unwinds\rilassato 12596unwinds\rilassato
12598unwise\imprudente 12597unwise\imprudente
12599unwitting\senza volere 12598unwitting\senza volere
12600unwontedly\inconsueto 12599unwontedly\inconsueto
12601unworried\spensierato 12600unworried\spensierato
12602unworthy\indegno 12601unworthy\indegno
12603unwounded\illeso 12602unwounded\illeso
12604unwrought\grezzo 12603unwrought\grezzo
12605up\sù, a, sù, sù 12604up\sù, a, sù, sù
12606up above\sù 12605up above\sù
12607up there\lassù 12606up there\lassù
12608upbraiding\rimprovero 12607upbraiding\rimprovero
12609upbringing\creanza 12608upbringing\creanza
12610upchuck\vòmito 12609upchuck\vòmito
12611upcoming\prossimamente 12610upcoming\prossimamente
12612upgrade\estensione, ampliare 12611upgrade\estensione, ampliare
12613upgrades\trasportato 12612upgrades\trasportato
12614upgrading\estensione 12613upgrading\estensione
12615upheaval\elevamento 12614upheaval\elevamento
12616uphold\durare 12615uphold\durare
12617upholster\imbottire 12616upholster\imbottire
12618upholsterer\tappezziere 12617upholsterer\tappezziere
12619upkeep\manutenzione 12618upkeep\manutenzione
12620uplift\esaltare 12619uplift\esaltare
12621uplifting\alzante 12620uplifting\alzante
12622upon\a 12621upon\a
12623upper arm\braccio superiore 12622upper arm\braccio superiore
12624upper case character\lettera maiuscola 12623upper case character\lettera maiuscola
12625uppish\impettito 12624uppish\impettito
12626uppity\baldanzoso 12625uppity\baldanzoso
12627upraise\esaltare 12626upraise\esaltare
12628upraising\alzante 12627upraising\alzante
12629upright\pari, verticale 12628upright\pari, verticale
12630uprise\levarsi 12629uprise\levarsi
12631uproar\eccitazione 12630uproar\eccitazione
12632uproariously\liuto 12631uproariously\liuto
12633upshot\risultato 12632upshot\risultato
12634upstage\arrivista 12633upstage\arrivista
12635upstairs\in alto, sù 12634upstairs\in alto, sù
12636upturn\incremento 12635upturn\incremento
12637upwards\sù 12636upwards\sù
12638uranium\uranio 12637uranium\uranio
12639urban\urbano 12638urban\urbano
12640urge\premura, incoraggiare 12639urge\premura, incoraggiare
12641urgency\urgenza 12640urgency\urgenza
12642urgent\urgente, legante 12641urgent\urgente, legante
12643urine\orina, uroscopia 12642urine\orina, uroscopia
12644urn\urna 12643urn\urna
12645us\noi, a noi 12644us\noi, a noi
12646usable\usabile 12645usable\usabile
12647usage\uso 12646usage\uso
12648use\uso, adoperare 12647use\uso, adoperare
12649use up\esaurire 12648use up\esaurire
12650used\usato 12649used\usato
12651useful\utile 12650useful\utile
12652usefull\utile
12653useless\inutile, disùtile, inservibile 12651useless\inutile, disùtile, inservibile
12654user\utente 12652user\utente
12655uses\usato 12653uses\usato
12656usual\usuale, ordinario 12654usual\usuale, ordinario
12657usually\ordinario 12655usually\ordinario
12658usuries\usura 12656usuries\usura
12659usury\usura 12657usury\usura
12660Utopian\utopico 12658Utopian\utopico
12661utter\estrinsecare 12659utter\estrinsecare
12662vacant\vacante 12660vacant\vacante
12663vacation\vacanze, ferie 12661vacation\vacanze, ferie
12664vaccinate\vaccinare 12662vaccinate\vaccinare
12665vaccination\vaccinazione 12663vaccination\vaccinazione
12666vaccine\vaccino 12664vaccine\vaccino
12667vacuum\vuotaggine 12665vacuum\vuotaggine
12668vacuum cleaner\aspirapòlvere 12666vacuum cleaner\aspirapòlvere
12669vagabond\vagabondaggio 12667vagabond\vagabondaggio
12670vagina\fòdero 12668vagina\fòdero
12671vailable\disponìbile 12669vailable\disponìbile
12672vain\vano 12670vain\vano
12673valerian\valeriana 12671valerian\valeriana
12674valid\valevole 12672valid\valevole
12675validity\validità 12673validity\validità
12676validness\validità 12674validness\validità
12677valley\valle 12675valley\valle
12678valorize\valorizzare 12676valorize\valorizzare
12679valse\valzer 12677valse\valzer
12680valuable\pregiato 12678valuable\pregiato
12681valuables\valori 12679valuables\valori
12682value\valutare, valore 12680value\valutare, valore
12683valuejudgment\valutazione 12681valuejudgment\valutazione
12684valve\valvola, valvola 12682valve\valvola, valvola
12685vanguard\avanguardia 12683vanguard\avanguardia
12686vanilla\vainiglia 12684vanilla\vainiglia
12687vanish\scomparire 12685vanish\scomparire
12688vanity\fatuità 12686vanity\fatuità
12689vaporizer\vaporizzatore 12687vaporizer\vaporizzatore
12690vapors\evaporazione 12688vapors\evaporazione
12691vapour\vapore 12689vapour\vapore
12692variable\variàbile 12690variable\variàbile
12693variance\contrarietà 12691variance\contrarietà
12694variation\aberrazione 12692variation\aberrazione
12695varicosity\varice 12693varicosity\varice
12696various\differente 12694various\differente
12697variousness\varietà 12695variousness\varietà
12698varnish\vernice 12696varnish\vernice
12699vary\variare 12697vary\variare
12700vascular\recipiente 12698vascular\recipiente
12701vase\vaso, vaso da fiori 12699vase\vaso, vaso da fiori
12702vast\vasto 12700vast\vasto
12703vault\volta 12701vault\volta
12704vaulted\volta 12702vaulted\volta
12705veal\carne di vitello 12703veal\carne di vitello
12706veda\sapere 12704veda\sapere
12707vegetable\pianta 12705vegetable\pianta
12708vegetable soup\zuppa di verdura 12706vegetable soup\zuppa di verdura
12709vegetables\legume 12707vegetables\legume
12710vegetatively\vegetativo 12708vegetatively\vegetativo
12711vehicle\carro, veicolo 12709vehicle\carro, veicolo
12712veil\veletta 12710veil\veletta
12713vein\vena, vena 12711vein\vena, vena
12714veined\venato 12712veined\venato
12715velocity\velocità 12713velocity\velocità
12716velvet\velluto 12714velvet\velluto
12717vending machine\autòma 12715vending machine\autòma
12718vendue\licitazione 12716vendue\licitazione
12719vengeance\vendetta 12717vengeance\vendetta
12720vengeful\vendicativo 12718vengeful\vendicativo
12721venom\veleno 12719venom\veleno
12722ventilate\ventilare, arieggiare, aerare 12720ventilate\ventilare, arieggiare, aerare
12723ventilating\ventilazione 12721ventilating\ventilazione
12724venturous\rischioso 12722venturous\rischioso
12725veraciousness\veridicità 12723veraciousness\veridicità
12726verbal\orale 12724verbal\orale
12727verdict\giudizio 12725verdict\giudizio
12728verifield\giustezza 12726verifield\giustezza
12729verify\verificare, esaminare 12727verify\verificare, esaminare
12730verity\verità 12728verity\verità
12731vermicide\vermifugo 12729vermicide\vermifugo
12732vermilion\cinabro 12730vermilion\cinabro
12733verminous\impidocchiato 12731verminous\impidocchiato
12734versatile\multilaterale 12732versatile\multilaterale
12735version\versione, emissione 12733version\versione, emissione
12736vertical\verticale 12734vertical\verticale
12737vessel\recipiente, vascello 12735vessel\recipiente, vascello
12738vest\maglia 12736vest\maglia
12739vet\veterinario 12737vet\veterinario
12740vetoed\divieto 12738vetoed\divieto
12741vex\molestare 12739vex\molestare
12742vexation\rancore, nonostante 12740vexation\rancore, nonostante
12743via\sopra 12741via\sopra
12744viaduct\viadotto 12742viaduct\viadotto
12745viand\vettovaglia 12743viand\vettovaglia
12746vice\vizio 12744vice\vizio
12747vicious\vizioso 12745vicious\vizioso
12748victim\sacrificio 12746victim\sacrificio
12749victor\vincitore 12747victor\vincitore
12750victorious\vittorioso 12748victorious\vittorioso
12751victory\vincita 12749victory\vincita
12752victualer\fornitore 12750victualer\fornitore
12753victuals\commestìbili 12751victuals\commestìbili
12754videotaping\nota 12752videotaping\nota
12755vie\gareggiare 12753vie\gareggiare
12756viennese\viennese 12754viennese\viennese
12757view\parere, concezione, vista, veduta, visuale 12755view\parere, concezione, vista, veduta, visuale
12758viewer\negli, spettatore 12756viewer\negli, spettatore
12759viewpoint\belvedere 12757viewpoint\belvedere
12760views\vedute 12758views\vedute
12761vigorous\benportante, energico 12759vigorous\benportante, energico
12762vile\infame 12760vile\infame
12763villa\villa 12761villa\villa
12764village\villaggio 12762village\villaggio
12765villain\pezzente 12763villain\pezzente
12766vine\vite, vigna 12764vine\vite, vigna
12767vintage\annata 12765vintage\annata
12768vintner\vinaio 12766vintner\vinaio
12769violation\infrazione 12767violation\infrazione
12770violator\violatore 12768violator\violatore
12771violence\balìa 12769violence\balìa
12772violent\violento, veemente 12770violent\violento, veemente
12773violent temper\irascibilità 12771violent temper\irascibilità
12774violet\viola 12772violet\viola
12775violin\violino 12773violin\violino
12776viper\biscia 12774viper\biscia
12777viral\virus 12775viral\virus
12778virgin\intatto, nuovo di fabbrica 12776virgin\intatto, nuovo di fabbrica
12779virginity\verginità 12777virginity\verginità
12780viril\maschile 12778viril\maschile
12781virtual\virtuale 12779virtual\virtuale
12782virtue\virtù 12780virtue\virtù
12783virtuoso\campione 12781virtuoso\campione
12784virtuous\virtuoso 12782virtuous\virtuoso
12785virtuousness\virtù 12783virtuousness\virtù
12786visa\visto 12784visa\visto
12787visible\visibile 12785visible\visibile
12788visibleness\visibilità 12786visibleness\visibilità
12789visionary\visionario 12787visionary\visionario
12790visit\ispezionare, visitare, visita, vìsita 12788visit\ispezionare, visitare, visita, vìsita
12791visitor\visitatore 12789visitor\visitatore
12792visors\ombrelli 12790visors\ombrelli
12793vital\importante 12791vital\importante
12794vitality\vitalità 12792vitality\vitalità
12795vitamin\vitamina 12793vitamin\vitamina
12796vitiation\depravazione 12794vitiation\depravazione
12797viticulture\enofilo 12795viticulture\enofilo
12798vituperation\vituperio 12796vituperation\vituperio
12799vividly\chiara 12797vividly\chiara
12800vocabulary\dizionario 12798vocabulary\dizionario
12801vocalists\cantante 12799vocalists\cantante
12802vocation\appello 12800vocation\appello
12803vocational\per lavoro 12801vocational\per lavoro
12804vodka\vodka 12802vodka\vodka
12805voice\voce 12803voice\voce
12806voiceclerk\fatturista 12804voiceclerk\fatturista
12807void\vuotaggine 12805void\vuotaggine
12808volcano\vulano 12806volcano\vulano
12809volitive\essere disposto 12807volitive\essere disposto
12810voltage\voltaggio 12808voltage\voltaggio
12811volume\volume, volume 12809volume\volume, volume
12812voluntary\volontario 12810voluntary\volontario
12813volunteer\volontario, volontario 12811volunteer\volontario, volontario
12814volution\voluta 12812volution\voluta
12815vomit\vòmito 12813vomit\vòmito
12816voracious\vorace, àvido 12814voracious\vorace, àvido
12817vote\voce, eleggere, votazione, votare, elezione 12815vote\voce, eleggere, votazione, votare, elezione
12818vouch\obbligarsi 12816vouch\obbligarsi
12819voucher\biglietto di garanzia 12817voucher\biglietto di garanzia
12820vulcanize\vulcanizzare 12818vulcanize\vulcanizzare
12821vulnerability\vulnerabilità 12819vulnerability\vulnerabilità
12822vulnerable\vulnerabile 12820vulnerable\vulnerabile
12823vulture\avvoltoio 12821vulture\avvoltoio
12824wadding\incluso 12822wadding\incluso
12825wade\sguazzare 12823wade\sguazzare
12826wads\fardello 12824wads\fardello
12827wage\stipendio 12825wage\stipendio
12828wages\stipendio 12826wages\stipendio
12829waist\vita 12827waist\vita
12830waistband\lega 12828waistband\lega
12831waiter\cameriere 12829waiter\cameriere
12832wake\destare 12830wake\destare
12833wake up\svegliarsi 12831wake up\svegliarsi
12834walk\camminare, corro, giro 12832walk\camminare, corro, giro
12835walked\andai 12833walked\andai
12836wall\parete, muro 12834wall\parete, muro
12837wallet\portamonete 12835wallet\portamonete
12838wallpaper\tappezzeria 12836wallpaper\tappezzeria
12839walnut-tree\noce 12837walnut-tree\noce
12840waltz\valzer 12838waltz\valzer
12841want\vuole, volere 12839want\vuole, volere
12842wants\desiderare 12840wants\desiderare
12843war\guerra, guerre 12841war\guerra, guerre
12844wardens\guardiana 12842wardens\guardiana
12845wardrobe\vestiario 12843wardrobe\vestiario
12846warehouse\campeggio 12844warehouse\campeggio
12847warm up\riscaldare 12845warm up\riscaldare
12848warmth\calore 12846warmth\calore
12849warn\dissuadere 12847warn\dissuadere
12850warn out\stanco 12848warn out\stanco
12851warning\ammonizione 12849warning\ammonizione
12852warrant\mandato di cattura 12850warrant\mandato di cattura
12853warrantirs\facoltà 12851warrantirs\facoltà
12854warranty\garanzia 12852warranty\garanzia
12855warship\nave da guerra 12853warship\nave da guerra
12856was absent\mancai 12854was absent\mancai
12857was allowed\potei 12855was allowed\potei
12858was astonished\mi stupii 12856was astonished\mi stupii
12859was called\mi chiamavo 12857was called\mi chiamavo
12860was cold\gelai 12858was cold\gelai
12861was valid\valsi 12859was valid\valsi
12862wash\lavare 12860wash\lavare
12863washbasin\catinella 12861washbasin\catinella
12864washer\lavatore 12862washer\lavatore
12865washing\lavabiancheria 12863washing\lavabiancheria
12866washing machine\lavabiancheria 12864washing machine\lavabiancheria
12867wasp\vespa 12865wasp\vespa
12868waste\sperperare, eremo 12866waste\sperperare, eremo
12869waste of time\perdita di tempo 12867waste of time\perdita di tempo
12870waste water\acqua di scarico 12868waste water\acqua di scarico
12871wastes\sperperato 12869wastes\sperperato
12872watch\orologio, sorvegliare 12870watch\orologio, sorvegliare
12873watch dog\cane da guardia 12871watch dog\cane da guardia
12874watch television\televisione 12872watch television\televisione
12875watchdog\cane da guardia 12873watchdog\cane da guardia
12876watcher\guardia 12874watcher\guardia
12877watchful\vigile 12875watchful\vigile
12878watchfulness\vigilanza 12876watchfulness\vigilanza
12879watchmaker\orologiaio 12877watchmaker\orologiaio
12880water\diluviare, annaffiare, acqua, bagnare 12878water\diluviare, annaffiare, acqua, bagnare
12881water colour\acquerello 12879water colour\acquerello
12882water for rinsing\lavatura 12880water for rinsing\lavatura
12883water gun\autopompa 12881water gun\autopompa
12884water melon\anguria 12882water melon\anguria
12885water rat\lupo di mare 12883water rat\lupo di mare
12886water sports\sport acquatico 12884water sports\sport acquatico
12887watercolor\acquerello 12885watercolor\acquerello
12888waterfall\cascata 12886waterfall\cascata
12889watergate\cateratta 12887watergate\cateratta
12890watering can\annaffiatoio 12888watering can\annaffiatoio
12891watermark\filigrana 12889watermark\filigrana
12892watermarks\filigrana 12890watermarks\filigrana
12893watermelon\anguria 12891watermelon\anguria
12894waterproof\impermabile 12892waterproof\impermabile
12895watertight\impermabile 12893watertight\impermabile
12896watery\acquoso 12894watery\acquoso
12897wattle\ostacolo 12895wattle\ostacolo
12898watts\bassofondo 12896watts\bassofondo
12899wave\flutto, sventolare, soffiare, svolazzare, onda 12897wave\flutto, sventolare, soffiare, svolazzare, onda
12900wave about\brandire 12898wave about\brandire
12901wave to\accennare 12899wave to\accennare
12902wavelike\ondulatorio 12900wavelike\ondulatorio
12903waver\svolazzare, barcollare, ondeggiamento, vertere 12901waver\svolazzare, barcollare, ondeggiamento, vertere
12904wavered\oscillai 12902wavered\oscillai
12905wavering\vacilncnve 12903wavering\vacilncnve
12906wavers\oscilla 12904wavers\oscilla
12907wavily\ondulato 12905wavily\ondulato
12908wavy\ondulato 12906wavy\ondulato
12909wax\cera, créscere 12907wax\cera, créscere
12910wax candle\candela di cera 12908wax candle\candela di cera
12911wax figure\figura di cera 12909wax figure\figura di cera
12912waxwork\figura di cera 12910waxwork\figura di cera
12913waxy\cèreo 12911waxy\cèreo
12914way\cammino, strada, strada, direzione 12912way\cammino, strada, strada, direzione
12915way bill\lettera di porto 12913way bill\lettera di porto
12916way out\esito, passaggio 12914way out\esito, passaggio
12917wayfarer\viaggiatore 12915wayfarer\viaggiatore
12918waylay\appostare 12916waylay\appostare
12919wayward\bisbètico 12917wayward\bisbètico
12920waywardness\cocciutaggine 12918waywardness\cocciutaggine
12921WC\abbigliatura 12919WC\abbigliatura
12922we\noi altri, noi 12920we\noi altri, noi
12923weak\gràcile, debole, labkle 12921weak\gràcile, debole, labkle
12924weaken\indebolire, debilitare 12922weaken\indebolire, debilitare
12925weakening\indebolimento 12923weakening\indebolimento
12926weakling\codardo 12924weakling\codardo
12927weakly\gràcile 12925weakly\gràcile
12928weakness\mancare, debolezza, debolezza 12926weakness\mancare, debolezza, debolezza
12929weakness of character\debolezza di carattere 12927weakness of character\debolezza di carattere
12930weaknesses\indebolire 12928weaknesses\indebolire
12931wealth\opulenza 12929wealth\opulenza
12932wealthier\ricco 12930wealthier\ricco
12933wealthily\ricco 12931wealthily\ricco
12934wealthiness\opulenza 12932wealthiness\opulenza
12935wealthy\ricco, benestante, facoltoso 12933wealthy\ricco, benestante, facoltoso
12936wean\divezzare 12934wean\divezzare
12937weans\divezzo 12935weans\divezzo
12938weapon\armi, arma, arme 12936weapon\armi, arma, arme
12939weapond\armato 12937weapond\armato
12940weaponless\disarmato 12938weaponless\disarmato
12941weaponries\armi 12939weaponries\armi
12942weapons\nucleare 12940weapons\nucleare
12943wear\abbigliare 12941wear\abbigliare
12944wear and tear\logorio 12942wear and tear\logorio
12945wear out\logorare 12943wear out\logorare
12946wearer\vettore 12944wearer\vettore
12947weariness\sfinitezza 12945weariness\sfinitezza
12948wearout\logorio 12946wearout\logorio
12949weary\stracco 12947weary\stracco
12950weather chart\carta meteorologica 12948weather chart\carta meteorologica
12951weather forecast\bollettino meteorològico 12949weather forecast\bollettino meteorològico
12952weather observation\meteorologia 12950weather observation\meteorologia
12953weather vane\voltagabbana 12951weather vane\voltagabbana
12954weave\tessere 12952weave\tessere
12955weaver\tessitore 12953weaver\tessitore
12956weavers\tessitrice 12954weavers\tessitrice
12957wedding\nozze, sposalizio 12955wedding\nozze, sposalizio
12958wedding dress\abito da sposa 12956wedding dress\abito da sposa
12959wedding ring\anello matrimoniale 12957wedding ring\anello matrimoniale
12960wedge\mania, cùneo 12958wedge\mania, cùneo
12961wedge shaped\cuneiforme 12959wedge shaped\cuneiforme
12962wedges\cunei 12960wedges\cunei
12963Wednesday\mercoledí 12961Wednesday\mercoledí
12964wednesday\mercoledì 12962wednesday\mercoledì
12965wee\minuscolo 12963wee\minuscolo
12966weed\erbaccia 12964weed\erbaccia
12967weeding\sarchiare 12965weeding\sarchiare
12968week\settimana 12966week\settimana
12969weekend\fine settimana 12967weekend\fine settimana
12970weekly\ebdomadario, settimanalmente 12968weekly\ebdomadario, settimanalmente
12971weekly paper\ebdomadario 12969weekly paper\ebdomadario
12972weeks\settimane 12970weeks\settimane
12973ween\sperare 12971ween\sperare
12974weep\lacrimare 12972weep\lacrimare
12975weeps\piange, piansi 12973weeps\piange, piansi
12976weigh\pesare 12974weigh\pesare
12977weighable\pesabile 12975weighable\pesabile
12978weightily\pesante 12976weightily\pesante
12979weights\pesi 12977weights\pesi
12980weighty\pesante 12978weighty\pesante
12981welcome\salutare, gradito, desiderato, benvenuto 12979welcome\salutare, gradito, desiderato, benvenuto
12982weld\saldare 12980weld\saldare
12983welding\sudore, saldare 12981welding\sudore, saldare
12984welfare\benessere, assistenza pubblica 12982welfare\benessere, assistenza pubblica
12985well\bene, benessere, pozzo, sano, interamente, ebbene 12983well\bene, benessere, pozzo, sano, interamente, ebbene
12986well behaved\educato 12984well behaved\educato
12987well built\benfatto 12985well built\benfatto
12988well deserved\benemèrito 12986well deserved\benemèrito
12989well fed\ben nutrito 12987well fed\ben nutrito
12990well meant\con buone intenzioni 12988well meant\con buone intenzioni
12991well off\benestante 12989well off\benestante
12992well read\erudito 12990well read\erudito
12993well thought out\ponderato 12991well thought out\ponderato
12994well tried\esperimentato 12992well tried\esperimentato
12995well understood\beninteso 12993well understood\beninteso
12996well well\così così 12994well well\così così
12997wellfare\benessere 12995wellfare\benessere
12998welling\scaturente 12996welling\scaturente
12999wells\pozzo 12997wells\pozzo
13000welter weight\welter 12998welter weight\welter
13001welters\ondeggiamento 12999welters\ondeggiamento
13002wench\prostituta 13000wench\prostituta
13003wenches\fornicare 13001wenches\fornicare
13004wend\dirìgersi 13002wend\dirìgersi
13005went up\salii 13003went up\salii
13006wept\piansi 13004wept\piansi
13007were\sua 13005were\sua
13008werewolf\lupo mannaro 13006werewolf\lupo mannaro
13009west\ovest 13007west\ovest
13010West\ovest 13008West\ovest
13011western\occidentale 13009western\occidentale
13012westwards\verso ovest 13010westwards\verso ovest
13013wet\umido, inumidire, bagnato 13011wet\umido, inumidire, bagnato
13014wether\montone 13012wether\montone
13015wetly\bagnato 13013wetly\bagnato
13016wetness\fradicezza 13014wetness\fradicezza
13017whack\legnare 13015whack\legnare
13018whacked\picchiai 13016whacked\picchiai
13019whacking\convincente 13017whacking\convincente
13020whale\balena 13018whale\balena
13021whaler\baleniere 13019whaler\baleniere
13022whalers\baleniere 13020whalers\baleniere
13023wham\battuta 13021wham\battuta
13024whammy\assalto 13022whammy\assalto
13025whams\colpi 13023whams\colpi
13026wharf\molo 13024wharf\molo
13027what\che, che cosa 13025what\che, che cosa
13028whatever\checché 13026whatever\checché
13029wheat\frumento, grano 13027wheat\frumento, grano
13030wheel\ruota 13028wheel\ruota
13031wheel barrow\carriola 13029wheel barrow\carriola
13032wheel chair\sedia a rotelle 13030wheel chair\sedia a rotelle
13033wheel suspension\sospensione delle ruote 13031wheel suspension\sospensione delle ruote
13034wheelbarrows\carriola 13032wheelbarrows\carriola
13035wheelchair\sedia a rotelle 13033wheelchair\sedia a rotelle
13036wheeled\carreggiabile 13034wheeled\carreggiabile
13037wheeler\veicolo 13035wheeler\veicolo
13038wheels\arruotare, ruote 13036wheels\arruotare, ruote
13039wheeze\anelare 13037wheeze\anelare
13040wheezy\affannoso 13038wheezy\affannoso
13041whelp\cucciolo 13039whelp\cucciolo
13042when\laddove, appena che, quando, allorché 13040when\laddove, appena che, quando, allorché
13043whence\donde 13041whence\donde
13044whenever\ogni qual volta 13042whenever\ogni qual volta
13045whensoever\qualvolta 13043whensoever\qualvolta
13046where\ove, presso al quale, dove 13044where\ove, presso al quale, dove
13047whereabout\rimanenza, luogo di soggiorno 13045whereabout\rimanenza, luogo di soggiorno
13048whereas\presso al quale 13046whereas\presso al quale
13049whereby\per cui, presso al quale 13047whereby\per cui, presso al quale
13050wherefore\per quale scopo 13048wherefore\per quale scopo
13051wherefrom\donde 13049wherefrom\donde
13052whereof\a che cosa 13050whereof\a che cosa
13053whereon\onde 13051whereon\onde
13054wheresoever\dovunque 13052wheresoever\dovunque
13055whereto\ove 13053whereto\ove
13056wherry\yole 13054wherry\yole
13057whether\come se 13055whether\come se
13058whetstone\cote 13056whetstone\cote
13059whey\siero 13057whey\siero
13060which\che 13058which\che
13061whichever\che 13059whichever\che
13062whiffed\soffiai 13060whiffed\soffiai
13063whiffing\soffiante 13061whiffing\soffiante
13064whiffs\soffia 13062whiffs\soffia
13065while\finchè, laddove, durante, tratto di tempo 13063while\finchè, laddove, durante, tratto di tempo
13066whilst\laddove, durante 13064whilst\laddove, durante
13067whim\capriccio 13065whim\capriccio
13068whimper\mugolare 13066whimper\mugolare
13069whimsical\bizzaro 13067whimsical\bizzaro
13070whimsy\capriccio 13068whimsy\capriccio
13071whine\mugolare 13069whine\mugolare
13072whinny\nitrire 13070whinny\nitrire
13073whip\frusta 13071whip\frusta
13074whipped cream\panna montata 13072whipped cream\panna montata
13075whips\frustare 13073whips\frustare
13076whirlpool\vortice 13074whirlpool\vortice
13077whirlpools\vortice 13075whirlpools\vortice
13078whirlwind\turbine 13076whirlwind\turbine
13079whisper\sussurrare 13077whisper\sussurrare
13080whisper to\sussurrare 13078whisper to\sussurrare
13081whistle\fischio, fischietto, zufolare 13079whistle\fischio, fischietto, zufolare
13082whistled\fischio 13080whistled\fischio
13083whistles\zufolare, fischia 13081whistles\zufolare, fischia
13084whit\un pochino 13082whit\un pochino
13085white\bianco 13083white\bianco
13086white cabbage\cavolo bianco 13084white cabbage\cavolo bianco
13087white haired\canuto 13085white haired\canuto
13088white hot\incandescente 13086white hot\incandescente
13089white wine\vernaccia 13087white wine\vernaccia
13090whitely\biancastro 13088whitely\biancastro
13091whiteness\bianca 13089whiteness\bianca
13092whiter\uomo bianco 13090whiter\uomo bianco
13093whites\sai 13091whites\sai
13094whitethorn\biancospino 13092whitethorn\biancospino
13095whitish\biancastro 13093whitish\biancastro
13096whitlow\circolazione 13094whitlow\circolazione
13097Whitsun\pentecoste 13095Whitsun\pentecoste
13098whitsuntide\pentecoste 13096whitsuntide\pentecoste
13099whittle\intagliare 13097whittle\intagliare
13100whiz\grillare 13098whiz\grillare
13101who\che, chi 13099who\che, chi
13102whoever\chiunque 13100whoever\chiunque
13103whole\tutta 13101whole\tutta
13104wholehearted\serio 13102wholehearted\serio
13105wholeness\interezza 13103wholeness\interezza
13106wholesale dealer\grossista 13104wholesale dealer\grossista
13107wholesaler\grossista 13105wholesaler\grossista
13108wholesome\sano 13106wholesome\sano
13109wholesomely\sana 13107wholesomely\sana
13110wholly\interamente 13108wholly\interamente
13111whom\chi 13109whom\chi
13112whooping cough\tosse canina 13110whooping cough\tosse canina
13113whoopingcough\tosse canina 13111whoopingcough\tosse canina
13114whopping\colossale 13112whopping\colossale
13115whore\prostituta 13113whore\prostituta
13116whores\fornicare 13114whores\fornicare
13117whorl\voluta 13115whorl\voluta
13118whose\di questo, di che 13116whose\di questo, di che
13119whoseever\che 13117whoseever\che
13120why\per quale ragione 13118why\per quale ragione
13121wick\stoppino 13119wick\stoppino
13122wicked\malizioso, cattivo 13120wicked\malizioso, cattivo
13123wickedness\nequizia 13121wickedness\nequizia
13124wide\largo, vasto, latitudine 13122wide\largo, vasto, latitudine
13125widely\vasto 13123widely\vasto
13126widely ramified\molto ramificato 13124widely ramified\molto ramificato
13127wideness\vastità 13125wideness\vastità
13128widespread\molto diffuso 13126widespread\molto diffuso
13129widget\fatto giuochi di prestigio 13127widget\fatto giuochi di prestigio
13130widow\védova 13128widow\védova
13131widowed\védovo 13129widowed\védovo
13132widower\védovo 13130widower\védovo
13133width\latitudine, vastità 13131width\latitudine, vastità
13134wielding\esercente 13132wielding\esercente
13135wife\moglie, femmina, signora 13133wife\moglie, femmina, signora
13136wig\parrucca 13134wig\parrucca
13137wihtout\senza 13135wihtout\senza
13138wild\licenzioso 13136wild\licenzioso
13139wild boar\verro 13137wild boar\verro
13140wilderness\luogo selvaggio 13138wilderness\luogo selvaggio
13141wilful\intenzionale 13139wilful\intenzionale
13142will\volli, favore, testamento, volere, diventa 13140will\volli, favore, testamento, volere, diventa
13143will less\abulico 13141will less\abulico
13144will power\volitivo 13142will power\volitivo
13145willed\voglioso 13143willed\voglioso
13146willful\intenzionale 13144willful\intenzionale
13147willing\disposto, volonteroso, essere disposto, vuole 13145willing\disposto, volonteroso, essere disposto, vuole
13148willingly\volontieri, volontiere 13146willingly\volontieri, volontiere
13149willow\salcio 13147willow\salcio
13150wimble\trapano 13148wimble\trapano
13151win\guadagnare, vincere 13149win\guadagnare, vincere
13152wind\avvoltare, avvolgere, soffiare, vento 13150wind\avvoltare, avvolgere, soffiare, vento
13153wind force\velocità del vento 13151wind force\velocità del vento
13154wind gauge\anemometro 13152wind gauge\anemometro
13155wind mill\mulino a vento 13153wind mill\mulino a vento
13156wind tunnel\canale aerodinamico 13154wind tunnel\canale aerodinamico
13157wind up\avvoltare 13155wind up\avvoltare
13158windcheater\giacca a vento 13156windcheater\giacca a vento
13159window\fetta, finestra, finestrino, oblo 13157window\fetta, finestra, finestrino, oblo
13160window pane\lastra 13158window pane\lastra
13161window seat\posto alla finestra 13159window seat\posto alla finestra
13162window sill\davanzale 13160window sill\davanzale
13163windows\finestrino 13161windows\finestrino
13164windscreen\parabrezzo 13162windscreen\parabrezzo
13165windshield\parabrezzo 13163windshield\parabrezzo
13166windy\ventoso 13164windy\ventoso
13167wine\vino 13165wine\vino
13168wine cask\botte di vino 13166wine cask\botte di vino
13169wine cellars\casa vinicola 13167wine cellars\casa vinicola
13170wine glas\bicchiere da vino 13168wine glas\bicchiere da vino
13171wine growing\enofilo 13169wine growing\enofilo
13172wine list\lista dei vini 13170wine list\lista dei vini
13173wine merchant\vinaio 13171wine merchant\vinaio
13174wine store\bottiglierìa 13172wine store\bottiglierìa
13175wine tavern\fiaschetteria 13173wine tavern\fiaschetteria
13176winegrower\viticoltore 13174winegrower\viticoltore
13177wines\vini 13175wines\vini
13178wing of a door\battente 13176wing of a door\battente
13179winner\vincitore 13177winner\vincitore
13180winning\vittorioso 13178winning\vittorioso
13181wins\vince 13179wins\vince
13182winter\verno 13180winter\verno
13183winter sleep\letargo 13181winter sleep\letargo
13184winter sports\sport invernale 13182winter sports\sport invernale
13185winterly\invernale 13183winterly\invernale
13186wintertime\verno 13184wintertime\verno
13187wipes out\estingue 13185wipes out\estingue
13188wire\cavo, fil di ferro 13186wire\cavo, fil di ferro
13189wire brush\spazzola metallica 13187wire brush\spazzola metallica
13190wire fencing\traliccio 13188wire fencing\traliccio
13191wires\fili 13189wires\fili
13192wisdom\saggezza, saggezza, freccia 13190wisdom\saggezza, saggezza, freccia
13193wisdom tooth\dente del giudizio 13191wisdom tooth\dente del giudizio
13194wise\saggio, ragionevole 13192wise\saggio, ragionevole
13195wiseacre\saputello 13193wiseacre\saputello
13196wish\voto 13194wish\voto
13197wished\desiderato 13195wished\desiderato
13198wishes\desidero 13196wishes\desidero
13199wishing\volitivo 13197wishing\volitivo
13200wisp\strofinaccio 13198wisp\strofinaccio
13201wistful\malinconico 13199wistful\malinconico
13202wistfully\malinconico 13200wistfully\malinconico
13203wit\giudizio 13201wit\giudizio
13204witch\maga, fattucchiera 13202witch\maga, fattucchiera
13205witchcraft\stregoneria 13203witchcraft\stregoneria
13206witcheries\forza magica 13204witcheries\forza magica
13207witches\stregare 13205witches\stregare
13208with\con 13206with\con
13209with it\onde 13207with it\onde
13210with pleasure\volontiere 13208with pleasure\volontiere
13211with what\con che cosa 13209with what\con che cosa
13212withal\presso 13210withal\presso
13213withdraw\levare 13211withdraw\levare
13214withdrawn\ritirato 13212withdrawn\ritirato
13215wither\appassire, sfiorire 13213wither\appassire, sfiorire
13216withers\sfiorito 13214withers\sfiorito
13217withhold\ritenere 13215withhold\ritenere
13218within\dentro, frà 13216within\dentro, frà
13219within the company\aziendale 13217within the company\aziendale
13220without\senza 13218without\senza
13221without contradiction\non contradditorio 13219without contradiction\non contradditorio
13222without engagement\non impegnativo 13220without engagement\non impegnativo
13223without exception\senza eccezione 13221without exception\senza eccezione
13224without fail\immancabile 13222without fail\immancabile
13225without holding on\a mano libera 13223without holding on\a mano libera
13226without notice\senza avviso 13224without notice\senza avviso
13227without permission\non permesso 13225without permission\non permesso
13228without result\senza esito 13226without result\senza esito
13229without using cash\senza denaro in contanti 13227without using cash\senza denaro in contanti
13230witness\testimonio 13228witness\testimonio
13231witnesses\testimoniare 13229witnesses\testimoniare
13232witnessing\testimoniante 13230witnessing\testimoniante
13233wits\giudizio 13231wits\giudizio
13234witted\sensato 13232witted\sensato
13235witticism\lazzo 13233witticism\lazzo
13236wittily\faceto 13234wittily\faceto
13237wizard\fattucchiera 13235wizard\fattucchiera
13238wobbliness\incertezza 13236wobbliness\incertezza
13239wobbly\malfermo 13237wobbly\malfermo
13240woes\soffrire 13238woes\soffrire
13241woken\svegliato 13239woken\svegliato
13242wolf\lupo 13240wolf\lupo
13243wolfish\lupino 13241wolfish\lupino
13244wolfish appetite\fame da lupo 13242wolfish appetite\fame da lupo
13245wolves\lupi 13243wolves\lupi
13246woman\donna, signora, morta 13244woman\donna, signora, morta
13247woman hairdresser\parrucchiera 13245woman hairdresser\parrucchiera
13248womanliness\femminilità 13246womanliness\femminilità
13249women\donne 13247women\donne
13250women folk\donne 13248women folk\donne
13251womenfolk\donne 13249womenfolk\donne
13252won\vinsi, vinto 13250won\vinsi, vinto
13253wonder\miracolo, stupore, chièdere 13251wonder\miracolo, stupore, chièdere
13254wonder of the world\prodigio 13252wonder of the world\prodigio
13255wondered\sorpreso 13253wondered\sorpreso
13256wonderful\favolosamente, grandioso, magnifico 13254wonderful\favolosamente, grandioso, magnifico
13257wonderfulness\splendore 13255wonderfulness\splendore
13258wondering\stupefatto 13256wondering\stupefatto
13259wonderingly\attònito 13257wonderingly\attònito
13260wonderment\stupore 13258wonderment\stupore
13261wondrous\meraviglioso 13259wondrous\meraviglioso
13262wondrousness\stupirsi 13260wondrousness\stupirsi
13263woo\arruolare 13261woo\arruolare
13264wood\legno, selva, boschetto, legna 13262wood\legno, selva, boschetto, legna
13265wood grouse\urogallo 13263wood grouse\urogallo
13266woodpecker\picchio 13264woodpecker\picchio
13267woods\bosco, selve 13265woods\bosco, selve
13268woodsman\guardiaboschi 13266woodsman\guardiaboschi
13269woodstrawberry\fragola dei boschi 13267woodstrawberry\fragola dei boschi
13270woodworker\legnaiolo 13268woodworker\legnaiolo
13271woody\legnoso 13269woody\legnoso
13272wool\lana 13270wool\lana
13273wool spinning mill\lanificio 13271wool spinning mill\lanificio
13274woollen\volere, laneria 13272woollen\volere, laneria
13275woolly\lanuto 13273woolly\lanuto
13276wools\lana 13274wools\lana
13277woozily\farraginoso 13275woozily\farraginoso
13278word\formulare, parola, vocàbolo 13276word\formulare, parola, vocàbolo
13279wording\lettera 13277wording\lettera
13280wordlessness\mutezza 13278wordlessness\mutezza
13281words\parole 13279words\parole
13282wore\portai 13280wore\portai
13283work\lavorare, funzionare, lavorare, opera, occupazione 13281work\lavorare, funzionare, lavorare, opera, occupazione
13284work in a factory\lavoro in fabbrica 13282work in a factory\lavoro in fabbrica
13285work out\calcolare 13283work out\calcolare
13286worked up\irritato, nervoso, emozionato 13284worked up\irritato, nervoso, emozionato
13287working hours\orario di lavoro 13285working hours\orario di lavoro
13288working time\orario di lavoro 13286working time\orario di lavoro
13289workman\artéfice 13287workman\artéfice
13290workmanship\equipaggio 13288workmanship\equipaggio
13291works council\consiglio aziendale 13289works council\consiglio aziendale
13292workshop\corso avanzato, officina 13290workshop\corso avanzato, officina
13293workshops\officine 13291workshops\officine
13294world\mondo 13292world\mondo
13295world domination\dominio del mondo 13293world domination\dominio del mondo
13296world economy\economia mondiale 13294world economy\economia mondiale
13297world history\storia universale 13295world history\storia universale
13298world outlook\concezione del mondo 13296world outlook\concezione del mondo
13299world record\primato mondiale 13297world record\primato mondiale
13300world war\guerra mondiale 13298world war\guerra mondiale
13301worldliness\mondanità 13299worldliness\mondanità
13302worldly\laico 13300worldly\laico
13303worldly innocent\estraneo al mondo 13301worldly innocent\estraneo al mondo
13304worm\baco, verme 13302worm\baco, verme
13305wormwood\vermut 13303wormwood\vermut
13306worn\portato 13304worn\portato
13307worn out\liso 13305worn out\liso
13308worried\pieno di timore, affannoso 13306worried\pieno di timore, affannoso
13309worries\stare in pensiero 13307worries\stare in pensiero
13310worriment\seccatura 13308worriment\seccatura
13311worrisome\noioso 13309worrisome\noioso
13312worry\fastidio, stare in pensiero, disturba, arrabiare 13310worry\fastidio, stare in pensiero, disturba, arrabiare
13313worryingly\inquietante 13311worryingly\inquietante
13314worse\più cattivo, peggiore 13312worse\più cattivo, peggiore
13315worship\venerare, adorare, venerazione 13313worship\venerare, adorare, venerazione
13316worshiper\veneratore 13314worshiper\veneratore
13317worships\venerato 13315worships\venerato
13318worst\cattivissima 13316worst\cattivissima
13319worth\valore 13317worth\valore
13320worth seeing\da vedere 13318worth seeing\da vedere
13321worthily\equo 13319worthily\equo
13322worthiness\valore 13320worthiness\valore
13323worthless\senza valore 13321worthless\senza valore
13324worthwhile\redditizio 13322worthwhile\redditizio
13325worthy\meritevole 13323worthy\meritevole
13326would\volei, decoro 13324would\volei, decoro
13327would like\vuole 13325would like\vuole
13328would like to\vuole 13326would like to\vuole
13329wound\fegriva, ferire 13327wound\fegriva, ferire
13330woven\tessuto 13328woven\tessuto
13331wow\successone 13329wow\successone
13332wraith\fantasma 13330wraith\fantasma
13333wraiths\lemuri 13331wraiths\lemuri
13334wrangle\questione 13332wrangle\questione
13335wrangled\litigai 13333wrangled\litigai
13336wrangles\litiga 13334wrangles\litiga
13337wrap\infagottare, involgere, avvolgere, avvòlgere 13335wrap\infagottare, involgere, avvolgere, avvòlgere
13338wrap up\avvòlgere 13336wrap up\avvòlgere
13339wrapper\involucro 13337wrapper\involucro
13340wrappers\involgere 13338wrappers\involgere
13341wrath\furia 13339wrath\furia
13342wrathful\adirato 13340wrathful\adirato
13343wreak\spingere 13341wreak\spingere
13344wreaks\esercita 13342wreaks\esercita
13345wreath\ghirlanda 13343wreath\ghirlanda
13346wreck\naufragio, disfare, guaio 13344wreck\naufragio, disfare, guaio
13347wrecked\distrussi 13345wrecked\distrussi
13348wrecking service\servizio recupero automezzi 13346wrecking service\servizio recupero automezzi
13349wrecks\distrutto, sporcato 13347wrecks\distrutto, sporcato
13350wren\scricciolo 13348wren\scricciolo
13351wrench\chiave 13349wrench\chiave
13352wrest\arraffare 13350wrest\arraffare
13353wrestle\lottare 13351wrestle\lottare
13354wrestled\rango 13352wrestled\rango
13355wrestler\lottatore, lottatore 13353wrestler\lottatore, lottatore
13356wretchedness\miserabile 13354wretchedness\miserabile
13357wrinkle\trucco, grinza, suggerimento, pizzicotto 13355wrinkle\trucco, grinza, suggerimento, pizzicotto
13358wrinkled\increspato 13356wrinkled\increspato
13359wrinkles\corrugare 13357wrinkles\corrugare
13360wrist\polso 13358wrist\polso
13361wristband\braccialetto 13359wristband\braccialetto
13362writ\documento 13360writ\documento
13363writ of execution\esecutorio 13361writ of execution\esecutorio
13364write\vergare, scrivere 13362write\vergare, scrivere
13365write down\appuntare 13363write down\appuntare
13366write error\errore ortografico 13364write error\errore ortografico
13367write fault error\errore ortografico 13365write fault error\errore ortografico
13368write out\appuntare, emettere 13366write out\appuntare, emettere
13369write poetry\comporre versi 13367write poetry\comporre versi
13370writer\quattrocentista, autore 13368writer\quattrocentista, autore
13371writes\scrive 13369writes\scrive
13372writing\vergare, scrittura 13370writing\vergare, scrittura
13373writing paper\carta da scrivere 13371writing paper\carta da scrivere
13374written\scritto 13372written\scritto
13375wrong\fasullo, inverso, non giusto, colpevole 13373wrong\fasullo, inverso, non giusto, colpevole
13376wrong conclusion\argomentazione sbagliata 13374wrong conclusion\argomentazione sbagliata
13377wrongdoer\malfattore 13375wrongdoer\malfattore
13378wrongly\erroneamente 13376wrongly\erroneamente
13379wrongous\illegale 13377wrongous\illegale
13380wrongously\illegale 13378wrongously\illegale
13381wrote\scrivei 13379wrote\scrivei
13382wrought\lavorato 13380wrought\lavorato
13383wroughtiron\ferro battuto 13381wroughtiron\ferro battuto
13384wry\obliquo 13382wry\obliquo
13385wryly\storto 13383wryly\storto
13386wryness\obliqua 13384wryness\obliqua
13387xenophobia\xenofobia 13385xenophobia\xenofobia
13388xenophobic\xenofobo 13386xenophobic\xenofobo
13389yacht\yacht 13387yacht\yacht
13390yachting\velismo 13388yachting\velismo
13391yachtsman\veliero 13389yachtsman\veliero
13392yachtswoman\veleggiatrice 13390yachtswoman\veleggiatrice
13393yahoo\mascalzone 13391yahoo\mascalzone
13394yank\estrarre 13392yank\estrarre
13395yankeedoodle\canto popolare 13393yankeedoodle\canto popolare
13396yap\muso 13394yap\muso
13397yaps\bocche 13395yaps\bocche
13398yard\ulna, cortile 13396yard\ulna, cortile
13399yards\cortili 13397yards\cortili
13400yardstick\criterio 13398yardstick\criterio
13401yarn\filo 13399yarn\filo
13402yarns\fili 13400yarns\fili
13403yarrow\achillea 13401yarrow\achillea
13404yawn\sbadigliare 13402yawn\sbadigliare
13405yawns\sbadiglia 13403yawns\sbadiglia
13406yclept\nominato 13404yclept\nominato
13407ye\il 13405ye\il
13408yea\si 13406yea\si
13409yeah\sereno 13407yeah\sereno
13410year\anno 13408year\anno
13411year of birth\anno di nascita 13409year of birth\anno di nascita
13412year of construction\anno di costruzione 13410year of construction\anno di costruzione
13413yearbook\effemeride 13411yearbook\effemeride
13414yearbooks\annali 13412yearbooks\annali
13415yearlong\di un anno 13413yearlong\di un anno
13416yearly\ànnuo, annualmente 13414yearly\ànnuo, annualmente
13417yearning\ansia 13415yearning\ansia
13418yeast\fondaccio 13416yeast\fondaccio
13419yegg\vagabondaggio 13417yegg\vagabondaggio
13420yell\gridare, stridere 13418yell\gridare, stridere
diff --git a/noncore/apps/opie-console/filereceive.cpp b/noncore/apps/opie-console/filereceive.cpp
index e387273..452be60 100644
--- a/noncore/apps/opie-console/filereceive.cpp
+++ b/noncore/apps/opie-console/filereceive.cpp
@@ -1,162 +1,162 @@
1#include <unistd.h> 1#include <unistd.h>
2#include <fcntl.h> 2#include <fcntl.h>
3#include <signal.h> 3#include <signal.h>
4#include <errno.h> 4#include <errno.h>
5 5
6#include <qsocketnotifier.h> 6#include <qsocketnotifier.h>
7 7
8#include "io_layer.h" 8#include "io_layer.h"
9#include "procctl.h" 9#include "procctl.h"
10#include "filereceive.h" 10#include "filereceive.h"
11 11
12FileReceive::FileReceive( Type t, IOLayer* lay, const QString& dir ) 12FileReceive::FileReceive( Type t, IOLayer* lay, const QString& dir )
13 : ReceiveLayer(lay, dir ), m_type( t ) 13 : ReceiveLayer(lay, dir ), m_type( t )
14{ 14{
15 m_fd = -1; 15 m_fd = -1;
16 m_not = 0l; 16 m_not = 0l;
17 m_proc = 0l; 17 m_proc = 0l;
18} 18}
19FileReceive::~FileReceive() { 19FileReceive::~FileReceive() {
20} 20}
21void FileReceive::receive() { 21void FileReceive::receive() {
22 receive( currentDir() ); 22 receive( currentDir() );
23} 23}
24void FileReceive::receive( const QString& dir ) { 24void FileReceive::receive( const QString& dir ) {
25 m_prog = -1; 25 m_prog = -1;
26 m_fd = layer()->rawIO(); 26 m_fd = layer()->rawIO();
27 m_curDir = dir; 27 m_curDir = dir;
28 28
29 if (pipe( m_comm ) < 0 ) 29 if (pipe( m_comm ) < 0 )
30 m_comm[0] = m_comm[1] = 0; 30 m_comm[0] = m_comm[1] = 0;
31 if (pipe( m_info ) < 0 ) 31 if (pipe( m_info ) < 0 )
32 m_info[0] = m_info[1] = 0; 32 m_info[0] = m_info[1] = 0;
33 33
34 m_pid = fork(); 34 m_pid = fork();
35 switch( m_pid ) { 35 switch( m_pid ) {
36 case -1: 36 case -1:
37 //emit error 37 //emit error
38 slotExec(); 38 slotExec();
39 break; 39 break;
40 /* child */ 40 /* child */
41 case 0: { 41 case 0: {
42 setupChild(); 42 setupChild();
43 char* typus = NULL; 43 char* typus = NULL;
44 switch(m_type ) { 44 switch(m_type ) {
45 case SZ: 45 case SZ:
46 break; 46 break;
47 case SX: 47 case SX:
48 typus = "-X"; 48 typus = "-X";
49 break; 49 break;
50 case SY: 50 case SY:
51 typus = "--ymodem"; 51 typus = "--ymodem";
52 break; 52 break;
53 } 53 }
54 54
55 /* we should never return from here */ 55 /* we should never return from here */
56 if( m_type == SX ) 56 if( m_type == SX )
57 // FIXME: file name should be configurable - currently we ensure it 57 // FIXME: file name should be configurable - currently we ensure it
58 // doesn't get overwritten by -E (--rename) 58 // doesn't get overwritten by -E (--rename)
59 execlp("rz", "rz", typus, "--overwrite", QObject::tr("SynchronizedFile").latin1(), NULL ); 59 execlp("rz", "rz", typus, "--overwrite", QObject::tr("SynchronizedFile").latin1(), NULL );
60 else 60 else
61 execlp("rz", "rz", typus, "--overwrite", NULL ); 61 execlp("rz", "rz", typus, "--overwrite", NULL );
62 62
63 char resultByte = 1; 63 char resultByte = 1;
64 if (m_info[1] ) 64 if (m_info[1] )
65 ::write(m_info[1], &resultByte, 1 ); 65 ::write(m_info[1], &resultByte, 1 );
66 66
67 _exit( -1 ); 67 _exit( -1 );
68 break; 68 break;
69 } 69 }
70 default: { 70 default: {
71 if ( m_info[1] ) 71 if ( m_info[1] )
72 close( m_info[1] ); 72 close( m_info[1] );
73 73
74 if ( m_info[0] ) for (;;) { 74 if ( m_info[0] ) for (;;) {
75 char resultByte; int len; 75 char resultByte; int len;
76 len = read(m_info[0], &resultByte, 1 ); 76 len = read(m_info[0], &resultByte, 1 );
77 /* len == 1 start up failed */ 77 /* len == 1 start up failed */
78 if ( len == 1 ) { 78 if ( len == 1 ) {
79 emit error( StartError, tr("Could not start") ); 79 emit error( StartError, tr("Could not start") );
80 return; 80 return;
81 } 81 }
82 if ( len == -1 ) 82 if ( len == -1 )
83 if ( (errno == ECHILD ) || (errno == EINTR ) ) 83 if ( (errno == ECHILD ) || (errno == EINTR ) )
84 continue; 84 continue;
85 85
86 // len == 0 or something like this 86 // len == 0 or something like this
87 break; 87 break;
88 } 88 }
89 89
90 if ( m_info[0] ) 90 if ( m_info[0] )
91 close( m_info[0] ); 91 close( m_info[0] );
92 92
93 m_not = new QSocketNotifier(m_comm[0], QSocketNotifier::Read ); 93 m_not = new QSocketNotifier(m_comm[0], QSocketNotifier::Read );
94 connect(m_not, SIGNAL(activated(int) ), 94 connect(m_not, SIGNAL(activated(int) ),
95 this, SLOT(slotRead() ) ); 95 this, SLOT(slotRead() ) );
96 if ( pipe(m_term) < 0 ) 96 if ( pipe(m_term) < 0 )
97 m_term[0] = m_term[1] = 0; 97 m_term[0] = m_term[1] = 0;
98 98
99 ProcCtl::self()->add(m_pid, m_term[1] ); 99 ProcCtl::self()->add(m_pid, m_term[1] );
100 m_proc = new QSocketNotifier(m_term[0], QSocketNotifier::Read ); 100 m_proc = new QSocketNotifier(m_term[0], QSocketNotifier::Read );
101 connect(m_proc, SIGNAL(activated(int) ), 101 connect(m_proc, SIGNAL(activated(int) ),
102 this, SLOT(slotExec() ) ); 102 this, SLOT(slotExec() ) );
103 103
104 } 104 }
105 break; 105 break;
106 106
107 } 107 }
108 108
109} 109}
110void FileReceive::cancel() { 110void FileReceive::cancel() {
111 ::kill(m_pid, 9 ); 111 ::kill(m_pid, 9 );
112} 112}
113void FileReceive::setupChild() { 113void FileReceive::setupChild() {
114 changeDir( currentDir() ); 114 changeDir( currentDir() );
115 /* 115 /*
116 * we do not want to read from our 116 * we do not want to read from our
117 * information channel 117 * information channel
118 */ 118 */
119 if (m_info[0] ) 119 if (m_info[0] )
120 close(m_info[0] ); 120 close(m_info[0] );
121 /* 121 /*
122 * FD_CLOEXEC will close the 122 * FD_CLOEXEC will close the
123 * fd on successfull exec 123 * fd on successful exec
124 */ 124 */
125 if (m_info[1] ) 125 if (m_info[1] )
126 fcntl(m_info[1], F_SETFD, FD_CLOEXEC ); 126 fcntl(m_info[1], F_SETFD, FD_CLOEXEC );
127 127
128 if (m_comm[0] ) 128 if (m_comm[0] )
129 close( m_comm[0] ); 129 close( m_comm[0] );
130 /* 130 /*
131 * now set the communication 131 * now set the communication
132 * m_fd STDIN_FILENO 132 * m_fd STDIN_FILENO
133 * STDOUT_FILENO 133 * STDOUT_FILENO
134 * STDERR_FILENO 134 * STDERR_FILENO
135 */ 135 */
136 dup2( m_fd, STDIN_FILENO ); 136 dup2( m_fd, STDIN_FILENO );
137 dup2( m_fd, STDOUT_FILENO ); 137 dup2( m_fd, STDOUT_FILENO );
138 dup2( m_comm[1], STDERR_FILENO ); 138 dup2( m_comm[1], STDERR_FILENO );
139} 139}
140void FileReceive::slotRead() { 140void FileReceive::slotRead() {
141 QByteArray ar(4096); 141 QByteArray ar(4096);
142 int len = read(m_comm[0], ar.data(), 4096 ); 142 int len = read(m_comm[0], ar.data(), 4096 );
143 for (int i = 0; i < len; i++ ) { 143 for (int i = 0; i < len; i++ ) {
144 // printf("%c", ar[i] ); 144 // printf("%c", ar[i] );
145 } 145 }
146 ar.resize( len ); 146 ar.resize( len );
147 QString str( ar ); 147 QString str( ar );
148} 148}
149void FileReceive::slotExec() { 149void FileReceive::slotExec() {
150 char buf[2]; 150 char buf[2];
151 ::read(m_term[0], buf, 1 ); 151 ::read(m_term[0], buf, 1 );
152 delete m_proc; 152 delete m_proc;
153 delete m_not; 153 delete m_not;
154 m_not = m_proc = 0l; 154 m_not = m_proc = 0l;
155 close( m_term[0] ); 155 close( m_term[0] );
156 close( m_term[1] ); 156 close( m_term[1] );
157 close( m_comm[0] ); 157 close( m_comm[0] );
158 close( m_comm[1] ); 158 close( m_comm[1] );
159 layer()->closeRawIO(m_fd); 159 layer()->closeRawIO(m_fd);
160 emit received(QString::null); 160 emit received(QString::null);
161 161
162} 162}
diff --git a/noncore/apps/opie-console/filetransfer.cpp b/noncore/apps/opie-console/filetransfer.cpp
index 221838c..5144941 100644
--- a/noncore/apps/opie-console/filetransfer.cpp
+++ b/noncore/apps/opie-console/filetransfer.cpp
@@ -1,251 +1,251 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <stdlib.h> 2#include <stdlib.h>
3#include <errno.h> 3#include <errno.h>
4#include <fcntl.h> 4#include <fcntl.h>
5#include <unistd.h> 5#include <unistd.h>
6 6
7#include <qcstring.h> 7#include <qcstring.h>
8#include <qsocketnotifier.h> 8#include <qsocketnotifier.h>
9 9
10#include <opie/oprocess.h> 10#include <opie/oprocess.h>
11 11
12#include "procctl.h" 12#include "procctl.h"
13#include "filetransfer.h" 13#include "filetransfer.h"
14 14
15 15
16FileTransfer::FileTransfer( Type t, IOLayer* lay ) 16FileTransfer::FileTransfer( Type t, IOLayer* lay )
17 : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) { 17 : FileTransferLayer( lay ), m_type( t ), m_pid ( 0 ) {
18 signal(SIGPIPE, SIG_IGN ); 18 signal(SIGPIPE, SIG_IGN );
19 19
20 m_pid = 0; 20 m_pid = 0;
21 m_not = 0l; 21 m_not = 0l;
22 m_proc = 0l; 22 m_proc = 0l;
23} 23}
24FileTransfer::~FileTransfer() { 24FileTransfer::~FileTransfer() {
25} 25}
26 26
27/** 27/**
28 * now we will send the file. 28 * now we will send the file.
29 * 29 *
30 * we request an fd. The IOLayer should be closed 30 * we request an fd. The IOLayer should be closed
31 * then we will setup a pipe for progress communication 31 * then we will setup a pipe for progress communication
32 * then we will dup2 the m_fd in the forked process 32 * then we will dup2 the m_fd in the forked process
33 * to do direct IO from and to the fd 33 * to do direct IO from and to the fd
34 */ 34 */
35void FileTransfer::sendFile( const QString& file ) { 35void FileTransfer::sendFile( const QString& file ) {
36 m_prog =-1; 36 m_prog =-1;
37 m_fd = layer()->rawIO(); 37 m_fd = layer()->rawIO();
38// 38//
39// m_fd = ::open("/dev/ttyS0", O_RDWR); 39// m_fd = ::open("/dev/ttyS0", O_RDWR);
40 40
41 m_file = file; 41 m_file = file;
42 if ( pipe( m_comm ) < 0 ) 42 if ( pipe( m_comm ) < 0 )
43 m_comm[0] = m_comm[1] = 0; 43 m_comm[0] = m_comm[1] = 0;
44 if ( pipe( m_info ) < 0 ) 44 if ( pipe( m_info ) < 0 )
45 m_info[0] = m_info[1] = 0; 45 m_info[0] = m_info[1] = 0;
46 46
47 47
48 m_pid = fork(); 48 m_pid = fork();
49 switch( m_pid ) { 49 switch( m_pid ) {
50 case -1: 50 case -1:
51 emit error( StartError, tr("Was not able to fork") ); 51 emit error( StartError, tr("Was not able to fork") );
52 slotExec(); 52 slotExec();
53 break; 53 break;
54 case 0:{ 54 case 0:{
55 setupChild(); 55 setupChild();
56 /* exec */ 56 /* exec */
57 char* verbose = "-vv"; 57 char* verbose = "-vv";
58 char* binray = "-b"; 58 char* binray = "-b";
59 59
60 60
61 char* typus; 61 char* typus;
62 switch(m_type ) { 62 switch(m_type ) {
63 default: 63 default:
64 case SZ: 64 case SZ:
65 typus = ""; 65 typus = "";
66 break; 66 break;
67 case SX: 67 case SX:
68 typus = "-X"; 68 typus = "-X";
69 break; 69 break;
70 case SY: 70 case SY:
71 typus = "--ymodem"; 71 typus = "--ymodem";
72 break; 72 break;
73 } 73 }
74 74
75 /* we should never return from here */ 75 /* we should never return from here */
76 execlp("sz", "sz", verbose, binray, file.latin1(), typus, NULL ); 76 execlp("sz", "sz", verbose, binray, file.latin1(), typus, NULL );
77 77
78 /* communication for error!*/ 78 /* communication for error!*/
79 char resultByte =1; 79 char resultByte =1;
80 if (m_info[1] ) 80 if (m_info[1] )
81 write(m_info[1], &resultByte, 1 ); 81 write(m_info[1], &resultByte, 1 );
82 _exit( -1 ); 82 _exit( -1 );
83 break; 83 break;
84 } 84 }
85 default:{ 85 default:{
86 if ( m_info[1] ) 86 if ( m_info[1] )
87 close( m_info[1] ); 87 close( m_info[1] );
88 if ( m_info[0] ) for (;;) { 88 if ( m_info[0] ) for (;;) {
89 char resultByte; int len; 89 char resultByte; int len;
90 len = read(m_info[0], &resultByte, 1 ); 90 len = read(m_info[0], &resultByte, 1 );
91 /* len == 1 start up failed */ 91 /* len == 1 start up failed */
92 if ( len == 1 ) { 92 if ( len == 1 ) {
93 emit error( StartError, tr("Could not start") ); 93 emit error( StartError, tr("Could not start") );
94 return; 94 return;
95 } 95 }
96 if ( len == -1 ) 96 if ( len == -1 )
97 if ( (errno == ECHILD ) || (errno == EINTR ) ) 97 if ( (errno == ECHILD ) || (errno == EINTR ) )
98 continue; 98 continue;
99 99
100 // len == 0 or something like this 100 // len == 0 or something like this
101 break; 101 break;
102 } 102 }
103 if ( m_info[0] ) 103 if ( m_info[0] )
104 close( m_info[0] ); 104 close( m_info[0] );
105 105
106 106
107 107
108 /* replace by QSocketNotifier!!! */ 108 /* replace by QSocketNotifier!!! */
109 m_not = new QSocketNotifier(m_comm[0], QSocketNotifier::Read ); 109 m_not = new QSocketNotifier(m_comm[0], QSocketNotifier::Read );
110 connect(m_not, SIGNAL(activated(int) ), 110 connect(m_not, SIGNAL(activated(int) ),
111 this, SLOT(slotRead() ) ); 111 this, SLOT(slotRead() ) );
112 if ( pipe(m_term) < 0 ) 112 if ( pipe(m_term) < 0 )
113 m_term[0] = m_term[1] = 0; 113 m_term[0] = m_term[1] = 0;
114 114
115 ProcCtl::self()->add(m_pid, m_term[1] ); 115 ProcCtl::self()->add(m_pid, m_term[1] );
116 m_proc = new QSocketNotifier(m_term[0], QSocketNotifier::Read ); 116 m_proc = new QSocketNotifier(m_term[0], QSocketNotifier::Read );
117 connect(m_proc, SIGNAL(activated(int) ), 117 connect(m_proc, SIGNAL(activated(int) ),
118 this, SLOT(slotExec() ) ); 118 this, SLOT(slotExec() ) );
119 119
120 } 120 }
121 break; 121 break;
122 } 122 }
123} 123}
124/* 124/*
125 * let's call the one with the filename 125 * let's call the one with the filename
126 */ 126 */
127void FileTransfer::sendFile( const QFile& file ) { 127void FileTransfer::sendFile( const QFile& file ) {
128 sendFile( file.name() ); 128 sendFile( file.name() );
129} 129}
130 130
131/* 131/*
132 * setting up communication 132 * setting up communication
133 * between parent child and ioLayer 133 * between parent child and ioLayer
134 */ 134 */
135void FileTransfer::setupChild() { 135void FileTransfer::setupChild() {
136 /* 136 /*
137 * we do not want to read from our 137 * we do not want to read from our
138 * information channel 138 * information channel
139 */ 139 */
140 if (m_info[0] ) 140 if (m_info[0] )
141 close(m_info[0] ); 141 close(m_info[0] );
142 /* 142 /*
143 * FD_CLOEXEC will close the 143 * FD_CLOEXEC will close the
144 * fd on successfull exec 144 * fd on successful exec
145 */ 145 */
146 if (m_info[1] ) 146 if (m_info[1] )
147 fcntl(m_info[1], F_SETFD, FD_CLOEXEC ); 147 fcntl(m_info[1], F_SETFD, FD_CLOEXEC );
148 148
149 if (m_comm[0] ) 149 if (m_comm[0] )
150 close( m_comm[0] ); 150 close( m_comm[0] );
151 /* 151 /*
152 * now set the communication 152 * now set the communication
153 * m_fd STDIN_FILENO 153 * m_fd STDIN_FILENO
154 * STDOUT_FILENO 154 * STDOUT_FILENO
155 * STDERR_FILENO 155 * STDERR_FILENO
156 */ 156 */
157 dup2( m_fd, STDIN_FILENO ); 157 dup2( m_fd, STDIN_FILENO );
158 dup2( m_fd, STDOUT_FILENO ); 158 dup2( m_fd, STDOUT_FILENO );
159 dup2( m_comm[1], STDERR_FILENO ); 159 dup2( m_comm[1], STDERR_FILENO );
160} 160}
161 161
162/* 162/*
163 * read from the stderr of the child 163 * read from the stderr of the child
164 * process 164 * process
165 */ 165 */
166void FileTransfer::slotRead() { 166void FileTransfer::slotRead() {
167 QByteArray ar(4096); 167 QByteArray ar(4096);
168 int len = read(m_comm[0], ar.data(), 4096 ); 168 int len = read(m_comm[0], ar.data(), 4096 );
169 for (int i = 0; i < len; i++ ) { 169 for (int i = 0; i < len; i++ ) {
170 // printf("%c", ar[i] ); 170 // printf("%c", ar[i] );
171 } 171 }
172 ar.resize( len ); 172 ar.resize( len );
173 QString str( ar ); 173 QString str( ar );
174 QStringList lis = QStringList::split(' ', str ); 174 QStringList lis = QStringList::split(' ', str );
175 /* 175 /*
176 * Transfer finished.. either complete or incomplete 176 * Transfer finished.. either complete or incomplete
177 */ 177 */
178 if ( lis[0].simplifyWhiteSpace() == "Transfer" ) { 178 if ( lis[0].simplifyWhiteSpace() == "Transfer" ) {
179 return; 179 return;
180 } 180 }
181 /* 181 /*
182 * do progress reading 182 * do progress reading
183 */ 183 */
184 slotProgress( lis ); 184 slotProgress( lis );
185 185
186 186
187} 187}
188/* 188/*
189 * find the progress 189 * find the progress
190 */ 190 */
191void FileTransfer::slotProgress( const QStringList& list ) { 191void FileTransfer::slotProgress( const QStringList& list ) {
192 if ( m_type != SZ ) 192 if ( m_type != SZ )
193 return; 193 return;
194 bool complete = true; 194 bool complete = true;
195 int min, sec; 195 int min, sec;
196 int bps; 196 int bps;
197 unsigned long sent, total; 197 unsigned long sent, total;
198 198
199 min = sec = bps = -1; 199 min = sec = bps = -1;
200 sent = total = 0; 200 sent = total = 0;
201 201
202 // Data looks like this 202 // Data looks like this
203 // 0 1 2 3 4 5 203 // 0 1 2 3 4 5
204 // Bytes Sent 65536/11534336 BPS:7784 ETA 24:33 204 // Bytes Sent 65536/11534336 BPS:7784 ETA 24:33
205 QStringList progi = QStringList::split('/', list[2].simplifyWhiteSpace() ); 205 QStringList progi = QStringList::split('/', list[2].simplifyWhiteSpace() );
206 sent = progi[0].toULong(&complete ); 206 sent = progi[0].toULong(&complete );
207 if (!complete ) return; 207 if (!complete ) return;
208 208
209 total = progi[1].toULong(&complete ); 209 total = progi[1].toULong(&complete );
210 if (!complete || total == 0) { 210 if (!complete || total == 0) {
211 return; 211 return;
212 } 212 }
213 213
214 214
215 double pro = (double)sent/total; 215 double pro = (double)sent/total;
216 int prog = pro * 100; 216 int prog = pro * 100;
217 217
218 // speed 218 // speed
219 progi = QStringList::split(':', list[3].simplifyWhiteSpace() ); 219 progi = QStringList::split(':', list[3].simplifyWhiteSpace() );
220 bps = progi[1].toInt(); 220 bps = progi[1].toInt();
221 221
222 // time 222 // time
223 progi = QStringList::split(':', list[5].simplifyWhiteSpace() ); 223 progi = QStringList::split(':', list[5].simplifyWhiteSpace() );
224 min = progi[0].toInt(); 224 min = progi[0].toInt();
225 sec = progi[1].toInt(); 225 sec = progi[1].toInt();
226 226
227 227
228 if ( prog > m_prog ) { 228 if ( prog > m_prog ) {
229 m_prog = prog; 229 m_prog = prog;
230 emit progress(m_file, m_prog, bps, -1, min , sec ); 230 emit progress(m_file, m_prog, bps, -1, min , sec );
231 } 231 }
232 232
233} 233}
234void FileTransfer::cancel() { 234void FileTransfer::cancel() {
235 if(m_pid > 0) ::kill(m_pid,9 ); 235 if(m_pid > 0) ::kill(m_pid,9 );
236 236
237} 237}
238void FileTransfer::slotExec() { 238void FileTransfer::slotExec() {
239 char buf[2]; 239 char buf[2];
240 ::read(m_term[0], buf, 1 ); 240 ::read(m_term[0], buf, 1 );
241 delete m_proc; 241 delete m_proc;
242 delete m_not; 242 delete m_not;
243 m_proc = m_not = 0l; 243 m_proc = m_not = 0l;
244 close( m_term[0] ); 244 close( m_term[0] );
245 close( m_term[1] ); 245 close( m_term[1] );
246 close( m_comm[0] ); 246 close( m_comm[0] );
247 close( m_comm[1] ); 247 close( m_comm[1] );
248 layer()->closeRawIO( m_fd ); 248 layer()->closeRawIO( m_fd );
249 emit sent(); 249 emit sent();
250 m_pid = 0; 250 m_pid = 0;
251} 251}
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 3250627..2b29d83 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -1,1515 +1,1515 @@
1/*************************************************************************** 1/***************************************************************************
2 opieftp.cpp 2 opieftp.cpp
3 ------------------- 3 -------------------
4** Created: Sat Mar 9 23:33:09 2002 4** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12//#define DEVELOPERS_VERSION 12//#define DEVELOPERS_VERSION
13 13
14#include "opieftp.h" 14#include "opieftp.h"
15 15
16extern "C" { 16extern "C" {
17#include "../ftplib/ftplib.h" 17#include "../ftplib/ftplib.h"
18} 18}
19 19
20#include "inputDialog.h" 20#include "inputDialog.h"
21 21
22#include <qmenubar.h> 22#include <qmenubar.h>
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <qpe/resource.h> 24#include <qpe/resource.h>
25#include <qpe/config.h> 25#include <qpe/config.h>
26#include <qpe/mimetype.h> 26#include <qpe/mimetype.h>
27 27
28#include <qtextstream.h> 28#include <qtextstream.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qtoolbutton.h> 30#include <qtoolbutton.h>
31#include <qcombobox.h> 31#include <qcombobox.h>
32#include <qlistview.h> 32#include <qlistview.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qprogressbar.h> 34#include <qprogressbar.h>
35#include <qspinbox.h> 35#include <qspinbox.h>
36#include <qtabwidget.h> 36#include <qtabwidget.h>
37#include <qlayout.h> 37#include <qlayout.h>
38#include <qmessagebox.h> 38#include <qmessagebox.h>
39#include <qlineedit.h> 39#include <qlineedit.h>
40#include <qlistbox.h> 40#include <qlistbox.h>
41 41
42#include <unistd.h> 42#include <unistd.h>
43#include <stdlib.h> 43#include <stdlib.h>
44 44
45 45
46QProgressBar *ProgressBar; 46QProgressBar *ProgressBar;
47static netbuf *conn=NULL; 47static netbuf *conn=NULL;
48 48
49static int log_progress(netbuf *, int xfered, void *) 49static int log_progress(netbuf *, int xfered, void *)
50{ 50{
51// int fsz = *(int *)arg; 51// int fsz = *(int *)arg;
52// int pct = (xfered * 100) / fsz; 52// int pct = (xfered * 100) / fsz;
53// printf("%3d%%\r", pct); 53// printf("%3d%%\r", pct);
54// fflush(stdout); 54// fflush(stdout);
55 ProgressBar->setProgress(xfered); 55 ProgressBar->setProgress(xfered);
56 qApp->processEvents(); 56 qApp->processEvents();
57 return 1; 57 return 1;
58} 58}
59 59
60OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) 60OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl)
61 : QMainWindow( parent, name, fl ) 61 : QMainWindow( parent, name, fl )
62{ 62{
63 setCaption( tr( "OpieFtp" ) ); 63 setCaption( tr( "OpieFtp" ) );
64 fuckeduphack=FALSE; 64 fuckeduphack=FALSE;
65 QGridLayout *layout = new QGridLayout( this ); 65 QGridLayout *layout = new QGridLayout( this );
66 layout->setSpacing( 2); 66 layout->setSpacing( 2);
67 layout->setMargin( 2); 67 layout->setMargin( 2);
68 68
69 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 69 connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
70 70
71 QMenuBar *menuBar = new QMenuBar(this); 71 QMenuBar *menuBar = new QMenuBar(this);
72// QToolBar *menuBar = new QToolBar(this); 72// QToolBar *menuBar = new QToolBar(this);
73// menuBar->setHorizontalStretchable( TRUE ); 73// menuBar->setHorizontalStretchable( TRUE );
74 74
75 QWMatrix matrix; 75 QWMatrix matrix;
76 QPixmap pix(Resource::loadPixmap( "UnknownDocument" )); 76 QPixmap pix(Resource::loadPixmap( "UnknownDocument" ));
77 matrix.scale( .4, .4); 77 matrix.scale( .4, .4);
78 unknownXpm = pix.xForm(matrix); 78 unknownXpm = pix.xForm(matrix);
79 79
80 connectionMenu = new QPopupMenu( this ); 80 connectionMenu = new QPopupMenu( this );
81 localMenu = new QPopupMenu( this ); 81 localMenu = new QPopupMenu( this );
82 remoteMenu = new QPopupMenu( this ); 82 remoteMenu = new QPopupMenu( this );
83 tabMenu = new QPopupMenu( this ); 83 tabMenu = new QPopupMenu( this );
84 84
85 layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 ); 85 layout->addMultiCellWidget( menuBar, 0, 0, 0, 2 );
86 86
87 menuBar->insertItem( tr( "Connection" ), connectionMenu); 87 menuBar->insertItem( tr( "Connection" ), connectionMenu);
88// menuBar->insertItem( tr( "Local" ), localMenu); 88// menuBar->insertItem( tr( "Local" ), localMenu);
89// menuBar->insertItem( tr( "Remote" ), remoteMenu); 89// menuBar->insertItem( tr( "Remote" ), remoteMenu);
90 menuBar->insertItem( tr( "View" ), tabMenu); 90 menuBar->insertItem( tr( "View" ), tabMenu);
91 91
92 tabMenu->insertItem( tr( "Local" ), localMenu); 92 tabMenu->insertItem( tr( "Local" ), localMenu);
93 tabMenu->insertItem( tr( "Remote" ), remoteMenu); 93 tabMenu->insertItem( tr( "Remote" ), remoteMenu);
94 94
95 connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() )); 95 connectionMenu->insertItem( tr( "New" ), this, SLOT( newConnection() ));
96 connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() )); 96 connectionMenu->insertItem( tr( "Connect" ), this, SLOT( connector() ));
97 connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() )); 97 connectionMenu->insertItem( tr( "Disconnect" ), this, SLOT( disConnector() ));
98 98
99 localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); 99 localMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
100 localMenu->insertSeparator(); 100 localMenu->insertSeparator();
101 localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); 101 localMenu->insertItem( tr( "Upload" ), this, SLOT( localUpload() ));
102 localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); 102 localMenu->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() ));
103 localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() )); 103 localMenu->insertItem( tr( "Rename" ), this, SLOT( localRename() ));
104 localMenu->insertSeparator(); 104 localMenu->insertSeparator();
105 localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 105 localMenu->insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
106 localMenu->setCheckable(TRUE); 106 localMenu->setCheckable(TRUE);
107 107
108 remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); 108 remoteMenu->insertItem( tr( "Download" ), this, SLOT( remoteDownload() ));
109 remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); 109 remoteMenu->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() ));
110 remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); 110 remoteMenu->insertItem( tr( "Rename" ), this, SLOT( remoteRename() ));
111 remoteMenu->insertSeparator(); 111 remoteMenu->insertSeparator();
112 remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); 112 remoteMenu->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
113 113
114 tabMenu->insertSeparator(); 114 tabMenu->insertSeparator();
115 tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() )); 115 tabMenu->insertItem( tr( "Switch to Local" ), this, SLOT( switchToLocalTab() ));
116 tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() )); 116 tabMenu->insertItem( tr( "Switch to Remote" ), this, SLOT( switchToRemoteTab() ));
117 tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); 117 tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() ));
118 tabMenu->insertSeparator(); 118 tabMenu->insertSeparator();
119// tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); 119// tabMenu->insertItem( tr( "About" ), this, SLOT( doAbout() ));
120 tabMenu->setCheckable(TRUE); 120 tabMenu->setCheckable(TRUE);
121 121
122 122
123 123
124 cdUpButton = new QToolButton( this,"cdUpButton"); 124 cdUpButton = new QToolButton( this,"cdUpButton");
125 cdUpButton->setPixmap(Resource::loadPixmap("up")); 125 cdUpButton->setPixmap(Resource::loadPixmap("up"));
126 cdUpButton ->setFixedSize( QSize( 20, 20 ) ); 126 cdUpButton ->setFixedSize( QSize( 20, 20 ) );
127 connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) ); 127 connect( cdUpButton ,SIGNAL(released()),this,SLOT( upDir()) );
128 layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 ); 128 layout->addMultiCellWidget( cdUpButton, 0, 0, 3, 3 );
129 cdUpButton->hide(); 129 cdUpButton->hide();
130 130
131// docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton"); 131// docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"",this,"docsButton");
132// docButton->setFixedSize( QSize( 20, 20 ) ); 132// docButton->setFixedSize( QSize( 20, 20 ) );
133// connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) ); 133// connect( docButton,SIGNAL(released()),this,SLOT( docButtonPushed()) );
134// docButton->setFlat(TRUE); 134// docButton->setFlat(TRUE);
135// layout->addMultiCellWidget( docButton, 0, 0, 6, 6 ); 135// layout->addMultiCellWidget( docButton, 0, 0, 6, 6 );
136 136
137 homeButton = new QToolButton(this,"homeButton"); 137 homeButton = new QToolButton(this,"homeButton");
138 homeButton->setPixmap( Resource::loadPixmap("home")); 138 homeButton->setPixmap( Resource::loadPixmap("home"));
139 homeButton->setFixedSize( QSize( 20, 20 ) ); 139 homeButton->setFixedSize( QSize( 20, 20 ) );
140 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) ); 140 connect(homeButton,SIGNAL(released()),this,SLOT(homeButtonPushed()) );
141 layout->addMultiCellWidget( homeButton, 0, 0, 4, 4); 141 layout->addMultiCellWidget( homeButton, 0, 0, 4, 4);
142 homeButton->hide(); 142 homeButton->hide();
143 143
144 TabWidget = new QTabWidget( this, "TabWidget" ); 144 TabWidget = new QTabWidget( this, "TabWidget" );
145 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 ); 145 layout->addMultiCellWidget( TabWidget, 1, 1, 0, 4 );
146 146
147// TabWidget->setTabShape(QTabWidget::Triangular); 147// TabWidget->setTabShape(QTabWidget::Triangular);
148 148
149 tab = new QWidget( TabWidget, "tab" ); 149 tab = new QWidget( TabWidget, "tab" );
150 tabLayout = new QGridLayout( tab ); 150 tabLayout = new QGridLayout( tab );
151 tabLayout->setSpacing( 2); 151 tabLayout->setSpacing( 2);
152 tabLayout->setMargin( 2); 152 tabLayout->setMargin( 2);
153 153
154 Local_View = new QListView( tab, "Local_View" ); 154 Local_View = new QListView( tab, "Local_View" );
155// Local_View->setResizePolicy( QListView::AutoOneFit ); 155// Local_View->setResizePolicy( QListView::AutoOneFit );
156 Local_View->addColumn( tr("File"),150); 156 Local_View->addColumn( tr("File"),150);
157 Local_View->addColumn( tr("Date"),-1); 157 Local_View->addColumn( tr("Date"),-1);
158 Local_View->setColumnAlignment(1,QListView::AlignRight); 158 Local_View->setColumnAlignment(1,QListView::AlignRight);
159 Local_View->addColumn( tr("Size"),-1); 159 Local_View->addColumn( tr("Size"),-1);
160 Local_View->setColumnAlignment(2,QListView::AlignRight); 160 Local_View->setColumnAlignment(2,QListView::AlignRight);
161 Local_View->setAllColumnsShowFocus(TRUE); 161 Local_View->setAllColumnsShowFocus(TRUE);
162 162
163 Local_View->setMultiSelection( TRUE); 163 Local_View->setMultiSelection( TRUE);
164 Local_View->setSelectionMode(QListView::Extended); 164 Local_View->setSelectionMode(QListView::Extended);
165 Local_View->setFocusPolicy(QWidget::ClickFocus); 165 Local_View->setFocusPolicy(QWidget::ClickFocus);
166 166
167 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); 167 QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
168 168
169 tabLayout->addWidget( Local_View, 0, 0 ); 169 tabLayout->addWidget( Local_View, 0, 0 );
170 170
171 connect( Local_View, SIGNAL( clicked( QListViewItem*)), 171 connect( Local_View, SIGNAL( clicked( QListViewItem*)),
172 this,SLOT( localListClicked(QListViewItem *)) ); 172 this,SLOT( localListClicked(QListViewItem *)) );
173// connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)), 173// connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)),
174// this,SLOT( localListClicked(QListViewItem *)) ); 174// this,SLOT( localListClicked(QListViewItem *)) );
175 connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 175 connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
176 this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); 176 this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) );
177 177
178 TabWidget->insertTab( tab, tr( "Local" ) ); 178 TabWidget->insertTab( tab, tr( "Local" ) );
179 179
180 tab_2 = new QWidget( TabWidget, "tab_2" ); 180 tab_2 = new QWidget( TabWidget, "tab_2" );
181 tabLayout_2 = new QGridLayout( tab_2 ); 181 tabLayout_2 = new QGridLayout( tab_2 );
182 tabLayout_2->setSpacing( 2); 182 tabLayout_2->setSpacing( 2);
183 tabLayout_2->setMargin( 2); 183 tabLayout_2->setMargin( 2);
184 184
185 Remote_View = new QListView( tab_2, "Remote_View" ); 185 Remote_View = new QListView( tab_2, "Remote_View" );
186 Remote_View->addColumn( tr("File"),150); 186 Remote_View->addColumn( tr("File"),150);
187 Remote_View->addColumn( tr("Date"),-1); 187 Remote_View->addColumn( tr("Date"),-1);
188// Remote_View->setColumnAlignment(1,QListView::AlignRight); 188// Remote_View->setColumnAlignment(1,QListView::AlignRight);
189 Remote_View->addColumn( tr("Size"),-1); 189 Remote_View->addColumn( tr("Size"),-1);
190 Remote_View->setColumnAlignment(2,QListView::AlignRight); 190 Remote_View->setColumnAlignment(2,QListView::AlignRight);
191 Remote_View->setColumnAlignment(3,QListView::AlignCenter); 191 Remote_View->setColumnAlignment(3,QListView::AlignCenter);
192 Remote_View->addColumn( tr("Dir"),-1); 192 Remote_View->addColumn( tr("Dir"),-1);
193 Remote_View->setColumnAlignment(4,QListView::AlignRight); 193 Remote_View->setColumnAlignment(4,QListView::AlignRight);
194 Remote_View->setAllColumnsShowFocus(TRUE); 194 Remote_View->setAllColumnsShowFocus(TRUE);
195 195
196 Remote_View->setMultiSelection( FALSE); 196 Remote_View->setMultiSelection( FALSE);
197 Remote_View->setSelectionMode(QListView::Extended); 197 Remote_View->setSelectionMode(QListView::Extended);
198 Remote_View->setFocusPolicy(QWidget::ClickFocus); 198 Remote_View->setFocusPolicy(QWidget::ClickFocus);
199 199
200 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold); 200 QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
201 201
202 connect( Remote_View, SIGNAL( clicked( QListViewItem*)), 202 connect( Remote_View, SIGNAL( clicked( QListViewItem*)),
203 this,SLOT( remoteListClicked(QListViewItem *)) ); 203 this,SLOT( remoteListClicked(QListViewItem *)) );
204 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 204 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)),
205 this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) ); 205 this,SLOT( RemoteListPressed(int, QListViewItem *, const QPoint&, int)) );
206 206
207 tabLayout_2->addWidget( Remote_View, 0, 0 ); 207 tabLayout_2->addWidget( Remote_View, 0, 0 );
208 208
209 TabWidget->insertTab( tab_2, tr( "Remote" ) ); 209 TabWidget->insertTab( tab_2, tr( "Remote" ) );
210 210
211 tab_3 = new QWidget( TabWidget, "tab_3" ); 211 tab_3 = new QWidget( TabWidget, "tab_3" );
212 tabLayout_3 = new QGridLayout( tab_3 ); 212 tabLayout_3 = new QGridLayout( tab_3 );
213 tabLayout_3->setSpacing( 2); 213 tabLayout_3->setSpacing( 2);
214 tabLayout_3->setMargin( 2); 214 tabLayout_3->setMargin( 2);
215 215
216 TextLabel1 = new QLabel( tab_3, "TextLabel1" ); 216 TextLabel1 = new QLabel( tab_3, "TextLabel1" );
217 TextLabel1->setText( tr( "Username" ) ); 217 TextLabel1->setText( tr( "Username" ) );
218 tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); 218 tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 );
219 219
220 UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" ); 220 UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" );
221 UsernameComboBox->setEditable(TRUE); 221 UsernameComboBox->setEditable(TRUE);
222 tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 ); 222 tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 );
223 223
224 connect( UsernameComboBox,SIGNAL(textChanged(const QString &)),this, 224 connect( UsernameComboBox,SIGNAL(textChanged(const QString &)),this,
225 SLOT( UsernameComboBoxEdited(const QString & ) )); 225 SLOT( UsernameComboBoxEdited(const QString & ) ));
226 226
227 TextLabel2 = new QLabel( tab_3, "TextLabel2" ); 227 TextLabel2 = new QLabel( tab_3, "TextLabel2" );
228 TextLabel2->setText( tr( "Password" ) ); 228 TextLabel2->setText( tr( "Password" ) );
229 tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 ); 229 tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 );
230 230
231 PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" ); 231 PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" );
232 PasswordEdit->setEchoMode(QLineEdit::Password); 232 PasswordEdit->setEchoMode(QLineEdit::Password);
233 tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 ); 233 tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 );
234 234
235 connect( PasswordEdit,SIGNAL(textChanged(const QString &)),this, 235 connect( PasswordEdit,SIGNAL(textChanged(const QString &)),this,
236 SLOT( PasswordEditEdited(const QString & ) )); 236 SLOT( PasswordEditEdited(const QString & ) ));
237 237
238//PasswordEdit->setFixedWidth(85); 238//PasswordEdit->setFixedWidth(85);
239 TextLabel3 = new QLabel( tab_3, "TextLabel3" ); 239 TextLabel3 = new QLabel( tab_3, "TextLabel3" );
240 TextLabel3->setText( tr( "Remote server" ) ); 240 TextLabel3->setText( tr( "Remote server" ) );
241 tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 ); 241 tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
242 242
243 ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" ); 243 ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" );
244 ServerComboBox->setEditable(TRUE); 244 ServerComboBox->setEditable(TRUE);
245 tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 ); 245 tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 );
246 246
247 connect(ServerComboBox,SIGNAL(activated(int)),this,SLOT(serverComboSelected(int ) )); 247 connect(ServerComboBox,SIGNAL(activated(int)),this,SLOT(serverComboSelected(int ) ));
248 connect(ServerComboBox,SIGNAL(textChanged(const QString &)),this, 248 connect(ServerComboBox,SIGNAL(textChanged(const QString &)),this,
249 SLOT(serverComboEdited(const QString & ) )); 249 SLOT(serverComboEdited(const QString & ) ));
250 250
251 QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" ); 251 QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" );
252 TextLabel5->setText( tr( "Remote path" ) ); 252 TextLabel5->setText( tr( "Remote path" ) );
253 tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 ); 253 tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 );
254 254
255 255
256 remotePath = new QLineEdit( "/", tab_3, "remotePath" ); 256 remotePath = new QLineEdit( "/", tab_3, "remotePath" );
257 tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 ); 257 tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 );
258 TextLabel4 = new QLabel( tab_3, "TextLabel4" ); 258 TextLabel4 = new QLabel( tab_3, "TextLabel4" );
259 TextLabel4->setText( tr( "Port" ) ); 259 TextLabel4->setText( tr( "Port" ) );
260 tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 ); 260 tabLayout_3->addMultiCellWidget( TextLabel4, 4, 4, 0, 1 );
261 261
262 PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" ); 262 PortSpinBox = new QSpinBox( tab_3, "PortSpinBox" );
263 PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows ); 263 PortSpinBox->setButtonSymbols( QSpinBox::UpDownArrows );
264 PortSpinBox->setMaxValue(32786); 264 PortSpinBox->setMaxValue(32786);
265 tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1); 265 tabLayout_3->addMultiCellWidget( PortSpinBox, 4, 4, 1, 1);
266 266
267 serverListView = new QListBox( tab_3, "ServerListView" ); 267 serverListView = new QListBox( tab_3, "ServerListView" );
268 tabLayout_3->addMultiCellWidget( serverListView , 5, 5, 0, 5); 268 tabLayout_3->addMultiCellWidget( serverListView , 5, 5, 0, 5);
269 269
270 connect( serverListView, SIGNAL( highlighted( const QString &)), 270 connect( serverListView, SIGNAL( highlighted( const QString &)),
271 this,SLOT( serverListClicked( const QString &) ) ); 271 this,SLOT( serverListClicked( const QString &) ) );
272 272
273 connectServerBtn = new QPushButton( tr("Connect"), tab_3 , "ConnectButton" ); 273 connectServerBtn = new QPushButton( tr("Connect"), tab_3 , "ConnectButton" );
274 tabLayout_3->addMultiCellWidget( connectServerBtn, 6, 6, 0, 1); 274 tabLayout_3->addMultiCellWidget( connectServerBtn, 6, 6, 0, 1);
275 connectServerBtn->setToggleButton(TRUE); 275 connectServerBtn->setToggleButton(TRUE);
276 connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) )); 276 connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) ));
277 277
278 newServerButton= new QPushButton( tr("Add"), tab_3 , "NewServerButton" ); 278 newServerButton= new QPushButton( tr("Add"), tab_3 , "NewServerButton" );
279 tabLayout_3->addMultiCellWidget( newServerButton, 6, 6, 2, 2); 279 tabLayout_3->addMultiCellWidget( newServerButton, 6, 6, 2, 2);
280 connect( newServerButton,SIGNAL( clicked()),SLOT( NewServer() )); 280 connect( newServerButton,SIGNAL( clicked()),SLOT( NewServer() ));
281 281
282 QPushButton *deleteServerBtn; 282 QPushButton *deleteServerBtn;
283 deleteServerBtn = new QPushButton( tr("Delete"), tab_3 , "OpenButton" ); 283 deleteServerBtn = new QPushButton( tr("Delete"), tab_3 , "OpenButton" );
284 tabLayout_3->addMultiCellWidget( deleteServerBtn, 6, 6, 3, 3); 284 tabLayout_3->addMultiCellWidget( deleteServerBtn, 6, 6, 3, 3);
285 285
286 connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer())); 286 connect(deleteServerBtn,SIGNAL(clicked()),SLOT(deleteServer()));
287 287
288 288
289 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); 289 QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
290 tabLayout_3->addItem( spacer, 5, 0 ); 290 tabLayout_3->addItem( spacer, 5, 0 );
291 291
292 TabWidget->insertTab( tab_3, tr( "Config" ) ); 292 TabWidget->insertTab( tab_3, tr( "Config" ) );
293 293
294 connect(TabWidget,SIGNAL(currentChanged(QWidget *)), 294 connect(TabWidget,SIGNAL(currentChanged(QWidget *)),
295 this,SLOT(tabChanged(QWidget*))); 295 this,SLOT(tabChanged(QWidget*)));
296 296
297 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 297 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
298 currentDir.setPath( QDir::currentDirPath()); 298 currentDir.setPath( QDir::currentDirPath());
299// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 299// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
300 300
301 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); 301 currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" );
302 layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4); 302 layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 4);
303 currentPathCombo ->setFixedWidth(220); 303 currentPathCombo ->setFixedWidth(220);
304 currentPathCombo->setEditable(TRUE); 304 currentPathCombo->setEditable(TRUE);
305 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 305 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
306 306
307 connect( currentPathCombo, SIGNAL( activated( const QString & ) ), 307 connect( currentPathCombo, SIGNAL( activated( const QString & ) ),
308 this, SLOT( currentPathComboActivated( const QString & ) ) ); 308 this, SLOT( currentPathComboActivated( const QString & ) ) );
309 309
310 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), 310 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()),
311 this,SLOT(currentPathComboChanged())); 311 this,SLOT(currentPathComboChanged()));
312 312
313 ProgressBar = new QProgressBar( this, "ProgressBar" ); 313 ProgressBar = new QProgressBar( this, "ProgressBar" );
314 layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); 314 layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4);
315 ProgressBar->setMaximumHeight(10); 315 ProgressBar->setMaximumHeight(10);
316 filterStr="*"; 316 filterStr="*";
317 b=FALSE; 317 b=FALSE;
318 populateLocalView(); 318 populateLocalView();
319 readConfig(); 319 readConfig();
320 320
321// ServerComboBox->setCurrentItem(currentServerConfig); 321// ServerComboBox->setCurrentItem(currentServerConfig);
322 322
323 TabWidget->setCurrentPage(2); 323 TabWidget->setCurrentPage(2);
324} 324}
325 325
326OpieFtp::~OpieFtp() 326OpieFtp::~OpieFtp()
327{ 327{
328} 328}
329 329
330void OpieFtp::cleanUp() 330void OpieFtp::cleanUp()
331{ 331{
332 if(conn) 332 if(conn)
333 FtpQuit(conn); 333 FtpQuit(conn);
334 QString sfile=QDir::homeDirPath(); 334 QString sfile=QDir::homeDirPath();
335 if(sfile.right(1) != "/") 335 if(sfile.right(1) != "/")
336 sfile+="/._temp"; 336 sfile+="/._temp";
337 else 337 else
338 sfile+="._temp"; 338 sfile+="._temp";
339 QFile file( sfile); 339 QFile file( sfile);
340 if(file.exists()) 340 if(file.exists())
341 file.remove(); 341 file.remove();
342 Config cfg("opieftp"); 342 Config cfg("opieftp");
343 cfg.setGroup("Server"); 343 cfg.setGroup("Server");
344 cfg.writeEntry("currentServer", currentServerConfig); 344 cfg.writeEntry("currentServer", currentServerConfig);
345 345
346 exit(0); 346 exit(0);
347} 347}
348 348
349void OpieFtp::tabChanged(QWidget *) 349void OpieFtp::tabChanged(QWidget *)
350{ 350{
351 if (TabWidget->currentPageIndex() == 0) { 351 if (TabWidget->currentPageIndex() == 0) {
352 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); 352 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath());
353 tabMenu->setItemChecked(tabMenu->idAt(0),TRUE); 353 tabMenu->setItemChecked(tabMenu->idAt(0),TRUE);
354 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); 354 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE);
355 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); 355 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE);
356 if(cdUpButton->isHidden()) 356 if(cdUpButton->isHidden())
357 cdUpButton->show(); 357 cdUpButton->show();
358 if(homeButton->isHidden()) 358 if(homeButton->isHidden())
359 homeButton->show(); 359 homeButton->show();
360 360
361 } 361 }
362 if (TabWidget->currentPageIndex() == 1) { 362 if (TabWidget->currentPageIndex() == 1) {
363 currentPathCombo->lineEdit()->setText( currentRemoteDir ); 363 currentPathCombo->lineEdit()->setText( currentRemoteDir );
364 tabMenu->setItemChecked(tabMenu->idAt(1),TRUE); 364 tabMenu->setItemChecked(tabMenu->idAt(1),TRUE);
365 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); 365 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE);
366 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); 366 tabMenu->setItemChecked(tabMenu->idAt(2),FALSE);
367 if(cdUpButton->isHidden()) 367 if(cdUpButton->isHidden())
368 cdUpButton->show(); 368 cdUpButton->show();
369 homeButton->hide(); 369 homeButton->hide();
370 370
371 } 371 }
372 if (TabWidget->currentPageIndex() == 2) { 372 if (TabWidget->currentPageIndex() == 2) {
373 tabMenu->setItemChecked(tabMenu->idAt(2),TRUE); 373 tabMenu->setItemChecked(tabMenu->idAt(2),TRUE);
374 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE); 374 tabMenu->setItemChecked(tabMenu->idAt(0),FALSE);
375 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); 375 tabMenu->setItemChecked(tabMenu->idAt(1),FALSE);
376 cdUpButton->hide(); 376 cdUpButton->hide();
377 homeButton->hide(); 377 homeButton->hide();
378 } 378 }
379} 379}
380 380
381void OpieFtp::newConnection() 381void OpieFtp::newConnection()
382{ 382{
383 UsernameComboBox->lineEdit()->setText(""); 383 UsernameComboBox->lineEdit()->setText("");
384 PasswordEdit->setText( "" ); 384 PasswordEdit->setText( "" );
385 ServerComboBox->lineEdit()->setText( ""); 385 ServerComboBox->lineEdit()->setText( "");
386 remotePath->setText( currentRemoteDir = "/"); 386 remotePath->setText( currentRemoteDir = "/");
387 PortSpinBox->setValue( 21); 387 PortSpinBox->setValue( 21);
388 TabWidget->setCurrentPage(2); 388 TabWidget->setCurrentPage(2);
389} 389}
390 390
391void OpieFtp::serverComboEdited(const QString & ) 391void OpieFtp::serverComboEdited(const QString & )
392{ 392{
393// if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) { 393// if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) {
394// qDebug("ServerComboEdited"); 394// qDebug("ServerComboEdited");
395// // currentServerConfig = -1; 395// // currentServerConfig = -1;
396// } 396// }
397} 397}
398 398
399void OpieFtp::UsernameComboBoxEdited(const QString &) { 399void OpieFtp::UsernameComboBoxEdited(const QString &) {
400// currentServerConfig = -1; 400// currentServerConfig = -1;
401} 401}
402 402
403void OpieFtp::PasswordEditEdited(const QString & ) { 403void OpieFtp::PasswordEditEdited(const QString & ) {
404// currentServerConfig = -1; 404// currentServerConfig = -1;
405} 405}
406 406
407void OpieFtp::connectorBtnToggled(bool On) 407void OpieFtp::connectorBtnToggled(bool On)
408{ 408{
409 if(On) { 409 if(On) {
410 connector(); 410 connector();
411 } else { 411 } else {
412 disConnector(); 412 disConnector();
413 } 413 }
414 414
415} 415}
416 416
417void OpieFtp::connector() 417void OpieFtp::connector()
418{ 418{
419// QCopEnvelope ( "QPE/System", "busy()" ); 419// QCopEnvelope ( "QPE/System", "busy()" );
420// qApp->processEvents(); 420// qApp->processEvents();
421 currentRemoteDir=remotePath->text(); 421 currentRemoteDir=remotePath->text();
422 422
423 if( ServerComboBox->currentText().isEmpty()) { 423 if( ServerComboBox->currentText().isEmpty()) {
424 424
425 QMessageBox::warning(this,tr("Ftp"),tr("Please set the server info"),tr("Ok"),0,0); 425 QMessageBox::warning(this,tr("Ftp"),tr("Please set the server info"),tr("Ok"),0,0);
426 TabWidget->setCurrentPage(2); 426 TabWidget->setCurrentPage(2);
427 ServerComboBox->setFocus(); 427 ServerComboBox->setFocus();
428 connectServerBtn->setOn(FALSE); 428 connectServerBtn->setOn(FALSE);
429 connectServerBtn->setText( tr("Connect")); 429 connectServerBtn->setText( tr("Connect"));
430 return; 430 return;
431 } 431 }
432 432
433 FtpInit(); 433 FtpInit();
434 434
435 TabWidget->setCurrentPage(1); 435 TabWidget->setCurrentPage(1);
436 QString ftp_host = ServerComboBox->currentText(); 436 QString ftp_host = ServerComboBox->currentText();
437 QString ftp_user = UsernameComboBox->currentText(); 437 QString ftp_user = UsernameComboBox->currentText();
438 QString ftp_pass = PasswordEdit->text(); 438 QString ftp_pass = PasswordEdit->text();
439 QString port=PortSpinBox->cleanText(); 439 QString port=PortSpinBox->cleanText();
440 port.stripWhiteSpace(); 440 port.stripWhiteSpace();
441 441
442 Config cfg("opieftp"); 442 Config cfg("opieftp");
443 cfg.setGroup("Server"); 443 cfg.setGroup("Server");
444// int current=cfg.readNumEntry("currentServer", 1); 444// int current=cfg.readNumEntry("currentServer", 1);
445 445
446// if(ftp_host!= cfg.readEntry(QString::number( current))) 446// if(ftp_host!= cfg.readEntry(QString::number( current)))
447// currentServerConfig=-1; 447// currentServerConfig=-1;
448// cfg.setGroup(QString::number(current)); 448// cfg.setGroup(QString::number(current));
449// if( ftp_user != cfg.readEntry("Username")) 449// if( ftp_user != cfg.readEntry("Username"))
450// currentServerConfig=-1; 450// currentServerConfig=-1;
451// if(ftp_pass != cfg.readEntry(cfg.readEntry("Username"))) 451// if(ftp_pass != cfg.readEntry(cfg.readEntry("Username")))
452// currentServerConfig=-1; 452// currentServerConfig=-1;
453 453
454 454
455 if(ftp_host.find("ftp://",0, TRUE) != -1 ) 455 if(ftp_host.find("ftp://",0, TRUE) != -1 )
456 ftp_host=ftp_host.right(ftp_host.length()-6); 456 ftp_host=ftp_host.right(ftp_host.length()-6);
457 ftp_host+=":"+port; 457 ftp_host+=":"+port;
458 458
459 if (!FtpConnect( ftp_host.latin1(), &conn)) { 459 if (!FtpConnect( ftp_host.latin1(), &conn)) {
460 QMessageBox::message(tr("Note"),tr("Unable to connect to\n")+ftp_host); 460 QMessageBox::message(tr("Note"),tr("Unable to connect to\n")+ftp_host);
461 connectServerBtn->setOn(FALSE); 461 connectServerBtn->setOn(FALSE);
462 connectServerBtn->setText( tr("Connect")); 462 connectServerBtn->setText( tr("Connect"));
463 return ; 463 return ;
464 } 464 }
465 465
466 if (!FtpLogin( ftp_user.latin1(), ftp_pass.latin1(),conn )) { 466 if (!FtpLogin( ftp_user.latin1(), ftp_pass.latin1(),conn )) {
467 QString msg; 467 QString msg;
468 msg.sprintf(tr("Unable to log in\n")+"%s",FtpLastResponse(conn)); 468 msg.sprintf(tr("Unable to log in\n")+"%s",FtpLastResponse(conn));
469 msg.replace(QRegExp(":"),"\n"); 469 msg.replace(QRegExp(":"),"\n");
470 QMessageBox::message(tr("Note"),msg); 470 QMessageBox::message(tr("Note"),msg);
471 if(conn) 471 if(conn)
472 FtpQuit(conn); 472 FtpQuit(conn);
473 connectServerBtn->setOn(FALSE); 473 connectServerBtn->setOn(FALSE);
474 connectServerBtn->setText( tr("Connect")); 474 connectServerBtn->setText( tr("Connect"));
475 return ; 475 return ;
476 } 476 }
477 477
478 remoteDirList("/") ; 478 remoteDirList("/") ;
479 setCaption(ftp_host); 479 setCaption(ftp_host);
480 if( currentServerConfig == -1) 480 if( currentServerConfig == -1)
481 writeConfig(); 481 writeConfig();
482 connectServerBtn->setText( tr("Disconnect")); 482 connectServerBtn->setText( tr("Disconnect"));
483// QCopEnvelope ( "QPE/System", "notBusy()" ); 483// QCopEnvelope ( "QPE/System", "notBusy()" );
484} 484}
485 485
486void OpieFtp::disConnector() 486void OpieFtp::disConnector()
487{ 487{
488 if(conn) 488 if(conn)
489 FtpQuit(conn); 489 FtpQuit(conn);
490 setCaption("OpieFtp"); 490 setCaption("OpieFtp");
491 currentRemoteDir="/"; 491 currentRemoteDir="/";
492 Remote_View->clear(); 492 Remote_View->clear();
493 connectServerBtn->setText( tr("Connect")); 493 connectServerBtn->setText( tr("Connect"));
494 connectServerBtn->setOn(FALSE); 494 connectServerBtn->setOn(FALSE);
495 setCaption("OpieFtp"); 495 setCaption("OpieFtp");
496} 496}
497 497
498void OpieFtp::localUpload() 498void OpieFtp::localUpload()
499{ 499{
500 int fsz; 500 int fsz;
501// QCopEnvelope ( "QPE/System", "busy()" ); 501// QCopEnvelope ( "QPE/System", "busy()" );
502// qApp->processEvents(); 502// qApp->processEvents();
503 QList<QListViewItem> * getSelectedItems( QListView * Local_View ); 503 QList<QListViewItem> * getSelectedItems( QListView * Local_View );
504 QListViewItemIterator it( Local_View ); 504 QListViewItemIterator it( Local_View );
505 for ( ; it.current(); ++it ) { 505 for ( ; it.current(); ++it ) {
506 if ( it.current()->isSelected() ) { 506 if ( it.current()->isSelected() ) {
507 QString strItem = it.current()->text(0); 507 QString strItem = it.current()->text(0);
508 QString localFile = currentDir.canonicalPath()+"/"+strItem; 508 QString localFile = currentDir.canonicalPath()+"/"+strItem;
509 QString remoteFile= currentRemoteDir+strItem; 509 QString remoteFile= currentRemoteDir+strItem;
510 QFileInfo fi(localFile); 510 QFileInfo fi(localFile);
511 if( !fi.isDir()) { 511 if( !fi.isDir()) {
512 fsz=fi.size(); 512 fsz=fi.size();
513 ProgressBar->setTotalSteps(fsz); 513 ProgressBar->setTotalSteps(fsz);
514 514
515 FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn); 515 FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn);
516 FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn); 516 FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn);
517 FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); 517 FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn);
518 FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); 518 FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn);
519 qDebug("Put: %s, %s",localFile.latin1(),remoteFile.latin1()); 519 qDebug("Put: %s, %s",localFile.latin1(),remoteFile.latin1());
520 520
521 if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { 521 if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) {
522 QString msg; 522 QString msg;
523 msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); 523 msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn));
524 msg.replace(QRegExp(":"),"\n"); 524 msg.replace(QRegExp(":"),"\n");
525 QMessageBox::message(tr("Note"),msg); 525 QMessageBox::message(tr("Note"),msg);
526 } 526 }
527 } else { 527 } else {
528 QMessageBox::message(tr("Note"),tr("Cannot upload directories")); 528 QMessageBox::message(tr("Note"),tr("Cannot upload directories"));
529 } 529 }
530 ProgressBar->reset(); 530 ProgressBar->reset();
531 nullifyCallBack(); 531 nullifyCallBack();
532 it.current()->setSelected(FALSE); 532 it.current()->setSelected(FALSE);
533 } //end currentSelected 533 } //end currentSelected
534 } 534 }
535 for ( ; it.current(); ++it ) { 535 for ( ; it.current(); ++it ) {
536 Local_View->clearSelection(); 536 Local_View->clearSelection();
537 } 537 }
538 Local_View->clearFocus(); 538 Local_View->clearFocus();
539 TabWidget->setCurrentPage(1); 539 TabWidget->setCurrentPage(1);
540 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate 540 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
541// QCopEnvelope ( "QPE/System", "notBusy()" ); 541// QCopEnvelope ( "QPE/System", "notBusy()" );
542} 542}
543 543
544void OpieFtp::nullifyCallBack() 544void OpieFtp::nullifyCallBack()
545{ 545{
546 FtpOptions(FTPLIB_CALLBACK, 0, conn); 546 FtpOptions(FTPLIB_CALLBACK, 0, conn);
547 FtpOptions(FTPLIB_IDLETIME, 0, conn); 547 FtpOptions(FTPLIB_IDLETIME, 0, conn);
548 FtpOptions(FTPLIB_CALLBACKARG, 0, conn); 548 FtpOptions(FTPLIB_CALLBACKARG, 0, conn);
549 FtpOptions(FTPLIB_CALLBACKBYTES, 0, conn); 549 FtpOptions(FTPLIB_CALLBACKBYTES, 0, conn);
550} 550}
551 551
552void OpieFtp::remoteDownload() 552void OpieFtp::remoteDownload()
553{ 553{
554// qApp->processEvents(); 554// qApp->processEvents();
555 int fsz; 555 int fsz;
556// QCopEnvelope ( "QPE/System", "busy()" ); 556// QCopEnvelope ( "QPE/System", "busy()" );
557 557
558 QList<QListViewItem> * getSelectedItems( QListView * Remote_View ); 558 QList<QListViewItem> * getSelectedItems( QListView * Remote_View );
559 QListViewItemIterator it( Remote_View ); 559 QListViewItemIterator it( Remote_View );
560 for ( ; it.current(); ++it ) { 560 for ( ; it.current(); ++it ) {
561 if ( it.current()->isSelected() ) { 561 if ( it.current()->isSelected() ) {
562 QString strItem = it.current()->text(0); 562 QString strItem = it.current()->text(0);
563// strItem=strItem.right(strItem.length()-1); 563// strItem=strItem.right(strItem.length()-1);
564 QString localFile = currentDir.canonicalPath(); 564 QString localFile = currentDir.canonicalPath();
565 if(localFile.right(1).find("/",0,TRUE) == -1) 565 if(localFile.right(1).find("/",0,TRUE) == -1)
566 localFile += "/"; 566 localFile += "/";
567 localFile += strItem; 567 localFile += strItem;
568// QString localFile = currentDir.canonicalPath()+"/"+strItem; 568// QString localFile = currentDir.canonicalPath()+"/"+strItem;
569 QString remoteFile= currentRemoteDir+strItem; 569 QString remoteFile= currentRemoteDir+strItem;
570 if (!FtpSize( remoteFile.latin1(), &fsz, FTPLIB_ASCII, conn)) 570 if (!FtpSize( remoteFile.latin1(), &fsz, FTPLIB_ASCII, conn))
571 fsz = 0; 571 fsz = 0;
572 QString temp; 572 QString temp;
573 temp.sprintf( remoteFile+" "+" %dkb", fsz); 573 temp.sprintf( remoteFile+" "+" %dkb", fsz);
574 574
575 ProgressBar->setTotalSteps(fsz); 575 ProgressBar->setTotalSteps(fsz);
576 FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn); 576 FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn);
577 FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn); 577 FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn);
578 FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); 578 FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn);
579 FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); 579 FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn);
580 qDebug("Get: %s, %s",localFile.latin1(),remoteFile.latin1()); 580 qDebug("Get: %s, %s",localFile.latin1(),remoteFile.latin1());
581 581
582 if(!FtpGet( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { 582 if(!FtpGet( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) {
583 QString msg; 583 QString msg;
584 msg.sprintf(tr("Unable to download \n")+"%s",FtpLastResponse(conn)); 584 msg.sprintf(tr("Unable to download \n")+"%s",FtpLastResponse(conn));
585 msg.replace(QRegExp(":"),"\n"); 585 msg.replace(QRegExp(":"),"\n");
586 QMessageBox::message(tr("Note"),msg); 586 QMessageBox::message(tr("Note"),msg);
587 } 587 }
588 ProgressBar->reset(); 588 ProgressBar->reset();
589 nullifyCallBack(); 589 nullifyCallBack();
590 it.current()->setSelected(FALSE); 590 it.current()->setSelected(FALSE);
591 } 591 }
592 } 592 }
593 for ( ; it.current(); ++it ) { 593 for ( ; it.current(); ++it ) {
594 Remote_View->clearSelection(); 594 Remote_View->clearSelection();
595 } 595 }
596 Remote_View->setFocus(); 596 Remote_View->setFocus();
597 TabWidget->setCurrentPage(0); 597 TabWidget->setCurrentPage(0);
598 populateLocalView(); 598 populateLocalView();
599// QCopEnvelope ( "QPE/System", "notBusy()" ); 599// QCopEnvelope ( "QPE/System", "notBusy()" );
600} 600}
601 601
602bool OpieFtp::remoteDirList(const QString &dir) 602bool OpieFtp::remoteDirList(const QString &dir)
603{ 603{
604 QString tmp = QDir::homeDirPath(); 604 QString tmp = QDir::homeDirPath();
605 if(tmp.right(1) != "/") 605 if(tmp.right(1) != "/")
606 tmp+="/._temp"; 606 tmp+="/._temp";
607 else 607 else
608 tmp+="._temp"; 608 tmp+="._temp";
609// qDebug("Listing remote dir "+tmp); 609// qDebug("Listing remote dir "+tmp);
610// QCopEnvelope ( "QPE/System", "busy()" ); 610// QCopEnvelope ( "QPE/System", "busy()" );
611 if (!FtpDir( tmp.latin1(), dir.latin1(), conn) ) { 611 if (!FtpDir( tmp.latin1(), dir.latin1(), conn) ) {
612 QString msg; 612 QString msg;
613 msg.sprintf(tr("Unable to list the directory\n")+dir+"\n%s",FtpLastResponse(conn) ); 613 msg.sprintf(tr("Unable to list the directory\n")+dir+"\n%s",FtpLastResponse(conn) );
614 msg.replace(QRegExp(":"),"\n"); 614 msg.replace(QRegExp(":"),"\n");
615 QMessageBox::message(tr("Note"),msg); 615 QMessageBox::message(tr("Note"),msg);
616 return false; 616 return false;
617 } 617 }
618 populateRemoteView() ; 618 populateRemoteView() ;
619// QCopEnvelope ( "QPE/System", "notBusy()" ); 619// QCopEnvelope ( "QPE/System", "notBusy()" );
620 return true; 620 return true;
621} 621}
622 622
623bool OpieFtp::remoteChDir(const QString &dir) 623bool OpieFtp::remoteChDir(const QString &dir)
624{ 624{
625// QCopEnvelope ( "QPE/System", "busy()" ); 625// QCopEnvelope ( "QPE/System", "busy()" );
626 if (!FtpChdir( dir.latin1(), conn )) { 626 if (!FtpChdir( dir.latin1(), conn )) {
627 QString msg; 627 QString msg;
628 msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn)); 628 msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn));
629 msg.replace(QRegExp(":"),"\n"); 629 msg.replace(QRegExp(":"),"\n");
630 QMessageBox::message(tr("Note"),msg); 630 QMessageBox::message(tr("Note"),msg);
631// qDebug(msg); 631// qDebug(msg);
632// QCopEnvelope ( "QPE/System", "notBusy()" ); 632// QCopEnvelope ( "QPE/System", "notBusy()" );
633 return FALSE; 633 return FALSE;
634 } 634 }
635// QCopEnvelope ( "QPE/System", "notBusy()" ); 635// QCopEnvelope ( "QPE/System", "notBusy()" );
636 return TRUE; 636 return TRUE;
637} 637}
638 638
639void OpieFtp::populateLocalView() 639void OpieFtp::populateLocalView()
640{ 640{
641 Local_View->clear(); 641 Local_View->clear();
642 currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 642 currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
643 currentDir.setMatchAllDirs(TRUE); 643 currentDir.setMatchAllDirs(TRUE);
644 currentDir.setNameFilter(filterStr); 644 currentDir.setNameFilter(filterStr);
645 QString fileL, fileS, fileDate; 645 QString fileL, fileS, fileDate;
646 bool isDir=FALSE; 646 bool isDir=FALSE;
647 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 647 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
648 QFileInfoListIterator it(*list); 648 QFileInfoListIterator it(*list);
649 QFileInfo *fi; 649 QFileInfo *fi;
650 while ( (fi=it.current()) ) { 650 while ( (fi=it.current()) ) {
651 if (fi->isSymLink() ){ 651 if (fi->isSymLink() ){
652 QString symLink=fi->readLink(); 652 QString symLink=fi->readLink();
653// qDebug("Symlink detected "+symLink); 653// qDebug("Symlink detected "+symLink);
654 QFileInfo sym( symLink); 654 QFileInfo sym( symLink);
655 fileS.sprintf( "%10i", sym.size() ); 655 fileS.sprintf( "%10i", sym.size() );
656 fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); 656 fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() );
657 fileDate = sym.lastModified().toString(); 657 fileDate = sym.lastModified().toString();
658 } else { 658 } else {
659// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); 659// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL);
660 fileS.sprintf( "%10i", fi->size() ); 660 fileS.sprintf( "%10i", fi->size() );
661 fileL.sprintf( "%s",fi->fileName().data() ); 661 fileL.sprintf( "%s",fi->fileName().data() );
662 fileDate= fi->lastModified().toString(); 662 fileDate= fi->lastModified().toString();
663 if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { 663 if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) {
664 fileL+="/"; 664 fileL+="/";
665 isDir=TRUE; 665 isDir=TRUE;
666// qDebug( fileL); 666// qDebug( fileL);
667 } 667 }
668 } 668 }
669 if(fileL !="./" && fi->exists()) { 669 if(fileL !="./" && fi->exists()) {
670 item = new QListViewItem( Local_View,fileL, fileDate, fileS ); 670 item = new QListViewItem( Local_View,fileL, fileDate, fileS );
671 QPixmap pm; 671 QPixmap pm;
672 672
673 if(isDir || fileL.find("/",0,TRUE) != -1) { 673 if(isDir || fileL.find("/",0,TRUE) != -1) {
674 if( !QDir( fi->filePath() ).isReadable()) 674 if( !QDir( fi->filePath() ).isReadable())
675 pm = Resource::loadPixmap( "lockedfolder" ); 675 pm = Resource::loadPixmap( "lockedfolder" );
676 else 676 else
677 pm= Resource::loadPixmap( "folder" ); 677 pm= Resource::loadPixmap( "folder" );
678 item->setPixmap( 0,pm ); 678 item->setPixmap( 0,pm );
679 } else { 679 } else {
680 if( !fi->isReadable() ) 680 if( !fi->isReadable() )
681 pm = Resource::loadPixmap( "locked" ); 681 pm = Resource::loadPixmap( "locked" );
682 else { 682 else {
683 MimeType mt(fi->filePath()); 683 MimeType mt(fi->filePath());
684 pm=mt.pixmap(); //sets the correct pixmap for mimetype 684 pm=mt.pixmap(); //sets the correct pixmap for mimetype
685 if(pm.isNull()) 685 if(pm.isNull())
686 pm = unknownXpm; 686 pm = unknownXpm;
687 } 687 }
688 } 688 }
689 if( fileL.find("->",0,TRUE) != -1) { 689 if( fileL.find("->",0,TRUE) != -1) {
690 // overlay link image 690 // overlay link image
691 pm= Resource::loadPixmap( "folder" ); 691 pm= Resource::loadPixmap( "folder" );
692 QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); 692 QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
693 QPainter painter( &pm ); 693 QPainter painter( &pm );
694 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); 694 painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
695 pm.setMask( pm.createHeuristicMask( FALSE ) ); 695 pm.setMask( pm.createHeuristicMask( FALSE ) );
696 } 696 }
697 item->setPixmap( 0,pm); 697 item->setPixmap( 0,pm);
698 } 698 }
699 isDir=FALSE; 699 isDir=FALSE;
700 ++it; 700 ++it;
701 } 701 }
702 Local_View->setSorting( 3,FALSE); 702 Local_View->setSorting( 3,FALSE);
703 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() ); 703 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() );
704 fillCombo( (const QString &)currentDir); 704 fillCombo( (const QString &)currentDir);
705} 705}
706 706
707bool OpieFtp::populateRemoteView( ) 707bool OpieFtp::populateRemoteView( )
708{ 708{
709// qDebug("populate remoteview"); 709// qDebug("populate remoteview");
710 QString sfile=QDir::homeDirPath(); 710 QString sfile=QDir::homeDirPath();
711 if(sfile.right(1) != "/") 711 if(sfile.right(1) != "/")
712 sfile+="/._temp"; 712 sfile+="/._temp";
713 else 713 else
714 sfile+="._temp"; 714 sfile+="._temp";
715 QFile file( sfile); 715 QFile file( sfile);
716 Remote_View->clear(); 716 Remote_View->clear();
717 QString s, File_Name; 717 QString s, File_Name;
718 QListViewItem *itemDir=NULL, *itemFile=NULL; 718 QListViewItem *itemDir=NULL, *itemFile=NULL;
719 QRegExp monthRe(" [JFMASOND][eapuecoe][brynlgptvc] [ 0-9][0-9] [ 0-9][0-9][:0-9][0-9][0-9] "); 719 QRegExp monthRe(" [JFMASOND][eapuecoe][brynlgptvc] [ 0-9][0-9] [ 0-9][0-9][:0-9][0-9][0-9] ");
720 QString fileL, fileS, fileDate; 720 QString fileL, fileS, fileDate;
721 if ( file.open(IO_ReadOnly)) { 721 if ( file.open(IO_ReadOnly)) {
722 QTextStream t( &file ); // use a text stream 722 QTextStream t( &file ); // use a text stream
723 while ( !t.eof()) { 723 while ( !t.eof()) {
724 s = t.readLine(); 724 s = t.readLine();
725 725
726 if(s.find("total",0,TRUE) == 0) 726 if(s.find("total",0,TRUE) == 0)
727 continue; 727 continue;
728 728
729 int len, month = monthRe.match(s, 0, &len); 729 int len, month = monthRe.match(s, 0, &len);
730 fileDate = s.mid(month + 1, len - 2); // minus spaces 730 fileDate = s.mid(month + 1, len - 2); // minus spaces
731 fileL = s.right(s.length() - month - len); 731 fileL = s.right(s.length() - month - len);
732 if(s.left(1) == "d") 732 if(s.left(1) == "d")
733 fileL = fileL+"/"; 733 fileL = fileL+"/";
734 fileS = s.mid(month - 8, 8); // FIXME 734 fileS = s.mid(month - 8, 8); // FIXME
735 fileS = fileS.stripWhiteSpace(); 735 fileS = fileS.stripWhiteSpace();
736 736
737 if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) { 737 if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) {
738 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"d"); 738 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"d");
739 item->setPixmap( 0, Resource::loadPixmap( "folder" )); 739 item->setPixmap( 0, Resource::loadPixmap( "folder" ));
740// if(itemDir) 740// if(itemDir)
741 item->moveItem(itemDir); 741 item->moveItem(itemDir);
742 itemDir=item; 742 itemDir=item;
743 } else { 743 } else {
744 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"f"); 744 QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"f");
745 item->setPixmap( 0, Resource::loadPixmap( "fileopen" )); 745 item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
746// if(itemFile) 746// if(itemFile)
747 item->moveItem(itemDir); 747 item->moveItem(itemDir);
748 item->moveItem(itemFile); 748 item->moveItem(itemFile);
749 itemFile=item; 749 itemFile=item;
750 } 750 }
751 } 751 }
752 QListViewItem * item1 = new QListViewItem( Remote_View, "../"); 752 QListViewItem * item1 = new QListViewItem( Remote_View, "../");
753 item1->setPixmap( 0, Resource::loadPixmap( "folder" )); 753 item1->setPixmap( 0, Resource::loadPixmap( "folder" ));
754 file.close(); 754 file.close();
755 if( file.exists()) 755 if( file.exists())
756 file. remove(); 756 file. remove();
757 } else 757 } else
758 qDebug("temp file not opened successfullly "+sfile); 758 qDebug("temp file not opened successfully "+sfile);
759 Remote_View->setSorting( 4,TRUE); 759 Remote_View->setSorting( 4,TRUE);
760 return true; 760 return true;
761} 761}
762 762
763void OpieFtp::remoteListClicked(QListViewItem *selectedItem) 763void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
764{ 764{
765 if( selectedItem) { 765 if( selectedItem) {
766 // if(selectedItem!= NULL) { 766 // if(selectedItem!= NULL) {
767// QCopEnvelope ( "QPE/System", "busy()" ); 767// QCopEnvelope ( "QPE/System", "busy()" );
768 QString oldRemoteCurrentDir = currentRemoteDir; 768 QString oldRemoteCurrentDir = currentRemoteDir;
769 QString strItem=selectedItem->text(0); 769 QString strItem=selectedItem->text(0);
770 strItem=strItem.simplifyWhiteSpace(); 770 strItem=strItem.simplifyWhiteSpace();
771 if(strItem == "../") { // the user wants to go ^ 771 if(strItem == "../") { // the user wants to go ^
772 if( FtpCDUp( conn) == 0) { 772 if( FtpCDUp( conn) == 0) {
773 QString msg; 773 QString msg;
774 msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn)); 774 msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn));
775 msg.replace(QRegExp(":"),"\n"); 775 msg.replace(QRegExp(":"),"\n");
776 QMessageBox::message(tr("Note"),msg); 776 QMessageBox::message(tr("Note"),msg);
777// qDebug(msg); 777// qDebug(msg);
778 } 778 }
779 char path[256]; 779 char path[256];
780 if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string 780 if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string
781 QString msg; 781 QString msg;
782 msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn)); 782 msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn));
783 msg.replace(QRegExp(":"),"\n"); 783 msg.replace(QRegExp(":"),"\n");
784 QMessageBox::message(tr("Note"),msg); 784 QMessageBox::message(tr("Note"),msg);
785// qDebug(msg); 785// qDebug(msg);
786 } 786 }
787 currentRemoteDir=path; 787 currentRemoteDir=path;
788 } else { 788 } else {
789 if(strItem.find("->",0,TRUE) != -1) { //symlink on some servers 789 if(strItem.find("->",0,TRUE) != -1) { //symlink on some servers
790 strItem=strItem.right( strItem.length() - strItem.find("->",0,TRUE) - 2 ); 790 strItem=strItem.right( strItem.length() - strItem.find("->",0,TRUE) - 2 );
791 strItem = strItem.stripWhiteSpace(); 791 strItem = strItem.stripWhiteSpace();
792 currentRemoteDir = strItem; 792 currentRemoteDir = strItem;
793 if( !remoteChDir( (const QString &)strItem)) { 793 if( !remoteChDir( (const QString &)strItem)) {
794 currentRemoteDir = oldRemoteCurrentDir; 794 currentRemoteDir = oldRemoteCurrentDir;
795 strItem=""; 795 strItem="";
796// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); 796// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir);
797 } 797 }
798 } else if(strItem.find("/",0,TRUE) != -1) { // this is a directory 798 } else if(strItem.find("/",0,TRUE) != -1) { // this is a directory
799 if( !remoteChDir( (const QString &)currentRemoteDir + strItem)) { 799 if( !remoteChDir( (const QString &)currentRemoteDir + strItem)) {
800 currentRemoteDir = oldRemoteCurrentDir; 800 currentRemoteDir = oldRemoteCurrentDir;
801 strItem=""; 801 strItem="";
802// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); 802// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir);
803 803
804 } else { 804 } else {
805 currentRemoteDir = currentRemoteDir+strItem; 805 currentRemoteDir = currentRemoteDir+strItem;
806 } 806 }
807 } else { 807 } else {
808// QCopEnvelope ( "QPE/System", "notBusy()" ); 808// QCopEnvelope ( "QPE/System", "notBusy()" );
809 return; 809 return;
810 } 810 }
811 } 811 }
812 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate 812 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
813 if(currentRemoteDir.right(1) !="/") 813 if(currentRemoteDir.right(1) !="/")
814 currentRemoteDir +="/"; 814 currentRemoteDir +="/";
815 currentPathCombo->lineEdit()->setText( currentRemoteDir); 815 currentPathCombo->lineEdit()->setText( currentRemoteDir);
816 fillRemoteCombo( (const QString &)currentRemoteDir); 816 fillRemoteCombo( (const QString &)currentRemoteDir);
817// QCopEnvelope ( "QPE/System", "notBusy()" ); 817// QCopEnvelope ( "QPE/System", "notBusy()" );
818 Remote_View->ensureItemVisible(Remote_View->firstChild()); 818 Remote_View->ensureItemVisible(Remote_View->firstChild());
819 819
820 } 820 }
821} 821}
822 822
823void OpieFtp::localListClicked(QListViewItem *selectedItem) 823void OpieFtp::localListClicked(QListViewItem *selectedItem)
824{ 824{
825 if(selectedItem!= NULL) { 825 if(selectedItem!= NULL) {
826 826
827 QString strItem=selectedItem->text(0); 827 QString strItem=selectedItem->text(0);
828 QString strSize=selectedItem->text(1); 828 QString strSize=selectedItem->text(1);
829 strSize=strSize.stripWhiteSpace(); 829 strSize=strSize.stripWhiteSpace();
830 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink 830 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) { //if symlink
831 // is symlink 831 // is symlink
832 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 832 QString strItem2 = strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
833 if(QDir(strItem2).exists() ) { 833 if(QDir(strItem2).exists() ) {
834 currentDir.cd(strItem2, TRUE); 834 currentDir.cd(strItem2, TRUE);
835 populateLocalView(); 835 populateLocalView();
836 } 836 }
837 } else { // not a symlink 837 } else { // not a symlink
838 if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { 838 if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) {
839 839
840 if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { 840 if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) {
841 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); 841 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem);
842 currentDir.cd(strItem,FALSE); 842 currentDir.cd(strItem,FALSE);
843 populateLocalView(); 843 populateLocalView();
844 } else { 844 } else {
845 currentDir.cdUp(); 845 currentDir.cdUp();
846 populateLocalView(); 846 populateLocalView();
847 } 847 }
848 if(QDir(strItem).exists()){ 848 if(QDir(strItem).exists()){
849 currentDir.cd(strItem, TRUE); 849 currentDir.cd(strItem, TRUE);
850 populateLocalView(); 850 populateLocalView();
851 } 851 }
852 } else { 852 } else {
853 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); 853 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem);
854 if( QFile::exists(strItem ) ) { 854 if( QFile::exists(strItem ) ) {
855 // qDebug("upload "+strItem); 855 // qDebug("upload "+strItem);
856 return; 856 return;
857 } 857 }
858 } //end not symlink 858 } //end not symlink
859 chdir(strItem.latin1()); 859 chdir(strItem.latin1());
860 } 860 }
861 Local_View->ensureItemVisible(Local_View->firstChild()); 861 Local_View->ensureItemVisible(Local_View->firstChild());
862 } 862 }
863} 863}
864 864
865void OpieFtp::doLocalCd() 865void OpieFtp::doLocalCd()
866{ 866{
867 localListClicked( Local_View->currentItem()); 867 localListClicked( Local_View->currentItem());
868} 868}
869 869
870void OpieFtp:: doRemoteCd() 870void OpieFtp:: doRemoteCd()
871{ 871{
872 remoteListClicked( Remote_View->currentItem()); 872 remoteListClicked( Remote_View->currentItem());
873 873
874} 874}
875 875
876void OpieFtp::showHidden() 876void OpieFtp::showHidden()
877{ 877{
878 if (!b) { 878 if (!b) {
879 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 879 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
880 localMenu->setItemChecked(localMenu->idAt(0),TRUE); 880 localMenu->setItemChecked(localMenu->idAt(0),TRUE);
881// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 881// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
882 b=TRUE; 882 b=TRUE;
883 883
884 } else { 884 } else {
885 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 885 currentDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
886 localMenu->setItemChecked(localMenu->idAt(0),FALSE); 886 localMenu->setItemChecked(localMenu->idAt(0),FALSE);
887// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 887// currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
888 b=FALSE; 888 b=FALSE;
889 } 889 }
890 populateLocalView(); 890 populateLocalView();
891} 891}
892 892
893void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &, int) 893void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &, int)
894{ 894{
895// if(item) 895// if(item)
896 if (mouse == 2) { 896 if (mouse == 2) {
897 showLocalMenu(item); 897 showLocalMenu(item);
898 } 898 }
899} 899}
900 900
901void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &, int ) 901void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &, int )
902{ 902{
903 if(mouse == 2) { 903 if(mouse == 2) {
904 showRemoteMenu(item); 904 showRemoteMenu(item);
905 } 905 }
906} 906}
907 907
908void OpieFtp::showRemoteMenu(QListViewItem * item) 908void OpieFtp::showRemoteMenu(QListViewItem * item)
909{ 909{
910 QPopupMenu * m;// = new QPopupMenu( Local_View ); 910 QPopupMenu * m;// = new QPopupMenu( Local_View );
911 m = new QPopupMenu(this); 911 m = new QPopupMenu(this);
912 if(item != NULL ) { 912 if(item != NULL ) {
913 if( item->text(0).find("/",0,TRUE) != -1) 913 if( item->text(0).find("/",0,TRUE) != -1)
914 m->insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() )); 914 m->insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() ));
915 else 915 else
916 m->insertItem( tr( "Download" ), this, SLOT( remoteDownload() )); 916 m->insertItem( tr( "Download" ), this, SLOT( remoteDownload() ));
917 } 917 }
918 m->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); 918 m->insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() ));
919 m->insertItem( tr("Rescan"), this, SLOT( populateLocalView() )); 919 m->insertItem( tr("Rescan"), this, SLOT( populateLocalView() ));
920 m->insertItem( tr( "Rename" ), this, SLOT( remoteRename() )); 920 m->insertItem( tr( "Rename" ), this, SLOT( remoteRename() ));
921 m->insertSeparator(); 921 m->insertSeparator();
922 m->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() )); 922 m->insertItem( tr( "Delete" ), this, SLOT( remoteDelete() ));
923 m->exec( QCursor::pos() ); 923 m->exec( QCursor::pos() );
924 delete m; 924 delete m;
925} 925}
926 926
927void OpieFtp::showLocalMenu(QListViewItem * item) 927void OpieFtp::showLocalMenu(QListViewItem * item)
928{ 928{
929 929
930 QPopupMenu *m; 930 QPopupMenu *m;
931 m = new QPopupMenu( this); 931 m = new QPopupMenu( this);
932 m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() )); 932 m->insertItem( tr( "Show Hidden Files" ), this, SLOT( showHidden() ));
933 m->insertSeparator(); 933 m->insertSeparator();
934 if(item != NULL ) { 934 if(item != NULL ) {
935 if( item->text(0).find("/",0,TRUE) !=-1) 935 if( item->text(0).find("/",0,TRUE) !=-1)
936 m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); 936 m->insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() ));
937 else 937 else
938 m->insertItem( tr( "Upload" ), this, SLOT( localUpload() )); 938 m->insertItem( tr( "Upload" ), this, SLOT( localUpload() ));
939 } 939 }
940 m->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); 940 m->insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() ));
941 m->insertItem( tr("Rescan"), this, SLOT( populateRemoteView() )); 941 m->insertItem( tr("Rescan"), this, SLOT( populateRemoteView() ));
942 m->insertItem( tr( "Rename" ), this, SLOT( localRename() )); 942 m->insertItem( tr( "Rename" ), this, SLOT( localRename() ));
943 m->insertSeparator(); 943 m->insertSeparator();
944 m->insertItem( tr( "Delete" ), this, SLOT( localDelete() )); 944 m->insertItem( tr( "Delete" ), this, SLOT( localDelete() ));
945 m->setCheckable(TRUE); 945 m->setCheckable(TRUE);
946 if (b) 946 if (b)
947 m->setItemChecked(m->idAt(0),TRUE); 947 m->setItemChecked(m->idAt(0),TRUE);
948 else 948 else
949 m->setItemChecked(m->idAt(0),FALSE); 949 m->setItemChecked(m->idAt(0),FALSE);
950 950
951 m->exec( QCursor::pos() ); 951 m->exec( QCursor::pos() );
952 delete m; 952 delete m;
953} 953}
954 954
955void OpieFtp::localMakDir() 955void OpieFtp::localMakDir()
956{ 956{
957 InputDialog *fileDlg; 957 InputDialog *fileDlg;
958 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); 958 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0);
959 fileDlg->exec(); 959 fileDlg->exec();
960 if( fileDlg->result() == 1 ) { 960 if( fileDlg->result() == 1 ) {
961 QString filename = fileDlg->LineEdit1->text(); 961 QString filename = fileDlg->LineEdit1->text();
962 currentDir.mkdir( currentDir.canonicalPath()+"/"+filename); 962 currentDir.mkdir( currentDir.canonicalPath()+"/"+filename);
963 } 963 }
964 populateLocalView(); 964 populateLocalView();
965} 965}
966 966
967void OpieFtp::localDelete() 967void OpieFtp::localDelete()
968{ 968{
969 QList<QListViewItem> * getSelectedItems( QListView * Local_View ); 969 QList<QListViewItem> * getSelectedItems( QListView * Local_View );
970 QListViewItemIterator it( Local_View ); 970 QListViewItemIterator it( Local_View );
971 for ( ; it.current(); ++it ) { 971 for ( ; it.current(); ++it ) {
972 if ( it.current()->isSelected() ) { 972 if ( it.current()->isSelected() ) {
973 QString f = it.current()->text(0); 973 QString f = it.current()->text(0);
974 it.current()->setSelected(FALSE); 974 it.current()->setSelected(FALSE);
975 975
976// QString f = Local_View->currentItem()->text(0); 976// QString f = Local_View->currentItem()->text(0);
977 if(QDir(f).exists() ) { 977 if(QDir(f).exists() ) {
978 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+ 978 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+
979 tr(" ?\nIt must be empty"),tr("Yes"),tr("No"),0,0,1) ) { 979 tr(" ?\nIt must be empty"),tr("Yes"),tr("No"),0,0,1) ) {
980 case 0: { 980 case 0: {
981 f=currentDir.canonicalPath()+"/"+f; 981 f=currentDir.canonicalPath()+"/"+f;
982 QString cmd="rmdir "+f; 982 QString cmd="rmdir "+f;
983 system( cmd.latin1()); 983 system( cmd.latin1());
984 } 984 }
985 break; 985 break;
986 case 1: 986 case 1:
987 // exit 987 // exit
988 break; 988 break;
989 }; 989 };
990 990
991 } else { 991 } else {
992 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f 992 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f
993 +" ?",tr("Yes"),tr("No"),0,0,1) ) { 993 +" ?",tr("Yes"),tr("No"),0,0,1) ) {
994 case 0: { 994 case 0: {
995 f=currentDir.canonicalPath()+"/"+f; 995 f=currentDir.canonicalPath()+"/"+f;
996 QString cmd="rm "+f; 996 QString cmd="rm "+f;
997 system( cmd.latin1()); 997 system( cmd.latin1());
998 } 998 }
999 break; 999 break;
1000 case 1: 1000 case 1:
1001 // exit 1001 // exit
1002 break; 1002 break;
1003 }; 1003 };
1004 } 1004 }
1005 } 1005 }
1006 } 1006 }
1007 populateLocalView(); 1007 populateLocalView();
1008 1008
1009} 1009}
1010 1010
1011void OpieFtp::remoteMakDir() 1011void OpieFtp::remoteMakDir()
1012{ 1012{
1013 InputDialog *fileDlg; 1013 InputDialog *fileDlg;
1014 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); 1014 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0);
1015 fileDlg->exec(); 1015 fileDlg->exec();
1016 if( fileDlg->result() == 1 ) { 1016 if( fileDlg->result() == 1 ) {
1017 QString filename = fileDlg->LineEdit1->text();//+".playlist"; 1017 QString filename = fileDlg->LineEdit1->text();//+".playlist";
1018 QString tmp=currentRemoteDir+filename; 1018 QString tmp=currentRemoteDir+filename;
1019// QCopEnvelope ( "QPE/System", "busy()" ); 1019// QCopEnvelope ( "QPE/System", "busy()" );
1020 if(FtpMkdir( tmp.latin1(), conn) == 0) { 1020 if(FtpMkdir( tmp.latin1(), conn) == 0) {
1021 QString msg; 1021 QString msg;
1022 msg.sprintf(tr("Unable to make directory\n")+"%s",FtpLastResponse(conn)); 1022 msg.sprintf(tr("Unable to make directory\n")+"%s",FtpLastResponse(conn));
1023 msg.replace(QRegExp(":"),"\n"); 1023 msg.replace(QRegExp(":"),"\n");
1024 QMessageBox::message(tr("Note"),msg); 1024 QMessageBox::message(tr("Note"),msg);
1025 } 1025 }
1026// QCopEnvelope ( "QPE/System", "notBusy()" ); 1026// QCopEnvelope ( "QPE/System", "notBusy()" );
1027 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate 1027 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
1028 } 1028 }
1029} 1029}
1030 1030
1031void OpieFtp::remoteDelete() 1031void OpieFtp::remoteDelete()
1032{ 1032{
1033 QList<QListViewItem> * getSelectedItems( QListView * Remote_View ); 1033 QList<QListViewItem> * getSelectedItems( QListView * Remote_View );
1034 QListViewItemIterator it( Remote_View ); 1034 QListViewItemIterator it( Remote_View );
1035 for ( ; it.current(); ++it ) { 1035 for ( ; it.current(); ++it ) {
1036 if ( it.current()->isSelected() ) { 1036 if ( it.current()->isSelected() ) {
1037 QString f = it.current()->text(0); 1037 QString f = it.current()->text(0);
1038// QString f = Remote_View->currentItem()->text(0); 1038// QString f = Remote_View->currentItem()->text(0);
1039// QCopEnvelope ( "QPE/System", "busy()" ); 1039// QCopEnvelope ( "QPE/System", "busy()" );
1040 if( f.right(1) =="/") { 1040 if( f.right(1) =="/") {
1041 QString path= currentRemoteDir+f; 1041 QString path= currentRemoteDir+f;
1042 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+"?" 1042 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+"?"
1043 ,tr("Yes"),tr("No"),0,0,1) ) { 1043 ,tr("Yes"),tr("No"),0,0,1) ) {
1044 case 0: { 1044 case 0: {
1045 f=currentDir.canonicalPath()+"/"+f; 1045 f=currentDir.canonicalPath()+"/"+f;
1046 if(FtpRmdir( path.latin1(), conn) ==0) { 1046 if(FtpRmdir( path.latin1(), conn) ==0) {
1047 QString msg; 1047 QString msg;
1048 msg.sprintf(tr("Unable to remove directory\n")+"%s",FtpLastResponse(conn)); 1048 msg.sprintf(tr("Unable to remove directory\n")+"%s",FtpLastResponse(conn));
1049 msg.replace(QRegExp(":"),"\n"); 1049 msg.replace(QRegExp(":"),"\n");
1050 QMessageBox::message(tr("Note"),msg); 1050 QMessageBox::message(tr("Note"),msg);
1051 } 1051 }
1052 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate 1052 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
1053 } 1053 }
1054 break; 1054 break;
1055 }; 1055 };
1056 } else { 1056 } else {
1057 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+"?" 1057 switch ( QMessageBox::warning(this,tr("Delete"),tr("Do you really want to delete\n")+f+"?"
1058 ,tr("Yes"),tr("No"),0,0,1) ) { 1058 ,tr("Yes"),tr("No"),0,0,1) ) {
1059 case 0: { 1059 case 0: {
1060 QString path= currentRemoteDir+f; 1060 QString path= currentRemoteDir+f;
1061 if(FtpDelete( path.latin1(), conn)==0) { 1061 if(FtpDelete( path.latin1(), conn)==0) {
1062 QString msg; 1062 QString msg;
1063 msg.sprintf(tr("Unable to delete file\n")+"%s",FtpLastResponse(conn)); 1063 msg.sprintf(tr("Unable to delete file\n")+"%s",FtpLastResponse(conn));
1064 msg.replace(QRegExp(":"),"\n"); 1064 msg.replace(QRegExp(":"),"\n");
1065 QMessageBox::message(tr("Note"),msg); 1065 QMessageBox::message(tr("Note"),msg);
1066 } 1066 }
1067 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate 1067 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
1068 } 1068 }
1069 break; 1069 break;
1070 }; 1070 };
1071 } 1071 }
1072 } 1072 }
1073 } 1073 }
1074// QCopEnvelope ( "QPE/System", "notBusy()" ); 1074// QCopEnvelope ( "QPE/System", "notBusy()" );
1075} 1075}
1076 1076
1077void OpieFtp::remoteRename() 1077void OpieFtp::remoteRename()
1078{ 1078{
1079 QString curFile = Remote_View->currentItem()->text(0); 1079 QString curFile = Remote_View->currentItem()->text(0);
1080 InputDialog *fileDlg; 1080 InputDialog *fileDlg;
1081 fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); 1081 fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0);
1082 fileDlg->setTextEdit((const QString &)curFile); 1082 fileDlg->setTextEdit((const QString &)curFile);
1083 fileDlg->exec(); 1083 fileDlg->exec();
1084 if( fileDlg->result() == 1 ) { 1084 if( fileDlg->result() == 1 ) {
1085 QString oldName = currentRemoteDir +"/"+ curFile; 1085 QString oldName = currentRemoteDir +"/"+ curFile;
1086 QString newName = currentRemoteDir +"/"+ fileDlg->LineEdit1->text();//+".playlist"; 1086 QString newName = currentRemoteDir +"/"+ fileDlg->LineEdit1->text();//+".playlist";
1087// QCopEnvelope ( "QPE/System", "busy()" ); 1087// QCopEnvelope ( "QPE/System", "busy()" );
1088 if(FtpRename( oldName.latin1(), newName.latin1(),conn) == 0) { 1088 if(FtpRename( oldName.latin1(), newName.latin1(),conn) == 0) {
1089 QString msg; 1089 QString msg;
1090 msg.sprintf(tr("Unable to rename file\n")+"%s",FtpLastResponse(conn)); 1090 msg.sprintf(tr("Unable to rename file\n")+"%s",FtpLastResponse(conn));
1091 msg.replace(QRegExp(":"),"\n"); 1091 msg.replace(QRegExp(":"),"\n");
1092 QMessageBox::message(tr("Note"),msg); 1092 QMessageBox::message(tr("Note"),msg);
1093 } 1093 }
1094// QCopEnvelope ( "QPE/System", "notBusy()" ); 1094// QCopEnvelope ( "QPE/System", "notBusy()" );
1095 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate 1095 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
1096 } 1096 }
1097} 1097}
1098 1098
1099void OpieFtp::localRename() 1099void OpieFtp::localRename()
1100{ 1100{
1101 QString curFile = Local_View->currentItem()->text(0); 1101 QString curFile = Local_View->currentItem()->text(0);
1102 InputDialog *fileDlg; 1102 InputDialog *fileDlg;
1103 fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0); 1103 fileDlg = new InputDialog(this,tr("Rename"),TRUE, 0);
1104 fileDlg->setTextEdit((const QString &)curFile); 1104 fileDlg->setTextEdit((const QString &)curFile);
1105 fileDlg->exec(); 1105 fileDlg->exec();
1106 if( fileDlg->result() == 1 ) { 1106 if( fileDlg->result() == 1 ) {
1107 QString oldname = currentDir.canonicalPath() + "/" + curFile; 1107 QString oldname = currentDir.canonicalPath() + "/" + curFile;
1108 QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist"; 1108 QString newName = currentDir.canonicalPath() + "/" + fileDlg->LineEdit1->text();//+".playlist";
1109 if( rename(oldname.latin1(), newName.latin1())== -1) 1109 if( rename(oldname.latin1(), newName.latin1())== -1)
1110 QMessageBox::message(tr("Note"),tr("Could not rename")); 1110 QMessageBox::message(tr("Note"),tr("Could not rename"));
1111 } 1111 }
1112 populateLocalView(); 1112 populateLocalView();
1113} 1113}
1114 1114
1115void OpieFtp::currentPathComboActivated(const QString & currentPath) { 1115void OpieFtp::currentPathComboActivated(const QString & currentPath) {
1116 if (TabWidget->currentPageIndex() == 0) { 1116 if (TabWidget->currentPageIndex() == 0) {
1117 chdir( currentPath.latin1() ); 1117 chdir( currentPath.latin1() );
1118 currentDir.cd( currentPath, TRUE); 1118 currentDir.cd( currentPath, TRUE);
1119 populateLocalView(); 1119 populateLocalView();
1120 update(); 1120 update();
1121 } else { 1121 } else {
1122// chdir( currentPath.latin1() ); 1122// chdir( currentPath.latin1() );
1123// currentDir.cd( currentPath, TRUE); 1123// currentDir.cd( currentPath, TRUE);
1124// populateList(); 1124// populateList();
1125// update(); 1125// update();
1126 1126
1127 } 1127 }
1128} 1128}
1129 1129
1130void OpieFtp::fillCombo(const QString &currentPath) { 1130void OpieFtp::fillCombo(const QString &currentPath) {
1131 1131
1132 currentPathCombo->lineEdit()->setText(currentPath); 1132 currentPathCombo->lineEdit()->setText(currentPath);
1133 if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { 1133 if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
1134 currentPathCombo->clear(); 1134 currentPathCombo->clear();
1135 localDirPathStringList.prepend(currentPath ); 1135 localDirPathStringList.prepend(currentPath );
1136 currentPathCombo->insertStringList( localDirPathStringList,-1); 1136 currentPathCombo->insertStringList( localDirPathStringList,-1);
1137 } 1137 }
1138 currentPathCombo->lineEdit()->setText(currentPath); 1138 currentPathCombo->lineEdit()->setText(currentPath);
1139 if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { 1139 if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
1140 currentPathCombo->clear(); 1140 currentPathCombo->clear();
1141 remoteDirPathStringList.prepend(currentPath ); 1141 remoteDirPathStringList.prepend(currentPath );
1142 currentPathCombo->insertStringList( remoteDirPathStringList,-1); 1142 currentPathCombo->insertStringList( remoteDirPathStringList,-1);
1143 } 1143 }
1144} 1144}
1145 1145
1146void OpieFtp::fillRemoteCombo(const QString &currentPath) { 1146void OpieFtp::fillRemoteCombo(const QString &currentPath) {
1147 1147
1148 currentPathCombo->lineEdit()->setText(currentPath); 1148 currentPathCombo->lineEdit()->setText(currentPath);
1149 if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { 1149 if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) {
1150 currentPathCombo->clear(); 1150 currentPathCombo->clear();
1151 remoteDirPathStringList.prepend(currentPath ); 1151 remoteDirPathStringList.prepend(currentPath );
1152 currentPathCombo->insertStringList( remoteDirPathStringList,-1); 1152 currentPathCombo->insertStringList( remoteDirPathStringList,-1);
1153 } 1153 }
1154} 1154}
1155 1155
1156void OpieFtp::currentPathComboChanged() 1156void OpieFtp::currentPathComboChanged()
1157{ 1157{
1158 QString oldRemoteCurrentDir = currentRemoteDir; 1158 QString oldRemoteCurrentDir = currentRemoteDir;
1159// qDebug("oldRemoteCurrentDir "+oldRemoteCurrentDir); 1159// qDebug("oldRemoteCurrentDir "+oldRemoteCurrentDir);
1160 if (TabWidget->currentPageIndex() == 0) { 1160 if (TabWidget->currentPageIndex() == 0) {
1161 if(QDir( currentPathCombo->lineEdit()->text()).exists()) { 1161 if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
1162 currentDir.setPath( currentPathCombo->lineEdit()->text() ); 1162 currentDir.setPath( currentPathCombo->lineEdit()->text() );
1163 populateLocalView(); 1163 populateLocalView();
1164 } else { 1164 } else {
1165 QMessageBox::message(tr("Note"),tr("That directory does not exist")); 1165 QMessageBox::message(tr("Note"),tr("That directory does not exist"));
1166 } 1166 }
1167 } 1167 }
1168 if (TabWidget->currentPageIndex() == 1) { 1168 if (TabWidget->currentPageIndex() == 1) {
1169 currentRemoteDir = currentPathCombo->lineEdit()->text(); 1169 currentRemoteDir = currentPathCombo->lineEdit()->text();
1170 if(currentRemoteDir.right(1) !="/") { 1170 if(currentRemoteDir.right(1) !="/") {
1171 currentRemoteDir = currentRemoteDir +"/"; 1171 currentRemoteDir = currentRemoteDir +"/";
1172 currentPathCombo->lineEdit()->setText( currentRemoteDir ); 1172 currentPathCombo->lineEdit()->setText( currentRemoteDir );
1173 } 1173 }
1174 if( !remoteChDir( (const QString &)currentRemoteDir) ) { 1174 if( !remoteChDir( (const QString &)currentRemoteDir) ) {
1175 currentRemoteDir = oldRemoteCurrentDir; 1175 currentRemoteDir = oldRemoteCurrentDir;
1176 currentPathCombo->lineEdit()->setText( currentRemoteDir ); 1176 currentPathCombo->lineEdit()->setText( currentRemoteDir );
1177 } 1177 }
1178 1178
1179 remoteDirList( (const QString &)currentRemoteDir); 1179 remoteDirList( (const QString &)currentRemoteDir);
1180 } 1180 }
1181} 1181}
1182 1182
1183void OpieFtp::switchToLocalTab() 1183void OpieFtp::switchToLocalTab()
1184{ 1184{
1185 TabWidget->setCurrentPage(0); 1185 TabWidget->setCurrentPage(0);
1186} 1186}
1187 1187
1188void OpieFtp::switchToRemoteTab() 1188void OpieFtp::switchToRemoteTab()
1189{ 1189{
1190 TabWidget->setCurrentPage(1); 1190 TabWidget->setCurrentPage(1);
1191} 1191}
1192 1192
1193void OpieFtp::switchToConfigTab() 1193void OpieFtp::switchToConfigTab()
1194{ 1194{
1195 TabWidget->setCurrentPage(2); 1195 TabWidget->setCurrentPage(2);
1196} 1196}
1197 1197
1198void OpieFtp::readConfig() 1198void OpieFtp::readConfig()
1199{ 1199{
1200 fillCombos(); 1200 fillCombos();
1201 Config cfg("opieftp"); 1201 Config cfg("opieftp");
1202 cfg.setGroup("Server"); 1202 cfg.setGroup("Server");
1203 currentServerConfig = cfg.readNumEntry("currentServer", -1); 1203 currentServerConfig = cfg.readNumEntry("currentServer", -1);
1204 1204
1205// qDebug("Reading %d", currentServerConfig); 1205// qDebug("Reading %d", currentServerConfig);
1206 serverComboSelected( currentServerConfig-1); 1206 serverComboSelected( currentServerConfig-1);
1207 1207
1208} 1208}
1209 1209
1210void OpieFtp::writeConfig() 1210void OpieFtp::writeConfig()
1211{ 1211{
1212 qDebug("write config"); 1212 qDebug("write config");
1213 Config cfg("opieftp"); 1213 Config cfg("opieftp");
1214 cfg.setGroup("Server"); 1214 cfg.setGroup("Server");
1215 1215
1216 QString username, remoteServerStr, remotePathStr, password, port, temp; 1216 QString username, remoteServerStr, remotePathStr, password, port, temp;
1217 1217
1218 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1218 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
1219 1219
1220 if( currentServerConfig == -1) { 1220 if( currentServerConfig == -1) {
1221 1221
1222 for (int i = 1; i <= numberOfEntries; i++) { 1222 for (int i = 1; i <= numberOfEntries; i++) {
1223 temp.setNum(i); 1223 temp.setNum(i);
1224 cfg.setGroup("Server"); 1224 cfg.setGroup("Server");
1225 QString tempStr = cfg.readEntry( temp,""); 1225 QString tempStr = cfg.readEntry( temp,"");
1226 } 1226 }
1227 1227
1228 temp.setNum( numberOfEntries + 1); 1228 temp.setNum( numberOfEntries + 1);
1229 cfg.setGroup("Server"); 1229 cfg.setGroup("Server");
1230 1230
1231 remoteServerStr = cfg.readEntry( temp,""); 1231 remoteServerStr = cfg.readEntry( temp,"");
1232 1232
1233 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); 1233 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE);
1234 remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider); 1234 remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider);
1235 1235
1236 temp.setNum(numberOfEntries+1); 1236 temp.setNum(numberOfEntries+1);
1237 cfg.setGroup("Server"); 1237 cfg.setGroup("Server");
1238 1238
1239 cfg.writeEntry( temp, ServerComboBox->currentText() +":"+PortSpinBox->cleanText() ); 1239 cfg.writeEntry( temp, ServerComboBox->currentText() +":"+PortSpinBox->cleanText() );
1240 cfg.writeEntry("currentServer", numberOfEntries+1); 1240 cfg.writeEntry("currentServer", numberOfEntries+1);
1241 1241
1242 currentServerConfig = numberOfEntries+1; 1242 currentServerConfig = numberOfEntries+1;
1243 qDebug("setting currentserverconfig to %d", currentServerConfig); 1243 qDebug("setting currentserverconfig to %d", currentServerConfig);
1244 1244
1245 cfg.setGroup(temp); 1245 cfg.setGroup(temp);
1246 if(!newServerName.isEmpty()) 1246 if(!newServerName.isEmpty())
1247 cfg.writeEntry("ServerName", newServerName); 1247 cfg.writeEntry("ServerName", newServerName);
1248 1248
1249 cfg.writeEntry("RemotePath", remotePath->text()); 1249 cfg.writeEntry("RemotePath", remotePath->text());
1250 1250
1251 cfg.writeEntry("Username", UsernameComboBox->currentText()); 1251 cfg.writeEntry("Username", UsernameComboBox->currentText());
1252 1252
1253 cfg.writeEntryCrypt( UsernameComboBox->currentText(), PasswordEdit->text()); 1253 cfg.writeEntryCrypt( UsernameComboBox->currentText(), PasswordEdit->text());
1254 cfg.setGroup("Server"); 1254 cfg.setGroup("Server");
1255 1255
1256 cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); 1256 cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 ));
1257 1257
1258 } 1258 }
1259} 1259}
1260 1260
1261void OpieFtp::clearCombos() { 1261void OpieFtp::clearCombos() {
1262 qDebug("clearing"); 1262 qDebug("clearing");
1263 ServerComboBox->clear(); 1263 ServerComboBox->clear();
1264 UsernameComboBox->clear(); 1264 UsernameComboBox->clear();
1265 PasswordEdit->clear(); 1265 PasswordEdit->clear();
1266 serverListView->clear(); 1266 serverListView->clear();
1267} 1267}
1268 1268
1269 1269
1270void OpieFtp::fillCombos() 1270void OpieFtp::fillCombos()
1271{ 1271{
1272 clearCombos(); 1272 clearCombos();
1273 1273
1274 Config cfg("opieftp"); 1274 Config cfg("opieftp");
1275 cfg.setGroup("Server"); 1275 cfg.setGroup("Server");
1276 QString username, remoteServerStr, remotePathStr, password, port, temp; 1276 QString username, remoteServerStr, remotePathStr, password, port, temp;
1277 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1277 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
1278 1278
1279 for (int i = 1; i <= numberOfEntries; i++) { 1279 for (int i = 1; i <= numberOfEntries; i++) {
1280 temp.setNum(i); 1280 temp.setNum(i);
1281 qDebug(temp); 1281 qDebug(temp);
1282 cfg.setGroup("Server"); 1282 cfg.setGroup("Server");
1283 remoteServerStr = cfg.readEntry( temp,""); 1283 remoteServerStr = cfg.readEntry( temp,"");
1284 qDebug( remoteServerStr); 1284 qDebug( remoteServerStr);
1285 1285
1286 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); 1286 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE);
1287 port = remoteServerStr.right( divider - 1); 1287 port = remoteServerStr.right( divider - 1);
1288 bool ok; 1288 bool ok;
1289 PortSpinBox->setValue( port.toInt(&ok,10)); 1289 PortSpinBox->setValue( port.toInt(&ok,10));
1290 1290
1291 remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider); 1291 remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider);
1292 qDebug( "remote server string "+remoteServerStr); 1292 qDebug( "remote server string "+remoteServerStr);
1293 ServerComboBox->insertItem( remoteServerStr ); 1293 ServerComboBox->insertItem( remoteServerStr );
1294 1294
1295 cfg.setGroup(temp); 1295 cfg.setGroup(temp);
1296 1296
1297 username = cfg.readEntry(temp); 1297 username = cfg.readEntry(temp);
1298 UsernameComboBox->insertItem(username); 1298 UsernameComboBox->insertItem(username);
1299 password = cfg.readEntryCrypt(username,""); 1299 password = cfg.readEntryCrypt(username,"");
1300 PasswordEdit->setText(password); 1300 PasswordEdit->setText(password);
1301 1301
1302 serverListView->insertItem( cfg.readEntry("ServerName")); 1302 serverListView->insertItem( cfg.readEntry("ServerName"));
1303 } 1303 }
1304} 1304}
1305 1305
1306 1306
1307void OpieFtp::serverComboSelected(int index) 1307void OpieFtp::serverComboSelected(int index)
1308{ 1308{
1309 currentServerConfig = index+1; 1309 currentServerConfig = index+1;
1310 qDebug("server combo selected %d", index+1); 1310 qDebug("server combo selected %d", index+1);
1311 QString username, remoteServerStr, remotePathStr, password, port, temp; 1311 QString username, remoteServerStr, remotePathStr, password, port, temp;
1312// remoteServerStr = ServerComboBox->text(index); 1312// remoteServerStr = ServerComboBox->text(index);
1313 1313
1314 Config cfg("opieftp"); 1314 Config cfg("opieftp");
1315 cfg.setGroup("Server"); 1315 cfg.setGroup("Server");
1316// int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1316// int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
1317 1317
1318 temp.setNum(index+1); 1318 temp.setNum(index+1);
1319 remoteServerStr = cfg.readEntry( temp,""); 1319 remoteServerStr = cfg.readEntry( temp,"");
1320 1320
1321 qDebug("Group" +temp); 1321 qDebug("Group" +temp);
1322 cfg.setGroup(temp); 1322 cfg.setGroup(temp);
1323// qDebug(temp); 1323// qDebug(temp);
1324 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); 1324 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE);
1325 port = remoteServerStr.right( divider - 1); 1325 port = remoteServerStr.right( divider - 1);
1326 bool ok; 1326 bool ok;
1327 int portInt = port.toInt(&ok,10); 1327 int portInt = port.toInt(&ok,10);
1328 if( portInt == 0) portInt = 21; 1328 if( portInt == 0) portInt = 21;
1329 1329
1330 ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE))); 1330 ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE)));
1331 1331
1332 PortSpinBox->setValue( portInt); 1332 PortSpinBox->setValue( portInt);
1333 1333
1334 remotePath->setText(cfg.readEntry("RemotePath", "/")); 1334 remotePath->setText(cfg.readEntry("RemotePath", "/"));
1335 1335
1336 username = cfg.readEntry("Username", "anonymous"); 1336 username = cfg.readEntry("Username", "anonymous");
1337 UsernameComboBox->lineEdit()->setText(username); 1337 UsernameComboBox->lineEdit()->setText(username);
1338 qDebug(username); 1338 qDebug(username);
1339// qDebug("Password is "+cfg.readEntryCrypt(username, "me@opieftp.org")); 1339// qDebug("Password is "+cfg.readEntryCrypt(username, "me@opieftp.org"));
1340 PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); 1340 PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org"));
1341// UsernameComboBox 1341// UsernameComboBox
1342// PasswordEdit 1342// PasswordEdit
1343 1343
1344 cfg.setGroup("Server"); 1344 cfg.setGroup("Server");
1345 temp.sprintf("%d",currentServerConfig); 1345 temp.sprintf("%d",currentServerConfig);
1346 cfg.writeEntry("currentServer", temp); 1346 cfg.writeEntry("currentServer", temp);
1347 1347
1348 fuckeduphack = TRUE; 1348 fuckeduphack = TRUE;
1349 serverListView->setCurrentItem( index); 1349 serverListView->setCurrentItem( index);
1350 fuckeduphack=FALSE; 1350 fuckeduphack=FALSE;
1351 qDebug("server list set selected %d",index); 1351 qDebug("server list set selected %d",index);
1352 update(); 1352 update();
1353} 1353}
1354 1354
1355void OpieFtp::deleteServer() 1355void OpieFtp::deleteServer()
1356{ 1356{
1357 QString username, remoteServerStr, remotePathStr, password, port, temp, servername; 1357 QString username, remoteServerStr, remotePathStr, password, port, temp, servername;
1358 remoteServerStr = ServerComboBox->currentText( ); 1358 remoteServerStr = ServerComboBox->currentText( );
1359 username = UsernameComboBox->currentText(); 1359 username = UsernameComboBox->currentText();
1360 servername=serverListView->currentText(); 1360 servername=serverListView->currentText();
1361 1361
1362 Config cfg("opieftp"); 1362 Config cfg("opieftp");
1363 cfg.setGroup("Server"); 1363 cfg.setGroup("Server");
1364 QString tempname; 1364 QString tempname;
1365 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1365 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
1366 1366
1367 for (int i = 1; i <= numberOfEntries; i++) { 1367 for (int i = 1; i <= numberOfEntries; i++) {
1368 temp.setNum(i); 1368 temp.setNum(i);
1369// cfg.setGroup("Server"); 1369// cfg.setGroup("Server");
1370 cfg.setGroup(QString::number(i)); 1370 cfg.setGroup(QString::number(i));
1371 tempname=cfg.readEntry( "ServerName",""); 1371 tempname=cfg.readEntry( "ServerName","");
1372 1372
1373 if( tempname.find( servername,0,TRUE) != -1 ) { 1373 if( tempname.find( servername,0,TRUE) != -1 ) {
1374// servername.find( cfg.readEntry("ServerName")) != -1 && 1374// servername.find( cfg.readEntry("ServerName")) != -1 &&
1375// remoteServerStr.find( cfg.readEntry("RemotePath")) != -1 && 1375// remoteServerStr.find( cfg.readEntry("RemotePath")) != -1 &&
1376// username.find( cfg.readEntry("Username")) != -1) { 1376// username.find( cfg.readEntry("Username")) != -1) {
1377 1377
1378 serverListView->removeItem(i); 1378 serverListView->removeItem(i);
1379 1379
1380 qDebug("OK DELETE "+tempname); 1380 qDebug("OK DELETE "+tempname);
1381 cfg.removeEntry(QString::number(i)); 1381 cfg.removeEntry(QString::number(i));
1382 for ( ; i <= numberOfEntries; i++) { 1382 for ( ; i <= numberOfEntries; i++) {
1383 cfg.setGroup("Server"); 1383 cfg.setGroup("Server");
1384 cfg.writeEntry("Server", QString::number(numberOfEntries + 1 )); 1384 cfg.writeEntry("Server", QString::number(numberOfEntries + 1 ));
1385 1385
1386 cfg.setGroup(QString::number(i+1)); //get next server config 1386 cfg.setGroup(QString::number(i+1)); //get next server config
1387 servername=cfg.readEntry("ServerName"); 1387 servername=cfg.readEntry("ServerName");
1388 remoteServerStr=cfg.readEntry("RemotePath"); 1388 remoteServerStr=cfg.readEntry("RemotePath");
1389 username=cfg.readEntry("Username"); 1389 username=cfg.readEntry("Username");
1390 password=cfg.readEntryCrypt( username); 1390 password=cfg.readEntryCrypt( username);
1391 1391
1392 cfg.setGroup(QString::number(i)); 1392 cfg.setGroup(QString::number(i));
1393 1393
1394 cfg.writeEntry("RemotePath", remoteServerStr); 1394 cfg.writeEntry("RemotePath", remoteServerStr);
1395 cfg.writeEntry("ServerName", servername); 1395 cfg.writeEntry("ServerName", servername);
1396 cfg.writeEntry("Username", username); 1396 cfg.writeEntry("Username", username);
1397 cfg.writeEntryCrypt( username, password); 1397 cfg.writeEntryCrypt( username, password);
1398 1398
1399 } 1399 }
1400 cfg.setGroup("Server"); 1400 cfg.setGroup("Server");
1401 cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries - 1 )); 1401 cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries - 1 ));
1402 } 1402 }
1403 } 1403 }
1404 cfg.setGroup(QString::number(numberOfEntries)); 1404 cfg.setGroup(QString::number(numberOfEntries));
1405 cfg.removeEntry("Server"); 1405 cfg.removeEntry("Server");
1406 cfg.removeEntry("RemotePath"); 1406 cfg.removeEntry("RemotePath");
1407 cfg.removeEntry("ServerName"); 1407 cfg.removeEntry("ServerName");
1408 username=cfg.readEntry("Username"); 1408 username=cfg.readEntry("Username");
1409 cfg.removeEntry("Username"); 1409 cfg.removeEntry("Username");
1410 cfg.removeEntry(username); 1410 cfg.removeEntry(username);
1411 1411
1412 currentServerConfig=currentServerConfig-1; 1412 currentServerConfig=currentServerConfig-1;
1413 1413
1414 fillCombos(); 1414 fillCombos();
1415 update(); 1415 update();
1416} 1416}
1417 1417
1418void OpieFtp::upDir() 1418void OpieFtp::upDir()
1419{ 1419{
1420 if (TabWidget->currentPageIndex() == 0) { 1420 if (TabWidget->currentPageIndex() == 0) {
1421 QString current = currentDir.canonicalPath(); 1421 QString current = currentDir.canonicalPath();
1422 QDir dir(current); 1422 QDir dir(current);
1423 dir.cdUp(); 1423 dir.cdUp();
1424 current = dir.canonicalPath(); 1424 current = dir.canonicalPath();
1425 chdir( current.latin1() ); 1425 chdir( current.latin1() );
1426 currentDir.cd( current, TRUE); 1426 currentDir.cd( current, TRUE);
1427 populateLocalView(); 1427 populateLocalView();
1428 update(); 1428 update();
1429 } else { 1429 } else {
1430 if( FtpCDUp( conn) == 0) { 1430 if( FtpCDUp( conn) == 0) {
1431 QString msg; 1431 QString msg;
1432 msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn)); 1432 msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn));
1433 msg.replace(QRegExp(":"),"\n"); 1433 msg.replace(QRegExp(":"),"\n");
1434 QMessageBox::message(tr("Note"),msg); 1434 QMessageBox::message(tr("Note"),msg);
1435// qDebug(msg); 1435// qDebug(msg);
1436 } 1436 }
1437 char path[256]; 1437 char path[256];
1438 if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string 1438 if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string
1439 QString msg; 1439 QString msg;
1440 msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn)); 1440 msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn));
1441 msg.replace(QRegExp(":"),"\n"); 1441 msg.replace(QRegExp(":"),"\n");
1442 QMessageBox::message(tr("Note"),msg); 1442 QMessageBox::message(tr("Note"),msg);
1443// qDebug(msg); 1443// qDebug(msg);
1444 } 1444 }
1445 currentRemoteDir=path; 1445 currentRemoteDir=path;
1446 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate 1446 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
1447 if(currentRemoteDir.right(1) !="/") 1447 if(currentRemoteDir.right(1) !="/")
1448 currentRemoteDir +="/"; 1448 currentRemoteDir +="/";
1449 currentPathCombo->lineEdit()->setText( currentRemoteDir); 1449 currentPathCombo->lineEdit()->setText( currentRemoteDir);
1450 fillRemoteCombo( (const QString &)currentRemoteDir); 1450 fillRemoteCombo( (const QString &)currentRemoteDir);
1451 1451
1452 } 1452 }
1453} 1453}
1454 1454
1455void OpieFtp::docButtonPushed() { 1455void OpieFtp::docButtonPushed() {
1456 QString current = QPEApplication::documentDir(); 1456 QString current = QPEApplication::documentDir();
1457 chdir( current.latin1() ); 1457 chdir( current.latin1() );
1458 currentDir.cd( current, TRUE); 1458 currentDir.cd( current, TRUE);
1459 populateLocalView(); 1459 populateLocalView();
1460 update(); 1460 update();
1461 1461
1462} 1462}
1463 1463
1464void OpieFtp::homeButtonPushed() { 1464void OpieFtp::homeButtonPushed() {
1465 QString current = QDir::homeDirPath(); 1465 QString current = QDir::homeDirPath();
1466 chdir( current.latin1() ); 1466 chdir( current.latin1() );
1467 currentDir.cd( current, TRUE); 1467 currentDir.cd( current, TRUE);
1468 populateLocalView(); 1468 populateLocalView();
1469 update(); 1469 update();
1470} 1470}
1471 1471
1472void OpieFtp::doAbout() { 1472void OpieFtp::doAbout() {
1473 QMessageBox::message("OpieFtp","Opie ftp client is copyright 2002 by\n" 1473 QMessageBox::message("OpieFtp","Opie ftp client is copyright 2002 by\n"
1474 "L.J.Potter<llornkcor@handhelds.org>\n" 1474 "L.J.Potter<llornkcor@handhelds.org>\n"
1475 "and uses ftplib copyright 1996-2000\n" 1475 "and uses ftplib copyright 1996-2000\n"
1476 "by Thomas Pfau, pfau@cnj.digex.net\n\n" 1476 "by Thomas Pfau, pfau@cnj.digex.net\n\n"
1477 "and is licensed by the GPL"); 1477 "and is licensed by the GPL");
1478} 1478}
1479 1479
1480void OpieFtp::NewServer() { 1480void OpieFtp::NewServer() {
1481 InputDialog *fileDlg; 1481 InputDialog *fileDlg;
1482 fileDlg = new InputDialog(this,tr("New Server name"),TRUE, 0); 1482 fileDlg = new InputDialog(this,tr("New Server name"),TRUE, 0);
1483 fileDlg->exec(); 1483 fileDlg->exec();
1484 Config cfg("opieftp"); 1484 Config cfg("opieftp");
1485 if( fileDlg->result() == 1 ) { 1485 if( fileDlg->result() == 1 ) {
1486 newServerName = fileDlg->LineEdit1->text(); 1486 newServerName = fileDlg->LineEdit1->text();
1487 for(int i=1;i<serverListView->count();i++) { 1487 for(int i=1;i<serverListView->count();i++) {
1488 cfg.setGroup( QString::number(i)); 1488 cfg.setGroup( QString::number(i));
1489 if(cfg.readEntry("ServerName").find(newServerName,0,TRUE) != -1) { 1489 if(cfg.readEntry("ServerName").find(newServerName,0,TRUE) != -1) {
1490 QMessageBox::message(tr("OpieFtp"),tr("Sorry name already taken")); 1490 QMessageBox::message(tr("OpieFtp"),tr("Sorry name already taken"));
1491 return; 1491 return;
1492 } 1492 }
1493 } 1493 }
1494 currentServerConfig =-1; 1494 currentServerConfig =-1;
1495 writeConfig(); 1495 writeConfig();
1496 serverListView->insertItem( newServerName ); 1496 serverListView->insertItem( newServerName );
1497 serverListView->setCurrentItem( serverListView->count()); 1497 serverListView->setCurrentItem( serverListView->count());
1498 } 1498 }
1499} 1499}
1500 1500
1501void OpieFtp::serverListClicked( const QString &item) { 1501void OpieFtp::serverListClicked( const QString &item) {
1502 if(item.isEmpty()) return; 1502 if(item.isEmpty()) return;
1503 Config cfg("opieftp"); 1503 Config cfg("opieftp");
1504 qDebug("highltined "+item); 1504 qDebug("highltined "+item);
1505 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1505 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
1506 for (int i = 1; i <= numberOfEntries; i++) { 1506 for (int i = 1; i <= numberOfEntries; i++) {
1507 cfg.setGroup(QString::number(i)); 1507 cfg.setGroup(QString::number(i));
1508 if(cfg.readEntry( "ServerName").find(item) != -1 && !fuckeduphack) 1508 if(cfg.readEntry( "ServerName").find(item) != -1 && !fuckeduphack)
1509 serverComboSelected(i-1); 1509 serverComboSelected(i-1);
1510 } 1510 }
1511} 1511}
1512 1512
1513void OpieFtp::timerOut() { 1513void OpieFtp::timerOut() {
1514 1514
1515} 1515}
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 477e24d..93bedf6 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -1,471 +1,471 @@
1 1
2#include "backuprestore.h" 2#include "backuprestore.h"
3//#include "output.h" 3//#include "output.h"
4#include "errordialog.h" 4#include "errordialog.h"
5 5
6#include <qapplication.h> 6#include <qapplication.h>
7#include <qmultilineedit.h> 7#include <qmultilineedit.h>
8 8
9#include <qdir.h> 9#include <qdir.h>
10#include <qfile.h> 10#include <qfile.h>
11#include <qfileinfo.h> 11#include <qfileinfo.h>
12#include <qlistview.h> 12#include <qlistview.h>
13#include <qpushbutton.h> 13#include <qpushbutton.h>
14#include <qheader.h> 14#include <qheader.h>
15#include <qpe/resource.h> 15#include <qpe/resource.h>
16#include <qpe/config.h> 16#include <qpe/config.h>
17#include <qmessagebox.h> 17#include <qmessagebox.h>
18#include <qcombobox.h> 18#include <qcombobox.h>
19#include <qlist.h> 19#include <qlist.h>
20#include <stdlib.h> 20#include <stdlib.h>
21#include <qregexp.h> 21#include <qregexp.h>
22#include <qtextstream.h> 22#include <qtextstream.h>
23#include <qtextview.h> 23#include <qtextview.h>
24#include <qpe/storage.h> 24#include <qpe/storage.h>
25 25
26#include <errno.h> 26#include <errno.h>
27#include <stdlib.h> 27#include <stdlib.h>
28#include <unistd.h> 28#include <unistd.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#include <dirent.h> 30#include <dirent.h>
31 31
32#define HEADER_NAME 0 32#define HEADER_NAME 0
33#define HEADER_BACKUP 1 33#define HEADER_BACKUP 1
34#define BACKUP_LOCATION 2 34#define BACKUP_LOCATION 2
35 35
36#define EXTENSION ".bck" 36#define EXTENSION ".bck"
37 37
38const QString tempFileName = "/tmp/backup.err"; 38const QString tempFileName = "/tmp/backup.err";
39 39
40 40
41BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) 41BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl)
42 : BackupAndRestoreBase(parent, name, fl) 42 : BackupAndRestoreBase(parent, name, fl)
43{ 43{
44 this->showMaximized(); 44 this->showMaximized();
45 backupList->header()->hide(); 45 backupList->header()->hide();
46 restoreList->header()->hide(); 46 restoreList->header()->hide();
47 connect(backupButton, SIGNAL(clicked()), 47 connect(backupButton, SIGNAL(clicked()),
48 this, SLOT(backup())); 48 this, SLOT(backup()));
49 connect(restoreButton, SIGNAL(clicked()), 49 connect(restoreButton, SIGNAL(clicked()),
50 this, SLOT(restore())); 50 this, SLOT(restore()));
51 connect(backupList, SIGNAL(clicked( QListViewItem * )), 51 connect(backupList, SIGNAL(clicked( QListViewItem * )),
52 this, SLOT(selectItem(QListViewItem*))); 52 this, SLOT(selectItem(QListViewItem*)));
53 connect(restoreSource, SIGNAL(activated( int )), 53 connect(restoreSource, SIGNAL(activated( int )),
54 this, SLOT(sourceDirChanged(int))); 54 this, SLOT(sourceDirChanged(int)));
55 connect(updateList, SIGNAL(clicked()), 55 connect(updateList, SIGNAL(clicked()),
56 this, SLOT( fileListUpdate())); 56 this, SLOT( fileListUpdate()));
57 57
58 //add directorys for backing up 58 //add directorys for backing up
59 applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/"); 59 applicationSettings = new QListViewItem(backupList, "Application Settings", "", "Settings/");
60 selectItem(applicationSettings); 60 selectItem(applicationSettings);
61 applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/"); 61 applicationSettings = new QListViewItem(backupList, "Application Data", "", "Applications/");
62 selectItem(applicationSettings); 62 selectItem(applicationSettings);
63 documents= new QListViewItem(backupList, "Documents", "", "Documents/"); 63 documents= new QListViewItem(backupList, "Documents", "", "Documents/");
64 selectItem(documents); 64 selectItem(documents);
65 65
66 scanForApplicationSettings(); 66 scanForApplicationSettings();
67 67
68 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" ); 68 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" );
69 if (StorageInfo::hasCf()) 69 if (StorageInfo::hasCf())
70 { 70 {
71 backupLocations.insert("CF", "/mnt/cf"); 71 backupLocations.insert("CF", "/mnt/cf");
72 } 72 }
73 if (StorageInfo::hasSd() || StorageInfo::hasMmc()) 73 if (StorageInfo::hasSd() || StorageInfo::hasMmc())
74 { 74 {
75 backupLocations.insert("SD", "/mnt/card"); 75 backupLocations.insert("SD", "/mnt/card");
76 } 76 }
77 77
78 Config config("BackupAndRestore"); 78 Config config("BackupAndRestore");
79 //read last locations 79 //read last locations
80 config.setGroup("LastLocation"); 80 config.setGroup("LastLocation");
81 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" ); 81 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" );
82 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" ); 82 QString lastRestoreLocation = config.readEntry( "LastRestoreLocation", "" );
83 int locationIndex = 0; 83 int locationIndex = 0;
84 84
85 QMap<QString, QString>::Iterator it; 85 QMap<QString, QString>::Iterator it;
86 for( it = backupLocations.begin(); it != backupLocations.end(); ++it ) 86 for( it = backupLocations.begin(); it != backupLocations.end(); ++it )
87 { 87 {
88 storeToLocation->insertItem(it.key()); 88 storeToLocation->insertItem(it.key());
89 restoreSource->insertItem(it.key()); 89 restoreSource->insertItem(it.key());
90 90
91 //check for last locations 91 //check for last locations
92 if ( it.key() == lastStoreLocation ) 92 if ( it.key() == lastStoreLocation )
93 storeToLocation->setCurrentItem( locationIndex ); 93 storeToLocation->setCurrentItem( locationIndex );
94 if ( it.key() == lastRestoreLocation ) 94 if ( it.key() == lastRestoreLocation )
95 restoreSource->setCurrentItem( locationIndex ); 95 restoreSource->setCurrentItem( locationIndex );
96 locationIndex++; 96 locationIndex++;
97 } 97 }
98 98
99 // Read the list of items to ignore. 99 // Read the list of items to ignore.
100 QList<QString> dontBackupList; 100 QList<QString> dontBackupList;
101 dontBackupList.setAutoDelete(true); 101 dontBackupList.setAutoDelete(true);
102 config.setGroup("DontBackup"); 102 config.setGroup("DontBackup");
103 int total = config.readNumEntry("Total", 0); 103 int total = config.readNumEntry("Total", 0);
104 for(int i = 0; i < total; i++) 104 for(int i = 0; i < total; i++)
105 { 105 {
106 dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), ""))); 106 dontBackupList.append(new QString(config.readEntry(QString("%1").arg(i), "")));
107 } 107 }
108 108
109 QList<QListViewItem> list; 109 QList<QListViewItem> list;
110 getAllItems(backupList->firstChild(), list); 110 getAllItems(backupList->firstChild(), list);
111 111
112 for(uint i = 0; i < list.count(); i++) 112 for(uint i = 0; i < list.count(); i++)
113 { 113 {
114 QString text = list.at(i)->text(HEADER_NAME); 114 QString text = list.at(i)->text(HEADER_NAME);
115 for(uint i2 = 0; i2 < dontBackupList.count(); i2++) 115 for(uint i2 = 0; i2 < dontBackupList.count(); i2++)
116 { 116 {
117 if(*dontBackupList.at(i2) == text) 117 if(*dontBackupList.at(i2) == text)
118 { 118 {
119 selectItem(list.at(i)); 119 selectItem(list.at(i));
120 break; 120 break;
121 } 121 }
122 } 122 }
123 } 123 }
124} 124}
125 125
126BackupAndRestore::~BackupAndRestore() 126BackupAndRestore::~BackupAndRestore()
127{ 127{
128 QList<QListViewItem> list; 128 QList<QListViewItem> list;
129 getAllItems(backupList->firstChild(), list); 129 getAllItems(backupList->firstChild(), list);
130 130
131 Config config("BackupAndRestore"); 131 Config config("BackupAndRestore");
132 config.setGroup("DontBackup"); 132 config.setGroup("DontBackup");
133 config.clearGroup(); 133 config.clearGroup();
134 134
135 int count = 0; 135 int count = 0;
136 for(uint i = 0; i < list.count(); i++) 136 for(uint i = 0; i < list.count(); i++)
137 { 137 {
138 if(list.at(i)->text(HEADER_BACKUP) == "") 138 if(list.at(i)->text(HEADER_BACKUP) == "")
139 { 139 {
140 config.writeEntry(QString("%1").arg(count), list.at(i)->text(HEADER_NAME)); 140 config.writeEntry(QString("%1").arg(count), list.at(i)->text(HEADER_NAME));
141 count++; 141 count++;
142 } 142 }
143 } 143 }
144 config.writeEntry("Total", count); 144 config.writeEntry("Total", count);
145 145
146 // Remove Temp File 146 // Remove Temp File
147 if ( QFile::exists( tempFileName ) ) 147 if ( QFile::exists( tempFileName ) )
148 QFile::remove( tempFileName ); 148 QFile::remove( tempFileName );
149} 149}
150 150
151QList<QListViewItem> BackupAndRestore::getAllItems(QListViewItem *item, QList<QListViewItem> &list) 151QList<QListViewItem> BackupAndRestore::getAllItems(QListViewItem *item, QList<QListViewItem> &list)
152{ 152{
153 while(item) 153 while(item)
154 { 154 {
155 if(item->childCount() > 0) 155 if(item->childCount() > 0)
156 getAllItems(item->firstChild(), list); 156 getAllItems(item->firstChild(), list);
157 list.append(item); 157 list.append(item);
158 item = item->nextSibling(); 158 item = item->nextSibling();
159 } 159 }
160 return list; 160 return list;
161} 161}
162 162
163/** 163/**
164 * Selects and unselects the item by setting the HEADER_BACKUP to B or !. 164 * Selects and unselects the item by setting the HEADER_BACKUP to B or !.
165 * and changing the icon to match 165 * and changing the icon to match
166 * @param currentItem the item to swich the selection choice. 166 * @param currentItem the item to swich the selection choice.
167 */ 167 */
168void BackupAndRestore::selectItem(QListViewItem *currentItem) 168void BackupAndRestore::selectItem(QListViewItem *currentItem)
169{ 169{
170 if(!currentItem) 170 if(!currentItem)
171 return; 171 return;
172 172
173 if(currentItem->text(HEADER_BACKUP) == "B") 173 if(currentItem->text(HEADER_BACKUP) == "B")
174 { 174 {
175 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/null")); 175 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/null"));
176 currentItem->setText(HEADER_BACKUP, ""); 176 currentItem->setText(HEADER_BACKUP, "");
177 } 177 }
178 else 178 else
179 { 179 {
180 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/check")); 180 currentItem->setPixmap(HEADER_NAME, Resource::loadPixmap("backup/check"));
181 currentItem->setText(HEADER_BACKUP, "B"); 181 currentItem->setText(HEADER_BACKUP, "B");
182 } 182 }
183} 183}
184 184
185void BackupAndRestore::scanForApplicationSettings() 185void BackupAndRestore::scanForApplicationSettings()
186{ 186{
187 QDir d( QDir::homeDirPath() + "/" + QString( applicationSettings->text(BACKUP_LOCATION) ) ); 187 QDir d( QDir::homeDirPath() + "/" + QString( applicationSettings->text(BACKUP_LOCATION) ) );
188 d.setFilter( QDir::Dirs | QDir::Files | QDir::NoSymLinks ); 188 d.setFilter( QDir::Dirs | QDir::Files | QDir::NoSymLinks );
189 const QFileInfoList *list = d.entryInfoList(); 189 const QFileInfoList *list = d.entryInfoList();
190 QFileInfoListIterator it( *list ); 190 QFileInfoListIterator it( *list );
191 QFileInfo *fi; 191 QFileInfo *fi;
192 while ( (fi=it.current()) ) 192 while ( (fi=it.current()) )
193 { 193 {
194 //qDebug((d.path()+"/"+fi->fileName()).latin1()); 194 //qDebug((d.path()+"/"+fi->fileName()).latin1());
195 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) ) 195 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) )
196 { 196 {
197 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName()); 197 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName());
198 selectItem(newItem); 198 selectItem(newItem);
199 } 199 }
200 ++it; 200 ++it;
201 } 201 }
202} 202}
203 203
204/** 204/**
205 * The "Backup" button has been pressed. Get a list of all of the files that 205 * The "Backup" button has been pressed. Get a list of all of the files that
206 * should be backed up. If there are no files, emit and error and exit. 206 * should be backed up. If there are no files, emit and error and exit.
207 * Determine the file name to store the backup in. Backup the file(s) using 207 * Determine the file name to store the backup in. Backup the file(s) using
208 * tar and gzip --best. Report failure or success 208 * tar and gzip --best. Report failure or success
209 */ 209 */
210void BackupAndRestore::backup() 210void BackupAndRestore::backup()
211{ 211{
212 QString backupFiles; 212 QString backupFiles;
213 if(getBackupFiles(backupFiles, NULL) == 0) 213 if(getBackupFiles(backupFiles, NULL) == 0)
214 { 214 {
215 QMessageBox::critical(this, "Message", 215 QMessageBox::critical(this, "Message",
216 "No items selected.",QString("Ok") ); 216 "No items selected.",QString("Ok") );
217 return; 217 return;
218 } 218 }
219 219
220 setCaption(tr("Backup and Restore... working...")); 220 setCaption(tr("Backup and Restore... working..."));
221 QString outputFile = backupLocations[storeToLocation->currentText()]; 221 QString outputFile = backupLocations[storeToLocation->currentText()];
222 222
223 QDateTime datetime = QDateTime::currentDateTime(); 223 QDateTime datetime = QDateTime::currentDateTime();
224 QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') + 224 QString dateString = QString::number( datetime.date().year() ) + QString::number( datetime.date().month() ).rightJustify(2, '0') +
225 QString::number( datetime.date().day() ).rightJustify(2, '0'); 225 QString::number( datetime.date().day() ).rightJustify(2, '0');
226 226
227 outputFile += "/" + dateString; 227 outputFile += "/" + dateString;
228 228
229 QString t = outputFile; 229 QString t = outputFile;
230 int c = 1; 230 int c = 1;
231 while(QFile::exists(outputFile + EXTENSION)) 231 while(QFile::exists(outputFile + EXTENSION))
232 { 232 {
233 outputFile = t + QString("%1").arg(c); 233 outputFile = t + QString("%1").arg(c);
234 c++; 234 c++;
235 } 235 }
236 236
237 // We execute tar and compressing its output with gzip.. 237 // We execute tar and compressing its output with gzip..
238 // The error output will be written into a temp-file which could be provided 238 // The error output will be written into a temp-file which could be provided
239 // for debugging.. 239 // for debugging..
240 qDebug( "Storing file: %s", outputFile.latin1() ); 240 qDebug( "Storing file: %s", outputFile.latin1() );
241 outputFile += EXTENSION; 241 outputFile += EXTENSION;
242 242
243 QString commandLine = QString( "(tar -C %1 -c %2 | gzip > %3 ) 2> %4" ).arg( QDir::homeDirPath() ) 243 QString commandLine = QString( "(tar -C %1 -c %2 | gzip > %3 ) 2> %4" ).arg( QDir::homeDirPath() )
244 .arg( backupFiles ) 244 .arg( backupFiles )
245 .arg( outputFile.latin1() ) 245 .arg( outputFile.latin1() )
246 .arg( tempFileName.latin1() ); 246 .arg( tempFileName.latin1() );
247 247
248 qDebug( commandLine ); 248 qDebug( commandLine );
249 249
250 int r = system( commandLine ); 250 int r = system( commandLine );
251 251
252 if(r != 0) 252 if(r != 0)
253 { 253 {
254 perror("Error: "); 254 perror("Error: ");
255 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); 255 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
256 256
257 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n" 257 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n"
258 + errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) ) 258 + errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) )
259 { 259 {
260 260
261 case 1: 261 case 1:
262 qWarning("Details pressed !"); 262 qWarning("Details pressed !");
263 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); 263 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
264 QFile errorFile( tempFileName ); 264 QFile errorFile( tempFileName );
265 if ( errorFile.open(IO_ReadOnly) ) 265 if ( errorFile.open(IO_ReadOnly) )
266 { 266 {
267 QTextStream t( &errorFile ); 267 QTextStream t( &errorFile );
268 QString s; 268 QString s;
269 while ( !t.eof() ) 269 while ( !t.eof() )
270 { // until end of file... 270 { // until end of file...
271 s += t.readLine(); // line of text excluding '\n' 271 s += t.readLine(); // line of text excluding '\n'
272 } 272 }
273 errorFile.close(); 273 errorFile.close();
274 274
275 pErrDialog->m_textarea->setText( s ); 275 pErrDialog->m_textarea->setText( s );
276 } 276 }
277 else 277 else
278 { 278 {
279 pErrDialog->m_textarea->setText( "Unable to open File: /tmp/backup.er" ); 279 pErrDialog->m_textarea->setText( "Unable to open File: /tmp/backup.er" );
280 } 280 }
281 pErrDialog->showMaximized(); 281 pErrDialog->showMaximized();
282 pErrDialog->exec(); 282 pErrDialog->exec();
283 delete pErrDialog; 283 delete pErrDialog;
284 break; 284 break;
285 } 285 }
286 setCaption(tr("Backup and Restore.. Failed !!")); 286 setCaption(tr("Backup and Restore.. Failed !!"));
287 return; 287 return;
288 } 288 }
289 else 289 else
290 { 290 {
291 QMessageBox::information(this, tr( "Message" ), tr( "Backup Successfull." ), QString(tr( "Ok" ) ) ); 291 QMessageBox::information(this, tr( "Message" ), tr( "Backup Successful." ), QString(tr( "Ok" ) ) );
292 292
293 } 293 }
294 294
295 //write store-location 295 //write store-location
296 Config config( "BackupAndRestore" ); 296 Config config( "BackupAndRestore" );
297 config.setGroup( "LastLocation" ); 297 config.setGroup( "LastLocation" );
298 config.writeEntry( "LastStoreLocation", storeToLocation->currentText() ); 298 config.writeEntry( "LastStoreLocation", storeToLocation->currentText() );
299 299
300 setCaption(tr("Backup and Restore")); 300 setCaption(tr("Backup and Restore"));
301} 301}
302 302
303/*** 303/***
304 * Get a list of all of the files to backup. 304 * Get a list of all of the files to backup.
305 */ 305 */
306int BackupAndRestore::getBackupFiles(QString &backupFiles, QListViewItem *parent) 306int BackupAndRestore::getBackupFiles(QString &backupFiles, QListViewItem *parent)
307{ 307{
308 QListViewItem * currentItem; 308 QListViewItem * currentItem;
309 QString currentHome; 309 QString currentHome;
310 if(!parent) 310 if(!parent)
311 currentItem = backupList->firstChild(); 311 currentItem = backupList->firstChild();
312 else 312 else
313 { 313 {
314 currentItem = parent->firstChild(); 314 currentItem = parent->firstChild();
315 currentHome = parent->text(BACKUP_LOCATION); 315 currentHome = parent->text(BACKUP_LOCATION);
316 } 316 }
317 317
318 uint count = 0; 318 uint count = 0;
319 while( currentItem != 0 ) 319 while( currentItem != 0 )
320 { 320 {
321 if(currentItem->text(HEADER_BACKUP) == "B" ) 321 if(currentItem->text(HEADER_BACKUP) == "B" )
322 { 322 {
323 if(currentItem->childCount() == 0 ) 323 if(currentItem->childCount() == 0 )
324 { 324 {
325 if(parent == NULL) 325 if(parent == NULL)
326 backupFiles += currentItem->text(BACKUP_LOCATION); 326 backupFiles += currentItem->text(BACKUP_LOCATION);
327 else 327 else
328 backupFiles += currentHome + currentItem->text(HEADER_NAME); 328 backupFiles += currentHome + currentItem->text(HEADER_NAME);
329 backupFiles += " "; 329 backupFiles += " ";
330 count++; 330 count++;
331 } 331 }
332 else 332 else
333 { 333 {
334 count += getBackupFiles(backupFiles, currentItem); 334 count += getBackupFiles(backupFiles, currentItem);
335 } 335 }
336 } 336 }
337 currentItem = currentItem->nextSibling(); 337 currentItem = currentItem->nextSibling();
338 } 338 }
339 return count; 339 return count;
340} 340}
341 341
342void BackupAndRestore::sourceDirChanged(int selection) 342void BackupAndRestore::sourceDirChanged(int selection)
343{ 343{
344 restoreList->clear(); 344 restoreList->clear();
345 rescanFolder(backupLocations[restoreSource->text(selection)]); 345 rescanFolder(backupLocations[restoreSource->text(selection)]);
346} 346}
347 347
348void BackupAndRestore::fileListUpdate() 348void BackupAndRestore::fileListUpdate()
349{ 349{
350 qWarning("void BackupAndRestore::fileListUpdate()"); 350 qWarning("void BackupAndRestore::fileListUpdate()");
351 restoreList->clear(); 351 restoreList->clear();
352 rescanFolder( backupLocations[restoreSource->currentText()] ); 352 rescanFolder( backupLocations[restoreSource->currentText()] );
353} 353}
354 354
355/** 355/**
356 * Scans directory for any backup files. Will recursivly go down, 356 * Scans directory for any backup files. Will recursivly go down,
357 * but will not follow symlinks. 357 * but will not follow symlinks.
358 * @param directory - the directory to look in. 358 * @param directory - the directory to look in.
359 */ 359 */
360void BackupAndRestore::rescanFolder(QString directory) 360void BackupAndRestore::rescanFolder(QString directory)
361{ 361{
362 //qDebug(QString("rescanFolder: ") + directory.latin1()); 362 //qDebug(QString("rescanFolder: ") + directory.latin1());
363 QDir d(directory); 363 QDir d(directory);
364 if(!d.exists()) 364 if(!d.exists())
365 return; 365 return;
366 366
367 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs); 367 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs);
368 const QFileInfoList *list = d.entryInfoList(); 368 const QFileInfoList *list = d.entryInfoList();
369 QFileInfoListIterator it( *list ); 369 QFileInfoListIterator it( *list );
370 QFileInfo *file; 370 QFileInfo *file;
371 while ( (file=it.current()) ) 371 while ( (file=it.current()) )
372 { // for each file... 372 { // for each file...
373 // If it is a dir and not .. or . then add it as a tab and go down. 373 // If it is a dir and not .. or . then add it as a tab and go down.
374 if(file->isDir()) 374 if(file->isDir())
375 { 375 {
376 if(file->fileName() != ".." && file->fileName() != ".") 376 if(file->fileName() != ".." && file->fileName() != ".")
377 { 377 {
378 rescanFolder(directory + "/" + file->fileName()); 378 rescanFolder(directory + "/" + file->fileName());
379 } 379 }
380 } 380 }
381 else 381 else
382 { 382 {
383 // If it is a backup file add to list. 383 // If it is a backup file add to list.
384 if(file->fileName().contains(EXTENSION)) 384 if(file->fileName().contains(EXTENSION))
385 (void)new QListViewItem(restoreList, file->fileName()); 385 (void)new QListViewItem(restoreList, file->fileName());
386 } 386 }
387 ++it; 387 ++it;
388 } 388 }
389} 389}
390 390
391/** 391/**
392 * Restore a backup file. 392 * Restore a backup file.
393 * Report errors or success 393 * Report errors or success
394 */ 394 */
395void BackupAndRestore::restore() 395void BackupAndRestore::restore()
396{ 396{
397 QListViewItem *restoreItem = restoreList->currentItem(); 397 QListViewItem *restoreItem = restoreList->currentItem();
398 if(!restoreItem) 398 if(!restoreItem)
399 { 399 {
400 QMessageBox::critical(this, tr( "Message" ), 400 QMessageBox::critical(this, tr( "Message" ),
401 tr( "Please select something to restore." ),QString( tr( "Ok") ) ); 401 tr( "Please select something to restore." ),QString( tr( "Ok") ) );
402 return; 402 return;
403 } 403 }
404 setCaption(tr("Backup and Restore... working...")); 404 setCaption(tr("Backup and Restore... working..."));
405 405
406 QString restoreFile = backupLocations[restoreSource->currentText()]; 406 QString restoreFile = backupLocations[restoreSource->currentText()];
407 407
408 restoreFile += "/" + restoreItem->text(0); 408 restoreFile += "/" + restoreItem->text(0);
409 409
410 qDebug( restoreFile ); 410 qDebug( restoreFile );
411 411
412 QString commandLine = QString( "tar -C %1 -zxf %2 2> %3" ).arg( QDir::homeDirPath() ) 412 QString commandLine = QString( "tar -C %1 -zxf %2 2> %3" ).arg( QDir::homeDirPath() )
413 .arg( restoreFile.latin1() ) 413 .arg( restoreFile.latin1() )
414 .arg( tempFileName.latin1() ); 414 .arg( tempFileName.latin1() );
415 415
416 qDebug( commandLine ); 416 qDebug( commandLine );
417 417
418 int r = system( commandLine ); 418 int r = system( commandLine );
419 419
420 if(r != 0) 420 if(r != 0)
421 { 421 {
422 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); 422 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
423 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n" 423 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n"
424 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) ) 424 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) )
425 { 425 {
426 case 1: 426 case 1:
427 qWarning("Details pressed !"); 427 qWarning("Details pressed !");
428 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); 428 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
429 QFile errorFile( tempFileName ); 429 QFile errorFile( tempFileName );
430 if ( errorFile.open(IO_ReadOnly) ) 430 if ( errorFile.open(IO_ReadOnly) )
431 { 431 {
432 QTextStream t( &errorFile ); 432 QTextStream t( &errorFile );
433 QString s; 433 QString s;
434 while ( !t.eof() ) 434 while ( !t.eof() )
435 { // until end of file... 435 { // until end of file...
436 s += t.readLine(); // line of text excluding '\n' 436 s += t.readLine(); // line of text excluding '\n'
437 } 437 }
438 errorFile.close(); 438 errorFile.close();
439 439
440 pErrDialog->m_textarea->setText( s ); 440 pErrDialog->m_textarea->setText( s );
441 } 441 }
442 else 442 else
443 { 443 {
444 pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) ); 444 pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) );
445 } 445 }
446 pErrDialog->showMaximized(); 446 pErrDialog->showMaximized();
447 pErrDialog->exec(); 447 pErrDialog->exec();
448 delete pErrDialog; 448 delete pErrDialog;
449 449
450 setCaption(tr("Backup and Restore.. Failed !!")); 450 setCaption(tr("Backup and Restore.. Failed !!"));
451 return; 451 return;
452 452
453 break; 453 break;
454 454
455 } 455 }
456 } 456 }
457 else 457 else
458 { 458 {
459 QMessageBox::information(this, tr( "Message" ), tr( "Restore Successfull." ), QString( tr( "Ok") ) ); 459 QMessageBox::information(this, tr( "Message" ), tr( "Restore Successful." ), QString( tr( "Ok") ) );
460 } 460 }
461 461
462 //write restore-location 462 //write restore-location
463 Config config( "BackupAndRestore" ); 463 Config config( "BackupAndRestore" );
464 config.setGroup( "LastLocation" ); 464 config.setGroup( "LastLocation" );
465 config.writeEntry( "LastRestoreLocation", restoreSource->currentText() ); 465 config.writeEntry( "LastRestoreLocation", restoreSource->currentText() );
466 466
467 setCaption(tr("Backup and Restore")); 467 setCaption(tr("Backup and Restore"));
468} 468}
469 469
470// backuprestore.cpp 470// backuprestore.cpp
471 471
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp
index 69b55d1..b00b899 100644
--- a/noncore/settings/networksettings/interfaces/interface.cpp
+++ b/noncore/settings/networksettings/interfaces/interface.cpp
@@ -1,302 +1,302 @@
1/** 1/**
2 * $Author$ 2 * $Author$
3 * $Date$ 3 * $Date$
4 */ 4 */
5 5
6#include "interface.h" 6#include "interface.h"
7#include <qdatetime.h> 7#include <qdatetime.h>
8#include <qfile.h> 8#include <qfile.h>
9#include <qdir.h> 9#include <qdir.h>
10#include <qfileinfo.h> 10#include <qfileinfo.h>
11#include <qtextstream.h> 11#include <qtextstream.h>
12 12
13#define IFCONFIG "/sbin/ifconfig" 13#define IFCONFIG "/sbin/ifconfig"
14#define DHCP_INFO_DIR "/etc/dhcpc" 14#define DHCP_INFO_DIR "/etc/dhcpc"
15 15
16#include <stdio.h> 16#include <stdio.h>
17#include <stdlib.h> 17#include <stdlib.h>
18 18
19Interface::Interface(QObject * parent, const char * name, bool newSatus): QObject(parent, name), hardwareName("Unknown"), moduleOwner(NULL), status(newSatus), attached(false), dhcp(false), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"){ 19Interface::Interface(QObject * parent, const char * name, bool newSatus): QObject(parent, name), hardwareName("Unknown"), moduleOwner(NULL), status(newSatus), attached(false), dhcp(false), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"){
20 refresh(); 20 refresh();
21} 21}
22 22
23/** 23/**
24 * Set status 24 * Set status
25 * @param newStatus - the new status 25 * @param newStatus - the new status
26 * emit updateInterface 26 * emit updateInterface
27 */ 27 */
28void Interface::setStatus(bool newStatus){ 28void Interface::setStatus(bool newStatus){
29 if(status != newStatus){ 29 if(status != newStatus){
30 status = newStatus; 30 status = newStatus;
31 refresh(); 31 refresh();
32 } 32 }
33}; 33};
34 34
35/** 35/**
36 * Set if attached or not (802.11 card pulled out for example) 36 * Set if attached or not (802.11 card pulled out for example)
37 * @param isAttached - if attached 37 * @param isAttached - if attached
38 * emit updateInterface 38 * emit updateInterface
39 */ 39 */
40void Interface::setAttached(bool isAttached){ 40void Interface::setAttached(bool isAttached){
41 attached = isAttached; 41 attached = isAttached;
42 emit(updateInterface(this)); 42 emit(updateInterface(this));
43}; 43};
44 44
45/** 45/**
46 * Set Hardware name 46 * Set Hardware name
47 * @param name - the new name 47 * @param name - the new name
48 * emit updateInterface 48 * emit updateInterface
49 */ 49 */
50void Interface::setHardwareName(const QString &name){ 50void Interface::setHardwareName(const QString &name){
51 hardwareName = name; 51 hardwareName = name;
52 emit(updateInterface(this)); 52 emit(updateInterface(this));
53}; 53};
54 54
55/** 55/**
56 * Set Module owner 56 * Set Module owner
57 * @param owner - the new owner 57 * @param owner - the new owner
58 * emit updateInterface 58 * emit updateInterface
59 */ 59 */
60void Interface::setModuleOwner(Module *owner){ 60void Interface::setModuleOwner(Module *owner){
61 moduleOwner = owner; 61 moduleOwner = owner;
62 emit(updateInterface(this)); 62 emit(updateInterface(this));
63}; 63};
64 64
65 65
66/** 66/**
67 * Try to start the interface. 67 * Try to start the interface.
68 */ 68 */
69void Interface::start(){ 69void Interface::start(){
70 // check to see if we are already running. 70 // check to see if we are already running.
71 if(true == status){ 71 if(true == status){
72 emit (updateMessage("Unable to start interface,\n already started")); 72 emit (updateMessage("Unable to start interface,\n already started"));
73 return; 73 return;
74 } 74 }
75 75
76 int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1()); 76 int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1());
77 // See if it was successfull... 77 // See if it was successful...
78 if(ret != 0){ 78 if(ret != 0){
79 emit (updateMessage("Starting interface failed")); 79 emit (updateMessage("Starting interface failed"));
80 return; 80 return;
81 } 81 }
82 82
83 status = true; 83 status = true;
84 refresh(); 84 refresh();
85 emit (updateMessage("Start successfull")); 85 emit (updateMessage("Start successful"));
86} 86}
87 87
88/** 88/**
89 * Try to stop the interface. 89 * Try to stop the interface.
90 */ 90 */
91void Interface::stop(){ 91void Interface::stop(){
92 // check to see if we are already stopped. 92 // check to see if we are already stopped.
93 if(false == status){ 93 if(false == status){
94 emit (updateMessage("Unable to stop interface,\n already stopped")); 94 emit (updateMessage("Unable to stop interface,\n already stopped"));
95 return; 95 return;
96 } 96 }
97 97
98 int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); 98 int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1());
99 if(ret != 0){ 99 if(ret != 0){
100 emit (updateMessage("Stopping interface failed")); 100 emit (updateMessage("Stopping interface failed"));
101 return; 101 return;
102 } 102 }
103 103
104 status = false; 104 status = false;
105 refresh(); 105 refresh();
106 emit (updateMessage("Stop successfull")); 106 emit (updateMessage("Stop successful"));
107} 107}
108 108
109/** 109/**
110 * Try to restart the interface. 110 * Try to restart the interface.
111 */ 111 */
112void Interface::restart(){ 112void Interface::restart(){
113 stop(); 113 stop();
114 start(); 114 start();
115} 115}
116 116
117/** 117/**
118 * Try to refresh the information about the interface. 118 * Try to refresh the information about the interface.
119 * First call ifconfig, then check the dhcp-info file 119 * First call ifconfig, then check the dhcp-info file
120 * @return bool true if successfull. 120 * @return bool true if successful.
121 */ 121 */
122bool Interface::refresh(){ 122bool Interface::refresh(){
123 // See if we are up. 123 // See if we are up.
124 if(status == false){ 124 if(status == false){
125 macAddress = ""; 125 macAddress = "";
126 ip = "0.0.0.0"; 126 ip = "0.0.0.0";
127 subnetMask = "0.0.0.0"; 127 subnetMask = "0.0.0.0";
128 broadcast = ""; 128 broadcast = "";
129 dhcp = false; 129 dhcp = false;
130 dhcpServerIp = ""; 130 dhcpServerIp = "";
131 leaseObtained = ""; 131 leaseObtained = "";
132 leaseExpires = ""; 132 leaseExpires = "";
133 emit(updateInterface(this)); 133 emit(updateInterface(this));
134 return true; 134 return true;
135 } 135 }
136 136
137 QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name()); 137 QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name());
138 int ret = system(QString("LANG=C %1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1()); 138 int ret = system(QString("LANG=C %1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1());
139 if(ret != 0){ 139 if(ret != 0){
140 qDebug(QString("Interface: Ifconfig return value: %1, is not 0").arg(ret).latin1()); 140 qDebug(QString("Interface: Ifconfig return value: %1, is not 0").arg(ret).latin1());
141 return false; 141 return false;
142 } 142 }
143 143
144 QFile file(fileName); 144 QFile file(fileName);
145 if (!file.open(IO_ReadOnly)){ 145 if (!file.open(IO_ReadOnly)){
146 qDebug(QString("Interface: Can't open file: %1").arg(fileName).latin1()); 146 qDebug(QString("Interface: Can't open file: %1").arg(fileName).latin1());
147 return false; 147 return false;
148 } 148 }
149 149
150 // Set to the defaults 150 // Set to the defaults
151 macAddress = ""; 151 macAddress = "";
152 ip = "0.0.0.0"; 152 ip = "0.0.0.0";
153 subnetMask = "0.0.0.0"; 153 subnetMask = "0.0.0.0";
154 broadcast = ""; 154 broadcast = "";
155 155
156 QTextStream stream( &file ); 156 QTextStream stream( &file );
157 QString line; 157 QString line;
158 while ( !stream.eof() ) { 158 while ( !stream.eof() ) {
159 line = stream.readLine(); 159 line = stream.readLine();
160 if(line.contains("HWaddr")){ 160 if(line.contains("HWaddr")){
161 int mac = line.find("HWaddr"); 161 int mac = line.find("HWaddr");
162 macAddress = line.mid(mac+7, line.length()); 162 macAddress = line.mid(mac+7, line.length());
163 } 163 }
164 if(line.contains("inet addr")){ 164 if(line.contains("inet addr")){
165 int ipl = line.find("inet addr"); 165 int ipl = line.find("inet addr");
166 int space = line.find(" ", ipl+10); 166 int space = line.find(" ", ipl+10);
167 ip = line.mid(ipl+10, space-ipl-10); 167 ip = line.mid(ipl+10, space-ipl-10);
168 } 168 }
169 if(line.contains("Mask")){ 169 if(line.contains("Mask")){
170 int mask = line.find("Mask"); 170 int mask = line.find("Mask");
171 subnetMask = line.mid(mask+5, line.length()); 171 subnetMask = line.mid(mask+5, line.length());
172 } 172 }
173 if(line.contains("Bcast")){ 173 if(line.contains("Bcast")){
174 int mask = line.find("Bcast"); 174 int mask = line.find("Bcast");
175 int space = line.find(" ", mask+6); 175 int space = line.find(" ", mask+6);
176 broadcast = line.mid(mask+6, space-mask-6); 176 broadcast = line.mid(mask+6, space-mask-6);
177 } 177 }
178 } 178 }
179 file.close(); 179 file.close();
180 QFile::remove(fileName); 180 QFile::remove(fileName);
181 181
182 // DHCP TESTING 182 // DHCP TESTING
183 // reset DHCP info 183 // reset DHCP info
184 dhcpServerIp = ""; 184 dhcpServerIp = "";
185 leaseObtained = ""; 185 leaseObtained = "";
186 leaseExpires = ""; 186 leaseExpires = "";
187 dhcp = false; 187 dhcp = false;
188 188
189 QString dhcpDirectory(DHCP_INFO_DIR); 189 QString dhcpDirectory(DHCP_INFO_DIR);
190 QDir d(dhcpDirectory); 190 QDir d(dhcpDirectory);
191 if(!d.exists(dhcpDirectory)) 191 if(!d.exists(dhcpDirectory))
192 dhcpDirectory = "/var/run"; 192 dhcpDirectory = "/var/run";
193 193
194 // See if we have 194 // See if we have
195 QString dhcpFile(QString(dhcpDirectory+"/dhcpcd-%1.info").arg(this->name())); 195 QString dhcpFile(QString(dhcpDirectory+"/dhcpcd-%1.info").arg(this->name()));
196 // If there is no DHCP information then exit now with no errors. 196 // If there is no DHCP information then exit now with no errors.
197 if(!QFile::exists(dhcpFile)){ 197 if(!QFile::exists(dhcpFile)){
198 emit(updateInterface(this)); 198 emit(updateInterface(this));
199 return true; 199 return true;
200 } 200 }
201 201
202 file.setName(dhcpFile); 202 file.setName(dhcpFile);
203 if (!file.open(IO_ReadOnly)){ 203 if (!file.open(IO_ReadOnly)){
204 qDebug(QString("Interface: Can't open file: %1").arg(dhcpFile).latin1()); 204 qDebug(QString("Interface: Can't open file: %1").arg(dhcpFile).latin1());
205 return false; 205 return false;
206 } 206 }
207 207
208 // leaseTime and renewalTime and used if pid and deamon exe can be accessed. 208 // leaseTime and renewalTime and used if pid and deamon exe can be accessed.
209 int leaseTime = 0; 209 int leaseTime = 0;
210 int renewalTime = 0; 210 int renewalTime = 0;
211 211
212 stream.setDevice( &file ); 212 stream.setDevice( &file );
213 while ( !stream.eof() ) { 213 while ( !stream.eof() ) {
214 line = stream.readLine(); 214 line = stream.readLine();
215 if(line.contains("DHCPSIADDR=")) 215 if(line.contains("DHCPSIADDR="))
216 dhcpServerIp = line.mid(11, line.length()); 216 dhcpServerIp = line.mid(11, line.length());
217 if(line.contains("LEASETIME=")) 217 if(line.contains("LEASETIME="))
218 leaseTime = line.mid(10, line.length()).toInt(); 218 leaseTime = line.mid(10, line.length()).toInt();
219 if(line.contains("RENEWALTIME=")) 219 if(line.contains("RENEWALTIME="))
220 renewalTime = line.mid(12, line.length()).toInt(); 220 renewalTime = line.mid(12, line.length()).toInt();
221 } 221 }
222 file.close(); 222 file.close();
223 //qDebug(QString("Interface: leaseTime: %1").arg(leaseTime).latin1()); 223 //qDebug(QString("Interface: leaseTime: %1").arg(leaseTime).latin1());
224 //qDebug(QString("Interface: renewalTime: %1").arg(renewalTime).latin1()); 224 //qDebug(QString("Interface: renewalTime: %1").arg(renewalTime).latin1());
225 225
226 // Get the pid of the deamond 226 // Get the pid of the deamond
227 dhcpFile = (QString(dhcpDirectory+"/dhcpcd-%1.pid").arg(this->name())); 227 dhcpFile = (QString(dhcpDirectory+"/dhcpcd-%1.pid").arg(this->name()));
228 file.setName(dhcpFile); 228 file.setName(dhcpFile);
229 if (!file.open(IO_ReadOnly)){ 229 if (!file.open(IO_ReadOnly)){
230 qDebug(QString("Interface: Can't open file: %1").arg(dhcpFile).latin1()); 230 qDebug(QString("Interface: Can't open file: %1").arg(dhcpFile).latin1());
231 return false; 231 return false;
232 } 232 }
233 233
234 int pid = -1; 234 int pid = -1;
235 stream.setDevice( &file ); 235 stream.setDevice( &file );
236 while ( !stream.eof() ) { 236 while ( !stream.eof() ) {
237 line = stream.readLine(); 237 line = stream.readLine();
238 pid = line.toInt(); 238 pid = line.toInt();
239 } 239 }
240 file.close(); 240 file.close();
241 241
242 if( pid == -1){ 242 if( pid == -1){
243 qDebug("Interface: Could not get pid of dhcpc deamon."); 243 qDebug("Interface: Could not get pid of dhcpc deamon.");
244 return false; 244 return false;
245 } 245 }
246 246
247 // Get the start running time of the deamon 247 // Get the start running time of the deamon
248 fileName = (QString("/proc/%1/stat").arg(pid)); 248 fileName = (QString("/proc/%1/stat").arg(pid));
249 file.setName(fileName); 249 file.setName(fileName);
250 stream.setDevice( &file ); 250 stream.setDevice( &file );
251 if (!file.open(IO_ReadOnly)){ 251 if (!file.open(IO_ReadOnly)){
252 qDebug(QString("Interface: Can't open file: %1").arg(fileName).latin1()); 252 qDebug(QString("Interface: Can't open file: %1").arg(fileName).latin1());
253 return false; 253 return false;
254 } 254 }
255 while ( !stream.eof() ) { 255 while ( !stream.eof() ) {
256 line = stream.readLine(); 256 line = stream.readLine();
257 } 257 }
258 file.close(); 258 file.close();
259 long time = 0; 259 long time = 0;
260 // Grab the start time 260 // Grab the start time
261 // pid com state ppid pgrp session tty_nr tpgid flags 261 // pid com state ppid pgrp session tty_nr tpgid flags
262 sscanf(line.latin1(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u " 262 sscanf(line.latin1(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u "
263 // minflt cminflt majflt cmajflt utime stime cutime cstime priority 263 // minflt cminflt majflt cmajflt utime stime cutime cstime priority
264 "%*u %*u %*u %*u %*u %*u %*d %*d %*d " 264 "%*u %*u %*u %*u %*u %*u %*d %*d %*d "
265 // nice 0 itrealvalue starttime 265 // nice 0 itrealvalue starttime
266 "%*d %*d %*d %lu", (long*) &time); 266 "%*d %*d %*d %lu", (long*) &time);
267 time = time/100; 267 time = time/100;
268 268
269 QDateTime datetime(QDateTime::currentDateTime()); 269 QDateTime datetime(QDateTime::currentDateTime());
270 270
271 // Get the uptime of the computer. 271 // Get the uptime of the computer.
272 QFile f("/proc/uptime"); 272 QFile f("/proc/uptime");
273 if ( f.open(IO_ReadOnly) ) { // file opened successfully 273 if ( f.open(IO_ReadOnly) ) { // file opened successfully
274 QTextStream t( &f ); // use a text stream 274 QTextStream t( &f ); // use a text stream
275 int sec = 0; 275 int sec = 0;
276 t >> sec; 276 t >> sec;
277 datetime = datetime.addSecs((-1*sec)); 277 datetime = datetime.addSecs((-1*sec));
278 f.close(); 278 f.close();
279 } 279 }
280 else{ 280 else{
281 qDebug("Interface: Can't open /proc/uptime to retrive uptime."); 281 qDebug("Interface: Can't open /proc/uptime to retrive uptime.");
282 return false; 282 return false;
283 } 283 }
284 284
285 datetime = datetime.addSecs(time); 285 datetime = datetime.addSecs(time);
286 //qDebug(QString("Interface: %1 %2").arg(datetime.toString()).arg(pid).latin1()); 286 //qDebug(QString("Interface: %1 %2").arg(datetime.toString()).arg(pid).latin1());
287 287
288 // Calculate the start and renew times 288 // Calculate the start and renew times
289 leaseObtained= datetime.toString(); 289 leaseObtained= datetime.toString();
290 290
291 // Calculate the start and renew times 291 // Calculate the start and renew times
292 datetime = datetime.addSecs(leaseTime); 292 datetime = datetime.addSecs(leaseTime);
293 leaseExpires = datetime.toString(); 293 leaseExpires = datetime.toString();
294 294
295 dhcp = true; 295 dhcp = true;
296 296
297 emit(updateInterface(this)); 297 emit(updateInterface(this));
298 return true; 298 return true;
299} 299}
300 300
301// interface.cpp 301// interface.cpp
302 302
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp
index 436e449..6b161ae 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaces.cpp
@@ -1,712 +1,712 @@
1#include "interfaces.h" 1#include "interfaces.h"
2 2
3#include <qcheckbox.h> 3#include <qcheckbox.h>
4#include <qfile.h> 4#include <qfile.h>
5#include <qtextstream.h> 5#include <qtextstream.h>
6#include <qregexp.h> 6#include <qregexp.h>
7 7
8// The three stanza's 8// The three stanza's
9#define AUTO "auto" 9#define AUTO "auto"
10#define IFACE "iface" 10#define IFACE "iface"
11#define MAPPING "mapping" 11#define MAPPING "mapping"
12 12
13/** 13/**
14 * Constructor. Reads in the interfaces file and then split the file up by 14 * Constructor. Reads in the interfaces file and then split the file up by
15 * the \n for interfaces variable. 15 * the \n for interfaces variable.
16 * @param useInterfacesFile if an interface file other then the default is 16 * @param useInterfacesFile if an interface file other then the default is
17 * desired to be used it should be passed in. 17 * desired to be used it should be passed in.
18 */ 18 */
19Interfaces::Interfaces(QString useInterfacesFile){ 19Interfaces::Interfaces(QString useInterfacesFile){
20 acceptedFamily.append(INTERFACES_FAMILY_INET); 20 acceptedFamily.append(INTERFACES_FAMILY_INET);
21 acceptedFamily.append(INTERFACES_FAMILY_IPX); 21 acceptedFamily.append(INTERFACES_FAMILY_IPX);
22 acceptedFamily.append(INTERFACES_FAMILY_INET6); 22 acceptedFamily.append(INTERFACES_FAMILY_INET6);
23 23
24 interfacesFile = useInterfacesFile; 24 interfacesFile = useInterfacesFile;
25 QFile file(interfacesFile); 25 QFile file(interfacesFile);
26 if (!file.open(IO_ReadOnly)){ 26 if (!file.open(IO_ReadOnly)){
27 qDebug("Interfaces: Can't open file: %s for reading.", interfacesFile.latin1() ); 27 qDebug("Interfaces: Can't open file: %s for reading.", interfacesFile.latin1() );
28 currentIface = interfaces.end(); 28 currentIface = interfaces.end();
29 currentMapping = interfaces.end(); 29 currentMapping = interfaces.end();
30 return; 30 return;
31 } 31 }
32 QTextStream stream( &file ); 32 QTextStream stream( &file );
33 QString line; 33 QString line;
34 while ( !stream.eof() ) { 34 while ( !stream.eof() ) {
35 line += stream.readLine(); 35 line += stream.readLine();
36 line += "\n"; 36 line += "\n";
37 } 37 }
38 file.close(); 38 file.close();
39 interfaces = QStringList::split("\n", line, true); 39 interfaces = QStringList::split("\n", line, true);
40 40
41 currentIface = interfaces.end(); 41 currentIface = interfaces.end();
42 currentMapping = interfaces.end(); 42 currentMapping = interfaces.end();
43} 43}
44 44
45 45
46/** 46/**
47 * Get a list of all interfaces in the interface file. Usefull for 47 * Get a list of all interfaces in the interface file. Useful for
48 * hardware that is not currently connected such as an 802.11b card 48 * hardware that is not currently connected such as an 802.11b card
49 * not plugged in, but configured for when it is plugged in. 49 * not plugged in, but configured for when it is plugged in.
50 * @return Return string list of interfaces. 50 * @return Return string list of interfaces.
51 **/ 51 **/
52QStringList Interfaces::getInterfaceList(){ 52QStringList Interfaces::getInterfaceList(){
53 QStringList list; 53 QStringList list;
54 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { 54 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
55 QString line = (*it).simplifyWhiteSpace(); 55 QString line = (*it).simplifyWhiteSpace();
56 if(line.contains(IFACE) && line.at(0) != '#'){ 56 if(line.contains(IFACE) && line.at(0) != '#'){
57 line = line.mid(QString(IFACE).length() +1, line.length()); 57 line = line.mid(QString(IFACE).length() +1, line.length());
58 line = line.simplifyWhiteSpace(); 58 line = line.simplifyWhiteSpace();
59 int findSpace = line.find(" "); 59 int findSpace = line.find(" ");
60 if( findSpace >= 0){ 60 if( findSpace >= 0){
61 line = line.mid(0, findSpace); 61 line = line.mid(0, findSpace);
62 list.append(line); 62 list.append(line);
63 } 63 }
64 } 64 }
65 } 65 }
66 return list; 66 return list;
67} 67}
68 68
69/** 69/**
70 * Find out if interface is in an "auto" group or not. 70 * Find out if interface is in an "auto" group or not.
71 * Report any duplicates such as eth0 being in two differnt auto's 71 * Report any duplicates such as eth0 being in two differnt auto's
72 * @param interface interface to check to see if it is on or not. 72 * @param interface interface to check to see if it is on or not.
73 * @return true is interface is in auto 73 * @return true is interface is in auto
74 */ 74 */
75bool Interfaces::isAuto(const QString &interface) const { 75bool Interfaces::isAuto(const QString &interface) const {
76 QStringList autoLines = interfaces.grep(QRegExp(AUTO)); 76 QStringList autoLines = interfaces.grep(QRegExp(AUTO));
77 QStringList awi = autoLines.grep(QRegExp(interface)); 77 QStringList awi = autoLines.grep(QRegExp(interface));
78 if(awi.count() > 1) 78 if(awi.count() > 1)
79 qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1()); 79 qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1());
80 return awi.count() > 0; 80 return awi.count() > 0;
81} 81}
82 82
83/** 83/**
84 * Attempt to set the auto option for interface to setAuto. 84 * Attempt to set the auto option for interface to setAuto.
85 * @param interface the interface to set 85 * @param interface the interface to set
86 * @param setAuto the value to set interface to. 86 * @param setAuto the value to set interface to.
87 * @return false if already set to setAuto. 87 * @return false if already set to setAuto.
88 * */ 88 * */
89bool Interfaces::setAuto(const QString &interface, bool setAuto){ 89bool Interfaces::setAuto(const QString &interface, bool setAuto){
90 // Don't need to set it if it is already set. 90 // Don't need to set it if it is already set.
91 if(isAuto(interface) == setAuto) 91 if(isAuto(interface) == setAuto)
92 return false; 92 return false;
93 93
94 bool changed = false; 94 bool changed = false;
95 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { 95 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
96 if((*it).contains(AUTO)){ 96 if((*it).contains(AUTO)){
97 //We know that they are not in any group so let add to this auto. 97 //We know that they are not in any group so let add to this auto.
98 if(setAuto){ 98 if(setAuto){
99 (*it) = (*it) += " " + interface; 99 (*it) = (*it) += " " + interface;
100 // Don't care to have such thins as: auto eth0 lo usb0 100 // Don't care to have such thins as: auto eth0 lo usb0
101 (*it) = (*it).simplifyWhiteSpace(); 101 (*it) = (*it).simplifyWhiteSpace();
102 changed = true; 102 changed = true;
103 break; 103 break;
104 } 104 }
105 // else see if we need to remove from this one 105 // else see if we need to remove from this one
106 else{ 106 else{
107 if((*it).contains(interface)){ 107 if((*it).contains(interface)){
108 (*it) = (*it).replace(QRegExp(interface), ""); 108 (*it) = (*it).replace(QRegExp(interface), "");
109 // if AUTO is the only thing left clear the line 109 // if AUTO is the only thing left clear the line
110 if(((*it).simplifyWhiteSpace()).replace(QRegExp(" "),"") == AUTO) 110 if(((*it).simplifyWhiteSpace()).replace(QRegExp(" "),"") == AUTO)
111 (*it) = ""; 111 (*it) = "";
112 changed = true; 112 changed = true;
113 // Don't break because we want to make sure we remove all cases. 113 // Don't break because we want to make sure we remove all cases.
114 } 114 }
115 } 115 }
116 } 116 }
117 } 117 }
118 // In the case where there is no AUTO field add one. 118 // In the case where there is no AUTO field add one.
119 if(!changed && setAuto) 119 if(!changed && setAuto)
120 interfaces.append(QString(AUTO" %1").arg(interface)); 120 interfaces.append(QString(AUTO" %1").arg(interface));
121 return true; 121 return true;
122} 122}
123 123
124/** 124/**
125 * Set the current interface to interface. This needs to be done before you 125 * Set the current interface to interface. This needs to be done before you
126 * can call getFamily(), getMethod, and get/setOption(). 126 * can call getFamily(), getMethod, and get/setOption().
127 * @param interface the name of the interface to set. All whitespace is 127 * @param interface the name of the interface to set. All whitespace is
128 * removed from the interface name. 128 * removed from the interface name.
129 * @return bool true if it is successfull. 129 * @return bool true if it is successful.
130 */ 130 */
131bool Interfaces::setInterface(QString interface){ 131bool Interfaces::setInterface(QString interface){
132 interface = interface.simplifyWhiteSpace(); 132 interface = interface.simplifyWhiteSpace();
133 interface = interface.replace(QRegExp(" "), ""); 133 interface = interface.replace(QRegExp(" "), "");
134 return setStanza(IFACE, interface, currentIface); 134 return setStanza(IFACE, interface, currentIface);
135} 135}
136 136
137/** 137/**
138 * A quick helper funtion to see if the current interface is set. 138 * A quick helper funtion to see if the current interface is set.
139 * @return bool true if set, false otherwise. 139 * @return bool true if set, false otherwise.
140 */ 140 */
141bool Interfaces::isInterfaceSet() const { 141bool Interfaces::isInterfaceSet() const {
142 return (interfaces.end() != currentIface); 142 return (interfaces.end() != currentIface);
143} 143}
144 144
145/** 145/**
146 * Add a new interface of with the settings - family and method 146 * Add a new interface of with the settings - family and method
147 * @param interface the name of the interface to set. All whitespace is 147 * @param interface the name of the interface to set. All whitespace is
148 * removed from the interface name. 148 * removed from the interface name.
149 * @param family the family of this interface inet or inet, ipx or inet6 149 * @param family the family of this interface inet or inet, ipx or inet6
150 * Must of one of the families defined in interfaces.h 150 * Must of one of the families defined in interfaces.h
151 * @param method for the family. see interfaces man page for family methods. 151 * @param method for the family. see interfaces man page for family methods.
152 * @return true if successfull. 152 * @return true if successful.
153 */ 153 */
154bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ 154bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){
155 qDebug("Interfaces::addInterface(%s)",interface.latin1()); 155 qDebug("Interfaces::addInterface(%s)",interface.latin1());
156 if(0 == acceptedFamily.contains(family)) 156 if(0 == acceptedFamily.contains(family))
157 return false; 157 return false;
158 QString newInterface = interface.simplifyWhiteSpace(); 158 QString newInterface = interface.simplifyWhiteSpace();
159 newInterface = newInterface.replace(QRegExp(" "), ""); 159 newInterface = newInterface.replace(QRegExp(" "), "");
160 interfaces.append(""); 160 interfaces.append("");
161 interfaces.append(QString(IFACE " %1 %2 %3").arg(newInterface).arg(family).arg(method)); 161 interfaces.append(QString(IFACE " %1 %2 %3").arg(newInterface).arg(family).arg(method));
162 return true; 162 return true;
163} 163}
164 164
165/** 165/**
166 * Copies interface with name interface to name newInterface 166 * Copies interface with name interface to name newInterface
167 * @param newInterface name of the new interface. 167 * @param newInterface name of the new interface.
168 * @return bool true if successfull 168 * @return bool true if successful
169 */ 169 */
170bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ 170bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){
171 qDebug("copy interface %s to %s", interface.latin1(), newInterface.latin1()); 171 qDebug("copy interface %s to %s", interface.latin1(), newInterface.latin1());
172 if(!setInterface(interface)) 172 if(!setInterface(interface))
173 return false; 173 return false;
174 174
175 // Store the old interface and bump past the stanza line. 175 // Store the old interface and bump past the stanza line.
176 QStringList::Iterator it = currentIface; 176 QStringList::Iterator it = currentIface;
177 it++; 177 it++;
178 178
179 // Add the new interface 179 // Add the new interface
180 bool error; 180 bool error;
181 addInterface(newInterface, getInterfaceFamily(error), getInterfaceMethod(error)); 181 addInterface(newInterface, getInterfaceFamily(error), getInterfaceMethod(error));
182 if(!setInterface(newInterface)) 182 if(!setInterface(newInterface))
183 return false; 183 return false;
184 184
185 QStringList::Iterator newIface = currentIface; 185 QStringList::Iterator newIface = currentIface;
186 newIface++; 186 newIface++;
187 187
188 // Copy all of the lines 188 // Copy all of the lines
189 for ( ; it != interfaces.end(); ++it ){ 189 for ( ; it != interfaces.end(); ++it ){
190 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO))) 190 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)))
191 break; 191 break;
192 newIface = interfaces.insert(newIface, *it); 192 newIface = interfaces.insert(newIface, *it);
193 } 193 }
194 194
195 return true; 195 return true;
196} 196}
197 197
198/** 198/**
199 * Remove the currently selected interface and all of its options. 199 * Remove the currently selected interface and all of its options.
200 * @return bool if successfull or not. 200 * @return bool if successful or not.
201 */ 201 */
202bool Interfaces::removeInterface(){ 202bool Interfaces::removeInterface(){
203 return removeStanza(currentIface); 203 return removeStanza(currentIface);
204} 204}
205 205
206/** 206/**
207 * Gets the hardware name of the interface that is currently selected. 207 * Gets the hardware name of the interface that is currently selected.
208 * @return QString name of the hardware interface (eth0, usb2, wlan1...). 208 * @return QString name of the hardware interface (eth0, usb2, wlan1...).
209 * @param error set to true if any error occurs, false otherwise. 209 * @param error set to true if any error occurs, false otherwise.
210 */ 210 */
211QString Interfaces::getInterfaceName(bool &error){ 211QString Interfaces::getInterfaceName(bool &error){
212 if(currentIface == interfaces.end()){ 212 if(currentIface == interfaces.end()){
213 error = true; 213 error = true;
214 return QString(); 214 return QString();
215 } 215 }
216 QString line = (*currentIface); 216 QString line = (*currentIface);
217 line = line.mid(QString(IFACE).length() +1, line.length()); 217 line = line.mid(QString(IFACE).length() +1, line.length());
218 line = line.simplifyWhiteSpace(); 218 line = line.simplifyWhiteSpace();
219 int findSpace = line.find(" "); 219 int findSpace = line.find(" ");
220 if( findSpace < 0){ 220 if( findSpace < 0){
221 error = true; 221 error = true;
222 return QString(); 222 return QString();
223 } 223 }
224 error = false; 224 error = false;
225 return line.mid(0, findSpace); 225 return line.mid(0, findSpace);
226} 226}
227 227
228/** 228/**
229 * Gets the family name of the interface that is currently selected. 229 * Gets the family name of the interface that is currently selected.
230 * @return QString name of the family (inet, inet6, ipx). 230 * @return QString name of the family (inet, inet6, ipx).
231 * @param error set to true if any error occurs, false otherwise. 231 * @param error set to true if any error occurs, false otherwise.
232 */ 232 */
233QString Interfaces::getInterfaceFamily(bool &error){ 233QString Interfaces::getInterfaceFamily(bool &error){
234 QString name = getInterfaceName(error); 234 QString name = getInterfaceName(error);
235 if(error) 235 if(error)
236 return QString(); 236 return QString();
237 QString line = (*currentIface); 237 QString line = (*currentIface);
238 line = line.mid(QString(IFACE).length() +1, line.length()); 238 line = line.mid(QString(IFACE).length() +1, line.length());
239 line = line.mid(name.length()+1, line.length()); 239 line = line.mid(name.length()+1, line.length());
240 line = line.simplifyWhiteSpace(); 240 line = line.simplifyWhiteSpace();
241 int findSpace = line.find(" "); 241 int findSpace = line.find(" ");
242 if( findSpace < 0){ 242 if( findSpace < 0){
243 error = true; 243 error = true;
244 return QString(); 244 return QString();
245 } 245 }
246 error = false; 246 error = false;
247 return line.mid(0, findSpace); 247 return line.mid(0, findSpace);
248} 248}
249 249
250/** 250/**
251 * Gets the method of the interface that is currently selected. 251 * Gets the method of the interface that is currently selected.
252 * @return QString name of the method such as staic or dhcp. 252 * @return QString name of the method such as staic or dhcp.
253 * See the man page of interfaces for possible methods depending on the family. 253 * See the man page of interfaces for possible methods depending on the family.
254 * @param error set to true if any error occurs, false otherwise. 254 * @param error set to true if any error occurs, false otherwise.
255 */ 255 */
256QString Interfaces::getInterfaceMethod(bool &error){ 256QString Interfaces::getInterfaceMethod(bool &error){
257 QString name = getInterfaceName(error); 257 QString name = getInterfaceName(error);
258 if(error) 258 if(error)
259 return QString(); 259 return QString();
260 QString family = getInterfaceFamily(error); 260 QString family = getInterfaceFamily(error);
261 if(error) 261 if(error)
262 return QString(); 262 return QString();
263 QString line = (*currentIface); 263 QString line = (*currentIface);
264 line = line.mid(QString(IFACE).length()+1, line.length()); 264 line = line.mid(QString(IFACE).length()+1, line.length());
265 line = line.mid(name.length()+1, line.length()); 265 line = line.mid(name.length()+1, line.length());
266 line = line.mid(family.length()+1, line.length()); 266 line = line.mid(family.length()+1, line.length());
267 line = line.simplifyWhiteSpace(); 267 line = line.simplifyWhiteSpace();
268 error = false; 268 error = false;
269 return line; 269 return line;
270} 270}
271 271
272/** 272/**
273 * Sets the interface name to newName. 273 * Sets the interface name to newName.
274 * @param newName the new name of the interface. All whitespace is removed. 274 * @param newName the new name of the interface. All whitespace is removed.
275 * @return bool true if successfull. 275 * @return bool true if successful.
276 */ 276 */
277bool Interfaces::setInterfaceName(const QString &newName){ 277bool Interfaces::setInterfaceName(const QString &newName){
278 qDebug("setInterfaceName %s", newName.latin1()); 278 qDebug("setInterfaceName %s", newName.latin1());
279 if(currentIface == interfaces.end()) 279 if(currentIface == interfaces.end())
280 return false; 280 return false;
281 QString name = newName.simplifyWhiteSpace(); 281 QString name = newName.simplifyWhiteSpace();
282 name = name.replace(QRegExp(" "), ""); 282 name = name.replace(QRegExp(" "), "");
283 bool returnValue = false; 283 bool returnValue = false;
284 QString tmp = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); 284 QString tmp = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue));
285 qDebug("setting %s",tmp.latin1()); 285 qDebug("setting %s",tmp.latin1());
286 286
287 (*currentIface) = tmp; 287 (*currentIface) = tmp;
288 return !returnValue; 288 return !returnValue;
289} 289}
290 290
291/** 291/**
292 * Sets the interface family to newName. 292 * Sets the interface family to newName.
293 * @param newName the new name of the interface. Must be one of the families 293 * @param newName the new name of the interface. Must be one of the families
294 * defined in the interfaces.h file. 294 * defined in the interfaces.h file.
295 * @return bool true if successfull. 295 * @return bool true if successful.
296 */ 296 */
297bool Interfaces::setInterfaceFamily(const QString &newName){ 297bool Interfaces::setInterfaceFamily(const QString &newName){
298 if(currentIface == interfaces.end()) 298 if(currentIface == interfaces.end())
299 return false; 299 return false;
300 if(acceptedFamily.contains(newName)==0) 300 if(acceptedFamily.contains(newName)==0)
301 return false; 301 return false;
302 bool returnValue = false; 302 bool returnValue = false;
303 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(newName).arg(getInterfaceMethod(returnValue)); 303 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(newName).arg(getInterfaceMethod(returnValue));
304 return !returnValue; 304 return !returnValue;
305} 305}
306 306
307/** 307/**
308 * Sets the interface method to newName 308 * Sets the interface method to newName
309 * @param newName the new name of the interface 309 * @param newName the new name of the interface
310 * @return bool true if successfull. 310 * @return bool true if successful.
311 */ 311 */
312bool Interfaces::setInterfaceMethod(const QString &newName){ 312bool Interfaces::setInterfaceMethod(const QString &newName){
313 if(currentIface == interfaces.end()) 313 if(currentIface == interfaces.end())
314 return false; 314 return false;
315 bool returnValue = false; 315 bool returnValue = false;
316 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(getInterfaceFamily(returnValue)).arg(newName); 316 (*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(getInterfaceFamily(returnValue)).arg(newName);
317 return !returnValue; 317 return !returnValue;
318} 318}
319 319
320/** 320/**
321 * Get a value for an option in the currently selected interface. For example 321 * Get a value for an option in the currently selected interface. For example
322 * calling getInterfaceOption("address") on the following stanza would 322 * calling getInterfaceOption("address") on the following stanza would
323 * return 192.168.1.1. 323 * return 192.168.1.1.
324 * iface eth0 static 324 * iface eth0 static
325 * address 192.168.1.1 325 * address 192.168.1.1
326 * @param option the options to get the value. 326 * @param option the options to get the value.
327 * @param error set to true if any error occurs, false otherwise. 327 * @param error set to true if any error occurs, false otherwise.
328 * @return QString the options value. QString::null if error == true 328 * @return QString the options value. QString::null if error == true
329 */ 329 */
330QString Interfaces::getInterfaceOption(const QString &option, bool &error){ 330QString Interfaces::getInterfaceOption(const QString &option, bool &error){
331 return getOption(currentIface, option, error); 331 return getOption(currentIface, option, error);
332} 332}
333 333
334/** 334/**
335 * Set a value for an option in the currently selected interface. If option 335 * Set a value for an option in the currently selected interface. If option
336 * doesn't exist then it is added along with the value. 336 * doesn't exist then it is added along with the value.
337 * If value isEmpty() then we will remove the option 337 * If value isEmpty() then we will remove the option
338 * 338 *
339 * @param option the options to set the value. 339 * @param option the options to set the value.
340 * @param value the value that option should be set to. 340 * @param value the value that option should be set to.
341 * @param error set to true if any error occurs, false otherwise. 341 * @param error set to true if any error occurs, false otherwise.
342 * @return QString the options value. QString::null if error == true 342 * @return QString the options value. QString::null if error == true
343 */ 343 */
344bool Interfaces::setInterfaceOption(const QString &option, const QString &value){ 344bool Interfaces::setInterfaceOption(const QString &option, const QString &value){
345 if( value.stripWhiteSpace().isEmpty() ) 345 if( value.stripWhiteSpace().isEmpty() )
346 return removeInterfaceOption( option ); 346 return removeInterfaceOption( option );
347 347
348 qDebug("iface >%s< option >%s< value >%s<", (*currentIface).latin1(), option.latin1(),value.latin1()); 348 qDebug("iface >%s< option >%s< value >%s<", (*currentIface).latin1(), option.latin1(),value.latin1());
349 return setOption(currentIface, option, value); 349 return setOption(currentIface, option, value);
350} 350}
351 351
352/** 352/**
353 * Removes a value for an option in the currently selected interface. 353 * Removes a value for an option in the currently selected interface.
354 * @param option the options to set the value. 354 * @param option the options to set the value.
355 * @param error set to true if any error occurs, false otherwise. 355 * @param error set to true if any error occurs, false otherwise.
356 * @return QString the options value. QString::null if error == true 356 * @return QString the options value. QString::null if error == true
357 */ 357 */
358bool Interfaces::removeInterfaceOption(const QString &option){ 358bool Interfaces::removeInterfaceOption(const QString &option){
359 return removeOption(currentIface, option); 359 return removeOption(currentIface, option);
360} 360}
361 361
362/** 362/**
363 * Removes a value for an option in the currently selected interface. 363 * Removes a value for an option in the currently selected interface.
364 * @param option the options to set the value. 364 * @param option the options to set the value.
365 * @param value the value that option should be set to. 365 * @param value the value that option should be set to.
366 * @param error set to true if any error occurs, false otherwise. 366 * @param error set to true if any error occurs, false otherwise.
367 * @return QString the options value. QString::null if error == true 367 * @return QString the options value. QString::null if error == true
368 */ 368 */
369bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){ 369bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){
370 return removeOption(currentIface, option, value); 370 return removeOption(currentIface, option, value);
371} 371}
372 372
373/** 373/**
374 * Removes all of the options from the currently selected interface. 374 * Removes all of the options from the currently selected interface.
375 * @return bool error if if successfull 375 * @return bool error if if successful
376 */ 376 */
377bool Interfaces::removeAllInterfaceOptions(){ 377bool Interfaces::removeAllInterfaceOptions(){
378 return removeAllOptions(currentIface); 378 return removeAllOptions(currentIface);
379} 379}
380 380
381/** 381/**
382 * Set the current map to interface's map. This needs to be done before you 382 * Set the current map to interface's map. This needs to be done before you
383 * can call addMapping(), set/getMap(), and get/setScript(). 383 * can call addMapping(), set/getMap(), and get/setScript().
384 * @param interface the name of the interface to set. All whitespace is 384 * @param interface the name of the interface to set. All whitespace is
385 * removed from the interface name. 385 * removed from the interface name.
386 * @return bool true if it is successfull. 386 * @return bool true if it is successful.
387 */ 387 */
388bool Interfaces::setMapping(const QString &interface){ 388bool Interfaces::setMapping(const QString &interface){
389 QString interfaceName = interface.simplifyWhiteSpace(); 389 QString interfaceName = interface.simplifyWhiteSpace();
390 interfaceName = interfaceName.replace(QRegExp(" "), ""); 390 interfaceName = interfaceName.replace(QRegExp(" "), "");
391 return setStanza(MAPPING, interfaceName, currentMapping); 391 return setStanza(MAPPING, interfaceName, currentMapping);
392} 392}
393 393
394/** 394/**
395 * Adds a new Mapping to the interfaces file with interfaces. 395 * Adds a new Mapping to the interfaces file with interfaces.
396 * @param interface the name(s) of the interfaces to set to this mapping 396 * @param interface the name(s) of the interfaces to set to this mapping
397 */ 397 */
398void Interfaces::addMapping(const QString &option){ 398void Interfaces::addMapping(const QString &option){
399 interfaces.append(""); 399 interfaces.append("");
400 interfaces.append(QString(MAPPING " %1").arg(option)); 400 interfaces.append(QString(MAPPING " %1").arg(option));
401} 401}
402 402
403/** 403/**
404 * Remove the currently selected map and all of its options. 404 * Remove the currently selected map and all of its options.
405 * @return bool if successfull or not. 405 * @return bool if successful or not.
406 */ 406 */
407bool Interfaces::removeMapping(){ 407bool Interfaces::removeMapping(){
408 return removeStanza(currentMapping); 408 return removeStanza(currentMapping);
409} 409}
410 410
411/** 411/**
412 * Set a map option within a mapping. 412 * Set a map option within a mapping.
413 * @param map map to use 413 * @param map map to use
414 * @param value value to go with map 414 * @param value value to go with map
415 * @return bool true if it is successfull. 415 * @return bool true if it is successful.
416 */ 416 */
417bool Interfaces::setMap(const QString &map, const QString &value){ 417bool Interfaces::setMap(const QString &map, const QString &value){
418 return setOption(currentMapping, map, value); 418 return setOption(currentMapping, map, value);
419} 419}
420 420
421/** 421/**
422 * Removes a map option within a mapping. 422 * Removes a map option within a mapping.
423 * @param map map to use 423 * @param map map to use
424 * @param value value to go with map 424 * @param value value to go with map
425 * @return bool true if it is successfull. 425 * @return bool true if it is successful.
426 */ 426 */
427bool Interfaces::removeMap(const QString &map, const QString &value){ 427bool Interfaces::removeMap(const QString &map, const QString &value){
428 return removeOption(currentMapping, map, value); 428 return removeOption(currentMapping, map, value);
429} 429}
430 430
431/** 431/**
432 * Get a map value within a mapping. 432 * Get a map value within a mapping.
433 * @param map map to get value of 433 * @param map map to get value of
434 * @param bool true if it is successfull. 434 * @param bool true if it is successful.
435 * @return value that goes to the map 435 * @return value that goes to the map
436 */ 436 */
437QString Interfaces::getMap(const QString &map, bool &error){ 437QString Interfaces::getMap(const QString &map, bool &error){
438 return getOption(currentMapping, map, error); 438 return getOption(currentMapping, map, error);
439} 439}
440 440
441/** 441/**
442 * Sets a script value of the current mapping to argument. 442 * Sets a script value of the current mapping to argument.
443 * @param argument the script name. 443 * @param argument the script name.
444 * @return true if successfull. 444 * @return true if successful.
445 */ 445 */
446bool Interfaces::setScript(const QString &argument){ 446bool Interfaces::setScript(const QString &argument){
447 return setOption(currentMapping, "script", argument); 447 return setOption(currentMapping, "script", argument);
448} 448}
449 449
450/** 450/**
451 * @param error true if could not retrieve the current script argument. 451 * @param error true if could not retrieve the current script argument.
452 * @return QString the argument of the script for the current mapping. 452 * @return QString the argument of the script for the current mapping.
453 */ 453 */
454QString Interfaces::getScript(bool &error){ 454QString Interfaces::getScript(bool &error){
455 return getOption(currentMapping, "script", error); 455 return getOption(currentMapping, "script", error);
456} 456}
457 457
458 458
459 459
460/** 460/**
461 * Helper function used to parse through the QStringList and put pointers in 461 * Helper function used to parse through the QStringList and put pointers in
462 * the correct place. 462 * the correct place.
463 * @param stanza The stanza (auto, iface, mapping) to look for. 463 * @param stanza The stanza (auto, iface, mapping) to look for.
464 * @param option string that must be in the stanza's main line. 464 * @param option string that must be in the stanza's main line.
465 * @param interator interator to place at location of stanza if successfull. 465 * @param interator interator to place at location of stanza if successful.
466 * @return bool true if the stanza is found. 466 * @return bool true if the stanza is found.
467 */ 467 */
468bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){ 468bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){
469 bool found = false; 469 bool found = false;
470 iterator = interfaces.end(); 470 iterator = interfaces.end();
471 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { 471 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
472 QString line = (*it).simplifyWhiteSpace(); 472 QString line = (*it).simplifyWhiteSpace();
473 if(line.contains(stanza) && line.contains(option) && line.at(0) != '#'){ 473 if(line.contains(stanza) && line.contains(option) && line.at(0) != '#'){
474 uint point = line.find(option); 474 uint point = line.find(option);
475 bool valid = true; 475 bool valid = true;
476 if(point > 0){ 476 if(point > 0){
477 // There are more chars in the line. check +1 477 // There are more chars in the line. check +1
478 if(line.at(point-1) != ' ') 478 if(line.at(point-1) != ' ')
479 valid = false; 479 valid = false;
480 } 480 }
481 point += option.length(); 481 point += option.length();
482 if(point < line.length()-1){ 482 if(point < line.length()-1){
483 // There are more chars in the line. check -1 483 // There are more chars in the line. check -1
484 if(line.at(point) != ' ') 484 if(line.at(point) != ' ')
485 valid = false; 485 valid = false;
486 } 486 }
487 if(valid){ 487 if(valid){
488 if(found == true){ 488 if(found == true){
489 qDebug(QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1()); 489 qDebug(QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1());
490 } 490 }
491 found = true; 491 found = true;
492 iterator = it; 492 iterator = it;
493 } 493 }
494 } 494 }
495 } 495 }
496 return found; 496 return found;
497} 497}
498 498
499/** 499/**
500 * Sets a value of an option in a stanza 500 * Sets a value of an option in a stanza
501 * @param start the start of the stanza 501 * @param start the start of the stanza
502 * @param option the option to use when setting value. 502 * @param option the option to use when setting value.
503 * @return bool true if successfull, false otherwise. 503 * @return bool true if successful, false otherwise.
504 */ 504 */
505bool Interfaces::setOption(const QStringList::Iterator &start, const QString &option, const QString &value){ 505bool Interfaces::setOption(const QStringList::Iterator &start, const QString &option, const QString &value){
506 if(start == interfaces.end()) 506 if(start == interfaces.end())
507 return false; 507 return false;
508 qDebug("setting option"); 508 qDebug("setting option");
509 bool found = false; 509 bool found = false;
510 bool replaced = false; 510 bool replaced = false;
511 QStringList::Iterator insertAt = NULL; 511 QStringList::Iterator insertAt = NULL;
512 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 512 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
513 qDebug(" Interfaces::setOption got line >%s<",(*it).latin1()); 513 qDebug(" Interfaces::setOption got line >%s<",(*it).latin1());
514 // FIXME: was not completly stupid just wrong sice all options got inserted bevore the iface line 514 // FIXME: was not completly stupid just wrong sice all options got inserted bevore the iface line
515 // but since it works with an empty interfaces file I (tille) will not do anything more 515 // but since it works with an empty interfaces file I (tille) will not do anything more
516 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) ){ 516 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) ){
517 if (found) break; 517 if (found) break;
518// && it != start){ 518// && it != start){
519// if(!found && value != ""){ 519// if(!found && value != ""){
520// // Got to the end of the stanza without finding it, so append it. 520// // Got to the end of the stanza without finding it, so append it.
521// qDebug(" Got to the end of the stanza without finding it, so append it."); 521// qDebug(" Got to the end of the stanza without finding it, so append it.");
522// interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value)); 522// interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value));
523// } 523// }
524 qDebug("found 1"); 524 qDebug("found 1");
525// interfaces.insert(++it, QString("\t%1 %2").arg(option).arg(value)); 525// interfaces.insert(++it, QString("\t%1 %2").arg(option).arg(value));
526 found = true; 526 found = true;
527 insertAt = it; 527 insertAt = it;
528 528
529 } 529 }
530 if((*it).contains(option) && it != start && (*it).at(0) != '#'){ 530 if((*it).contains(option) && it != start && (*it).at(0) != '#'){
531 // Found it in stanza so replace it. 531 // Found it in stanza so replace it.
532 qDebug("found 2"); 532 qDebug("found 2");
533 if(found) 533 if(found)
534 qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); 534 qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
535 found = true; 535 found = true;
536 replaced = true; 536 replaced = true;
537 (*it) = QString("\t%1 %2").arg(option).arg(value); 537 (*it) = QString("\t%1 %2").arg(option).arg(value);
538 } 538 }
539 } 539 }
540 if(!found){ 540 if(!found){
541 qDebug("! found insert anyway"); 541 qDebug("! found insert anyway");
542 QStringList::Iterator p = start; 542 QStringList::Iterator p = start;
543 interfaces.insert(++p, QString("\t%1 %2").arg(option).arg(value)); 543 interfaces.insert(++p, QString("\t%1 %2").arg(option).arg(value));
544 found = true; 544 found = true;
545 } 545 }
546 546
547 if(found && !replaced){ 547 if(found && !replaced){
548 qDebug("found iface but not the option so insert it here..."); 548 qDebug("found iface but not the option so insert it here...");
549 interfaces.insert(++insertAt, QString("\t%1 %2").arg(option).arg(value)); 549 interfaces.insert(++insertAt, QString("\t%1 %2").arg(option).arg(value));
550 } 550 }
551 return found; 551 return found;
552} 552}
553 553
554/** 554/**
555 * Removes a stanza and all of its options 555 * Removes a stanza and all of its options
556 * @param stanza the stanza to remove 556 * @param stanza the stanza to remove
557 * @return bool true if successfull. 557 * @return bool true if successful.
558 */ 558 */
559bool Interfaces::removeStanza(QStringList::Iterator &stanza){ 559bool Interfaces::removeStanza(QStringList::Iterator &stanza){
560 if(stanza == interfaces.end()) 560 if(stanza == interfaces.end())
561 return false; 561 return false;
562 (*stanza) = ""; 562 (*stanza) = "";
563 return removeAllOptions(stanza); 563 return removeAllOptions(stanza);
564} 564}
565 565
566/** 566/**
567 * Removes a option in a stanza 567 * Removes a option in a stanza
568 * @param start the start of the stanza 568 * @param start the start of the stanza
569 * @param option the option to remove 569 * @param option the option to remove
570 * @return bool true if successfull, false otherwise. 570 * @return bool true if successful, false otherwise.
571 */ 571 */
572bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option){ 572bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option){
573 if(start == interfaces.end()) 573 if(start == interfaces.end())
574 return false; 574 return false;
575 575
576 bool found = false; 576 bool found = false;
577 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 577 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
578 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ 578 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
579 // got to the end without finding it 579 // got to the end without finding it
580 break; 580 break;
581 } 581 }
582 if((*it).contains(option) && it != start && (*it).at(0) != '#'){ 582 if((*it).contains(option) && it != start && (*it).at(0) != '#'){
583 // Found it in stanza so replace it. 583 // Found it in stanza so replace it.
584 if(found) 584 if(found)
585 qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); 585 qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
586 found = true; 586 found = true;
587 it = interfaces.remove( it ); // we really want to remove the line 587 it = interfaces.remove( it ); // we really want to remove the line
588 --it; // we do ++it later in the head of the for loop 588 --it; // we do ++it later in the head of the for loop
589 } 589 }
590 } 590 }
591 return found; 591 return found;
592} 592}
593 593
594/** 594/**
595 * Removes a option in a stanza 595 * Removes a option in a stanza
596 * @param start the start of the stanza 596 * @param start the start of the stanza
597 * @param option the option to use when setting value. 597 * @param option the option to use when setting value.
598 * @return bool true if successfull, false otherwise. 598 * @return bool true if successful, false otherwise.
599 */ 599 */
600bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option, const QString &value){ 600bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option, const QString &value){
601 if(start == interfaces.end()) 601 if(start == interfaces.end())
602 return false; 602 return false;
603 603
604 bool found = false; 604 bool found = false;
605 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 605 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
606 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ 606 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
607 // got to the end without finding it 607 // got to the end without finding it
608 break; 608 break;
609 } 609 }
610 if((*it).contains(option) && (*it).contains(value) && it != start && (*it).at(0) != '#'){ 610 if((*it).contains(option) && (*it).contains(value) && it != start && (*it).at(0) != '#'){
611 // Found it in stanza so replace it. 611 // Found it in stanza so replace it.
612 if(found) 612 if(found)
613 qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); 613 qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
614 found = true; 614 found = true;
615 it = interfaces.remove( it ); // we really want to remove the line 615 it = interfaces.remove( it ); // we really want to remove the line
616 --it; // we do ++it later in the head of the for loop 616 --it; // we do ++it later in the head of the for loop
617 } 617 }
618 } 618 }
619 return found; 619 return found;
620} 620}
621 621
622/** 622/**
623 * Removes all options in a stanza 623 * Removes all options in a stanza
624 * @param start the start of the stanza 624 * @param start the start of the stanza
625 * @return bool true if successfull, false otherwise. 625 * @return bool true if successful, false otherwise.
626 */ 626 */
627bool Interfaces::removeAllOptions(const QStringList::Iterator &start){ 627bool Interfaces::removeAllOptions(const QStringList::Iterator &start){
628 if(start == interfaces.end()) 628 if(start == interfaces.end())
629 return false; 629 return false;
630 630
631 QStringList::Iterator it = start; 631 QStringList::Iterator it = start;
632 it = ++it; 632 it = ++it;
633 for (; it != interfaces.end(); ++it ) { 633 for (; it != interfaces.end(); ++it ) {
634 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ 634 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
635 break; 635 break;
636 } 636 }
637 it = interfaces.remove(it); 637 it = interfaces.remove(it);
638 it = --it; 638 it = --it;
639 } 639 }
640 // Leave a space between this interface and the next. 640 // Leave a space between this interface and the next.
641 interfaces.insert(it, QString("")); 641 interfaces.insert(it, QString(""));
642 return true; 642 return true;
643} 643}
644 644
645/** 645/**
646 * Gets a value of an option in a stanza 646 * Gets a value of an option in a stanza
647 * @param start the start of the stanza 647 * @param start the start of the stanza
648 * @param option the option to use when getting the value. 648 * @param option the option to use when getting the value.
649 * @param bool true if errors false otherwise. 649 * @param bool true if errors false otherwise.
650 * @return QString the value of option QString::null() if error == true. 650 * @return QString the value of option QString::null() if error == true.
651 */ 651 */
652QString Interfaces::getOption(const QStringList::Iterator &start, const QString &option, bool &error){ 652QString Interfaces::getOption(const QStringList::Iterator &start, const QString &option, bool &error){
653 if(start == interfaces.end()){ 653 if(start == interfaces.end()){
654 error = false; 654 error = false;
655 return QString(); 655 return QString();
656 } 656 }
657 657
658 QString value; 658 QString value;
659 bool found = false; 659 bool found = false;
660 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 660 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
661 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ 661 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
662 break; 662 break;
663 } 663 }
664 if((*it).contains(option) && (*it).at(0) != '#'){ 664 if((*it).contains(option) && (*it).at(0) != '#'){
665 if(found) 665 if(found)
666 qDebug(QString("Interfaces: getOption found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1()); 666 qDebug(QString("Interfaces: getOption found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1());
667 found = true; 667 found = true;
668 QString line = (*it).simplifyWhiteSpace(); 668 QString line = (*it).simplifyWhiteSpace();
669 int space = line.find(" ", option.length()); 669 int space = line.find(" ", option.length());
670 if(space != -1){ 670 if(space != -1){
671 value = line.mid(space+1, line.length()); 671 value = line.mid(space+1, line.length());
672 break; 672 break;
673 } 673 }
674 } 674 }
675 } 675 }
676 error = !found; 676 error = !found;
677 return value; 677 return value;
678} 678}
679 679
680/** 680/**
681 * Write out the interfaces file to the file passed into the constructor. 681 * Write out the interfaces file to the file passed into the constructor.
682 * Removes any excess blank lines over 1 line long. 682 * Removes any excess blank lines over 1 line long.
683 * @return bool true if successfull, false if not. 683 * @return bool true if successful, false if not.
684 */ 684 */
685bool Interfaces::write(){ 685bool Interfaces::write(){
686 QFile::remove(interfacesFile); 686 QFile::remove(interfacesFile);
687 QFile file(interfacesFile); 687 QFile file(interfacesFile);
688 688
689 if (!file.open(IO_ReadWrite)){ 689 if (!file.open(IO_ReadWrite)){
690 qDebug(QString("Interfaces: Can't open file: %1 for writing.").arg(interfacesFile).latin1()); 690 qDebug(QString("Interfaces: Can't open file: %1 for writing.").arg(interfacesFile).latin1());
691 return false; 691 return false;
692 } 692 }
693 QTextStream stream( &file ); 693 QTextStream stream( &file );
694 int whiteSpaceCount = 0; 694 int whiteSpaceCount = 0;
695 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { 695 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
696 QString line = (*it).simplifyWhiteSpace(); 696 QString line = (*it).simplifyWhiteSpace();
697 line = line.replace(QRegExp(" "),""); 697 line = line.replace(QRegExp(" "),"");
698 if(line.length() == 0) 698 if(line.length() == 0)
699 whiteSpaceCount++; 699 whiteSpaceCount++;
700 else 700 else
701 whiteSpaceCount = 0; 701 whiteSpaceCount = 0;
702 if(whiteSpaceCount < 2){ 702 if(whiteSpaceCount < 2){
703 qDebug((*it).latin1()); 703 qDebug((*it).latin1());
704 stream << (*it) << '\n'; 704 stream << (*it) << '\n';
705 } 705 }
706 } 706 }
707 file.close(); 707 file.close();
708 return true; 708 return true;
709} 709}
710 710
711// interfaces.cpp 711// interfaces.cpp
712 712
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index e844d8a..78466d0 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -1,206 +1,206 @@
1#include "interfacesetupimp.h" 1#include "interfacesetupimp.h"
2#include "interface.h" 2#include "interface.h"
3 3
4#include <qcheckbox.h> 4#include <qcheckbox.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qspinbox.h> 6#include <qspinbox.h>
7#include <qgroupbox.h> 7#include <qgroupbox.h>
8#include <qlabel.h> 8#include <qlabel.h>
9 9
10#include <qmessagebox.h> 10#include <qmessagebox.h>
11 11
12#include <opie/oprocess.h> 12#include <opie/oprocess.h>
13 13
14#ifdef QWS 14#ifdef QWS
15#include <opie/owait.h> 15#include <opie/owait.h>
16#include <qpe/global.h> 16#include <qpe/global.h>
17#include <qapplication.h> 17#include <qapplication.h>
18#endif 18#endif
19 19
20#define DNSSCRIPT "changedns" 20#define DNSSCRIPT "changedns"
21 21
22/** 22/**
23 * Constuctor. Set up the connection. A profile must be set. 23 * Constuctor. Set up the connection. A profile must be set.
24 */ 24 */
25InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){ 25InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){
26 if (j == 0) { 26 if (j == 0) {
27 delInterfaces = true; 27 delInterfaces = true;
28 interfaces = new Interfaces; 28 interfaces = new Interfaces;
29 } 29 }
30} 30}
31 31
32/** 32/**
33 * Destructor 33 * Destructor
34 */ 34 */
35InterfaceSetupImp::~InterfaceSetupImp(){ 35InterfaceSetupImp::~InterfaceSetupImp(){
36 if(delInterfaces) { 36 if(delInterfaces) {
37 delete interfaces; 37 delete interfaces;
38 } 38 }
39} 39}
40 40
41/** 41/**
42 * Save the current settings, then write out the interfaces file and close. 42 * Save the current settings, then write out the interfaces file and close.
43 */ 43 */
44bool InterfaceSetupImp::saveChanges(){ 44bool InterfaceSetupImp::saveChanges(){
45 bool error; 45 bool error;
46 QString iface = interfaces->getInterfaceName(error); 46 QString iface = interfaces->getInterfaceName(error);
47 qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() ); 47 qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() );
48 if(!saveSettings()) 48 if(!saveSettings())
49 return false; 49 return false;
50 50
51 interfaces->write(); 51 interfaces->write();
52 52
53 if (interface->getStatus()) { 53 if (interface->getStatus()) {
54 QString ifup; 54 QString ifup;
55 ifup += "ifdown "; 55 ifup += "ifdown ";
56 ifup += iface; 56 ifup += iface;
57 ifup += "; ifup "; 57 ifup += "; ifup ";
58 ifup += iface; 58 ifup += iface;
59 ifup += ";"; 59 ifup += ";";
60 60
61 OProcess restart; 61 OProcess restart;
62 restart << "sh"; 62 restart << "sh";
63 restart << "-c"; 63 restart << "-c";
64 restart << ifup; 64 restart << ifup;
65 65
66 OWait *owait = new OWait(); 66 OWait *owait = new OWait();
67 Global::statusMessage( tr( "Restarting interface" ) ); 67 Global::statusMessage( tr( "Restarting interface" ) );
68 68
69 owait->show(); 69 owait->show();
70 qApp->processEvents(); 70 qApp->processEvents();
71 71
72 if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) { 72 if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) {
73 qWarning("unstable to spawn ifdown/ifup"); 73 qWarning("unstable to spawn ifdown/ifup");
74 } 74 }
75 75
76 owait->hide(); 76 owait->hide();
77 delete owait; 77 delete owait;
78 78
79 interface->refresh(); 79 interface->refresh();
80 } 80 }
81 return true; 81 return true;
82} 82}
83 83
84/** 84/**
85 * Save the settings for the current Interface. 85 * Save the settings for the current Interface.
86 * @return bool true if successfull, false otherwise 86 * @return bool true if successful, false otherwise
87 */ 87 */
88bool InterfaceSetupImp::saveSettings(){ 88bool InterfaceSetupImp::saveSettings(){
89 // eh can't really do anything about it other then return. :-D 89 // eh can't really do anything about it other then return. :-D
90 if(!interfaces->isInterfaceSet()) 90 if(!interfaces->isInterfaceSet())
91 return true; 91 return true;
92 92
93 bool error = false; 93 bool error = false;
94 // Loopback case 94 // Loopback case
95 if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ 95 if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){
96 interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); 96 interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked());
97 return true; 97 return true;
98 } 98 }
99 99
100 if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ 100 if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){
101 QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok); 101 QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok);
102 return false; 102 return false;
103 } 103 }
104 // DHCP 104 // DHCP
105 if(dhcpCheckBox->isChecked()) { 105 if(dhcpCheckBox->isChecked()) {
106 interfaces->setInterfaceMethod(INTERFACES_METHOD_DHCP); 106 interfaces->setInterfaceMethod(INTERFACES_METHOD_DHCP);
107 interfaces->removeInterfaceOption("address"); 107 interfaces->removeInterfaceOption("address");
108 interfaces->removeInterfaceOption("netmask"); 108 interfaces->removeInterfaceOption("netmask");
109 interfaces->removeInterfaceOption("gateway"); 109 interfaces->removeInterfaceOption("gateway");
110 interfaces->removeInterfaceOption("up "DNSSCRIPT" -a "); 110 interfaces->removeInterfaceOption("up "DNSSCRIPT" -a ");
111 interfaces->removeInterfaceOption("down "DNSSCRIPT" -r "); 111 interfaces->removeInterfaceOption("down "DNSSCRIPT" -r ");
112 } else{ 112 } else{
113 interfaces->setInterfaceMethod("static"); 113 interfaces->setInterfaceMethod("static");
114 interfaces->setInterfaceOption("address", ipAddressEdit->text()); 114 interfaces->setInterfaceOption("address", ipAddressEdit->text());
115 interfaces->setInterfaceOption("netmask", subnetMaskEdit->text()); 115 interfaces->setInterfaceOption("netmask", subnetMaskEdit->text());
116 interfaces->setInterfaceOption("gateway", gatewayEdit->text()); 116 interfaces->setInterfaceOption("gateway", gatewayEdit->text());
117 if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ 117 if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){
118 QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); 118 QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text();
119 interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns); 119 interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns);
120 interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); 120 interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns);
121 }else{ 121 }else{
122 interfaces->removeInterfaceOption("up "DNSSCRIPT" -a "); 122 interfaces->removeInterfaceOption("up "DNSSCRIPT" -a ");
123 interfaces->removeInterfaceOption("down "DNSSCRIPT" -r"); 123 interfaces->removeInterfaceOption("down "DNSSCRIPT" -r");
124 } 124 }
125 } 125 }
126 126
127 // IP Information 127 // IP Information
128 interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); 128 interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked());
129 return true; 129 return true;
130} 130}
131 131
132/** 132/**
133 * The Profile has changed. 133 * The Profile has changed.
134 * @param QString profile the new profile. 134 * @param QString profile the new profile.
135 */ 135 */
136void InterfaceSetupImp::setProfile(const QString &profile){ 136void InterfaceSetupImp::setProfile(const QString &profile){
137 /* 137 /*
138 bool error = false; 138 bool error = false;
139 if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ 139 if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){
140 staticGroupBox->hide(); 140 staticGroupBox->hide();
141 dhcpCheckBox->hide(); 141 dhcpCheckBox->hide();
142 leaseTime->hide(); 142 leaseTime->hide();
143 leaseHoursLabel->hide(); 143 leaseHoursLabel->hide();
144 } 144 }
145 */ 145 */
146 146
147 QString newInterfaceName = interface->getInterfaceName(); 147 QString newInterfaceName = interface->getInterfaceName();
148 if(profile.length() > 0) 148 if(profile.length() > 0)
149 newInterfaceName += "_" + profile; 149 newInterfaceName += "_" + profile;
150 // See if we have to make a interface. 150 // See if we have to make a interface.
151 if(!interfaces->setInterface(newInterfaceName)){ 151 if(!interfaces->setInterface(newInterfaceName)){
152 // Add making for this new interface if need too 152 // Add making for this new interface if need too
153 if(profile != ""){ 153 if(profile != ""){
154 interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); 154 interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName);
155 if(!interfaces->setMapping(interface->getInterfaceName())){ 155 if(!interfaces->setMapping(interface->getInterfaceName())){
156 interfaces->addMapping(interface->getInterfaceName()); 156 interfaces->addMapping(interface->getInterfaceName());
157 if(!interfaces->setMapping(interface->getInterfaceName())){ 157 if(!interfaces->setMapping(interface->getInterfaceName())){
158 qDebug("InterfaceSetupImp: Added Mapping, but still can't setInterface."); 158 qDebug("InterfaceSetupImp: Added Mapping, but still can't setInterface.");
159 return; 159 return;
160 } 160 }
161 } 161 }
162 interfaces->setMap("map", newInterfaceName); 162 interfaces->setMap("map", newInterfaceName);
163 interfaces->setScript("getprofile.sh"); 163 interfaces->setScript("getprofile.sh");
164 } 164 }
165 else{ 165 else{
166 interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); 166 interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP);
167 if(!interfaces->setInterface(newInterfaceName)){ 167 if(!interfaces->setInterface(newInterfaceName)){
168 qDebug("InterfaceSetupImp: Added interface, but still can't setInterface."); 168 qDebug("InterfaceSetupImp: Added interface, but still can't setInterface.");
169 return; 169 return;
170 } 170 }
171 } 171 }
172 } 172 }
173 173
174 // We must have a valid interface to get this far so read some settings. 174 // We must have a valid interface to get this far so read some settings.
175 175
176 // DHCP 176 // DHCP
177 bool error = false; 177 bool error = false;
178 if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) 178 if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP)
179 dhcpCheckBox->setChecked(true); 179 dhcpCheckBox->setChecked(true);
180 else 180 else
181 dhcpCheckBox->setChecked(false); 181 dhcpCheckBox->setChecked(false);
182 182
183 // IP Information 183 // IP Information
184 autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); 184 autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName()));
185 QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); 185 QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error);
186 qDebug("dns >%s<",dns.latin1()); 186 qDebug("dns >%s<",dns.latin1());
187 if(dns.contains(" ")){ 187 if(dns.contains(" ")){
188 firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); 188 firstDNSLineEdit->setText(dns.mid(0, dns.find(" ")));
189 secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); 189 secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length()));
190 }else firstDNSLineEdit->setText(dns); 190 }else firstDNSLineEdit->setText(dns);
191 191
192 ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); 192 ipAddressEdit->setText(interfaces->getInterfaceOption("address", error));
193 subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); 193 subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error));
194 if (subnetMaskEdit->text().isEmpty()) 194 if (subnetMaskEdit->text().isEmpty())
195 subnetMaskEdit->setText( "255.255.255.0" ); 195 subnetMaskEdit->setText( "255.255.255.0" );
196 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); 196 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error));
197 197
198 198
199 199
200 qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); 200 qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1());
201 qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); 201 qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1());
202 202
203} 203}
204 204
205// interfacesetup.cpp 205// interfacesetup.cpp
206 206
diff --git a/noncore/settings/networksettings/module.h b/noncore/settings/networksettings/module.h
index f7d8046..5cc82cd 100644
--- a/noncore/settings/networksettings/module.h
+++ b/noncore/settings/networksettings/module.h
@@ -1,113 +1,113 @@
1#ifndef NETCONF_MODULE_H 1#ifndef NETCONF_MODULE_H
2#define NETCONF_MODULE_H 2#define NETCONF_MODULE_H
3 3
4#include <qobject.h> 4#include <qobject.h>
5#if QT_VERSION < 300 5#if QT_VERSION < 300
6#include <qlist.h> 6#include <qlist.h>
7#else 7#else
8#include <qptrlist.h> 8#include <qptrlist.h>
9#endif 9#endif
10#include <qmap.h> 10#include <qmap.h>
11#include "interface.h" 11#include "interface.h"
12 12
13class QWidget; 13class QWidget;
14class QTabWidget; 14class QTabWidget;
15 15
16class Module : QObject{ 16class Module : QObject{
17 17
18signals: 18signals:
19 void updateInterface(Interface *i); 19 void updateInterface(Interface *i);
20 20
21 21
22public: 22public:
23 Module(){}; 23 Module(){};
24 24
25 /** 25 /**
26 * The type of the plugin 26 * The type of the plugin
27 * and the name of the dcop call 27 * and the name of the dcop call
28 */ 28 */
29 virtual const QString type() = 0; 29 virtual const QString type() = 0;
30 30
31 /** 31 /**
32 * The current profile has been changed and the module should do any 32 * The current profile has been changed and the module should do any
33 * neccesary changes also. 33 * neccesary changes also.
34 * @param newProfile what the profile should be changed to. 34 * @param newProfile what the profile should be changed to.
35 */ 35 */
36 virtual void setProfile(const QString &newProfile) = 0; 36 virtual void setProfile(const QString &newProfile) = 0;
37 37
38 /** 38 /**
39 * get the icon name for this device. 39 * get the icon name for this device.
40 * @param Interface* can be used in determining the icon. 40 * @param Interface* can be used in determining the icon.
41 * @return QString the icon name (minus .png, .gif etc) 41 * @return QString the icon name (minus .png, .gif etc)
42 */ 42 */
43 virtual QString getPixmapName(Interface *) = 0; 43 virtual QString getPixmapName(Interface *) = 0;
44 44
45 /** 45 /**
46 * Check to see if the interface i is owned by this module. 46 * Check to see if the interface i is owned by this module.
47 * @param Interface* interface to check against 47 * @param Interface* interface to check against
48 * @return bool true if i is owned by this module, false otherwise. 48 * @return bool true if i is owned by this module, false otherwise.
49 */ 49 */
50 virtual bool isOwner(Interface *){ return false; }; 50 virtual bool isOwner(Interface *){ return false; };
51 51
52 /** 52 /**
53 * Create and return the WLANConfigure Module 53 * Create and return the WLANConfigure Module
54 * @param Interface *i the interface to configure. 54 * @param Interface *i the interface to configure.
55 * @return QWidget* pointer to this modules configure. 55 * @return QWidget* pointer to this modules configure.
56 */ 56 */
57 virtual QWidget *configure(Interface *){ return NULL; } ; 57 virtual QWidget *configure(Interface *){ return NULL; } ;
58 58
59 /** 59 /**
60 * Create, and return the Information Module 60 * Create, and return the Information Module
61 * @param Interface *i the interface to get info on. 61 * @param Interface *i the interface to get info on.
62 * @return QWidget* pointer to this modules info. 62 * @return QWidget* pointer to this modules info.
63 */ 63 */
64 virtual QWidget *information(Interface *){ return NULL; }; 64 virtual QWidget *information(Interface *){ return NULL; };
65 65
66 /** 66 /**
67 * Get all active (up or down) interfaces 67 * Get all active (up or down) interfaces
68 * @return QList<Interface> A list of interfaces that exsist that havn't 68 * @return QList<Interface> A list of interfaces that exsist that havn't
69 * been called by isOwner() 69 * been called by isOwner()
70 */ 70 */
71 virtual QList<Interface> getInterfaces() = 0; 71 virtual QList<Interface> getInterfaces() = 0;
72 72
73 /** 73 /**
74 * Adds possible new interfaces to the list (Example: usb(ppp), ir(ppp), 74 * Adds possible new interfaces to the list (Example: usb(ppp), ir(ppp),
75 * modem ppp) 75 * modem ppp)
76 */ 76 */
77 virtual void possibleNewInterfaces(QMap<QString, QString> &list) = 0; 77 virtual void possibleNewInterfaces(QMap<QString, QString> &list) = 0;
78 78
79 /** 79 /**
80 * Attempts to create a new interface from name 80 * Attempts to create a new interface from name
81 * @return Interface* NULL if it was unable to be created. 81 * @return Interface* NULL if it was unable to be created.
82 * @param name the type of interface to create 82 * @param name the type of interface to create
83 */ 83 */
84 virtual Interface *addNewInterface(const QString &name) = 0; 84 virtual Interface *addNewInterface(const QString &name) = 0;
85 85
86 /** 86 /**
87 * Attempts to remove the interface, doesn't delete i 87 * Attempts to remove the interface, doesn't delete i
88 * @return bool true if successfull, false otherwise. 88 * @return bool true if successful, false otherwise.
89 */ 89 */
90 virtual bool remove(Interface* i) = 0; 90 virtual bool remove(Interface* i) = 0;
91 91
92 /** 92 /**
93 * get dcop calls 93 * get dcop calls
94 */ 94 */
95 virtual void receive(const QCString &msg, const QByteArray &arg) = 0; 95 virtual void receive(const QCString &msg, const QByteArray &arg) = 0;
96 96
97 QStringList handledInterfaceNames()const { return m_inter; } 97 QStringList handledInterfaceNames()const { return m_inter; }
98protected: 98protected:
99 /** 99 /**
100 * set which interfaceNames should not be shown cause they're handled 100 * set which interfaceNames should not be shown cause they're handled
101 * internally of this module.. An already running ppp link or 101 * internally of this module.. An already running ppp link or
102 * a tunnel... 102 * a tunnel...
103 */ 103 */
104 void setHandledInterfaceNames( const QStringList& in) { m_inter = in; } 104 void setHandledInterfaceNames( const QStringList& in) { m_inter = in; }
105 105
106private: 106private:
107 QStringList m_inter; 107 QStringList m_inter;
108}; 108};
109 109
110#endif 110#endif
111 111
112// module.h 112// module.h
113 113
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index af05eb7..2462fa4 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -1,250 +1,250 @@
1#include <errno.h> 1#include <errno.h>
2#include <signal.h> 2#include <signal.h>
3 3
4 4
5#include <qpe/config.h> 5#include <qpe/config.h>
6 6
7#include "modem.h" 7#include "modem.h"
8#include "pppconfig.h" 8#include "pppconfig.h"
9#include "pppmodule.h" 9#include "pppmodule.h"
10#include "pppdata.h" 10#include "pppdata.h"
11#include "interfaceinformationppp.h" 11#include "interfaceinformationppp.h"
12#include "interfaceppp.h" 12#include "interfaceppp.h"
13 13
14// don't polute global namespace 14// don't polute global namespace
15namespace { 15namespace {
16 /* 16 /*
17 * If network settings is qutting and we've ppp 17 * If network settings is qutting and we've ppp
18 * devices open we need to save the pid_t the PPData 18 * devices open we need to save the pid_t the PPData
19 * and the interface number 19 * and the interface number
20 */ 20 */
21 struct Connection { 21 struct Connection {
22 pid_t pid; 22 pid_t pid;
23 QString device; 23 QString device;
24 QString name; 24 QString name;
25 }; 25 };
26 class InterfaceKeeper { 26 class InterfaceKeeper {
27 public: 27 public:
28 InterfaceKeeper(); 28 InterfaceKeeper();
29 ~InterfaceKeeper(); 29 ~InterfaceKeeper();
30 30
31 void addInterface( pid_t, const QString& pppDev, const QString& name ); 31 void addInterface( pid_t, const QString& pppDev, const QString& name );
32 QMap<QString, Connection> interfaces()const; // will check if still available 32 QMap<QString, Connection> interfaces()const; // will check if still available
33 private: 33 private:
34 bool isAvailable( pid_t )const; 34 bool isAvailable( pid_t )const;
35 QMap<QString, Connection> m_interfaces; 35 QMap<QString, Connection> m_interfaces;
36 }; 36 };
37} 37}
38 38
39 39
40/** 40/**
41 * Constructor, find all of the possible interfaces 41 * Constructor, find all of the possible interfaces
42 * We also need to restore the state.. it could be that 42 * We also need to restore the state.. it could be that
43 * an interface was up while closing the application 43 * an interface was up while closing the application
44 * we need to be able to shut it down... 44 * we need to be able to shut it down...
45 */ 45 */
46PPPModule::PPPModule() : Module() 46PPPModule::PPPModule() : Module()
47{ 47{
48 InterfaceKeeper inFace; 48 InterfaceKeeper inFace;
49 QMap<QString,Connection> running = inFace.interfaces(); 49 QMap<QString,Connection> running = inFace.interfaces();
50 QStringList handledInterfaceNames; 50 QStringList handledInterfaceNames;
51 51
52 QMap<QString,QString> ifaces = PPPData::getConfiguredInterfaces(); 52 QMap<QString,QString> ifaces = PPPData::getConfiguredInterfaces();
53 QMap<QString,QString>::Iterator it; 53 QMap<QString,QString>::Iterator it;
54 InterfacePPP *iface; 54 InterfacePPP *iface;
55 qDebug("getting interfaces"); 55 qDebug("getting interfaces");
56 for( it = ifaces.begin(); it != ifaces.end(); ++it ){ 56 for( it = ifaces.begin(); it != ifaces.end(); ++it ){
57 qDebug("ifaces %s %s", it.key().latin1(), it.data().latin1() ); 57 qDebug("ifaces %s %s", it.key().latin1(), it.data().latin1() );
58 iface = new InterfacePPP( 0, it.key() ); 58 iface = new InterfacePPP( 0, it.key() );
59 iface->setHardwareName( it.data() ); 59 iface->setHardwareName( it.data() );
60 list.append( (Interface*)iface ); 60 list.append( (Interface*)iface );
61 61
62 // check if (*it) is one of the running ifaces 62 // check if (*it) is one of the running ifaces
63 if ( running.contains( it.data() ) ) { 63 if ( running.contains( it.data() ) ) {
64 qDebug("iface is running %s", it.key().latin1() ); 64 qDebug("iface is running %s", it.key().latin1() );
65 handledInterfaceNames << running[it.data()].device; 65 handledInterfaceNames << running[it.data()].device;
66 iface->setStatus( true ); 66 iface->setStatus( true );
67 iface->setPPPDpid( running[it.data()].pid ); 67 iface->setPPPDpid( running[it.data()].pid );
68 iface->modem()->setPPPDevice( running[it.data()].device ); 68 iface->modem()->setPPPDevice( running[it.data()].device );
69 iface->refresh(); 69 iface->refresh();
70 } 70 }
71 } 71 }
72 72
73 setHandledInterfaceNames( handledInterfaceNames ); 73 setHandledInterfaceNames( handledInterfaceNames );
74} 74}
75 75
76/** 76/**
77 * Delete any interfaces that we own. 77 * Delete any interfaces that we own.
78 */ 78 */
79PPPModule::~PPPModule(){ 79PPPModule::~PPPModule(){
80 qDebug("PPPModule::~PPPModule() " ); 80 qDebug("PPPModule::~PPPModule() " );
81 QMap<QString,QString> ifaces; 81 QMap<QString,QString> ifaces;
82 InterfaceKeeper keeper; 82 InterfaceKeeper keeper;
83 Interface *i; 83 Interface *i;
84 for ( i=list.first(); i != 0; i=list.next() ){ 84 for ( i=list.first(); i != 0; i=list.next() ){
85 /* if online save the state */ 85 /* if online save the state */
86 if ( i->getStatus() ) { 86 if ( i->getStatus() ) {
87 qDebug("Iface %s is still up", i->getHardwareName().latin1() ); 87 qDebug("Iface %s is still up", i->getHardwareName().latin1() );
88 InterfacePPP* ppp = static_cast<InterfacePPP*>(i); 88 InterfacePPP* ppp = static_cast<InterfacePPP*>(i);
89 keeper.addInterface( ppp->pppPID(), ppp->pppDev(), ppp->getHardwareName() ); 89 keeper.addInterface( ppp->pppPID(), ppp->pppDev(), ppp->getHardwareName() );
90 } 90 }
91 ifaces.insert( i->getInterfaceName(), i->getHardwareName() ); 91 ifaces.insert( i->getInterfaceName(), i->getHardwareName() );
92 delete i; 92 delete i;
93 } 93 }
94 PPPData::setConfiguredInterfaces( ifaces ); 94 PPPData::setConfiguredInterfaces( ifaces );
95} 95}
96 96
97/** 97/**
98 * Change the current profile 98 * Change the current profile
99 */ 99 */
100void PPPModule::setProfile(const QString &newProfile){ 100void PPPModule::setProfile(const QString &newProfile){
101 profile = newProfile; 101 profile = newProfile;
102} 102}
103 103
104/** 104/**
105 * get the icon name for this device. 105 * get the icon name for this device.
106 * @param Interface* can be used in determining the icon. 106 * @param Interface* can be used in determining the icon.
107 * @return QString the icon name (minus .png, .gif etc) 107 * @return QString the icon name (minus .png, .gif etc)
108 */ 108 */
109QString PPPModule::getPixmapName(Interface* ){ 109QString PPPModule::getPixmapName(Interface* ){
110 return "ppp"; 110 return "ppp";
111} 111}
112 112
113/** 113/**
114 * Check to see if the interface i is owned by this module. 114 * Check to see if the interface i is owned by this module.
115 * @param Interface* interface to check against 115 * @param Interface* interface to check against
116 * @return bool true if i is owned by this module, false otherwise. 116 * @return bool true if i is owned by this module, false otherwise.
117 */ 117 */
118bool PPPModule::isOwner(Interface *i){ 118bool PPPModule::isOwner(Interface *i){
119 return list.find( i ) != -1; 119 return list.find( i ) != -1;
120} 120}
121 121
122/** 122/**
123 * Create, and return the WLANConfigure Module 123 * Create, and return the WLANConfigure Module
124 * @return QWidget* pointer to this modules configure. 124 * @return QWidget* pointer to this modules configure.
125 */ 125 */
126QWidget *PPPModule::configure(Interface *i){ 126QWidget *PPPModule::configure(Interface *i){
127 qDebug("return ModemWidget"); 127 qDebug("return ModemWidget");
128 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i, 128 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i,
129 0, "PPPConfig", false, 129 0, "PPPConfig", false,
130 Qt::WDestructiveClose | Qt::WStyle_ContextHelp); 130 Qt::WDestructiveClose | Qt::WStyle_ContextHelp);
131 return pppconfig; 131 return pppconfig;
132} 132}
133 133
134/** 134/**
135 * Create, and return the Information Module 135 * Create, and return the Information Module
136 * @return QWidget* pointer to this modules info. 136 * @return QWidget* pointer to this modules info.
137 */ 137 */
138QWidget *PPPModule::information(Interface *i){ 138QWidget *PPPModule::information(Interface *i){
139 // We don't have any advanced pppd information widget yet :-D 139 // We don't have any advanced pppd information widget yet :-D
140 // TODO ^ 140 // TODO ^
141 141
142 return new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i ); 142 return new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i );
143} 143}
144 144
145/** 145/**
146 * Get all active (up or down) interfaces 146 * Get all active (up or down) interfaces
147 * @return QList<Interface> A list of interfaces that exsist that havn't 147 * @return QList<Interface> A list of interfaces that exsist that havn't
148 * been called by isOwner() 148 * been called by isOwner()
149 */ 149 */
150QList<Interface> PPPModule::getInterfaces(){ 150QList<Interface> PPPModule::getInterfaces(){
151 // List all of the files in the peer directory 151 // List all of the files in the peer directory
152 qDebug("PPPModule::getInterfaces"); 152 qDebug("PPPModule::getInterfaces");
153 return list; 153 return list;
154} 154}
155 155
156/** 156/**
157 * Attempt to add a new interface as defined by name 157 * Attempt to add a new interface as defined by name
158 * @param name the name of the type of interface that should be created given 158 * @param name the name of the type of interface that should be created given
159 * by possibleNewInterfaces(); 159 * by possibleNewInterfaces();
160 * @return Interface* NULL if it was unable to be created. 160 * @return Interface* NULL if it was unable to be created.
161 */ 161 */
162Interface *PPPModule::addNewInterface(const QString &newInterface){ 162Interface *PPPModule::addNewInterface(const QString &newInterface){
163 163
164 InterfacePPP *ifaceppp; 164 InterfacePPP *ifaceppp;
165 Interface *iface; 165 Interface *iface;
166 ifaceppp = new InterfacePPP(); 166 ifaceppp = new InterfacePPP();
167 PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true); 167 PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true);
168 imp.showMaximized(); 168 imp.showMaximized();
169 if(imp.exec() == QDialog::Accepted ){ 169 if(imp.exec() == QDialog::Accepted ){
170 iface = (InterfacePPP*) ifaceppp; 170 iface = (InterfacePPP*) ifaceppp;
171 iface->setModuleOwner( this ); 171 iface->setModuleOwner( this );
172 list.append( iface ); 172 list.append( iface );
173 return iface; 173 return iface;
174 }else { 174 }else {
175 delete ifaceppp; 175 delete ifaceppp;
176 iface = NULL; 176 iface = NULL;
177 } 177 }
178 return iface; 178 return iface;
179} 179}
180 180
181/** 181/**
182 * Attempts to remove the interface, doesn't delete i 182 * Attempts to remove the interface, doesn't delete i
183 * @return bool true if successfull, false otherwise. 183 * @return bool true if successful, false otherwise.
184 */ 184 */
185bool PPPModule::remove(Interface *i){ 185bool PPPModule::remove(Interface *i){
186 return list.remove(i); 186 return list.remove(i);
187} 187}
188 188
189void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) 189void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces)
190{ 190{
191 newIfaces.insert(QObject::tr("PPP") , 191 newIfaces.insert(QObject::tr("PPP") ,
192 QObject::tr("generic ppp device")); 192 QObject::tr("generic ppp device"));
193} 193}
194 194
195 195
196 196
197namespace { 197namespace {
198 InterfaceKeeper::InterfaceKeeper( ) { 198 InterfaceKeeper::InterfaceKeeper( ) {
199 } 199 }
200 InterfaceKeeper::~InterfaceKeeper() { 200 InterfaceKeeper::~InterfaceKeeper() {
201 Config cfg("ppp_plugin_keeper"); 201 Config cfg("ppp_plugin_keeper");
202 QStringList lst = cfg.groupList(); 202 QStringList lst = cfg.groupList();
203 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { 203 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
204 Connection con; 204 Connection con;
205 cfg.setGroup( (*it) ); 205 cfg.setGroup( (*it) );
206 cfg.clearGroup(); 206 cfg.clearGroup();
207 } 207 }
208 208
209 for (QMap<QString, Connection>::Iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it ) { 209 for (QMap<QString, Connection>::Iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it ) {
210 Connection con = it.data(); 210 Connection con = it.data();
211 cfg.setGroup( con.name ); 211 cfg.setGroup( con.name );
212 cfg.writeEntry( "pid", con.pid ); 212 cfg.writeEntry( "pid", con.pid );
213 cfg.writeEntry( "device", con.device ); 213 cfg.writeEntry( "device", con.device );
214 } 214 }
215 } 215 }
216 void InterfaceKeeper::addInterface(pid_t pid, const QString& dev, const QString& name ) { 216 void InterfaceKeeper::addInterface(pid_t pid, const QString& dev, const QString& name ) {
217 Connection con; 217 Connection con;
218 con.pid = pid; 218 con.pid = pid;
219 con.device = dev; 219 con.device = dev;
220 con.name = name; 220 con.name = name;
221 m_interfaces.insert( name, con ); 221 m_interfaces.insert( name, con );
222 } 222 }
223 QMap<QString, Connection> InterfaceKeeper::interfaces()const { 223 QMap<QString, Connection> InterfaceKeeper::interfaces()const {
224 Config cfg("ppp_plugin_keeper"); 224 Config cfg("ppp_plugin_keeper");
225 QMap<QString, Connection> ifaces; 225 QMap<QString, Connection> ifaces;
226 QStringList lst = cfg.groupList(); 226 QStringList lst = cfg.groupList();
227 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { 227 for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
228 Connection con; 228 Connection con;
229 cfg.setGroup( (*it) ); 229 cfg.setGroup( (*it) );
230 con.name = (*it); 230 con.name = (*it);
231 con.pid = cfg.readNumEntry("pid"); 231 con.pid = cfg.readNumEntry("pid");
232 con.device = cfg.readEntry("device"); 232 con.device = cfg.readEntry("device");
233 qDebug(" %s %s %d", con.name.latin1(), con.device.latin1(), con.pid ); 233 qDebug(" %s %s %d", con.name.latin1(), con.device.latin1(), con.pid );
234 234
235 if ( con.pid != -1 && isAvailable( con.pid ) ) 235 if ( con.pid != -1 && isAvailable( con.pid ) )
236 ifaces.insert( con.name, con ); 236 ifaces.insert( con.name, con );
237 } 237 }
238 return ifaces; 238 return ifaces;
239 } 239 }
240 bool InterfaceKeeper::isAvailable( pid_t p)const { 240 bool InterfaceKeeper::isAvailable( pid_t p)const {
241 if (::kill(p, 0 ) == 0 || errno != ESRCH ) { 241 if (::kill(p, 0 ) == 0 || errno != ESRCH ) {
242 qDebug("isAvailable %d", p); 242 qDebug("isAvailable %d", p);
243 return true; 243 return true;
244 } 244 }
245 245
246 qDebug("notAvailable %d", p); 246 qDebug("notAvailable %d", p);
247 return false; 247 return false;
248 } 248 }
249 249
250} 250}
diff --git a/noncore/settings/networksettings/wlan/wextensions.cpp b/noncore/settings/networksettings/wlan/wextensions.cpp
index bd7cf93..d1fff88 100644
--- a/noncore/settings/networksettings/wlan/wextensions.cpp
+++ b/noncore/settings/networksettings/wlan/wextensions.cpp
@@ -1,200 +1,200 @@
1#include "wextensions.h" 1#include "wextensions.h"
2 2
3#include <qfile.h> 3#include <qfile.h>
4#include <qtextstream.h> 4#include <qtextstream.h>
5 5
6#include <arpa/inet.h> 6#include <arpa/inet.h>
7#include <sys/socket.h> 7#include <sys/socket.h>
8#include <sys/ioctl.h> 8#include <sys/ioctl.h>
9 9
10#include <math.h> 10#include <math.h>
11 11
12#define PROCNETWIRELESS "/proc/net/wireless" 12#define PROCNETWIRELESS "/proc/net/wireless"
13#define IW_LOWER 0 13#define IW_LOWER 0
14#define IW_UPPER 256 14#define IW_UPPER 256
15 15
16/** 16/**
17 * Constructor. Sets hasWirelessExtensions 17 * Constructor. Sets hasWirelessExtensions
18 */ 18 */
19WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false), interface(interfaceName) { 19WExtensions::WExtensions(QString interfaceName): hasWirelessExtensions(false), interface(interfaceName) {
20 fd = socket( AF_INET, SOCK_DGRAM, 0 ); 20 fd = socket( AF_INET, SOCK_DGRAM, 0 );
21 if(fd == -1) 21 if(fd == -1)
22 return; 22 return;
23 23
24 const char* buffer[200]; 24 const char* buffer[200];
25 memset( &iwr, 0, sizeof( iwr ) ); 25 memset( &iwr, 0, sizeof( iwr ) );
26 iwr.u.essid.pointer = (caddr_t) buffer; 26 iwr.u.essid.pointer = (caddr_t) buffer;
27 iwr.u.essid.length = IW_ESSID_MAX_SIZE; 27 iwr.u.essid.length = IW_ESSID_MAX_SIZE;
28 iwr.u.essid.flags = 0; 28 iwr.u.essid.flags = 0;
29 29
30 // check if it is an IEEE 802.11 standard conform 30 // check if it is an IEEE 802.11 standard conform
31 // wireless device by sending SIOCGIWESSID 31 // wireless device by sending SIOCGIWESSID
32 // which also gives back the Extended Service Set ID 32 // which also gives back the Extended Service Set ID
33 // (see IEEE 802.11 for more information) 33 // (see IEEE 802.11 for more information)
34 34
35 const char* iname = interface.latin1(); 35 const char* iname = interface.latin1();
36 strcpy( iwr.ifr_ifrn.ifrn_name, (const char *)iname ); 36 strcpy( iwr.ifr_ifrn.ifrn_name, (const char *)iname );
37 if ( 0 == ioctl( fd, SIOCGIWESSID, &iwr ) ) 37 if ( 0 == ioctl( fd, SIOCGIWESSID, &iwr ) )
38 hasWirelessExtensions = true; 38 hasWirelessExtensions = true;
39} 39}
40 40
41/** 41/**
42 * @return QString the station name of the access point. 42 * @return QString the station name of the access point.
43 */ 43 */
44QString WExtensions::station(){ 44QString WExtensions::station(){
45 if(!hasWirelessExtensions) 45 if(!hasWirelessExtensions)
46 return QString(); 46 return QString();
47 const char* buffer[200]; 47 const char* buffer[200];
48 iwr.u.data.pointer = (caddr_t) buffer; 48 iwr.u.data.pointer = (caddr_t) buffer;
49 iwr.u.data.length = IW_ESSID_MAX_SIZE; 49 iwr.u.data.length = IW_ESSID_MAX_SIZE;
50 iwr.u.data.flags = 0; 50 iwr.u.data.flags = 0;
51 if ( 0 == ioctl( fd, SIOCGIWNICKN, &iwr )){ 51 if ( 0 == ioctl( fd, SIOCGIWNICKN, &iwr )){
52 iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0'; 52 iwr.u.data.pointer[(unsigned int) iwr.u.data.length-1] = '\0';
53 return QString(iwr.u.data.pointer); 53 return QString(iwr.u.data.pointer);
54 } 54 }
55 return QString(); 55 return QString();
56} 56}
57 57
58/** 58/**
59 * @return QString the essid of the host 802.11 access point. 59 * @return QString the essid of the host 802.11 access point.
60 */ 60 */
61QString WExtensions::essid(){ 61QString WExtensions::essid(){
62 if(!hasWirelessExtensions) 62 if(!hasWirelessExtensions)
63 return QString(); 63 return QString();
64 if ( 0 == ioctl( fd, SIOCGIWESSID, &iwr )){ 64 if ( 0 == ioctl( fd, SIOCGIWESSID, &iwr )){
65 iwr.u.essid.pointer[(unsigned int) iwr.u.essid.length] = '\0'; 65 iwr.u.essid.pointer[(unsigned int) iwr.u.essid.length] = '\0';
66 return QString(iwr.u.essid.pointer); 66 return QString(iwr.u.essid.pointer);
67 } 67 }
68 return QString(); 68 return QString();
69} 69}
70 70
71/** 71/**
72 * @return QString the mode of interface 72 * @return QString the mode of interface
73 */ 73 */
74QString WExtensions::mode(){ 74QString WExtensions::mode(){
75 if(!hasWirelessExtensions) 75 if(!hasWirelessExtensions)
76 return QString(); 76 return QString();
77 if ( 0 == ioctl( fd, SIOCGIWMODE, &iwr ) ) 77 if ( 0 == ioctl( fd, SIOCGIWMODE, &iwr ) )
78 return QString("%1").arg(iwr.u.mode == IW_MODE_ADHOC ? "Ad-Hoc" : "Managed"); 78 return QString("%1").arg(iwr.u.mode == IW_MODE_ADHOC ? "Ad-Hoc" : "Managed");
79 return QString(); 79 return QString();
80} 80}
81 81
82/** 82/**
83 * Get the frequency that the interface is running at. 83 * Get the frequency that the interface is running at.
84 * @return int the frequency that the interfacae is running at. 84 * @return int the frequency that the interfacae is running at.
85 */ 85 */
86double WExtensions::frequency(){ 86double WExtensions::frequency(){
87 if(!hasWirelessExtensions) 87 if(!hasWirelessExtensions)
88 return 0; 88 return 0;
89 if ( 0 == ioctl( fd, SIOCGIWFREQ, &iwr )) 89 if ( 0 == ioctl( fd, SIOCGIWFREQ, &iwr ))
90 return (double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000); 90 return (double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000);
91 return 0; 91 return 0;
92} 92}
93 93
94/** 94/**
95 * Get the channel that the interface is running at. 95 * Get the channel that the interface is running at.
96 * @return int the channel that the interfacae is running at. 96 * @return int the channel that the interfacae is running at.
97 */ 97 */
98int WExtensions::channel(){ 98int WExtensions::channel(){
99 if(!hasWirelessExtensions) 99 if(!hasWirelessExtensions)
100 return 0; 100 return 0;
101 if ( 0 != ioctl( fd, SIOCGIWFREQ, &iwr )) 101 if ( 0 != ioctl( fd, SIOCGIWFREQ, &iwr ))
102 return 0; 102 return 0;
103 103
104 // http://www.elanix.com/pdf/an137e.pdf 104 // http://www.elanix.com/pdf/an137e.pdf
105 105
106 double num = (double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000); 106 double num = (double( iwr.u.freq.m ) * pow( 10, iwr.u.freq.e ) / 1000000000);
107 double left = 2.401; 107 double left = 2.401;
108 double right = 2.416; 108 double right = 2.416;
109 for(int channel = 1; channel<= 15; channel++){ 109 for(int channel = 1; channel<= 15; channel++){
110 if( num >= left && num <= right ) 110 if( num >= left && num <= right )
111 return channel; 111 return channel;
112 left += 0.005; 112 left += 0.005;
113 right += 0.005; 113 right += 0.005;
114 } 114 }
115 qDebug(QString("Unknown frequency: %1, returning -1 for the channel.").arg(num).latin1()); 115 qDebug(QString("Unknown frequency: %1, returning -1 for the channel.").arg(num).latin1());
116 return -1; 116 return -1;
117} 117}
118 118
119/*** 119/***
120 * Get the current rate that the card is transmiting at. 120 * Get the current rate that the card is transmiting at.
121 * @return double the rate, 0 if error. 121 * @return double the rate, 0 if error.
122 */ 122 */
123double WExtensions::rate(){ 123double WExtensions::rate(){
124 if(!hasWirelessExtensions) 124 if(!hasWirelessExtensions)
125 return 0; 125 return 0;
126 if(0 == ioctl(fd, SIOCGIWRATE, &iwr)){ 126 if(0 == ioctl(fd, SIOCGIWRATE, &iwr)){
127 return ((double)iwr.u.bitrate.value)/1000000; 127 return ((double)iwr.u.bitrate.value)/1000000;
128 } 128 }
129 return 0; 129 return 0;
130} 130}
131 131
132 132
133/** 133/**
134 * @return QString the AccessPoint that the interface is connected to. 134 * @return QString the AccessPoint that the interface is connected to.
135 */ 135 */
136QString WExtensions::ap(){ 136QString WExtensions::ap(){
137 if(!hasWirelessExtensions) 137 if(!hasWirelessExtensions)
138 return QString(); 138 return QString();
139 if ( 0 == ioctl( fd, SIOCGIWAP, &iwr )){ 139 if ( 0 == ioctl( fd, SIOCGIWAP, &iwr )){
140 QString ap; 140 QString ap;
141 ap = ap.sprintf( "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X", 141 ap = ap.sprintf( "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",
142 iwr.u.ap_addr.sa_data[0]&0xff, 142 iwr.u.ap_addr.sa_data[0]&0xff,
143 iwr.u.ap_addr.sa_data[1]&0xff, 143 iwr.u.ap_addr.sa_data[1]&0xff,
144 iwr.u.ap_addr.sa_data[2]&0xff, 144 iwr.u.ap_addr.sa_data[2]&0xff,
145 iwr.u.ap_addr.sa_data[3]&0xff, 145 iwr.u.ap_addr.sa_data[3]&0xff,
146 iwr.u.ap_addr.sa_data[4]&0xff, 146 iwr.u.ap_addr.sa_data[4]&0xff,
147 iwr.u.ap_addr.sa_data[5]&0xff ); 147 iwr.u.ap_addr.sa_data[5]&0xff );
148 return ap; 148 return ap;
149 } 149 }
150 else return QString(); 150 else return QString();
151} 151}
152 152
153/** 153/**
154 * Get the stats for interfaces 154 * Get the stats for interfaces
155 * @param signal the signal strength of interface 155 * @param signal the signal strength of interface
156 * @param noise the noise level of the interface 156 * @param noise the noise level of the interface
157 * @param quality the quality level of the interface 157 * @param quality the quality level of the interface
158 * @return bool true if successfull 158 * @return bool true if successful
159 */ 159 */
160bool WExtensions::stats(int &signal, int &noise, int &quality){ 160bool WExtensions::stats(int &signal, int &noise, int &quality){
161 // gather link quality from /proc/net/wireless 161 // gather link quality from /proc/net/wireless
162 if(!QFile::exists(PROCNETWIRELESS)) 162 if(!QFile::exists(PROCNETWIRELESS))
163 return false; 163 return false;
164 164
165 char c; 165 char c;
166 QString status; 166 QString status;
167 QString name; 167 QString name;
168 168
169 QFile wfile( PROCNETWIRELESS ); 169 QFile wfile( PROCNETWIRELESS );
170 if(!wfile.open( IO_ReadOnly )) 170 if(!wfile.open( IO_ReadOnly ))
171 return false; 171 return false;
172 172
173 QTextStream wstream( &wfile ); 173 QTextStream wstream( &wfile );
174 wstream.readLine(); // skip the first two lines 174 wstream.readLine(); // skip the first two lines
175 wstream.readLine(); // because they only contain headers 175 wstream.readLine(); // because they only contain headers
176 while(!wstream.atEnd()){ 176 while(!wstream.atEnd()){
177 wstream >> name >> status >> quality >> c >> signal >> c >> noise; 177 wstream >> name >> status >> quality >> c >> signal >> c >> noise;
178 if(name == QString("%1:").arg(interface)){ 178 if(name == QString("%1:").arg(interface)){
179 if ( quality > 92 ) 179 if ( quality > 92 )
180 qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality ); 180 qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality );
181 if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) ) 181 if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) )
182 qDebug( "WIFIAPPLET: Doh! Strength %d > estimated max!\n", signal ); 182 qDebug( "WIFIAPPLET: Doh! Strength %d > estimated max!\n", signal );
183 if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) ) 183 if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) )
184 qDebug( "WIFIAPPLET: Doh! Noise %d > estimated max!\n", noise ); 184 qDebug( "WIFIAPPLET: Doh! Noise %d > estimated max!\n", noise );
185 //qDebug(QString("q:%1, s:%2, n:%3").arg(quality).arg(signal).arg(noise).latin1()); 185 //qDebug(QString("q:%1, s:%2, n:%3").arg(quality).arg(signal).arg(noise).latin1());
186 signal = ( ( signal-IW_LOWER ) * 100 ) / IW_UPPER; 186 signal = ( ( signal-IW_LOWER ) * 100 ) / IW_UPPER;
187 noise = ( ( noise-IW_LOWER ) * 100 ) / IW_UPPER; 187 noise = ( ( noise-IW_LOWER ) * 100 ) / IW_UPPER;
188 quality = ( quality*100 ) / 92; 188 quality = ( quality*100 ) / 92;
189 return true; 189 return true;
190 } 190 }
191 } 191 }
192 192
193 qDebug("WExtensions::statsCard no longer present."); 193 qDebug("WExtensions::statsCard no longer present.");
194 quality = -1; 194 quality = -1;
195 signal = IW_LOWER; 195 signal = IW_LOWER;
196 noise = IW_LOWER; 196 noise = IW_LOWER;
197 return false; 197 return false;
198} 198}
199 199
200// wextensions.cpp 200// wextensions.cpp
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index b4c3509..07bf73f 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -1,252 +1,252 @@
1#include "wlanmodule.h" 1#include "wlanmodule.h"
2#include "wlanimp2.h" 2#include "wlanimp2.h"
3#include "infoimp.h" 3#include "infoimp.h"
4#include "wextensions.h" 4#include "wextensions.h"
5#include "interfaceinformationimp.h" 5#include "interfaceinformationimp.h"
6 6
7#include <qcheckbox.h> 7#include <qcheckbox.h>
8#include <qcombobox.h> 8#include <qcombobox.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qlineedit.h> 10#include <qlineedit.h>
11#include <qprogressbar.h> 11#include <qprogressbar.h>
12#include <qspinbox.h> 12#include <qspinbox.h>
13#include <qtabwidget.h> 13#include <qtabwidget.h>
14 14
15 15
16 16
17 17
18/** 18/**
19 * Constructor, find all of the possible interfaces 19 * Constructor, find all of the possible interfaces
20 */ 20 */
21WLANModule::WLANModule() 21WLANModule::WLANModule()
22 : Module(), 22 : Module(),
23 wlanconfigWiget(0) 23 wlanconfigWiget(0)
24{ 24{
25} 25}
26 26
27/** 27/**
28 * Delete any interfaces that we own. 28 * Delete any interfaces that we own.
29 */ 29 */
30WLANModule::~WLANModule(){ 30WLANModule::~WLANModule(){
31 Interface *i; 31 Interface *i;
32 for ( i=list.first(); i != 0; i=list.next() ) 32 for ( i=list.first(); i != 0; i=list.next() )
33 delete i; 33 delete i;
34 34
35} 35}
36 36
37/** 37/**
38 * Change the current profile 38 * Change the current profile
39 */ 39 */
40void WLANModule::setProfile(const QString &newProfile){ 40void WLANModule::setProfile(const QString &newProfile){
41 profile = newProfile; 41 profile = newProfile;
42} 42}
43 43
44/** 44/**
45 * get the icon name for this device. 45 * get the icon name for this device.
46 * @param Interface* can be used in determining the icon. 46 * @param Interface* can be used in determining the icon.
47 * @return QString the icon name (minus .png, .gif etc) 47 * @return QString the icon name (minus .png, .gif etc)
48 */ 48 */
49QString WLANModule::getPixmapName(Interface* ){ 49QString WLANModule::getPixmapName(Interface* ){
50 return "wlan"; 50 return "wlan";
51} 51}
52 52
53/** 53/**
54 * Check to see if the interface i is owned by this module. 54 * Check to see if the interface i is owned by this module.
55 * @param Interface* interface to check against 55 * @param Interface* interface to check against
56 * @return bool true if i is owned by this module, false otherwise. 56 * @return bool true if i is owned by this module, false otherwise.
57 */ 57 */
58bool WLANModule::isOwner(Interface *i){ 58bool WLANModule::isOwner(Interface *i){
59 WExtensions we(i->getInterfaceName()); 59 WExtensions we(i->getInterfaceName());
60 if(!we.doesHaveWirelessExtensions()) 60 if(!we.doesHaveWirelessExtensions())
61 return false; 61 return false;
62 62
63 i->setHardwareName("802.11b"); 63 i->setHardwareName("802.11b");
64 list.append(i); 64 list.append(i);
65 return true; 65 return true;
66} 66}
67 67
68/** 68/**
69 * Create, and return the WLANConfigure Module 69 * Create, and return the WLANConfigure Module
70 * @return QWidget* pointer to this modules configure. 70 * @return QWidget* pointer to this modules configure.
71 */ 71 */
72QWidget *WLANModule::configure(Interface *i){ 72QWidget *WLANModule::configure(Interface *i){
73 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, Qt::WDestructiveClose); 73 WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, Qt::WDestructiveClose);
74 wlanconfig->setProfile(profile); 74 wlanconfig->setProfile(profile);
75 return wlanconfig; 75 return wlanconfig;
76} 76}
77 77
78/** 78/**
79 * Create, and return the Information Module 79 * Create, and return the Information Module
80 * @return QWidget* pointer to this modules info. 80 * @return QWidget* pointer to this modules info.
81 */ 81 */
82QWidget *WLANModule::information(Interface *i){ 82QWidget *WLANModule::information(Interface *i){
83 WExtensions we(i->getInterfaceName()); 83 WExtensions we(i->getInterfaceName());
84 if(!we.doesHaveWirelessExtensions()) 84 if(!we.doesHaveWirelessExtensions())
85 return NULL; 85 return NULL;
86 86
87 return getInfo( i ); 87 return getInfo( i );
88} 88}
89 89
90/** 90/**
91 * Get all active (up or down) interfaces 91 * Get all active (up or down) interfaces
92 * @return QList<Interface> A list of interfaces that exsist that havn't 92 * @return QList<Interface> A list of interfaces that exsist that havn't
93 * been called by isOwner() 93 * been called by isOwner()
94 */ 94 */
95QList<Interface> WLANModule::getInterfaces(){ 95QList<Interface> WLANModule::getInterfaces(){
96 return list; 96 return list;
97} 97}
98 98
99/** 99/**
100 * Attempt to add a new interface as defined by name 100 * Attempt to add a new interface as defined by name
101 * @param name the name of the type of interface that should be created given 101 * @param name the name of the type of interface that should be created given
102 * by possibleNewInterfaces(); 102 * by possibleNewInterfaces();
103 * @return Interface* NULL if it was unable to be created. 103 * @return Interface* NULL if it was unable to be created.
104 */ 104 */
105Interface *WLANModule::addNewInterface(const QString &){ 105Interface *WLANModule::addNewInterface(const QString &){
106 // We can't add a 802.11 interface, either the hardware will be there 106 // We can't add a 802.11 interface, either the hardware will be there
107 // or it wont. 107 // or it wont.
108 return NULL; 108 return NULL;
109} 109}
110 110
111/** 111/**
112 * Attempts to remove the interface, doesn't delete i 112 * Attempts to remove the interface, doesn't delete i
113 * @return bool true if successfull, false otherwise. 113 * @return bool true if successful, false otherwise.
114 */ 114 */
115bool WLANModule::remove(Interface*){ 115bool WLANModule::remove(Interface*){
116 // Can't remove a hardware device, you can stop it though. 116 // Can't remove a hardware device, you can stop it though.
117 return false; 117 return false;
118} 118}
119 119
120void WLANModule::receive(const QCString &param, const QByteArray &arg) 120void WLANModule::receive(const QCString &param, const QByteArray &arg)
121{ 121{
122 qDebug("WLANModule::receive "+param); 122 qDebug("WLANModule::receive "+param);
123 QStringList params = QStringList::split(",",param); 123 QStringList params = QStringList::split(",",param);
124 int count = params.count(); 124 int count = params.count();
125 qDebug("WLANModule got %i params", count ); 125 qDebug("WLANModule got %i params", count );
126 if (count < 2){ 126 if (count < 2){
127 qDebug("Erorr less than 2 parameter"); 127 qDebug("Erorr less than 2 parameter");
128 qDebug("RETURNING"); 128 qDebug("RETURNING");
129 return; 129 return;
130 } 130 }
131 131
132 QDataStream stream(arg,IO_ReadOnly); 132 QDataStream stream(arg,IO_ReadOnly);
133 QString interface; 133 QString interface;
134 QString action; 134 QString action;
135 int countMsgs = 0; 135 int countMsgs = 0;
136 stream >> interface; 136 stream >> interface;
137 qDebug("got count? >%s<",interface.latin1()); 137 qDebug("got count? >%s<",interface.latin1());
138 if (interface == "count"){ 138 if (interface == "count"){
139 qDebug("got count"); 139 qDebug("got count");
140 stream >> action; 140 stream >> action;
141 qDebug("Got count num >%s<", action.latin1()); 141 qDebug("Got count num >%s<", action.latin1());
142 countMsgs = action.toInt(); 142 countMsgs = action.toInt();
143 } 143 }
144 144
145 QDialog *toShow; 145 QDialog *toShow;
146 //while (! stream.atEnd() ){ 146 //while (! stream.atEnd() ){
147 for (int i = 0; i < countMsgs; i++){ 147 for (int i = 0; i < countMsgs; i++){
148 qDebug("start stream %d/%d",i,countMsgs); 148 qDebug("start stream %d/%d",i,countMsgs);
149 if (stream.atEnd()){ 149 if (stream.atEnd()){
150 qDebug("end of stream"); 150 qDebug("end of stream");
151 return; 151 return;
152 } 152 }
153 stream >> interface; 153 stream >> interface;
154 qDebug("got iface"); 154 qDebug("got iface");
155 stream >> action; 155 stream >> action;
156 qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); 156 qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1());
157 // find interfaces 157 // find interfaces
158 Interface *ifa=0; 158 Interface *ifa=0;
159 for ( Interface *i=list.first(); i != 0; i=list.next() ){ 159 for ( Interface *i=list.first(); i != 0; i=list.next() ){
160 if (i->getInterfaceName() == interface){ 160 if (i->getInterfaceName() == interface){
161 qDebug("WLANModule found interface %s",interface.latin1()); 161 qDebug("WLANModule found interface %s",interface.latin1());
162 ifa = i; 162 ifa = i;
163 } 163 }
164 } 164 }
165 165
166 if (ifa == 0){ 166 if (ifa == 0){
167 qDebug("WLANModule Did not find %s",interface.latin1()); 167 qDebug("WLANModule Did not find %s",interface.latin1());
168 qDebug("skipping"); 168 qDebug("skipping");
169 count = 0; 169 count = 0;
170 } 170 }
171 171
172 if (count == 2){ 172 if (count == 2){
173 // those should call the interface directly 173 // those should call the interface directly
174 QWidget *info = getInfo( ifa ); 174 QWidget *info = getInfo( ifa );
175 info->showMaximized(); 175 info->showMaximized();
176 176
177 if ( action.contains("start" ) ){ 177 if ( action.contains("start" ) ){
178 ifa->start(); 178 ifa->start();
179 } else if ( action.contains("restart" ) ){ 179 } else if ( action.contains("restart" ) ){
180 ifa->restart(); 180 ifa->restart();
181 } else if ( action.contains("stop" ) ){ 181 } else if ( action.contains("stop" ) ){
182 ifa->stop(); 182 ifa->stop();
183 }else if ( action.contains("refresh" ) ){ 183 }else if ( action.contains("refresh" ) ){
184 ifa->refresh(); 184 ifa->refresh();
185 } 185 }
186 }else if (count == 3){ 186 }else if (count == 3){
187 QString value; 187 QString value;
188 if (!wlanconfigWiget){ 188 if (!wlanconfigWiget){
189 //FIXME: what if it got closed meanwhile? 189 //FIXME: what if it got closed meanwhile?
190 wlanconfigWiget = (WLANImp*) configure(ifa); 190 wlanconfigWiget = (WLANImp*) configure(ifa);
191 toShow = (QDialog*) wlanconfigWiget; 191 toShow = (QDialog*) wlanconfigWiget;
192 } 192 }
193 wlanconfigWiget->showMaximized(); 193 wlanconfigWiget->showMaximized();
194 stream >> value; 194 stream >> value;
195 qDebug("WLANModule (build 4) is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); 195 qDebug("WLANModule (build 4) is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() );
196 if (value.isEmpty()){ 196 if (value.isEmpty()){
197 qDebug("value is empty!!!\nreturning"); 197 qDebug("value is empty!!!\nreturning");
198 return; 198 return;
199 } 199 }
200 if ( action.contains("ESSID") ){ 200 if ( action.contains("ESSID") ){
201 QComboBox *combo = wlanconfigWiget->essid; 201 QComboBox *combo = wlanconfigWiget->essid;
202 bool found = false; 202 bool found = false;
203 for ( int i = 0; i < combo->count(); i++) 203 for ( int i = 0; i < combo->count(); i++)
204 if ( combo->text( i ) == value ){ 204 if ( combo->text( i ) == value ){
205 combo->setCurrentItem( i ); 205 combo->setCurrentItem( i );
206 found = true; 206 found = true;
207 } 207 }
208 if (!found) combo->insertItem( value, 0 ); 208 if (!found) combo->insertItem( value, 0 );
209 }else if ( action.contains("Mode") ){ 209 }else if ( action.contains("Mode") ){
210 QComboBox *combo = wlanconfigWiget->mode; 210 QComboBox *combo = wlanconfigWiget->mode;
211 for ( int i = 0; i < combo->count(); i++) 211 for ( int i = 0; i < combo->count(); i++)
212 if ( combo->text( i ) == value ){ 212 if ( combo->text( i ) == value ){
213 combo->setCurrentItem( i ); 213 combo->setCurrentItem( i );
214 } 214 }
215 215
216 }else if (action.contains("Channel")){ 216 }else if (action.contains("Channel")){
217 bool ok; 217 bool ok;
218 qDebug("converting channel"); 218 qDebug("converting channel");
219 int chan = value.toInt( &ok ); 219 int chan = value.toInt( &ok );
220 if (ok){ 220 if (ok){
221 qDebug("ok setting channel"); 221 qDebug("ok setting channel");
222 wlanconfigWiget->specifyChan->setChecked( true ); 222 wlanconfigWiget->specifyChan->setChecked( true );
223 wlanconfigWiget->networkChannel->setValue( chan ); 223 wlanconfigWiget->networkChannel->setValue( chan );
224 } 224 }
225 }else if (action.contains("MacAddr")){ 225 }else if (action.contains("MacAddr")){
226 wlanconfigWiget->specifyAp->setChecked( true ); 226 wlanconfigWiget->specifyAp->setChecked( true );
227 wlanconfigWiget->macEdit->setText( value ); 227 wlanconfigWiget->macEdit->setText( value );
228 }else 228 }else
229 qDebug("wlan plugin has no clue"); 229 qDebug("wlan plugin has no clue");
230 } 230 }
231 qDebug("next stream"); 231 qDebug("next stream");
232 }// while stream 232 }// while stream
233 qDebug("end of stream"); 233 qDebug("end of stream");
234 if (toShow) toShow->exec(); 234 if (toShow) toShow->exec();
235 qDebug("returning"); 235 qDebug("returning");
236} 236}
237 237
238QWidget *WLANModule::getInfo( Interface *i) 238QWidget *WLANModule::getInfo( Interface *i)
239{ 239{
240 qDebug("WLANModule::getInfo start"); 240 qDebug("WLANModule::getInfo start");
241 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); 241 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose);
242 InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); 242 InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i);
243 info->tabWidget->insertTab(information, "TCP/IP", 0); 243 info->tabWidget->insertTab(information, "TCP/IP", 0);
244 info->tabWidget->setCurrentPage( 0 ); 244 info->tabWidget->setCurrentPage( 0 );
245 info->tabWidget->showPage( information ); 245 info->tabWidget->showPage( information );
246 if (info->tabWidget->currentPage() == information ) qDebug("infotab OK"); 246 if (info->tabWidget->currentPage() == information ) qDebug("infotab OK");
247 else qDebug("infotab NOT OK"); 247 else qDebug("infotab NOT OK");
248 qDebug("current idx %d", info->tabWidget->currentPageIndex()); 248 qDebug("current idx %d", info->tabWidget->currentPageIndex());
249 qDebug("WLANModule::getInfo return"); 249 qDebug("WLANModule::getInfo return");
250 return info; 250 return info;
251} 251}
252 252
diff --git a/noncore/settings/tabmanager/tabmanager.cpp b/noncore/settings/tabmanager/tabmanager.cpp
index c9d7aed..ff5957c 100644
--- a/noncore/settings/tabmanager/tabmanager.cpp
+++ b/noncore/settings/tabmanager/tabmanager.cpp
@@ -1,508 +1,508 @@
1#include "tabmanager.h" 1#include "tabmanager.h"
2#include "app.h" 2#include "app.h"
3#include "wait.h" 3#include "wait.h"
4#include "tabapplnk.h" 4#include "tabapplnk.h"
5 5
6#include <qpe/applnk.h> 6#include <qpe/applnk.h>
7#include <qdir.h> 7#include <qdir.h>
8#include <qfile.h> 8#include <qfile.h>
9#include <qtextstream.h> 9#include <qtextstream.h>
10#include <qlistview.h> 10#include <qlistview.h>
11#include <qheader.h> 11#include <qheader.h>
12#include <qcombobox.h> 12#include <qcombobox.h>
13#include <qlineedit.h> 13#include <qlineedit.h>
14#include <qlabel.h> 14#include <qlabel.h>
15#include <qmessagebox.h> 15#include <qmessagebox.h>
16#include <stdlib.h> 16#include <stdlib.h>
17#include <qpe/qcopenvelope_qws.h> 17#include <qpe/qcopenvelope_qws.h>
18#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
19#include <qpe/resource.h> 19#include <qpe/resource.h>
20 20
21 21
22#define HOME_APP_DIR QPEApplication::qpeDir()+"/apps" 22#define HOME_APP_DIR QPEApplication::qpeDir()+"/apps"
23#define HOME_APP_INSTALL_DIR "/usr/lib/ipkg/info" 23#define HOME_APP_INSTALL_DIR "/usr/lib/ipkg/info"
24#define NEW_FOLDER "EmptyTab" 24#define NEW_FOLDER "EmptyTab"
25#define NEW_APPLICATION "NewApp" 25#define NEW_APPLICATION "NewApp"
26#define APPLICATION_EXTENSION ".desktop" 26#define APPLICATION_EXTENSION ".desktop"
27#define APPLICATION_EXTENSION_LENGTH 8 27#define APPLICATION_EXTENSION_LENGTH 8
28 28
29/** 29/**
30 * Constructor. Sets up signals. Performs initial scan of applications 30 * Constructor. Sets up signals. Performs initial scan of applications
31 * and tabs 31 * and tabs
32 */ 32 */
33TabManager::TabManager( QWidget* parent, const char* name):TabManagerBase(parent, name), changed(false), application(NULL){ 33TabManager::TabManager( QWidget* parent, const char* name):TabManagerBase(parent, name), changed(false), application(NULL){
34 rescanFolder(HOME_APP_DIR); 34 rescanFolder(HOME_APP_DIR);
35 35
36 // Connect the signals and slots 36 // Connect the signals and slots
37 connect(tabList, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(editItem(QListViewItem*))); 37 connect(tabList, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(editItem(QListViewItem*)));
38 (tabList->header())->hide(); 38 (tabList->header())->hide();
39 connect(tabList, SIGNAL(moveItem(QListViewItem *, QListViewItem *)), this, SLOT(moveApplication(QListViewItem *, QListViewItem *))); 39 connect(tabList, SIGNAL(moveItem(QListViewItem *, QListViewItem *)), this, SLOT(moveApplication(QListViewItem *, QListViewItem *)));
40} 40}
41 41
42/** 42/**
43 * If anything in the tab's have been changed then update the system or alert 43 * If anything in the tab's have been changed then update the system or alert
44 * the user. 44 * the user.
45 */ 45 */
46TabManager::~TabManager(){ 46TabManager::~TabManager(){
47 if(changed){ 47 if(changed){
48 // Prompt. 48 // Prompt.
49 //int answer = QMessageBox::warning(this, "Message", "Should your desktop be","Yes", "Cancel", 0, 1 ); 49 //int answer = QMessageBox::warning(this, "Message", "Should your desktop be","Yes", "Cancel", 0, 1 );
50 //if (answer) 50 //if (answer)
51 // return; 51 // return;
52 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 52 QCopEnvelope e("QPE/System", "linkChanged(QString)");
53 QString link; //we'll just send an empty string 53 QString link; //we'll just send an empty string
54 e << link; 54 e << link;
55 } 55 }
56} 56}
57 57
58/** 58/**
59 * Scans root directory for any tabs or applications. Will recursivly go down, 59 * Scans root directory for any tabs or applications. Will recursivly go down,
60 * but will not follow symlinks. 60 * but will not follow symlinks.
61 * @param directory - the directory to look in. 61 * @param directory - the directory to look in.
62 * @param parent - the parent to place any new tabs or apps into. If parent is 62 * @param parent - the parent to place any new tabs or apps into. If parent is
63 * NULL then the item is a tab and should be placed as a child of the window. 63 * NULL then the item is a tab and should be placed as a child of the window.
64 */ 64 */
65void TabManager::rescanFolder(QString directory, QListViewItem* parent){ 65void TabManager::rescanFolder(QString directory, QListViewItem* parent){
66 //qDebug(QString("rescanFolder: ") + directory.latin1()); 66 //qDebug(QString("rescanFolder: ") + directory.latin1());
67 67
68 QDir d; 68 QDir d;
69 d.setPath(directory); 69 d.setPath(directory);
70 // Show hidden files for .directories 70 // Show hidden files for .directories
71 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs); 71 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs);
72 72
73 const QFileInfoList *list = d.entryInfoList(); 73 const QFileInfoList *list = d.entryInfoList();
74 QFileInfoListIterator it( *list ); // create list iterator 74 QFileInfoListIterator it( *list ); // create list iterator
75 QFileInfo *fi; // pointer for traversing 75 QFileInfo *fi; // pointer for traversing
76 76
77 while ( (fi=it.current()) ) { // for each file... 77 while ( (fi=it.current()) ) { // for each file...
78 // If it is a dir and not .. or . then add it as a tab and go down. 78 // If it is a dir and not .. or . then add it as a tab and go down.
79 if(fi->isDir()){ 79 if(fi->isDir()){
80 if(fi->fileName() != ".." && fi->fileName() != ".") { 80 if(fi->fileName() != ".." && fi->fileName() != ".") {
81 QListViewItem* newItem; 81 QListViewItem* newItem;
82 if(!parent) 82 if(!parent)
83 newItem = new QListViewItem(tabList, fi->fileName()); 83 newItem = new QListViewItem(tabList, fi->fileName());
84 else 84 else
85 newItem = new QListViewItem(parent, fi->fileName()); 85 newItem = new QListViewItem(parent, fi->fileName());
86 itemList.insert(newItem, directory + "/" + fi->fileName() + "/.directory" ); 86 itemList.insert(newItem, directory + "/" + fi->fileName() + "/.directory" );
87 rescanFolder(directory + "/" + fi->fileName(), newItem); 87 rescanFolder(directory + "/" + fi->fileName(), newItem);
88 } 88 }
89 } 89 }
90 else{ 90 else{
91 // it is a file, if not a .directory add to parent. 91 // it is a file, if not a .directory add to parent.
92 92
93 // Change parents name and icon to reflect icon. 93 // Change parents name and icon to reflect icon.
94 if(fi->fileName() == ".directory"){ 94 if(fi->fileName() == ".directory"){
95 AppLnk app(directory + "/" + fi->fileName()); 95 AppLnk app(directory + "/" + fi->fileName());
96 if(parent){ 96 if(parent){
97 parent->setPixmap(0,app.pixmap()); 97 parent->setPixmap(0,app.pixmap());
98 parent->setText(0, app.name()); 98 parent->setText(0, app.name());
99 } 99 }
100 } 100 }
101 else{ 101 else{
102 // Add any desktop files found. 102 // Add any desktop files found.
103 QListViewItem* newItem; 103 QListViewItem* newItem;
104 if(directory != HOME_APP_DIR){ 104 if(directory != HOME_APP_DIR){
105 if(!parent) 105 if(!parent)
106 newItem = new QListViewItem(tabList, fi->fileName()); 106 newItem = new QListViewItem(tabList, fi->fileName());
107 else 107 else
108 newItem = new QListViewItem(parent, fi->fileName()); 108 newItem = new QListViewItem(parent, fi->fileName());
109 if(fi->fileName().right(APPLICATION_EXTENSION_LENGTH) == APPLICATION_EXTENSION){ 109 if(fi->fileName().right(APPLICATION_EXTENSION_LENGTH) == APPLICATION_EXTENSION){
110 AppLnk app(directory + "/" + fi->fileName()); 110 AppLnk app(directory + "/" + fi->fileName());
111 newItem->setPixmap(0,app.pixmap()); 111 newItem->setPixmap(0,app.pixmap());
112 newItem->setText(0, app.name()); 112 newItem->setText(0, app.name());
113 itemList.insert(newItem, directory + "/" + fi->fileName()); 113 itemList.insert(newItem, directory + "/" + fi->fileName());
114 } 114 }
115 } 115 }
116 } 116 }
117 } 117 }
118 ++it; // goto next list element 118 ++it; // goto next list element
119 } 119 }
120} 120}
121 121
122/** 122/**
123 * Create a new blank Tab. 123 * Create a new blank Tab.
124 * Create a physical folder with .directory file 124 * Create a physical folder with .directory file
125 * Create a item on the list 125 * Create a item on the list
126 */ 126 */
127void TabManager::newFolder(){ 127void TabManager::newFolder(){
128 QDir r; 128 QDir r;
129 r.mkdir(QString(HOME_APP_DIR) + "/" + NEW_FOLDER); 129 r.mkdir(QString(HOME_APP_DIR) + "/" + NEW_FOLDER);
130 system((QString("echo [Desktop Entry] | cat >> ") + HOME_APP_DIR + "/" + NEW_FOLDER "/.directory").latin1()); 130 system((QString("echo [Desktop Entry] | cat >> ") + HOME_APP_DIR + "/" + NEW_FOLDER "/.directory").latin1());
131 system((QString("echo Name=" NEW_FOLDER " | cat >> ") + HOME_APP_DIR + "/" + NEW_FOLDER "/.directory").latin1()); 131 system((QString("echo Name=" NEW_FOLDER " | cat >> ") + HOME_APP_DIR + "/" + NEW_FOLDER "/.directory").latin1());
132 132
133 QString homeLocation = QString(HOME_APP_DIR) + "/" + NEW_FOLDER + "/.directory"; 133 QString homeLocation = QString(HOME_APP_DIR) + "/" + NEW_FOLDER + "/.directory";
134 QListViewItem *newItem = new QListViewItem(tabList, NEW_FOLDER); 134 QListViewItem *newItem = new QListViewItem(tabList, NEW_FOLDER);
135 itemList.insert(newItem, homeLocation ); 135 itemList.insert(newItem, homeLocation );
136 136
137 // We have changed something. 137 // We have changed something.
138 changed = true; 138 changed = true;
139} 139}
140 140
141/** 141/**
142 * Create a new blank application 142 * Create a new blank application
143 * Make sure a tab is selected 143 * Make sure a tab is selected
144 * create physical file 144 * create physical file
145 * fill file with default information (entry, name, type). 145 * fill file with default information (entry, name, type).
146 */ 146 */
147void TabManager::newApplication(){ 147void TabManager::newApplication(){
148 QListViewItem *item = tabList->currentItem(); 148 QListViewItem *item = tabList->currentItem();
149 if(!item || item->parent()) 149 if(!item || item->parent())
150 return; 150 return;
151 151
152 QString parentDir = itemList[item].mid(0,itemList[item].length()-11); 152 QString parentDir = itemList[item].mid(0,itemList[item].length()-11);
153 QString homeLocation = parentDir + "/" NEW_APPLICATION APPLICATION_EXTENSION; 153 QString homeLocation = parentDir + "/" NEW_APPLICATION APPLICATION_EXTENSION;
154 system((QString("echo [Desktop Entry] | cat >> ") + homeLocation).latin1()); 154 system((QString("echo [Desktop Entry] | cat >> ") + homeLocation).latin1());
155 system((QString("echo Name=" NEW_APPLICATION " | cat >> ") + homeLocation).latin1()); 155 system((QString("echo Name=" NEW_APPLICATION " | cat >> ") + homeLocation).latin1());
156 int slash = parentDir.findRev('/', -1); 156 int slash = parentDir.findRev('/', -1);
157 QString folderName = parentDir.mid(slash+1, parentDir.length()); 157 QString folderName = parentDir.mid(slash+1, parentDir.length());
158 158
159 system((QString("echo Type=") + folderName + " | cat >> " + homeLocation).latin1()); 159 system((QString("echo Type=") + folderName + " | cat >> " + homeLocation).latin1());
160 160
161 // Insert into the tree 161 // Insert into the tree
162 QListViewItem *newItem = new QListViewItem(item, NEW_APPLICATION); 162 QListViewItem *newItem = new QListViewItem(item, NEW_APPLICATION);
163 itemList.insert(newItem, homeLocation ); 163 itemList.insert(newItem, homeLocation );
164 164
165 // We have changed something. 165 // We have changed something.
166 changed = true; 166 changed = true;
167} 167}
168 168
169/** 169/**
170 * Remove the item. 170 * Remove the item.
171 * Check if we can 171 * Check if we can
172 * Prompt user 172 * Prompt user
173 * Delete physical file (Dir, remove .dir, then dir. File, remove file) 173 * Delete physical file (Dir, remove .dir, then dir. File, remove file)
174 * Remove from installer if need too. 174 * Remove from installer if need too.
175 */ 175 */
176void TabManager::removeItem(){ 176void TabManager::removeItem(){
177 // Make sure we can delete 177 // Make sure we can delete
178 QListViewItem *item = tabList->currentItem(); 178 QListViewItem *item = tabList->currentItem();
179 if(!item) 179 if(!item)
180 return; 180 return;
181 if(item->childCount() > 0){ 181 if(item->childCount() > 0){
182 QMessageBox::critical(this, tr("Message"), tr("Can't remove with applications\nstill in the group."), tr("Ok") ); 182 QMessageBox::critical(this, tr("Message"), tr("Can't remove with applications\nstill in the group."), tr("Ok") );
183 return; 183 return;
184 } 184 }
185 185
186 // Prompt. 186 // Prompt.
187 int answer = QMessageBox::warning(this, tr("Message"), tr("Are you sure you want to delete?"), tr("Yes"), tr("Cancel"), 0, 1 ); 187 int answer = QMessageBox::warning(this, tr("Message"), tr("Are you sure you want to delete?"), tr("Yes"), tr("Cancel"), 0, 1 );
188 if (answer) 188 if (answer)
189 return; 189 return;
190 190
191 bool removeSuccessfull = true; 191 bool removeSuccessful = true;
192 QString location = itemList[item]; 192 QString location = itemList[item];
193 // Remove file (.directory in a Directory case) 193 // Remove file (.directory in a Directory case)
194 if(!QFile::remove(location)) 194 if(!QFile::remove(location))
195 removeSuccessfull = false; 195 removeSuccessful = false;
196 196
197 // Remove directory 197 // Remove directory
198 if(item->parent() == NULL){ 198 if(item->parent() == NULL){
199 // Remove .directory file string 199 // Remove .directory file string
200 location = location.mid(0,location.length()-10); 200 location = location.mid(0,location.length()-10);
201 QDir dir; 201 QDir dir;
202 if(!dir.rmdir(location)) 202 if(!dir.rmdir(location))
203 removeSuccessfull = false; 203 removeSuccessful = false;
204 else 204 else
205 removeSuccessfull = true; 205 removeSuccessful = true;
206 } 206 }
207 207
208 // If removing failed. 208 // If removing failed.
209 if(!removeSuccessfull){ 209 if(!removeSuccessful){
210 qDebug((QString("removeItem: ") + location).latin1()); 210 qDebug((QString("removeItem: ") + location).latin1());
211 QMessageBox::critical(this, tr("Message"), tr("Can't remove."), tr("Ok") ); 211 QMessageBox::critical(this, tr("Message"), tr("Can't remove."), tr("Ok") );
212 return; 212 return;
213 } 213 }
214 214
215 // Remove from the installer so it wont fail. 215 // Remove from the installer so it wont fail.
216 // Don't need to do this sense the current install uses rm -f so no error 216 // Don't need to do this sense the current install uses rm -f so no error
217 217
218 // Remove from the gui list. 218 // Remove from the gui list.
219 itemList.remove(item); 219 itemList.remove(item);
220 if(item->parent()) 220 if(item->parent())
221 item->parent()->takeItem(item); 221 item->parent()->takeItem(item);
222 delete item; 222 delete item;
223 223
224 // We have changed something. 224 // We have changed something.
225 changed = true; 225 changed = true;
226} 226}
227 227
228/** 228/**
229 * Helper function. Edits the current item. 229 * Helper function. Edits the current item.
230 * calls editItem with the currently selected item. 230 * calls editItem with the currently selected item.
231 */ 231 */
232void TabManager::editCurrentItem(){ 232void TabManager::editCurrentItem(){
233 editItem(tabList->currentItem()); 233 editItem(tabList->currentItem());
234} 234}
235 235
236/** 236/**
237 * Edit the item that is passed in. 237 * Edit the item that is passed in.
238 * Show application dialog and if anything changed 238 * Show application dialog and if anything changed
239 * @param item the item to edit. 239 * @param item the item to edit.
240 */ 240 */
241void TabManager::editItem( QListViewItem * item){ 241void TabManager::editItem( QListViewItem * item){
242 if(!item) 242 if(!item)
243 return; 243 return;
244 244
245 TabAppLnk app(itemList[item]); 245 TabAppLnk app(itemList[item]);
246 if(!app.isValid()){ 246 if(!app.isValid()){
247 qDebug(QString("editItem: Not a valid applnk file: ") + itemList[item].latin1()); 247 qDebug(QString("editItem: Not a valid applnk file: ") + itemList[item].latin1());
248 return; 248 return;
249 } 249 }
250 250
251 // Fill with all of the icons 251 // Fill with all of the icons
252 if(!application){ 252 if(!application){
253 Wait waitDialog(this, "Wait dialog"); 253 Wait waitDialog(this, "Wait dialog");
254 waitDialog.waitLabel->setText(tr("Gathering icons...")); 254 waitDialog.waitLabel->setText(tr("Gathering icons..."));
255 waitDialog.show(); 255 waitDialog.show();
256 qApp->processEvents(); 256 qApp->processEvents();
257 application = new AppEdit(this, "Application edit", true); 257 application = new AppEdit(this, "Application edit", true);
258 258
259 QDir d(QPEApplication::qpeDir() + "/pics/"); 259 QDir d(QPEApplication::qpeDir() + "/pics/");
260 d.setFilter( QDir::Files); 260 d.setFilter( QDir::Files);
261 261
262 const QFileInfoList *list = d.entryInfoList(); 262 const QFileInfoList *list = d.entryInfoList();
263 QFileInfoListIterator it( *list ); // create list iterator 263 QFileInfoListIterator it( *list ); // create list iterator
264 QFileInfo *fi; // pointer for traversing 264 QFileInfo *fi; // pointer for traversing
265 265
266 while ( (fi=it.current()) ) { // for each file... 266 while ( (fi=it.current()) ) { // for each file...
267 QString fileName = fi->fileName(); 267 QString fileName = fi->fileName();
268 if(fileName.right(4) == ".png"){ 268 if(fileName.right(4) == ".png"){
269 fileName = fileName.mid(0,fileName.length()-4); 269 fileName = fileName.mid(0,fileName.length()-4);
270 QPixmap imageOfFile(Resource::loadPixmap(fileName)); 270 QPixmap imageOfFile(Resource::loadPixmap(fileName));
271 QImage foo = imageOfFile.convertToImage(); 271 QImage foo = imageOfFile.convertToImage();
272 foo = foo.smoothScale(16,16); 272 foo = foo.smoothScale(16,16);
273 imageOfFile.convertFromImage(foo); 273 imageOfFile.convertFromImage(foo);
274 application->iconLineEdit->insertItem(imageOfFile,fileName); 274 application->iconLineEdit->insertItem(imageOfFile,fileName);
275 } 275 }
276 //qDebug(fi->fileName().latin1()); 276 //qDebug(fi->fileName().latin1());
277 ++it; 277 ++it;
278 } 278 }
279 waitDialog.hide(); 279 waitDialog.hide();
280 } 280 }
281 int pixmap = -1; 281 int pixmap = -1;
282 QString pixmapText = app.pixmapString(); 282 QString pixmapText = app.pixmapString();
283 QComboBox *f = application->iconLineEdit; 283 QComboBox *f = application->iconLineEdit;
284 for(int i = 0; i < application->iconLineEdit->count(); i++){ 284 for(int i = 0; i < application->iconLineEdit->count(); i++){
285 if(f->text(i) == pixmapText){ 285 if(f->text(i) == pixmapText){
286 pixmap = i; 286 pixmap = i;
287 break; 287 break;
288 } 288 }
289 } 289 }
290 if(pixmap != -1) 290 if(pixmap != -1)
291 application->iconLineEdit->setCurrentItem(pixmap); 291 application->iconLineEdit->setCurrentItem(pixmap);
292 else if(pixmapText.isEmpty()){ 292 else if(pixmapText.isEmpty()){
293 application->iconLineEdit->setCurrentItem(0); 293 application->iconLineEdit->setCurrentItem(0);
294 } 294 }
295 else{ 295 else{
296 QPixmap imageOfFile(Resource::loadPixmap(pixmapText)); 296 QPixmap imageOfFile(Resource::loadPixmap(pixmapText));
297 QImage foo = imageOfFile.convertToImage(); 297 QImage foo = imageOfFile.convertToImage();
298 foo = foo.smoothScale(16,16); 298 foo = foo.smoothScale(16,16);
299 imageOfFile.convertFromImage(foo); 299 imageOfFile.convertFromImage(foo);
300 application->iconLineEdit->insertItem(imageOfFile,pixmapText,0); 300 application->iconLineEdit->insertItem(imageOfFile,pixmapText,0);
301 application->iconLineEdit->setCurrentItem(0); 301 application->iconLineEdit->setCurrentItem(0);
302 } 302 }
303 303
304 application->nameLineEdit->setText(app.name()); 304 application->nameLineEdit->setText(app.name());
305 application->execLineEdit->setText(app.exec()); 305 application->execLineEdit->setText(app.exec());
306 application->commentLineEdit->setText(app.comment()); 306 application->commentLineEdit->setText(app.comment());
307 307
308 if(item->parent() == NULL){ 308 if(item->parent() == NULL){
309 application->execLineEdit->setEnabled(false); 309 application->execLineEdit->setEnabled(false);
310 application->TextLabel3->setEnabled(false); 310 application->TextLabel3->setEnabled(false);
311 application->setCaption(tr("Tab")); 311 application->setCaption(tr("Tab"));
312 } 312 }
313 else{ 313 else{
314 application->execLineEdit->setEnabled(true); 314 application->execLineEdit->setEnabled(true);
315 application->TextLabel3->setEnabled(true); 315 application->TextLabel3->setEnabled(true);
316 application->setCaption(tr("Application")); 316 application->setCaption(tr("Application"));
317 } 317 }
318 318
319 // Only do somthing if they hit OK 319 // Only do somthing if they hit OK
320 application->showMaximized(); 320 application->showMaximized();
321 if(application->exec() == 0) 321 if(application->exec() == 0)
322 return; 322 return;
323 323
324 // If nothing has changed exit (hmmm why did they hit ok?) 324 // If nothing has changed exit (hmmm why did they hit ok?)
325 if(app.name() == application->nameLineEdit->text() && 325 if(app.name() == application->nameLineEdit->text() &&
326 app.pixmapString() == application->iconLineEdit->currentText() && 326 app.pixmapString() == application->iconLineEdit->currentText() &&
327 app.comment() == application->commentLineEdit->text() && 327 app.comment() == application->commentLineEdit->text() &&
328 app.exec() == application->execLineEdit->text()) 328 app.exec() == application->execLineEdit->text())
329 return; 329 return;
330 330
331 // Change the applnk file 331 // Change the applnk file
332 QString oldName = app.name(); 332 QString oldName = app.name();
333 app.setName(application->nameLineEdit->text()); 333 app.setName(application->nameLineEdit->text());
334 app.setIcon(application->iconLineEdit->currentText()); 334 app.setIcon(application->iconLineEdit->currentText());
335 app.setComment(application->commentLineEdit->text()); 335 app.setComment(application->commentLineEdit->text());
336 app.setExec(application->execLineEdit->text()); 336 app.setExec(application->execLineEdit->text());
337 if(!app.writeLink()){ 337 if(!app.writeLink()){
338 QMessageBox::critical(this, tr("Message"), "Can't save.", tr("Ok") ); 338 QMessageBox::critical(this, tr("Message"), "Can't save.", tr("Ok") );
339 return; 339 return;
340 } 340 }
341 341
342 // Update the gui icon and name 342 // Update the gui icon and name
343 item->setText(0,app.name()); 343 item->setText(0,app.name());
344 item->setPixmap(0,app.pixmap()); 344 item->setPixmap(0,app.pixmap());
345 345
346 // We have changed something. 346 // We have changed something.
347 changed = true; 347 changed = true;
348 348
349 // If we were dealing with a new folder or new application change 349 // If we were dealing with a new folder or new application change
350 // the file names. Also change the item location in itemList 350 // the file names. Also change the item location in itemList
351 if(oldName == NEW_FOLDER){ 351 if(oldName == NEW_FOLDER){
352 QDir r; 352 QDir r;
353 QString oldName = itemList[item]; 353 QString oldName = itemList[item];
354 oldName = oldName.mid(0,oldName.length()-11); 354 oldName = oldName.mid(0,oldName.length()-11);
355 QString newName = oldName.mid(0,oldName.length()-9); 355 QString newName = oldName.mid(0,oldName.length()-9);
356 newName = newName + "/" + app.name(); 356 newName = newName + "/" + app.name();
357 r.rename(oldName, newName); 357 r.rename(oldName, newName);
358 itemList.remove(item); 358 itemList.remove(item);
359 itemList.insert(item, newName + "/.directory" ); 359 itemList.insert(item, newName + "/.directory" );
360 } 360 }
361 else if(oldName == NEW_APPLICATION){ 361 else if(oldName == NEW_APPLICATION){
362 if(!item->parent()) 362 if(!item->parent())
363 return; 363 return;
364 QString parentDir = itemList[item->parent()]; 364 QString parentDir = itemList[item->parent()];
365 QDir r; 365 QDir r;
366 QString oldName = itemList[item]; 366 QString oldName = itemList[item];
367 QString newName = oldName.mid(0, parentDir.length()-10); 367 QString newName = oldName.mid(0, parentDir.length()-10);
368 newName = newName + app.name() + APPLICATION_EXTENSION; 368 newName = newName + app.name() + APPLICATION_EXTENSION;
369 r.rename(oldName, newName); 369 r.rename(oldName, newName);
370 itemList.remove(item); 370 itemList.remove(item);
371 itemList.insert(item, newName); 371 itemList.insert(item, newName);
372 } 372 }
373} 373}
374 374
375/** 375/**
376 * Move an application from one directory to another. 376 * Move an application from one directory to another.
377 * Move in the gui, move in the applnk file, move in the installer. 377 * Move in the gui, move in the applnk file, move in the installer.
378 * @param item the application to move 378 * @param item the application to move
379 * @pearam newGroup the new parent of this application 379 * @pearam newGroup the new parent of this application
380 */ 380 */
381void TabManager::moveApplication(QListViewItem *item, QListViewItem *newGroup){ 381void TabManager::moveApplication(QListViewItem *item, QListViewItem *newGroup){
382 // Can we even move it? 382 // Can we even move it?
383 if(!item || !item->parent() || newGroup->parent()) 383 if(!item || !item->parent() || newGroup->parent())
384 return; 384 return;
385 if(item->parent() == newGroup) 385 if(item->parent() == newGroup)
386 return; 386 return;
387 387
388 // Get the new folder, new file name, 388 // Get the new folder, new file name,
389 QString newFolder = itemList[newGroup]; 389 QString newFolder = itemList[newGroup];
390 newFolder = newFolder.mid(0,newFolder.length()-11); 390 newFolder = newFolder.mid(0,newFolder.length()-11);
391 int slash = newFolder.findRev('/', -1); 391 int slash = newFolder.findRev('/', -1);
392 QString folderName = newFolder.mid(slash+1, newFolder.length()); 392 QString folderName = newFolder.mid(slash+1, newFolder.length());
393 393
394 QString desktopFile = itemList[item]; 394 QString desktopFile = itemList[item];
395 slash = desktopFile.findRev('/', -1); 395 slash = desktopFile.findRev('/', -1);
396 desktopFile = desktopFile.mid(slash, desktopFile.length()); 396 desktopFile = desktopFile.mid(slash, desktopFile.length());
397 newFolder = newFolder + desktopFile; 397 newFolder = newFolder + desktopFile;
398 398
399 // Move file 399 // Move file
400 QDir r; 400 QDir r;
401 if(!r.rename(itemList[item], newFolder)){ 401 if(!r.rename(itemList[item], newFolder)){
402 QMessageBox::critical(this, tr("Message"), "Can't move application.", tr("Ok") ); 402 QMessageBox::critical(this, tr("Message"), "Can't move application.", tr("Ok") );
403 return; 403 return;
404 } 404 }
405 //qDebug((QString("moveApplication: ") + itemList[item]).latin1()); 405 //qDebug((QString("moveApplication: ") + itemList[item]).latin1());
406 //qDebug((QString("moveApplication: ") + newFolder).latin1()); 406 //qDebug((QString("moveApplication: ") + newFolder).latin1());
407 407
408 // Move in the gui 408 // Move in the gui
409 item->parent()->takeItem(item); 409 item->parent()->takeItem(item);
410 newGroup->insertItem(item); 410 newGroup->insertItem(item);
411 newGroup->setOpen(true); 411 newGroup->setOpen(true);
412 412
413 // Move file in the installer 413 // Move file in the installer
414 QString installedAppFile; 414 QString installedAppFile;
415 if(findInstalledApplication(desktopFile, installedAppFile)) 415 if(findInstalledApplication(desktopFile, installedAppFile))
416 swapInstalledLocation(installedAppFile, desktopFile, newFolder); 416 swapInstalledLocation(installedAppFile, desktopFile, newFolder);
417 else 417 else
418 qDebug("moveApplication: No installed app found for dekstop file"); 418 qDebug("moveApplication: No installed app found for dekstop file");
419 419
420 // Move application type 420 // Move application type
421 AppLnk app(newFolder); 421 AppLnk app(newFolder);
422 app.setType(folderName); 422 app.setType(folderName);
423 app.writeLink(); 423 app.writeLink();
424 424
425 // Move in our internal list 425 // Move in our internal list
426 itemList.remove(item); 426 itemList.remove(item);
427 itemList.insert(item, newFolder); 427 itemList.insert(item, newFolder);
428 428
429 // We have changed something. 429 // We have changed something.
430 changed = true; 430 changed = true;
431} 431}
432 432
433/** 433/**
434 * File the installed application that has this desktop file. 434 * File the installed application that has this desktop file.
435 * Go through each file in HOME_APP_INSTALL_DIR and see if it contains desktop 435 * Go through each file in HOME_APP_INSTALL_DIR and see if it contains desktop
436 * file 436 * file
437 * @param desktopFile - the .desktop file to search for [foo.desktop] 437 * @param desktopFile - the .desktop file to search for [foo.desktop]
438 * @param installedAppFile - location of the app install list 438 * @param installedAppFile - location of the app install list
439 * @return true if successfull, false if file not found. 439 * @return true if successful, false if file not found.
440 */ 440 */
441bool TabManager::findInstalledApplication(QString desktopFile, QString &installedAppFile){ 441bool TabManager::findInstalledApplication(QString desktopFile, QString &installedAppFile){
442 442
443 QDir d; 443 QDir d;
444 d.setPath(HOME_APP_INSTALL_DIR); 444 d.setPath(HOME_APP_INSTALL_DIR);
445 d.setFilter( QDir::Files ); 445 d.setFilter( QDir::Files );
446 446
447 const QFileInfoList *list = d.entryInfoList(); 447 const QFileInfoList *list = d.entryInfoList();
448 QFileInfoListIterator it( *list ); // create list iterator 448 QFileInfoListIterator it( *list ); // create list iterator
449 QFileInfo *fi; // pointer for traversing 449 QFileInfo *fi; // pointer for traversing
450 450
451 while ( (fi=it.current()) ) { // for each file... 451 while ( (fi=it.current()) ) { // for each file...
452 QFile file(QString(HOME_APP_INSTALL_DIR) + "/" + fi->fileName()); 452 QFile file(QString(HOME_APP_INSTALL_DIR) + "/" + fi->fileName());
453 if ( file.open(IO_ReadOnly) ) { // file opened successfully 453 if ( file.open(IO_ReadOnly) ) { // file opened successfully
454 QTextStream stream( &file ); // use a text stream 454 QTextStream stream( &file ); // use a text stream
455 QString line; 455 QString line;
456 while ( !stream.eof() ) { // until end of file... 456 while ( !stream.eof() ) { // until end of file...
457 line = stream.readLine(); // line of text excluding '\n' 457 line = stream.readLine(); // line of text excluding '\n'
458 if(line.contains(desktopFile)){ 458 if(line.contains(desktopFile)){
459 installedAppFile = QString(HOME_APP_INSTALL_DIR) + "/" + fi->fileName(); 459 installedAppFile = QString(HOME_APP_INSTALL_DIR) + "/" + fi->fileName();
460 file.close(); 460 file.close();
461 return true; 461 return true;
462 } 462 }
463 } 463 }
464 file.close(); 464 file.close();
465 } 465 }
466 else 466 else
467 qDebug((QString("findInstalledApplication: Can't open file") + HOME_APP_INSTALL_DIR + "/" + fi->fileName()).latin1()); 467 qDebug((QString("findInstalledApplication: Can't open file") + HOME_APP_INSTALL_DIR + "/" + fi->fileName()).latin1());
468 ++it; // goto next list element 468 ++it; // goto next list element
469 } 469 }
470 return false; 470 return false;
471} 471}
472 472
473/** 473/**
474 * Open a file and replace a file containing the old desktop file with the new. 474 * Open a file and replace a file containing the old desktop file with the new.
475 * @param installedAppFile application installed list 475 * @param installedAppFile application installed list
476 * @param desktopFile old .desktop file 476 * @param desktopFile old .desktop file
477 * @param newLocation new .desktop file 477 * @param newLocation new .desktop file
478 */ 478 */
479void TabManager::swapInstalledLocation( QString installedAppFile, QString desktopFile, QString newLocation ){ 479void TabManager::swapInstalledLocation( QString installedAppFile, QString desktopFile, QString newLocation ){
480 QFile file(installedAppFile); 480 QFile file(installedAppFile);
481 if ( !file.open(IO_ReadOnly) ){ 481 if ( !file.open(IO_ReadOnly) ){
482 qDebug(QString("swapInstalledLocation: Can't edit file: %1").arg(installedAppFile).latin1()); 482 qDebug(QString("swapInstalledLocation: Can't edit file: %1").arg(installedAppFile).latin1());
483 return; 483 return;
484 } 484 }
485 485
486 QTextStream stream( &file ); // use a text stream 486 QTextStream stream( &file ); // use a text stream
487 QString allLines; 487 QString allLines;
488 while ( !stream.eof() ) { // until end of file... 488 while ( !stream.eof() ) { // until end of file...
489 QString line = stream.readLine(); // line of text excluding '\n' 489 QString line = stream.readLine(); // line of text excluding '\n'
490 if(line.contains(desktopFile)) 490 if(line.contains(desktopFile))
491 allLines += newLocation; 491 allLines += newLocation;
492 else 492 else
493 allLines += line; 493 allLines += line;
494 allLines += '\n'; 494 allLines += '\n';
495 } 495 }
496 file.close(); 496 file.close();
497 497
498 if ( !file.open(IO_ReadWrite) ){ 498 if ( !file.open(IO_ReadWrite) ){
499 qDebug(QString("swapInstalledLocation: Can't edit file: %1").arg(installedAppFile).latin1()); 499 qDebug(QString("swapInstalledLocation: Can't edit file: %1").arg(installedAppFile).latin1());
500 return; 500 return;
501 } 501 }
502 QTextStream streamOut( &file ); 502 QTextStream streamOut( &file );
503 streamOut << allLines; 503 streamOut << allLines;
504 file.close(); 504 file.close();
505} 505}
506 506
507// tabmanager.cpp 507// tabmanager.cpp
508 508
diff --git a/noncore/unsupported/mail2/TODO b/noncore/unsupported/mail2/TODO
index 4bc434f..3c83fdd 100644
--- a/noncore/unsupported/mail2/TODO
+++ b/noncore/unsupported/mail2/TODO
@@ -1,34 +1,34 @@
1Mail TODO 1Mail TODO
2----------------------------------------------------------------------------- 2-----------------------------------------------------------------------------
3 3
4General stuff: 4General stuff:
5 - This program needs a name! 5 - This program needs a name!
6 - If password is empty, ask for it during fetch. 6 - If password is empty, ask for it during fetch.
7 - Check if all necessary fields in AccoundEditor are filled. 7 - Check if all necessary fields in AccoundEditor are filled.
8 - Seperate Sending and Recieving in configuration. 8 - Seperate Sending and Recieving in configuration.
9 9
10Protocol related: 10Protocol related:
11 - The IMAP implentation is kinda strange and slow. 11 - The IMAP implentation is kinda strange and slow.
12 - The SMTP implentation is goddamn strange. 12 - The SMTP implentation is goddamn strange.
13 - POP3 support would be nice. 13 - POP3 support would be nice.
14 - NNTP would be kinda neat, too. 14 - NNTP would be kinda neat, too.
15 - Implent a plugin system. 15 - Implent a plugin system.
16 16
17Security related: 17Security related:
18 - GnuPG support. This will require a seperate gpg managing utility in 18 - GnuPG support. This will require a seperate gpg managing utility in
19 the settings tab. 19 the settings tab.
20 - sMIME? maybe in the distant future. 20 - sMIME? maybe in the distant future.
21 - Integrated SSH tunneling. 21 - Integrated SSH tunneling.
22 22
23Mail management: 23Mail management:
24 - Header caching 24 - Header caching
25 - Sieve filtering support? 25 - Sieve filtering support?
26 - Enqueueing/Draft support both on the IMAP server and local. 26 - Enqueueing/Draft support both on the IMAP server and local.
27 27
28Testing: 28Testing:
29 I'm using the courier-imap server at my developement site. I didn't have 29 I'm using the courier-imap server at my developement site. I didn't have
30 much opportunity to test on other servers. Giving me test-accounts on other 30 much opportunity to test on other servers. Giving me test-accounts on other
31 servers would be helpfull. 31 servers would be helpful.
32 32
33If you want something added, drop a mail. Comments are always welcome. 33If you want something added, drop a mail. Comments are always welcome.
34 34
diff --git a/noncore/unsupported/mail2/folderwidget.cpp b/noncore/unsupported/mail2/folderwidget.cpp
index 6c36e92..d27968b 100644
--- a/noncore/unsupported/mail2/folderwidget.cpp
+++ b/noncore/unsupported/mail2/folderwidget.cpp
@@ -1,314 +1,314 @@
1#include <qmessagebox.h> 1#include <qmessagebox.h>
2#include <qtextstream.h> 2#include <qtextstream.h>
3#include <qpopupmenu.h> 3#include <qpopupmenu.h>
4#include <qheader.h> 4#include <qheader.h>
5#include <qfile.h> 5#include <qfile.h>
6#include <qdir.h> 6#include <qdir.h>
7 7
8#include <qpe/resource.h> 8#include <qpe/resource.h>
9 9
10#include <stdlib.h> 10#include <stdlib.h>
11 11
12#include "folderwidget.h" 12#include "folderwidget.h"
13#include "imaphandler.h" 13#include "imaphandler.h"
14#include "imapbase.h" 14#include "imapbase.h"
15#include "rename.h" 15#include "rename.h"
16 16
17FolderWidgetItem::FolderWidgetItem(Folder &folder, QListView *parent) 17FolderWidgetItem::FolderWidgetItem(Folder &folder, QListView *parent)
18 : QListViewItem(parent), _folder(folder) 18 : QListViewItem(parent), _folder(folder)
19{ 19{
20 setPixmap(0, QPixmap(Resource::loadPixmap("mail/inbox"))); 20 setPixmap(0, QPixmap(Resource::loadPixmap("mail/inbox")));
21 setText(0, _folder.topFolder().account().user() + " (" + _folder.topFolder().account().imapServer() + ")"); 21 setText(0, _folder.topFolder().account().user() + " (" + _folder.topFolder().account().imapServer() + ")");
22 setOpen(true); 22 setOpen(true);
23} 23}
24 24
25FolderWidgetItem::FolderWidgetItem(Folder &folder, FolderWidgetItem *parent) 25FolderWidgetItem::FolderWidgetItem(Folder &folder, FolderWidgetItem *parent)
26 : QListViewItem(parent), _folder(folder) 26 : QListViewItem(parent), _folder(folder)
27{ 27{
28 if (_folder.noCache()) { 28 if (_folder.noCache()) {
29 setText(0, QObject::tr("<Foldertree not known.>")); 29 setText(0, QObject::tr("<Foldertree not known.>"));
30 } else { 30 } else {
31 if (folder.fullName().upper() == "INBOX") { 31 if (folder.fullName().upper() == "INBOX") {
32 setPixmap(0, QPixmap(Resource::loadPixmap("mail/inbox"))); 32 setPixmap(0, QPixmap(Resource::loadPixmap("mail/inbox")));
33 setText(0, QObject::tr("Inbox")); 33 setText(0, QObject::tr("Inbox"));
34 } else { 34 } else {
35 setPixmap(0, QPixmap(Resource::loadPixmap("mail/folder"))); 35 setPixmap(0, QPixmap(Resource::loadPixmap("mail/folder")));
36 setText(0, folder.fullName()); 36 setText(0, folder.fullName());
37 } 37 }
38 setOpen(true); 38 setOpen(true);
39 } 39 }
40} 40}
41 41
42FolderWidget::FolderWidget(QWidget *parent, const char *name, WFlags fl) 42FolderWidget::FolderWidget(QWidget *parent, const char *name, WFlags fl)
43 : ListViewPlus(parent, name, fl) 43 : ListViewPlus(parent, name, fl)
44{ 44{
45 header()->hide(); 45 header()->hide();
46 addColumn(""); 46 addColumn("");
47 setSorting(-1); 47 setSorting(-1);
48 48
49 QPopupMenu *menu = new QPopupMenu(); 49 QPopupMenu *menu = new QPopupMenu();
50 menu->insertItem(tr("Rename"), MENU_RENAME); 50 menu->insertItem(tr("Rename"), MENU_RENAME);
51 menu->insertItem(tr("Delete"), MENU_DELETE); 51 menu->insertItem(tr("Delete"), MENU_DELETE);
52 menu->insertItem(tr("Move"), MENU_MOVE); 52 menu->insertItem(tr("Move"), MENU_MOVE);
53 menu->insertItem(tr("Copy"), MENU_COPY); 53 menu->insertItem(tr("Copy"), MENU_COPY);
54 menu->insertSeparator(); 54 menu->insertSeparator();
55 menu->insertItem(tr("Create folder"), MENU_CREATE); 55 menu->insertItem(tr("Create folder"), MENU_CREATE);
56 menu->insertSeparator(); 56 menu->insertSeparator();
57 menu->insertItem(tr("Rescan folder list"), MENU_RESCAN); 57 menu->insertItem(tr("Rescan folder list"), MENU_RESCAN);
58 setPopup(menu); 58 setPopup(menu);
59 59
60 getAccounts(); 60 getAccounts();
61 61
62 connect(menu, SIGNAL(activated(int)), SLOT(slotMenuActivated(int))); 62 connect(menu, SIGNAL(activated(int)), SLOT(slotMenuActivated(int)));
63 connect(this, SIGNAL(clicked(QListViewItem *)), SLOT(slotItemClicked(QListViewItem *))); 63 connect(this, SIGNAL(clicked(QListViewItem *)), SLOT(slotItemClicked(QListViewItem *)));
64} 64}
65 65
66FolderWidget::~FolderWidget() 66FolderWidget::~FolderWidget()
67{ 67{
68 // TODO: Save folder tree. 68 // TODO: Save folder tree.
69} 69}
70 70
71void FolderWidget::update() 71void FolderWidget::update()
72{ 72{
73 getAccounts(); 73 getAccounts();
74} 74}
75 75
76void FolderWidget::getAccounts() 76void FolderWidget::getAccounts()
77{ 77{
78 clear(); 78 clear();
79 79
80 QValueList<Account> accounts = ConfigFile::getAccounts(); 80 QValueList<Account> accounts = ConfigFile::getAccounts();
81 QValueList<Account>::Iterator it; 81 QValueList<Account>::Iterator it;
82 for (it = accounts.begin(); it != accounts.end(); it++) { 82 for (it = accounts.begin(); it != accounts.end(); it++) {
83 FolderWidgetItem *item = addAccount(*it); 83 FolderWidgetItem *item = addAccount(*it);
84 QFile f((QString) getenv("HOME") + "/Applications/mail/foldercache/foldercache-" + (*it).accountName()); 84 QFile f((QString) getenv("HOME") + "/Applications/mail/foldercache/foldercache-" + (*it).accountName());
85 if (!f.open(IO_ReadOnly)) { 85 if (!f.open(IO_ReadOnly)) {
86 Folder folder; 86 Folder folder;
87 folder.setNoCache(true); 87 folder.setNoCache(true);
88 addFolder(folder, item); 88 addFolder(folder, item);
89 } else { 89 } else {
90 QTextStream t(&f); 90 QTextStream t(&f);
91 while (!t.atEnd()) { 91 while (!t.atEnd()) {
92 QString separator = t.readLine(); 92 QString separator = t.readLine();
93 QString fullname = t.readLine(); 93 QString fullname = t.readLine();
94 Folder folder; 94 Folder folder;
95 folder.setSeparator(separator); 95 folder.setSeparator(separator);
96 folder.setFullName(fullname); 96 folder.setFullName(fullname);
97 folder.setTopFolder(item->folder().topFolder()); 97 folder.setTopFolder(item->folder().topFolder());
98 addFolder(folder, item); 98 addFolder(folder, item);
99 } 99 }
100 f.close(); 100 f.close();
101 } 101 }
102 } 102 }
103} 103}
104 104
105FolderWidgetItem *FolderWidget::addAccount(Account &account) 105FolderWidgetItem *FolderWidget::addAccount(Account &account)
106{ 106{
107 TopFolder tf; 107 TopFolder tf;
108 tf.setAccount(account); 108 tf.setAccount(account);
109 109
110 // XXX This has to change!!! The folderwidget may not create an 110 // XXX This has to change!!! The folderwidget may not create an
111 // XXX IMAPHandler!!!! Do this in IMAPHandler! 111 // XXX IMAPHandler!!!! Do this in IMAPHandler!
112 tf.setIMAPHandler(new IMAPHandler(account)); 112 tf.setIMAPHandler(new IMAPHandler(account));
113 113
114 Folder folder; 114 Folder folder;
115 folder.setTopFolder(tf); 115 folder.setTopFolder(tf);
116 116
117 connect(tf.handler(), SIGNAL(IMAPLookingUpHost()), SLOT(slotIMAPLookingUpHost())); 117 connect(tf.handler(), SIGNAL(IMAPLookingUpHost()), SLOT(slotIMAPLookingUpHost()));
118 connect(tf.handler(), SIGNAL(IMAPHostFound()), SLOT(slotIMAPHostFound())); 118 connect(tf.handler(), SIGNAL(IMAPHostFound()), SLOT(slotIMAPHostFound()));
119 connect(tf.handler(), SIGNAL(IMAPConnected()), SLOT(slotIMAPConnected())); 119 connect(tf.handler(), SIGNAL(IMAPConnected()), SLOT(slotIMAPConnected()));
120 connect(tf.handler(), SIGNAL(IMAPDisconnected()), SLOT(slotIMAPDisconnected())); 120 connect(tf.handler(), SIGNAL(IMAPDisconnected()), SLOT(slotIMAPDisconnected()));
121 connect(tf.handler(), SIGNAL(IMAPError(int)), SLOT(slotIMAPError(int))); 121 connect(tf.handler(), SIGNAL(IMAPError(int)), SLOT(slotIMAPError(int)));
122 122
123 return new FolderWidgetItem(folder, this); 123 return new FolderWidgetItem(folder, this);
124} 124}
125 125
126FolderWidgetItem *FolderWidget::addFolder(Folder &folder, FolderWidgetItem *folderWidgetItem) 126FolderWidgetItem *FolderWidget::addFolder(Folder &folder, FolderWidgetItem *folderWidgetItem)
127{ 127{
128 return new FolderWidgetItem(folder, folderWidgetItem); 128 return new FolderWidgetItem(folder, folderWidgetItem);
129} 129}
130 130
131void FolderWidget::slotMenuActivated(int itemid) 131void FolderWidget::slotMenuActivated(int itemid)
132{ 132{
133 if (currentItem() == NULL) { 133 if (currentItem() == NULL) {
134 QMessageBox::information(this, tr("Error"), tr("<p>Please select an item first.</p>"), tr("Ok")); 134 QMessageBox::information(this, tr("Error"), tr("<p>Please select an item first.</p>"), tr("Ok"));
135 return; 135 return;
136 } 136 }
137 137
138 if (itemid == MENU_RENAME) { 138 if (itemid == MENU_RENAME) {
139 if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; 139 if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return;
140 140
141 Folder folder = ((FolderWidgetItem *)currentItem())->folder(); 141 Folder folder = ((FolderWidgetItem *)currentItem())->folder();
142 QString newName = Rename::rename(folder.fullName(), this); 142 QString newName = Rename::rename(folder.fullName(), this);
143 if (newName.isNull()) return; 143 if (newName.isNull()) return;
144 144
145 folder.topFolder().handler()->iRename(folder.fullName(), newName); 145 folder.topFolder().handler()->iRename(folder.fullName(), newName);
146 connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPRename(IMAPResponse &))); 146 connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPRename(IMAPResponse &)));
147 } else if (itemid == MENU_DELETE) { 147 } else if (itemid == MENU_DELETE) {
148 if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return; 148 if (((FolderWidgetItem *)currentItem())->folder().fullName().isEmpty()) return;
149 149
150 Folder folder = ((FolderWidgetItem *)currentItem())->folder(); 150 Folder folder = ((FolderWidgetItem *)currentItem())->folder();
151 151
152 int ret = QMessageBox::information(this, tr("Question"), tr("<p>Do you really want to delete <pre>%1</pre>?").arg(folder.fullName()), tr("Yes"), tr("No")); 152 int ret = QMessageBox::information(this, tr("Question"), tr("<p>Do you really want to delete <pre>%1</pre>?").arg(folder.fullName()), tr("Yes"), tr("No"));
153 if (ret == 1) return; 153 if (ret == 1) return;
154 154
155 _createFolder = folder; 155 _createFolder = folder;
156 156
157 folder.topFolder().handler()->iDelete(folder.fullName()); 157 folder.topFolder().handler()->iDelete(folder.fullName());
158 connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPDelete(IMAPResponse &))); 158 connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPDelete(IMAPResponse &)));
159 } else if (itemid == MENU_MOVE) { 159 } else if (itemid == MENU_MOVE) {
160 160
161 } else if (itemid == MENU_COPY) { 161 } else if (itemid == MENU_COPY) {
162 162
163 } else if (itemid == MENU_CREATE) { 163 } else if (itemid == MENU_CREATE) {
164 Folder folder = (((FolderWidgetItem *)currentItem())->folder()); 164 Folder folder = (((FolderWidgetItem *)currentItem())->folder());
165 _createFolder = folder; 165 _createFolder = folder;
166 166
167 QString folderName = Rename::getText(tr("Foldername"), tr("<p>Please enter the name of the new folder.</p>"), this); 167 QString folderName = Rename::getText(tr("Foldername"), tr("<p>Please enter the name of the new folder.</p>"), this);
168 if (folderName.isNull()) return; 168 if (folderName.isNull()) return;
169 169
170 folder.topFolder().handler()->iCreate(folder.fullName() + folder.separator() + folderName); 170 folder.topFolder().handler()->iCreate(folder.fullName() + folder.separator() + folderName);
171 connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPCreate(IMAPResponse &))); 171 connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPCreate(IMAPResponse &)));
172 } else if (itemid == MENU_RESCAN) { 172 } else if (itemid == MENU_RESCAN) {
173 Folder folder = (((FolderWidgetItem *)currentItem())->folder()); 173 Folder folder = (((FolderWidgetItem *)currentItem())->folder());
174 _rescanAccount = folder.topFolder().account(); 174 _rescanAccount = folder.topFolder().account();
175 175
176 folder.topFolder().handler()->iList("", "*"); 176 folder.topFolder().handler()->iList("", "*");
177 connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &))); 177 connect(folder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &)));
178 } 178 }
179} 179}
180 180
181void FolderWidget::slotItemClicked(QListViewItem *item) 181void FolderWidget::slotItemClicked(QListViewItem *item)
182{ 182{
183 if (item == NULL) return; 183 if (item == NULL) return;
184 Folder folder = ((FolderWidgetItem *)item)->folder(); 184 Folder folder = ((FolderWidgetItem *)item)->folder();
185 if (folder.fullName().isEmpty()) return; 185 if (folder.fullName().isEmpty()) return;
186 186
187 emit folderSelected(folder); 187 emit folderSelected(folder);
188} 188}
189 189
190void FolderWidget::slotIMAPLookingUpHost() 190void FolderWidget::slotIMAPLookingUpHost()
191{ 191{
192 emit status(tr("Looking up host...")); 192 emit status(tr("Looking up host..."));
193 emit connecting(); 193 emit connecting();
194} 194}
195 195
196void FolderWidget::slotIMAPHostFound() 196void FolderWidget::slotIMAPHostFound()
197{ 197{
198 emit status(tr("Host found.")); 198 emit status(tr("Host found."));
199} 199}
200 200
201void FolderWidget::slotIMAPConnected() 201void FolderWidget::slotIMAPConnected()
202{ 202{
203 emit status(tr("Connected to host.")); 203 emit status(tr("Connected to host."));
204 emit connected(); 204 emit connected();
205} 205}
206 206
207void FolderWidget::slotIMAPError(int error) 207void FolderWidget::slotIMAPError(int error)
208{ 208{
209 if (error == IMAPBase::IMAPErrConnectionRefused) { 209 if (error == IMAPBase::IMAPErrConnectionRefused) {
210 QMessageBox::warning(this, tr("Error"), tr("<p>The IMAP connection was refused.</p>"), tr("Ok")); 210 QMessageBox::warning(this, tr("Error"), tr("<p>The IMAP connection was refused.</p>"), tr("Ok"));
211 } else if (error == IMAPBase::IMAPErrHostNotFound) { 211 } else if (error == IMAPBase::IMAPErrHostNotFound) {
212 QMessageBox::warning(this, tr("Error"), tr("<p>The host was not found.</p>"), tr("Ok")); 212 QMessageBox::warning(this, tr("Error"), tr("<p>The host was not found.</p>"), tr("Ok"));
213 } else if (error == IMAPBase::IMAPErrSocketRead) { 213 } else if (error == IMAPBase::IMAPErrSocketRead) {
214 QMessageBox::warning(this, tr("Error"), tr("<p>There was an error while reading from the socket.</p>"), tr("Ok")); 214 QMessageBox::warning(this, tr("Error"), tr("<p>There was an error while reading from the socket.</p>"), tr("Ok"));
215 } else if (error == IMAPBase::IMAPErrLoginFailed) { 215 } else if (error == IMAPBase::IMAPErrLoginFailed) {
216 QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Check your password/username.</p>"), tr("Ok")); 216 QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Check your password/username.</p>"), tr("Ok"));
217 } else { 217 } else {
218 QMessageBox::warning(this, tr("Error"), tr("<p>An unknown error was encountered.</p>"), tr("Ok")); 218 QMessageBox::warning(this, tr("Error"), tr("<p>An unknown error was encountered.</p>"), tr("Ok"));
219 } 219 }
220} 220}
221 221
222void FolderWidget::slotIMAPDisconnected() 222void FolderWidget::slotIMAPDisconnected()
223{ 223{
224 emit status(tr("Disconnected.")); 224 emit status(tr("Disconnected."));
225 emit disconnected(); 225 emit disconnected();
226} 226}
227 227
228void FolderWidget::slotIMAPLogin(IMAPResponse &response) 228void FolderWidget::slotIMAPLogin(IMAPResponse &response)
229{ 229{
230 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPLogin(IMAPResponse &))); 230 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPLogin(IMAPResponse &)));
231 231
232 if (response.statusResponse().status() == IMAPResponseEnums::OK) { 232 if (response.statusResponse().status() == IMAPResponseEnums::OK) {
233 emit status(tr("Login successfull!")); 233 emit status(tr("Login successful!"));
234 } else { 234 } else {
235 QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Go away.</p>"), tr("Ok")); 235 QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Go away.</p>"), tr("Ok"));
236 } 236 }
237} 237}
238 238
239void FolderWidget::slotIMAPRename(IMAPResponse &response) 239void FolderWidget::slotIMAPRename(IMAPResponse &response)
240{ 240{
241 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPRename(IMAPResponse &))); 241 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPRename(IMAPResponse &)));
242 242
243 if (response.statusResponse().status() == IMAPResponseEnums::OK) { 243 if (response.statusResponse().status() == IMAPResponseEnums::OK) {
244 emit status(tr("Renaming successfull!")); 244 emit status(tr("Renaming successful!"));
245 } else { 245 } else {
246 QMessageBox::warning(this, tr("Error"), tr("<p>Renaming failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); 246 QMessageBox::warning(this, tr("Error"), tr("<p>Renaming failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
247 } 247 }
248} 248}
249 249
250void FolderWidget::slotIMAPDelete(IMAPResponse &response) 250void FolderWidget::slotIMAPDelete(IMAPResponse &response)
251{ 251{
252 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPDelete(IMAPResponse &))); 252 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPDelete(IMAPResponse &)));
253 253
254 if (response.statusResponse().status() == IMAPResponseEnums::OK) { 254 if (response.statusResponse().status() == IMAPResponseEnums::OK) {
255 emit status(tr("Deletion successfull!")); 255 emit status(tr("Deletion successful!"));
256 256
257 _rescanAccount = _createFolder.topFolder().account(); 257 _rescanAccount = _createFolder.topFolder().account();
258 258
259 _createFolder.topFolder().handler()->iList(".", "*"); 259 _createFolder.topFolder().handler()->iList(".", "*");
260 connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &))); 260 connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &)));
261 } else { 261 } else {
262 QMessageBox::warning(this, tr("Error"), tr("<p>Delete failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); 262 QMessageBox::warning(this, tr("Error"), tr("<p>Delete failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
263 } 263 }
264} 264}
265 265
266void FolderWidget::slotIMAPCreate(IMAPResponse &response) 266void FolderWidget::slotIMAPCreate(IMAPResponse &response)
267{ 267{
268 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPCreate(IMAPResponse &))); 268 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPCreate(IMAPResponse &)));
269 269
270 if (response.statusResponse().status() == IMAPResponseEnums::OK) { 270 if (response.statusResponse().status() == IMAPResponseEnums::OK) {
271 emit status(tr("Folder created. Rescanning...")); 271 emit status(tr("Folder created. Rescanning..."));
272 272
273 _rescanAccount = _createFolder.topFolder().account(); 273 _rescanAccount = _createFolder.topFolder().account();
274 274
275 _createFolder.topFolder().handler()->iList(".", "*"); 275 _createFolder.topFolder().handler()->iList(".", "*");
276 connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &))); 276 connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &)));
277 } else { 277 } else {
278 QMessageBox::warning(this, tr("Error"), tr("<p>The folder could not be created. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); 278 QMessageBox::warning(this, tr("Error"), tr("<p>The folder could not be created. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
279 } 279 }
280} 280}
281 281
282void FolderWidget::slotIMAPList(IMAPResponse &response) 282void FolderWidget::slotIMAPList(IMAPResponse &response)
283{ 283{
284 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPList(IMAPResponse &))); 284 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPList(IMAPResponse &)));
285 285
286 if (response.statusResponse().status() == IMAPResponseEnums::OK) { 286 if (response.statusResponse().status() == IMAPResponseEnums::OK) {
287 QDir d((QString) getenv("HOME") + "/Applications/mail/foldercache"); 287 QDir d((QString) getenv("HOME") + "/Applications/mail/foldercache");
288 if (!d.exists()) { 288 if (!d.exists()) {
289 system("mkdir -p $HOME/Applications/mail/foldercache"); 289 system("mkdir -p $HOME/Applications/mail/foldercache");
290 qWarning("Created $HOME/Applications/mail/foldercache."); 290 qWarning("Created $HOME/Applications/mail/foldercache.");
291 } 291 }
292 QFile f((QString) getenv("HOME") + "/Applications/mail/foldercache/foldercache-" + _rescanAccount.accountName()); 292 QFile f((QString) getenv("HOME") + "/Applications/mail/foldercache/foldercache-" + _rescanAccount.accountName());
293 if (!f.open(IO_WriteOnly)) { 293 if (!f.open(IO_WriteOnly)) {
294 QMessageBox::critical(this, tr("Error"), tr("<p>Couldn't open folder cache file for writing!</p>"), tr("Ok")); 294 QMessageBox::critical(this, tr("Error"), tr("<p>Couldn't open folder cache file for writing!</p>"), tr("Ok"));
295 return; 295 return;
296 } 296 }
297 QTextStream t(&f); 297 QTextStream t(&f);
298 298
299 QValueList<IMAPResponseLIST>::Iterator it; 299 QValueList<IMAPResponseLIST>::Iterator it;
300 QValueList<IMAPResponseLIST> lists = response.LIST(); 300 QValueList<IMAPResponseLIST> lists = response.LIST();
301 for (it = lists.begin(); it != lists.end(); it++) { 301 for (it = lists.begin(); it != lists.end(); it++) {
302 t << (*it).folderSeparator() << "\n"; 302 t << (*it).folderSeparator() << "\n";
303 t << (*it).folder() << "\n"; 303 t << (*it).folder() << "\n";
304 } 304 }
305 305
306 f.close(); 306 f.close();
307 307
308 emit status(tr("Got folder list.")); 308 emit status(tr("Got folder list."));
309 getAccounts(); 309 getAccounts();
310 } else { 310 } else {
311 QMessageBox::warning(this, tr("Error"), tr("<p>Couldn't retrieve the folder list. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok")); 311 QMessageBox::warning(this, tr("Error"), tr("<p>Couldn't retrieve the folder list. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
312 } 312 }
313} 313}
314 314
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 8525058..b46005b 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1,983 +1,983 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Definition of ________ class. 4** Definition of ________ class.
5** 5**
6** Created : 970521 6** Created : 970521
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the network module of the Qt GUI Toolkit. 10** This file is part of the network module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed under the terms of the Q Public License 12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file 13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file. 14** LICENSE.QPL included in the packaging of this file.
15** 15**
16** This file may be distributed and/or modified under the terms of the 16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software 17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the 18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file. 19** packaging of this file.
20** 20**
21** Licensees holding valid Qt Enterprise Edition licenses may use this 21** Licensees holding valid Qt Enterprise Edition licenses may use this
22** file in accordance with the Qt Commercial License Agreement provided 22** file in accordance with the Qt Commercial License Agreement provided
23** with the Software. 23** with the Software.
24** 24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27** 27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements. 29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information. 30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information. 31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#include "pbuilder_pbx.h" 38#include "pbuilder_pbx.h"
39#include "option.h" 39#include "option.h"
40#include <qdir.h> 40#include <qdir.h>
41#include <qdict.h> 41#include <qdict.h>
42#include <qregexp.h> 42#include <qregexp.h>
43#include <stdlib.h> 43#include <stdlib.h>
44#include <time.h> 44#include <time.h>
45#ifdef Q_OS_UNIX 45#ifdef Q_OS_UNIX
46# include <sys/types.h> 46# include <sys/types.h>
47# include <sys/stat.h> 47# include <sys/stat.h>
48#endif 48#endif
49 49
50// Note: this is fairly hacky, but it does the job... 50// Note: this is fairly hacky, but it does the job...
51 51
52 52
53ProjectBuilderMakefileGenerator::ProjectBuilderMakefileGenerator(QMakeProject *p) : UnixMakefileGenerator(p) 53ProjectBuilderMakefileGenerator::ProjectBuilderMakefileGenerator(QMakeProject *p) : UnixMakefileGenerator(p)
54{ 54{
55 55
56} 56}
57 57
58bool 58bool
59ProjectBuilderMakefileGenerator::writeMakefile(QTextStream &t) 59ProjectBuilderMakefileGenerator::writeMakefile(QTextStream &t)
60{ 60{
61 if(!project->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) { 61 if(!project->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) {
62 /* for now just dump, I need to generated an empty xml or something.. */ 62 /* for now just dump, I need to generated an empty xml or something.. */
63 fprintf(stderr, "Project file not generated because all requirements not met:\n\t%s\n", 63 fprintf(stderr, "Project file not generated because all requirements not met:\n\t%s\n",
64 var("QMAKE_FAILED_REQUIREMENTS").latin1()); 64 var("QMAKE_FAILED_REQUIREMENTS").latin1());
65 return TRUE; 65 return TRUE;
66 } 66 }
67 67
68 project->variables()["MAKEFILE"].clear(); 68 project->variables()["MAKEFILE"].clear();
69 project->variables()["MAKEFILE"].append("Makefile"); 69 project->variables()["MAKEFILE"].append("Makefile");
70 if(project->first("TEMPLATE") == "app" || project->first("TEMPLATE") == "lib") { 70 if(project->first("TEMPLATE") == "app" || project->first("TEMPLATE") == "lib") {
71 return writeMakeParts(t); 71 return writeMakeParts(t);
72 } else if(project->first("TEMPLATE") == "subdirs") { 72 } else if(project->first("TEMPLATE") == "subdirs") {
73 writeSubdirs(t, FALSE); 73 writeSubdirs(t, FALSE);
74 return TRUE; 74 return TRUE;
75 } 75 }
76 return FALSE; 76 return FALSE;
77} 77}
78 78
79bool 79bool
80ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) 80ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
81{ 81{
82 int i; 82 int i;
83 QStringList tmp; 83 QStringList tmp;
84 bool did_preprocess = FALSE; 84 bool did_preprocess = FALSE;
85 85
86 //HEADER 86 //HEADER
87 t << "// !$*UTF8*$!" << "\n" 87 t << "// !$*UTF8*$!" << "\n"
88 << "{" << "\n" 88 << "{" << "\n"
89 << "\t" << "archiveVersion = 1;" << "\n" 89 << "\t" << "archiveVersion = 1;" << "\n"
90 << "\t" << "classes = {" << "\n" << "\t" << "};" << "\n" 90 << "\t" << "classes = {" << "\n" << "\t" << "};" << "\n"
91 << "\t" << "objectVersion = " << pbuilderVersion() << ";" << "\n" 91 << "\t" << "objectVersion = " << pbuilderVersion() << ";" << "\n"
92 << "\t" << "objects = {" << endl; 92 << "\t" << "objects = {" << endl;
93 93
94 //MAKE QMAKE equivlant 94 //MAKE QMAKE equivlant
95 if(!project->isActiveConfig("no_autoqmake") && project->projectFile() != "(stdin)") { 95 if(!project->isActiveConfig("no_autoqmake") && project->projectFile() != "(stdin)") {
96 QString mkfile = pbx_dir + Option::dir_sep + "qt_makeqmake.mak"; 96 QString mkfile = pbx_dir + Option::dir_sep + "qt_makeqmake.mak";
97 QFile mkf(mkfile); 97 QFile mkf(mkfile);
98 if(mkf.open(IO_WriteOnly | IO_Translate)) { 98 if(mkf.open(IO_WriteOnly | IO_Translate)) {
99 debug_msg(1, "pbuilder: Creating file: %s", mkfile.latin1()); 99 debug_msg(1, "pbuilder: Creating file: %s", mkfile.latin1());
100 QTextStream mkt(&mkf); 100 QTextStream mkt(&mkf);
101 writeHeader(mkt); 101 writeHeader(mkt);
102 mkt << "QMAKE = "<< 102 mkt << "QMAKE = "<<
103 (project->isEmpty("QMAKE_QMAKE") ? QString("$(QTDIR)/bin/qmake") : 103 (project->isEmpty("QMAKE_QMAKE") ? QString("$(QTDIR)/bin/qmake") :
104 var("QMAKE_QMAKE")) << endl; 104 var("QMAKE_QMAKE")) << endl;
105 writeMakeQmake(mkt); 105 writeMakeQmake(mkt);
106 mkf.close(); 106 mkf.close();
107 } 107 }
108 QString phase_key = keyFor("QMAKE_PBX_MAKEQMAKE_BUILDPHASE"); 108 QString phase_key = keyFor("QMAKE_PBX_MAKEQMAKE_BUILDPHASE");
109 mkfile = fileFixify(mkfile, QDir::currentDirPath()); 109 mkfile = fileFixify(mkfile, QDir::currentDirPath());
110 project->variables()["QMAKE_PBX_BUILDPHASES"].append(phase_key); 110 project->variables()["QMAKE_PBX_BUILDPHASES"].append(phase_key);
111 t << "\t\t" << phase_key << " = {" << "\n" 111 t << "\t\t" << phase_key << " = {" << "\n"
112 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n" 112 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n"
113 << "\t\t\t" << "files = (" << "\n" 113 << "\t\t\t" << "files = (" << "\n"
114 << "\t\t\t" << ");" << "\n" 114 << "\t\t\t" << ");" << "\n"
115 << "\t\t\t" << "generatedFileNames = (" << "\n" 115 << "\t\t\t" << "generatedFileNames = (" << "\n"
116 << "\t\t\t" << ");" << "\n" 116 << "\t\t\t" << ");" << "\n"
117 << "\t\t\t" << "isa = PBXShellScriptBuildPhase;" << "\n" 117 << "\t\t\t" << "isa = PBXShellScriptBuildPhase;" << "\n"
118 << "\t\t\t" << "name = \"Qt Qmake\";" << "\n" 118 << "\t\t\t" << "name = \"Qt Qmake\";" << "\n"
119 << "\t\t\t" << "neededFileNames = (" << "\n" 119 << "\t\t\t" << "neededFileNames = (" << "\n"
120 << "\t\t\t" << ");" << "\n" 120 << "\t\t\t" << ");" << "\n"
121 << "\t\t\t" << "shellPath = /bin/sh;" << "\n" 121 << "\t\t\t" << "shellPath = /bin/sh;" << "\n"
122 << "\t\t\t" << "shellScript = \"make -C " << QDir::currentDirPath() << 122 << "\t\t\t" << "shellScript = \"make -C " << QDir::currentDirPath() <<
123 " -f " << mkfile << "\";" << "\n" 123 " -f " << mkfile << "\";" << "\n"
124 << "\t\t" << "};" << "\n"; 124 << "\t\t" << "};" << "\n";
125 } 125 }
126 126
127 //DUMP SOURCES 127 //DUMP SOURCES
128 QMap<QString, QStringList> groups; 128 QMap<QString, QStringList> groups;
129 QString srcs[] = { "SOURCES", "SRCMOC", "UICIMPLS", QString::null }; 129 QString srcs[] = { "SOURCES", "SRCMOC", "UICIMPLS", QString::null };
130 for(i = 0; !srcs[i].isNull(); i++) { 130 for(i = 0; !srcs[i].isNull(); i++) {
131 tmp = project->variables()[srcs[i]]; 131 tmp = project->variables()[srcs[i]];
132 QStringList &src_list = project->variables()["QMAKE_PBX_" + srcs[i]]; 132 QStringList &src_list = project->variables()["QMAKE_PBX_" + srcs[i]];
133 for(QStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it) { 133 for(QStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it) {
134 QString file = fileFixify((*it)); 134 QString file = fileFixify((*it));
135 if(file.endsWith(Option::moc_ext)) 135 if(file.endsWith(Option::moc_ext))
136 continue; 136 continue;
137 bool in_root = TRUE; 137 bool in_root = TRUE;
138 QString src_key = keyFor(file); 138 QString src_key = keyFor(file);
139 if(!project->isActiveConfig("flat")) { 139 if(!project->isActiveConfig("flat")) {
140 QString flat_file = fileFixify(file, QDir::currentDirPath(), Option::output_dir, TRUE); 140 QString flat_file = fileFixify(file, QDir::currentDirPath(), Option::output_dir, TRUE);
141 if(QDir::isRelativePath(flat_file) && flat_file.find(Option::dir_sep) != -1) { 141 if(QDir::isRelativePath(flat_file) && flat_file.find(Option::dir_sep) != -1) {
142 QString last_grp("QMAKE_PBX_" + srcs[i] + "_HEIR_GROUP"); 142 QString last_grp("QMAKE_PBX_" + srcs[i] + "_HEIR_GROUP");
143 QStringList dirs = QStringList::split(Option::dir_sep, flat_file); 143 QStringList dirs = QStringList::split(Option::dir_sep, flat_file);
144 dirs.pop_back(); //remove the file portion as it will be added via src_key 144 dirs.pop_back(); //remove the file portion as it will be added via src_key
145 for(QStringList::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) { 145 for(QStringList::Iterator dir_it = dirs.begin(); dir_it != dirs.end(); ++dir_it) {
146 QString new_grp(last_grp + Option::dir_sep + (*dir_it)), 146 QString new_grp(last_grp + Option::dir_sep + (*dir_it)),
147 new_grp_key(keyFor(new_grp)), last_grp_key(keyFor(last_grp)); 147 new_grp_key(keyFor(new_grp)), last_grp_key(keyFor(last_grp));
148 if(dir_it == dirs.begin()) { 148 if(dir_it == dirs.begin()) {
149 if(!groups.contains(new_grp)) 149 if(!groups.contains(new_grp))
150 project->variables()["QMAKE_PBX_" + srcs[i]].append(new_grp_key); 150 project->variables()["QMAKE_PBX_" + srcs[i]].append(new_grp_key);
151 } else { 151 } else {
152 groups[last_grp] += new_grp_key; 152 groups[last_grp] += new_grp_key;
153 } 153 }
154 last_grp = new_grp; 154 last_grp = new_grp;
155 } 155 }
156 groups[last_grp] += src_key; 156 groups[last_grp] += src_key;
157 in_root = FALSE; 157 in_root = FALSE;
158 } 158 }
159 } 159 }
160 if(in_root) 160 if(in_root)
161 src_list.append(src_key); 161 src_list.append(src_key);
162 //source reference 162 //source reference
163 t << "\t\t" << src_key << " = {" << "\n" 163 t << "\t\t" << src_key << " = {" << "\n"
164 << "\t\t\t" << "isa = PBXFileReference;" << "\n" 164 << "\t\t\t" << "isa = PBXFileReference;" << "\n"
165 << "\t\t\t" << "path = \"" << file << "\";" << "\n" 165 << "\t\t\t" << "path = \"" << file << "\";" << "\n"
166 << "\t\t\t" << "refType = " << reftypeForFile(file) << ";" << "\n" 166 << "\t\t\t" << "refType = " << reftypeForFile(file) << ";" << "\n"
167 << "\t\t" << "};" << "\n"; 167 << "\t\t" << "};" << "\n";
168 //build reference 168 //build reference
169 QString obj_key = file + ".o"; 169 QString obj_key = file + ".o";
170 obj_key = keyFor(obj_key); 170 obj_key = keyFor(obj_key);
171 t << "\t\t" << obj_key << " = {" << "\n" 171 t << "\t\t" << obj_key << " = {" << "\n"
172 << "\t\t\t" << "fileRef = " << src_key << ";" << "\n" 172 << "\t\t\t" << "fileRef = " << src_key << ";" << "\n"
173 << "\t\t\t" << "isa = PBXBuildFile;" << "\n" 173 << "\t\t\t" << "isa = PBXBuildFile;" << "\n"
174 << "\t\t\t" << "settings = {" << "\n" 174 << "\t\t\t" << "settings = {" << "\n"
175 << "\t\t\t\t" << "ATTRIBUTES = (" << "\n" 175 << "\t\t\t\t" << "ATTRIBUTES = (" << "\n"
176 << "\t\t\t\t" << ");" << "\n" 176 << "\t\t\t\t" << ");" << "\n"
177 << "\t\t\t" << "};" << "\n" 177 << "\t\t\t" << "};" << "\n"
178 << "\t\t" << "};" << "\n"; 178 << "\t\t" << "};" << "\n";
179 project->variables()["QMAKE_PBX_OBJ"].append(obj_key); 179 project->variables()["QMAKE_PBX_OBJ"].append(obj_key);
180 } 180 }
181 if(!src_list.isEmpty()) { 181 if(!src_list.isEmpty()) {
182 QString grp; 182 QString grp;
183 if(srcs[i] == "SOURCES") { 183 if(srcs[i] == "SOURCES") {
184 if(project->first("TEMPLATE") == "app" && !project->isEmpty("RC_FILE")) { //Icon 184 if(project->first("TEMPLATE") == "app" && !project->isEmpty("RC_FILE")) { //Icon
185 QString icns_file = keyFor("ICNS_FILE"); 185 QString icns_file = keyFor("ICNS_FILE");
186 src_list.append(icns_file); 186 src_list.append(icns_file);
187 t << "\t\t" << icns_file << " = {" << "\n" 187 t << "\t\t" << icns_file << " = {" << "\n"
188 << "\t\t\t" << "isa = PBXFileReference;" << "\n" 188 << "\t\t\t" << "isa = PBXFileReference;" << "\n"
189 << "\t\t\t" << "path = \"" << project->first("RC_FILE") << "\";" << "\n" 189 << "\t\t\t" << "path = \"" << project->first("RC_FILE") << "\";" << "\n"
190 << "\t\t\t" << "refType = " << reftypeForFile(project->first("RC_FILE")) << ";" << "\n" 190 << "\t\t\t" << "refType = " << reftypeForFile(project->first("RC_FILE")) << ";" << "\n"
191 << "\t\t" << "};" << "\n"; 191 << "\t\t" << "};" << "\n";
192 t << "\t\t" << keyFor("ICNS_FILE_REFERENCE") << " = {" << "\n" 192 t << "\t\t" << keyFor("ICNS_FILE_REFERENCE") << " = {" << "\n"
193 << "\t\t\t" << "fileRef = " << icns_file << ";" << "\n" 193 << "\t\t\t" << "fileRef = " << icns_file << ";" << "\n"
194 << "\t\t\t" << "isa = PBXBuildFile;" << "\n" 194 << "\t\t\t" << "isa = PBXBuildFile;" << "\n"
195 << "\t\t\t" << "settings = {" << "\n" 195 << "\t\t\t" << "settings = {" << "\n"
196 << "\t\t\t" << "};" << "\n" 196 << "\t\t\t" << "};" << "\n"
197 << "\t\t" << "};" << "\n"; 197 << "\t\t" << "};" << "\n";
198 } 198 }
199 grp = "Sources"; 199 grp = "Sources";
200 } else if(srcs[i] == "SRCMOC") { 200 } else if(srcs[i] == "SRCMOC") {
201 grp = "Mocables"; 201 grp = "Mocables";
202 } else if(srcs[i] == "UICIMPLS") { 202 } else if(srcs[i] == "UICIMPLS") {
203 grp = "UICables"; 203 grp = "UICables";
204 } 204 }
205 QString grp_key = keyFor(grp); 205 QString grp_key = keyFor(grp);
206 project->variables()["QMAKE_PBX_GROUPS"].append(grp_key); 206 project->variables()["QMAKE_PBX_GROUPS"].append(grp_key);
207 t << "\t\t" << grp_key << " = {" << "\n" 207 t << "\t\t" << grp_key << " = {" << "\n"
208 << "\t\t\t" << "children = (" << "\n" 208 << "\t\t\t" << "children = (" << "\n"
209 << varGlue("QMAKE_PBX_" + srcs[i], "\t\t\t\t", ",\n\t\t\t\t", "\n") 209 << varGlue("QMAKE_PBX_" + srcs[i], "\t\t\t\t", ",\n\t\t\t\t", "\n")
210 << "\t\t\t" << ");" << "\n" 210 << "\t\t\t" << ");" << "\n"
211 << "\t\t\t" << "isa = PBXGroup;" << "\n" 211 << "\t\t\t" << "isa = PBXGroup;" << "\n"
212 << "\t\t\t" << "name = " << grp << ";" << "\n" 212 << "\t\t\t" << "name = " << grp << ";" << "\n"
213 << "\t\t\t" << "refType = 4;" << "\n" 213 << "\t\t\t" << "refType = 4;" << "\n"
214 << "\t\t" << "};" << "\n"; 214 << "\t\t" << "};" << "\n";
215 } 215 }
216 } 216 }
217 for(QMap<QString, QStringList>::Iterator grp_it = groups.begin(); 217 for(QMap<QString, QStringList>::Iterator grp_it = groups.begin();
218 grp_it != groups.end(); ++grp_it) { 218 grp_it != groups.end(); ++grp_it) {
219 t << "\t\t" << keyFor(grp_it.key()) << " = {" << "\n" 219 t << "\t\t" << keyFor(grp_it.key()) << " = {" << "\n"
220 << "\t\t\t" << "isa = PBXGroup;" << "\n" 220 << "\t\t\t" << "isa = PBXGroup;" << "\n"
221 << "\t\t\t" << "children = (" << "\n" 221 << "\t\t\t" << "children = (" << "\n"
222 << valGlue(grp_it.data(), "\t\t\t\t", ",\n\t\t\t\t", "\n") 222 << valGlue(grp_it.data(), "\t\t\t\t", ",\n\t\t\t\t", "\n")
223 << "\t\t\t" << ");" << "\n" 223 << "\t\t\t" << ");" << "\n"
224 << "\t\t\t" << "name = \"" << grp_it.key().section(Option::dir_sep, -1) << "\";" << "\n" 224 << "\t\t\t" << "name = \"" << grp_it.key().section(Option::dir_sep, -1) << "\";" << "\n"
225 << "\t\t\t" << "refType = 4;" << "\n" 225 << "\t\t\t" << "refType = 4;" << "\n"
226 << "\t\t" << "};" << "\n"; 226 << "\t\t" << "};" << "\n";
227 } 227 }
228 228
229 //PREPROCESS BUILDPHASE (just a makefile) 229 //PREPROCESS BUILDPHASE (just a makefile)
230 if(!project->isEmpty("UICIMPLS") || !project->isEmpty("SRCMOC") || 230 if(!project->isEmpty("UICIMPLS") || !project->isEmpty("SRCMOC") ||
231 !project->isEmpty("YACCSOURCES") || !project->isEmpty("LEXSOURCES")) { 231 !project->isEmpty("YACCSOURCES") || !project->isEmpty("LEXSOURCES")) {
232 QString mkfile = pbx_dir + Option::dir_sep + "qt_preprocess.mak"; 232 QString mkfile = pbx_dir + Option::dir_sep + "qt_preprocess.mak";
233 QFile mkf(mkfile); 233 QFile mkf(mkfile);
234 if(mkf.open(IO_WriteOnly | IO_Translate)) { 234 if(mkf.open(IO_WriteOnly | IO_Translate)) {
235 did_preprocess = TRUE; 235 did_preprocess = TRUE;
236 debug_msg(1, "pbuilder: Creating file: %s", mkfile.latin1()); 236 debug_msg(1, "pbuilder: Creating file: %s", mkfile.latin1());
237 QTextStream mkt(&mkf); 237 QTextStream mkt(&mkf);
238 writeHeader(mkt); 238 writeHeader(mkt);
239 mkt << "MOC = " << var("QMAKE_MOC") << endl; 239 mkt << "MOC = " << var("QMAKE_MOC") << endl;
240 mkt << "UIC = " << var("QMAKE_UIC") << endl; 240 mkt << "UIC = " << var("QMAKE_UIC") << endl;
241 mkt << "LEX = " << var("QMAKE_LEX") << endl; 241 mkt << "LEX = " << var("QMAKE_LEX") << endl;
242 mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << endl; 242 mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << endl;
243 mkt << "YACC = " << var("QMAKE_YACC") << endl; 243 mkt << "YACC = " << var("QMAKE_YACC") << endl;
244 mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << endl; 244 mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << endl;
245 mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; 245 mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
246 mkt << "MOVE = " << var("QMAKE_MOVE") << endl << endl; 246 mkt << "MOVE = " << var("QMAKE_MOVE") << endl << endl;
247 mkt << "FORMS = " << varList("UICIMPLS") << endl; 247 mkt << "FORMS = " << varList("UICIMPLS") << endl;
248 mkt << "MOCS = " << varList("SRCMOC") << endl; 248 mkt << "MOCS = " << varList("SRCMOC") << endl;
249 mkt << "PARSERS ="; 249 mkt << "PARSERS =";
250 if(!project->isEmpty("YACCSOURCES")) { 250 if(!project->isEmpty("YACCSOURCES")) {
251 QStringList &yaccs = project->variables()["YACCSOURCES"]; 251 QStringList &yaccs = project->variables()["YACCSOURCES"];
252 for(QStringList::Iterator yit = yaccs.begin(); yit != yaccs.end(); ++yit) { 252 for(QStringList::Iterator yit = yaccs.begin(); yit != yaccs.end(); ++yit) {
253 QFileInfo fi((*yit)); 253 QFileInfo fi((*yit));
254 mkt << " " << fi.dirPath() << Option::dir_sep << fi.baseName(TRUE) 254 mkt << " " << fi.dirPath() << Option::dir_sep << fi.baseName(TRUE)
255 << Option::yacc_mod << Option::cpp_ext.first(); 255 << Option::yacc_mod << Option::cpp_ext.first();
256 } 256 }
257 } 257 }
258 if(!project->isEmpty("LEXSOURCES")) { 258 if(!project->isEmpty("LEXSOURCES")) {
259 QStringList &lexs = project->variables()["LEXSOURCES"]; 259 QStringList &lexs = project->variables()["LEXSOURCES"];
260 for(QStringList::Iterator lit = lexs.begin(); lit != lexs.end(); ++lit) { 260 for(QStringList::Iterator lit = lexs.begin(); lit != lexs.end(); ++lit) {
261 QFileInfo fi((*lit)); 261 QFileInfo fi((*lit));
262 mkt << " " << fi.dirPath() << Option::dir_sep << fi.baseName(TRUE) 262 mkt << " " << fi.dirPath() << Option::dir_sep << fi.baseName(TRUE)
263 << Option::lex_mod << Option::cpp_ext.first(); 263 << Option::lex_mod << Option::cpp_ext.first();
264 } 264 }
265 } 265 }
266 mkt << "\n"; 266 mkt << "\n";
267 mkt << "preprocess: $(FORMS) $(MOCS) $(PARSERS)" << endl; 267 mkt << "preprocess: $(FORMS) $(MOCS) $(PARSERS)" << endl;
268 mkt << "preprocess_clean: mocclean uiclean parser_clean" << endl << endl; 268 mkt << "preprocess_clean: mocclean uiclean parser_clean" << endl << endl;
269 mkt << "mocclean:" << "\n"; 269 mkt << "mocclean:" << "\n";
270 if(!project->isEmpty("SRCMOC")) 270 if(!project->isEmpty("SRCMOC"))
271 mkt << "\t-rm -f $(MOCS)" << "\n"; 271 mkt << "\t-rm -f $(MOCS)" << "\n";
272 mkt << "uiclean:" << "\n"; 272 mkt << "uiclean:" << "\n";
273 if(!project->isEmpty("UICIMPLS")) 273 if(!project->isEmpty("UICIMPLS"))
274 mkt << "\t-rm -f $(FORMS)" << "\n"; 274 mkt << "\t-rm -f $(FORMS)" << "\n";
275 mkt << "parser_clean:" << "\n"; 275 mkt << "parser_clean:" << "\n";
276 if(!project->isEmpty("YACCSOURCES") || !project->isEmpty("LEXSOURCES")) 276 if(!project->isEmpty("YACCSOURCES") || !project->isEmpty("LEXSOURCES"))
277 mkt << "\t-rm -f $(PARSERS)" << "\n"; 277 mkt << "\t-rm -f $(PARSERS)" << "\n";
278 writeUicSrc(mkt, "FORMS"); 278 writeUicSrc(mkt, "FORMS");
279 writeMocSrc(mkt, "HEADERS"); 279 writeMocSrc(mkt, "HEADERS");
280 writeMocSrc(mkt, "SOURCES"); 280 writeMocSrc(mkt, "SOURCES");
281 writeMocSrc(mkt, "UICDECLS"); 281 writeMocSrc(mkt, "UICDECLS");
282 writeYaccSrc(mkt, "YACCSOURCES"); 282 writeYaccSrc(mkt, "YACCSOURCES");
283 writeLexSrc(mkt, "LEXSOURCES"); 283 writeLexSrc(mkt, "LEXSOURCES");
284 mkf.close(); 284 mkf.close();
285 } 285 }
286 QString target_key = keyFor("QMAKE_PBX_PREPROCESS_TARGET"); 286 QString target_key = keyFor("QMAKE_PBX_PREPROCESS_TARGET");
287 mkfile = fileFixify(mkfile, QDir::currentDirPath()); 287 mkfile = fileFixify(mkfile, QDir::currentDirPath());
288 t << "\t\t" << target_key << " = {" << "\n" 288 t << "\t\t" << target_key << " = {" << "\n"
289 << "\t\t\t" << "buildArgumentsString = \"-f " << mkfile << "\";" << "\n" 289 << "\t\t\t" << "buildArgumentsString = \"-f " << mkfile << "\";" << "\n"
290 << "\t\t\t" << "buildPhases = (" << "\n" 290 << "\t\t\t" << "buildPhases = (" << "\n"
291 << "\t\t\t" << ");" << "\n" 291 << "\t\t\t" << ");" << "\n"
292 << "\t\t\t" << "buildSettings = {" << "\n" 292 << "\t\t\t" << "buildSettings = {" << "\n"
293 << "\t\t\t" << "};" << "\n" 293 << "\t\t\t" << "};" << "\n"
294 << "\t\t\t" << "buildToolPath = \"/usr/bin/gnumake\";"<< "\n" 294 << "\t\t\t" << "buildToolPath = \"/usr/bin/gnumake\";"<< "\n"
295 << "\t\t\t" << "buildWorkingDirectory = \"" << QDir::currentDirPath() << "\";" << "\n" 295 << "\t\t\t" << "buildWorkingDirectory = \"" << QDir::currentDirPath() << "\";" << "\n"
296 << "\t\t\t" << "dependencies = (" << "\n" 296 << "\t\t\t" << "dependencies = (" << "\n"
297 << "\t\t\t" << ");" << "\n" 297 << "\t\t\t" << ");" << "\n"
298 << "\t\t\t" << "isa = PBXLegacyTarget;" << "\n" 298 << "\t\t\t" << "isa = PBXLegacyTarget;" << "\n"
299 << "\t\t\t" << "name = QtPreprocessors;" << "\n" 299 << "\t\t\t" << "name = QtPreprocessors;" << "\n"
300 << "\t\t\t" << "productName = QtPreprocessors;" << "\n" 300 << "\t\t\t" << "productName = QtPreprocessors;" << "\n"
301 << "\t\t\t" << "settingsToExpand = 6;" << "\n" 301 << "\t\t\t" << "settingsToExpand = 6;" << "\n"
302 << "\t\t\t" << "settingsToPassInEnvironment = 287;" << "\n" 302 << "\t\t\t" << "settingsToPassInEnvironment = 287;" << "\n"
303 << "\t\t\t" << "settingsToPassOnCommandLine = 280;" << "\n" 303 << "\t\t\t" << "settingsToPassOnCommandLine = 280;" << "\n"
304 << "\t\t\t" << "shouldsUseHeadermap = 0;" << "\n" 304 << "\t\t\t" << "shouldsUseHeadermap = 0;" << "\n"
305 << "\t\t" << "};" << "\n"; 305 << "\t\t" << "};" << "\n";
306 306
307 QString target_depend_key = keyFor("QMAKE_PBX_PREPROCESS_TARGET_DEPEND"); 307 QString target_depend_key = keyFor("QMAKE_PBX_PREPROCESS_TARGET_DEPEND");
308 project->variables()["QMAKE_PBX_TARGETDEPENDS"].append(target_depend_key); 308 project->variables()["QMAKE_PBX_TARGETDEPENDS"].append(target_depend_key);
309 t << "\t\t" << target_depend_key << " = {" << "\n" 309 t << "\t\t" << target_depend_key << " = {" << "\n"
310 << "\t\t\t" << "isa = PBXTargetDependency;" << "\n" 310 << "\t\t\t" << "isa = PBXTargetDependency;" << "\n"
311 << "\t\t\t" << "target = " << target_key << ";" << "\n" 311 << "\t\t\t" << "target = " << target_key << ";" << "\n"
312 << "\t\t" << "};" << "\n"; 312 << "\t\t" << "};" << "\n";
313 } 313 }
314 //SOURCE BUILDPHASE 314 //SOURCE BUILDPHASE
315 if(!project->isEmpty("QMAKE_PBX_OBJ")) { 315 if(!project->isEmpty("QMAKE_PBX_OBJ")) {
316 QString grp = "Build Sources", key = keyFor(grp); 316 QString grp = "Build Sources", key = keyFor(grp);
317 project->variables()["QMAKE_PBX_BUILDPHASES"].append(key); 317 project->variables()["QMAKE_PBX_BUILDPHASES"].append(key);
318 t << "\t\t" << key << " = {" << "\n" 318 t << "\t\t" << key << " = {" << "\n"
319 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n" 319 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n"
320 << "\t\t\t" << "files = (" << "\n" 320 << "\t\t\t" << "files = (" << "\n"
321 << varGlue("QMAKE_PBX_OBJ", "\t\t\t\t", ",\n\t\t\t\t", "\n") 321 << varGlue("QMAKE_PBX_OBJ", "\t\t\t\t", ",\n\t\t\t\t", "\n")
322 << "\t\t\t" << ");" << "\n" 322 << "\t\t\t" << ");" << "\n"
323 << "\t\t\t" << "isa = PBXSourcesBuildPhase;" << "\n" 323 << "\t\t\t" << "isa = PBXSourcesBuildPhase;" << "\n"
324 << "\t\t\t" << "name = \"" << grp << "\";" << "\n" 324 << "\t\t\t" << "name = \"" << grp << "\";" << "\n"
325 << "\t\t" << "};" << "\n"; 325 << "\t\t" << "};" << "\n";
326 } 326 }
327 327
328 if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES 328 if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES
329 QStringList &libdirs = project->variables()["QMAKE_PBX_LIBPATHS"]; 329 QStringList &libdirs = project->variables()["QMAKE_PBX_LIBPATHS"];
330 QString libs[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_LIBS", QString::null }; 330 QString libs[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_LIBS", QString::null };
331 for(i = 0; !libs[i].isNull(); i++) { 331 for(i = 0; !libs[i].isNull(); i++) {
332 tmp = project->variables()[libs[i]]; 332 tmp = project->variables()[libs[i]];
333 for(QStringList::Iterator it = tmp.begin(); it != tmp.end();) { 333 for(QStringList::Iterator it = tmp.begin(); it != tmp.end();) {
334 bool remove = FALSE; 334 bool remove = FALSE;
335 QString library, name, opt = (*it).stripWhiteSpace(); 335 QString library, name, opt = (*it).stripWhiteSpace();
336 if(opt.startsWith("-L")) { 336 if(opt.startsWith("-L")) {
337 QString r = opt.right(opt.length() - 2); 337 QString r = opt.right(opt.length() - 2);
338 fixEnvVariables(r); 338 fixEnvVariables(r);
339 libdirs.append(r); 339 libdirs.append(r);
340 } else if(opt.startsWith("-l")) { 340 } else if(opt.startsWith("-l")) {
341 name = opt.right(opt.length() - 2); 341 name = opt.right(opt.length() - 2);
342 QString lib("lib" + name); 342 QString lib("lib" + name);
343 for(QStringList::Iterator lit = libdirs.begin(); lit != libdirs.end(); ++lit) { 343 for(QStringList::Iterator lit = libdirs.begin(); lit != libdirs.end(); ++lit) {
344 if(project->isActiveConfig("link_prl")) { 344 if(project->isActiveConfig("link_prl")) {
345 /* This isn't real nice, but it is real usefull. This looks in a prl 345 /* This isn't real nice, but it is real useful. This looks in a prl
346 for what the library will ultimately be called so we can stick it 346 for what the library will ultimately be called so we can stick it
347 in the ProjectFile. If the prl format ever changes (not likely) then 347 in the ProjectFile. If the prl format ever changes (not likely) then
348 this will not really work. However, more concerning is that it will 348 this will not really work. However, more concerning is that it will
349 encode the version number in the Project file which might be a bad 349 encode the version number in the Project file which might be a bad
350 things in days to come? --Sam 350 things in days to come? --Sam
351 */ 351 */
352 QString prl_file = (*lit) + Option::dir_sep + lib + Option::prl_ext; 352 QString prl_file = (*lit) + Option::dir_sep + lib + Option::prl_ext;
353 if(QFile::exists(prl_file)) { 353 if(QFile::exists(prl_file)) {
354 QMakeProject proj; 354 QMakeProject proj;
355 if(proj.read(prl_file, QDir::currentDirPath())) { 355 if(proj.read(prl_file, QDir::currentDirPath())) {
356 if(!proj.isEmpty("QMAKE_PRL_TARGET")) { 356 if(!proj.isEmpty("QMAKE_PRL_TARGET")) {
357 library = (*lit) + Option::dir_sep + proj.first("QMAKE_PRL_TARGET"); 357 library = (*lit) + Option::dir_sep + proj.first("QMAKE_PRL_TARGET");
358 debug_msg(1, "pbuilder: Found library (%s) via PRL %s (%s)", 358 debug_msg(1, "pbuilder: Found library (%s) via PRL %s (%s)",
359 opt.latin1(), prl_file.latin1(), library.latin1()); 359 opt.latin1(), prl_file.latin1(), library.latin1());
360 remove = TRUE; 360 remove = TRUE;
361 } 361 }
362 } 362 }
363 363
364 } 364 }
365 } 365 }
366 if(!remove) { 366 if(!remove) {
367 QString extns[] = { ".dylib", ".so", ".a", QString::null }; 367 QString extns[] = { ".dylib", ".so", ".a", QString::null };
368 for(int n = 0; !remove && !extns[n].isNull(); n++) { 368 for(int n = 0; !remove && !extns[n].isNull(); n++) {
369 QString tmp = (*lit) + Option::dir_sep + lib + extns[n]; 369 QString tmp = (*lit) + Option::dir_sep + lib + extns[n];
370 if(QFile::exists(tmp)) { 370 if(QFile::exists(tmp)) {
371 library = tmp; 371 library = tmp;
372 debug_msg(1, "pbuilder: Found library (%s) via %s", 372 debug_msg(1, "pbuilder: Found library (%s) via %s",
373 opt.latin1(), library.latin1()); 373 opt.latin1(), library.latin1());
374 remove = TRUE; 374 remove = TRUE;
375 } 375 }
376 } 376 }
377 } 377 }
378 } 378 }
379 } else if(opt == "-framework") { 379 } else if(opt == "-framework") {
380 ++it; 380 ++it;
381 if(it == tmp.end()) 381 if(it == tmp.end())
382 break; 382 break;
383 QStringList &fdirs = project->variables()["QMAKE_FRAMEWORKDIR"]; 383 QStringList &fdirs = project->variables()["QMAKE_FRAMEWORKDIR"];
384 if(fdirs.isEmpty()) 384 if(fdirs.isEmpty())
385 fdirs.append("/System/Library/Frameworks/"); 385 fdirs.append("/System/Library/Frameworks/");
386 for(QStringList::Iterator fit = fdirs.begin(); fit != fdirs.end(); ++fit) { 386 for(QStringList::Iterator fit = fdirs.begin(); fit != fdirs.end(); ++fit) {
387 if(QFile::exists((*fit) + QDir::separator() + (*it) + ".framework")) { 387 if(QFile::exists((*fit) + QDir::separator() + (*it) + ".framework")) {
388 --it; 388 --it;
389 it = tmp.remove(it); 389 it = tmp.remove(it);
390 remove = TRUE; 390 remove = TRUE;
391 library = (*fit) + Option::dir_sep + (*it) + ".framework"; 391 library = (*fit) + Option::dir_sep + (*it) + ".framework";
392 break; 392 break;
393 } 393 }
394 } 394 }
395 } else if(opt.left(1) != "-") { 395 } else if(opt.left(1) != "-") {
396 remove = TRUE; 396 remove = TRUE;
397 library = opt; 397 library = opt;
398 } 398 }
399 if(!library.isEmpty()) { 399 if(!library.isEmpty()) {
400 if(name.isEmpty()) { 400 if(name.isEmpty()) {
401 int slsh = library.findRev(Option::dir_sep); 401 int slsh = library.findRev(Option::dir_sep);
402 if(slsh != -1) 402 if(slsh != -1)
403 name = library.right(library.length() - slsh - 1); 403 name = library.right(library.length() - slsh - 1);
404 } 404 }
405 library = fileFixify(library); 405 library = fileFixify(library);
406 QString key = keyFor(library); 406 QString key = keyFor(library);
407 bool is_frmwrk = (library.endsWith(".framework")); 407 bool is_frmwrk = (library.endsWith(".framework"));
408 t << "\t\t" << key << " = {" << "\n" 408 t << "\t\t" << key << " = {" << "\n"
409 << "\t\t\t" << "isa = " << (is_frmwrk ? "PBXFrameworkReference" : "PBXFileReference") << ";" << "\n" 409 << "\t\t\t" << "isa = " << (is_frmwrk ? "PBXFrameworkReference" : "PBXFileReference") << ";" << "\n"
410 << "\t\t\t" << "name = \"" << name << "\";" << "\n" 410 << "\t\t\t" << "name = \"" << name << "\";" << "\n"
411 << "\t\t\t" << "path = \"" << library << "\";" << "\n" 411 << "\t\t\t" << "path = \"" << library << "\";" << "\n"
412 << "\t\t\t" << "refType = " << reftypeForFile(library) << ";" << "\n" 412 << "\t\t\t" << "refType = " << reftypeForFile(library) << ";" << "\n"
413 << "\t\t" << "};" << "\n"; 413 << "\t\t" << "};" << "\n";
414 project->variables()["QMAKE_PBX_LIBRARIES"].append(key); 414 project->variables()["QMAKE_PBX_LIBRARIES"].append(key);
415 QString obj_key = library + ".o"; 415 QString obj_key = library + ".o";
416 obj_key = keyFor(obj_key); 416 obj_key = keyFor(obj_key);
417 t << "\t\t" << obj_key << " = {" << "\n" 417 t << "\t\t" << obj_key << " = {" << "\n"
418 << "\t\t\t" << "fileRef = " << key << ";" << "\n" 418 << "\t\t\t" << "fileRef = " << key << ";" << "\n"
419 << "\t\t\t" << "isa = PBXBuildFile;" << "\n" 419 << "\t\t\t" << "isa = PBXBuildFile;" << "\n"
420 << "\t\t\t" << "settings = {" << "\n" 420 << "\t\t\t" << "settings = {" << "\n"
421 << "\t\t\t" << "};" << "\n" 421 << "\t\t\t" << "};" << "\n"
422 << "\t\t" << "};" << "\n"; 422 << "\t\t" << "};" << "\n";
423 project->variables()["QMAKE_PBX_BUILD_LIBRARIES"].append(obj_key); 423 project->variables()["QMAKE_PBX_BUILD_LIBRARIES"].append(obj_key);
424 } 424 }
425 if(remove) 425 if(remove)
426 it = tmp.remove(it); 426 it = tmp.remove(it);
427 else 427 else
428 ++it; 428 ++it;
429 } 429 }
430 project->variables()[libs[i]] = tmp; 430 project->variables()[libs[i]] = tmp;
431 } 431 }
432 } 432 }
433 //SUBLIBS BUILDPHASE (just another makefile) 433 //SUBLIBS BUILDPHASE (just another makefile)
434 if(!project->isEmpty("SUBLIBS")) { 434 if(!project->isEmpty("SUBLIBS")) {
435 QString mkfile = pbx_dir + Option::dir_sep + "qt_sublibs.mak"; 435 QString mkfile = pbx_dir + Option::dir_sep + "qt_sublibs.mak";
436 QFile mkf(mkfile); 436 QFile mkf(mkfile);
437 if(mkf.open(IO_WriteOnly | IO_Translate)) { 437 if(mkf.open(IO_WriteOnly | IO_Translate)) {
438 debug_msg(1, "pbuilder: Creating file: %s", mkfile.latin1()); 438 debug_msg(1, "pbuilder: Creating file: %s", mkfile.latin1());
439 QTextStream mkt(&mkf); 439 QTextStream mkt(&mkf);
440 writeHeader(mkt); 440 writeHeader(mkt);
441 mkt << "SUBLIBS= "; 441 mkt << "SUBLIBS= ";
442 tmp = project->variables()["SUBLIBS"]; 442 tmp = project->variables()["SUBLIBS"];
443 QStringList::Iterator it; 443 QStringList::Iterator it;
444 for(it = tmp.begin(); it != tmp.end(); ++it) 444 for(it = tmp.begin(); it != tmp.end(); ++it)
445 t << "tmp/lib" << (*it) << ".a "; 445 t << "tmp/lib" << (*it) << ".a ";
446 t << endl << endl; 446 t << endl << endl;
447 mkt << "sublibs: $(SUBLIBS)" << endl << endl; 447 mkt << "sublibs: $(SUBLIBS)" << endl << endl;
448 tmp = project->variables()["SUBLIBS"]; 448 tmp = project->variables()["SUBLIBS"];
449 for(it = tmp.begin(); it != tmp.end(); ++it) 449 for(it = tmp.begin(); it != tmp.end(); ++it)
450 t << "tmp/lib" << (*it) << ".a" << ":\n\t" 450 t << "tmp/lib" << (*it) << ".a" << ":\n\t"
451 << var(QString("MAKELIB") + (*it)) << endl << endl; 451 << var(QString("MAKELIB") + (*it)) << endl << endl;
452 mkf.close(); 452 mkf.close();
453 } 453 }
454 QString phase_key = keyFor("QMAKE_PBX_SUBLIBS_BUILDPHASE"); 454 QString phase_key = keyFor("QMAKE_PBX_SUBLIBS_BUILDPHASE");
455 mkfile = fileFixify(mkfile, QDir::currentDirPath()); 455 mkfile = fileFixify(mkfile, QDir::currentDirPath());
456 project->variables()["QMAKE_PBX_BUILDPHASES"].append(phase_key); 456 project->variables()["QMAKE_PBX_BUILDPHASES"].append(phase_key);
457 t << "\t\t" << phase_key << " = {" << "\n" 457 t << "\t\t" << phase_key << " = {" << "\n"
458 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n" 458 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n"
459 << "\t\t\t" << "files = (" << "\n" 459 << "\t\t\t" << "files = (" << "\n"
460 << "\t\t\t" << ");" << "\n" 460 << "\t\t\t" << ");" << "\n"
461 << "\t\t\t" << "generatedFileNames = (" << "\n" 461 << "\t\t\t" << "generatedFileNames = (" << "\n"
462 << "\t\t\t" << ");" << "\n" 462 << "\t\t\t" << ");" << "\n"
463 << "\t\t\t" << "isa = PBXShellScriptBuildPhase;" << "\n" 463 << "\t\t\t" << "isa = PBXShellScriptBuildPhase;" << "\n"
464 << "\t\t\t" << "name = \"Qt Sublibs\";" << "\n" 464 << "\t\t\t" << "name = \"Qt Sublibs\";" << "\n"
465 << "\t\t\t" << "neededFileNames = (" << "\n" 465 << "\t\t\t" << "neededFileNames = (" << "\n"
466 << "\t\t\t" << ");" << "\n" 466 << "\t\t\t" << ");" << "\n"
467 << "\t\t\t" << "shellPath = /bin/sh;" << "\n" 467 << "\t\t\t" << "shellPath = /bin/sh;" << "\n"
468 << "\t\t\t" << "shellScript = \"make -C " << QDir::currentDirPath() << 468 << "\t\t\t" << "shellScript = \"make -C " << QDir::currentDirPath() <<
469 " -f " << mkfile << "\";" << "\n" 469 " -f " << mkfile << "\";" << "\n"
470 << "\t\t" << "};" << "\n"; 470 << "\t\t" << "};" << "\n";
471 } 471 }
472 //LIBRARY BUILDPHASE 472 //LIBRARY BUILDPHASE
473 if(!project->isEmpty("QMAKE_PBX_LIBRARIES")) { 473 if(!project->isEmpty("QMAKE_PBX_LIBRARIES")) {
474 tmp = project->variables()["QMAKE_PBX_LIBRARIES"]; 474 tmp = project->variables()["QMAKE_PBX_LIBRARIES"];
475 if(!tmp.isEmpty()) { 475 if(!tmp.isEmpty()) {
476 QString grp("External Frameworks and Libraries"), key = keyFor(grp); 476 QString grp("External Frameworks and Libraries"), key = keyFor(grp);
477 project->variables()["QMAKE_PBX_GROUPS"].append(key); 477 project->variables()["QMAKE_PBX_GROUPS"].append(key);
478 t << "\t\t" << key << " = {" << "\n" 478 t << "\t\t" << key << " = {" << "\n"
479 << "\t\t\t" << "children = (" << "\n" 479 << "\t\t\t" << "children = (" << "\n"
480 << varGlue("QMAKE_PBX_LIBRARIES", "\t\t\t\t", ",\n\t\t\t\t", "\n") 480 << varGlue("QMAKE_PBX_LIBRARIES", "\t\t\t\t", ",\n\t\t\t\t", "\n")
481 << "\t\t\t" << ");" << "\n" 481 << "\t\t\t" << ");" << "\n"
482 << "\t\t\t" << "isa = PBXGroup;" << "\n" 482 << "\t\t\t" << "isa = PBXGroup;" << "\n"
483 << "\t\t\t" << "name = \"" << grp << "\"" << ";" << "\n" 483 << "\t\t\t" << "name = \"" << grp << "\"" << ";" << "\n"
484 << "\t\t\t" << "path = \"\";" << "\n" 484 << "\t\t\t" << "path = \"\";" << "\n"
485 << "\t\t\t" << "refType = 4;" << "\n" 485 << "\t\t\t" << "refType = 4;" << "\n"
486 << "\t\t" << "};" << "\n"; 486 << "\t\t" << "};" << "\n";
487 } 487 }
488 } 488 }
489 { 489 {
490 QString grp("Frameworks & Libraries"), key = keyFor(grp); 490 QString grp("Frameworks & Libraries"), key = keyFor(grp);
491 project->variables()["QMAKE_PBX_BUILDPHASES"].append(key); 491 project->variables()["QMAKE_PBX_BUILDPHASES"].append(key);
492 t << "\t\t" << key << " = {" << "\n" 492 t << "\t\t" << key << " = {" << "\n"
493 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n" 493 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n"
494 << "\t\t\t" << "files = (" << "\n" 494 << "\t\t\t" << "files = (" << "\n"
495 << varGlue("QMAKE_PBX_BUILD_LIBRARIES", "\t\t\t\t", ",\n\t\t\t\t", "\n") 495 << varGlue("QMAKE_PBX_BUILD_LIBRARIES", "\t\t\t\t", ",\n\t\t\t\t", "\n")
496 << "\t\t\t" << ");" << "\n" 496 << "\t\t\t" << ");" << "\n"
497 << "\t\t\t" << "isa = PBXFrameworksBuildPhase;" << "\n" 497 << "\t\t\t" << "isa = PBXFrameworksBuildPhase;" << "\n"
498 << "\t\t\t" << "name = \"" << grp << "\";" << "\n" 498 << "\t\t\t" << "name = \"" << grp << "\";" << "\n"
499 << "\t\t" << "};" << "\n"; 499 << "\t\t" << "};" << "\n";
500 } 500 }
501 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console") && 501 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console") &&
502 project->first("TEMPLATE") == "app") { //BUNDLE RESOURCES 502 project->first("TEMPLATE") == "app") { //BUNDLE RESOURCES
503 QString grp("Bundle Resources"), key = keyFor(grp); 503 QString grp("Bundle Resources"), key = keyFor(grp);
504 project->variables()["QMAKE_PBX_BUILDPHASES"].append(key); 504 project->variables()["QMAKE_PBX_BUILDPHASES"].append(key);
505 t << "\t\t" << key << " = {" << "\n" 505 t << "\t\t" << key << " = {" << "\n"
506 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n" 506 << "\t\t\t" << "buildActionMask = 2147483647;" << "\n"
507 << "\t\t\t" << "files = (" << "\n" 507 << "\t\t\t" << "files = (" << "\n"
508 << (!project->isEmpty("RC_FILE") ? keyFor("ICNS_FILE_REFERENCE") : QString("")) 508 << (!project->isEmpty("RC_FILE") ? keyFor("ICNS_FILE_REFERENCE") : QString(""))
509 << "\t\t\t" << ");" << "\n" 509 << "\t\t\t" << ");" << "\n"
510 << "\t\t\t" << "isa = PBXResourcesBuildPhase;" << "\n" 510 << "\t\t\t" << "isa = PBXResourcesBuildPhase;" << "\n"
511 << "\t\t\t" << "name = \"" << grp << "\";" << "\n" 511 << "\t\t\t" << "name = \"" << grp << "\";" << "\n"
512 << "\t\t" << "};" << "\n"; 512 << "\t\t" << "};" << "\n";
513 } 513 }
514 514
515 //DUMP EVERYTHING THAT TIES THE ABOVE TOGETHER 515 //DUMP EVERYTHING THAT TIES THE ABOVE TOGETHER
516 //PRODUCTS 516 //PRODUCTS
517 { 517 {
518 QString grp("Products"), key = keyFor(grp); 518 QString grp("Products"), key = keyFor(grp);
519 project->variables()["QMAKE_PBX_GROUPS"].append(key); 519 project->variables()["QMAKE_PBX_GROUPS"].append(key);
520 t << "\t\t" << key << " = {" << "\n" 520 t << "\t\t" << key << " = {" << "\n"
521 << "\t\t\t" << "children = (" << "\n" 521 << "\t\t\t" << "children = (" << "\n"
522 << "\t\t\t\t" << keyFor("QMAKE_PBX_REFERENCE") << "\n" 522 << "\t\t\t\t" << keyFor("QMAKE_PBX_REFERENCE") << "\n"
523 << "\t\t\t" << ");" << "\n" 523 << "\t\t\t" << ");" << "\n"
524 << "\t\t\t" << "isa = PBXGroup;" << "\n" 524 << "\t\t\t" << "isa = PBXGroup;" << "\n"
525 << "\t\t\t" << "name = Products;" << "\n" 525 << "\t\t\t" << "name = Products;" << "\n"
526 << "\t\t\t" << "refType = 4;" << "\n" 526 << "\t\t\t" << "refType = 4;" << "\n"
527 << "\t\t" << "};" << "\n"; 527 << "\t\t" << "};" << "\n";
528 } 528 }
529 { //INSTALL BUILDPHASE (sh script) 529 { //INSTALL BUILDPHASE (sh script)
530 QString targ = project->first("TARGET"); 530 QString targ = project->first("TARGET");
531 if(project->first("TEMPLATE") == "app" || 531 if(project->first("TEMPLATE") == "app" ||
532 (project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") && 532 (project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") &&
533 project->isActiveConfig("frameworklib"))) 533 project->isActiveConfig("frameworklib")))
534 targ = project->first("QMAKE_ORIG_TARGET"); 534 targ = project->first("QMAKE_ORIG_TARGET");
535 int slsh = targ.findRev(Option::dir_sep); 535 int slsh = targ.findRev(Option::dir_sep);
536 if(slsh != -1) 536 if(slsh != -1)
537 targ = targ.right(targ.length() - slsh - 1); 537 targ = targ.right(targ.length() - slsh - 1);
538 fixEnvVariables(targ); 538 fixEnvVariables(targ);
539 QStringList links; 539 QStringList links;
540 if(project->first("TEMPLATE") == "app") { 540 if(project->first("TEMPLATE") == "app") {
541 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console")) 541 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console"))
542 targ += ".app"; 542 targ += ".app";
543 } else if(!project->isActiveConfig("staticlib") && 543 } else if(!project->isActiveConfig("staticlib") &&
544 !project->isActiveConfig("frameworklib")) { 544 !project->isActiveConfig("frameworklib")) {
545 QString li[] = { "TARGET_", "TARGET_x", "TARGET_x.y", QString::null }; 545 QString li[] = { "TARGET_", "TARGET_x", "TARGET_x.y", QString::null };
546 for(int n = 0; !li[n].isNull(); n++) { 546 for(int n = 0; !li[n].isNull(); n++) {
547 QString t = project->first(li[n]); 547 QString t = project->first(li[n]);
548 slsh = t.findRev(Option::dir_sep); 548 slsh = t.findRev(Option::dir_sep);
549 if(slsh != -1) 549 if(slsh != -1)
550 t = t.right(t.length() - slsh); 550 t = t.right(t.length() - slsh);
551 fixEnvVariables(t); 551 fixEnvVariables(t);
552 links << t; 552 links << t;
553 } 553 }
554 } 554 }
555 QString script = pbx_dir + Option::dir_sep + "qt_install.sh"; 555 QString script = pbx_dir + Option::dir_sep + "qt_install.sh";
556 QFile shf(script); 556 QFile shf(script);
557 if(shf.open(IO_WriteOnly | IO_Translate)) { 557 if(shf.open(IO_WriteOnly | IO_Translate)) {
558 debug_msg(1, "pbuilder: Creating file: %s", script.latin1()); 558 debug_msg(1, "pbuilder: Creating file: %s", script.latin1());
559 QString targ = project->first("QMAKE_ORIG_TARGET"), cpflags; 559 QString targ = project->first("QMAKE_ORIG_TARGET"), cpflags;
560 if(project->first("TEMPLATE") == "app") { 560 if(project->first("TEMPLATE") == "app") {
561 targ = project->first("TARGET"); 561 targ = project->first("TARGET");
562 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console")) { 562 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console")) {
563 targ += ".app"; 563 targ += ".app";
564 cpflags += "-r "; 564 cpflags += "-r ";
565 } 565 }
566 } else if(!project->isActiveConfig("frameworklib")) { 566 } else if(!project->isActiveConfig("frameworklib")) {
567 if(project->isActiveConfig("staticlib")) 567 if(project->isActiveConfig("staticlib"))
568 targ = project->first("TARGET"); 568 targ = project->first("TARGET");
569 else 569 else
570 targ = project->first("TARGET_"); 570 targ = project->first("TARGET_");
571 int slsh = targ.findRev(Option::dir_sep); 571 int slsh = targ.findRev(Option::dir_sep);
572 if(slsh != -1) 572 if(slsh != -1)
573 targ = targ.right(targ.length() - slsh - 1); 573 targ = targ.right(targ.length() - slsh - 1);
574 } 574 }
575 QTextStream sht(&shf); 575 QTextStream sht(&shf);
576 QString dstdir = project->first("DESTDIR"); 576 QString dstdir = project->first("DESTDIR");
577 fixEnvVariables(dstdir); 577 fixEnvVariables(dstdir);
578 578
579 sht << "#!/bin/sh" << endl; 579 sht << "#!/bin/sh" << endl;
580 //copy the actual target 580 //copy the actual target
581 sht << "OUT_TARG=\"" << targ << "\"\n" 581 sht << "OUT_TARG=\"" << targ << "\"\n"
582 << "[ -z \"$BUILD_ROOT\" ] || OUT_TARG=\"${BUILD_ROOT}/${OUT_TARG}\"" << endl; 582 << "[ -z \"$BUILD_ROOT\" ] || OUT_TARG=\"${BUILD_ROOT}/${OUT_TARG}\"" << endl;
583 sht << "[ \"$OUT_TARG\" = \"" 583 sht << "[ \"$OUT_TARG\" = \""
584 << (dstdir.isEmpty() ? QDir::currentDirPath() + QDir::separator(): dstdir) << targ << "\" ] || " 584 << (dstdir.isEmpty() ? QDir::currentDirPath() + QDir::separator(): dstdir) << targ << "\" ] || "
585 << "[ \"$OUT_TARG\" = \"" << targ << "\" ] || " 585 << "[ \"$OUT_TARG\" = \"" << targ << "\" ] || "
586 << "cp -r \"$OUT_TARG\" " << "\"" << dstdir << targ << "\"" << endl; 586 << "cp -r \"$OUT_TARG\" " << "\"" << dstdir << targ << "\"" << endl;
587 //rename as a framework 587 //rename as a framework
588 if(project->first("TEMPLATE") == "lib" && project->isActiveConfig("frameworklib")) 588 if(project->first("TEMPLATE") == "lib" && project->isActiveConfig("frameworklib"))
589 sht << "ln -sf \"" << targ << "\" " << "\"" << dstdir << targ << "\"" << endl; 589 sht << "ln -sf \"" << targ << "\" " << "\"" << dstdir << targ << "\"" << endl;
590 //create all the version symlinks (just to be like unixmake) 590 //create all the version symlinks (just to be like unixmake)
591 for(QStringList::Iterator it = links.begin(); it != links.end(); ++it) { 591 for(QStringList::Iterator it = links.begin(); it != links.end(); ++it) {
592 if(targ != (*it)) 592 if(targ != (*it))
593 sht << "ln -sf \"" << targ << "\" " << "\"" << dstdir << (*it) << "\"" << endl; 593 sht << "ln -sf \"" << targ << "\" " << "\"" << dstdir << (*it) << "\"" << endl;
594 } 594 }
595 shf.close(); 595 shf.close();
596#ifdef Q_OS_UNIX 596#ifdef Q_OS_UNIX
597 chmod(script.latin1(), S_IRWXU | S_IRWXG); 597 chmod(script.latin1(), S_IRWXU | S_IRWXG);
598#endif 598#endif
599 QString phase_key = keyFor("QMAKE_PBX_INSTALL_BUILDPHASE"); 599 QString phase_key = keyFor("QMAKE_PBX_INSTALL_BUILDPHASE");
600 script = fileFixify(script, QDir::currentDirPath()); 600 script = fileFixify(script, QDir::currentDirPath());
601 project->variables()["QMAKE_PBX_BUILDPHASES"].append(phase_key); 601 project->variables()["QMAKE_PBX_BUILDPHASES"].append(phase_key);
602 t << "\t\t" << phase_key << " = {" << "\n" 602 t << "\t\t" << phase_key << " = {" << "\n"
603 << "\t\t\t" << "buildActionMask = 8;" << "\n" //only on install! 603 << "\t\t\t" << "buildActionMask = 8;" << "\n" //only on install!
604 << "\t\t\t" << "files = (" << "\n" 604 << "\t\t\t" << "files = (" << "\n"
605 << "\t\t\t" << ");" << "\n" 605 << "\t\t\t" << ");" << "\n"
606 << "\t\t\t" << "generatedFileNames = (" << "\n" 606 << "\t\t\t" << "generatedFileNames = (" << "\n"
607 << "\t\t\t" << ");" << "\n" 607 << "\t\t\t" << ");" << "\n"
608 << "\t\t\t" << "isa = PBXShellScriptBuildPhase;" << "\n" 608 << "\t\t\t" << "isa = PBXShellScriptBuildPhase;" << "\n"
609 << "\t\t\t" << "name = \"Qt Install\";" << "\n" 609 << "\t\t\t" << "name = \"Qt Install\";" << "\n"
610 << "\t\t\t" << "neededFileNames = (" << "\n" 610 << "\t\t\t" << "neededFileNames = (" << "\n"
611 << "\t\t\t" << ");" << "\n" 611 << "\t\t\t" << ");" << "\n"
612 << "\t\t\t" << "shellPath = /bin/sh;" << "\n" 612 << "\t\t\t" << "shellPath = /bin/sh;" << "\n"
613 << "\t\t\t" << "shellScript = \"" << script << "\";" << "\n" 613 << "\t\t\t" << "shellScript = \"" << script << "\";" << "\n"
614 << "\t\t" << "};" << "\n"; 614 << "\t\t" << "};" << "\n";
615 } 615 }
616 } 616 }
617 //ROOT_GROUP 617 //ROOT_GROUP
618 t << "\t\t" << keyFor("QMAKE_PBX_ROOT_GROUP") << " = {" << "\n" 618 t << "\t\t" << keyFor("QMAKE_PBX_ROOT_GROUP") << " = {" << "\n"
619 << "\t\t\t" << "children = (" << "\n" 619 << "\t\t\t" << "children = (" << "\n"
620 << varGlue("QMAKE_PBX_GROUPS", "\t\t\t\t", ",\n\t\t\t\t", "\n") 620 << varGlue("QMAKE_PBX_GROUPS", "\t\t\t\t", ",\n\t\t\t\t", "\n")
621 << "\t\t\t" << ");" << "\n" 621 << "\t\t\t" << ");" << "\n"
622 << "\t\t\t" << "isa = PBXGroup;" << "\n" 622 << "\t\t\t" << "isa = PBXGroup;" << "\n"
623 << "\t\t\t" << "name = " << project->first("QMAKE_ORIG_TARGET") << ";" << "\n" 623 << "\t\t\t" << "name = " << project->first("QMAKE_ORIG_TARGET") << ";" << "\n"
624 << "\t\t\t" << "path = \"\";" << "\n" 624 << "\t\t\t" << "path = \"\";" << "\n"
625 << "\t\t\t" << "refType = 4;" << "\n" 625 << "\t\t\t" << "refType = 4;" << "\n"
626 << "\t\t" << "};" << "\n"; 626 << "\t\t" << "};" << "\n";
627 //REFERENCE 627 //REFERENCE
628 t << "\t\t" << keyFor("QMAKE_PBX_REFERENCE") << " = {" << "\n"; 628 t << "\t\t" << keyFor("QMAKE_PBX_REFERENCE") << " = {" << "\n";
629 if(project->first("TEMPLATE") == "app") { 629 if(project->first("TEMPLATE") == "app") {
630 QString targ = project->first("QMAKE_ORIG_TARGET"); 630 QString targ = project->first("QMAKE_ORIG_TARGET");
631 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console")) { 631 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console")) {
632 targ += ".app"; 632 targ += ".app";
633 t << "\t\t\t" << "isa = PBXApplicationReference;" << "\n"; 633 t << "\t\t\t" << "isa = PBXApplicationReference;" << "\n";
634 } else { 634 } else {
635 t << "\t\t\t" << "isa = PBXExecutableFileReference;" << "\n"; 635 t << "\t\t\t" << "isa = PBXExecutableFileReference;" << "\n";
636 } 636 }
637 QString app = (!project->isEmpty("DESTDIR") ? project->first("DESTDIR") + project->first("QMAKE_ORIG_TARGET") : 637 QString app = (!project->isEmpty("DESTDIR") ? project->first("DESTDIR") + project->first("QMAKE_ORIG_TARGET") :
638 QDir::currentDirPath()) + Option::dir_sep + targ; 638 QDir::currentDirPath()) + Option::dir_sep + targ;
639 t << "\t\t\t" << "name = " << targ << ";" << "\n" 639 t << "\t\t\t" << "name = " << targ << ";" << "\n"
640 << "\t\t\t" << "path = \"" << targ << "\";" << "\n" 640 << "\t\t\t" << "path = \"" << targ << "\";" << "\n"
641 << "\t\t\t" << "refType = " << reftypeForFile(app) << ";" << "\n"; 641 << "\t\t\t" << "refType = " << reftypeForFile(app) << ";" << "\n";
642 } else { 642 } else {
643 QString lib = project->first("QMAKE_ORIG_TARGET"); 643 QString lib = project->first("QMAKE_ORIG_TARGET");
644 if(project->isActiveConfig("staticlib")) { 644 if(project->isActiveConfig("staticlib")) {
645 lib = project->first("TARGET"); 645 lib = project->first("TARGET");
646 } else if(!project->isActiveConfig("frameworklib")) { 646 } else if(!project->isActiveConfig("frameworklib")) {
647 if(project->isActiveConfig("plugin")) 647 if(project->isActiveConfig("plugin"))
648 lib = project->first("TARGET"); 648 lib = project->first("TARGET");
649 else 649 else
650 lib = project->first("TARGET_"); 650 lib = project->first("TARGET_");
651 } 651 }
652 int slsh = lib.findRev(Option::dir_sep); 652 int slsh = lib.findRev(Option::dir_sep);
653 if(slsh != -1) 653 if(slsh != -1)
654 lib = lib.right(lib.length() - slsh - 1); 654 lib = lib.right(lib.length() - slsh - 1);
655 t << "\t\t\t" << "isa = PBXLibraryReference;" << "\n" 655 t << "\t\t\t" << "isa = PBXLibraryReference;" << "\n"
656 << "\t\t\t" << "path = " << lib << ";\n" 656 << "\t\t\t" << "path = " << lib << ";\n"
657 << "\t\t\t" << "refType = " << reftypeForFile(lib) << ";" << "\n"; 657 << "\t\t\t" << "refType = " << reftypeForFile(lib) << ";" << "\n";
658 } 658 }
659 t << "\t\t" << "};" << "\n"; 659 t << "\t\t" << "};" << "\n";
660 //TARGET 660 //TARGET
661 t << "\t\t" << keyFor("QMAKE_PBX_TARGET") << " = {" << "\n" 661 t << "\t\t" << keyFor("QMAKE_PBX_TARGET") << " = {" << "\n"
662 << "\t\t\t" << "buildPhases = (" << "\n" 662 << "\t\t\t" << "buildPhases = (" << "\n"
663 << varGlue("QMAKE_PBX_BUILDPHASES", "\t\t\t\t", ",\n\t\t\t\t", "\n") 663 << varGlue("QMAKE_PBX_BUILDPHASES", "\t\t\t\t", ",\n\t\t\t\t", "\n")
664 << "\t\t\t" << ");" << "\n" 664 << "\t\t\t" << ");" << "\n"
665 << "\t\t\t" << "buildSettings = {" << "\n" 665 << "\t\t\t" << "buildSettings = {" << "\n"
666 << "\t\t\t\t" << "FRAMEWORK_SEARCH_PATHS = \"\";" << "\n" 666 << "\t\t\t\t" << "FRAMEWORK_SEARCH_PATHS = \"\";" << "\n"
667 << "\t\t\t\t" << "HEADER_SEARCH_PATHS = \"" << fixEnvsList("INCLUDEPATH") << " " << fixEnvs(specdir()) << "\";" << "\n" 667 << "\t\t\t\t" << "HEADER_SEARCH_PATHS = \"" << fixEnvsList("INCLUDEPATH") << " " << fixEnvs(specdir()) << "\";" << "\n"
668 << "\t\t\t\t" << "LIBRARY_SEARCH_PATHS = \"" << var("QMAKE_PBX_LIBPATHS") << "\";" << "\n" 668 << "\t\t\t\t" << "LIBRARY_SEARCH_PATHS = \"" << var("QMAKE_PBX_LIBPATHS") << "\";" << "\n"
669 << "\t\t\t\t" << "OPTIMIZATION_CFLAGS = \"\";" << "\n" 669 << "\t\t\t\t" << "OPTIMIZATION_CFLAGS = \"\";" << "\n"
670 << "\t\t\t\t" << "OTHER_CFLAGS = \"" << 670 << "\t\t\t\t" << "OTHER_CFLAGS = \"" <<
671 fixEnvsList("QMAKE_CFLAGS") << varGlue("PRL_EXPORT_DEFINES"," -D"," -D","") << 671 fixEnvsList("QMAKE_CFLAGS") << varGlue("PRL_EXPORT_DEFINES"," -D"," -D","") <<
672 varGlue("DEFINES"," -D"," -D","") << "\";" << "\n" 672 varGlue("DEFINES"," -D"," -D","") << "\";" << "\n"
673 << "\t\t\t\t" << "LEXFLAGS = \"" << var("QMAKE_LEXFLAGS") << "\";" << "\n" 673 << "\t\t\t\t" << "LEXFLAGS = \"" << var("QMAKE_LEXFLAGS") << "\";" << "\n"
674 << "\t\t\t\t" << "YACCFLAGS = \"" << var("QMAKE_YACCFLAGS") << "\";" << "\n" 674 << "\t\t\t\t" << "YACCFLAGS = \"" << var("QMAKE_YACCFLAGS") << "\";" << "\n"
675 << "\t\t\t\t" << "OTHER_CPLUSPLUSFLAGS = \"" << 675 << "\t\t\t\t" << "OTHER_CPLUSPLUSFLAGS = \"" <<
676 fixEnvsList("QMAKE_CXXFLAGS") << varGlue("PRL_EXPORT_DEFINES"," -D"," -D","") << 676 fixEnvsList("QMAKE_CXXFLAGS") << varGlue("PRL_EXPORT_DEFINES"," -D"," -D","") <<
677 varGlue("DEFINES"," -D"," -D","") << "\";" << "\n" 677 varGlue("DEFINES"," -D"," -D","") << "\";" << "\n"
678 << "\t\t\t\t" << "OTHER_REZFLAGS = \"\";" << "\n" 678 << "\t\t\t\t" << "OTHER_REZFLAGS = \"\";" << "\n"
679 << "\t\t\t\t" << "SECTORDER_FLAGS = \"\";" << "\n" 679 << "\t\t\t\t" << "SECTORDER_FLAGS = \"\";" << "\n"
680 << "\t\t\t\t" << "WARNING_CFLAGS = \"\";" << "\n"; 680 << "\t\t\t\t" << "WARNING_CFLAGS = \"\";" << "\n";
681#if 1 681#if 1
682 t << "\t\t\t\t" << "BUILD_ROOT = \"" << QDir::currentDirPath() << "\";" << "\n"; 682 t << "\t\t\t\t" << "BUILD_ROOT = \"" << QDir::currentDirPath() << "\";" << "\n";
683#endif 683#endif
684 if(!project->isActiveConfig("staticlib")) 684 if(!project->isActiveConfig("staticlib"))
685 t << "\t\t\t\t" << "OTHER_LDFLAGS = \"" << fixEnvsList("SUBLIBS") << " " << 685 t << "\t\t\t\t" << "OTHER_LDFLAGS = \"" << fixEnvsList("SUBLIBS") << " " <<
686 fixEnvsList("QMAKE_LFLAGS") << " " << fixEnvsList("QMAKE_LIBDIR_FLAGS") << 686 fixEnvsList("QMAKE_LFLAGS") << " " << fixEnvsList("QMAKE_LIBDIR_FLAGS") <<
687 " " << fixEnvsList("QMAKE_LIBS") << "\";" << "\n"; 687 " " << fixEnvsList("QMAKE_LIBS") << "\";" << "\n";
688 if(!project->isEmpty("DESTDIR")) 688 if(!project->isEmpty("DESTDIR"))
689 t << "\t\t\t\t" << "INSTALL_PATH = \"" << project->first("DESTDIR") << "\";" << "\n"; 689 t << "\t\t\t\t" << "INSTALL_PATH = \"" << project->first("DESTDIR") << "\";" << "\n";
690 if(!project->isEmpty("VERSION") && project->first("VERSION") != "0.0.0") 690 if(!project->isEmpty("VERSION") && project->first("VERSION") != "0.0.0")
691 t << "\t\t\t\t" << "DYLIB_CURRENT_VERSION = \"" << project->first("VERSION") << "\";" << "\n"; 691 t << "\t\t\t\t" << "DYLIB_CURRENT_VERSION = \"" << project->first("VERSION") << "\";" << "\n";
692 if(!project->isEmpty("OBJECTS_DIR")) 692 if(!project->isEmpty("OBJECTS_DIR"))
693 t << "\t\t\t\t" << "OBJECT_FILE_DIR = \"" << project->first("OBJECTS_DIR") << "\";" << "\n"; 693 t << "\t\t\t\t" << "OBJECT_FILE_DIR = \"" << project->first("OBJECTS_DIR") << "\";" << "\n";
694 if(project->first("TEMPLATE") == "app") { 694 if(project->first("TEMPLATE") == "app") {
695 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console")) 695 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console"))
696 t << "\t\t\t\t" << "WRAPPER_EXTENSION = app;" << "\n"; 696 t << "\t\t\t\t" << "WRAPPER_EXTENSION = app;" << "\n";
697 t << "\t\t\t\t" << "PRODUCT_NAME = " << project->first("QMAKE_ORIG_TARGET") << ";" << "\n"; 697 t << "\t\t\t\t" << "PRODUCT_NAME = " << project->first("QMAKE_ORIG_TARGET") << ";" << "\n";
698 } else { 698 } else {
699 QString lib = project->first("QMAKE_ORIG_TARGET"); 699 QString lib = project->first("QMAKE_ORIG_TARGET");
700 if(!project->isActiveConfig("plugin") && project->isActiveConfig("staticlib")) { 700 if(!project->isActiveConfig("plugin") && project->isActiveConfig("staticlib")) {
701 t << "\t\t\t\t" << "LIBRARY_STYLE = STATIC;" << "\n"; 701 t << "\t\t\t\t" << "LIBRARY_STYLE = STATIC;" << "\n";
702 lib = project->first("TARGET"); 702 lib = project->first("TARGET");
703 } else { 703 } else {
704 t << "\t\t\t\t" << "LIBRARY_STYLE = DYNAMIC;" << "\n"; 704 t << "\t\t\t\t" << "LIBRARY_STYLE = DYNAMIC;" << "\n";
705 if(!project->isActiveConfig("frameworklib")) { 705 if(!project->isActiveConfig("frameworklib")) {
706 if(project->isActiveConfig("plugin")) 706 if(project->isActiveConfig("plugin"))
707 lib = project->first("TARGET"); 707 lib = project->first("TARGET");
708 else 708 else
709 lib = project->first("TARGET_"); 709 lib = project->first("TARGET_");
710 } 710 }
711 } 711 }
712 int slsh = lib.findRev(Option::dir_sep); 712 int slsh = lib.findRev(Option::dir_sep);
713 if(slsh != -1) 713 if(slsh != -1)
714 lib = lib.right(lib.length() - slsh - 1); 714 lib = lib.right(lib.length() - slsh - 1);
715 t << "\t\t\t\t" << "PRODUCT_NAME = " << lib << ";" << "\n"; 715 t << "\t\t\t\t" << "PRODUCT_NAME = " << lib << ";" << "\n";
716 } 716 }
717 tmp = project->variables()["QMAKE_PBX_VARS"]; 717 tmp = project->variables()["QMAKE_PBX_VARS"];
718 for(QStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it) 718 for(QStringList::Iterator it = tmp.begin(); it != tmp.end(); ++it)
719 t << "\t\t\t\t" << (*it) << " = \"" << getenv((*it)) << "\";" << "\n"; 719 t << "\t\t\t\t" << (*it) << " = \"" << getenv((*it)) << "\";" << "\n";
720 t << "\t\t\t" << "};" << "\n" 720 t << "\t\t\t" << "};" << "\n"
721 << "\t\t\t" << "conditionalBuildSettings = {" << "\n" 721 << "\t\t\t" << "conditionalBuildSettings = {" << "\n"
722 << "\t\t\t" << "};" << "\n" 722 << "\t\t\t" << "};" << "\n"
723 << "\t\t\t" << "dependencies = (" << "\n" 723 << "\t\t\t" << "dependencies = (" << "\n"
724 << varGlue("QMAKE_PBX_TARGETDEPENDS", "\t\t\t\t", ",\n\t\t\t\t", "\n") 724 << varGlue("QMAKE_PBX_TARGETDEPENDS", "\t\t\t\t", ",\n\t\t\t\t", "\n")
725 << "\t\t\t" << ");" << "\n" 725 << "\t\t\t" << ");" << "\n"
726 << "\t\t\t" << "productReference = " << keyFor("QMAKE_PBX_REFERENCE") << ";" << "\n" 726 << "\t\t\t" << "productReference = " << keyFor("QMAKE_PBX_REFERENCE") << ";" << "\n"
727 << "\t\t\t" << "shouldUseHeadermap = 1;" << "\n"; 727 << "\t\t\t" << "shouldUseHeadermap = 1;" << "\n";
728 if(project->first("TEMPLATE") == "app") { 728 if(project->first("TEMPLATE") == "app") {
729 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console")) { 729 if(project->isActiveConfig("resource_fork") && !project->isActiveConfig("console")) {
730 t << "\t\t\t" << "isa = PBXApplicationTarget;" << "\n" 730 t << "\t\t\t" << "isa = PBXApplicationTarget;" << "\n"
731 << "\t\t\t" << "productSettingsXML = " << "\"" << "<?xml version=" 731 << "\t\t\t" << "productSettingsXML = " << "\"" << "<?xml version="
732 << "\\\"1.0\\\" encoding=" << "\\\"UTF-8\\\"" << "?>" << "\n" 732 << "\\\"1.0\\\" encoding=" << "\\\"UTF-8\\\"" << "?>" << "\n"
733 << "\t\t\t\t" << "<!DOCTYPE plist SYSTEM \\\"file://localhost/System/" 733 << "\t\t\t\t" << "<!DOCTYPE plist SYSTEM \\\"file://localhost/System/"
734 << "Library/DTDs/PropertyList.dtd\\\">" << "\n" 734 << "Library/DTDs/PropertyList.dtd\\\">" << "\n"
735 << "\t\t\t\t" << "<plist version=\\\"0.9\\\">" << "\n" 735 << "\t\t\t\t" << "<plist version=\\\"0.9\\\">" << "\n"
736 << "\t\t\t\t" << "<dict>" << "\n" 736 << "\t\t\t\t" << "<dict>" << "\n"
737 << "\t\t\t\t\t" << "<key>CFBundleDevelopmentRegion</key>" << "\n" 737 << "\t\t\t\t\t" << "<key>CFBundleDevelopmentRegion</key>" << "\n"
738 << "\t\t\t\t\t" << "<string>English</string>" << "\n" 738 << "\t\t\t\t\t" << "<string>English</string>" << "\n"
739 << "\t\t\t\t\t" << "<key>CFBundleExecutable</key>" << "\n" 739 << "\t\t\t\t\t" << "<key>CFBundleExecutable</key>" << "\n"
740 << "\t\t\t\t\t" << "<string>" << project->first("QMAKE_ORIG_TARGET") << "</string>" << "\n" 740 << "\t\t\t\t\t" << "<string>" << project->first("QMAKE_ORIG_TARGET") << "</string>" << "\n"
741 << "\t\t\t\t\t" << "<key>CFBundleIconFile</key>" << "\n" 741 << "\t\t\t\t\t" << "<key>CFBundleIconFile</key>" << "\n"
742 << "\t\t\t\t\t" << "<string>" << var("RC_FILE").section(Option::dir_sep, -1) << "</string>" << "\n" 742 << "\t\t\t\t\t" << "<string>" << var("RC_FILE").section(Option::dir_sep, -1) << "</string>" << "\n"
743 << "\t\t\t\t\t" << "<key>CFBundleInfoDictionaryVersion</key>" << "\n" 743 << "\t\t\t\t\t" << "<key>CFBundleInfoDictionaryVersion</key>" << "\n"
744 << "\t\t\t\t\t" << "<string>6.0</string>" << "\n" 744 << "\t\t\t\t\t" << "<string>6.0</string>" << "\n"
745 << "\t\t\t\t\t" << "<key>CFBundlePackageType</key>" << "\n" 745 << "\t\t\t\t\t" << "<key>CFBundlePackageType</key>" << "\n"
746 << "\t\t\t\t\t" << "<string>APPL</string>" << "\n" 746 << "\t\t\t\t\t" << "<string>APPL</string>" << "\n"
747 << "\t\t\t\t\t" << "<key>CFBundleSignature</key>" << "\n" 747 << "\t\t\t\t\t" << "<key>CFBundleSignature</key>" << "\n"
748 << "\t\t\t\t\t" << "<string>????</string>" << "\n" 748 << "\t\t\t\t\t" << "<string>????</string>" << "\n"
749 << "\t\t\t\t\t" << "<key>CFBundleVersion</key>" << "\n" 749 << "\t\t\t\t\t" << "<key>CFBundleVersion</key>" << "\n"
750 << "\t\t\t\t\t" << "<string>0.1</string>" << "\n" 750 << "\t\t\t\t\t" << "<string>0.1</string>" << "\n"
751 << "\t\t\t\t\t" << "<key>CSResourcesFileMapped</key>" << "\n" 751 << "\t\t\t\t\t" << "<key>CSResourcesFileMapped</key>" << "\n"
752 << "\t\t\t\t\t" << "<true/>" << "\n" 752 << "\t\t\t\t\t" << "<true/>" << "\n"
753 << "\t\t\t\t" << "</dict>" << "\n" 753 << "\t\t\t\t" << "</dict>" << "\n"
754 << "\t\t\t\t" << "</plist>" << "\";" << "\n"; 754 << "\t\t\t\t" << "</plist>" << "\";" << "\n";
755 } else { 755 } else {
756 t << "\t\t\t" << "isa = PBXToolTarget;" << "\n"; 756 t << "\t\t\t" << "isa = PBXToolTarget;" << "\n";
757 } 757 }
758 t << "\t\t\t" << "name = \"" << project->first("QMAKE_ORIG_TARGET") << "\";" << "\n" 758 t << "\t\t\t" << "name = \"" << project->first("QMAKE_ORIG_TARGET") << "\";" << "\n"
759 << "\t\t\t" << "productName = " << project->first("QMAKE_ORIG_TARGET") << ";" << "\n"; 759 << "\t\t\t" << "productName = " << project->first("QMAKE_ORIG_TARGET") << ";" << "\n";
760 } else { 760 } else {
761 QString lib = project->first("QMAKE_ORIG_TARGET"); 761 QString lib = project->first("QMAKE_ORIG_TARGET");
762 if(!project->isActiveConfig("frameworklib")) 762 if(!project->isActiveConfig("frameworklib"))
763 lib.prepend("lib"); 763 lib.prepend("lib");
764 t << "\t\t\t" << "isa = PBXLibraryTarget;" << "\n" 764 t << "\t\t\t" << "isa = PBXLibraryTarget;" << "\n"
765 << "\t\t\t" << "name = \"" << lib << "\";" << "\n" 765 << "\t\t\t" << "name = \"" << lib << "\";" << "\n"
766 << "\t\t\t" << "productName = " << lib << ";" << "\n"; 766 << "\t\t\t" << "productName = " << lib << ";" << "\n";
767 } 767 }
768 if(!project->isEmpty("DESTDIR")) 768 if(!project->isEmpty("DESTDIR"))
769 t << "\t\t\t" << "productInstallPath = \"" << project->first("DESTDIR") << "\";" << "\n"; 769 t << "\t\t\t" << "productInstallPath = \"" << project->first("DESTDIR") << "\";" << "\n";
770 t << "\t\t" << "};" << "\n"; 770 t << "\t\t" << "};" << "\n";
771 //DEBUG/RELEASE 771 //DEBUG/RELEASE
772 for(i = 0; i < 2; i++) { 772 for(i = 0; i < 2; i++) {
773 bool as_release = !i; 773 bool as_release = !i;
774 if(project->isActiveConfig("debug")) 774 if(project->isActiveConfig("debug"))
775 as_release = i; 775 as_release = i;
776 QString key = "QMAKE_PBX_" + QString(as_release ? "RELEASE" : "DEBUG"); 776 QString key = "QMAKE_PBX_" + QString(as_release ? "RELEASE" : "DEBUG");
777 key = keyFor(key); 777 key = keyFor(key);
778 project->variables()["QMAKE_PBX_BUILDSTYLES"].append(key); 778 project->variables()["QMAKE_PBX_BUILDSTYLES"].append(key);
779 t << "\t\t" << key << " = {" << "\n" 779 t << "\t\t" << key << " = {" << "\n"
780 << "\t\t\t" << "buildRules = (" << "\n" 780 << "\t\t\t" << "buildRules = (" << "\n"
781 << "\t\t\t" << ");" << "\n" 781 << "\t\t\t" << ");" << "\n"
782 << "\t\t\t" << "buildSettings = {" << "\n" 782 << "\t\t\t" << "buildSettings = {" << "\n"
783 << "\t\t\t\t" << "COPY_PHASE_STRIP = " << (as_release ? "YES" : "NO") << ";" << "\n"; 783 << "\t\t\t\t" << "COPY_PHASE_STRIP = " << (as_release ? "YES" : "NO") << ";" << "\n";
784 if(as_release) 784 if(as_release)
785 t << "\t\t\t\t" << "DEBUGGING_SYMBOLS = NO;" << "\n"; 785 t << "\t\t\t\t" << "DEBUGGING_SYMBOLS = NO;" << "\n";
786 t << "\t\t\t" << "};" << "\n" 786 t << "\t\t\t" << "};" << "\n"
787 << "\t\t\t" << "isa = PBXBuildStyle;" << "\n" 787 << "\t\t\t" << "isa = PBXBuildStyle;" << "\n"
788 << "\t\t\t" << "name = " << (as_release ? "Deployment" : "Development") << ";" << "\n" 788 << "\t\t\t" << "name = " << (as_release ? "Deployment" : "Development") << ";" << "\n"
789 << "\t\t" << "};" << "\n"; 789 << "\t\t" << "};" << "\n";
790 } 790 }
791 //ROOT 791 //ROOT
792 t << "\t\t" << keyFor("QMAKE_PBX_ROOT") << " = {" << "\n" 792 t << "\t\t" << keyFor("QMAKE_PBX_ROOT") << " = {" << "\n"
793 << "\t\t\t" << "buildStyles = (" << "\n" 793 << "\t\t\t" << "buildStyles = (" << "\n"
794 << varGlue("QMAKE_PBX_BUILDSTYLES", "\t\t\t\t", ",\n\t\t\t\t", "\n") 794 << varGlue("QMAKE_PBX_BUILDSTYLES", "\t\t\t\t", ",\n\t\t\t\t", "\n")
795 << "\t\t\t" << ");" << "\n" 795 << "\t\t\t" << ");" << "\n"
796 << "\t\t\t" << "isa = PBXProject;" << "\n" 796 << "\t\t\t" << "isa = PBXProject;" << "\n"
797 << "\t\t\t" << "mainGroup = " << keyFor("QMAKE_PBX_ROOT_GROUP") << ";" << "\n" 797 << "\t\t\t" << "mainGroup = " << keyFor("QMAKE_PBX_ROOT_GROUP") << ";" << "\n"
798 << "\t\t\t" << "targets = (" << "\n" 798 << "\t\t\t" << "targets = (" << "\n"
799 << "\t\t\t\t" << keyFor("QMAKE_PBX_TARGET") << "\n" 799 << "\t\t\t\t" << keyFor("QMAKE_PBX_TARGET") << "\n"
800 << "\t\t\t" << ");" << "\n" 800 << "\t\t\t" << ");" << "\n"
801 << "\t\t" << "};" << "\n"; 801 << "\t\t" << "};" << "\n";
802 802
803 //FOOTER 803 //FOOTER
804 t << "\t" << "};" << "\n" 804 t << "\t" << "};" << "\n"
805 << "\t" << "rootObject = " << keyFor("QMAKE_PBX_ROOT") << ";" << "\n" 805 << "\t" << "rootObject = " << keyFor("QMAKE_PBX_ROOT") << ";" << "\n"
806 << "}" << endl; 806 << "}" << endl;
807 807
808 QString mkwrap = fileFixify(pbx_dir + Option::dir_sep + ".." + Option::dir_sep + project->first("MAKEFILE"), 808 QString mkwrap = fileFixify(pbx_dir + Option::dir_sep + ".." + Option::dir_sep + project->first("MAKEFILE"),
809 QDir::currentDirPath()); 809 QDir::currentDirPath());
810 QFile mkwrapf(mkwrap); 810 QFile mkwrapf(mkwrap);
811 if(mkwrapf.open(IO_WriteOnly | IO_Translate)) { 811 if(mkwrapf.open(IO_WriteOnly | IO_Translate)) {
812 debug_msg(1, "pbuilder: Creating file: %s", mkwrap.latin1()); 812 debug_msg(1, "pbuilder: Creating file: %s", mkwrap.latin1());
813 QTextStream mkwrapt(&mkwrapf); 813 QTextStream mkwrapt(&mkwrapf);
814 writeHeader(mkwrapt); 814 writeHeader(mkwrapt);
815 const char *cleans = "uiclean mocclean preprocess_clean "; 815 const char *cleans = "uiclean mocclean preprocess_clean ";
816 mkwrapt << "#This is a makefile wrapper for PROJECT BUILDER\n" 816 mkwrapt << "#This is a makefile wrapper for PROJECT BUILDER\n"
817 << "all:" << "\n\t" 817 << "all:" << "\n\t"
818 << "cd " << (project->first("QMAKE_ORIG_TARGET") + ".pbproj/ && pbxbuild") << "\n" 818 << "cd " << (project->first("QMAKE_ORIG_TARGET") + ".pbproj/ && pbxbuild") << "\n"
819 << "install: all" << "\n\t" 819 << "install: all" << "\n\t"
820 << "cd " << (project->first("QMAKE_ORIG_TARGET") + ".pbproj/ && pbxbuild install") << "\n" 820 << "cd " << (project->first("QMAKE_ORIG_TARGET") + ".pbproj/ && pbxbuild install") << "\n"
821 << "distclean clean: preprocess_clean" << "\n\t" 821 << "distclean clean: preprocess_clean" << "\n\t"
822 << "cd " << (project->first("QMAKE_ORIG_TARGET") + ".pbproj/ && pbxbuild clean") << "\n" 822 << "cd " << (project->first("QMAKE_ORIG_TARGET") + ".pbproj/ && pbxbuild clean") << "\n"
823 << (!did_preprocess ? cleans : "") << ":" << "\n"; 823 << (!did_preprocess ? cleans : "") << ":" << "\n";
824 if(did_preprocess) 824 if(did_preprocess)
825 mkwrapt << cleans << ":" << "\n\t" 825 mkwrapt << cleans << ":" << "\n\t"
826 << "make -f " 826 << "make -f "
827 << pbx_dir << Option::dir_sep << "qt_preprocess.mak $@" << endl; 827 << pbx_dir << Option::dir_sep << "qt_preprocess.mak $@" << endl;
828 } 828 }
829 return TRUE; 829 return TRUE;
830} 830}
831 831
832QString 832QString
833ProjectBuilderMakefileGenerator::fixEnvs(QString file) 833ProjectBuilderMakefileGenerator::fixEnvs(QString file)
834{ 834{
835 QRegExp reg_var("\\$\\((.*)\\)"); 835 QRegExp reg_var("\\$\\((.*)\\)");
836 for(int rep = 0; (rep = reg_var.search(file, rep)) != -1; ) { 836 for(int rep = 0; (rep = reg_var.search(file, rep)) != -1; ) {
837 if(project->variables()["QMAKE_PBX_VARS"].findIndex(reg_var.cap(1)) == -1) 837 if(project->variables()["QMAKE_PBX_VARS"].findIndex(reg_var.cap(1)) == -1)
838 project->variables()["QMAKE_PBX_VARS"].append(reg_var.cap(1)); 838 project->variables()["QMAKE_PBX_VARS"].append(reg_var.cap(1));
839 rep += reg_var.matchedLength(); 839 rep += reg_var.matchedLength();
840 } 840 }
841 return file; 841 return file;
842} 842}
843 843
844QString 844QString
845ProjectBuilderMakefileGenerator::fixEnvsList(QString where) 845ProjectBuilderMakefileGenerator::fixEnvsList(QString where)
846{ 846{
847 QString ret; 847 QString ret;
848 const QStringList &l = project->variables()[where]; 848 const QStringList &l = project->variables()[where];
849 for(QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) { 849 for(QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {
850 fixEnvs((*it)); 850 fixEnvs((*it));
851 if(!ret.isEmpty()) 851 if(!ret.isEmpty())
852 ret += " "; 852 ret += " ";
853 ret += (*it); 853 ret += (*it);
854 } 854 }
855 return ret; 855 return ret;
856} 856}
857 857
858QString 858QString
859ProjectBuilderMakefileGenerator::keyFor(QString block) 859ProjectBuilderMakefileGenerator::keyFor(QString block)
860{ 860{
861#if 0 //This make this code much easier to debug.. 861#if 0 //This make this code much easier to debug..
862 return block; 862 return block;
863#endif 863#endif
864 864
865 QString ret; 865 QString ret;
866 if(!keys.contains(block)) { 866 if(!keys.contains(block)) {
867#if 0 867#if 0
868 static unsigned int r = 0; 868 static unsigned int r = 0;
869 ret.sprintf("%024x", ++r); 869 ret.sprintf("%024x", ++r);
870#else //not really necesary, but makes it look more interesting.. 870#else //not really necesary, but makes it look more interesting..
871 static struct { unsigned int a1, a2, a3; } r = { 0, 0, 0 }; 871 static struct { unsigned int a1, a2, a3; } r = { 0, 0, 0 };
872 if(!r.a1 && !r.a2 && !r.a3) { 872 if(!r.a1 && !r.a2 && !r.a3) {
873 r.a1 = rand(); 873 r.a1 = rand();
874 r.a2 = rand(); 874 r.a2 = rand();
875 r.a3 = rand(); 875 r.a3 = rand();
876 } 876 }
877 switch(rand() % 3) { 877 switch(rand() % 3) {
878 case 0: ++r.a1; break; 878 case 0: ++r.a1; break;
879 case 1: ++r.a2; break; 879 case 1: ++r.a2; break;
880 case 2: ++r.a3; break; 880 case 2: ++r.a3; break;
881 } 881 }
882 ret.sprintf("%08x%08x%08x", r.a1, r.a2, r.a3); 882 ret.sprintf("%08x%08x%08x", r.a1, r.a2, r.a3);
883#endif 883#endif
884 ret = ret.upper(); 884 ret = ret.upper();
885 keys.insert(block, ret); 885 keys.insert(block, ret);
886 } else { 886 } else {
887 ret = keys[block]; 887 ret = keys[block];
888 } 888 }
889 return ret; 889 return ret;
890} 890}
891 891
892bool 892bool
893ProjectBuilderMakefileGenerator::openOutput(QFile &file) const 893ProjectBuilderMakefileGenerator::openOutput(QFile &file) const
894{ 894{
895 if(project->first("TEMPLATE") != "subdirs") { 895 if(project->first("TEMPLATE") != "subdirs") {
896 QFileInfo fi(file); 896 QFileInfo fi(file);
897 if(fi.extension() != "pbxproj" || file.name().isEmpty()) { 897 if(fi.extension() != "pbxproj" || file.name().isEmpty()) {
898 QString output = file.name(); 898 QString output = file.name();
899 if(fi.isDir()) 899 if(fi.isDir())
900 output += QDir::separator(); 900 output += QDir::separator();
901 if(fi.extension() != "pbproj") { 901 if(fi.extension() != "pbproj") {
902 if(file.name().isEmpty() || fi.isDir()) 902 if(file.name().isEmpty() || fi.isDir())
903 output += project->first("TARGET"); 903 output += project->first("TARGET");
904 output += QString(".pbproj") + QDir::separator(); 904 output += QString(".pbproj") + QDir::separator();
905 } else if(output[(int)output.length() - 1] != QDir::separator()) { 905 } else if(output[(int)output.length() - 1] != QDir::separator()) {
906 output += QDir::separator(); 906 output += QDir::separator();
907 } 907 }
908 output += QString("project.pbxproj"); 908 output += QString("project.pbxproj");
909 file.setName(output); 909 file.setName(output);
910 } 910 }
911 bool ret = UnixMakefileGenerator::openOutput(file); 911 bool ret = UnixMakefileGenerator::openOutput(file);
912 ((ProjectBuilderMakefileGenerator*)this)->pbx_dir = Option::output_dir.section(Option::dir_sep, 0, -1); 912 ((ProjectBuilderMakefileGenerator*)this)->pbx_dir = Option::output_dir.section(Option::dir_sep, 0, -1);
913 Option::output_dir = pbx_dir.section(Option::dir_sep, 0, -2); 913 Option::output_dir = pbx_dir.section(Option::dir_sep, 0, -2);
914 return ret; 914 return ret;
915 } 915 }
916 return UnixMakefileGenerator::openOutput(file); 916 return UnixMakefileGenerator::openOutput(file);
917} 917}
918 918
919/* This function is such a hack it is almost pointless, but it 919/* This function is such a hack it is almost pointless, but it
920 eliminates the warning message from ProjectBuilder that the project 920 eliminates the warning message from ProjectBuilder that the project
921 file is for an older version. I guess this could be used someday if 921 file is for an older version. I guess this could be used someday if
922 the format of the output is dependant upon the version of 922 the format of the output is dependant upon the version of
923 ProjectBuilder as well. 923 ProjectBuilder as well.
924*/ 924*/
925int 925int
926ProjectBuilderMakefileGenerator::pbuilderVersion() const 926ProjectBuilderMakefileGenerator::pbuilderVersion() const
927{ 927{
928 QString ret; 928 QString ret;
929 if(project->isEmpty("QMAKE_PBUILDER_VERSION")) { 929 if(project->isEmpty("QMAKE_PBUILDER_VERSION")) {
930 QString version, version_plist = project->first("QMAKE_PBUILDER_VERSION_PLIST"); 930 QString version, version_plist = project->first("QMAKE_PBUILDER_VERSION_PLIST");
931 if(version_plist.isEmpty()) 931 if(version_plist.isEmpty())
932 version_plist = "/Developer/Applications/Project Builder.app/Contents/version.plist"; 932 version_plist = "/Developer/Applications/Project Builder.app/Contents/version.plist";
933 else 933 else
934 version_plist = version_plist.replace(QRegExp("\""), ""); 934 version_plist = version_plist.replace(QRegExp("\""), "");
935 QFile version_file(version_plist); 935 QFile version_file(version_plist);
936 if(version_file.open(IO_ReadOnly)) { 936 if(version_file.open(IO_ReadOnly)) {
937 debug_msg(1, "pbuilder: version.plist: Reading file: %s", version_plist.latin1()); 937 debug_msg(1, "pbuilder: version.plist: Reading file: %s", version_plist.latin1());
938 QTextStream plist(&version_file); 938 QTextStream plist(&version_file);
939 939
940 bool in_dict = FALSE; 940 bool in_dict = FALSE;
941 QString current_key; 941 QString current_key;
942 QRegExp keyreg("^<key>(.*)</key>$"), stringreg("^<string>(.*)</string>$"); 942 QRegExp keyreg("^<key>(.*)</key>$"), stringreg("^<string>(.*)</string>$");
943 while(!plist.eof()) { 943 while(!plist.eof()) {
944 QString line = plist.readLine().stripWhiteSpace(); 944 QString line = plist.readLine().stripWhiteSpace();
945 if(line == "<dict>") 945 if(line == "<dict>")
946 in_dict = TRUE; 946 in_dict = TRUE;
947 else if(line == "</dict>") 947 else if(line == "</dict>")
948 in_dict = FALSE; 948 in_dict = FALSE;
949 else if(in_dict) { 949 else if(in_dict) {
950 if(keyreg.exactMatch(line)) 950 if(keyreg.exactMatch(line))
951 current_key = keyreg.cap(1); 951 current_key = keyreg.cap(1);
952 else if(current_key == "CFBundleShortVersionString" && stringreg.exactMatch(line)) 952 else if(current_key == "CFBundleShortVersionString" && stringreg.exactMatch(line))
953 version = stringreg.cap(1); 953 version = stringreg.cap(1);
954 } 954 }
955 } 955 }
956 version_file.close(); 956 version_file.close();
957 } else debug_msg(1, "pbuilder: version.plist: Failure to open %s", version_plist.latin1()); 957 } else debug_msg(1, "pbuilder: version.plist: Failure to open %s", version_plist.latin1());
958 if(version.startsWith("2.0")) 958 if(version.startsWith("2.0"))
959 ret = "38"; 959 ret = "38";
960 else if(version == "1.1") 960 else if(version == "1.1")
961 ret = "34"; 961 ret = "34";
962 } else { 962 } else {
963 ret = project->first("QMAKE_PBUILDER_VERSION"); 963 ret = project->first("QMAKE_PBUILDER_VERSION");
964 } 964 }
965 if(!ret.isEmpty()) { 965 if(!ret.isEmpty()) {
966 bool ok; 966 bool ok;
967 int int_ret = ret.toInt(&ok); 967 int int_ret = ret.toInt(&ok);
968 if(ok) { 968 if(ok) {
969 debug_msg(1, "pbuilder: version.plist: Got version: %d", int_ret); 969 debug_msg(1, "pbuilder: version.plist: Got version: %d", int_ret);
970 return int_ret; 970 return int_ret;
971 } 971 }
972 } 972 }
973 debug_msg(1, "pbuilder: version.plist: Fallback to default version"); 973 debug_msg(1, "pbuilder: version.plist: Fallback to default version");
974 return 34; //my fallback 974 return 34; //my fallback
975} 975}
976 976
977QString 977QString
978ProjectBuilderMakefileGenerator::reftypeForFile(QString where) 978ProjectBuilderMakefileGenerator::reftypeForFile(QString where)
979{ 979{
980 if(QDir::isRelativePath(where)) 980 if(QDir::isRelativePath(where))
981 return "4"; //relative 981 return "4"; //relative
982 return "0"; //absolute 982 return "0"; //absolute
983} 983}
diff --git a/x11/ipc/server/ocopserver.cpp b/x11/ipc/server/ocopserver.cpp
index 992cb8c..3ee38e9 100644
--- a/x11/ipc/server/ocopserver.cpp
+++ b/x11/ipc/server/ocopserver.cpp
@@ -1,413 +1,413 @@
1#include <errno.h> 1#include <errno.h>
2#include <signal.h> 2#include <signal.h>
3#include <stdio.h> 3#include <stdio.h>
4#include <stdlib.h> 4#include <stdlib.h>
5#include <unistd.h> 5#include <unistd.h>
6#include <sys/socket.h> 6#include <sys/socket.h>
7#include <sys/un.h> 7#include <sys/un.h>
8 8
9#include <qcstring.h> 9#include <qcstring.h>
10#include <qtimer.h> 10#include <qtimer.h>
11 11
12#include "ocopserver.h" 12#include "ocopserver.h"
13 13
14OCopServer::OCopServer() 14OCopServer::OCopServer()
15 : QObject() 15 : QObject()
16{ 16{
17 setName( "ocopserver"); 17 setName( "ocopserver");
18 18
19 /* 19 /*
20 * init the server 20 * init the server
21 */ 21 */
22 init(); 22 init();
23 initSocket(); 23 initSocket();
24} 24}
25OCopServer::~OCopServer() { 25OCopServer::~OCopServer() {
26// socket notifiers should be deleted 26// socket notifiers should be deleted
27 close(m_serverfd ); 27 close(m_serverfd );
28} 28}
29void OCopServer::init() { 29void OCopServer::init() {
30 /* 30 /*
31 * we set SIGPIPE to SIG_IGN 31 * we set SIGPIPE to SIG_IGN
32 * to get EPIPE on reads ;) 32 * to get EPIPE on reads ;)
33 */ 33 */
34// qWarning("SIGPIPE to be ignored"); 34// qWarning("SIGPIPE to be ignored");
35 signal(SIGPIPE, SIG_IGN ); 35 signal(SIGPIPE, SIG_IGN );
36 36
37 /* 37 /*
38 * initialize some variables 38 * initialize some variables
39 */ 39 */
40 m_server = 0l; 40 m_server = 0l;
41 m_serverError = 0l; 41 m_serverError = 0l;
42} 42}
43 43
44/** 44/**
45 * here we will init our server 45 * here we will init our server
46 * socket and bind and do the listen 46 * socket and bind and do the listen
47 */ 47 */
48void OCopServer::initSocket() { 48void OCopServer::initSocket() {
49 /* get the home dir */ 49 /* get the home dir */
50 QCString home( getenv("HOME") ); 50 QCString home( getenv("HOME") );
51 QCString path( home + "/.opie.cop"); 51 QCString path( home + "/.opie.cop");
52 52
53 if ( ( m_serverfd = socket( PF_UNIX, SOCK_STREAM, 0 ) ) == -1 ) { 53 if ( ( m_serverfd = socket( PF_UNIX, SOCK_STREAM, 0 ) ) == -1 ) {
54 qWarning("failed to create server socket"); 54 qWarning("failed to create server socket");
55 /* try again later */ 55 /* try again later */
56 QTimer::singleShot( 400, this, SLOT(initSocket() ) ); 56 QTimer::singleShot( 400, this, SLOT(initSocket() ) );
57 return; 57 return;
58 } 58 }
59 qWarning( "unlinking file %s", path.data() ); 59 qWarning( "unlinking file %s", path.data() );
60 60
61 /* unlink previous sockets */ 61 /* unlink previous sockets */
62 unlink( path.data() ); 62 unlink( path.data() );
63 63
64 struct sockaddr_un m_address; 64 struct sockaddr_un m_address;
65 memset(&m_address, 0, sizeof(m_address ) ); 65 memset(&m_address, 0, sizeof(m_address ) );
66 m_address.sun_family = AF_UNIX; /* unix domain socket */ 66 m_address.sun_family = AF_UNIX; /* unix domain socket */
67 strcpy(m_address.sun_path, path.data() ); 67 strcpy(m_address.sun_path, path.data() );
68 m_adrlaenge = sizeof(m_address.sun_family) + strlen(m_address.sun_path ); 68 m_adrlaenge = sizeof(m_address.sun_family) + strlen(m_address.sun_path );
69 69
70 /* cast to make it a (sockadr*) */ 70 /* cast to make it a (sockadr*) */
71 if (bind(m_serverfd, (struct sockaddr*)&m_address, m_adrlaenge ) == -1 ) { 71 if (bind(m_serverfd, (struct sockaddr*)&m_address, m_adrlaenge ) == -1 ) {
72 qWarning("Server could not bind try again"); 72 qWarning("Server could not bind try again");
73 close(m_serverfd); 73 close(m_serverfd);
74 QTimer::singleShot(400, this, SLOT(initSocket() ) ); 74 QTimer::singleShot(400, this, SLOT(initSocket() ) );
75 return; 75 return;
76 } 76 }
77 77
78 /* tell the kernel that we're listening and accepting 78 /* tell the kernel that we're listening and accepting
79 * 5 pending connections */ 79 * 5 pending connections */
80 if (listen(m_serverfd, 5) == -1 ) { 80 if (listen(m_serverfd, 5) == -1 ) {
81 qWarning("could not listen"); 81 qWarning("could not listen");
82 close(m_serverfd ); 82 close(m_serverfd );
83 QTimer::singleShot(400, this, SLOT(initSocket() ) ); 83 QTimer::singleShot(400, this, SLOT(initSocket() ) );
84 return; 84 return;
85 } 85 }
86 86
87 /* 87 /*
88 * now we will create two QSocketNotifier 88 * now we will create two QSocketNotifier
89 * which will us notify on reads 89 * which will us notify on reads
90 * and errors 90 * and errors
91 * we do this because they integrate 91 * we do this because they integrate
92 * nicely into the QApplication eventloop 92 * nicely into the QApplication eventloop
93 */ 93 */
94 m_server = new QSocketNotifier(m_serverfd, QSocketNotifier::Read, this ); 94 m_server = new QSocketNotifier(m_serverfd, QSocketNotifier::Read, this );
95 connect( m_server, SIGNAL(activated(int) ), 95 connect( m_server, SIGNAL(activated(int) ),
96 this, SLOT(newOnServer() ) ); 96 this, SLOT(newOnServer() ) );
97 97
98 m_serverError = new QSocketNotifier( m_serverfd, QSocketNotifier::Exception, this); 98 m_serverError = new QSocketNotifier( m_serverfd, QSocketNotifier::Exception, this);
99 connect(m_serverError, SIGNAL(activated(int) ), 99 connect(m_serverError, SIGNAL(activated(int) ),
100 this, SLOT(errorOnServer() ) ); 100 this, SLOT(errorOnServer() ) );
101 101
102 qWarning("done with registering"); 102 qWarning("done with registering");
103} 103}
104/** 104/**
105 * we got the possibility to read 105 * we got the possibility to read
106 * on the server 106 * on the server
107 * this is mostly due a connect 107 * this is mostly due a connect
108 * on a client side 108 * on a client side
109 * we will accept it 109 * we will accept it
110 * add it to our list 110 * add it to our list
111 */ 111 */
112void OCopServer::newOnServer() { 112void OCopServer::newOnServer() {
113 int fd = accept(); 113 int fd = accept();
114 if ( fd < 0 ) 114 if ( fd < 0 )
115 return; 115 return;
116 116
117 /* 117 /*
118 * we got a successfull new connection 118 * we got a successful new connection
119 * be happy 119 * be happy
120 * set SocketNotifier 120 * set SocketNotifier
121 * connect it 121 * connect it
122 * and a OCOPClient 122 * and a OCOPClient
123 */ 123 */
124// qWarning("Heureka new connection %d", fd ); 124// qWarning("Heureka new connection %d", fd );
125 125
126 126
127 registerClient( fd ); 127 registerClient( fd );
128} 128}
129int OCopServer::accept() { 129int OCopServer::accept() {
130 /* 130 /*
131 * accept it 131 * accept it
132 * the socket is currently blocking IIRC 132 * the socket is currently blocking IIRC
133 */ 133 */
134 return ::accept( m_serverfd, (struct sockaddr*)&m_address, &m_adrlaenge ); 134 return ::accept( m_serverfd, (struct sockaddr*)&m_address, &m_adrlaenge );
135} 135}
136void OCopServer::newOnClient( int fd ) { 136void OCopServer::newOnClient( int fd ) {
137 errno = 0; 137 errno = 0;
138 OCOPHead head; 138 OCOPHead head;
139 memset(&head, 0, sizeof(head) ); 139 memset(&head, 0, sizeof(head) );
140 int rea = ::read(fd, &head, sizeof(head) ); 140 int rea = ::read(fd, &head, sizeof(head) );
141 //qWarning("read %d %d", rea, errno); 141 //qWarning("read %d %d", rea, errno);
142 /* 142 /*
143 * I should get EPIPE but nothing like this happens 143 * I should get EPIPE but nothing like this happens
144 * so if rea == 0 and we were signaled by the notifier 144 * so if rea == 0 and we were signaled by the notifier
145 * we close it and drop the clients... 145 * we close it and drop the clients...
146 */ 146 */
147 if ( rea <= 0 ) { 147 if ( rea <= 0 ) {
148 deregisterClient( fd ); 148 deregisterClient( fd );
149 return; 149 return;
150 } 150 }
151 /* 151 /*
152 * OCOPHead 152 * OCOPHead
153 */ 153 */
154 //qWarning("data %s %d", &bug, rea ); 154 //qWarning("data %s %d", &bug, rea );
155 155
156 /* 156 /*
157 * Check the magic 157 * Check the magic
158 * if chcked read till EOF if magic does not match 158 * if chcked read till EOF if magic does not match
159 * otherwise do read 159 * otherwise do read
160 * channel 160 * channel
161 * func 161 * func
162 * data into mem 162 * data into mem
163 * and then send the OCOPPacket 163 * and then send the OCOPPacket
164 * 164 *
165 */ 165 */
166 if (head.magic == 47 ) { 166 if (head.magic == 47 ) {
167// qWarning("magic match"); 167// qWarning("magic match");
168 QCString channel( head.chlen+1 ); 168 QCString channel( head.chlen+1 );
169 QCString func( head.funclen+1 ); 169 QCString func( head.funclen+1 );
170 QByteArray data ( head.datalen+1 ); 170 QByteArray data ( head.datalen+1 );
171 171
172 /* 172 /*
173 * we do not check for errors 173 * we do not check for errors
174 */ 174 */
175// qWarning("read "); 175// qWarning("read ");
176 int s = read(fd, channel.data(), head.chlen ); 176 int s = read(fd, channel.data(), head.chlen );
177 s = read(fd, func.data(), head.funclen ); 177 s = read(fd, func.data(), head.funclen );
178 s = read(fd, data.data(), head.datalen ); 178 s = read(fd, data.data(), head.datalen );
179// qWarning("read"); 179// qWarning("read");
180 180
181 /* debug output */ 181 /* debug output */
182// qWarning("channel %s %d", channel.data(), head.chlen ); 182// qWarning("channel %s %d", channel.data(), head.chlen );
183// qWarning("func %s %d", func.data(), head.funclen ); 183// qWarning("func %s %d", func.data(), head.funclen );
184 /* debug end */ 184 /* debug end */
185 185
186 /* 186 /*
187 * now that we got the complete body 187 * now that we got the complete body
188 * we need to make a package 188 * we need to make a package
189 * and then we need to send it to clients 189 * and then we need to send it to clients
190 * making a package is done here 190 * making a package is done here
191 * dispatching it not 191 * dispatching it not
192 */ 192 */
193 OCOPPacket packet( head.type, channel, func, data ); 193 OCOPPacket packet( head.type, channel, func, data );
194 dispatch( packet, fd ); 194 dispatch( packet, fd );
195 195
196 }else{ 196 }else{
197// qWarning("magic does not match"); 197// qWarning("magic does not match");
198// qWarning("magic %d", head.magic ); 198// qWarning("magic %d", head.magic );
199 } 199 }
200} 200}
201void OCopServer::registerClient( int fd ) { 201void OCopServer::registerClient( int fd ) {
202 if (m_clients.contains(fd) ) 202 if (m_clients.contains(fd) )
203 return; 203 return;
204 204
205 QSocketNotifier* notify = new QSocketNotifier(fd, QSocketNotifier::Read, this ); 205 QSocketNotifier* notify = new QSocketNotifier(fd, QSocketNotifier::Read, this );
206 connect(notify, SIGNAL(activated(int) ), 206 connect(notify, SIGNAL(activated(int) ),
207 this, SLOT(newOnClient(int) ) ); 207 this, SLOT(newOnClient(int) ) );
208 OCOPClient client; 208 OCOPClient client;
209 client.fd = fd; 209 client.fd = fd;
210 client.notify = notify; 210 client.notify = notify;
211 m_clients.insert( client.fd, client ); 211 m_clients.insert( client.fd, client );
212// qWarning("clients are up to %d", m_clients.count() ); 212// qWarning("clients are up to %d", m_clients.count() );
213}; 213};
214void OCopServer::deregisterClient(int fd ) { 214void OCopServer::deregisterClient(int fd ) {
215 QMap<int, OCOPClient>::Iterator it = m_clients.find( fd ); 215 QMap<int, OCOPClient>::Iterator it = m_clients.find( fd );
216 if (it != m_clients.end() ) { 216 if (it != m_clients.end() ) {
217 /* 217 /*
218 * TIME_ME 218 * TIME_ME
219 * 219 *
220 * now delete from all channels 220 * now delete from all channels
221 * go through all channels 221 * go through all channels
222 * remove the fd from the list 222 * remove the fd from the list
223 * if count becomes 0 remove the channel 223 * if count becomes 0 remove the channel
224 * otherwise replace QArray<int> 224 * otherwise replace QArray<int>
225 */ 225 */
226 QMap<QCString, QValueList<int> >::Iterator it2; 226 QMap<QCString, QValueList<int> >::Iterator it2;
227 repeatIt: 227 repeatIt:
228 for ( it2 = m_channels.begin(); it2 != m_channels.end(); ++it2 ) { 228 for ( it2 = m_channels.begin(); it2 != m_channels.end(); ++it2 ) {
229 /* 229 /*
230 * The channel contains this fd 230 * The channel contains this fd
231 */ 231 */
232// qWarning("Channel %s %d", it2.key().data(), it2.data().count() ); 232// qWarning("Channel %s %d", it2.key().data(), it2.data().count() );
233 if ( it2.data().contains( fd ) ) { 233 if ( it2.data().contains( fd ) ) {
234 qWarning("contains"); 234 qWarning("contains");
235 QValueList<int> array = it2.data(); 235 QValueList<int> array = it2.data();
236 236
237 /* 237 /*
238 * remove channel or just replace 238 * remove channel or just replace
239 */ 239 */
240 if ( array.count() == 1 || array.count() == 0) { 240 if ( array.count() == 1 || array.count() == 0) {
241// qWarning("Invalidate!"); 241// qWarning("Invalidate!");
242 /* is the list now invalidatet? */ 242 /* is the list now invalidatet? */
243 m_channels.remove( it2 ); 243 m_channels.remove( it2 );
244 /* That is the first go to of my life 244 /* That is the first go to of my life
245 * but Iterator remove( Iterator ) 245 * but Iterator remove( Iterator )
246 * does not exist 246 * does not exist
247 * it2 = --it2; 247 * it2 = --it2;
248 * does not work reliable too 248 * does not work reliable too
249 * so the only way is to reiterate :( 249 * so the only way is to reiterate :(
250 */ 250 */
251 goto repeatIt; 251 goto repeatIt;
252 }else{ 252 }else{
253// qWarning("removing count %d %d",fd, array.count() ); 253// qWarning("removing count %d %d",fd, array.count() );
254 QValueList<int>::Iterator it3 = array.find( fd ); 254 QValueList<int>::Iterator it3 = array.find( fd );
255 it3 = array.remove( it3 ); 255 it3 = array.remove( it3 );
256 QCString key = it2.key().copy(); 256 QCString key = it2.key().copy();
257 it2 = m_channels.replace( key, array ); 257 it2 = m_channels.replace( key, array );
258 } 258 }
259 } 259 }
260 } // off all channels 260 } // off all channels
261 OCOPClient client = it.data(); 261 OCOPClient client = it.data();
262 delete client.notify; 262 delete client.notify;
263 m_clients.remove(fd ); 263 m_clients.remove(fd );
264 close(fd ); 264 close(fd );
265 } 265 }
266// qWarning("clients are now at %d", m_clients.count() ); 266// qWarning("clients are now at %d", m_clients.count() );
267} 267}
268/** 268/**
269 * this function will evaluate 269 * this function will evaluate
270 * the package and then do the appropriate thins 270 * the package and then do the appropriate thins
271 */ 271 */
272void OCopServer::dispatch( const OCOPPacket& packet, int sourceFD ) { 272void OCopServer::dispatch( const OCOPPacket& packet, int sourceFD ) {
273// qWarning("packet.type() == %d", packet.type() ); 273// qWarning("packet.type() == %d", packet.type() );
274 switch( packet.type() ) { 274 switch( packet.type() ) {
275 case OCOPPacket::Register: 275 case OCOPPacket::Register:
276 registerClient(sourceFD ); 276 registerClient(sourceFD );
277 break; 277 break;
278 case OCOPPacket::Unregister: 278 case OCOPPacket::Unregister:
279 deregisterClient(sourceFD ); 279 deregisterClient(sourceFD );
280 break; 280 break;
281 case OCOPPacket::Call: 281 case OCOPPacket::Call:
282 call( packet, sourceFD ); 282 call( packet, sourceFD );
283 break; 283 break;
284 /* not implemented */ 284 /* not implemented */
285 case OCOPPacket::Method: 285 case OCOPPacket::Method:
286 break; 286 break;
287 /* nit implemented */ 287 /* nit implemented */
288 case OCOPPacket::Reply: 288 case OCOPPacket::Reply:
289 break; 289 break;
290 case OCOPPacket::RegisterChannel: 290 case OCOPPacket::RegisterChannel:
291 addChannel( packet.channel() , sourceFD ); 291 addChannel( packet.channel() , sourceFD );
292 break; 292 break;
293 case OCOPPacket::UnregisterChannel: 293 case OCOPPacket::UnregisterChannel:
294 delChannel( packet.channel(), sourceFD ); 294 delChannel( packet.channel(), sourceFD );
295 break; 295 break;
296 /* not implemented */ 296 /* not implemented */
297 case OCOPPacket::Return: 297 case OCOPPacket::Return:
298 break; 298 break;
299 /* not implemented :( */ 299 /* not implemented :( */
300 case OCOPPacket::Signal: 300 case OCOPPacket::Signal:
301 break; 301 break;
302 case OCOPPacket::IsRegistered: 302 case OCOPPacket::IsRegistered:
303// qWarning("Server:IsRegistered %s", packet.channel().data() ); 303// qWarning("Server:IsRegistered %s", packet.channel().data() );
304 isRegistered( packet.channel(), sourceFD ); 304 isRegistered( packet.channel(), sourceFD );
305 break; 305 break;
306 }; 306 };
307} 307}
308void OCopServer::errorOnServer() { 308void OCopServer::errorOnServer() {
309 /* 309 /*
310 * something is wrong on the server socket? 310 * something is wrong on the server socket?
311 * what should we do? 311 * what should we do?
312 * FIXME 312 * FIXME
313 */ 313 */
314} 314}
315QStringList OCopServer::channels() { 315QStringList OCopServer::channels() {
316 QStringList list; 316 QStringList list;
317 { 317 {
318 QMap<QCString, QValueList<int> >::Iterator it; 318 QMap<QCString, QValueList<int> >::Iterator it;
319 for (it = m_channels.begin(); it != m_channels.end(); ++it ) { 319 for (it = m_channels.begin(); it != m_channels.end(); ++it ) {
320 list << it.key(); 320 list << it.key();
321 }; 321 };
322 } 322 }
323 return list; 323 return list;
324} 324}
325bool OCopServer::isChannelRegistered( const QCString& chan ) const{ 325bool OCopServer::isChannelRegistered( const QCString& chan ) const{
326 return m_channels.contains( chan ); 326 return m_channels.contains( chan );
327} 327}
328void OCopServer::addChannel( const QCString& channel, 328void OCopServer::addChannel( const QCString& channel,
329 int fd ) { 329 int fd ) {
330 QMap<QCString, QValueList<int> >::Iterator it; 330 QMap<QCString, QValueList<int> >::Iterator it;
331 it = m_channels.find( channel ); 331 it = m_channels.find( channel );
332 if ( it != m_channels.end() ) { 332 if ( it != m_channels.end() ) {
333 /* could be empty */ 333 /* could be empty */
334 QValueList<int> list = it.data(); 334 QValueList<int> list = it.data();
335 list.append( fd ); 335 list.append( fd );
336 qWarning("Server:count is now in addChannel %d %s", list.count(), channel.data() ); 336 qWarning("Server:count is now in addChannel %d %s", list.count(), channel.data() );
337 it = m_channels.replace( channel, list ); 337 it = m_channels.replace( channel, list );
338 }else { 338 }else {
339 QValueList<int> ints; 339 QValueList<int> ints;
340 ints.append( fd ); 340 ints.append( fd );
341 m_channels.insert( channel, ints ); 341 m_channels.insert( channel, ints );
342 } 342 }
343}; 343};
344void OCopServer::delChannel( const QCString& channel, 344void OCopServer::delChannel( const QCString& channel,
345 int fd ) { 345 int fd ) {
346// qWarning("remove %s, %d", channel.data(), fd ); 346// qWarning("remove %s, %d", channel.data(), fd );
347 if (!m_channels.contains( channel ) ) 347 if (!m_channels.contains( channel ) )
348 return; 348 return;
349 349
350 QMap<QCString, QValueList<int> >::Iterator it; 350 QMap<QCString, QValueList<int> >::Iterator it;
351 it = m_channels.find( channel ); 351 it = m_channels.find( channel );
352 352
353 if ( it.data().contains(fd) ) { 353 if ( it.data().contains(fd) ) {
354 QValueList<int> ints = it.data(); 354 QValueList<int> ints = it.data();
355 if ( ints.count() == 1 ) 355 if ( ints.count() == 1 )
356 m_channels.remove( channel ); 356 m_channels.remove( channel );
357 else{ 357 else{
358 QValueList<int> ints = it.data(); 358 QValueList<int> ints = it.data();
359 QValueList<int>::Iterator rem = ints.find( fd ); 359 QValueList<int>::Iterator rem = ints.find( fd );
360 rem = ints.remove( rem ); 360 rem = ints.remove( rem );
361 QCString str = it.key().copy(); 361 QCString str = it.key().copy();
362 m_channels.replace( str, ints ); 362 m_channels.replace( str, ints );
363 } 363 }
364// qWarning(" channel count is now %d", ints.count() ); 364// qWarning(" channel count is now %d", ints.count() );
365 } 365 }
366} 366}
367void OCopServer::isRegistered( const QCString& channel, int fd) { 367void OCopServer::isRegistered( const QCString& channel, int fd) {
368// qWarning("Server:isRegistered %s", channel.data() ); 368// qWarning("Server:isRegistered %s", channel.data() );
369 OCOPHead head; 369 OCOPHead head;
370 QCString func(2); 370 QCString func(2);
371 371
372 memset(&head, 0, sizeof(head ) ); 372 memset(&head, 0, sizeof(head ) );
373 head.magic = 47; 373 head.magic = 47;
374 head.type = OCOPPacket::IsRegistered; 374 head.type = OCOPPacket::IsRegistered;
375 head.chlen = channel.size(); 375 head.chlen = channel.size();
376 head.funclen = func.size(); 376 head.funclen = func.size();
377 head.datalen = 0; 377 head.datalen = 0;
378 378
379 if ( isChannelRegistered( channel ) ) { 379 if ( isChannelRegistered( channel ) ) {
380 //is registered 380 //is registered
381 func[0] = 1; 381 func[0] = 1;
382 //qWarning("Server:Channel is Registered %d", head.chlen); 382 //qWarning("Server:Channel is Registered %d", head.chlen);
383 }else{ 383 }else{
384 func[0] = 0; 384 func[0] = 0;
385 //qWarning("Server:Channel is NotRegistered"); 385 //qWarning("Server:Channel is NotRegistered");
386 } 386 }
387 387
388 /** 388 /**
389 * write the head 389 * write the head
390 * and then channel 390 * and then channel
391 * success/failure inside func 391 * success/failure inside func
392 */ 392 */
393 write(fd, &head, sizeof(head) ); 393 write(fd, &head, sizeof(head) );
394 write(fd, channel.data(), channel.size() ); 394 write(fd, channel.data(), channel.size() );
395 write(fd, func.data(), func.size() ); 395 write(fd, func.data(), func.size() );
396} 396}
397QValueList<int> OCopServer::clients( const QCString& channel ) { 397QValueList<int> OCopServer::clients( const QCString& channel ) {
398 return m_channels[channel]; 398 return m_channels[channel];
399} 399}
400void OCopServer::call( const OCOPPacket& p, int ) { 400void OCopServer::call( const OCOPPacket& p, int ) {
401 QValueList<int> cli = clients( p.channel() ); 401 QValueList<int> cli = clients( p.channel() );
402 QValueList<int>::Iterator it; 402 QValueList<int>::Iterator it;
403 403
404 OCOPHead head = p.head(); 404 OCOPHead head = p.head();
405 for (it = cli.begin(); it != cli.end(); ++it ) { 405 for (it = cli.begin(); it != cli.end(); ++it ) {
406// qWarning("Server:calling %d %s %s", (*it), p.channel().data(), p.header().data() ); 406// qWarning("Server:calling %d %s %s", (*it), p.channel().data(), p.header().data() );
407 write( (*it), &head, sizeof(head ) ); 407 write( (*it), &head, sizeof(head ) );
408 /* expl. shared! */ 408 /* expl. shared! */
409 write( (*it), p.channel().data(), p.channel().size() ); 409 write( (*it), p.channel().data(), p.channel().size() );
410 write( (*it), p.header().data(), p.header().size() ); 410 write( (*it), p.header().data(), p.header().size() );
411 write( (*it), p.content().data(), p.content().size() ); 411 write( (*it), p.content().data(), p.content().size() );
412 }; 412 };
413} 413}