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
|
else
|
||||||
delete NewProject;
|
delete NewProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lcMainWindow::SaveProject(const QString& FileName)
|
bool lcMainWindow::SaveProject(const QString& FileName)
|
||||||
{
|
{
|
||||||
QString SaveFileName;
|
QString SaveFileName = FileName;
|
||||||
Project* Project = lcGetActiveProject();
|
Project* Project = lcGetActiveProject();
|
||||||
|
|
||||||
if (!FileName.isEmpty())
|
if (!SaveFileName.isEmpty() && Project->GetModels().GetSize() > 1 && QFileInfo(SaveFileName).suffix().toLower() != QLatin1String("mpd"))
|
||||||
SaveFileName = FileName;
|
SaveFileName.clear();
|
||||||
else
|
|
||||||
|
if (SaveFileName.isEmpty())
|
||||||
{
|
{
|
||||||
SaveFileName = Project->GetFileName();
|
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())
|
if (SaveFileName.isEmpty())
|
||||||
SaveFileName = QFileInfo(QDir(lcGetProfileString(LC_PROFILE_PROJECTS_PATH)), Project->GetTitle()).absoluteFilePath();
|
SaveFileName = QFileInfo(QDir(lcGetProfileString(LC_PROFILE_PROJECTS_PATH)), Project->GetTitle()).absoluteFilePath();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue