summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse/ChangeLog1
-rw-r--r--muse/muse/mixer/rack.cpp3
-rw-r--r--muse/muse/widgets/filedialog.cpp57
3 files changed, 34 insertions, 27 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog
index 07cccbd8..16fbf539 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,5 +1,6 @@
12.04.2010
* Fixed: LADSPA rack effects: Do not display LADSPA output controls (such as latency). (T356)
+ * Fixed: Bug when cancelling 'save as' operation, says 'file exists'. Caused by my earlier compressed save fixes. (T356)
11.04.2010
* Fixed: DSSI requested midi mapped controls were not correct. (T356)
* Changed: Working on controllers, and saving their state. Synths like Organ should remember their state now. (T356)
diff --git a/muse/muse/mixer/rack.cpp b/muse/muse/mixer/rack.cpp
index 57fc4b78..e94acb97 100644
--- a/muse/muse/mixer/rack.cpp
+++ b/muse/muse/mixer/rack.cpp
@@ -273,6 +273,9 @@ void EffectRack::savePreset(int idx)
QString name = getSaveFileName(QString(""), preset_file_save_pattern, this,
tr("MusE: Save Preset"));
+ if(name.isEmpty())
+ return;
+
//FILE* presetFp = fopen(name.ascii(),"w+");
bool popenFlag;
FILE* presetFp = fileOpen(this, name, QString(".pre"), "w", popenFlag, false, true);
diff --git a/muse/muse/widgets/filedialog.cpp b/muse/muse/widgets/filedialog.cpp
index 90120654..22f256e0 100644
--- a/muse/muse/widgets/filedialog.cpp
+++ b/muse/muse/widgets/filedialog.cpp
@@ -330,37 +330,15 @@ QString getSaveFileName(const QString &startWith,
dlg->setCaption(name);
dlg->setMode(QFileDialog::AnyFile);
QString result;
- if (dlg->exec() == QDialog::Accepted) {
- result = dlg->selectedFile();
- }
+ if (dlg->exec() == QDialog::Accepted)
+ result = dlg->selectedFile();
+
// Added by T356.
- QString filt = dlg->selectedFilter();
- filt = getFilterExtension(filt);
- // Do we have a valid extension?
- if(!filt.isEmpty())
- {
- // If the rightmost characters of the filename do not already contain
- // the extension, add the extension to the filename.
- //if(result.right(filt.length()) != filt)
- if(!result.endsWith(filt))
- result += filt;
- }
- else
+ if(!result.isEmpty())
{
- // No valid extension, or just * was given. Although it would be nice to allow no extension
- // or any desired extension by commenting this section out, it's probably not a good idea to do so.
- //
- // NOTE: Most calls to this routine getSaveFileName() are followed by fileOpen(),
- // which can tack on its own extension, but only if the *complete* extension is blank.
- // So there is some overlap going on. Enabling this actually stops that action,
- // but only if there are no errors in the list of filters. fileOpen() will act as a 'catchall'.
- //
- // Force the filter list to the first one (the preferred one), and then get the filter.
- dlg->setSelectedFilter(0);
- filt = dlg->selectedFilter();
+ QString filt = dlg->selectedFilter();
filt = getFilterExtension(filt);
-
// Do we have a valid extension?
if(!filt.isEmpty())
{
@@ -370,6 +348,31 @@ QString getSaveFileName(const QString &startWith,
if(!result.endsWith(filt))
result += filt;
}
+ else
+ {
+ // No valid extension, or just * was given. Although it would be nice to allow no extension
+ // or any desired extension by commenting this section out, it's probably not a good idea to do so.
+ //
+ // NOTE: Most calls to this routine getSaveFileName() are followed by fileOpen(),
+ // which can tack on its own extension, but only if the *complete* extension is blank.
+ // So there is some overlap going on. Enabling this actually stops that action,
+ // but only if there are no errors in the list of filters. fileOpen() will act as a 'catchall'.
+ //
+ // Force the filter list to the first one (the preferred one), and then get the filter.
+ dlg->setSelectedFilter(0);
+ filt = dlg->selectedFilter();
+ filt = getFilterExtension(filt);
+
+ // Do we have a valid extension?
+ if(!filt.isEmpty())
+ {
+ // If the rightmost characters of the filename do not already contain
+ // the extension, add the extension to the filename.
+ //if(result.right(filt.length()) != filt)
+ if(!result.endsWith(filt))
+ result += filt;
+ }
+ }
}
delete dlg;