comparison widgets/InteractiveFileFinder.cpp @ 1421:70e93f996da6

Fix inadvertent hardcoding of SV file extension
author Chris Cannam
date Mon, 18 Feb 2019 14:33:35 +0000
parents c8a6fd3f9dff
children 18101be79c9c
comparison
equal deleted inserted replaced
1420:2e0d9e68343d 1421:70e93f996da6
69 switch (type) { 69 switch (type) {
70 70
71 case SessionFile: 71 case SessionFile:
72 settingsKeyStub = "session"; 72 settingsKeyStub = "session";
73 title = tr("Select a session file"); 73 title = tr("Select a session file");
74 filter = tr("%1 session files (*.%1)\nRDF files (%3)\nAll files (*.*)") 74 filter = tr("%1 session files (*.%2)\nRDF files (%3)\nAll files (*.*)")
75 .arg(QApplication::applicationName()) 75 .arg(QApplication::applicationName())
76 .arg(m_sessionExtension) 76 .arg(m_sessionExtension)
77 .arg(RDFImporter::getKnownExtensions()); 77 .arg(RDFImporter::getKnownExtensions());
78 break; 78 break;
79 79
112 .arg(RDFImporter::getKnownExtensions()); 112 .arg(RDFImporter::getKnownExtensions());
113 break; 113 break;
114 114
115 case SessionOrAudioFile: 115 case SessionOrAudioFile:
116 settingsKeyStub = "last"; 116 settingsKeyStub = "last";
117 filter = tr("All supported files (*.sv %1 %2)\n%3 session files (*.%4)\nAudio files (%2)\nRDF files (%1)\nAll files (*.*)") 117 filter = tr("All supported files (*.%1 %2 %3)\n%4 session files (*.%1)\nAudio files (%3)\nRDF files (%2)\nAll files (*.*)")
118 .arg(m_sessionExtension)
118 .arg(RDFImporter::getKnownExtensions()) 119 .arg(RDFImporter::getKnownExtensions())
119 .arg(AudioFileReaderFactory::getKnownExtensions()) 120 .arg(AudioFileReaderFactory::getKnownExtensions())
120 .arg(QApplication::applicationName()) 121 .arg(QApplication::applicationName());
121 .arg(m_sessionExtension);
122 break; 122 break;
123 123
124 case ImageFile: 124 case ImageFile:
125 settingsKeyStub = "image"; 125 settingsKeyStub = "image";
126 { 126 {
145 filter = tr("Comma-separated data files (*.csv)\nSpace-separated .lab files (*.lab)\nText files (*.txt)\nAll files (*.*)"); 145 filter = tr("Comma-separated data files (*.csv)\nSpace-separated .lab files (*.lab)\nText files (*.txt)\nAll files (*.*)");
146 break; 146 break;
147 147
148 case AnyFile: 148 case AnyFile:
149 settingsKeyStub = "last"; 149 settingsKeyStub = "last";
150 filter = tr("All supported files (*.sv %1 %2 %3)\n%4 session files (*.%5)\nAudio files (%1)\nLayer files (%2)\nRDF files (%3)\nAll files (*.*)") 150 filter = tr("All supported files (*.%1 %2 %3 %4)\n%5 session files (*.%1)\nAudio files (%2)\nLayer files (%3)\nRDF files (%4)\nAll files (*.*)")
151 .arg(m_sessionExtension)
151 .arg(AudioFileReaderFactory::getKnownExtensions()) 152 .arg(AudioFileReaderFactory::getKnownExtensions())
152 .arg(DataFileReaderFactory::getKnownExtensions()) 153 .arg(DataFileReaderFactory::getKnownExtensions())
153 .arg(RDFImporter::getKnownExtensions()) 154 .arg(RDFImporter::getKnownExtensions())
154 .arg(QApplication::applicationName()) 155 .arg(QApplication::applicationName());
155 .arg(m_sessionExtension);
156 break; 156 break;
157 }; 157 };
158 158
159 if (lastPath == "") { 159 if (lastPath == "") {
160 std::string home; 160 std::string home;
245 245
246 case SessionFile: 246 case SessionFile:
247 settingsKeyStub = "savesession"; 247 settingsKeyStub = "savesession";
248 title = tr("Select a session file"); 248 title = tr("Select a session file");
249 filter = tr("%1 session files (*.%2)\nAll files (*.*)") 249 filter = tr("%1 session files (*.%2)\nAll files (*.*)")
250 .arg(QApplication::applicationName()).arg(m_sessionExtension); 250 .arg(QApplication::applicationName())
251 .arg(m_sessionExtension);
251 break; 252 break;
252 253
253 case AudioFile: 254 case AudioFile:
254 settingsKeyStub = "saveaudio"; 255 settingsKeyStub = "saveaudio";
255 title = "Select an audio file"; 256 title = "Select an audio file";
258 break; 259 break;
259 260
260 case LayerFile: 261 case LayerFile:
261 settingsKeyStub = "savelayer"; 262 settingsKeyStub = "savelayer";
262 title = tr("Select a file to export to"); 263 title = tr("Select a file to export to");
263 filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nRDF/Turtle files (%1)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)").arg(RDFExporter::getSupportedExtensions()); 264 filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nRDF/Turtle files (%1)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)")
265 .arg(RDFExporter::getSupportedExtensions());
264 break; 266 break;
265 267
266 case LayerFileNoMidi: 268 case LayerFileNoMidi:
267 settingsKeyStub = "savelayer"; 269 settingsKeyStub = "savelayer";
268 title = tr("Select a file to export to"); 270 title = tr("Select a file to export to");
269 filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nRDF/Turtle files (%1)\nText files (*.txt)\nAll files (*.*)").arg(RDFExporter::getSupportedExtensions()); 271 filter = tr("Sonic Visualiser Layer XML files (*.svl)\nComma-separated data files (*.csv)\nRDF/Turtle files (%1)\nText files (*.txt)\nAll files (*.*)")
272 .arg(RDFExporter::getSupportedExtensions());
270 break; 273 break;
271 274
272 case LayerFileNonSV: 275 case LayerFileNonSV:
273 settingsKeyStub = "savelayer"; 276 settingsKeyStub = "savelayer";
274 title = tr("Select a file to export to"); 277 title = tr("Select a file to export to");
275 filter = tr("Comma-separated data files (*.csv)\nSonic Visualiser Layer XML files (*.svl)\nRDF/Turtle files (%1)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)").arg(RDFExporter::getSupportedExtensions()); 278 filter = tr("Comma-separated data files (*.csv)\nSonic Visualiser Layer XML files (*.svl)\nRDF/Turtle files (%1)\nMIDI files (*.mid)\nText files (*.txt)\nAll files (*.*)")
279 .arg(RDFExporter::getSupportedExtensions());
276 break; 280 break;
277 281
278 case LayerFileNoMidiNonSV: 282 case LayerFileNoMidiNonSV:
279 settingsKeyStub = "savelayer"; 283 settingsKeyStub = "savelayer";
280 title = tr("Select a file to export to"); 284 title = tr("Select a file to export to");
281 filter = tr("Comma-separated data files (*.csv)\nSonic Visualiser Layer XML files (*.svl)\nRDF/Turtle files (%1)\nText files (*.txt)\nAll files (*.*)").arg(RDFExporter::getSupportedExtensions()); 285 filter = tr("Comma-separated data files (*.csv)\nSonic Visualiser Layer XML files (*.svl)\nRDF/Turtle files (%1)\nText files (*.txt)\nAll files (*.*)")
286 .arg(RDFExporter::getSupportedExtensions());
282 break; 287 break;
283 288
284 case SessionOrAudioFile: 289 case SessionOrAudioFile:
285 cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: SessionOrAudioFile cannot be used here" << endl; 290 cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: SessionOrAudioFile cannot be used here" << endl;
286 abort(); 291 abort();