Diffstat (limited to 'noncore/settings/networksettings2/networksettings2') (more/less context) (ignore whitespace changes)
5 files changed, 18 insertions, 25 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp index 3691e5a..417fba8 100644 --- a/noncore/settings/networksettings2/networksettings2/netnode.cpp +++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp @@ -75,11 +75,11 @@ void ANetNodeInstance::initialize( void ) { QString N; N.sprintf( "-%ld", InstanceCounter++ ); - N.prepend( NodeType->nodeName() ); - setNodeName( N ); + N.prepend( NodeType->name() ); + setName( N.latin1() ); } void ANetNodeInstance::setAttribute( QString & Attr, QString & Value ){ if( Attr == "name" ) { - NodeName = Value; + setName( Value.latin1() ); } else { setSpecificAttribute( Attr, Value ); @@ -88,5 +88,5 @@ void ANetNodeInstance::setAttribute( QString & Attr, QString & Value ){ void ANetNodeInstance::saveAttributes( QTextStream & TS ) { - TS << "name=" << quote( NodeName ) << endl; + TS << "name=" << name() << endl; saveSpecificAttribute( TS ); } @@ -181,5 +181,5 @@ void NodeCollection::save( QTextStream & TS ) { ++it ) { NNI = it.current(); - TS << "node=" << quote( NNI->nodeName() ) << endl; + TS << "node=" << NNI->name() << endl; } TS << endl; @@ -234,5 +234,5 @@ int NodeCollection::compareItems( QCollection::Item I1, NNI1 = (ANetNodeInstance *)I1; NNI2 = (ANetNodeInstance *)I2; - return NNI1->nodeName().compare( NNI2->nodeName() ); + return strcmp( NNI1->name(), NNI2->name() ); } diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h index 6ec9ef6..27d54f8 100644 --- a/noncore/settings/networksettings2/networksettings2/netnode.h +++ b/noncore/settings/networksettings2/networksettings2/netnode.h @@ -73,5 +73,5 @@ public: typedef QArray<ANetNode *> NetNodeList; - ANetNode(){}; + ANetNode( const char * Name ) : QObject( 0, Name ) {} virtual ~ANetNode(){}; @@ -79,7 +79,4 @@ public: virtual const QString pixmapName() = 0; - // name of this NetNode - virtual const QString nodeName() = 0; - // description for this NetNode virtual const QString nodeDescription() = 0; @@ -185,9 +182,4 @@ public: { return IsNew; } - // return logical name of this instance - QString & nodeName( void ) - { return NodeName; } - void setNodeName( const QString & S ) - { NodeName = S; } // return description for this instance QString & description( void ) @@ -226,5 +218,4 @@ protected : // connection to which this node belongs to NodeCollection * Connection; - QString NodeName; QString Description; bool IsModified; @@ -257,4 +248,6 @@ public : virtual bool handlesInterface( const QString & ) { return 0; } + virtual bool handlesInterface( const InterfaceInfo & ) + { return 0; } virtual InterfaceInfo * assignedInterface( void ); virtual AsDevice * device( void ); diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp index e6ce2b7..4b7a62f 100644 --- a/noncore/settings/networksettings2/networksettings2/resources.cpp +++ b/noncore/settings/networksettings2/networksettings2/resources.cpp @@ -168,5 +168,6 @@ bool TheNSResources::loadNetNode( // store mapping - AllNodeTypes.insert( NN->NetNode->nodeName(), NN ); + printf( "Store %s\n", NN->NetNode->name() ); + AllNodeTypes.insert( NN->NetNode->name(), NN ); } @@ -177,5 +178,4 @@ QPixmap TheNSResources::getPixmap( const QString & QS ) { QString S("networksettings2/"); S += QS; - printf( " pixmap %s\n", S.latin1() ); return Resource::loadPixmap( QString("networksettings2/")+QS ); } @@ -201,5 +201,5 @@ void TheNSResources::addConnection( NodeCollection * NC ) { ++it ) { NNI = it.current(); - if( findNodeInstance( NNI->nodeName() ) == 0 ) { + if( findNodeInstance( NNI->name() ) == 0 ) { // new item addNodeInstance( NNI ); @@ -216,5 +216,5 @@ void TheNSResources::removeConnection( const QString & N ) { ANetNodeInstance * NNI; for( NNI = NC->first(); NNI != 0; NNI = NC->next() ) { - removeNodeInstance( NNI->nodeName() ); + removeNodeInstance( NNI->name() ); } ConnectionsMap.remove( N ); diff --git a/noncore/settings/networksettings2/networksettings2/resources.h b/noncore/settings/networksettings2/networksettings2/resources.h index 7050f10..3d6a44f 100644 --- a/noncore/settings/networksettings2/networksettings2/resources.h +++ b/noncore/settings/networksettings2/networksettings2/resources.h @@ -80,5 +80,5 @@ public : { return AllNodes; } void addNodeInstance( ANetNodeInstance * I ) - { AllNodes.insert( I->nodeName(), I ); } + { AllNodes.insert( I->name(), I ); } void removeNodeInstance( const QString & N ) { AllNodes.remove( N );} diff --git a/noncore/settings/networksettings2/networksettings2/systemfile.cpp b/noncore/settings/networksettings2/networksettings2/systemfile.cpp index 62bb6af..b3fc1a5 100644 --- a/noncore/settings/networksettings2/networksettings2/systemfile.cpp +++ b/noncore/settings/networksettings2/networksettings2/systemfile.cpp @@ -125,5 +125,5 @@ bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) { while( ! TX.eof() ) { Out = S. - arg(NNI->nodeClass()->nodeName()); + arg(NNI->nodeClass()->name()); (*this) << Out << endl; S = TX.readLine(); @@ -143,5 +143,5 @@ bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long ) { while( ! TX.eof() ) { Out = S. - arg(NNI->nodeName()); + arg(NNI->name()); (*this) << Out << endl; S = TX.readLine(); @@ -160,5 +160,5 @@ bool SystemFile::preDeviceSection( ANetNode * NN ) { QString S = TX.readLine(); while( ! TX.eof() ) { - Out = S.arg(NN->nodeName()); + Out = S.arg(NN->name()); (*this) << Out << endl; S = TX.readLine(); @@ -177,5 +177,5 @@ bool SystemFile::postDeviceSection( ANetNode * NN ) { QString S = TX.readLine(); while( ! TX.eof() ) { - Out = S.arg(NN->nodeName()); + Out = S.arg(NN->name()); (*this) << Out << endl; S = TX.readLine(); |