summaryrefslogtreecommitdiff
authorar <ar>2004-04-07 11:23:41 (UTC)
committer ar <ar>2004-04-07 11:23:41 (UTC)
commit0e2322d2bc926036d62153346bb03776df1ca987 (patch) (unidiff)
tree217ce66605d7b68252662942dc98524a7f2d872f
parent6095b1f70bcac407208e7473598f2bbf53339810 (diff)
downloadopie-0e2322d2bc926036d62153346bb03776df1ca987.zip
opie-0e2322d2bc926036d62153346bb03776df1ca987.tar.gz
opie-0e2322d2bc926036d62153346bb03776df1ca987.tar.bz2
fix compile problem with gcc3.3.3
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp
index 417fba8..dc66aff 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.cpp
+++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp
@@ -1,120 +1,120 @@
1#include <qpe/qpeapplication.h> 1#include <qpe/qpeapplication.h>
2#include <time.h> 2#include <time.h>
3#include <qtextstream.h> 3#include <qtextstream.h>
4#include <qpixmap.h> 4#include <qpixmap.h>
5 5
6#include "resources.h" 6#include "resources.h"
7#include "netnode.h" 7#include "netnode.h"
8 8
9#include "asdevice.h" 9#include "asdevice.h"
10#include "asline.h" 10#include "asline.h"
11#include "asconnection.h" 11#include "asconnection.h"
12#include "asfullsetup.h" 12#include "asfullsetup.h"
13 13
14QString & deQuote( QString & X ) { 14QString & deQuote( QString & X ) {
15 if( X[0] == '"' ) { 15 if( X[0] == '"' ) {
16 // remove end and trailing "" and \x -> x 16 // remove end and trailing "" and \x -> x
17 QChar R; 17 QChar R;
18 long idx; 18 long idx;
19 idx = X.length()-1; 19 idx = X.length()-1;
20 X = X.mid( 1, idx ); 20 X = X.mid( 1, idx );
21 21
22 idx = 0; 22 idx = 0;
23 while( ( idx = X.find( '\\', idx ) ) >= 0 ) { 23 while( ( idx = X.find( '\\', idx ) ) >= 0 ) {
24 R = X[idx+1]; 24 R = X.at( idx + 1 );
25 X.replace( idx, 2, &R, 1 ); 25 X.replace( idx, 2, &R, 1 );
26 } 26 }
27 X = X.left( X.length()-1 ); 27 X = X.left( X.length()-1 );
28 } 28 }
29 return X; 29 return X;
30} 30}
31 31
32QString quote( QString X ) { 32QString quote( QString X ) {
33 if( X.find( QRegExp( "[ \n\"\\\t]" ) ) >= 0 ) { 33 if( X.find( QRegExp( "[ \n\"\\\t]" ) ) >= 0 ) {
34 // need to quote this 34 // need to quote this
35 QString OutString = "\""; 35 QString OutString = "\"";
36 36
37 X.replace( QRegExp("\""), "\\\"" ); 37 X.replace( QRegExp("\""), "\\\"" );
38 X.replace( QRegExp("\\"), "\\\\" ); 38 X.replace( QRegExp("\\"), "\\\\" );
39 X.replace( QRegExp(" "), "\\ " ); 39 X.replace( QRegExp(" "), "\\ " );
40 40
41 OutString += X; 41 OutString += X;
42 OutString += "\""; 42 OutString += "\"";
43 X = OutString; 43 X = OutString;
44 } 44 }
45 return X; 45 return X;
46} 46}
47 47
48 48
49// 49//
50// 50//
51// ANETNODE 51// ANETNODE
52// 52//
53// 53//
54 54
55void ANetNode::saveAttributes( QTextStream & TS ) { 55void ANetNode::saveAttributes( QTextStream & TS ) {
56 saveSpecificAttribute( TS ); 56 saveSpecificAttribute( TS );
57} 57}
58 58
59void ANetNode::setAttribute( QString & Attr, QString & Value ){ 59void ANetNode::setAttribute( QString & Attr, QString & Value ){
60 setSpecificAttribute( Attr, Value ); 60 setSpecificAttribute( Attr, Value );
61} 61}
62 62
63// 63//
64// 64//
65// ANETNODEINSTANCE 65// ANETNODEINSTANCE
66// 66//
67// 67//
68 68
69long ANetNodeInstance::InstanceCounter = -1; 69long ANetNodeInstance::InstanceCounter = -1;
70 70
71void ANetNodeInstance::initialize( void ) { 71void ANetNodeInstance::initialize( void ) {
72 if( InstanceCounter == -1 ) 72 if( InstanceCounter == -1 )
73 InstanceCounter = time(0); 73 InstanceCounter = time(0);
74 // set name 74 // set name
75 QString N; 75 QString N;
76 N.sprintf( "-%ld", InstanceCounter++ ); 76 N.sprintf( "-%ld", InstanceCounter++ );
77 N.prepend( NodeType->name() ); 77 N.prepend( NodeType->name() );
78 setName( N.latin1() ); 78 setName( N.latin1() );
79} 79}
80 80
81void ANetNodeInstance::setAttribute( QString & Attr, QString & Value ){ 81void ANetNodeInstance::setAttribute( QString & Attr, QString & Value ){
82 if( Attr == "name" ) { 82 if( Attr == "name" ) {
83 setName( Value.latin1() ); 83 setName( Value.latin1() );
84 } else { 84 } else {
85 setSpecificAttribute( Attr, Value ); 85 setSpecificAttribute( Attr, Value );
86 } 86 }
87} 87}
88 88
89void ANetNodeInstance::saveAttributes( QTextStream & TS ) { 89void ANetNodeInstance::saveAttributes( QTextStream & TS ) {
90 TS << "name=" << name() << endl; 90 TS << "name=" << name() << endl;
91 saveSpecificAttribute( TS ); 91 saveSpecificAttribute( TS );
92} 92}
93 93
94ANetNodeInstance * ANetNodeInstance::nextNode( void ) { 94ANetNodeInstance * ANetNodeInstance::nextNode( void ) {
95 return connection()->findNext( this ); 95 return connection()->findNext( this );
96} 96}
97 97
98// 98//
99// 99//
100// NODECOLLECTION 100// NODECOLLECTION
101// 101//
102// 102//
103 103
104long NodeCollection::MaxNr = -1; 104long NodeCollection::MaxNr = -1;
105 105
106NodeCollection::NodeCollection( void ) : QList<ANetNodeInstance>() { 106NodeCollection::NodeCollection( void ) : QList<ANetNodeInstance>() {
107 IsModified = 0; 107 IsModified = 0;
108 Index = -1; 108 Index = -1;
109 Name=""; 109 Name="";
110 IsNew = 1; 110 IsNew = 1;
111 CurrentState = Unchecked; 111 CurrentState = Unchecked;
112} 112}
113 113
114NodeCollection::NodeCollection( QTextStream & TS ) : 114NodeCollection::NodeCollection( QTextStream & TS ) :
115 QList<ANetNodeInstance>() { 115 QList<ANetNodeInstance>() {
116 long idx; 116 long idx;
117 bool InError = 0; 117 bool InError = 0;
118 QString S, A, N; 118 QString S, A, N;
119 IsModified = 0; 119 IsModified = 0;
120 Index = -1; 120 Index = -1;