Closed BeyondMagic closed 2 months ago
Where is this exactly located? DaKanji should place the data inside the user's documents folder not the home.
Currently, DaKanji uses xdg to get a path to the documents folder.
Currently it is located at ~/Dakanji
:
By documents folder
you mean XDG_DATA_HOME
? If so, it's not following that. Could you specify which one of the specification, please?
Currently, DaKanji uses the path_provider plugin which in turn uses the xdg_directories plugin. The line being called is this one.
return Future<String?>.value(xdg.getUserDirectory('DOCUMENTS')?.path);
I would assume that this is the documents folder inside the user's home directory. I may switch to the application's support directory, but I am not sure to what this will resolve on linux.
@override
Future<String?> getApplicationSupportPath() async {
final Directory directory =
Directory(path.join(xdg.dataHome.path, await _getId()));
if (directory.existsSync()) {
return directory.path;
}
Which should resolve to this
dataDirs - The list of preference-ordered base directories relative to which data files should be searched. (Corresponds to $XDG_DATA_DIRS).
Currently, I do not have a Linux machine available to test this. If you have time to test a build using this path I can make one and if everything is going well switch to that. I think a setting for this will be a bit problamatic.
I will try and build it, thank you.
No, worries I can build it in GitHub actions I just cannot run it. I am going to ping you here once it is done.
return Future<String?>.value(xdg.getUserDirectory('DOCUMENTS')?.path);
This is a very unfortunate line that does not follow XDG specification at all. The coder(s) seemed to want to make its own standard with it.
I believe it'd be better and easier to use:
dataHome
- The single base directory relative to which user-specific data files should be written. (Corresponds to$XDG_DATA_HOME
).
from the xdg_directories plugin you mentioned. But it is your call, I thank you nonetheless for building it and I'll test it when it is done.
To be honest, I am very inexperienced in developing specifically for Linux so I cannot say if this is a bad line. However, it's from the Flutter team so at least it's a credible team.
If I understand it correctly this will result in a path that is not usually accessed by the user ie.: not his/her home directory. I changed the according code and will create a beta release today. If you have some time I would also appreciate if you could test out the new features on Linux because as I mentioned before, I do not have a Linux setup currently.
No problems, I will test it, thank you.
Here you go. Let me know if this is the behavior you expect. The path where the files are stored should be printed when you run DaKanji from the command line. As this is a beta version of the upcoming 3.4 release, I would highly appreciate it if you could also test the new features.
Hey, just tested out the issue. It is resolved, thank you. I am going to try out the features, but I'm still figuring the application out -- although it's quite amazing what you've made, and for being full open source you get a special virtual hug :)
I'll close the issue when I test it all.
Thank you for the nice words and also thank you for using and testing DaKanji!
Are you using the portable, snap or flatpak? Where are those files located now?
I am using the portable version, the files are located at $XDG_DATA_HOME/com.DaAppLab.DaKanji
:
com.DaAppLab.DaKanji § ls **/*
+----+------------------------------------------+------+-----------+--------------+
| # | name | type | size | modified |
+----+------------------------------------------+------+-----------+--------------+
| 0 | DaKanji | dir | 4.0 KiB | 3 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 1 | DaKanji/assets | dir | 4.0 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 2 | DaKanji/assets/__MACOSX | dir | 4.0 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 3 | DaKanji/assets/__MACOSX/ipadic | dir | 4.0 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 4 | DaKanji/assets/dict | dir | 4.0 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 5 | DaKanji/assets/dict/dictionary.isar | file | 340.0 MiB | 18 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 6 | DaKanji/assets/dict/dictionary.isar.lock | file | 4.0 KiB | 3 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 7 | DaKanji/assets/dict/examples.isar | file | 308.3 MiB | 18 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 8 | DaKanji/assets/dict/examples.isar.lock | file | 4.0 KiB | 3 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 9 | DaKanji/assets/dict/krad.isar | file | 3.9 MiB | 18 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 10 | DaKanji/assets/dict/krad.isar.lock | file | 4.0 KiB | 3 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 11 | DaKanji/assets/dict/radk.isar | file | 2.6 MiB | 18 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 12 | DaKanji/assets/dict/radk.isar.lock | file | 4.0 KiB | 3 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 13 | DaKanji/assets/ipadic | dir | 4.0 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 14 | DaKanji/assets/ipadic/char.bin | file | 256.3 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 15 | DaKanji/assets/ipadic/dicrc | file | 693 B | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 16 | DaKanji/assets/ipadic/left-id.def | file | 54.6 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 17 | DaKanji/assets/ipadic/matrix.bin | file | 3.3 MiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 18 | DaKanji/assets/ipadic/mecabrc | file | 0 B | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 19 | DaKanji/assets/ipadic/pos-id.def | file | 1.4 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 20 | DaKanji/assets/ipadic/rewrite.def | file | 6.1 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 21 | DaKanji/assets/ipadic/right-id.def | file | 54.6 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 22 | DaKanji/assets/ipadic/sys.dic | file | 46.9 MiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 23 | DaKanji/assets/ipadic/unk.dic | file | 5.6 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 24 | DaKanji/searchhistory.sqlite | file | 12.0 KiB | 3 hours ago |
+----+------------------------------------------+------+-----------+--------------+
| 25 | DaKanji/wordlists.sqlite | file | 272.0 KiB | a day ago |
+----+------------------------------------------+------+-----------+--------------+
| 26 | shared_preferences.json | file | 2.9 KiB | a minute ago |
+----+------------------------------------------+------+-----------+--------------+
| # | name | type | size | modified |
+----+------------------------------------------+------+-----------+--------------
Sorry for only responding now, 18 hours ago I was studying Japanese for a test :|
I am going to need help though to test a few things, I'll join in Discord to ask a few questions about where these new features are located.
Thank you! This location seems way better than before
The images do not show up, I tested it out on my phone with the same Kanji to see if it was supposed to, and also looked at the settings to see if there was an option to enable it, but found none (maybe I am blind [maybe].)
Thank you so much! You are right, I totally forgot that the image search is only available on mobile (iOS, Android). This is due to a limitation in Flutter #3
Please, let us set the cache/configuration folder for Dakanji outside the user's home.
It looks out of place and there are better places for it to be, like or
~/.config/dakanji
, or~/.local/share/
.