1 (edited by plc-user 2025-01-23 20:41:03)

Topic: Set Config- and Data-Directory to system-specific paths

This thread is a continuation of the topic that started here:
https://qelectrotech.org/forum/viewtopi … 844#p20844
----------------------------

Salut Laurent !

I created a patch to set the config- and data-directories to system-specific values.

diff --git a/sources/dxf/dxftoelmt.cpp b/sources/dxf/dxftoelmt.cpp
index f2dd572d8..85ea2534f 100644
--- a/sources/dxf/dxftoelmt.cpp
+++ b/sources/dxf/dxftoelmt.cpp
@@ -21,7 +21,7 @@
 #include <QFile>
 #include <QProcess>
 #include <QMessageBox>
-#include <QDir>
+#include <QStandardPaths>
 
 /**
  * @brief dxftoElmt
@@ -71,13 +71,7 @@ QByteArray dxfToElmt(const QString &file_path)
 
 QString dxf2ElmtDirPath()
 {
-#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
-    return (QDir::homePath() + QStringLiteral("/Application Data/qet/binary"));
-#elif defined(Q_OS_MACOS)
-    return (QDir::homePath() + QStringLiteral("/.qet/binary"));
-#else
-    return (QDir::homePath() + QStringLiteral("/.qet/binary"));
-#endif
+    return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/binary";
 }
 
 /**
diff --git a/sources/main.cpp b/sources/main.cpp
index ed460609f..5eb7efca3 100644
--- a/sources/main.cpp
+++ b/sources/main.cpp
@@ -112,7 +112,8 @@ void myMessageOutput(QtMsgType type,
         txt+= context.function ? context.function : "";
         txt+=")\n";
     }
-    QFile outFile(QETApp::configDir()
+    QFile outFile(QETApp::dataDir()
+              +"/"
               +QDate::currentDate().toString("yyyyMMdd")
               +".log");
     if(outFile.open(QIODevice::WriteOnly | QIODevice::Append))
@@ -131,7 +132,7 @@ void myMessageOutput(QtMsgType type,
 void delete_old_log_files(int days)
 {
     const QDate today = QDate::currentDate();
-    const QString path = QETApp::configDir() + "/";
+    const QString path = QETApp::dataDir() + "/";
 
     QString filter("%1%1%1%1%1%1%1%1.log"); // pattern
     filter = filter.arg("[0123456789]"); // valid characters
diff --git a/sources/qet_elementscaler/qet_elementscaler.cpp b/sources/qet_elementscaler/qet_elementscaler.cpp
index 930bae333..b7e362d1e 100644
--- a/sources/qet_elementscaler/qet_elementscaler.cpp
+++ b/sources/qet_elementscaler/qet_elementscaler.cpp
@@ -22,7 +22,7 @@
 #include <QProcess>
 #include <QInputDialog>
 #include <QMessageBox>
-#include <QDir>
+#include <QStandardPaths>
 
 /**
  * @brief QET_ElementScaler
@@ -113,13 +113,7 @@ QByteArray ElementScaler(const QString &file_path, QWidget *parent)
 
 QString ElementScalerDirPath()
 {
-#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
-    return (QDir::homePath() + QStringLiteral("/Application Data/qet/binary"));
-#elif defined(Q_OS_MACOS)
-    return (QDir::homePath() + QStringLiteral("/.qet/binary"));
-#else
-    return (QDir::homePath() + QStringLiteral("/.qet/binary"));
-#endif
+    return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/binary";
 }
 
 /**
diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp
index f1211bb47..e7611fd88 100644
--- a/sources/qetapp.cpp
+++ b/sources/qetapp.cpp
@@ -121,7 +121,7 @@ QETApp::QETApp() :
         tr("Chargement... Initialisation du cache des collections d'éléments",
            "splash screen caption"));
     if (!collections_cache_) {
-    QString cache_path = QETApp::configDir() + "/elements_cache.sqlite";
+    QString cache_path = QETApp::dataDir() + "/elements_cache.sqlite";
 
         collections_cache_ = new ElementsCollectionCache(cache_path, this);
         collections_cache_->setLocale(langFromSetting());
@@ -620,7 +620,7 @@ QString QETApp::customElementsDir()
             }
         }
 
-        m_custom_element_dir = configDir() + "elements/";
+        m_custom_element_dir = dataDir() + "/elements/";
         return m_custom_element_dir;
     }
 }
@@ -657,7 +657,7 @@ QString QETApp::companyElementsDir()
             }
         }
 
-        m_company_element_dir = configDir() + "elements-company/";
+        m_company_element_dir = dataDir() + "/elements-company/";
         return m_company_element_dir;
     }
 }
@@ -780,7 +780,7 @@ QString QETApp::companyTitleBlockTemplatesDir()
         return m_user_company_tbt_dir;
     }
 
-    return(configDir() + "titleblocks-company/");
+    return(dataDir() + "/titleblocks-company/");
 }
 
 /**
@@ -813,7 +813,7 @@ QString QETApp::customTitleBlockTemplatesDir()
         return m_user_custom_tbt_dir;
     }
 
-    return(configDir() + "titleblocks/");
+    return(dataDir() + "/titleblocks/");
 }
 
 /**
@@ -841,21 +841,31 @@ QString QETApp::configDir()
 #ifdef QET_ALLOW_OVERRIDE_CD_OPTION
     if (config_dir != QString()) return(config_dir);
 #endif
-#ifdef Q_OS_WIN32
-    // recupere l'emplacement du dossier Application Data
-    // char *app_data_env = getenv("APPDATA");
-    // QString app_data_str(app_data_env);
-    QProcess * process = new QProcess();
-    QString app_data_str = (process->processEnvironment()).value("APPDATA");
-    // delete app_data_env;
-    delete process;
-    if (app_data_str.isEmpty()) {
-        app_data_str = QDir::homePath() + "/Application Data";
-    }
-    return(app_data_str + "/qet/");
-#else
-    return(QDir::homePath() + "/.qet/");
-#endif
+    QString configdir = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
+    if (configdir.endsWith('/')) {
+        configdir.remove(configdir.length()-1, 1);
+    }
+    return configdir;
+}
+
+/**
+    @brief QETApp::dataDir
+    Return the QET data folder, i.e. the path to the folder in which
+    QET will find user-collections and user-titleblocks by default
+    specific to the current user. This directory is generally
+    C:/Users/<USER>/AppData/Roaming/<APPNAME>
+    on Windows and
+    ~/.local/share/<APPNAME>
+    under UNIX-like systems.
+    \~ @return The path of the QElectroTech data-folder
+*/
+QString QETApp::dataDir()
+{
+    QString datadir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
+    if (datadir.endsWith('/')) {
+        datadir.remove(datadir.length()-1, 1);
+    }
+    return datadir;
 }
 
 /**
@@ -1536,7 +1546,7 @@ void QETApp::useSystemPalette(bool use) {
                 "}"
                 );
     } else {
-        QFile file(configDir() + "style.css");
+        QFile file(configDir() + "/style.css");
         file.open(QFile::ReadOnly);
         QString styleSheet = QLatin1String(file.readAll());
         qApp->setStyleSheet(styleSheet);
diff --git a/sources/qetapp.h b/sources/qetapp.h
index 2f4cdc402..572e2c837 100644
--- a/sources/qetapp.h
+++ b/sources/qetapp.h
@@ -97,6 +97,7 @@ class QETApp : public QObject
         static QETProject *project(const uint &);
         static int projectId(const QETProject *);
         static QString configDir();
+        static QString dataDir();
         static QString languagesPath();
         static QString realPath(const QString &);
         static QString symbolicPath(const QString &);
diff --git a/sources/ui/aboutqetdialog.cpp b/sources/ui/aboutqetdialog.cpp
index b1dc0abc0..f94b62449 100644
--- a/sources/ui/aboutqetdialog.cpp
+++ b/sources/ui/aboutqetdialog.cpp
@@ -208,7 +208,7 @@ void AboutQETDialog::setLicence()
 */
 void AboutQETDialog::setLoginfo()
 {
-    const QString path = QETApp::configDir() + "/";
+    const QString path = QETApp::dataDir() + "/";
     QString filter("%1%1%1%1%1%1%1%1.log"); // pattern
     filter = filter.arg("[0123456789]"); // valid characters
     Q_FOREACH (auto fileInfo,

As already said in previous post the general configuration-file of QET and the stalefiles are completely managed by Qt-Library-functions. So they are already at system-specific locations. There is no need to touch them with these modifications!

I uploaded that patch to my fork of QET at https://github.com/plc-user/qelectrotech-source-mirror and can create a pull-request, if you wish, Laurent.

@all:
Everyone who can compile QET from sources is invited to download, compile and test the software!  nomicons/smile
But be aware:
The location of configurations, the elements-collections and the titleblocks may (will) have changed!
Please give feedback here or at github about your experience!

Thanks in advance!
  plc-user

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Set Config- and Data-Directory to system-specific paths

Hallo plc-user:

Stalefiles was based to #include <KAutoSaveFile> (KCoreAddons)
https://api.kde.org/frameworks/kcoreadd … eFile.html

qetapp.cpp
https://github.com/qelectrotech/qelectr … pp.cpp#L50
https://github.com/qelectrotech/qelectr … .cpp#L2271

qetdiagrameditor.cpp
https://github.com/qelectrotech/qelectr … or.cpp#L51
https://github.com/qelectrotech/qelectr … .cpp#L1898

qetproject.cpp
https://github.com/qelectrotech/qelectr … ct.cpp#L93

qetproject.h
https://github.com/qelectrotech/qelectr … ject.h#L34
https://github.com/qelectrotech/qelectr … ject.h#L83

Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

3 (edited by plc-user 2025-01-24 10:29:45)

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

Thanks for the Links!

I think we don't have to handle stalefiles in this context, because we speak of the default-location of QET-Configuration, Elements, Titleblocks, etc.

plc-user wrote:

The stalefiles are handled by library-functions of Qt and are stored here:
/home/$USER/.local/share/stalefiles/QElectroTech/
No need to take any action!

And as "KDE" says on linked site:

KAutoSaveFile wrote:

Creates and manages a temporary "auto-save" file.

Autosave files are temporary files that applications use to store the unsaved data in a file they have open for editing. KAutoSaveFile allows you to easily create and manage such files, as well as to recover the unsaved data left over by a crashed or otherwise gone process.

The stalefiles are temporary copies of the current schematics in a QET-Project.
So: There is no need to take any action with stalefiles in this context.

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

With no code-change in stale-file handling.

In the attachment: A short story of stalefiles in pictures. nomicons/wink

Post's attachments

Bildschirmfoto_001_stalefile_with_QET_running.png, 8.57 kb, 388 x 124
Bildschirmfoto_001_stalefile_with_QET_running.png 8.57 kb, 8 downloads since 2025-01-24 

Bildschirmfoto_002_stalefile_with_QET_killed.png, 8.53 kb, 384 x 133
Bildschirmfoto_002_stalefile_with_QET_killed.png 8.53 kb, 7 downloads since 2025-01-24 

Bildschirmfoto_003_re-open_QET.png, 15.1 kb, 364 x 158
Bildschirmfoto_003_re-open_QET.png 15.1 kb, 8 downloads since 2025-01-24 

Bildschirmfoto_004_QET_closed_again.png, 5.43 kb, 396 x 110
Bildschirmfoto_004_QET_closed_again.png 5.43 kb, 7 downloads since 2025-01-24 

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Set Config- and Data-Directory to system-specific paths

Hallo plc-user,

you could add a pull request?

Users just want to know the PATH of stalesfiles:
https://qelectrotech.org/bugtracker/view.php?id=209

Joshua wrote:

When you click on cancel the backup file is deleted (it is the normal behavior).
I can't reproduce your bug on my windows 10 vm.
Can you test :
-when you click on cancel if the file on the folder C:\Users\ your_username\AppData\Local\stalefiles\QElectroTech is still here or not.
-Install the last QElectrotech build
-Test on another pc

BTW, I added new commit since.
https://github.com/qelectrotech/qelectr … 4af8e61d49


Edit:
11:50:34.522 Info:  System language: "fr"
11:50:34.523 Info:  language Path: "/usr/local/share/qelectrotech/lang/"
11:50:34.523 Info:  Common Elements Dir: "/usr/local/share/qelectrotech/elements/"
11:50:34.523 Info:  Common TitleBlock Templates Dir: "/usr/local/share/qelectrotech/titleblocks/"
11:50:34.523 Info:  Custom Elements Dir: "/home/laurent/.qet/elements/"
11:50:34.523 Info:  Custom TitleBlock Templates Dir: "/home/laurent/.qet/titleblocks/"
11:50:34.523 Info:  Company Elements Dir: "/home/laurent/.qet/elements-company/"
11:50:34.523 Info:  Company TitleBlock Templates Dir: "/home/laurent/.qet/titleblocks-company"
11:50:34.523 Info:  User Location: "/home/laurent/.qet/"
11:50:34.523 Info:  Config Location : ("/home/laurent/.config/QElectroTech/QElectroTech")
11:50:34.523 Info:  Project stalefiles Location: "/home/laurent/.local/share/QElectroTech/QElectroTech"

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

6 (edited by plc-user 2025-01-24 14:34:57)

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

scorpio810 wrote:

you could add a pull request?

Done!
There were overlapping changes at "machine_info.cpp" that conflicted with automatic merge at github.
EDIT:
No conflicts anymore: PR can be merged automatically!

scorpio810 wrote:

Users just want to know the PATH of stalesfiles:
https://qelectrotech.org/bugtracker/view.php?id=209

The path to stalefiles-directory seems to be:

QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)

according to info at https://doc.qt.io/qt-6/qstandardpaths.html it resolves to:

Linux:
  "~/.local/share"
windows: 
  "C:/Users/<USER>/AppData/Local"
macos:
  "~/Library/Application Support"

On my Debian - machines the stalefiles-directory for QET is this:

/home/ich/.local/share/stalefiles/QElectroTech/

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Set Config- and Data-Directory to system-specific paths

Hallo plc-user,

As expected, things aren't going so well

Um, Maybe I think I made a a little mistake when merging your PR, there are a lot of things to re-set,like elements, ect locations PATH, the location of binary plugin collections, the path in the logs now was  wrong, and so on.



DXF2elmt Binary or QETelementScaler offers me this PATH now on my Debian: /home/laurent/.local/share/QElectroTech/QElectroTech/binary/


Sometimes you have to demolish everything in order to rebuild better. nomicons/wink

Best regards,
Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

8 (edited by plc-user 2025-01-24 19:33:50)

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

scorpio810 wrote:

Maybe I think I made a a little mistake when merging your PR (...)

I admit, I was a bit surprised, that you accepted the PR that fast! nomicons/wink

scorpio810 wrote:

(...) the location of binary plugin collections, the path in the logs now was  wrong, and so on.

I wouldn't say the paths were wrong: Let's say the paths were different!

plc-user wrote:

Transition for the users might be a challenge...

We should at least have done a few tests to see how the change affects the various systems and how the effects can be explained and resolved. That's why I invited the other forum members to try out the changes on their systems and give feedback!
The invitation to test and give feedback is still active!

As far as I have seen on my systems, the corrections are limited to moving files from here to there. And on systems without any previous version, everything is fine!

scorpio810 wrote:

/home/laurent/.local/share/QElectroTech/QElectroTech/binary/

Yes, that's the new directory for the binaries of dxf2elmt and QET_ElementScaler on Linux
On a windows-system this directory for the additional binaries defaults to this:

C:/Users/<USER>/AppData/Roaming/QElectroTech/QElectroTech/binary

Do the path-specifications for python-plugin "qet_tb_generator" also need to be adjusted? I don't think so, because these aren't touched by the changes regarding "configDir()" or "dataDir()": They still refer to "QDir::homePath()".
(There is so much hardcoded in the sources! Maybe in another step and with the support of someone knowing, how to deal with "constrictor snakes"...)

As you said, the configuration on win is kept in the Registry, but the additional configuration files (*.json for nomenclature, etc.) are kept in this newly created path:

C:/Users/<USER>/AppData/Local/QElectroTech/QElectroTech/

For users who start QET from the command line and use the parameter “--config-dir $PATH”, nothing with configuration changes, as this is handled when the program is started, before reading system-default.

scorpio810 wrote:

Sometimes you have to demolish everything in order to rebuild better. nomicons/wink

We are on a good way to make QET even better!  nomicons/smile

Best regards,
  plc-user

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

9 (edited by plc-user Yesterday 21:37:45)

Re: Set Config- and Data-Directory to system-specific paths

A short manual for the transition from old to new locations of config- and data-directories.

In the following blocks you find the changes, that have to be made by the user, when upgrading to the new version.
If you are missing any information or have found an error, please let us know!

Modifications on Linux:
- location of QElectroTech.conf:
  ~/.config/QElectroTech/QElectroTech.conf
  NO activity required!
- location of QET-stalefiles
  ~/.local/share/stalefiles/QElectroTech
  NO activity required!
- python-plugin "qet_tb_generator"
  binary of plugin may be moved to ~/.local/share/QElectroTech/QElectroTech/binary
  but generally: NO activity required!

Linux old                         -->  Linux new
~/.qet/*.json                     -->  ~/.config/QElectroTech/QElectroTech/*.json
~/.qet/element_texts_pattern/*.*  -->  ~/.config/QElectroTech/QElectroTech/element_texts_pattern/*.*
~/.qet/*.log                      -->  ~/.local/share/QElectroTech/QElectroTech/*.log
~/.qet/elements_cache.sqlite      -->  ~/.local/share/QElectroTech/QElectroTech/elements_cache.sqlite
the following directories: including content!
~/.qet/binary                     -->  ~/.local/share/QElectroTech/QElectroTech/binary
~/.qet/elements                   -->  ~/.local/share/QElectroTech/QElectroTech/elements
~/.qet/elements-company           -->  ~/.local/share/QElectroTech/QElectroTech/elements-company
~/.qet/titleblocks                -->  ~/.local/share/QElectroTech/QElectroTech/titleblocks
~/.qet/titleblocks-company        -->  ~/.local/share/QElectroTech/QElectroTech/titleblocks-company

--------------------------------------------------------------------------------

Modifications on Windows (ReadyToUse):
- Configuration and data:
  NO activity required
- python-plugin "qet_tb_generator"
  binary of plugin may be moved to  (base-dir)\conf\binary
  but generally: NO activity required!

--------------------------------------------------------------------------------

Modifications on Windows (Installer):
- QElectroTech.conf:
  NO activity required: Registry
- QET-stalefiles
  NO activity required!
- python-plugin "qet_tb_generator"
  binary of plugin may be moved to  (+)\Roaming\QElectroTech\QElectroTech\binary
  but generally: NO activity required!

To keep line-length short:
  "(#)" means "C:\Users\<USER>\Application Data"
  "(+)" means "C:\Users\<USER>\AppData"

Windows old                        -->  Windows new
(#)\qet\*.json                     -->  (+)\Local\QElectroTech\QElectroTech\*.json
(#)\qet\element_texts_pattern\*.*  -->  (+)\Local\QElectroTech\QElectroTech\element_texts_pattern\*.*
(#)\qet\*.log                      -->  (+)\Roaming\QElectroTech\QElectroTech\*.log
(#)\qet\elements_cache.sqlite      -->  (+)\Roaming\QElectroTech\QElectroTech\elements_cache.sqlite
the following directories: including content!
(#)\qet\binary                     -->  (+)\Roaming\QElectroTech\QElectroTech\binary
(#)\qet\elements                   -->  (+)\Roaming\QElectroTech\QElectroTech\elements
(#)\qet\elements-company           -->  (+)\Roaming\QElectroTech\QElectroTech\elements-company
(#)\qet\titleblocks                -->  (+)\Roaming\QElectroTech\QElectroTech\titleblocks
(#)\qet\titleblocks-company        -->  (+)\Roaming\QElectroTech\QElectroTech\titleblocks-company

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

10 (edited by plc-user 2025-01-25 22:24:05)

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

A question of understanding about other storage locations:
Is there a special reason why all files (projects, export files, BOMs, etc.) are saved on the desktop by default and not in the documents directory?
I would even suggest to save nomenclatures, BOMs, etc. just beside the project-files by default.
While we're at it, we could adjust this at the same time. No user intervention would be necessary for this change!

Best regards
  plc-user

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Set Config- and Data-Directory to system-specific paths

Hallo plc-user,

I can't remember, I think it's been from the beginning...
I've always hated DesktopLocation... which saves the default project under Desktop! So I prefer to "save it" to others PATH.


Change can be easy, like this:

--- sources/qetproject.cpp
+++ sources/qetproject.cpp
@@ -369,7 +369,7 @@ QString QETProject::currentDir() const
{
     QString current_directory;
     if (m_file_path.isEmpty()) {
-        current_directory = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
+        current_directory = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
     } else {
         current_directory = QFileInfo(m_file_path).absoluteDir().absolutePath();
     }

Best regards
laurent

Edit :

https://github.com/qelectrotech/qelectr … 4db6af63a1

And

https://github.com/qelectrotech/qelectr … e1a08775fa

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: Set Config- and Data-Directory to system-specific paths

plc-user wrote:

A short manual for the transition from old to new locations of config- and data-directories.

In the following blocks you find the changes, that have to be made by the user.
If you are missing any information or have found an error, please let us know!


Hi plc-user and thanks for your little manual for the transition,
I will try to do it for macOS, maybe next week if I have time,
but I have to install a new macOS VM on my mac Mini and install december QET and compare the old locations with new QET  version's files PATH . But if someone can do it, I'd be relieved nomicons/wink

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

What I noticed when using the ReadyToUse version for Windows:
We haven't quite finished setting the directories for configuration and data yet.
One small detail is still missing:
A command line parameter for specifying a data directory!

If we want to keep the “ReadyToUse” version for Windows as a “portable” version as far as possible, in which all files are located under ONE base directory, we need the command line parameter “--data-dir” in the batch file. Otherwise, the log files and data are not stored in the directory of the ReadyToUse version, but in the standard Windows data directory.

As an additional benefit, we offer users the option of running completely separate versions on one PC! It would only need to be called with different parameters for “--config-dir” and “--data-dir” and completely different configurations and data are possible.
And this applies in particular to all macOS and Linux users:
Here the configuration is available as “QElectroTech.conf”, which is also located in the configuration directory. Win users have the disadvantage with the registry...

Will upload the changes to my fork of QET very soon ... stay tuned!  nomicons/smile


I have also noticed that we (still) supply a “QElectroTech.conf” with the ReadyToUse version, which is known not to be used on Windows. This can therefore be removed?

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Set Config- and Data-Directory to system-specific paths

Hallo plc-user,

i just published all packages, please try and check.
I don't publish arm64 macOS at this time. maybe this week...

Thanks,
Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

scorpio810 wrote:

i just published all packages, please try and check.

Thank you for the work you did with packaging! 
In my opinion they work perfectly:
For the ReadyToUse-Version the additional config (*.json, etc) and the data (elements, titleblocks, etc) are saved below one directory!

For convenience-reasons I changed some additional places in source-code, to QETApp::documentDir(), where other places were used.

But still: Location and handling of qet_tb_generator stays untouched, until we know, what we have to do to also move it to "dataDir()/binary" or so.
Or can we drop support of python-plugin at some time, when internal Terminal-Manager is ready for production-use?

This leads to the question of what is going on with Joshua: Do you have any information? How are he and his wife doing now? Can we expect to see him again in the foreseeable future? Please send him my regards: He is missing!

scorpio810 wrote:

I don't publish arm64 macOS at this time. maybe this week...

That's o.k. with me: Have no bitten fruits...  nomicons/wink

Best regards
  plc-user

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Set Config- and Data-Directory to system-specific paths

Hallo plc-user and thanks,

merged and package it for Debian, Ubuntu PPA, windows, please could you check-it?

No news about Joshua since november 2024. The delicate operation on his partner's severely damaged vertebrae went well and she is gradually recovering.

I was slow to reply, but I haven't heard from her since.

I hope he'll read this. And that they're well.

Best regards,
Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

Didn't find any new Debian-Packages on QET-Repo but my local created binary works very well with the latest changes!
The latest "major" changes mainly concern the ReadyToUse version for Windows and it works exactly as I know it from the “old” version ... only with more comprehensible directories for projects, exports, etc.!
The Install-Version for Windows also works as expected.

Best regards,
  plc-user

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

Didn't find any new Debian-Packages on QET-Repo but my local created binary works very well with the latest changes!

I rebuilt the Debian packages, perhaps I was very tired or in too much of a hurry at lunchtime when I pushed them ...

Best regards,
Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

19 (edited by plc-user 2025-01-29 20:45:42)

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

Thanks again, Laurent!
The Debian-Version is also working pretty good!

A few questions about "qet_tb_plugin":
As I understand correctly, the plugin may or even can only be started, when a project is loaded, correct?
"qet_tb_plugin" or "qet_tb_plugin.exe" is an executable file, right?
And:
Similar to dxf2elmt or QET_ElementScaler QET only starts the executable from known locations ... QET does not download python or source-code of the plugin, right?

If all three answers are "yes", some of the "spaghetti-code" in qetdiagrameditor.cpp can be simplified and "automated" similar to configDir() or dataDir().
Already making first attempts...

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

Re: Set Config- and Data-Directory to system-specific paths

Hallo plc-user,

"qet_tb_plugin" isn't easy to found:
On Windows you can make a binary.exe but all antirus refuse them...
https://qelectrotech.org/forum/viewtopi … 141#p17141
https://qelectrotech.org/forum/viewtopi … 150#p17150


Now it's more complicated under Debian like, they require you to install python in a virtual venv, see:
https://qelectrotech.org/forum/viewtopic.php?id=2861

Edit: https://qelectrotech.org/forum/viewtopi … 640#p20640

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

21 (edited by plc-user Yesterday 13:35:34)

Re: Set Config- and Data-Directory to system-specific paths

Salut Laurent !

Thanks for the links, but don't get me wrong:
I don't want to compile it, just want to use that plugin!
There are binaries for Linux and Win that run on Debian unstable and win10 that I can use on github: raulroda These binaries work for me.
EDIT (again):
Remark for me: Terminals in project need to be connected! Then the plugin works as expected!

In the meantime I rewrote the code for calling qet_tb_generator from diagram-editor: It looks very tidy now.
I used the existing locations for the various systems and added new path "dataDir()/binary" to search for the plugin. A few lines of additional output to log-file can be removed again, if we want.

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !