summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces/interface.cpp
authorkergoth <kergoth>2003-08-09 17:14:54 (UTC)
committer kergoth <kergoth>2003-08-09 17:14:54 (UTC)
commita7e015198a8c5ad3b6e144a9032b059086253e00 (patch) (side-by-side diff)
treeb712b6f11310d88744fe393a92b3160b741a7efe /noncore/settings/networksettings/interfaces/interface.cpp
parentbeba0e73306815337bf04dee39502233595e9739 (diff)
downloadopie-a7e015198a8c5ad3b6e144a9032b059086253e00.zip
opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.gz
opie-a7e015198a8c5ad3b6e144a9032b059086253e00.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/settings/networksettings/interfaces/interface.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interface.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp
index cc45525..69b55d1 100644
--- a/noncore/settings/networksettings/interfaces/interface.cpp
+++ b/noncore/settings/networksettings/interfaces/interface.cpp
@@ -3,3 +3,3 @@
* $Date$
- */
+ */
@@ -26,3 +26,3 @@ Interface::Interface(QObject * parent, const char * name, bool newSatus): QObjec
* emit updateInterface
- */
+ */
void Interface::setStatus(bool newStatus){
@@ -38,3 +38,3 @@ void Interface::setStatus(bool newStatus){
* emit updateInterface
- */
+ */
void Interface::setAttached(bool isAttached){
@@ -43,3 +43,3 @@ void Interface::setAttached(bool isAttached){
};
-
+
/**
@@ -48,3 +48,3 @@ void Interface::setAttached(bool isAttached){
* emit updateInterface
- */
+ */
void Interface::setHardwareName(const QString &name){
@@ -53,3 +53,3 @@ void Interface::setHardwareName(const QString &name){
};
-
+
/**
@@ -58,3 +58,3 @@ void Interface::setHardwareName(const QString &name){
* emit updateInterface
- */
+ */
void Interface::setModuleOwner(Module *owner){
@@ -67,5 +67,5 @@ void Interface::setModuleOwner(Module *owner){
* Try to start the interface.
- */
+ */
void Interface::start(){
- // check to see if we are already running.
+ // check to see if we are already running.
if(true == status){
@@ -74,3 +74,3 @@ void Interface::start(){
}
-
+
int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1());
@@ -91,3 +91,3 @@ void Interface::start(){
void Interface::stop(){
- // check to see if we are already stopped.
+ // check to see if we are already stopped.
if(false == status){
@@ -96,3 +96,3 @@ void Interface::stop(){
}
-
+
int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1());
@@ -110,3 +110,3 @@ void Interface::stop(){
* Try to restart the interface.
- */
+ */
void Interface::restart(){
@@ -135,5 +135,5 @@ bool Interface::refresh(){
}
-
+
QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name());
- int ret = system(QString("%1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1());
+ int ret = system(QString("LANG=C %1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1());
if(ret != 0){
@@ -142,3 +142,3 @@ bool Interface::refresh(){
}
-
+
QFile file(fileName);
@@ -154,3 +154,3 @@ bool Interface::refresh(){
broadcast = "";
-
+
QTextStream stream( &file );
@@ -187,3 +187,3 @@ bool Interface::refresh(){
dhcp = false;
-
+
QString dhcpDirectory(DHCP_INFO_DIR);
@@ -192,4 +192,4 @@ bool Interface::refresh(){
dhcpDirectory = "/var/run";
-
- // See if we have
+
+ // See if we have
QString dhcpFile(QString(dhcpDirectory+"/dhcpcd-%1.info").arg(this->name()));
@@ -200,3 +200,3 @@ bool Interface::refresh(){
}
-
+
file.setName(dhcpFile);
@@ -206,3 +206,3 @@ bool Interface::refresh(){
}
-
+
// leaseTime and renewalTime and used if pid and deamon exe can be accessed.
@@ -210,3 +210,3 @@ bool Interface::refresh(){
int renewalTime = 0;
-
+
stream.setDevice( &file );
@@ -224,3 +224,3 @@ bool Interface::refresh(){
//qDebug(QString("Interface: renewalTime: %1").arg(renewalTime).latin1());
-
+
// Get the pid of the deamond
@@ -246,3 +246,3 @@ bool Interface::refresh(){
- // Get the start running time of the deamon
+ // Get the start running time of the deamon
fileName = (QString("/proc/%1/stat").arg(pid));
@@ -259,3 +259,3 @@ bool Interface::refresh(){
long time = 0;
- // Grab the start time
+ // Grab the start time
// pid com state ppid pgrp session tty_nr tpgid flags
@@ -267,3 +267,3 @@ bool Interface::refresh(){
time = time/100;
-
+
QDateTime datetime(QDateTime::currentDateTime());
@@ -283,15 +283,15 @@ bool Interface::refresh(){
}
-
+
datetime = datetime.addSecs(time);
//qDebug(QString("Interface: %1 %2").arg(datetime.toString()).arg(pid).latin1());
-
- // Calculate the start and renew times
+
+ // Calculate the start and renew times
leaseObtained = datetime.toString();
-
- // Calculate the start and renew times
+
+ // Calculate the start and renew times
datetime = datetime.addSecs(leaseTime);
leaseExpires = datetime.toString();
-
+
dhcp = true;
-
+
emit(updateInterface(this));