Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/netnode.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings2/netnode.cpp | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp index f8f2d1e..f00e0b3 100644 --- a/noncore/settings/networksettings2/networksettings2/netnode.cpp +++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp @@ -143,9 +143,13 @@ NodeCollection::NodeCollection( void ) : QList<ANetNodeInstance>() { AssignedInterface = 0; + Number = -1; + Done = 0; } -NodeCollection::NodeCollection( QTextStream & TS ) : +NodeCollection::NodeCollection( QTextStream & TS, bool & Dangling ) : QList<ANetNodeInstance>() { long idx; - bool InError = 0; QString S, A, N; + + Number = -1; + Done = 0; IsModified = 0; @@ -157,2 +161,4 @@ NodeCollection::NodeCollection( QTextStream & TS ) : + Dangling = 0; // by default node collection is ok + do { @@ -160,6 +166,2 @@ NodeCollection::NodeCollection( QTextStream & TS ) : if( S.isEmpty() ) { - if( InError ) { - // remove all nodes - clear(); - } // empty line @@ -183,3 +185,3 @@ NodeCollection::NodeCollection( QTextStream & TS ) : Log(( "Find node %s : %p\n", N.latin1(), NNI )); - if( NNI && ! InError ) { + if( NNI ) { append( NNI ); @@ -187,3 +189,7 @@ NodeCollection::NodeCollection( QTextStream & TS ) : // could not find a node type -> collection invalid - InError = 1; + Log(( "Node %s missing -> connection dangling\n", + N.latin1() )); + // create placeholder for this dangling NNI + NNI = new ErrorNNI( N ); + Dangling = 1; } @@ -196,3 +202,2 @@ NodeCollection::NodeCollection( QTextStream & TS ) : - NodeCollection::~NodeCollection( void ) { @@ -231,7 +236,8 @@ ANetNodeInstance * NodeCollection::getToplevel( void ) { NNI = it.current(); - if( NNI->nodeClass()->isToplevel() ) - break; - } + if( NNI->nodeClass()->isToplevel() ) { return NNI; } + } + return 0; +} @@ -243,7 +249,8 @@ ANetNodeInstance * NodeCollection::findByName( const QString & S ) { NNI = it.current(); - if( NNI->name() == S ) - break; - } + if( NNI->name() == S ) { return NNI; } + } + return 0; +} |