Don't try to change the file extension to mpd. Fixes #451. Fixes #616. Fixes #462.

This commit is contained in:
Leonardo Zide 2021-02-07 13:44:59 -08:00
parent 98f2679cb2
commit b99724c7b0

View file

@ -2495,20 +2495,10 @@ bool lcMainWindow::SaveProject(const QString& FileName)
QString SaveFileName = FileName;
Project* Project = lcGetActiveProject();
if (!SaveFileName.isEmpty() && Project->GetModels().GetSize() > 1 && QFileInfo(SaveFileName).suffix().toLower() != QLatin1String("mpd"))
SaveFileName.clear();
if (SaveFileName.isEmpty())
{
SaveFileName = Project->GetFileName();
if (Project->GetModels().GetSize() > 1 && QFileInfo(SaveFileName).suffix().toLower() != QLatin1String("mpd"))
{
int SuffixLength = QFileInfo(SaveFileName).suffix().length();
if (SuffixLength)
SaveFileName = SaveFileName.left(SaveFileName.length() - SuffixLength - 1);
}
if (SaveFileName.isEmpty())
SaveFileName = QFileInfo(QDir(lcGetProfileString(LC_PROFILE_PROJECTS_PATH)), Project->GetTitle()).absoluteFilePath();