mirror of
https://github.com/leozide/leocad
synced 2025-02-05 08:45:55 +01:00
Prompt to save ldr files with multiple models as mpd. Fixes #311.
This commit is contained in:
parent
8f8a93e835
commit
f74b7bc801
1 changed files with 12 additions and 5 deletions
|
@ -2259,18 +2259,25 @@ void lcMainWindow::ImportInventory()
|
|||
else
|
||||
delete NewProject;
|
||||
}
|
||||
|
||||
bool lcMainWindow::SaveProject(const QString& FileName)
|
||||
{
|
||||
QString SaveFileName;
|
||||
QString SaveFileName = FileName;
|
||||
Project* Project = lcGetActiveProject();
|
||||
|
||||
if (!FileName.isEmpty())
|
||||
SaveFileName = FileName;
|
||||
else
|
||||
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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue