1 From 6e7dd2c763e2cc79db4cd7173921a4e72ce9b95e Mon Sep 17 00:00:00 2001
2 From: Elias Probst <mail@eliasprobst.eu>
3 Date: Tue, 5 Oct 2021 02:55:18 +0200
4 Subject: [PATCH] Don't use configurable POV-ray path.
6 Once the POV-ray path is configurable, it'll be written to the LeoCAD
7 profile, which will break upon the next update of POV-ray which will
8 have a different Nix store path.
10 Signed-off-by: Elias Probst <mail@eliasprobst.eu>
12 common/lc_application.cpp | 1 -
13 common/lc_profile.cpp | 2 +-
14 qt/lc_qpreferencesdialog.cpp | 3 ++-
15 qt/lc_renderdialog.cpp | 2 +-
16 4 files changed, 4 insertions(+), 4 deletions(-)
18 diff --git a/common/lc_application.cpp b/common/lc_application.cpp
19 index cbdec82e..21974510 100644
20 --- a/common/lc_application.cpp
21 +++ b/common/lc_application.cpp
22 @@ -1267,7 +1267,6 @@ void lcApplication::ShowPreferencesDialog()
23 lcSetProfileString(LC_PROFILE_DEFAULT_AUTHOR_NAME, Options.DefaultAuthor);
24 lcSetProfileString(LC_PROFILE_PARTS_LIBRARY, Options.LibraryPath);
25 lcSetProfileString(LC_PROFILE_MINIFIG_SETTINGS, Options.MinifigSettingsPath);
26 - lcSetProfileString(LC_PROFILE_POVRAY_PATH, Options.POVRayPath);
27 lcSetProfileString(LC_PROFILE_POVRAY_LGEO_PATH, Options.LGEOPath);
28 lcSetProfileString(LC_PROFILE_LANGUAGE, Options.Language);
29 lcSetProfileInt(LC_PROFILE_CHECK_UPDATES, Options.CheckForUpdates);
30 diff --git a/common/lc_profile.cpp b/common/lc_profile.cpp
31 index 1975b586..911c4fb0 100644
32 --- a/common/lc_profile.cpp
33 +++ b/common/lc_profile.cpp
34 @@ -132,7 +132,7 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
35 lcProfileEntry("HTML", "ImageWidth", 640), // LC_PROFILE_HTML_IMAGE_WIDTH
36 lcProfileEntry("HTML", "ImageHeight", 480), // LC_PROFILE_HTML_IMAGE_HEIGHT
38 - lcProfileEntry("POVRay", "Path", "/usr/bin/povray"), // LC_PROFILE_POVRAY_PATH
39 + lcProfileEntry("POVRay", "Path", "@povray@/bin/povray"), // LC_PROFILE_POVRAY_PATH
40 lcProfileEntry("POVRay", "LGEOPath", ""), // LC_PROFILE_POVRAY_LGEO_PATH
41 lcProfileEntry("POVRay", "Width", 1280), // LC_PROFILE_POVRAY_WIDTH
42 lcProfileEntry("POVRay", "Height", 720), // LC_PROFILE_POVRAY_HEIGHT
43 diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp
44 index 89f86aad..c239763f 100644
45 --- a/qt/lc_qpreferencesdialog.cpp
46 +++ b/qt/lc_qpreferencesdialog.cpp
47 @@ -55,7 +55,8 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
48 ui->partsLibrary->setText(mOptions->LibraryPath);
49 ui->ColorConfigEdit->setText(mOptions->ColorConfigPath);
50 ui->MinifigSettingsEdit->setText(mOptions->MinifigSettingsPath);
51 - ui->povrayExecutable->setText(mOptions->POVRayPath);
52 + ui->povrayExecutable->hide();
53 + ui->povrayExecutableBrowse->hide();
54 ui->lgeoPath->setText(mOptions->LGEOPath);
55 ui->authorName->setText(mOptions->DefaultAuthor);
56 ui->mouseSensitivity->setValue(mOptions->Preferences.mMouseSensitivity);
57 diff --git a/qt/lc_renderdialog.cpp b/qt/lc_renderdialog.cpp
58 index bd8a9102..96794738 100644
59 --- a/qt/lc_renderdialog.cpp
60 +++ b/qt/lc_renderdialog.cpp
61 @@ -184,7 +184,7 @@ void lcRenderDialog::on_RenderButton_clicked()
65 - POVRayPath = lcGetProfileString(LC_PROFILE_POVRAY_PATH);
66 + POVRayPath = QDir::cleanPath(QLatin1String("@povray@/bin/povray"));
67 Arguments.append("+FN");
68 Arguments.append("-D");