Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/system.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings2/system.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/system.cpp b/noncore/settings/networksettings2/networksettings2/system.cpp index 141484c..9512579 100644 --- a/noncore/settings/networksettings2/networksettings2/system.cpp +++ b/noncore/settings/networksettings2/networksettings2/system.cpp | |||
@@ -45,5 +45,4 @@ static char Dig2Hex[] = { | |||
45 | 45 | ||
46 | System::System( void ) : QObject(), ProbedInterfaces() { | 46 | System::System( void ) : QObject(), ProbedInterfaces() { |
47 | probeInterfaces(); | ||
48 | } | 47 | } |
49 | 48 | ||
@@ -53,5 +52,12 @@ System::~System( void ) { | |||
53 | } | 52 | } |
54 | 53 | ||
55 | int System::runAsRoot( QStringList & S ) { | 54 | QDict<InterfaceInfo> & System::interfaces( void ) { |
55 | if( ProbedInterfaces.count() == 0 ) { | ||
56 | probeInterfaces(); | ||
57 | } | ||
58 | return ProbedInterfaces; | ||
59 | } | ||
60 | |||
61 | int System::runAsRoot( QStringList & S, MyProcess * Prc ) { | ||
56 | char * usr = getenv("USER"); | 62 | char * usr = getenv("USER"); |
57 | 63 | ||
@@ -70,8 +76,11 @@ int System::runAsRoot( QStringList & S ) { | |||
70 | << oendl; | 76 | << oendl; |
71 | } else { | 77 | } else { |
72 | MyProcess * P = new MyProcess(); | 78 | MyProcess * P; |
73 | emit processEvent( tr("Command : ") + S.join( " " ) ); | ||
74 | 79 | ||
75 | P->process() << S; | 80 | if( Prc ) { |
81 | P = Prc; | ||
82 | } else { | ||
83 | P = new MyProcess(); | ||
84 | emit processEvent( tr("Command : ") + S.join( " " ) ); | ||
76 | 85 | ||
77 | connect( P, | 86 | connect( P, |
@@ -89,4 +98,7 @@ int System::runAsRoot( QStringList & S ) { | |||
89 | this, SLOT | 98 | this, SLOT |
90 | (SLOT_ProcessExited(MyProcess*) ) ); | 99 | (SLOT_ProcessExited(MyProcess*) ) ); |
100 | } | ||
101 | |||
102 | P->process() << S; | ||
91 | 103 | ||
92 | Log(("Executing %s\n", S.join( " " ).latin1() )); | 104 | Log(("Executing %s\n", S.join( " " ).latin1() )); |
@@ -95,4 +107,5 @@ int System::runAsRoot( QStringList & S ) { | |||
95 | OProcess::AllOutput ) ) { | 107 | OProcess::AllOutput ) ) { |
96 | owarn << "Error starting " << S << oendl; | 108 | owarn << "Error starting " << S << oendl; |
109 | if( ! Prc ) | ||
97 | delete P; | 110 | delete P; |
98 | // error starting app | 111 | // error starting app |