3 files changed, 8 insertions, 3 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.cpp b/noncore/settings/networksettings2/networksettings2/netnode.cpp index 17653bd..f8f2d1e 100644 --- a/noncore/settings/networksettings2/networksettings2/netnode.cpp +++ b/noncore/settings/networksettings2/networksettings2/netnode.cpp | |||
@@ -171,35 +171,36 @@ NodeCollection::NodeCollection( QTextStream & TS ) : | |||
171 | A = S.left( idx ); | 171 | A = S.left( idx ); |
172 | A.lower(); | 172 | A.lower(); |
173 | N = S.mid( idx+1, S.length() ); | 173 | N = S.mid( idx+1, S.length() ); |
174 | N.stripWhiteSpace(); | 174 | N.stripWhiteSpace(); |
175 | N = deQuote( N ); | 175 | N = deQuote( N ); |
176 | 176 | ||
177 | if( A == "name" ) { | 177 | if( A == "name" ) { |
178 | Name = N; | 178 | Name = N; |
179 | } else if( A == "number" ) { | 179 | } else if( A == "number" ) { |
180 | setNumber( N.toLong() ); | 180 | setNumber( N.toLong() ); |
181 | } else if( A == "node" ) { | 181 | } else if( A == "node" ) { |
182 | ANetNodeInstance * NNI = NSResources->findNodeInstance( N ); | 182 | ANetNodeInstance * NNI = NSResources->findNodeInstance( N ); |
183 | Log(( "Find node %s : %p\n", N.latin1(), NNI )); | ||
183 | if( NNI && ! InError ) { | 184 | if( NNI && ! InError ) { |
184 | append( NSResources->findNodeInstance( N ) ); | 185 | append( NNI ); |
185 | } else { | 186 | } else { |
186 | // could not find a node type -> collection invalid | 187 | // could not find a node type -> collection invalid |
187 | InError = 1; | 188 | InError = 1; |
188 | } | 189 | } |
189 | } | 190 | } |
190 | } while( 1 ); | 191 | } while( 1 ); |
191 | 192 | ||
192 | Log(( "Profile number %s : %d nodes\n", | 193 | Log(( "Profile number %s : %d nodes\n", |
193 | N.latin1(), count() )); | 194 | Name.latin1(), count() )); |
194 | } | 195 | } |
195 | 196 | ||
196 | 197 | ||
197 | NodeCollection::~NodeCollection( void ) { | 198 | NodeCollection::~NodeCollection( void ) { |
198 | } | 199 | } |
199 | 200 | ||
200 | const QString & NodeCollection::description( void ) { | 201 | const QString & NodeCollection::description( void ) { |
201 | ANetNodeInstance * NNI = getToplevel(); | 202 | ANetNodeInstance * NNI = getToplevel(); |
202 | return (NNI) ? NNI->runtime()->description() : Name; | 203 | return (NNI) ? NNI->runtime()->description() : Name; |
203 | } | 204 | } |
204 | 205 | ||
205 | void NodeCollection::append( ANetNodeInstance * NNI ) { | 206 | void NodeCollection::append( ANetNodeInstance * NNI ) { |
diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp index 8b3b4fe..50fb15a 100644 --- a/noncore/settings/networksettings2/networksettings2/resources.cpp +++ b/noncore/settings/networksettings2/networksettings2/resources.cpp | |||
@@ -132,34 +132,37 @@ void TheNSResources::findAvailableNetNodes(const QString &path){ | |||
132 | 132 | ||
133 | // Don't want sym links | 133 | // Don't want sym links |
134 | d.setFilter( QDir::Files | QDir::NoSymLinks ); | 134 | d.setFilter( QDir::Files | QDir::NoSymLinks ); |
135 | const QFileInfoList *list = d.entryInfoList(); | 135 | const QFileInfoList *list = d.entryInfoList(); |
136 | QFileInfoListIterator it( *list ); | 136 | QFileInfoListIterator it( *list ); |
137 | QFileInfo *fi; | 137 | QFileInfo *fi; |
138 | 138 | ||
139 | while ( (fi=it.current()) ) { | 139 | while ( (fi=it.current()) ) { |
140 | 140 | ||
141 | if( fi->fileName().contains(".so")){ | 141 | if( fi->fileName().contains(".so")){ |
142 | /* if loaded install translation */ | 142 | /* if loaded install translation */ |
143 | if( loadNetNode(path + "/" + fi->fileName()) ) { | 143 | if( loadNetNode(path + "/" + fi->fileName()) ) { |
144 | Log(( "Loading plugin %s\n", fi->fileName().latin1())); | ||
144 | QTranslator *trans = new QTranslator(qApp); | 145 | QTranslator *trans = new QTranslator(qApp); |
145 | QString fn = QPEApplication::qpeDir()+ | 146 | QString fn = QPEApplication::qpeDir()+ |
146 | "/i18n/"+lang+"/"+ | 147 | "/i18n/"+lang+"/"+ |
147 | fi->fileName().left( fi->fileName().find(".") )+ | 148 | fi->fileName().left( fi->fileName().find(".") )+ |
148 | ".qm"; | 149 | ".qm"; |
149 | 150 | ||
150 | if( trans->load( fn ) ) | 151 | if( trans->load( fn ) ) |
151 | qApp->installTranslator( trans ); | 152 | qApp->installTranslator( trans ); |
152 | else | 153 | else |
153 | delete trans; | 154 | delete trans; |
155 | } else { | ||
156 | Log(( "Error loading plugin %s\n", fi->fileName().latin1())); | ||
154 | } | 157 | } |
155 | } | 158 | } |
156 | ++it; | 159 | ++it; |
157 | } | 160 | } |
158 | } | 161 | } |
159 | 162 | ||
160 | // used to find unique connection number | 163 | // used to find unique connection number |
161 | int TheNSResources::assignConnectionNumber( void ) { | 164 | int TheNSResources::assignConnectionNumber( void ) { |
162 | bool found = 1; | 165 | bool found = 1; |
163 | for( int trial = 0; ; trial ++ ) { | 166 | for( int trial = 0; ; trial ++ ) { |
164 | found = 1; | 167 | found = 1; |
165 | for( QDictIterator<NodeCollection> it(ConnectionsMap); | 168 | for( QDictIterator<NodeCollection> it(ConnectionsMap); |
diff --git a/noncore/settings/networksettings2/networksettings2/resources.h b/noncore/settings/networksettings2/networksettings2/resources.h index 634cd39..5d90286 100644 --- a/noncore/settings/networksettings2/networksettings2/resources.h +++ b/noncore/settings/networksettings2/networksettings2/resources.h | |||
@@ -71,41 +71,42 @@ public : | |||
71 | void addNodeType( const QString & ID, | 71 | void addNodeType( const QString & ID, |
72 | const QString & LongName, | 72 | const QString & LongName, |
73 | const QString & Description ); | 73 | const QString & Description ); |
74 | 74 | ||
75 | Name2SystemFile_t & systemFiles( void ) | 75 | Name2SystemFile_t & systemFiles( void ) |
76 | { return SystemFiles; } | 76 | { return SystemFiles; } |
77 | void addSystemFile( const QString & ID, | 77 | void addSystemFile( const QString & ID, |
78 | const QString & P, | 78 | const QString & P, |
79 | bool KDI ); | 79 | bool KDI ); |
80 | 80 | ||
81 | ANetNodeInstance * createNodeInstance( const QString & S ) | 81 | ANetNodeInstance * createNodeInstance( const QString & S ) |
82 | { ANetNodeInstance * NNI = 0; | 82 | { ANetNodeInstance * NNI = 0; |
83 | printf( "Find node type %s\n", S.latin1() ); | ||
83 | NetNode_t * NNT = AllNodeTypes[S]; | 84 | NetNode_t * NNT = AllNodeTypes[S]; |
84 | if( ! NNT ) { | 85 | if( ! NNT ) { |
85 | return 0; | 86 | return 0; |
86 | } | 87 | } |
87 | NNI = NNT->NetNode->createInstance(); | 88 | NNI = NNT->NetNode->createInstance(); |
88 | NNI->initialize(); | 89 | NNI->initialize(); |
89 | return NNI; | 90 | return NNI; |
90 | } | 91 | } |
91 | 92 | ||
92 | Name2Instance_t & netNodeInstances( void ) | 93 | Name2Instance_t & netNodeInstances( void ) |
93 | { return AllNodes; } | 94 | { return AllNodes; } |
94 | void addNodeInstance( ANetNodeInstance * I ) | 95 | void addNodeInstance( ANetNodeInstance * I ) |
95 | { AllNodes.insert( I->name(), I ); } | 96 | { AllNodes.insert( I->name(), I ); } |
96 | void removeNodeInstance( const QString & N ) | 97 | void removeNodeInstance( const QString & N ) |
97 | { AllNodes.remove( N );} | 98 | { AllNodes.remove( N );} |
98 | ANetNodeInstance * findNodeInstance( const QString & S ) | 99 | ANetNodeInstance * findNodeInstance( const QString & S ) |
99 | { return (AllNodes.find(S)!=0) ? AllNodes[S] : 0; } | 100 | { return AllNodes[S]; } |
100 | 101 | ||
101 | const QString & netNode2Name( const char * Type ); | 102 | const QString & netNode2Name( const char * Type ); |
102 | const QString & netNode2Description( const char * Type ); | 103 | const QString & netNode2Description( const char * Type ); |
103 | 104 | ||
104 | void addConnection( NodeCollection * NC ); | 105 | void addConnection( NodeCollection * NC ); |
105 | void removeConnection( const QString & N ); | 106 | void removeConnection( const QString & N ); |
106 | NodeCollection * findConnection( const QString & N ); | 107 | NodeCollection * findConnection( const QString & N ); |
107 | NodeCollection * getConnection( int nr ); | 108 | NodeCollection * getConnection( int nr ); |
108 | Name2Connection_t & connections( void ) | 109 | Name2Connection_t & connections( void ) |
109 | { return ConnectionsMap; } | 110 | { return ConnectionsMap; } |
110 | 111 | ||
111 | inline bool userKnown( void ) | 112 | inline bool userKnown( void ) |