Mercurial > hg > svgui
comparison widgets/InteractiveFileFinder.cpp @ 584:1fe7951a61e8 debug-output
Remove most toStdString calls (no longer needed, with debug header)
author | Chris Cannam |
---|---|
date | Thu, 12 May 2011 17:31:43 +0100 |
parents | 3228b7913aa4 |
children | f4960f8ce798 |
comparison
equal
deleted
inserted
replaced
583:4c484636d5ec | 584:1fe7951a61e8 |
---|---|
282 if (files.empty()) break; | 282 if (files.empty()) break; |
283 path = *files.begin(); | 283 path = *files.begin(); |
284 | 284 |
285 QFileInfo fi(path); | 285 QFileInfo fi(path); |
286 | 286 |
287 std::cerr << "type = " << type << ", suffix = " << fi.suffix().toStdString() << std::endl; | 287 std::cerr << "type = " << type << ", suffix = " << fi.suffix() << std::endl; |
288 | 288 |
289 if ((type == LayerFile || type == LayerFileNoMidi) | 289 if ((type == LayerFile || type == LayerFileNoMidi) |
290 && fi.suffix() == "") { | 290 && fi.suffix() == "") { |
291 QString expectedExtension; | 291 QString expectedExtension; |
292 QString selectedFilter = dialog.selectedFilter(); | 292 QString selectedFilter = dialog.selectedFilter(); |
299 } else if (selectedFilter.contains(".mid")) { | 299 } else if (selectedFilter.contains(".mid")) { |
300 expectedExtension = "mid"; | 300 expectedExtension = "mid"; |
301 } else if (selectedFilter.contains(".ttl")) { | 301 } else if (selectedFilter.contains(".ttl")) { |
302 expectedExtension = "ttl"; | 302 expectedExtension = "ttl"; |
303 } | 303 } |
304 std::cerr << "expected extension = " << expectedExtension.toStdString() << std::endl; | 304 std::cerr << "expected extension = " << expectedExtension << std::endl; |
305 if (expectedExtension != "") { | 305 if (expectedExtension != "") { |
306 path = QString("%1.%2").arg(path).arg(expectedExtension); | 306 path = QString("%1.%2").arg(path).arg(expectedExtension); |
307 fi = QFileInfo(path); | 307 fi = QFileInfo(path); |
308 } | 308 } |
309 } | 309 } |
406 QString | 406 QString |
407 InteractiveFileFinder::findRelative(QString location, QString relativeTo) | 407 InteractiveFileFinder::findRelative(QString location, QString relativeTo) |
408 { | 408 { |
409 if (relativeTo == "") return ""; | 409 if (relativeTo == "") return ""; |
410 | 410 |
411 std::cerr << "Looking for \"" << location.toStdString() << "\" next to \"" | 411 std::cerr << "Looking for \"" << location << "\" next to \"" |
412 << relativeTo.toStdString() << "\"..." << std::endl; | 412 << relativeTo << "\"..." << std::endl; |
413 | 413 |
414 QString fileName; | 414 QString fileName; |
415 QString resolved; | 415 QString resolved; |
416 | 416 |
417 if (FileSource::isRemote(location)) { | 417 if (FileSource::isRemote(location)) { |
425 } | 425 } |
426 | 426 |
427 if (FileSource::isRemote(relativeTo)) { | 427 if (FileSource::isRemote(relativeTo)) { |
428 resolved = QUrl(relativeTo).resolved(fileName).toString(); | 428 resolved = QUrl(relativeTo).resolved(fileName).toString(); |
429 if (!FileSource(resolved).isAvailable()) resolved = ""; | 429 if (!FileSource(resolved).isAvailable()) resolved = ""; |
430 std::cerr << "resolved: " << resolved.toStdString() << std::endl; | 430 std::cerr << "resolved: " << resolved << std::endl; |
431 } else { | 431 } else { |
432 if (QUrl(relativeTo).scheme() == "file") { | 432 if (QUrl(relativeTo).scheme() == "file") { |
433 relativeTo = QUrl(relativeTo).toLocalFile(); | 433 relativeTo = QUrl(relativeTo).toLocalFile(); |
434 } | 434 } |
435 resolved = QFileInfo(relativeTo).dir().filePath(fileName); | 435 resolved = QFileInfo(relativeTo).dir().filePath(fileName); |