mirror of
https://github.com/leozide/leocad.git
synced 2026-07-27 19:56:49 +00:00
Fixed crash using the --stud-style option.
This commit is contained in:
@@ -655,12 +655,7 @@ lcCommandLineOptions lcApplication::ParseCommandLineOptions()
|
||||
}
|
||||
}
|
||||
else if (Option == QLatin1String("-ss") || Option == QLatin1String("--stud-style"))
|
||||
{
|
||||
ParseInteger(Options.StudStyle, 0, 7);
|
||||
|
||||
if (Options.StudStyle != lcGetProfileInt(LC_PROFILE_STUD_STYLE))
|
||||
lcGetPiecesLibrary()->SetStudStyle(Options.StudStyle, false);
|
||||
}
|
||||
else if (Option == QLatin1String("-obj") || Option == QLatin1String("--export-wavefront"))
|
||||
{
|
||||
Options.SaveWavefront = true;
|
||||
@@ -835,6 +830,8 @@ lcStartupMode lcApplication::Initialize(const QList<QPair<QString, bool>>& Libra
|
||||
}
|
||||
}
|
||||
|
||||
lcGetPiecesLibrary()->SetStudStyle(Options.StudStyle, false);
|
||||
|
||||
if (!SaveAndExit)
|
||||
gMainWindow->CreateWidgets();
|
||||
|
||||
|
||||
@@ -1536,6 +1536,9 @@ bool lcPiecesLibrary::SupportsStudStyle() const
|
||||
|
||||
void lcPiecesLibrary::SetStudStyle(int StudStyle, bool Reload)
|
||||
{
|
||||
if (mStudStyle == StudStyle)
|
||||
return;
|
||||
|
||||
mStudStyle = StudStyle;
|
||||
|
||||
LoadColors();
|
||||
|
||||
Reference in New Issue
Block a user