comparison widgets/InteractiveFileFinder.cpp @ 640:c6d705bf1672

Merge from branch "qt5". This revision actually builds with Qt4 (late releases) or Qt5, though it will warn on configure with Qt4.
author Chris Cannam
date Tue, 14 May 2013 12:36:43 +0100
parents d632a1e87018
children ee99f5c0050c
comparison
equal deleted inserted replaced
632:9d8f6552014d 640:c6d705bf1672
128 QString path = ""; 128 QString path = "";
129 129
130 // Use our own QFileDialog just for symmetry with getSaveFileName below 130 // Use our own QFileDialog just for symmetry with getSaveFileName below
131 131
132 QFileDialog dialog; 132 QFileDialog dialog;
133 dialog.setFilters(filter.split('\n')); 133 dialog.setNameFilters(filter.split('\n'));
134 dialog.setWindowTitle(title); 134 dialog.setWindowTitle(title);
135 dialog.setDirectory(lastPath); 135 dialog.setDirectory(lastPath);
136 136
137 dialog.setAcceptMode(QFileDialog::AcceptOpen); 137 dialog.setAcceptMode(QFileDialog::AcceptOpen);
138 dialog.setFileMode(QFileDialog::ExistingFile); 138 dialog.setFileMode(QFileDialog::ExistingFile);
252 252
253 // Use our own QFileDialog instead of static functions, as we may 253 // Use our own QFileDialog instead of static functions, as we may
254 // need to adjust the file extension based on the selected filter 254 // need to adjust the file extension based on the selected filter
255 255
256 QFileDialog dialog; 256 QFileDialog dialog;
257 dialog.setFilters(filter.split('\n')); 257 dialog.setNameFilters(filter.split('\n'));
258 dialog.setWindowTitle(title); 258 dialog.setWindowTitle(title);
259 dialog.setDirectory(lastPath); 259 dialog.setDirectory(lastPath);
260 260
261 dialog.setAcceptMode(QFileDialog::AcceptSave); 261 dialog.setAcceptMode(QFileDialog::AcceptSave);
262 dialog.setFileMode(QFileDialog::AnyFile); 262 dialog.setFileMode(QFileDialog::AnyFile);
287 std::cerr << "type = " << type << ", suffix = " << fi.suffix() << 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.selectedNameFilter();
293 if (selectedFilter.contains(".svl")) { 293 if (selectedFilter.contains(".svl")) {
294 expectedExtension = "svl"; 294 expectedExtension = "svl";
295 } else if (selectedFilter.contains(".txt")) { 295 } else if (selectedFilter.contains(".txt")) {
296 expectedExtension = "txt"; 296 expectedExtension = "txt";
297 } else if (selectedFilter.contains(".csv")) { 297 } else if (selectedFilter.contains(".csv")) {