comparison data/fileio/FileFinder.cpp @ 302:726b32522e3f

* Phase 1 of an image layer.
author Chris Cannam
date Thu, 04 Oct 2007 16:34:11 +0000
parents 73537d900d4b
children fc656505c573
comparison
equal deleted inserted replaced
301:73537d900d4b 302:726b32522e3f
20 20
21 #include <QFileInfo> 21 #include <QFileInfo>
22 #include <QMessageBox> 22 #include <QMessageBox>
23 #include <QFileDialog> 23 #include <QFileDialog>
24 #include <QInputDialog> 24 #include <QInputDialog>
25 #include <QImageReader>
25 #include <QSettings> 26 #include <QSettings>
26 27
27 #include <iostream> 28 #include <iostream>
28 29
29 FileFinder * 30 FileFinder *
87 .arg(AudioFileReaderFactory::getKnownExtensions()); 88 .arg(AudioFileReaderFactory::getKnownExtensions());
88 break; 89 break;
89 90
90 case ImageFile: 91 case ImageFile:
91 settingsKey = "imagepath"; 92 settingsKey = "imagepath";
92 filter = tr("Portable Network Graphics files (*.png)\nAll files (*.*)"); 93 {
94 QStringList fmts;
95 QList<QByteArray> formats = QImageReader::supportedImageFormats();
96 for (QList<QByteArray>::iterator i = formats.begin();
97 i != formats.end(); ++i) {
98 fmts.push_back(QString("*.%1")
99 .arg(QString::fromLocal8Bit(*i).toLower()));
100 }
101 filter = tr("Image files (%1)\nAll files (*.*)").arg(fmts.join(" "));
102 }
93 break; 103 break;
94 104
95 case AnyFile: 105 case AnyFile:
96 settingsKey = "lastpath"; 106 settingsKey = "lastpath";
97 filter = tr("All supported files (*.sv %1 %2)\nSonic Visualiser session files (*.sv)\nAudio files (%1)\nLayer files (%2)\nAll files (*.*)") 107 filter = tr("All supported files (*.sv %1 %2)\nSonic Visualiser session files (*.sv)\nAudio files (%1)\nLayer files (%2)\nAll files (*.*)")