comparison data/fileio/FileFinder.cpp @ 305:fc656505c573

* Add labelling option for instants inserted through tapping (closes FR#1674184) Needs some refinement still, but it's almost functionally complete
author Chris Cannam
date Mon, 08 Oct 2007 14:44:38 +0000
parents 726b32522e3f
children 3a6725f285d6
comparison
equal deleted inserted replaced
304:4fc6f49436b3 305:fc656505c573
280 QStringList files = dialog.selectedFiles(); 280 QStringList files = dialog.selectedFiles();
281 if (files.empty()) break; 281 if (files.empty()) break;
282 path = *files.begin(); 282 path = *files.begin();
283 283
284 QFileInfo fi(path); 284 QFileInfo fi(path);
285 285
286 if (type == LayerFile && fi.suffix() == "") { 286 std::cerr << "type = " << type << ", suffix = " << fi.suffix().toStdString() << std::endl;
287
288 if ((type == LayerFile || type == LayerFileNoMidi)
289 && fi.suffix() == "") {
287 QString expectedExtension; 290 QString expectedExtension;
288 QString selectedFilter = dialog.selectedFilter(); 291 QString selectedFilter = dialog.selectedFilter();
289 if (selectedFilter.contains(".svl")) { 292 if (selectedFilter.contains(".svl")) {
290 expectedExtension = "svl"; 293 expectedExtension = "svl";
291 } else if (selectedFilter.contains(".txt")) { 294 } else if (selectedFilter.contains(".txt")) {
293 } else if (selectedFilter.contains(".csv")) { 296 } else if (selectedFilter.contains(".csv")) {
294 expectedExtension = "csv"; 297 expectedExtension = "csv";
295 } else if (selectedFilter.contains(".mid")) { 298 } else if (selectedFilter.contains(".mid")) {
296 expectedExtension = "mid"; 299 expectedExtension = "mid";
297 } 300 }
301 std::cerr << "expected extension = " << expectedExtension.toStdString() << std::endl;
298 if (expectedExtension != "") { 302 if (expectedExtension != "") {
299 path = QString("%1.%2").arg(path).arg(expectedExtension); 303 path = QString("%1.%2").arg(path).arg(expectedExtension);
300 fi = QFileInfo(path); 304 fi = QFileInfo(path);
301 } 305 }
302 } 306 }