summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--README2
-rw-r--r--core/opiealarm/opiealarm.c2
-rw-r--r--etc/dict/words2
-rw-r--r--help/opie-sh/node3.html2
-rw-r--r--help/opie-sh/node9.html2
-rw-r--r--noncore/apps/odict/eng_ita.dic2
-rw-r--r--noncore/apps/opie-console/filereceive.cpp2
-rw-r--r--noncore/apps/opie-console/filetransfer.cpp2
-rw-r--r--noncore/net/opieftp/opieftp.cpp2
-rw-r--r--noncore/settings/backup/backuprestore.cpp4
-rw-r--r--noncore/settings/networksettings/interfaces/interface.cpp8
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.cpp44
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp2
-rw-r--r--noncore/settings/networksettings/module.h2
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wextensions.cpp2
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp2
-rw-r--r--noncore/settings/tabmanager/tabmanager.cpp12
-rw-r--r--noncore/unsupported/mail2/TODO2
-rw-r--r--noncore/unsupported/mail2/folderwidget.cpp6
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp2
-rw-r--r--x11/ipc/server/ocopserver.cpp2
22 files changed, 53 insertions, 55 deletions
diff --git a/README b/README
index 0075bde..cb7d5d4 100644
--- a/README
+++ b/README
@@ -19,68 +19,68 @@ You can get it from:
ftp://ftp.trolltech.com/qt/source/qt-embedded-2.3.7.tar.bz2
Set QTDIR to point to your qt/embedded source tree, such as:
export QTDIR=/opt/qt-2.3.7
You need to do set the OPIEDIR environment variable:
export OPIEDIR=`pwd`
or
export OPIEDIR=~/projects/sources/opie
or whereever you placed the Opie sources.
You need to adjust your runtime library search path,
so that the Qt/Embedded and Opie libraries can be found:
export LD_LIBRARY_PATH=$OPIEDIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH
You have to apply the qte<version>-all.patch to the Qt/Embedded
sources and copy the qconfig-qpe.h file to $QTDIR/src/tools:
cd $QTDIR; cat $OPIEDIR/qt/qte<version>*.patch | patch -p0
cp $OPIEDIR/qt/qpe-config.h $QTDIR/src/tools
You are now ready to configure and build Qt/Embedded
cd $QTDIR
echo 'yes' | ./configure -qconfig qpe -depths 4,16,24,32 -system-jpeg -system-libpng -system-zlib -no-xft -qvfb
make
Once you have these compiled, be sure to set the PATH to ensure your (cross)compiler
is available.
Then do the following in the opie source tree:
make clean
make menuconfig
Now you can move through the menu and select or deselect anything..
Exit and save the configuration and enter "make" to create opie...
Have fun with it !
If you get into trouble there are other makefile targets
make clean-configs
is a useful one.
2. Used Libraries
================
The following Libraries are used in Opie.
-For a successfull build you must install these librarys and headers.
+For a successful build you must install these librarys and headers.
The versions are known-good versions. If you successfully try newer ones,
commit a new README or send a mail to opie-devel@handhelds.org
* libsdl 1.2
http://www.libsdl.org/download-1.2.php
* libxine 1.0 beta 11
http://prdownloads.sourceforge.net/xine/
* libpcap 0.7.2
http://www.tcpdump.org/release/
* libetpan 0.31
http://prdownloads.sourceforge.net/libetpan/ + patch in noncore/net/mail/libetpanstuff
* libsqlite 2.8.6
http://www.sqlite.org/download.html
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
@@ -327,58 +327,58 @@ int onac ( void )
return on;
}
int resume ( int resuspend )
{
FILE *fp;
// re-suspend when on AC (optional) when woken up via RTC
if ( !opiealarm_was_running ) {
// if opiealarm -s didn't wake up via RTC, the old process gets killed
// by kill_by_pidfile(), which is recorded in opiealarm_was_running
if ( resuspend && onac ( )) {
time_t start, now;
char *argv [4];
if ( !fork_with_pidfile ( ))
return 4;
// we can't wait for the resuspend timeout in the parent process.
// so we fork and tell the parent it can exit immediatly
kill ( parent_pid, SIGUSR1 );
// sleep <resuspend> seconds - this method is much more precise than sleep() !
time ( &start );
do {
sleep ( 1 );
time ( &now );
} while (( now - start ) < resuspend );
if ( onac ( )) { // still on ac ?
argv[0] = "qcop";
argv[1] = "QPE/Desktop";
argv[2] = "suspend()";
argv[3] = 0;
// hard coded for now ...but needed
// another way would be to simulate a power-button press
setenv ( "LOGNAME", "root", 1 );
setenv ( "HOME", "/root", 1 );
setenv ( "LD_LIBRARY_PATH", "/opt/QtPalmtop/lib", 1 );
setenv ( "QTDIR", "/opt/QtPalmtop", 1 );
remove_pidfile ( );
- // no need for system() since this process is no longer usefull anyway
+ // no need for system() since this process is no longer useful anyway
execv ( "/opt/QtPalmtop/bin/qcop", argv );
perror ( "exec for qcop failed" );
return 5;
}
}
}
return 0;
}
diff --git a/etc/dict/words b/etc/dict/words
index 1568032..0f14205 100644
--- a/etc/dict/words
+++ b/etc/dict/words
@@ -4496,97 +4496,97 @@ beliefs
belies
believable
believably
believe
believed
believer
believers
believes
believing
belittle
belittled
belittles
belittling
Belize
bell
Bella
Bellamy
Bellatrix
bellboy
bellboys
belle
belles
Belleville
bellhop
bellhops
bellicose
bellicosity
bellies
belligerence
belligerent
belligerently
belligerents
Bellingham
Bellini
bellman
bellmen
Bellovin
bellow
bellowed
bellowing
bellows
bells
bellum
bellwether
bellwethers
Bellwood
belly
bellyache
-bellyfull
+bellyful
Belmont
Beloit
belong
belonged
belonging
belongings
belongs
beloved
below
Belshazzar
belt
belted
belting
Belton
belts
Beltsville
Belushi
bely
belying
bemoan
bemoaned
bemoaning
bemoans
Ben
Benares
bench
benched
benches
benchmark
benchmarking
benchmarks
bend
bendable
Bender
benders
bending
Bendix
bends
beneath
Benedict
Benedictine
benediction
benedictions
Benedikt
benefactor
benefactors
beneficence
beneficences
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
@@ -14,58 +14,58 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="opie-sh-howto.css">
<LINK REL="next" HREF="node4.html">
<LINK REL="previous" HREF="node2.html">
<LINK REL="up" HREF="node2.html">
<LINK REL="next" HREF="node4.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html71"
HREF="node4.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="file:/usr/local/share/lib/latex2html/icons/next.gif"></A>
<A NAME="tex2html67"
HREF="node2.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="file:/usr/local/share/lib/latex2html/icons/up.gif"></A>
<A NAME="tex2html61"
HREF="node2.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="file:/usr/local/share/lib/latex2html/icons/prev.gif"></A>
<A NAME="tex2html69"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="file:/usr/local/share/lib/latex2html/icons/contents.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html72"
HREF="node4.html">What it can do</A>
<B> Up:</B> <A NAME="tex2html68"
HREF="node2.html">Introduction</A>
<B> Previous:</B> <A NAME="tex2html62"
HREF="node2.html">Introduction</A>
&nbsp <B> <A NAME="tex2html70"
HREF="node1.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION00021000000000000000">
What it is for</A>
</H2>
-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.
+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.
<P>
<BR><HR>
<ADDRESS>
2002-05-15
</ADDRESS>
</BODY>
</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
@@ -24,97 +24,97 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<LINK REL="next" HREF="node10.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html144"
HREF="node10.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="file:/usr/local/share/lib/latex2html/icons/next.gif"></A>
<A NAME="tex2html140"
HREF="node6.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="file:/usr/local/share/lib/latex2html/icons/up.gif"></A>
<A NAME="tex2html136"
HREF="node8.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="file:/usr/local/share/lib/latex2html/icons/prev.gif"></A>
<A NAME="tex2html142"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="file:/usr/local/share/lib/latex2html/icons/contents.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html145"
HREF="node10.html">Fileviewer</A>
<B> Up:</B> <A NAME="tex2html141"
HREF="node6.html">Usage</A>
<B> Previous:</B> <A NAME="tex2html137"
HREF="node8.html">Buttons</A>
&nbsp <B> <A NAME="tex2html143"
HREF="node1.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H3><A NAME="SECTION00031300000000000000">
Icons</A>
</H3>
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.
<P>
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:
<P>
<PRE>
opie-sh -m -I
</PRE>
<P>
-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:
+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:
<P>
<PRE>
opie-sh -m -w
</PRE>
<P>
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:
<P>
<PRE>
opie-sh -m -e
</PRE>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html144"
HREF="node10.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="file:/usr/local/share/lib/latex2html/icons/next.gif"></A>
<A NAME="tex2html140"
HREF="node6.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="file:/usr/local/share/lib/latex2html/icons/up.gif"></A>
<A NAME="tex2html136"
HREF="node8.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="file:/usr/local/share/lib/latex2html/icons/prev.gif"></A>
<A NAME="tex2html142"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="file:/usr/local/share/lib/latex2html/icons/contents.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html145"
HREF="node10.html">Fileviewer</A>
<B> Up:</B> <A NAME="tex2html141"
HREF="node6.html">Usage</A>
<B> Previous:</B> <A NAME="tex2html137"
HREF="node8.html">Buttons</A>
&nbsp <B> <A NAME="tex2html143"
HREF="node1.html">Contents</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
2002-05-15
</ADDRESS>
</BODY>
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
@@ -10555,97 +10555,96 @@ sinks\abbassa
sinned\peccato
sinner\peccatore
sins\peccati
sinuous\contorto
sip\sorso
sir\signore
sire\testimoniare
sirloin\lonza
sissy\effeminato
sister\sorella
sister in law\cognata
sit\star seduto
sit down\accomodarsi
site\posto, circostanza
site of crime\luogo del fatto
sits\siede
sitting\seduto
sitting room\salotto
situate\allineare, mettere, mettere
situated\posto
situation\situazione, posizione, circostanza
six\sei
sixfold\sestuplo
sixteen\sedici
sixteenth\sedicesimo, sedicesima
sixth\sesto, sesta
sixty\sessanta
size\grossezza
size of shoe\numero di scarpa
sizzle\grillare
skating\pattinaggio artistico
skating ring\pista di ghiaccio
skating rink\pista di ghiaccio
skein\capestro
skeins\capestri
skeleton\scheletro
skeletons\scheletri
skepticalness\scetticismo
skepticism\scetticismo
sketch\abbozzo, abbozzare
sketchily\volatile, abbozzaticcio, superficiale
sketchiness\poca chiarezza
sketchy\torbido
skews\storto
ski\sci
skid\discesa a valle, avventare
skiful\esperto
skilful\apprèndere, azzeccato
-skilfull\apprèndere
skill\sorte, disinvoltura
skilled\versato
skilled worker\operaio specializzato
skillet\tegame
skillful\lesto, sveglio, esperto
skillfulness\disinvoltura
skimp\lesinare
skimpiest\piccolissimo
skimpily\scarso
skimpiness\strettezza
skimpy\scarso
skin\epidèrmide, epidermide
skinny\scremato, magro, secco
skins\pelli, pelli
skip\saltellare, lancio
skipper\marinaio
skirt\gonna
skirting board\battiscopa
skit\satira
skittle\birillo
skittle alley\gioco dei birilli
skivvy\biancherìa ìntima
skulker\lima sorda
skunk\puzzola
sky\cielo
skylark\lodola
skyrocket\razzo
skyscraper\grattacielo, grattacielo
skyscrapers\grattacielo
slab\frantumare
slack\lasco, floscio
slack joint\contatto lasco
slack period\ristagno
slacken\rilassare, rilassare
slackens\rilassato
slacker\scansafatiche
slacks\pantaloni
slake\allattamento
slam\sbattere
slammed\sbattuto
slander\calunniare
slanderer\calunniatore
slanderous\calunnioso
slanderousness\calunnia
slant\declinazione
slanting\obliquo, obliquo
slantingly\obliqua
slap\picchiare, ceffone
@@ -12604,97 +12603,96 @@ unwounded\illeso
unwrought\grezzo
up\sù, a, sù, sù
up above\sù
up there\lassù
upbraiding\rimprovero
upbringing\creanza
upchuck\vòmito
upcoming\prossimamente
upgrade\estensione, ampliare
upgrades\trasportato
upgrading\estensione
upheaval\elevamento
uphold\durare
upholster\imbottire
upholsterer\tappezziere
upkeep\manutenzione
uplift\esaltare
uplifting\alzante
upon\a
upper arm\braccio superiore
upper case character\lettera maiuscola
uppish\impettito
uppity\baldanzoso
upraise\esaltare
upraising\alzante
upright\pari, verticale
uprise\levarsi
uproar\eccitazione
uproariously\liuto
upshot\risultato
upstage\arrivista
upstairs\in alto, sù
upturn\incremento
upwards\sù
uranium\uranio
urban\urbano
urge\premura, incoraggiare
urgency\urgenza
urgent\urgente, legante
urine\orina, uroscopia
urn\urna
us\noi, a noi
usable\usabile
usage\uso
use\uso, adoperare
use up\esaurire
used\usato
useful\utile
-usefull\utile
useless\inutile, disùtile, inservibile
user\utente
uses\usato
usual\usuale, ordinario
usually\ordinario
usuries\usura
usury\usura
Utopian\utopico
utter\estrinsecare
vacant\vacante
vacation\vacanze, ferie
vaccinate\vaccinare
vaccination\vaccinazione
vaccine\vaccino
vacuum\vuotaggine
vacuum cleaner\aspirapòlvere
vagabond\vagabondaggio
vagina\fòdero
vailable\disponìbile
vain\vano
valerian\valeriana
valid\valevole
validity\validità
validness\validità
valley\valle
valorize\valorizzare
valse\valzer
valuable\pregiato
valuables\valori
value\valutare, valore
valuejudgment\valutazione
valve\valvola, valvola
vanguard\avanguardia
vanilla\vainiglia
vanish\scomparire
vanity\fatuità
vaporizer\vaporizzatore
vapors\evaporazione
vapour\vapore
variable\variàbile
variance\contrarietà
variation\aberrazione
varicosity\varice
various\differente
variousness\varietà
varnish\vernice
vary\variare
vascular\recipiente
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
@@ -75,88 +75,88 @@ void FileReceive::receive( const QString& dir ) {
char resultByte; int len;
len = read(m_info[0], &resultByte, 1 );
/* len == 1 start up failed */
if ( len == 1 ) {
emit error( StartError, tr("Could not start") );
return;
}
if ( len == -1 )
if ( (errno == ECHILD ) || (errno == EINTR ) )
continue;
// len == 0 or something like this
break;
}
if ( m_info[0] )
close( m_info[0] );
m_not = new QSocketNotifier(m_comm[0], QSocketNotifier::Read );
connect(m_not, SIGNAL(activated(int) ),
this, SLOT(slotRead() ) );
if ( pipe(m_term) < 0 )
m_term[0] = m_term[1] = 0;
ProcCtl::self()->add(m_pid, m_term[1] );
m_proc = new QSocketNotifier(m_term[0], QSocketNotifier::Read );
connect(m_proc, SIGNAL(activated(int) ),
this, SLOT(slotExec() ) );
}
break;
}
}
void FileReceive::cancel() {
::kill(m_pid, 9 );
}
void FileReceive::setupChild() {
changeDir( currentDir() );
/*
* we do not want to read from our
* information channel
*/
if (m_info[0] )
close(m_info[0] );
/*
* FD_CLOEXEC will close the
- * fd on successfull exec
+ * fd on successful exec
*/
if (m_info[1] )
fcntl(m_info[1], F_SETFD, FD_CLOEXEC );
if (m_comm[0] )
close( m_comm[0] );
/*
* now set the communication
* m_fd STDIN_FILENO
* STDOUT_FILENO
* STDERR_FILENO
*/
dup2( m_fd, STDIN_FILENO );
dup2( m_fd, STDOUT_FILENO );
dup2( m_comm[1], STDERR_FILENO );
}
void FileReceive::slotRead() {
QByteArray ar(4096);
int len = read(m_comm[0], ar.data(), 4096 );
for (int i = 0; i < len; i++ ) {
// printf("%c", ar[i] );
}
ar.resize( len );
QString str( ar );
}
void FileReceive::slotExec() {
char buf[2];
::read(m_term[0], buf, 1 );
delete m_proc;
delete m_not;
m_not = m_proc = 0l;
close( m_term[0] );
close( m_term[1] );
close( m_comm[0] );
close( m_comm[1] );
layer()->closeRawIO(m_fd);
emit received(QString::null);
}
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
@@ -96,97 +96,97 @@ void FileTransfer::sendFile( const QString& file ) {
if ( len == -1 )
if ( (errno == ECHILD ) || (errno == EINTR ) )
continue;
// len == 0 or something like this
break;
}
if ( m_info[0] )
close( m_info[0] );
/* replace by QSocketNotifier!!! */
m_not = new QSocketNotifier(m_comm[0], QSocketNotifier::Read );
connect(m_not, SIGNAL(activated(int) ),
this, SLOT(slotRead() ) );
if ( pipe(m_term) < 0 )
m_term[0] = m_term[1] = 0;
ProcCtl::self()->add(m_pid, m_term[1] );
m_proc = new QSocketNotifier(m_term[0], QSocketNotifier::Read );
connect(m_proc, SIGNAL(activated(int) ),
this, SLOT(slotExec() ) );
}
break;
}
}
/*
* let's call the one with the filename
*/
void FileTransfer::sendFile( const QFile& file ) {
sendFile( file.name() );
}
/*
* setting up communication
* between parent child and ioLayer
*/
void FileTransfer::setupChild() {
/*
* we do not want to read from our
* information channel
*/
if (m_info[0] )
close(m_info[0] );
/*
* FD_CLOEXEC will close the
- * fd on successfull exec
+ * fd on successful exec
*/
if (m_info[1] )
fcntl(m_info[1], F_SETFD, FD_CLOEXEC );
if (m_comm[0] )
close( m_comm[0] );
/*
* now set the communication
* m_fd STDIN_FILENO
* STDOUT_FILENO
* STDERR_FILENO
*/
dup2( m_fd, STDIN_FILENO );
dup2( m_fd, STDOUT_FILENO );
dup2( m_comm[1], STDERR_FILENO );
}
/*
* read from the stderr of the child
* process
*/
void FileTransfer::slotRead() {
QByteArray ar(4096);
int len = read(m_comm[0], ar.data(), 4096 );
for (int i = 0; i < len; i++ ) {
// printf("%c", ar[i] );
}
ar.resize( len );
QString str( ar );
QStringList lis = QStringList::split(' ', str );
/*
* Transfer finished.. either complete or incomplete
*/
if ( lis[0].simplifyWhiteSpace() == "Transfer" ) {
return;
}
/*
* do progress reading
*/
slotProgress( lis );
}
/*
* find the progress
*/
void FileTransfer::slotProgress( const QStringList& list ) {
if ( m_type != SZ )
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
@@ -710,97 +710,97 @@ bool OpieFtp::populateRemoteView( )
QString sfile=QDir::homeDirPath();
if(sfile.right(1) != "/")
sfile+="/._temp";
else
sfile+="._temp";
QFile file( sfile);
Remote_View->clear();
QString s, File_Name;
QListViewItem *itemDir=NULL, *itemFile=NULL;
QRegExp monthRe(" [JFMASOND][eapuecoe][brynlgptvc] [ 0-9][0-9] [ 0-9][0-9][:0-9][0-9][0-9] ");
QString fileL, fileS, fileDate;
if ( file.open(IO_ReadOnly)) {
QTextStream t( &file ); // use a text stream
while ( !t.eof()) {
s = t.readLine();
if(s.find("total",0,TRUE) == 0)
continue;
int len, month = monthRe.match(s, 0, &len);
fileDate = s.mid(month + 1, len - 2); // minus spaces
fileL = s.right(s.length() - month - len);
if(s.left(1) == "d")
fileL = fileL+"/";
fileS = s.mid(month - 8, 8); // FIXME
fileS = fileS.stripWhiteSpace();
if(s.left(1) == "d" || fileL.find("/",0,TRUE) != -1) {
QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"d");
item->setPixmap( 0, Resource::loadPixmap( "folder" ));
// if(itemDir)
item->moveItem(itemDir);
itemDir=item;
} else {
QListViewItem * item = new QListViewItem( Remote_View, fileL, fileDate, fileS,"f");
item->setPixmap( 0, Resource::loadPixmap( "fileopen" ));
// if(itemFile)
item->moveItem(itemDir);
item->moveItem(itemFile);
itemFile=item;
}
}
QListViewItem * item1 = new QListViewItem( Remote_View, "../");
item1->setPixmap( 0, Resource::loadPixmap( "folder" ));
file.close();
if( file.exists())
file. remove();
} else
- qDebug("temp file not opened successfullly "+sfile);
+ qDebug("temp file not opened successfully "+sfile);
Remote_View->setSorting( 4,TRUE);
return true;
}
void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
{
if( selectedItem) {
// if(selectedItem!= NULL) {
// QCopEnvelope ( "QPE/System", "busy()" );
QString oldRemoteCurrentDir = currentRemoteDir;
QString strItem=selectedItem->text(0);
strItem=strItem.simplifyWhiteSpace();
if(strItem == "../") { // the user wants to go ^
if( FtpCDUp( conn) == 0) {
QString msg;
msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn));
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
// qDebug(msg);
}
char path[256];
if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string
QString msg;
msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn));
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
// qDebug(msg);
}
currentRemoteDir=path;
} else {
if(strItem.find("->",0,TRUE) != -1) { //symlink on some servers
strItem=strItem.right( strItem.length() - strItem.find("->",0,TRUE) - 2 );
strItem = strItem.stripWhiteSpace();
currentRemoteDir = strItem;
if( !remoteChDir( (const QString &)strItem)) {
currentRemoteDir = oldRemoteCurrentDir;
strItem="";
// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir);
}
} else if(strItem.find("/",0,TRUE) != -1) { // this is a directory
if( !remoteChDir( (const QString &)currentRemoteDir + strItem)) {
currentRemoteDir = oldRemoteCurrentDir;
strItem="";
// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir);
} else {
currentRemoteDir = currentRemoteDir+strItem;
}
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
@@ -243,97 +243,97 @@ void BackupAndRestore::backup()
QString commandLine = QString( "(tar -C %1 -c %2 | gzip > %3 ) 2> %4" ).arg( QDir::homeDirPath() )
.arg( backupFiles )
.arg( outputFile.latin1() )
.arg( tempFileName.latin1() );
qDebug( commandLine );
int r = system( commandLine );
if(r != 0)
{
perror("Error: ");
QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n"
+ errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) )
{
case 1:
qWarning("Details pressed !");
ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
QFile errorFile( tempFileName );
if ( errorFile.open(IO_ReadOnly) )
{
QTextStream t( &errorFile );
QString s;
while ( !t.eof() )
{ // until end of file...
s += t.readLine(); // line of text excluding '\n'
}
errorFile.close();
pErrDialog->m_textarea->setText( s );
}
else
{
pErrDialog->m_textarea->setText( "Unable to open File: /tmp/backup.er" );
}
pErrDialog->showMaximized();
pErrDialog->exec();
delete pErrDialog;
break;
}
setCaption(tr("Backup and Restore.. Failed !!"));
return;
}
else
{
- QMessageBox::information(this, tr( "Message" ), tr( "Backup Successfull." ), QString(tr( "Ok" ) ) );
+ QMessageBox::information(this, tr( "Message" ), tr( "Backup Successful." ), QString(tr( "Ok" ) ) );
}
//write store-location
Config config( "BackupAndRestore" );
config.setGroup( "LastLocation" );
config.writeEntry( "LastStoreLocation", storeToLocation->currentText() );
setCaption(tr("Backup and Restore"));
}
/***
* Get a list of all of the files to backup.
*/
int BackupAndRestore::getBackupFiles(QString &backupFiles, QListViewItem *parent)
{
QListViewItem * currentItem;
QString currentHome;
if(!parent)
currentItem = backupList->firstChild();
else
{
currentItem = parent->firstChild();
currentHome = parent->text(BACKUP_LOCATION);
}
uint count = 0;
while( currentItem != 0 )
{
if(currentItem->text(HEADER_BACKUP) == "B" )
{
if(currentItem->childCount() == 0 )
{
if(parent == NULL)
backupFiles += currentItem->text(BACKUP_LOCATION);
else
backupFiles += currentHome + currentItem->text(HEADER_NAME);
backupFiles += " ";
count++;
}
else
{
count += getBackupFiles(backupFiles, currentItem);
}
}
currentItem = currentItem->nextSibling();
}
return count;
@@ -411,61 +411,61 @@ void BackupAndRestore::restore()
QString commandLine = QString( "tar -C %1 -zxf %2 2> %3" ).arg( QDir::homeDirPath() )
.arg( restoreFile.latin1() )
.arg( tempFileName.latin1() );
qDebug( commandLine );
int r = system( commandLine );
if(r != 0)
{
QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n"
+ errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) )
{
case 1:
qWarning("Details pressed !");
ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
QFile errorFile( tempFileName );
if ( errorFile.open(IO_ReadOnly) )
{
QTextStream t( &errorFile );
QString s;
while ( !t.eof() )
{ // until end of file...
s += t.readLine(); // line of text excluding '\n'
}
errorFile.close();
pErrDialog->m_textarea->setText( s );
}
else
{
pErrDialog->m_textarea->setText( tr( "Unable to open File: %1" ).arg( "/tmp/backup.er" ) );
}
pErrDialog->showMaximized();
pErrDialog->exec();
delete pErrDialog;
setCaption(tr("Backup and Restore.. Failed !!"));
return;
break;
}
}
else
{
- QMessageBox::information(this, tr( "Message" ), tr( "Restore Successfull." ), QString( tr( "Ok") ) );
+ QMessageBox::information(this, tr( "Message" ), tr( "Restore Successful." ), QString( tr( "Ok") ) );
}
//write restore-location
Config config( "BackupAndRestore" );
config.setGroup( "LastLocation" );
config.writeEntry( "LastRestoreLocation", restoreSource->currentText() );
setCaption(tr("Backup and Restore"));
}
// backuprestore.cpp
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
@@ -29,140 +29,140 @@ void Interface::setStatus(bool newStatus){
if(status != newStatus){
status = newStatus;
refresh();
}
};
/**
* Set if attached or not (802.11 card pulled out for example)
* @param isAttached - if attached
* emit updateInterface
*/
void Interface::setAttached(bool isAttached){
attached = isAttached;
emit(updateInterface(this));
};
/**
* Set Hardware name
* @param name - the new name
* emit updateInterface
*/
void Interface::setHardwareName(const QString &name){
hardwareName = name;
emit(updateInterface(this));
};
/**
* Set Module owner
* @param owner - the new owner
* emit updateInterface
*/
void Interface::setModuleOwner(Module *owner){
moduleOwner = owner;
emit(updateInterface(this));
};
/**
* Try to start the interface.
*/
void Interface::start(){
// check to see if we are already running.
if(true == status){
emit (updateMessage("Unable to start interface,\n already started"));
return;
}
int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1());
- // See if it was successfull...
+ // See if it was successful...
if(ret != 0){
emit (updateMessage("Starting interface failed"));
return;
}
status = true;
refresh();
- emit (updateMessage("Start successfull"));
+ emit (updateMessage("Start successful"));
}
/**
* Try to stop the interface.
*/
void Interface::stop(){
// check to see if we are already stopped.
if(false == status){
emit (updateMessage("Unable to stop interface,\n already stopped"));
return;
}
int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1());
if(ret != 0){
emit (updateMessage("Stopping interface failed"));
return;
}
status = false;
refresh();
- emit (updateMessage("Stop successfull"));
+ emit (updateMessage("Stop successful"));
}
/**
* Try to restart the interface.
*/
void Interface::restart(){
stop();
start();
}
/**
* Try to refresh the information about the interface.
* First call ifconfig, then check the dhcp-info file
- * @return bool true if successfull.
+ * @return bool true if successful.
*/
bool Interface::refresh(){
// See if we are up.
if(status == false){
macAddress = "";
ip = "0.0.0.0";
subnetMask = "0.0.0.0";
broadcast = "";
dhcp = false;
dhcpServerIp = "";
leaseObtained = "";
leaseExpires = "";
emit(updateInterface(this));
return true;
}
QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name());
int ret = system(QString("LANG=C %1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1());
if(ret != 0){
qDebug(QString("Interface: Ifconfig return value: %1, is not 0").arg(ret).latin1());
return false;
}
QFile file(fileName);
if (!file.open(IO_ReadOnly)){
qDebug(QString("Interface: Can't open file: %1").arg(fileName).latin1());
return false;
}
// Set to the defaults
macAddress = "";
ip = "0.0.0.0";
subnetMask = "0.0.0.0";
broadcast = "";
QTextStream stream( &file );
QString line;
while ( !stream.eof() ) {
line = stream.readLine();
if(line.contains("HWaddr")){
int mac = line.find("HWaddr");
macAddress = line.mid(mac+7, line.length());
}
if(line.contains("inet addr")){
int ipl = line.find("inet addr");
int space = line.find(" ", ipl+10);
ip = line.mid(ipl+10, space-ipl-10);
}
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp
index 436e449..6b161ae 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaces.cpp
@@ -1,712 +1,712 @@
#include "interfaces.h"
#include <qcheckbox.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qregexp.h>
// The three stanza's
#define AUTO "auto"
#define IFACE "iface"
#define MAPPING "mapping"
/**
* Constructor. Reads in the interfaces file and then split the file up by
* the \n for interfaces variable.
* @param useInterfacesFile if an interface file other then the default is
* desired to be used it should be passed in.
*/
Interfaces::Interfaces(QString useInterfacesFile){
acceptedFamily.append(INTERFACES_FAMILY_INET);
acceptedFamily.append(INTERFACES_FAMILY_IPX);
acceptedFamily.append(INTERFACES_FAMILY_INET6);
interfacesFile = useInterfacesFile;
QFile file(interfacesFile);
if (!file.open(IO_ReadOnly)){
qDebug("Interfaces: Can't open file: %s for reading.", interfacesFile.latin1() );
currentIface = interfaces.end();
currentMapping = interfaces.end();
return;
}
QTextStream stream( &file );
QString line;
while ( !stream.eof() ) {
line += stream.readLine();
line += "\n";
}
file.close();
interfaces = QStringList::split("\n", line, true);
currentIface = interfaces.end();
currentMapping = interfaces.end();
}
/**
- * Get a list of all interfaces in the interface file. Usefull for
+ * Get a list of all interfaces in the interface file. Useful for
* hardware that is not currently connected such as an 802.11b card
* not plugged in, but configured for when it is plugged in.
* @return Return string list of interfaces.
**/
QStringList Interfaces::getInterfaceList(){
QStringList list;
for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
QString line = (*it).simplifyWhiteSpace();
if(line.contains(IFACE) && line.at(0) != '#'){
line = line.mid(QString(IFACE).length() +1, line.length());
line = line.simplifyWhiteSpace();
int findSpace = line.find(" ");
if( findSpace >= 0){
line = line.mid(0, findSpace);
list.append(line);
}
}
}
return list;
}
/**
* Find out if interface is in an "auto" group or not.
* Report any duplicates such as eth0 being in two differnt auto's
* @param interface interface to check to see if it is on or not.
* @return true is interface is in auto
*/
bool Interfaces::isAuto(const QString &interface) const {
QStringList autoLines = interfaces.grep(QRegExp(AUTO));
QStringList awi = autoLines.grep(QRegExp(interface));
if(awi.count() > 1)
qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1());
return awi.count() > 0;
}
/**
* Attempt to set the auto option for interface to setAuto.
* @param interface the interface to set
* @param setAuto the value to set interface to.
* @return false if already set to setAuto.
* */
bool Interfaces::setAuto(const QString &interface, bool setAuto){
// Don't need to set it if it is already set.
if(isAuto(interface) == setAuto)
return false;
bool changed = false;
for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
if((*it).contains(AUTO)){
//We know that they are not in any group so let add to this auto.
if(setAuto){
(*it) = (*it) += " " + interface;
// Don't care to have such thins as: auto eth0 lo usb0
(*it) = (*it).simplifyWhiteSpace();
changed = true;
break;
}
// else see if we need to remove from this one
else{
if((*it).contains(interface)){
(*it) = (*it).replace(QRegExp(interface), "");
// if AUTO is the only thing left clear the line
if(((*it).simplifyWhiteSpace()).replace(QRegExp(" "),"") == AUTO)
(*it) = "";
changed = true;
// Don't break because we want to make sure we remove all cases.
}
}
}
}
// In the case where there is no AUTO field add one.
if(!changed && setAuto)
interfaces.append(QString(AUTO" %1").arg(interface));
return true;
}
/**
* Set the current interface to interface. This needs to be done before you
* can call getFamily(), getMethod, and get/setOption().
* @param interface the name of the interface to set. All whitespace is
* removed from the interface name.
- * @return bool true if it is successfull.
+ * @return bool true if it is successful.
*/
bool Interfaces::setInterface(QString interface){
interface = interface.simplifyWhiteSpace();
interface = interface.replace(QRegExp(" "), "");
return setStanza(IFACE, interface, currentIface);
}
/**
* A quick helper funtion to see if the current interface is set.
* @return bool true if set, false otherwise.
*/
bool Interfaces::isInterfaceSet() const {
return (interfaces.end() != currentIface);
}
/**
* Add a new interface of with the settings - family and method
* @param interface the name of the interface to set. All whitespace is
* removed from the interface name.
* @param family the family of this interface inet or inet, ipx or inet6
* Must of one of the families defined in interfaces.h
* @param method for the family. see interfaces man page for family methods.
- * @return true if successfull.
+ * @return true if successful.
*/
bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){
qDebug("Interfaces::addInterface(%s)",interface.latin1());
if(0 == acceptedFamily.contains(family))
return false;
QString newInterface = interface.simplifyWhiteSpace();
newInterface = newInterface.replace(QRegExp(" "), "");
interfaces.append("");
interfaces.append(QString(IFACE " %1 %2 %3").arg(newInterface).arg(family).arg(method));
return true;
}
/**
* Copies interface with name interface to name newInterface
* @param newInterface name of the new interface.
- * @return bool true if successfull
+ * @return bool true if successful
*/
bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){
qDebug("copy interface %s to %s", interface.latin1(), newInterface.latin1());
if(!setInterface(interface))
return false;
// Store the old interface and bump past the stanza line.
QStringList::Iterator it = currentIface;
it++;
// Add the new interface
bool error;
addInterface(newInterface, getInterfaceFamily(error), getInterfaceMethod(error));
if(!setInterface(newInterface))
return false;
QStringList::Iterator newIface = currentIface;
newIface++;
// Copy all of the lines
for ( ; it != interfaces.end(); ++it ){
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)))
break;
newIface = interfaces.insert(newIface, *it);
}
return true;
}
/**
* Remove the currently selected interface and all of its options.
- * @return bool if successfull or not.
+ * @return bool if successful or not.
*/
bool Interfaces::removeInterface(){
return removeStanza(currentIface);
}
/**
* Gets the hardware name of the interface that is currently selected.
* @return QString name of the hardware interface (eth0, usb2, wlan1...).
* @param error set to true if any error occurs, false otherwise.
*/
QString Interfaces::getInterfaceName(bool &error){
if(currentIface == interfaces.end()){
error = true;
return QString();
}
QString line = (*currentIface);
line = line.mid(QString(IFACE).length() +1, line.length());
line = line.simplifyWhiteSpace();
int findSpace = line.find(" ");
if( findSpace < 0){
error = true;
return QString();
}
error = false;
return line.mid(0, findSpace);
}
/**
* Gets the family name of the interface that is currently selected.
* @return QString name of the family (inet, inet6, ipx).
* @param error set to true if any error occurs, false otherwise.
*/
QString Interfaces::getInterfaceFamily(bool &error){
QString name = getInterfaceName(error);
if(error)
return QString();
QString line = (*currentIface);
line = line.mid(QString(IFACE).length() +1, line.length());
line = line.mid(name.length()+1, line.length());
line = line.simplifyWhiteSpace();
int findSpace = line.find(" ");
if( findSpace < 0){
error = true;
return QString();
}
error = false;
return line.mid(0, findSpace);
}
/**
* Gets the method of the interface that is currently selected.
* @return QString name of the method such as staic or dhcp.
* See the man page of interfaces for possible methods depending on the family.
* @param error set to true if any error occurs, false otherwise.
*/
QString Interfaces::getInterfaceMethod(bool &error){
QString name = getInterfaceName(error);
if(error)
return QString();
QString family = getInterfaceFamily(error);
if(error)
return QString();
QString line = (*currentIface);
line = line.mid(QString(IFACE).length()+1, line.length());
line = line.mid(name.length()+1, line.length());
line = line.mid(family.length()+1, line.length());
line = line.simplifyWhiteSpace();
error = false;
return line;
}
/**
* Sets the interface name to newName.
* @param newName the new name of the interface. All whitespace is removed.
- * @return bool true if successfull.
+ * @return bool true if successful.
*/
bool Interfaces::setInterfaceName(const QString &newName){
qDebug("setInterfaceName %s", newName.latin1());
if(currentIface == interfaces.end())
return false;
QString name = newName.simplifyWhiteSpace();
name = name.replace(QRegExp(" "), "");
bool returnValue = false;
QString tmp = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue));
qDebug("setting %s",tmp.latin1());
(*currentIface) = tmp;
return !returnValue;
}
/**
* Sets the interface family to newName.
* @param newName the new name of the interface. Must be one of the families
* defined in the interfaces.h file.
- * @return bool true if successfull.
+ * @return bool true if successful.
*/
bool Interfaces::setInterfaceFamily(const QString &newName){
if(currentIface == interfaces.end())
return false;
if(acceptedFamily.contains(newName)==0)
return false;
bool returnValue = false;
(*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(newName).arg(getInterfaceMethod(returnValue));
return !returnValue;
}
/**
* Sets the interface method to newName
* @param newName the new name of the interface
- * @return bool true if successfull.
+ * @return bool true if successful.
*/
bool Interfaces::setInterfaceMethod(const QString &newName){
if(currentIface == interfaces.end())
return false;
bool returnValue = false;
(*currentIface) = QString("iface %1 %2 %3").arg(getInterfaceName(returnValue)).arg(getInterfaceFamily(returnValue)).arg(newName);
return !returnValue;
}
/**
* Get a value for an option in the currently selected interface. For example
* calling getInterfaceOption("address") on the following stanza would
* return 192.168.1.1.
* iface eth0 static
* address 192.168.1.1
* @param option the options to get the value.
* @param error set to true if any error occurs, false otherwise.
* @return QString the options value. QString::null if error == true
*/
QString Interfaces::getInterfaceOption(const QString &option, bool &error){
return getOption(currentIface, option, error);
}
/**
* Set a value for an option in the currently selected interface. If option
* doesn't exist then it is added along with the value.
* If value isEmpty() then we will remove the option
*
* @param option the options to set the value.
* @param value the value that option should be set to.
* @param error set to true if any error occurs, false otherwise.
* @return QString the options value. QString::null if error == true
*/
bool Interfaces::setInterfaceOption(const QString &option, const QString &value){
if( value.stripWhiteSpace().isEmpty() )
return removeInterfaceOption( option );
qDebug("iface >%s< option >%s< value >%s<", (*currentIface).latin1(), option.latin1(),value.latin1());
return setOption(currentIface, option, value);
}
/**
* Removes a value for an option in the currently selected interface.
* @param option the options to set the value.
* @param error set to true if any error occurs, false otherwise.
* @return QString the options value. QString::null if error == true
*/
bool Interfaces::removeInterfaceOption(const QString &option){
return removeOption(currentIface, option);
}
/**
* Removes a value for an option in the currently selected interface.
* @param option the options to set the value.
* @param value the value that option should be set to.
* @param error set to true if any error occurs, false otherwise.
* @return QString the options value. QString::null if error == true
*/
bool Interfaces::removeInterfaceOption(const QString &option, const QString &value){
return removeOption(currentIface, option, value);
}
/**
* Removes all of the options from the currently selected interface.
- * @return bool error if if successfull
+ * @return bool error if if successful
*/
bool Interfaces::removeAllInterfaceOptions(){
return removeAllOptions(currentIface);
}
/**
* Set the current map to interface's map. This needs to be done before you
* can call addMapping(), set/getMap(), and get/setScript().
* @param interface the name of the interface to set. All whitespace is
* removed from the interface name.
- * @return bool true if it is successfull.
+ * @return bool true if it is successful.
*/
bool Interfaces::setMapping(const QString &interface){
QString interfaceName = interface.simplifyWhiteSpace();
interfaceName = interfaceName.replace(QRegExp(" "), "");
return setStanza(MAPPING, interfaceName, currentMapping);
}
/**
* Adds a new Mapping to the interfaces file with interfaces.
* @param interface the name(s) of the interfaces to set to this mapping
*/
void Interfaces::addMapping(const QString &option){
interfaces.append("");
interfaces.append(QString(MAPPING " %1").arg(option));
}
/**
* Remove the currently selected map and all of its options.
- * @return bool if successfull or not.
+ * @return bool if successful or not.
*/
bool Interfaces::removeMapping(){
return removeStanza(currentMapping);
}
/**
* Set a map option within a mapping.
* @param map map to use
* @param value value to go with map
- * @return bool true if it is successfull.
+ * @return bool true if it is successful.
*/
bool Interfaces::setMap(const QString &map, const QString &value){
return setOption(currentMapping, map, value);
}
/**
* Removes a map option within a mapping.
* @param map map to use
* @param value value to go with map
- * @return bool true if it is successfull.
+ * @return bool true if it is successful.
*/
bool Interfaces::removeMap(const QString &map, const QString &value){
return removeOption(currentMapping, map, value);
}
/**
* Get a map value within a mapping.
* @param map map to get value of
- * @param bool true if it is successfull.
+ * @param bool true if it is successful.
* @return value that goes to the map
*/
QString Interfaces::getMap(const QString &map, bool &error){
return getOption(currentMapping, map, error);
}
/**
* Sets a script value of the current mapping to argument.
* @param argument the script name.
- * @return true if successfull.
+ * @return true if successful.
*/
bool Interfaces::setScript(const QString &argument){
return setOption(currentMapping, "script", argument);
}
/**
* @param error true if could not retrieve the current script argument.
* @return QString the argument of the script for the current mapping.
*/
QString Interfaces::getScript(bool &error){
return getOption(currentMapping, "script", error);
}
/**
* Helper function used to parse through the QStringList and put pointers in
* the correct place.
* @param stanza The stanza (auto, iface, mapping) to look for.
* @param option string that must be in the stanza's main line.
- * @param interator interator to place at location of stanza if successfull.
+ * @param interator interator to place at location of stanza if successful.
* @return bool true if the stanza is found.
*/
bool Interfaces::setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator){
bool found = false;
iterator = interfaces.end();
for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
QString line = (*it).simplifyWhiteSpace();
if(line.contains(stanza) && line.contains(option) && line.at(0) != '#'){
uint point = line.find(option);
bool valid = true;
if(point > 0){
// There are more chars in the line. check +1
if(line.at(point-1) != ' ')
valid = false;
}
point += option.length();
if(point < line.length()-1){
// There are more chars in the line. check -1
if(line.at(point) != ' ')
valid = false;
}
if(valid){
if(found == true){
qDebug(QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1());
}
found = true;
iterator = it;
}
}
}
return found;
}
/**
* Sets a value of an option in a stanza
* @param start the start of the stanza
* @param option the option to use when setting value.
- * @return bool true if successfull, false otherwise.
+ * @return bool true if successful, false otherwise.
*/
bool Interfaces::setOption(const QStringList::Iterator &start, const QString &option, const QString &value){
if(start == interfaces.end())
return false;
qDebug("setting option");
bool found = false;
bool replaced = false;
QStringList::Iterator insertAt = NULL;
for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
qDebug(" Interfaces::setOption got line >%s<",(*it).latin1());
// FIXME: was not completly stupid just wrong sice all options got inserted bevore the iface line
// but since it works with an empty interfaces file I (tille) will not do anything more
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) ){
if (found) break;
// && it != start){
// if(!found && value != ""){
// // Got to the end of the stanza without finding it, so append it.
// qDebug(" Got to the end of the stanza without finding it, so append it.");
// interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value));
// }
qDebug("found 1");
// interfaces.insert(++it, QString("\t%1 %2").arg(option).arg(value));
found = true;
insertAt = it;
}
if((*it).contains(option) && it != start && (*it).at(0) != '#'){
// Found it in stanza so replace it.
qDebug("found 2");
if(found)
qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
found = true;
replaced = true;
(*it) = QString("\t%1 %2").arg(option).arg(value);
}
}
if(!found){
qDebug("! found insert anyway");
QStringList::Iterator p = start;
interfaces.insert(++p, QString("\t%1 %2").arg(option).arg(value));
found = true;
}
if(found && !replaced){
qDebug("found iface but not the option so insert it here...");
interfaces.insert(++insertAt, QString("\t%1 %2").arg(option).arg(value));
}
return found;
}
/**
* Removes a stanza and all of its options
* @param stanza the stanza to remove
- * @return bool true if successfull.
+ * @return bool true if successful.
*/
bool Interfaces::removeStanza(QStringList::Iterator &stanza){
if(stanza == interfaces.end())
return false;
(*stanza) = "";
return removeAllOptions(stanza);
}
/**
* Removes a option in a stanza
* @param start the start of the stanza
* @param option the option to remove
- * @return bool true if successfull, false otherwise.
+ * @return bool true if successful, false otherwise.
*/
bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option){
if(start == interfaces.end())
return false;
bool found = false;
for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
// got to the end without finding it
break;
}
if((*it).contains(option) && it != start && (*it).at(0) != '#'){
// Found it in stanza so replace it.
if(found)
qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
found = true;
it = interfaces.remove( it ); // we really want to remove the line
--it; // we do ++it later in the head of the for loop
}
}
return found;
}
/**
* Removes a option in a stanza
* @param start the start of the stanza
* @param option the option to use when setting value.
- * @return bool true if successfull, false otherwise.
+ * @return bool true if successful, false otherwise.
*/
bool Interfaces::removeOption(const QStringList::Iterator &start, const QString &option, const QString &value){
if(start == interfaces.end())
return false;
bool found = false;
for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
// got to the end without finding it
break;
}
if((*it).contains(option) && (*it).contains(value) && it != start && (*it).at(0) != '#'){
// Found it in stanza so replace it.
if(found)
qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1());
found = true;
it = interfaces.remove( it ); // we really want to remove the line
--it; // we do ++it later in the head of the for loop
}
}
return found;
}
/**
* Removes all options in a stanza
* @param start the start of the stanza
- * @return bool true if successfull, false otherwise.
+ * @return bool true if successful, false otherwise.
*/
bool Interfaces::removeAllOptions(const QStringList::Iterator &start){
if(start == interfaces.end())
return false;
QStringList::Iterator it = start;
it = ++it;
for (; it != interfaces.end(); ++it ) {
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
break;
}
it = interfaces.remove(it);
it = --it;
}
// Leave a space between this interface and the next.
interfaces.insert(it, QString(""));
return true;
}
/**
* Gets a value of an option in a stanza
* @param start the start of the stanza
* @param option the option to use when getting the value.
* @param bool true if errors false otherwise.
* @return QString the value of option QString::null() if error == true.
*/
QString Interfaces::getOption(const QStringList::Iterator &start, const QString &option, bool &error){
if(start == interfaces.end()){
error = false;
return QString();
}
QString value;
bool found = false;
for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
break;
}
if((*it).contains(option) && (*it).at(0) != '#'){
if(found)
qDebug(QString("Interfaces: getOption found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1());
found = true;
QString line = (*it).simplifyWhiteSpace();
int space = line.find(" ", option.length());
if(space != -1){
value = line.mid(space+1, line.length());
break;
}
}
}
error = !found;
return value;
}
/**
* Write out the interfaces file to the file passed into the constructor.
* Removes any excess blank lines over 1 line long.
- * @return bool true if successfull, false if not.
+ * @return bool true if successful, false if not.
*/
bool Interfaces::write(){
QFile::remove(interfacesFile);
QFile file(interfacesFile);
if (!file.open(IO_ReadWrite)){
qDebug(QString("Interfaces: Can't open file: %1 for writing.").arg(interfacesFile).latin1());
return false;
}
QTextStream stream( &file );
int whiteSpaceCount = 0;
for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
QString line = (*it).simplifyWhiteSpace();
line = line.replace(QRegExp(" "),"");
if(line.length() == 0)
whiteSpaceCount++;
else
whiteSpaceCount = 0;
if(whiteSpaceCount < 2){
qDebug((*it).latin1());
stream << (*it) << '\n';
}
}
file.close();
return true;
}
// interfaces.cpp
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
@@ -38,97 +38,97 @@ InterfaceSetupImp::~InterfaceSetupImp(){
}
}
/**
* Save the current settings, then write out the interfaces file and close.
*/
bool InterfaceSetupImp::saveChanges(){
bool error;
QString iface = interfaces->getInterfaceName(error);
qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() );
if(!saveSettings())
return false;
interfaces->write();
if (interface->getStatus()) {
QString ifup;
ifup += "ifdown ";
ifup += iface;
ifup += "; ifup ";
ifup += iface;
ifup += ";";
OProcess restart;
restart << "sh";
restart << "-c";
restart << ifup;
OWait *owait = new OWait();
Global::statusMessage( tr( "Restarting interface" ) );
owait->show();
qApp->processEvents();
if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) {
qWarning("unstable to spawn ifdown/ifup");
}
owait->hide();
delete owait;
interface->refresh();
}
return true;
}
/**
* Save the settings for the current Interface.
- * @return bool true if successfull, false otherwise
+ * @return bool true if successful, false otherwise
*/
bool InterfaceSetupImp::saveSettings(){
// eh can't really do anything about it other then return. :-D
if(!interfaces->isInterfaceSet())
return true;
bool error = false;
// Loopback case
if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){
interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked());
return true;
}
if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){
QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok);
return false;
}
// DHCP
if(dhcpCheckBox->isChecked()) {
interfaces->setInterfaceMethod(INTERFACES_METHOD_DHCP);
interfaces->removeInterfaceOption("address");
interfaces->removeInterfaceOption("netmask");
interfaces->removeInterfaceOption("gateway");
interfaces->removeInterfaceOption("up "DNSSCRIPT" -a ");
interfaces->removeInterfaceOption("down "DNSSCRIPT" -r ");
} else{
interfaces->setInterfaceMethod("static");
interfaces->setInterfaceOption("address", ipAddressEdit->text());
interfaces->setInterfaceOption("netmask", subnetMaskEdit->text());
interfaces->setInterfaceOption("gateway", gatewayEdit->text());
if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){
QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text();
interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns);
interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns);
}else{
interfaces->removeInterfaceOption("up "DNSSCRIPT" -a ");
interfaces->removeInterfaceOption("down "DNSSCRIPT" -r");
}
}
// IP Information
interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked());
return true;
}
/**
* The Profile has changed.
* @param QString profile the new profile.
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
@@ -40,74 +40,74 @@ public:
* @param Interface* can be used in determining the icon.
* @return QString the icon name (minus .png, .gif etc)
*/
virtual QString getPixmapName(Interface *) = 0;
/**
* Check to see if the interface i is owned by this module.
* @param Interface* interface to check against
* @return bool true if i is owned by this module, false otherwise.
*/
virtual bool isOwner(Interface *){ return false; };
/**
* Create and return the WLANConfigure Module
* @param Interface *i the interface to configure.
* @return QWidget* pointer to this modules configure.
*/
virtual QWidget *configure(Interface *){ return NULL; } ;
/**
* Create, and return the Information Module
* @param Interface *i the interface to get info on.
* @return QWidget* pointer to this modules info.
*/
virtual QWidget *information(Interface *){ return NULL; };
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
virtual QList<Interface> getInterfaces() = 0;
/**
* Adds possible new interfaces to the list (Example: usb(ppp), ir(ppp),
* modem ppp)
*/
virtual void possibleNewInterfaces(QMap<QString, QString> &list) = 0;
/**
* Attempts to create a new interface from name
* @return Interface* NULL if it was unable to be created.
* @param name the type of interface to create
*/
virtual Interface *addNewInterface(const QString &name) = 0;
/**
* Attempts to remove the interface, doesn't delete i
- * @return bool true if successfull, false otherwise.
+ * @return bool true if successful, false otherwise.
*/
virtual bool remove(Interface* i) = 0;
/**
* get dcop calls
*/
virtual void receive(const QCString &msg, const QByteArray &arg) = 0;
QStringList handledInterfaceNames()const { return m_inter; }
protected:
/**
* set which interfaceNames should not be shown cause they're handled
* internally of this module.. An already running ppp link or
* a tunnel...
*/
void setHandledInterfaceNames( const QStringList& in) { m_inter = in; }
private:
QStringList m_inter;
};
#endif
// 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
@@ -135,97 +135,97 @@ QWidget *PPPModule::configure(Interface *i){
* Create, and return the Information Module
* @return QWidget* pointer to this modules info.
*/
QWidget *PPPModule::information(Interface *i){
// We don't have any advanced pppd information widget yet :-D
// TODO ^
return new InterfaceInformationPPP( 0, "InterfaceInformationPPP", i );
}
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
QList<Interface> PPPModule::getInterfaces(){
// List all of the files in the peer directory
qDebug("PPPModule::getInterfaces");
return list;
}
/**
* Attempt to add a new interface as defined by name
* @param name the name of the type of interface that should be created given
* by possibleNewInterfaces();
* @return Interface* NULL if it was unable to be created.
*/
Interface *PPPModule::addNewInterface(const QString &newInterface){
InterfacePPP *ifaceppp;
Interface *iface;
ifaceppp = new InterfacePPP();
PPPConfigWidget imp(ifaceppp, 0, "PPPConfigImp", true);
imp.showMaximized();
if(imp.exec() == QDialog::Accepted ){
iface = (InterfacePPP*) ifaceppp;
iface->setModuleOwner( this );
list.append( iface );
return iface;
}else {
delete ifaceppp;
iface = NULL;
}
return iface;
}
/**
* Attempts to remove the interface, doesn't delete i
- * @return bool true if successfull, false otherwise.
+ * @return bool true if successful, false otherwise.
*/
bool PPPModule::remove(Interface *i){
return list.remove(i);
}
void PPPModule::possibleNewInterfaces(QMap<QString, QString> &newIfaces)
{
newIfaces.insert(QObject::tr("PPP") ,
QObject::tr("generic ppp device"));
}
namespace {
InterfaceKeeper::InterfaceKeeper( ) {
}
InterfaceKeeper::~InterfaceKeeper() {
Config cfg("ppp_plugin_keeper");
QStringList lst = cfg.groupList();
for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
Connection con;
cfg.setGroup( (*it) );
cfg.clearGroup();
}
for (QMap<QString, Connection>::Iterator it = m_interfaces.begin(); it != m_interfaces.end(); ++it ) {
Connection con = it.data();
cfg.setGroup( con.name );
cfg.writeEntry( "pid", con.pid );
cfg.writeEntry( "device", con.device );
}
}
void InterfaceKeeper::addInterface(pid_t pid, const QString& dev, const QString& name ) {
Connection con;
con.pid = pid;
con.device = dev;
con.name = name;
m_interfaces.insert( name, con );
}
QMap<QString, Connection> InterfaceKeeper::interfaces()const {
Config cfg("ppp_plugin_keeper");
QMap<QString, Connection> ifaces;
QStringList lst = cfg.groupList();
for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
Connection con;
cfg.setGroup( (*it) );
con.name = (*it);
con.pid = cfg.readNumEntry("pid");
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
@@ -110,91 +110,91 @@ int WExtensions::channel(){
if( num >= left && num <= right )
return channel;
left += 0.005;
right += 0.005;
}
qDebug(QString("Unknown frequency: %1, returning -1 for the channel.").arg(num).latin1());
return -1;
}
/***
* Get the current rate that the card is transmiting at.
* @return double the rate, 0 if error.
*/
double WExtensions::rate(){
if(!hasWirelessExtensions)
return 0;
if(0 == ioctl(fd, SIOCGIWRATE, &iwr)){
return ((double)iwr.u.bitrate.value)/1000000;
}
return 0;
}
/**
* @return QString the AccessPoint that the interface is connected to.
*/
QString WExtensions::ap(){
if(!hasWirelessExtensions)
return QString();
if ( 0 == ioctl( fd, SIOCGIWAP, &iwr )){
QString ap;
ap = ap.sprintf( "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",
iwr.u.ap_addr.sa_data[0]&0xff,
iwr.u.ap_addr.sa_data[1]&0xff,
iwr.u.ap_addr.sa_data[2]&0xff,
iwr.u.ap_addr.sa_data[3]&0xff,
iwr.u.ap_addr.sa_data[4]&0xff,
iwr.u.ap_addr.sa_data[5]&0xff );
return ap;
}
else return QString();
}
/**
* Get the stats for interfaces
* @param signal the signal strength of interface
* @param noise the noise level of the interface
* @param quality the quality level of the interface
- * @return bool true if successfull
+ * @return bool true if successful
*/
bool WExtensions::stats(int &signal, int &noise, int &quality){
// gather link quality from /proc/net/wireless
if(!QFile::exists(PROCNETWIRELESS))
return false;
char c;
QString status;
QString name;
QFile wfile( PROCNETWIRELESS );
if(!wfile.open( IO_ReadOnly ))
return false;
QTextStream wstream( &wfile );
wstream.readLine(); // skip the first two lines
wstream.readLine(); // because they only contain headers
while(!wstream.atEnd()){
wstream >> name >> status >> quality >> c >> signal >> c >> noise;
if(name == QString("%1:").arg(interface)){
if ( quality > 92 )
qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality );
if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) )
qDebug( "WIFIAPPLET: Doh! Strength %d > estimated max!\n", signal );
if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) )
qDebug( "WIFIAPPLET: Doh! Noise %d > estimated max!\n", noise );
//qDebug(QString("q:%1, s:%2, n:%3").arg(quality).arg(signal).arg(noise).latin1());
signal = ( ( signal-IW_LOWER ) * 100 ) / IW_UPPER;
noise = ( ( noise-IW_LOWER ) * 100 ) / IW_UPPER;
quality = ( quality*100 ) / 92;
return true;
}
}
qDebug("WExtensions::statsCard no longer present.");
quality = -1;
signal = IW_LOWER;
noise = IW_LOWER;
return false;
}
// wextensions.cpp
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index b4c3509..07bf73f 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -65,97 +65,97 @@ bool WLANModule::isOwner(Interface *i){
return true;
}
/**
* Create, and return the WLANConfigure Module
* @return QWidget* pointer to this modules configure.
*/
QWidget *WLANModule::configure(Interface *i){
WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, Qt::WDestructiveClose);
wlanconfig->setProfile(profile);
return wlanconfig;
}
/**
* Create, and return the Information Module
* @return QWidget* pointer to this modules info.
*/
QWidget *WLANModule::information(Interface *i){
WExtensions we(i->getInterfaceName());
if(!we.doesHaveWirelessExtensions())
return NULL;
return getInfo( i );
}
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
QList<Interface> WLANModule::getInterfaces(){
return list;
}
/**
* Attempt to add a new interface as defined by name
* @param name the name of the type of interface that should be created given
* by possibleNewInterfaces();
* @return Interface* NULL if it was unable to be created.
*/
Interface *WLANModule::addNewInterface(const QString &){
// We can't add a 802.11 interface, either the hardware will be there
// or it wont.
return NULL;
}
/**
* Attempts to remove the interface, doesn't delete i
- * @return bool true if successfull, false otherwise.
+ * @return bool true if successful, false otherwise.
*/
bool WLANModule::remove(Interface*){
// Can't remove a hardware device, you can stop it though.
return false;
}
void WLANModule::receive(const QCString &param, const QByteArray &arg)
{
qDebug("WLANModule::receive "+param);
QStringList params = QStringList::split(",",param);
int count = params.count();
qDebug("WLANModule got %i params", count );
if (count < 2){
qDebug("Erorr less than 2 parameter");
qDebug("RETURNING");
return;
}
QDataStream stream(arg,IO_ReadOnly);
QString interface;
QString action;
int countMsgs = 0;
stream >> interface;
qDebug("got count? >%s<",interface.latin1());
if (interface == "count"){
qDebug("got count");
stream >> action;
qDebug("Got count num >%s<", action.latin1());
countMsgs = action.toInt();
}
QDialog *toShow;
//while (! stream.atEnd() ){
for (int i = 0; i < countMsgs; i++){
qDebug("start stream %d/%d",i,countMsgs);
if (stream.atEnd()){
qDebug("end of stream");
return;
}
stream >> interface;
qDebug("got iface");
stream >> action;
qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1());
// find interfaces
Interface *ifa=0;
for ( Interface *i=list.first(); i != 0; i=list.next() ){
if (i->getInterfaceName() == interface){
qDebug("WLANModule found interface %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
@@ -143,115 +143,115 @@ void TabManager::newFolder(){
* Make sure a tab is selected
* create physical file
* fill file with default information (entry, name, type).
*/
void TabManager::newApplication(){
QListViewItem *item = tabList->currentItem();
if(!item || item->parent())
return;
QString parentDir = itemList[item].mid(0,itemList[item].length()-11);
QString homeLocation = parentDir + "/" NEW_APPLICATION APPLICATION_EXTENSION;
system((QString("echo [Desktop Entry] | cat >> ") + homeLocation).latin1());
system((QString("echo Name=" NEW_APPLICATION " | cat >> ") + homeLocation).latin1());
int slash = parentDir.findRev('/', -1);
QString folderName = parentDir.mid(slash+1, parentDir.length());
system((QString("echo Type=") + folderName + " | cat >> " + homeLocation).latin1());
// Insert into the tree
QListViewItem *newItem = new QListViewItem(item, NEW_APPLICATION);
itemList.insert(newItem, homeLocation );
// We have changed something.
changed = true;
}
/**
* Remove the item.
* Check if we can
* Prompt user
* Delete physical file (Dir, remove .dir, then dir. File, remove file)
* Remove from installer if need too.
*/
void TabManager::removeItem(){
// Make sure we can delete
QListViewItem *item = tabList->currentItem();
if(!item)
return;
if(item->childCount() > 0){
QMessageBox::critical(this, tr("Message"), tr("Can't remove with applications\nstill in the group."), tr("Ok") );
return;
}
// Prompt.
int answer = QMessageBox::warning(this, tr("Message"), tr("Are you sure you want to delete?"), tr("Yes"), tr("Cancel"), 0, 1 );
if (answer)
return;
- bool removeSuccessfull = true;
+ bool removeSuccessful = true;
QString location = itemList[item];
// Remove file (.directory in a Directory case)
if(!QFile::remove(location))
- removeSuccessfull = false;
+ removeSuccessful = false;
// Remove directory
if(item->parent() == NULL){
// Remove .directory file string
location = location.mid(0,location.length()-10);
QDir dir;
if(!dir.rmdir(location))
- removeSuccessfull = false;
+ removeSuccessful = false;
else
- removeSuccessfull = true;
+ removeSuccessful = true;
}
// If removing failed.
- if(!removeSuccessfull){
+ if(!removeSuccessful){
qDebug((QString("removeItem: ") + location).latin1());
QMessageBox::critical(this, tr("Message"), tr("Can't remove."), tr("Ok") );
return;
}
// Remove from the installer so it wont fail.
// Don't need to do this sense the current install uses rm -f so no error
// Remove from the gui list.
itemList.remove(item);
if(item->parent())
item->parent()->takeItem(item);
delete item;
// We have changed something.
changed = true;
}
/**
* Helper function. Edits the current item.
* calls editItem with the currently selected item.
*/
void TabManager::editCurrentItem(){
editItem(tabList->currentItem());
}
/**
* Edit the item that is passed in.
* Show application dialog and if anything changed
* @param item the item to edit.
*/
void TabManager::editItem( QListViewItem * item){
if(!item)
return;
TabAppLnk app(itemList[item]);
if(!app.isValid()){
qDebug(QString("editItem: Not a valid applnk file: ") + itemList[item].latin1());
return;
}
// Fill with all of the icons
if(!application){
Wait waitDialog(this, "Wait dialog");
waitDialog.waitLabel->setText(tr("Gathering icons..."));
waitDialog.show();
qApp->processEvents();
application = new AppEdit(this, "Application edit", true);
@@ -391,97 +391,97 @@ void TabManager::moveApplication(QListViewItem *item, QListViewItem *newGroup){
int slash = newFolder.findRev('/', -1);
QString folderName = newFolder.mid(slash+1, newFolder.length());
QString desktopFile = itemList[item];
slash = desktopFile.findRev('/', -1);
desktopFile = desktopFile.mid(slash, desktopFile.length());
newFolder = newFolder + desktopFile;
// Move file
QDir r;
if(!r.rename(itemList[item], newFolder)){
QMessageBox::critical(this, tr("Message"), "Can't move application.", tr("Ok") );
return;
}
//qDebug((QString("moveApplication: ") + itemList[item]).latin1());
//qDebug((QString("moveApplication: ") + newFolder).latin1());
// Move in the gui
item->parent()->takeItem(item);
newGroup->insertItem(item);
newGroup->setOpen(true);
// Move file in the installer
QString installedAppFile;
if(findInstalledApplication(desktopFile, installedAppFile))
swapInstalledLocation(installedAppFile, desktopFile, newFolder);
else
qDebug("moveApplication: No installed app found for dekstop file");
// Move application type
AppLnk app(newFolder);
app.setType(folderName);
app.writeLink();
// Move in our internal list
itemList.remove(item);
itemList.insert(item, newFolder);
// We have changed something.
changed = true;
}
/**
* File the installed application that has this desktop file.
* Go through each file in HOME_APP_INSTALL_DIR and see if it contains desktop
* file
* @param desktopFile - the .desktop file to search for [foo.desktop]
* @param installedAppFile - location of the app install list
- * @return true if successfull, false if file not found.
+ * @return true if successful, false if file not found.
*/
bool TabManager::findInstalledApplication(QString desktopFile, QString &installedAppFile){
QDir d;
d.setPath(HOME_APP_INSTALL_DIR);
d.setFilter( QDir::Files );
const QFileInfoList *list = d.entryInfoList();
QFileInfoListIterator it( *list ); // create list iterator
QFileInfo *fi; // pointer for traversing
while ( (fi=it.current()) ) { // for each file...
QFile file(QString(HOME_APP_INSTALL_DIR) + "/" + fi->fileName());
if ( file.open(IO_ReadOnly) ) { // file opened successfully
QTextStream stream( &file ); // use a text stream
QString line;
while ( !stream.eof() ) { // until end of file...
line = stream.readLine(); // line of text excluding '\n'
if(line.contains(desktopFile)){
installedAppFile = QString(HOME_APP_INSTALL_DIR) + "/" + fi->fileName();
file.close();
return true;
}
}
file.close();
}
else
qDebug((QString("findInstalledApplication: Can't open file") + HOME_APP_INSTALL_DIR + "/" + fi->fileName()).latin1());
++it; // goto next list element
}
return false;
}
/**
* Open a file and replace a file containing the old desktop file with the new.
* @param installedAppFile application installed list
* @param desktopFile old .desktop file
* @param newLocation new .desktop file
*/
void TabManager::swapInstalledLocation( QString installedAppFile, QString desktopFile, QString newLocation ){
QFile file(installedAppFile);
if ( !file.open(IO_ReadOnly) ){
qDebug(QString("swapInstalledLocation: Can't edit file: %1").arg(installedAppFile).latin1());
return;
}
QTextStream stream( &file ); // use a text stream
QString allLines;
diff --git a/noncore/unsupported/mail2/TODO b/noncore/unsupported/mail2/TODO
index 4bc434f..3c83fdd 100644
--- a/noncore/unsupported/mail2/TODO
+++ b/noncore/unsupported/mail2/TODO
@@ -1,34 +1,34 @@
Mail TODO
-----------------------------------------------------------------------------
General stuff:
- This program needs a name!
- If password is empty, ask for it during fetch.
- Check if all necessary fields in AccoundEditor are filled.
- Seperate Sending and Recieving in configuration.
Protocol related:
- The IMAP implentation is kinda strange and slow.
- The SMTP implentation is goddamn strange.
- POP3 support would be nice.
- NNTP would be kinda neat, too.
- Implent a plugin system.
Security related:
- GnuPG support. This will require a seperate gpg managing utility in
the settings tab.
- sMIME? maybe in the distant future.
- Integrated SSH tunneling.
Mail management:
- Header caching
- Sieve filtering support?
- Enqueueing/Draft support both on the IMAP server and local.
Testing:
I'm using the courier-imap server at my developement site. I didn't have
much opportunity to test on other servers. Giving me test-accounts on other
- servers would be helpfull.
+ servers would be helpful.
If you want something added, drop a mail. Comments are always welcome.
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
@@ -185,119 +185,119 @@ void FolderWidget::slotItemClicked(QListViewItem *item)
if (folder.fullName().isEmpty()) return;
emit folderSelected(folder);
}
void FolderWidget::slotIMAPLookingUpHost()
{
emit status(tr("Looking up host..."));
emit connecting();
}
void FolderWidget::slotIMAPHostFound()
{
emit status(tr("Host found."));
}
void FolderWidget::slotIMAPConnected()
{
emit status(tr("Connected to host."));
emit connected();
}
void FolderWidget::slotIMAPError(int error)
{
if (error == IMAPBase::IMAPErrConnectionRefused) {
QMessageBox::warning(this, tr("Error"), tr("<p>The IMAP connection was refused.</p>"), tr("Ok"));
} else if (error == IMAPBase::IMAPErrHostNotFound) {
QMessageBox::warning(this, tr("Error"), tr("<p>The host was not found.</p>"), tr("Ok"));
} else if (error == IMAPBase::IMAPErrSocketRead) {
QMessageBox::warning(this, tr("Error"), tr("<p>There was an error while reading from the socket.</p>"), tr("Ok"));
} else if (error == IMAPBase::IMAPErrLoginFailed) {
QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Check your password/username.</p>"), tr("Ok"));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>An unknown error was encountered.</p>"), tr("Ok"));
}
}
void FolderWidget::slotIMAPDisconnected()
{
emit status(tr("Disconnected."));
emit disconnected();
}
void FolderWidget::slotIMAPLogin(IMAPResponse &response)
{
disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPLogin(IMAPResponse &)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
- emit status(tr("Login successfull!"));
+ emit status(tr("Login successful!"));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Login failed. Go away.</p>"), tr("Ok"));
}
}
void FolderWidget::slotIMAPRename(IMAPResponse &response)
{
disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPRename(IMAPResponse &)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
- emit status(tr("Renaming successfull!"));
+ emit status(tr("Renaming successful!"));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Renaming failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
}
}
void FolderWidget::slotIMAPDelete(IMAPResponse &response)
{
disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPDelete(IMAPResponse &)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
- emit status(tr("Deletion successfull!"));
+ emit status(tr("Deletion successful!"));
_rescanAccount = _createFolder.topFolder().account();
_createFolder.topFolder().handler()->iList(".", "*");
connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &)));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>Delete failed. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
}
}
void FolderWidget::slotIMAPCreate(IMAPResponse &response)
{
disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPCreate(IMAPResponse &)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
emit status(tr("Folder created. Rescanning..."));
_rescanAccount = _createFolder.topFolder().account();
_createFolder.topFolder().handler()->iList(".", "*");
connect(_createFolder.topFolder().handler(), SIGNAL(gotResponse(IMAPResponse &)), SLOT(slotIMAPList(IMAPResponse &)));
} else {
QMessageBox::warning(this, tr("Error"), tr("<p>The folder could not be created. (Server said: %1)</p>").arg(response.statusResponse().comment()), tr("Ok"));
}
}
void FolderWidget::slotIMAPList(IMAPResponse &response)
{
disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPList(IMAPResponse &)));
if (response.statusResponse().status() == IMAPResponseEnums::OK) {
QDir d((QString) getenv("HOME") + "/Applications/mail/foldercache");
if (!d.exists()) {
system("mkdir -p $HOME/Applications/mail/foldercache");
qWarning("Created $HOME/Applications/mail/foldercache.");
}
QFile f((QString) getenv("HOME") + "/Applications/mail/foldercache/foldercache-" + _rescanAccount.accountName());
if (!f.open(IO_WriteOnly)) {
QMessageBox::critical(this, tr("Error"), tr("<p>Couldn't open folder cache file for writing!</p>"), tr("Ok"));
return;
}
QTextStream t(&f);
QValueList<IMAPResponseLIST>::Iterator it;
QValueList<IMAPResponseLIST> lists = response.LIST();
for (it = lists.begin(); it != lists.end(); it++) {
t << (*it).folderSeparator() << "\n";
t << (*it).folder() << "\n";
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
@@ -297,97 +297,97 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << ");" << "\n"
<< "\t\t\t" << "isa = PBXLegacyTarget;" << "\n"
<< "\t\t\t" << "name = QtPreprocessors;" << "\n"
<< "\t\t\t" << "productName = QtPreprocessors;" << "\n"
<< "\t\t\t" << "settingsToExpand = 6;" << "\n"
<< "\t\t\t" << "settingsToPassInEnvironment = 287;" << "\n"
<< "\t\t\t" << "settingsToPassOnCommandLine = 280;" << "\n"
<< "\t\t\t" << "shouldsUseHeadermap = 0;" << "\n"
<< "\t\t" << "};" << "\n";
QString target_depend_key = keyFor("QMAKE_PBX_PREPROCESS_TARGET_DEPEND");
project->variables()["QMAKE_PBX_TARGETDEPENDS"].append(target_depend_key);
t << "\t\t" << target_depend_key << " = {" << "\n"
<< "\t\t\t" << "isa = PBXTargetDependency;" << "\n"
<< "\t\t\t" << "target = " << target_key << ";" << "\n"
<< "\t\t" << "};" << "\n";
}
//SOURCE BUILDPHASE
if(!project->isEmpty("QMAKE_PBX_OBJ")) {
QString grp = "Build Sources", key = keyFor(grp);
project->variables()["QMAKE_PBX_BUILDPHASES"].append(key);
t << "\t\t" << key << " = {" << "\n"
<< "\t\t\t" << "buildActionMask = 2147483647;" << "\n"
<< "\t\t\t" << "files = (" << "\n"
<< varGlue("QMAKE_PBX_OBJ", "\t\t\t\t", ",\n\t\t\t\t", "\n")
<< "\t\t\t" << ");" << "\n"
<< "\t\t\t" << "isa = PBXSourcesBuildPhase;" << "\n"
<< "\t\t\t" << "name = \"" << grp << "\";" << "\n"
<< "\t\t" << "};" << "\n";
}
if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES
QStringList &libdirs = project->variables()["QMAKE_PBX_LIBPATHS"];
QString libs[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_LIBS", QString::null };
for(i = 0; !libs[i].isNull(); i++) {
tmp = project->variables()[libs[i]];
for(QStringList::Iterator it = tmp.begin(); it != tmp.end();) {
bool remove = FALSE;
QString library, name, opt = (*it).stripWhiteSpace();
if(opt.startsWith("-L")) {
QString r = opt.right(opt.length() - 2);
fixEnvVariables(r);
libdirs.append(r);
} else if(opt.startsWith("-l")) {
name = opt.right(opt.length() - 2);
QString lib("lib" + name);
for(QStringList::Iterator lit = libdirs.begin(); lit != libdirs.end(); ++lit) {
if(project->isActiveConfig("link_prl")) {
- /* This isn't real nice, but it is real usefull. This looks in a prl
+ /* This isn't real nice, but it is real useful. This looks in a prl
for what the library will ultimately be called so we can stick it
in the ProjectFile. If the prl format ever changes (not likely) then
this will not really work. However, more concerning is that it will
encode the version number in the Project file which might be a bad
things in days to come? --Sam
*/
QString prl_file = (*lit) + Option::dir_sep + lib + Option::prl_ext;
if(QFile::exists(prl_file)) {
QMakeProject proj;
if(proj.read(prl_file, QDir::currentDirPath())) {
if(!proj.isEmpty("QMAKE_PRL_TARGET")) {
library = (*lit) + Option::dir_sep + proj.first("QMAKE_PRL_TARGET");
debug_msg(1, "pbuilder: Found library (%s) via PRL %s (%s)",
opt.latin1(), prl_file.latin1(), library.latin1());
remove = TRUE;
}
}
}
}
if(!remove) {
QString extns[] = { ".dylib", ".so", ".a", QString::null };
for(int n = 0; !remove && !extns[n].isNull(); n++) {
QString tmp = (*lit) + Option::dir_sep + lib + extns[n];
if(QFile::exists(tmp)) {
library = tmp;
debug_msg(1, "pbuilder: Found library (%s) via %s",
opt.latin1(), library.latin1());
remove = TRUE;
}
}
}
}
} else if(opt == "-framework") {
++it;
if(it == tmp.end())
break;
QStringList &fdirs = project->variables()["QMAKE_FRAMEWORKDIR"];
if(fdirs.isEmpty())
fdirs.append("/System/Library/Frameworks/");
for(QStringList::Iterator fit = fdirs.begin(); fit != fdirs.end(); ++fit) {
if(QFile::exists((*fit) + QDir::separator() + (*it) + ".framework")) {
--it;
it = tmp.remove(it);
remove = TRUE;
library = (*fit) + Option::dir_sep + (*it) + ".framework";
break;
}
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
@@ -70,97 +70,97 @@ void OCopServer::initSocket() {
/* cast to make it a (sockadr*) */
if (bind(m_serverfd, (struct sockaddr*)&m_address, m_adrlaenge ) == -1 ) {
qWarning("Server could not bind try again");
close(m_serverfd);
QTimer::singleShot(400, this, SLOT(initSocket() ) );
return;
}
/* tell the kernel that we're listening and accepting
* 5 pending connections */
if (listen(m_serverfd, 5) == -1 ) {
qWarning("could not listen");
close(m_serverfd );
QTimer::singleShot(400, this, SLOT(initSocket() ) );
return;
}
/*
* now we will create two QSocketNotifier
* which will us notify on reads
* and errors
* we do this because they integrate
* nicely into the QApplication eventloop
*/
m_server = new QSocketNotifier(m_serverfd, QSocketNotifier::Read, this );
connect( m_server, SIGNAL(activated(int) ),
this, SLOT(newOnServer() ) );
m_serverError = new QSocketNotifier( m_serverfd, QSocketNotifier::Exception, this);
connect(m_serverError, SIGNAL(activated(int) ),
this, SLOT(errorOnServer() ) );
qWarning("done with registering");
}
/**
* we got the possibility to read
* on the server
* this is mostly due a connect
* on a client side
* we will accept it
* add it to our list
*/
void OCopServer::newOnServer() {
int fd = accept();
if ( fd < 0 )
return;
/*
- * we got a successfull new connection
+ * we got a successful new connection
* be happy
* set SocketNotifier
* connect it
* and a OCOPClient
*/
// qWarning("Heureka new connection %d", fd );
registerClient( fd );
}
int OCopServer::accept() {
/*
* accept it
* the socket is currently blocking IIRC
*/
return ::accept( m_serverfd, (struct sockaddr*)&m_address, &m_adrlaenge );
}
void OCopServer::newOnClient( int fd ) {
errno = 0;
OCOPHead head;
memset(&head, 0, sizeof(head) );
int rea = ::read(fd, &head, sizeof(head) );
//qWarning("read %d %d", rea, errno);
/*
* I should get EPIPE but nothing like this happens
* so if rea == 0 and we were signaled by the notifier
* we close it and drop the clients...
*/
if ( rea <= 0 ) {
deregisterClient( fd );
return;
}
/*
* OCOPHead
*/
//qWarning("data %s %d", &bug, rea );
/*
* Check the magic
* if chcked read till EOF if magic does not match
* otherwise do read
* channel
* func
* data into mem
* and then send the OCOPPacket
*
*/
if (head.magic == 47 ) {