Anonymous | Login | Signup for a new account | 2024-03-19 02:49 UTC |
My View | View Issues | Change Log | Roadmap | Doomseeker Issue Support Ranking | Rules | My Account |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0003262 | Doomseeker | [All Projects] Bug | public | 2017-09-12 03:33 | 2023-02-19 14:11 | ||||
Reporter | WubTheCaptain | ||||||||
Assigned To | Zalewa | ||||||||
Priority | low | Severity | tweak | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | x86_64 | OS | Debian GNU/Linux | OS Version | buster/sid | ||||
Product Version | 1.1 | ||||||||
Target Version | 1.4.0 | Fixed in Version | 1.4.0 | ||||||
Summary | 0003262: Allow $HOME and/or ~/ in file paths | ||||||||
Description | Doomseeker currently requires the file path to be absolute. ~/ and $HOME are not recognized as valid alternatives to /home/<username>, instead /home/<username> (e.g. /home/wub in my case) is written to each configuration. In example for IWAD paths, ~/ and $HOME fail with "Iwad Path error". This could possibly be extended to other user-configurable file paths, such as server executable path. | ||||||||
Steps To Reproduce |
| ||||||||
Additional Information | Changing the path of my home folder (as a consequence of renaming my username on the local system) means all my previous configurations with IWAD paths in the "Create Game" window and various IWAD/PWAD paths subsequently need fixing to the new location. If I recall correctly, at worst this means the "Create Game" window fails to list the additional WADs and they will be missing. The paths still exist in the .ini configuration and need to be manually edited to the new paths in a text editor. In reverse: If I keep my old home location, no change is required if the user wants to hard-type their old path. | ||||||||
Attached Files | dpkg.log [^] (3,173 bytes) 2017-09-12 03:37 | ||||||||
Relationships | |||||||||||
|
Notes | |
(0018287) WubTheCaptain (reporter) 2017-09-12 03:37 edited on: 2017-09-12 03:38 |
Tested with Qt5 5.9.1 for original suggestion. |
(0018355) WubTheCaptain (reporter) 2017-09-21 10:40 edited on: 2017-09-21 10:43 |
In addition to what's described in the steps to reproduce, here's some test case guidance for implementers (consider ~/ is /home/user1/):
QDir::homePath() may be useful. |
(0018398) WubTheCaptain (reporter) 2017-09-27 19:18 |
After some consideration, I think this is an upstream issue with QFileDialog in Qt which requires no change in Doomseeker. The change isn't as trivial as I initially thought it would be. It'd be nice to have in Qt for sure. Should we close this ticket? |
(0018399) WubTheCaptain (reporter) 2017-09-27 19:34 |
Nevermind. This issue was fixed in Qt 4.8 six years ago:'https://bugreports.qt.io/browse/QTBUG-20571 [^]' Seems like something about Doomseeker's use of QFileInfo is wrong, then. QFileInfo in Qt 5 definitely supports tilde. |
(0018400) Zalewa (developer) 2017-09-27 20:01 |
I'd still like to have a look around. Maybe I'll find out we're doing something non-standard with paths and it doesn't work everywhere. I'll also think if I want to support env vars resolution in paths. |
(0019489) Zalewa (developer) 2018-09-04 11:59 |
Progress update: I've started working on this and already have a path resolver method that implements some placeholders - it's basic but it should be enough. Documentation excerpt looks like this:
That was the easy part. The more difficult part stems partially from the fact that a thing like this needs to be done with full intent from the very first moment of development of the program. Right now, finding all places where the resolution needs to happen as we hit the filesystem and all other places where we need to keep the templated path may prove to be a challenge. This problem isn't only limited to defining the configuration defaults, because user will expect that the placeholders can be used anywhere where path can be input. This is something that can be overcomed, however we need to be careful. Another cause of problems is QStandardPaths. As much as it has proven to be helpful so far, it will now prove to be that much obstructive. Locations returned from it are absolute. Home dir is not represented as "~", but as an explicit path. To be even more general, Qt doesn't seem to have built-in support for "~" resolution, and anyway even if it had, we still desire to also use our own placehodlers for $PROGDIR and env. variables, which means we need custom resolver anyway. When we retrieve a path from QStandardPaths, do we need to check if it begins from home dir and replace this part with '~'? Where in the code should this happen? In DataPaths? Do we need our own wrapper over QStandardPaths? Quote from "WubTheCaptain" Do you have any documentation on this? My tests indicate that this is not true. |
(0019490) Zalewa (developer) 2018-09-04 12:30 |
I've pushed the work done so far to a separate branch:'https://bitbucket.org/Doomseeker/doomseeker/commits/5d30d232dfaba9f8ce5bc07f6f79f65342a37a8e [^]' |
(0022476) Zalewa (developer) 2022-10-26 20:49 |
I decided to revisit this and hopefully complete it this time, as it still bothers me that the --portable mode isn't really portable when Windows assigns varying letter names to partitions depending on the computer you connect your portable USB drive to. For now there's a commit that fixes $PROGDIRSOMETHING resolution bug and also implements handling of the "~user" pattern on UNIX-like systems: 'https://bitbucket.org/Doomseeker/doomseeker/commits/a1f315326a70aefc491415c0fe0f4d8345e06fc0 [^]' plus some extra tests. |
(0022480) Zalewa (developer) 2022-11-06 22:06 |
The work continues... in the meanwhile: The templated path resolution with $VARIABLE is getting complicated when someone really has a directory with a $ in its name. I can imagine someone naming their games directory "D:/game$/". There would need to be some escaping mechanism for this, such as $$ will take the single $ literally. And the paths retrieved from QFileDialog boxes would need to be translated to the escaped format, which means I will have to go through each case of where this is happening and deciding individually if the path needs to be escaped. Moreover, if the user sees "D:/game$$/" in their configured path instead of the "D:/game$/", they will think that the program has bugged their path, try to correct it manually and likely complain on #support. This somewhat makes me think that the $VARIABLE resolution may not be the best idea. However, the overall work on this task can continue because the ~ resolution, while still affected by this problem, is less probable to get hit by it on accident. I'm also identifying places where "absolutePath()" is used whereas just "path()" would do just fine. |
(0022484) Zalewa (developer) 2022-11-09 21:42 |
Continuing my monologue: I thought that maybe it would be sufficient and safe enough for the people if the $VARIABLE resolution was only limited if $VARIABLE was the first token in the path. We can limit the resolver to only resolve paths like "$DOOMDIR/wads", but not "/home/user/$DOOMDIRNAME/wads"? |
(0022488) WubTheCaptain (reporter) 2022-11-11 14:52 |
All or nothing approach, imo. Fine with ~/ and ~user working as the first token in the path. $variable should be expandable anywhere, or the feature omitted if it cannot be implemented correctly at this time. |
(0022497) Zalewa (developer) 2022-11-12 10:42 |
Quote from WubTheCaptain I will have to consider how this will affect the 0003354, but yeah, not doing the $templates at all is an option on the table. |
(0022501) Zalewa (developer) 2022-11-27 14:30 edited on: 2022-11-27 14:33 |
I have pushed 4 more commits that should cover the remaining occurrences of where the paths should be resolved: 1, 2, 3, 4. This isn't tested. I need to run the program now and verify it in runtime, so commits with fixes may still follow. I also extracted the resolver to a separate Plugin API class and made it configurable a bit. The boolean switches can control if the ~, $PROGDIR, and $ENV_VAR should be resolved or not. For now this is all hardcoded to be enabled, but I'm strongly considering adding an user option to disable the $PROGDIR and $ENV_VAR resolution and have it disabled by default. This needs to be confronted with 0003354, which I will focus my attention at next. |
(0022502) Zalewa (developer) 2022-11-29 22:36 |
Option added to the "File Paths" config box:'https://bitbucket.org/Doomseeker/doomseeker/commits/8a219f6f7342128721ef611e5eb70714f578f0f4 [^]' Also added one more unit test for $PROGDIR in the middle of the path:'https://bitbucket.org/Doomseeker/doomseeker/commits/180cd07cd08276b15a70310603237ee5c21dd971 [^]' |
(0022521) Zalewa (developer) 2022-12-01 22:26 |
Missed one conversion in the WADs picker. Also it was necessary to add an explicit browse button to the file paths and the WADs picker, because "Add" needs to simply add an empty entry where the user can specify the path by hand. The browse box, which comes from the OS, and the templated paths don't mix well. |
(0022522) Zalewa (developer) 2022-12-01 22:27 |
The templated_paths branch is ready to be merged into master. |
(0022525) Zalewa (developer) 2022-12-12 22:18 |
Merged now:'https://bitbucket.org/Doomseeker/doomseeker/commits/55ed82145710397848538add0853df2b543e3182 [^]' |
(0022643) Zalewa (developer) 2023-01-05 12:13 |
Beta package for Windows available at the beta auto-update channel and at:'https://devbuilds.drdteam.org/doomseeker/doomseeker-1.3.3~beta-230105-1140_windows.zip [^]' Please test. Keep in mind that the $ENVVAR and $PROGDIR placeholder replacements first need to be enabled in the "File paths" config box. Also keep in mind that the Windows build deliberately doesn't support the '~user' resolution (but it does support plain '~'). |
This issue is already marked as resolved. If you feel that is not the case, please reopen it and explain why. |
|
Supporters: | Zalewa |
Opponents: | No one explicitly opposes this issue yet. |
Issue History | |||
Date Modified | Username | Field | Change |
2017-09-12 03:33 | WubTheCaptain | New Issue | |
2017-09-12 03:37 | WubTheCaptain | Note Added: 0018287 | |
2017-09-12 03:37 | WubTheCaptain | File Added: dpkg.log | |
2017-09-12 03:38 | WubTheCaptain | Note Edited: 0018287 | View Revisions |
2017-09-21 10:40 | WubTheCaptain | Note Added: 0018355 | |
2017-09-21 10:43 | WubTheCaptain | Note Edited: 0018355 | View Revisions |
2017-09-27 18:30 | Zalewa | Relationship added | child of 0003246 |
2017-09-27 19:18 | WubTheCaptain | Note Added: 0018398 | |
2017-09-27 19:34 | WubTheCaptain | Note Added: 0018399 | |
2017-09-27 20:01 | Zalewa | Note Added: 0018400 | |
2017-09-27 21:53 | WubTheCaptain | Relationship added | child of 0003279 |
2017-09-27 21:54 | WubTheCaptain | Relationship deleted | child of 0003246 |
2017-10-04 19:27 | WubTheCaptain | Category | Suggestion => Bug |
2017-10-05 02:44 | WubTheCaptain | Status | new => acknowledged |
2017-12-11 16:49 | Zalewa | Relationship added | related to 0003354 |
2018-08-27 03:44 | WubTheCaptain | Priority | high => normal |
2018-08-27 07:31 | Zalewa | Assigned To | => Zalewa |
2018-08-27 07:31 | Zalewa | Status | acknowledged => assigned |
2018-09-04 11:59 | Zalewa | Note Added: 0019489 | |
2018-09-04 12:30 | Zalewa | Note Added: 0019490 | |
2018-10-05 06:17 | WubTheCaptain | Priority | normal => low |
2018-10-05 06:17 | WubTheCaptain | Target Version | => 1.3 |
2019-06-22 10:17 | Zalewa | Target Version | 1.3 => |
2022-09-10 14:59 | Zalewa | Target Version | => 1.4.0 |
2022-10-26 20:49 | Zalewa | Note Added: 0022476 | |
2022-11-06 22:06 | Zalewa | Note Added: 0022480 | |
2022-11-09 21:42 | Zalewa | Note Added: 0022484 | |
2022-11-09 21:42 | Zalewa | Status | assigned => feedback |
2022-11-11 14:52 | WubTheCaptain | Note Added: 0022488 | |
2022-11-11 14:52 | WubTheCaptain | Status | feedback => assigned |
2022-11-12 10:42 | Zalewa | Note Added: 0022497 | |
2022-11-27 14:30 | Zalewa | Note Added: 0022501 | |
2022-11-27 14:30 | Zalewa | Status | assigned => needs review |
2022-11-27 14:33 | Zalewa | Note Edited: 0022501 | View Revisions |
2022-11-29 22:36 | Zalewa | Note Added: 0022502 | |
2022-12-01 22:26 | Zalewa | Note Added: 0022521 | |
2022-12-01 22:27 | Zalewa | Note Added: 0022522 | |
2022-12-12 22:18 | Zalewa | Note Added: 0022525 | |
2023-01-05 12:13 | Zalewa | Note Added: 0022643 | |
2023-01-05 12:13 | Zalewa | Status | needs review => needs testing |
2023-02-19 14:11 | Zalewa | Status | needs testing => resolved |
2023-02-19 14:11 | Zalewa | Fixed in Version | => 1.4.0 |
2023-02-19 14:11 | Zalewa | Resolution | open => fixed |
Copyright © 2000 - 2024 MantisBT Team |