author | zecke <zecke> | 2004-01-05 14:39:29 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-01-05 14:39:29 (UTC) |
commit | c127e5d582b1ae4033eca1c8454bee75d510b9e8 (patch) (unidiff) | |
tree | e4f6e610969f35e1e0954f762f317c0e9ccf76b3 | |
parent | 7fb9bc93eae8007a6eb298fc743bbf70dc50fbc5 (diff) | |
download | opie-c127e5d582b1ae4033eca1c8454bee75d510b9e8.zip opie-c127e5d582b1ae4033eca1c8454bee75d510b9e8.tar.gz opie-c127e5d582b1ae4033eca1c8454bee75d510b9e8.tar.bz2 |
Spelling fixes by Michael Opdenacker <zumbi2@netcourrier.com>
22 files changed, 53 insertions, 55 deletions
@@ -43,44 +43,44 @@ echo 'yes' | ./configure -qconfig qpe -depths 4,16,24,32 -system-jpeg -system-li | |||
43 | make | 43 | make |
44 | 44 | ||
45 | Once you have these compiled, be sure to set the PATH to ensure your (cross)compiler | 45 | Once you have these compiled, be sure to set the PATH to ensure your (cross)compiler |
46 | is available. | 46 | is available. |
47 | 47 | ||
48 | Then do the following in the opie source tree: | 48 | Then do the following in the opie source tree: |
49 | 49 | ||
50 | make clean | 50 | make clean |
51 | make menuconfig | 51 | make menuconfig |
52 | 52 | ||
53 | Now you can move through the menu and select or deselect anything.. | 53 | Now you can move through the menu and select or deselect anything.. |
54 | Exit and save the configuration and enter "make" to create opie... | 54 | Exit and save the configuration and enter "make" to create opie... |
55 | 55 | ||
56 | Have fun with it ! | 56 | Have fun with it ! |
57 | 57 | ||
58 | If you get into trouble there are other makefile targets | 58 | If you get into trouble there are other makefile targets |
59 | 59 | ||
60 | make clean-configs | 60 | make clean-configs |
61 | is a useful one. | 61 | is a useful one. |
62 | 62 | ||
63 | 2. Used Libraries | 63 | 2. Used Libraries |
64 | ================ | 64 | ================ |
65 | 65 | ||
66 | The following Libraries are used in Opie. | 66 | The following Libraries are used in Opie. |
67 | For a successfull build you must install these librarys and headers. | 67 | For a successful build you must install these librarys and headers. |
68 | The versions are known-good versions. If you successfully try newer ones, | 68 | The versions are known-good versions. If you successfully try newer ones, |
69 | commit a new README or send a mail to opie-devel@handhelds.org | 69 | commit 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 | |||
@@ -351,34 +351,34 @@ int resume ( int resuspend ) | |||
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 | |||
@@ -4520,49 +4520,49 @@ bellhop | |||
4520 | bellhops | 4520 | bellhops |
4521 | bellicose | 4521 | bellicose |
4522 | bellicosity | 4522 | bellicosity |
4523 | bellies | 4523 | bellies |
4524 | belligerence | 4524 | belligerence |
4525 | belligerent | 4525 | belligerent |
4526 | belligerently | 4526 | belligerently |
4527 | belligerents | 4527 | belligerents |
4528 | Bellingham | 4528 | Bellingham |
4529 | Bellini | 4529 | Bellini |
4530 | bellman | 4530 | bellman |
4531 | bellmen | 4531 | bellmen |
4532 | Bellovin | 4532 | Bellovin |
4533 | bellow | 4533 | bellow |
4534 | bellowed | 4534 | bellowed |
4535 | bellowing | 4535 | bellowing |
4536 | bellows | 4536 | bellows |
4537 | bells | 4537 | bells |
4538 | bellum | 4538 | bellum |
4539 | bellwether | 4539 | bellwether |
4540 | bellwethers | 4540 | bellwethers |
4541 | Bellwood | 4541 | Bellwood |
4542 | belly | 4542 | belly |
4543 | bellyache | 4543 | bellyache |
4544 | bellyfull | 4544 | bellyful |
4545 | Belmont | 4545 | Belmont |
4546 | Beloit | 4546 | Beloit |
4547 | belong | 4547 | belong |
4548 | belonged | 4548 | belonged |
4549 | belonging | 4549 | belonging |
4550 | belongings | 4550 | belongings |
4551 | belongs | 4551 | belongs |
4552 | beloved | 4552 | beloved |
4553 | below | 4553 | below |
4554 | Belshazzar | 4554 | Belshazzar |
4555 | belt | 4555 | belt |
4556 | belted | 4556 | belted |
4557 | belting | 4557 | belting |
4558 | Belton | 4558 | Belton |
4559 | belts | 4559 | belts |
4560 | Beltsville | 4560 | Beltsville |
4561 | Belushi | 4561 | Belushi |
4562 | bely | 4562 | bely |
4563 | belying | 4563 | belying |
4564 | bemoan | 4564 | bemoan |
4565 | bemoaned | 4565 | bemoaned |
4566 | bemoaning | 4566 | bemoaning |
4567 | bemoans | 4567 | bemoans |
4568 | Ben | 4568 | Ben |
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 | |||
@@ -38,34 +38,34 @@ original version by: Nikos Drakos, CBLU, University of Leeds | |||
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 |   <B> <A NAME="tex2html70" | 53 |   <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"> |
60 | What it is for</A> | 60 | What it is for</A> |
61 | </H2> | 61 | </H2> |
62 | Opie-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. | 62 | Opie-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 | ||
68 | 2002-05-15 | 68 | 2002-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 | |||
@@ -48,49 +48,49 @@ original version by: Nikos Drakos, CBLU, University of Leeds | |||
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 |   <B> <A NAME="tex2html143" | 52 |   <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"> |
59 | Icons</A> | 59 | Icons</A> |
60 | </H3> | 60 | </H3> |
61 | There 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. | 61 | There 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> |
64 | An 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: | 64 | An 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> |
68 | opie-sh -m -I | 68 | opie-sh -m -I |
69 | </PRE> | 69 | </PRE> |
70 | 70 | ||
71 | <P> | 71 | <P> |
72 | A 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: | 72 | A 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> |
76 | opie-sh -m -w | 76 | opie-sh -m -w |
77 | </PRE> | 77 | </PRE> |
78 | 78 | ||
79 | <P> | 79 | <P> |
80 | An 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: | 80 | An 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> |
84 | opie-sh -m -e | 84 | opie-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" |
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 | |||
@@ -10579,49 +10579,48 @@ sixteen\sedici | |||
10579 | sixteenth\sedicesimo, sedicesima | 10579 | sixteenth\sedicesimo, sedicesima |
10580 | sixth\sesto, sesta | 10580 | sixth\sesto, sesta |
10581 | sixty\sessanta | 10581 | sixty\sessanta |
10582 | size\grossezza | 10582 | size\grossezza |
10583 | size of shoe\numero di scarpa | 10583 | size of shoe\numero di scarpa |
10584 | sizzle\grillare | 10584 | sizzle\grillare |
10585 | skating\pattinaggio artistico | 10585 | skating\pattinaggio artistico |
10586 | skating ring\pista di ghiaccio | 10586 | skating ring\pista di ghiaccio |
10587 | skating rink\pista di ghiaccio | 10587 | skating rink\pista di ghiaccio |
10588 | skein\capestro | 10588 | skein\capestro |
10589 | skeins\capestri | 10589 | skeins\capestri |
10590 | skeleton\scheletro | 10590 | skeleton\scheletro |
10591 | skeletons\scheletri | 10591 | skeletons\scheletri |
10592 | skepticalness\scetticismo | 10592 | skepticalness\scetticismo |
10593 | skepticism\scetticismo | 10593 | skepticism\scetticismo |
10594 | sketch\abbozzo, abbozzare | 10594 | sketch\abbozzo, abbozzare |
10595 | sketchily\volatile, abbozzaticcio, superficiale | 10595 | sketchily\volatile, abbozzaticcio, superficiale |
10596 | sketchiness\poca chiarezza | 10596 | sketchiness\poca chiarezza |
10597 | sketchy\torbido | 10597 | sketchy\torbido |
10598 | skews\storto | 10598 | skews\storto |
10599 | ski\sci | 10599 | ski\sci |
10600 | skid\discesa a valle, avventare | 10600 | skid\discesa a valle, avventare |
10601 | skiful\esperto | 10601 | skiful\esperto |
10602 | skilful\apprèndere, azzeccato | 10602 | skilful\apprèndere, azzeccato |
10603 | skilfull\apprèndere | ||
10604 | skill\sorte, disinvoltura | 10603 | skill\sorte, disinvoltura |
10605 | skilled\versato | 10604 | skilled\versato |
10606 | skilled worker\operaio specializzato | 10605 | skilled worker\operaio specializzato |
10607 | skillet\tegame | 10606 | skillet\tegame |
10608 | skillful\lesto, sveglio, esperto | 10607 | skillful\lesto, sveglio, esperto |
10609 | skillfulness\disinvoltura | 10608 | skillfulness\disinvoltura |
10610 | skimp\lesinare | 10609 | skimp\lesinare |
10611 | skimpiest\piccolissimo | 10610 | skimpiest\piccolissimo |
10612 | skimpily\scarso | 10611 | skimpily\scarso |
10613 | skimpiness\strettezza | 10612 | skimpiness\strettezza |
10614 | skimpy\scarso | 10613 | skimpy\scarso |
10615 | skin\epidèrmide, epidermide | 10614 | skin\epidèrmide, epidermide |
10616 | skinny\scremato, magro, secco | 10615 | skinny\scremato, magro, secco |
10617 | skins\pelli, pelli | 10616 | skins\pelli, pelli |
10618 | skip\saltellare, lancio | 10617 | skip\saltellare, lancio |
10619 | skipper\marinaio | 10618 | skipper\marinaio |
10620 | skirt\gonna | 10619 | skirt\gonna |
10621 | skirting board\battiscopa | 10620 | skirting board\battiscopa |
10622 | skit\satira | 10621 | skit\satira |
10623 | skittle\birillo | 10622 | skittle\birillo |
10624 | skittle alley\gioco dei birilli | 10623 | skittle alley\gioco dei birilli |
10625 | skivvy\biancherìa ìntima | 10624 | skivvy\biancherìa ìntima |
10626 | skulker\lima sorda | 10625 | skulker\lima sorda |
10627 | skunk\puzzola | 10626 | skunk\puzzola |
@@ -12628,49 +12627,48 @@ upraise\esaltare | |||
12628 | upraising\alzante | 12627 | upraising\alzante |
12629 | upright\pari, verticale | 12628 | upright\pari, verticale |
12630 | uprise\levarsi | 12629 | uprise\levarsi |
12631 | uproar\eccitazione | 12630 | uproar\eccitazione |
12632 | uproariously\liuto | 12631 | uproariously\liuto |
12633 | upshot\risultato | 12632 | upshot\risultato |
12634 | upstage\arrivista | 12633 | upstage\arrivista |
12635 | upstairs\in alto, sù | 12634 | upstairs\in alto, sù |
12636 | upturn\incremento | 12635 | upturn\incremento |
12637 | upwards\sù | 12636 | upwards\sù |
12638 | uranium\uranio | 12637 | uranium\uranio |
12639 | urban\urbano | 12638 | urban\urbano |
12640 | urge\premura, incoraggiare | 12639 | urge\premura, incoraggiare |
12641 | urgency\urgenza | 12640 | urgency\urgenza |
12642 | urgent\urgente, legante | 12641 | urgent\urgente, legante |
12643 | urine\orina, uroscopia | 12642 | urine\orina, uroscopia |
12644 | urn\urna | 12643 | urn\urna |
12645 | us\noi, a noi | 12644 | us\noi, a noi |
12646 | usable\usabile | 12645 | usable\usabile |
12647 | usage\uso | 12646 | usage\uso |
12648 | use\uso, adoperare | 12647 | use\uso, adoperare |
12649 | use up\esaurire | 12648 | use up\esaurire |
12650 | used\usato | 12649 | used\usato |
12651 | useful\utile | 12650 | useful\utile |
12652 | usefull\utile | ||
12653 | useless\inutile, disùtile, inservibile | 12651 | useless\inutile, disùtile, inservibile |
12654 | user\utente | 12652 | user\utente |
12655 | uses\usato | 12653 | uses\usato |
12656 | usual\usuale, ordinario | 12654 | usual\usuale, ordinario |
12657 | usually\ordinario | 12655 | usually\ordinario |
12658 | usuries\usura | 12656 | usuries\usura |
12659 | usury\usura | 12657 | usury\usura |
12660 | Utopian\utopico | 12658 | Utopian\utopico |
12661 | utter\estrinsecare | 12659 | utter\estrinsecare |
12662 | vacant\vacante | 12660 | vacant\vacante |
12663 | vacation\vacanze, ferie | 12661 | vacation\vacanze, ferie |
12664 | vaccinate\vaccinare | 12662 | vaccinate\vaccinare |
12665 | vaccination\vaccinazione | 12663 | vaccination\vaccinazione |
12666 | vaccine\vaccino | 12664 | vaccine\vaccino |
12667 | vacuum\vuotaggine | 12665 | vacuum\vuotaggine |
12668 | vacuum cleaner\aspirapòlvere | 12666 | vacuum cleaner\aspirapòlvere |
12669 | vagabond\vagabondaggio | 12667 | vagabond\vagabondaggio |
12670 | vagina\fòdero | 12668 | vagina\fòdero |
12671 | vailable\disponìbile | 12669 | vailable\disponìbile |
12672 | vain\vano | 12670 | vain\vano |
12673 | valerian\valeriana | 12671 | valerian\valeriana |
12674 | valid\valevole | 12672 | valid\valevole |
12675 | validity\validità | 12673 | validity\validità |
12676 | validness\validità | 12674 | validness\validità |
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 | |||
@@ -99,49 +99,49 @@ void FileReceive::receive( const QString& dir ) { | |||
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 | } |
110 | void FileReceive::cancel() { | 110 | void FileReceive::cancel() { |
111 | ::kill(m_pid, 9 ); | 111 | ::kill(m_pid, 9 ); |
112 | } | 112 | } |
113 | void FileReceive::setupChild() { | 113 | void 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 | } |
140 | void FileReceive::slotRead() { | 140 | void 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 ); |
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 | |||
@@ -120,49 +120,49 @@ void FileTransfer::sendFile( const QString& file ) { | |||
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 | */ |
127 | void FileTransfer::sendFile( const QFile& file ) { | 127 | void 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 | */ |
135 | void FileTransfer::setupChild() { | 135 | void 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 | */ |
166 | void FileTransfer::slotRead() { | 166 | void 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 ); |
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 | |||
@@ -734,49 +734,49 @@ bool OpieFtp::populateRemoteView( ) | |||
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 | ||
763 | void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | 763 | void 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)); |
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 | |||
@@ -267,49 +267,49 @@ void BackupAndRestore::backup() | |||
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 | */ |
306 | int BackupAndRestore::getBackupFiles(QString &backupFiles, QListViewItem *parent) | 306 | int 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); |
@@ -435,37 +435,37 @@ void BackupAndRestore::restore() | |||
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 | |||
@@ -53,92 +53,92 @@ void Interface::setHardwareName(const QString &name){ | |||
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 | */ |
60 | void Interface::setModuleOwner(Module *owner){ | 60 | void 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 | */ |
69 | void Interface::start(){ | 69 | void 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 | */ |
91 | void Interface::stop(){ | 91 | void 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 | */ |
112 | void Interface::restart(){ | 112 | void 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 | */ |
122 | bool Interface::refresh(){ | 122 | bool 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); |
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 | |||
@@ -23,49 +23,49 @@ Interfaces::Interfaces(QString useInterfacesFile){ | |||
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 | **/ |
52 | QStringList Interfaces::getInterfaceList(){ | 52 | QStringList 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 |
@@ -105,120 +105,120 @@ bool Interfaces::setAuto(const QString &interface, bool setAuto){ | |||
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 | */ |
131 | bool Interfaces::setInterface(QString interface){ | 131 | bool 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 | */ |
141 | bool Interfaces::isInterfaceSet() const { | 141 | bool 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 | */ |
154 | bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ | 154 | bool 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 | */ |
170 | bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ | 170 | bool 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 | */ |
202 | bool Interfaces::removeInterface(){ | 202 | bool 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 | */ |
211 | QString Interfaces::getInterfaceName(bool &error){ | 211 | QString 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; |
@@ -251,84 +251,84 @@ QString Interfaces::getInterfaceFamily(bool &error){ | |||
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 | */ |
256 | QString Interfaces::getInterfaceMethod(bool &error){ | 256 | QString 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 | */ |
277 | bool Interfaces::setInterfaceName(const QString &newName){ | 277 | bool 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 | */ |
297 | bool Interfaces::setInterfaceFamily(const QString &newName){ | 297 | bool 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 | */ |
312 | bool Interfaces::setInterfaceMethod(const QString &newName){ | 312 | bool 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 | */ |
330 | QString Interfaces::getInterfaceOption(const QString &option, bool &error){ | 330 | QString 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 | /** |
@@ -351,177 +351,177 @@ bool Interfaces::setInterfaceOption(const QString &option, const QString &value) | |||
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 | */ |
358 | bool Interfaces::removeInterfaceOption(const QString &option){ | 358 | bool 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 | */ |
369 | bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){ | 369 | bool 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 | */ |
377 | bool Interfaces::removeAllInterfaceOptions(){ | 377 | bool 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 | */ |
388 | bool Interfaces::setMapping(const QString &interface){ | 388 | bool 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 | */ |
398 | void Interfaces::addMapping(const QString &option){ | 398 | void 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 | */ |
407 | bool Interfaces::removeMapping(){ | 407 | bool 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 | */ |
417 | bool Interfaces::setMap(const QString &map, const QString &value){ | 417 | bool 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 | */ |
427 | bool Interfaces::removeMap(const QString &map, const QString &value){ | 427 | bool 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 | */ |
437 | QString Interfaces::getMap(const QString &map, bool &error){ | 437 | QString 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 | */ |
446 | bool Interfaces::setScript(const QString &argument){ | 446 | bool 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 | */ |
454 | QString Interfaces::getScript(bool &error){ | 454 | QString 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 | */ |
468 | bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){ | 468 | bool 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 | */ |
505 | bool Interfaces::setOption(const QStringList::Iterator &start, const QString &option, const QString &value){ | 505 | bool 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; |
@@ -533,117 +533,117 @@ bool Interfaces::setOption(const QStringList::Iterator &start, const QString &op | |||
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 | */ |
559 | bool Interfaces::removeStanza(QStringList::Iterator &stanza){ | 559 | bool 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 | */ |
572 | bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option){ | 572 | bool 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 | */ |
600 | bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option, const QString &value){ | 600 | bool 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 | */ |
627 | bool Interfaces::removeAllOptions(const QStringList::Iterator &start){ | 627 | bool 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. |
@@ -659,49 +659,49 @@ QString Interfaces::getOption(const QStringList::Iterator &start, const QString | |||
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 | */ |
685 | bool Interfaces::write(){ | 685 | bool 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(); |
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 | |||
@@ -62,49 +62,49 @@ bool InterfaceSetupImp::saveChanges(){ | |||
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 | */ |
88 | bool InterfaceSetupImp::saveSettings(){ | 88 | bool 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 "); |
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 | |||
@@ -64,49 +64,49 @@ public: | |||
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; } |
98 | protected: | 98 | protected: |
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 | ||
106 | private: | 106 | private: |
107 | QStringList m_inter; | 107 | QStringList m_inter; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | #endif | 110 | #endif |
111 | 111 | ||
112 | // module.h | 112 | // module.h |
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 | |||
@@ -159,49 +159,49 @@ QList<Interface> PPPModule::getInterfaces(){ | |||
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 | */ |
162 | Interface *PPPModule::addNewInterface(const QString &newInterface){ | 162 | Interface *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 | */ |
185 | bool PPPModule::remove(Interface *i){ | 185 | bool PPPModule::remove(Interface *i){ |
186 | return list.remove(i); | 186 | return list.remove(i); |
187 | } | 187 | } |
188 | 188 | ||
189 | void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces) | 189 | void 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 | ||
197 | namespace { | 197 | namespace { |
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 | } |
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 | |||
@@ -134,49 +134,49 @@ double WExtensions::rate(){ | |||
134 | * @return QString the AccessPoint that the interface is connected to. | 134 | * @return QString the AccessPoint that the interface is connected to. |
135 | */ | 135 | */ |
136 | QString WExtensions::ap(){ | 136 | QString 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 | */ |
160 | bool WExtensions::stats(int &signal, int &noise, int &quality){ | 160 | bool 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 ); |
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 | |||
@@ -89,49 +89,49 @@ QWidget *WLANModule::information(Interface *i){ | |||
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 | */ |
95 | QList<Interface> WLANModule::getInterfaces(){ | 95 | QList<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 | */ |
105 | Interface *WLANModule::addNewInterface(const QString &){ | 105 | Interface *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 | */ |
115 | bool WLANModule::remove(Interface*){ | 115 | bool 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 | ||
120 | void WLANModule::receive(const QCString ¶m, const QByteArray &arg) | 120 | void WLANModule::receive(const QCString ¶m, 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()); |
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 | |||
@@ -167,67 +167,67 @@ void TabManager::newApplication(){ | |||
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 | */ |
176 | void TabManager::removeItem(){ | 176 | void 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 | */ |
232 | void TabManager::editCurrentItem(){ | 232 | void TabManager::editCurrentItem(){ |
233 | editItem(tabList->currentItem()); | 233 | editItem(tabList->currentItem()); |
@@ -415,49 +415,49 @@ void TabManager::moveApplication(QListViewItem *item, QListViewItem *newGroup){ | |||
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 | */ |
441 | bool TabManager::findInstalledApplication(QString desktopFile, QString &installedAppFile){ | 441 | bool 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 | } |
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 | |||
@@ -7,28 +7,28 @@ General stuff: | |||
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 | ||
10 | Protocol related: | 10 | Protocol 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 | ||
17 | Security related: | 17 | Security 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 | ||
23 | Mail management: | 23 | Mail 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 | ||
28 | Testing: | 28 | Testing: |
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 | ||
33 | If you want something added, drop a mail. Comments are always welcome. | 33 | If 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 | |||
@@ -209,71 +209,71 @@ void FolderWidget::slotIMAPError(int error) | |||
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 | ||
222 | void FolderWidget::slotIMAPDisconnected() | 222 | void FolderWidget::slotIMAPDisconnected() |
223 | { | 223 | { |
224 | emit status(tr("Disconnected.")); | 224 | emit status(tr("Disconnected.")); |
225 | emit disconnected(); | 225 | emit disconnected(); |
226 | } | 226 | } |
227 | 227 | ||
228 | void FolderWidget::slotIMAPLogin(IMAPResponse &response) | 228 | void 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 | ||
239 | void FolderWidget::slotIMAPRename(IMAPResponse &response) | 239 | void 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 | ||
250 | void FolderWidget::slotIMAPDelete(IMAPResponse &response) | 250 | void 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 | ||
266 | void FolderWidget::slotIMAPCreate(IMAPResponse &response) | 266 | void 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 | } |
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 | |||
@@ -321,49 +321,49 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) | |||
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]; |
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 | |||
@@ -94,49 +94,49 @@ void OCopServer::initSocket() { | |||
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 | */ |
112 | void OCopServer::newOnServer() { | 112 | void 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 | } |
129 | int OCopServer::accept() { | 129 | int 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 | } |
136 | void OCopServer::newOnClient( int fd ) { | 136 | void 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 | /* |