comparison rdf/PluginRDFIndexer.cpp @ 686:b4a8d8221eaf debug-output

Remove most toStdString calls (no longer needed, with debug header)
author Chris Cannam
date Thu, 12 May 2011 17:31:24 +0100
parents e340b2fb9471
children 06f13a3b9e9e
comparison
equal deleted inserted replaced
685:99222d4bfc78 686:b4a8d8221eaf
128 for (int i = 0; i < indices.size(); ++i) { 128 for (int i = 0; i < indices.size(); ++i) {
129 129
130 QString index = indices[i]; 130 QString index = indices[i];
131 131
132 std::cerr << "PluginRDFIndexer::indexConfiguredURLs: index url is " 132 std::cerr << "PluginRDFIndexer::indexConfiguredURLs: index url is "
133 << index.toStdString() << std::endl; 133 << index << std::endl;
134 134
135 CachedFile cf(index); 135 CachedFile cf(index);
136 if (!cf.isOK()) continue; 136 if (!cf.isOK()) continue;
137 137
138 FileSource indexSource(cf.getLocalFilename()); 138 FileSource indexSource(cf.getLocalFilename());
184 // the uri as a document URL and reading that if possible. 184 // the uri as a document URL and reading that if possible.
185 185
186 // Because we may want to refer to this document again, we 186 // Because we may want to refer to this document again, we
187 // cache it locally if it turns out to exist. 187 // cache it locally if it turns out to exist.
188 188
189 cerr << "PluginRDFIndexer::getIdForPluginURI: NOTE: Failed to find a local RDF document describing plugin <" << uri.toStdString() << ">: attempting to retrieve one remotely by guesswork" << endl; 189 cerr << "PluginRDFIndexer::getIdForPluginURI: NOTE: Failed to find a local RDF document describing plugin <" << uri << ">: attempting to retrieve one remotely by guesswork" << endl;
190 190
191 QString baseUrl = QUrl(uri).toString(QUrl::RemoveFragment); 191 QString baseUrl = QUrl(uri).toString(QUrl::RemoveFragment);
192 192
193 indexURL(baseUrl); 193 indexURL(baseUrl);
194 194
239 { 239 {
240 Profiler profiler("PluginRDFIndexer::indexURL"); 240 Profiler profiler("PluginRDFIndexer::indexURL");
241 241
242 loadPrefixes(); 242 loadPrefixes();
243 243
244 // std::cerr << "PluginRDFIndexer::indexURL(" << urlString.toStdString() << ")" << std::endl; 244 // std::cerr << "PluginRDFIndexer::indexURL(" << urlString << ")" << std::endl;
245 245
246 QMutexLocker locker(&m_mutex); 246 QMutexLocker locker(&m_mutex);
247 247
248 QString localString = urlString; 248 QString localString = urlString;
249 249
286 286
287 SimpleSPARQLQuery::ResultList results = query.execute(); 287 SimpleSPARQLQuery::ResultList results = query.execute();
288 288
289 if (!query.isOK()) { 289 if (!query.isOK()) {
290 cerr << "ERROR: PluginRDFIndexer::reindex: ERROR: Failed to query plugins from model: " 290 cerr << "ERROR: PluginRDFIndexer::reindex: ERROR: Failed to query plugins from model: "
291 << query.getErrorString().toStdString() << endl; 291 << query.getErrorString() << endl;
292 return false; 292 return false;
293 } 293 }
294 294
295 if (results.empty()) { 295 if (results.empty()) {
296 cerr << "PluginRDFIndexer::reindex: NOTE: no vamp:Plugin resources found in indexed documents" << endl; 296 cerr << "PluginRDFIndexer::reindex: NOTE: no vamp:Plugin resources found in indexed documents" << endl;
307 QString soUri = (*i)["library"].value; 307 QString soUri = (*i)["library"].value;
308 QString identifier = (*i)["plugin_id"].value; 308 QString identifier = (*i)["plugin_id"].value;
309 309
310 if (identifier == "") { 310 if (identifier == "") {
311 cerr << "PluginRDFIndexer::reindex: NOTE: No vamp:identifier for plugin <" 311 cerr << "PluginRDFIndexer::reindex: NOTE: No vamp:identifier for plugin <"
312 << pluginUri.toStdString() << ">" 312 << pluginUri << ">"
313 << endl; 313 << endl;
314 continue; 314 continue;
315 } 315 }
316 if (soUri == "") { 316 if (soUri == "") {
317 cerr << "PluginRDFIndexer::reindex: NOTE: No implementation library for plugin <" 317 cerr << "PluginRDFIndexer::reindex: NOTE: No implementation library for plugin <"
318 << pluginUri.toStdString() << ">" 318 << pluginUri << ">"
319 << endl; 319 << endl;
320 continue; 320 continue;
321 } 321 }
322 322
323 QString sonameQuery = 323 QString sonameQuery =
333 SimpleSPARQLQuery::Value sonameValue = 333 SimpleSPARQLQuery::Value sonameValue =
334 SimpleSPARQLQuery::singleResultQuery(m, sonameQuery, "library_id"); 334 SimpleSPARQLQuery::singleResultQuery(m, sonameQuery, "library_id");
335 QString soname = sonameValue.value; 335 QString soname = sonameValue.value;
336 if (soname == "") { 336 if (soname == "") {
337 cerr << "PluginRDFIndexer::reindex: NOTE: No identifier for library <" 337 cerr << "PluginRDFIndexer::reindex: NOTE: No identifier for library <"
338 << soUri.toStdString() << ">" 338 << soUri << ">"
339 << endl; 339 << endl;
340 continue; 340 continue;
341 } 341 }
342 342
343 QString pluginId = PluginIdentifier::createIdentifier 343 QString pluginId = PluginIdentifier::createIdentifier
354 addedSomething = true; 354 addedSomething = true;
355 355
356 if (pluginUri != "") { 356 if (pluginUri != "") {
357 if (m_uriToIdMap.find(pluginUri) != m_uriToIdMap.end()) { 357 if (m_uriToIdMap.find(pluginUri) != m_uriToIdMap.end()) {
358 cerr << "PluginRDFIndexer::reindex: WARNING: Found multiple plugins with the same URI:" << endl; 358 cerr << "PluginRDFIndexer::reindex: WARNING: Found multiple plugins with the same URI:" << endl;
359 cerr << " 1. Plugin id \"" << m_uriToIdMap[pluginUri].toStdString() << "\"" << endl; 359 cerr << " 1. Plugin id \"" << m_uriToIdMap[pluginUri] << "\"" << endl;
360 cerr << " 2. Plugin id \"" << pluginId.toStdString() << "\"" << endl; 360 cerr << " 2. Plugin id \"" << pluginId << "\"" << endl;
361 cerr << "both claim URI <" << pluginUri.toStdString() << ">" << endl; 361 cerr << "both claim URI <" << pluginUri << ">" << endl;
362 } else { 362 } else {
363 m_uriToIdMap[pluginUri] = pluginId; 363 m_uriToIdMap[pluginUri] = pluginId;
364 } 364 }
365 } 365 }
366 } 366 }