| ... | ... | --- /dev/null |
| ... | ... | +++ b/config-file-fix.patch |
| ... | ... | @@ -0,0 +1,106 @@ |
| 1 |
From cb955a98b0dfa435dc0f8b7be1e559121adeb19a Mon Sep 17 00:00:00 2001
|
|
| 2 |
From: thomas_lucky13 <mkoul@mail.ru>
|
|
| 3 |
Date: Mon, 20 Nov 2023 16:04:06 +0300
|
|
| 4 |
Subject: [PATCH] config file fix
|
|
| 5 |
|
|
| 6 |
Remove dialog about config file security before start Trik-Studio
|
|
| 7 |
---
|
|
| 8 |
installer/platform/trikStudio.sh | 2 +-
|
|
| 9 |
qrkernel/platformInfo.cpp | 11 +++++++++++
|
|
| 10 |
qrkernel/qrkernel.pri | 12 ++++++++++++
|
|
| 11 |
qrkernel/settingsDefaultValues | 19 +++++++++++--------
|
|
| 12 |
4 files changed, 35 insertions(+), 9 deletions(-)
|
|
| 13 |
|
|
| 14 |
diff --git a/installer/platform/trikStudio.sh b/installer/platform/trikStudio.sh
|
|
| 15 |
index 5833460..ceb1313 100644
|
|
| 16 |
--- a/installer/platform/trikStudio.sh
|
|
| 17 |
+++ b/installer/platform/trikStudio.sh
|
|
| 18 |
@@ -1,3 +1,3 @@
|
|
| 19 |
#!/bin/sh
|
|
| 20 |
cd $HOME
|
|
| 21 |
-trik-studio --config /etc/trikStudio.config
|
|
| 22 |
+trik-studio
|
|
| 23 |
diff --git a/qrkernel/platformInfo.cpp b/qrkernel/platformInfo.cpp
|
|
| 24 |
index 0e25641..8c3b988 100644
|
|
| 25 |
--- a/qrkernel/platformInfo.cpp
|
|
| 26 |
+++ b/qrkernel/platformInfo.cpp
|
|
| 27 |
@@ -92,9 +92,20 @@ QString PlatformInfo::invariantPath(const QString &path)
|
|
| 28 |
const QString appDataLocationPath = appDataLocationPaths.isEmpty()
|
|
| 29 |
? applicationDirPath() : appDataLocationPaths.first();
|
|
| 30 |
return QString(path).replace("@AppDataLocation@", appDataLocationPath);
|
|
| 31 |
+ } else if (path.startsWith("@AppConfigLocation@")) {
|
|
| 32 |
+ const QStringList appConfigLocationPaths = QStandardPaths::standardLocations(QStandardPaths::AppConfigLocation);
|
|
| 33 |
+ const QString appConfigLocationPath = appConfigLocationPaths.isEmpty()
|
|
| 34 |
+ ? applicationDirPath() : appConfigLocationPaths.first();
|
|
| 35 |
+ return QString(path).replace("@AppConfigLocation@", appConfigLocationPath);
|
|
| 36 |
} else if (path.startsWith("@TempLocation@")) {
|
|
| 37 |
const QString tempPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation);
|
|
| 38 |
return QString(path).replace("@TempLocation@", tempPath);
|
|
| 39 |
+ } else if (path.startsWith("@ProgramDataLocation@")) {
|
|
| 40 |
+ const QString programDataLocationPath = PROGRAMDATA;
|
|
| 41 |
+ return QString(path).replace("@ProgramDataLocation@", programDataLocationPath);
|
|
| 42 |
+ } else if (path.startsWith("@ProgramLibLocation@")) {
|
|
| 43 |
+ const QString programLibLocationPath = PROGRAMLIB;
|
|
| 44 |
+ return QString(path).replace("@ProgramLibLocation@", programLibLocationPath);
|
|
| 45 |
} else if (windowsVariablesRegexp.exactMatch(path)) {
|
|
| 46 |
const QString variable = windowsVariablesRegexp.cap(1);
|
|
| 47 |
const QString value = QProcessEnvironment::systemEnvironment().value(variable);
|
|
| 48 |
diff --git a/qrkernel/qrkernel.pri b/qrkernel/qrkernel.pri
|
|
| 49 |
index 88e9256..f268bf2 100644
|
|
| 50 |
--- a/qrkernel/qrkernel.pri
|
|
| 51 |
+++ b/qrkernel/qrkernel.pri
|
|
| 52 |
@@ -39,3 +39,19 @@ SOURCES += \
|
|
| 53 |
|
|
| 54 |
RESOURCES += \
|
|
| 55 |
$$PWD/qrkernel.qrc \
|
|
| 56 |
+
|
|
| 57 |
+unix:!macx {
|
|
| 58 |
+ isEmpty(PREFIX) {
|
|
| 59 |
+ PREFIX = /usr
|
|
| 60 |
+ }
|
|
| 61 |
+ isEmpty(LIBDIR) {
|
|
| 62 |
+ contains(QMAKE_HOST.arch, x86_64) {LIBDIR="$$PREFIX/lib64"} else {LIBDIR="$$PREFIX/lib"}
|
|
| 63 |
+ }
|
|
| 64 |
+
|
|
| 65 |
+ isEmpty(DATADIR) {
|
|
| 66 |
+ DATADIR="$$PREFIX/share"
|
|
| 67 |
+ }
|
|
| 68 |
+
|
|
| 69 |
+ DEFINES += PROGRAMLIB=\\\"$$LIBDIR/trikStudio\\\"
|
|
| 70 |
+ DEFINES += PROGRAMDATA=\\\"$$DATADIR/trikStudio\\\"
|
|
| 71 |
+}
|
|
| 72 |
diff --git a/qrkernel/settingsDefaultValues b/qrkernel/settingsDefaultValues
|
|
| 73 |
index 0abbb18..4817433 100644
|
|
| 74 |
--- a/qrkernel/settingsDefaultValues
|
|
| 75 |
+++ b/qrkernel/settingsDefaultValues
|
|
| 76 |
@@ -51,16 +51,19 @@ workingDir=./save
|
|
| 77 |
zoomFactor=1.08
|
|
| 78 |
oldLineColor=magenta
|
|
| 79 |
PaintOldEdgeMode=true
|
|
| 80 |
-pathToImages=./images/iconset1
|
|
| 81 |
-pathToHelp=./help
|
|
| 82 |
-pathToTranslations=./translations
|
|
| 83 |
-pathToLogs=@AppDataLocation@/logs/
|
|
| 84 |
-pathToEditorPlugins=./plugins/editors
|
|
| 85 |
-pathToToolPlugins=./plugins/tools
|
|
| 86 |
-pathToInterpretedPlugins=./plugins/interpreted
|
|
| 87 |
+pathToImages=@ProgramDataLocation@/images/iconset1
|
|
| 88 |
+pathToHelp=@ProgramDataLocation@/help
|
|
| 89 |
+pathToTranslations=@ProgramDataLocation@/translations
|
|
| 90 |
+pathToExamples=@ProgramDataLocation@/examples/
|
|
| 91 |
+pathToLogs=@AppConfigLocation@/logs/
|
|
| 92 |
+pathToGeneratorRoot=@AppConfigLocation@/generators/
|
|
| 93 |
+pathToEditorPlugins=@ProgramLibLocation@/plugins/editors
|
|
| 94 |
+pathToToolPlugins=@ProgramLibLocation@/plugins/tools
|
|
| 95 |
+pathToKitPlugins=@ProgramLibLocation@/plugins/tools/kitPlugins/
|
|
| 96 |
+pathToInterpretedPlugins=@ProgramLibLocation@/plugins/interpreted
|
|
| 97 |
pathToDefaultSaves=@DocumentsPath@/
|
|
| 98 |
pathToTempFolder=@TempLocation@/qreal/
|
|
| 99 |
-pathToSplashscreen=./splashscreen.png
|
|
| 100 |
+pathToSplashscreen=@ProgramDataLocation@/images/splashscreen.png
|
|
| 101 |
toolbarSize=30
|
|
| 102 |
AutosaveTempFileName=~tempFile
|
|
| 103 |
pythonPath=python
|
|
| 104 |
--
|
|
| 105 |
2.40.1
|
|
| 106 |
|
| ... | ... | --- a/trik-studio.spec |
| ... | ... | +++ b/trik-studio.spec |
| ... | ... | @@ -37,7 +37,7 @@ Summary: TRIK Studio programming environment |
| 37 | 37 |
Summary(ru_RU.UTF-8): Cреда программирования TRIK Studio
|
| 38 | 38 |
Name: trik-studio
|
| 39 | 39 |
Version: 2023.1
|
| 40 |
Release: 1
|
|
| 40 |
Release: 3
|
|
| 41 | 41 |
License: Apache-2.0
|
| 42 | 42 |
Group: Sciences/Computer science
|
| 43 | 43 |
Url: https://github.com/trikset/trik-studio
|
| ... | ... | @@ -50,6 +50,7 @@ Url: https://github.com/trikset/trik-studio |
| … | … | |
| 50 | 50 |
Source0: %{name}-%{version}.tar.xz
|
| 51 | 51 |
Patch0: trik-studio-quazip1-qt5.patch
|
| 52 | 52 |
Patch1: trik-studio-python3.11.patch
|
| 53 |
Patch2: config-file-fix.patch
|
|
| 53 | 54 |
BuildRequires: qmake5
|
| 54 | 55 |
%ifnarch %{e2k}
|
| 55 | 56 |
BuildRequires: %{_lib}ubsan-static-devel
|
New comment