Diffstat (limited to 'noncore/settings/networksettings2/network/network_NN.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/network_NN.cpp | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp index b5c41bf..23b3d44 100644 --- a/noncore/settings/networksettings2/network/network_NN.cpp +++ b/noncore/settings/networksettings2/network/network_NN.cpp | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <qpe/qpeapplication.h> | 1 | #include <qpe/qpeapplication.h> |
2 | #include <asdevice.h> | 2 | #include <resources.h> |
3 | #include <netnode.h> | ||
3 | #include "network_NN.h" | 4 | #include "network_NN.h" |
@@ -10,2 +11,7 @@ static const char * NetworkNeeds[] = | |||
10 | 11 | ||
12 | static const char * NetworkProvides[] = | ||
13 | { "connection", | ||
14 | 0 | ||
15 | }; | ||
16 | |||
11 | /** | 17 | /** |
@@ -14,2 +20,5 @@ static const char * NetworkNeeds[] = | |||
14 | NetworkNetNode::NetworkNetNode() : ANetNode(tr("IP Configuration")) { | 20 | NetworkNetNode::NetworkNetNode() : ANetNode(tr("IP Configuration")) { |
21 | |||
22 | NSResources->addSystemFile( | ||
23 | "interfaces", "/etc/network/interfaces", 1 ); | ||
15 | } | 24 | } |
@@ -34,9 +43,7 @@ ANetNodeInstance * NetworkNetNode::createInstance( void ) { | |||
34 | 43 | ||
35 | bool NetworkNetNode::hasDataForFile( const QString & S ) { | 44 | bool NetworkNetNode::hasDataForFile( SystemFile & S ) { |
36 | return S == "interfaces"; | 45 | return S.name() == "interfaces"; |
37 | } | 46 | } |
38 | 47 | ||
39 | short NetworkNetNode::generateFile( const QString & ID, | 48 | short NetworkNetNode::generateFile( SystemFile & SF, |
40 | const QString & , | ||
41 | QTextStream & TS, | ||
42 | ANetNodeInstance * NNI, | 49 | ANetNodeInstance * NNI, |
@@ -44,8 +51,13 @@ short NetworkNetNode::generateFile( const QString & ID, | |||
44 | 51 | ||
52 | if( DevNr < 0 ) { | ||
53 | // generate device specific but common part | ||
54 | return 1; | ||
55 | } | ||
56 | |||
45 | QString NIC = NNI->runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); | 57 | QString NIC = NNI->runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); |
46 | 58 | ||
47 | if( ID == "interfaces" ) { | 59 | if( SF.name() == "interfaces" ) { |
48 | Log(("Generate entry for %s in %s\n", NIC.latin1(), ID.latin1() )); | 60 | Log(("Generate entry for %s in %s\n", NIC.latin1(), SF.name().latin1() )); |
49 | // generate mapping stanza for this interface | 61 | // generate mapping stanza for this interface |
50 | TS << "# check if " | 62 | SF << "# check if " |
51 | << NIC | 63 | << NIC |
@@ -53,8 +65,8 @@ short NetworkNetNode::generateFile( const QString & ID, | |||
53 | << endl; | 65 | << endl; |
54 | TS << "mapping " | 66 | SF << "mapping " |
55 | << NIC | 67 | << NIC |
56 | << endl; | 68 | << endl; |
57 | TS << " script " | 69 | SF << " script " |
58 | << QPEApplication::qpeDir() | 70 | << QPEApplication::qpeDir() |
59 | << "/bin/networksettings2-request" | 71 | << "bin/networksettings2-request" |
60 | << endl | 72 | << endl |
@@ -70,4 +82,4 @@ const char ** NetworkNetNode::needs( void ) { | |||
70 | 82 | ||
71 | const char * NetworkNetNode::provides( void ) { | 83 | const char ** NetworkNetNode::provides( void ) { |
72 | return "connection"; | 84 | return NetworkProvides; |
73 | } | 85 | } |