Hi Liviu! Thank you for your great work!
From version 6.12.0 (adding history), when the program is run, a directory is created (auto-saving, working, importing) but in wrong encoding (see attachment).
When you set the location of files in the settings again, this does not happen.
I tried to change the directory name in the settings file, but it didn't work, the encoding changed again and the directories were created.
I would like to help fix this in the code, but I did not understand where is making these directories.
Hello, Alex, and thank you for the appreciation!
I am very interested to fix this potential bug. So:
- Could you please confirm that exactly in FET-6.12.0 appeared this problem? (so, in FET-6.11.1 this problem did not appear?)
- Could you please tell me what operating system do you use?
- Do you use FET precompiled by me or do you compile? What Qt, for FET-6.12.0 and FET-6.11.1?
The part of saving the data is in src/engine/rules.cpp, line 16557, and in src/interface/fetmainform.cpp, line 4975 (and in other places, search "fileSave").
I wonder why there are in fact 2 of that strange directories.
Should be normally only one directory called "fet-results".
Did you replace that name by Cyrillic script? (And please answer Livius questions. They are more important.)
1. I downloaded the archives from https://github.com/lalesculiviu/fet and will check both versions. But the compilation takes about 1 hours. I remember that the problem arose when it became possible to record the history.
2. uname -a
Linux mentor 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
3. Compiling myself:
qmake fet.pro ; make
Sometimes I use Qt Creator.
qmake -v
QMake version 3.1
Using Qt version 5.15.8 in /usr/lib/x86_64-linux-gnu
qtcreator -version
Qt Creator 9.0.2 based on Qt 6.4.2
...
Quote from: Volker Dirr on March 03, 2024, 01:31:25 PMI wonder why there are in fact 2 of that strange directories.
Should be normally only one directory called "fet-results".
Did you replace that name by Cyrillic script? (And please answer Livius questions. They are more important.)
In my settings, the path is: /home/alex/Школа/Расписание and this path is re-created, but in a different encoding.I checked this same path.
I am sorry that you lose so much time compiling!
But do you know that if you have multi-threaded processor you can do "make -j 16" (I have 8 cores 16 threads processor)? It will be much faster. If you have 4 threads, do "make -j 4".
If you want, I have the old precompiled FET for GNU/Linux. I can put on my server for you. But I precompiled with Qt 6.
I highly recommend you to use Qt 6.
I know about multi-thread compilation, by the way, from you. I use make -j4 on this computer. And now I install Qt 6.
OK, good!
Hmm... on the other hand, I wonder about the bug... it shouldn't have appeared. I use Qt QString, which is UTF-8 or UTF-16, I am not sure.
I will try now to replicate this bug on my computer. I have Qt 6.6.2, but I also have Qt 5.15.2, on GNU/Linux. I will copy/paste your directory name.
Compilation on my computer takes 9 minutes with Qt 6 and less with Qt 5.
Dear Alex,
It is an issue, indeed. Seems like Qt 5.15.2 sets the directory "bad" and Qt 6.6.2 sets the directory "good". See the attached small files.
I will try to investigate a bit. Please don't waste your time compiling, I have found the issue. Thank you for the bug report!
Luckily, the issue is easy to fix, exactly as you said in your first post, reset the directory.
I think you used FET with Qt 6 and then FET with Qt 5.
There are some changes also in Qt 6.4 of the QSettings class (compared with Qt <6.4, like Qt 6.3 or Qt 5.15).
I updated Qt 5.15.2 "correct" way of storing the directory (a new file was added in my previous post).
Hmm... I don't know how I can solve this small problem. Luckily it is small.
Thanks for your prompt reply. But there was no such problem with the encoding before, even when compiling with a Qt 5 version and older. I've been using FET for a long time and compiling it myself. I will try to carefully localize when it appeared.
You used FET only with Qt 5 until day X. You used then FET with Qt 6. Then again with Qt 5.
Please see attached screenshot of Qt doc.
I found a possible fix, but I don't like it. I attach the file. You can see the fixes if you search the text setIniCodec (it appears in 2 places: line 390 and 598, adding stuff like 'newSettings.setIniCodec("UTF-8")'). Unfortunately, in line 598, when writing the settings, I don't know why I need not to apply the fix (I commented this line in the file attached below). Note that this fix is only for Qt 5 (easy to correct for Qt 6 with an #if).
With the fix in line 390, it works, but after saving the settings the file still looks ugly, they still have the \x... stuff.
I don't like this fix, because it is not symmetrical and the saved configuration file is not looking correctly.
I think I will add this in the TODO. I am not sure I will search some more for a fix.
The bug only appears if you use an INI-style file for the settings (macOS or GNU/Linux, not Windows), and use FET with Qt 5 after using FET with Qt 6 (not viceversa).
hmm... I think/hope that bug won't happen many times. Qt 5 will be end of life next year.
How about adding an execuatble that do nothing else than clearing the settings (of course it should ask first).
It might help in rare cases or if someone want to uninstall.
Yes, you're right. This is a problem when using the same config file for different FET (Qt) versions.
When I deleted the .config/fet/fettimetabling.conf file, any versions work fine and created default directories in fet-results
@Volker Dirr , 'Settings > Restore default settings' clears almost everything, but when you exit FET properly it will write a few default settings there.
Would you like to add your suggestion in the TODO?
Yes. Maybe.
How to call that exetuable "uninstall".
Then it just tells you that you need to delete the working directory, the fet directory (but it shouldn't delete it. The human should do it, also because it can't remove itself) and it should ask if the settings should be cleared.
hmm... In fact this is only true for windows. hmm...
Can do the same with configuration files as with a history file. If the version is out of date or format change, create a new file?
It is unnecessary in my opinion. It is comparable with loading a fet file with newer FET and saving it - the old FET might not always open it correctly.
The main options are there, only some characters are maybe wrong, but easily correctable.
But I will add your suggestion in the TODO.
By the way,
@Alex Chernous , do you like the additions since FET-6.11.0? Including adding constraints for all the teachers with one click, the history (in FET and on the disk), the fet file auto save option, multiple selection in activities / all time/space constraints dialogs, not available times time horizontal, max room/building changes per day in hourly interval, and students/teachers max hours daily in hourly interval? Do you use any of these?
Of course, the additions made the work more efficient.
- History and autosave. They are very useful when you return to work after some time and no longer remember what exactly changed. For me, this is very useful, since there are many constraints and they can change throughout the month. Autosave as an addition to history. I used to save different versions with different constraints. But now, that there is a story, I can store everything in one file.
- Multiple selection. For me, it is useful - space constraints dialogs, not available times time horizontal for teachers and students, when I see the overall picture.
- Room/building changes per day were useful last year when there was a renovation at the school. An rooms was assigned to each students set, and the changes had to be limited. Usually I assign the rooms to a certain subject or teacher.
- Students/teachers max hours daily in hourly interval - has not yet used.
Thank you for your great work!
Thank you for the feed-back, and you are welcome! :)