Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load dictionaries from anywhere #153

Open
JohannesKauffmann opened this issue Dec 8, 2023 · 9 comments
Open

Unable to load dictionaries from anywhere #153

JohannesKauffmann opened this issue Dec 8, 2023 · 9 comments

Comments

@JohannesKauffmann
Copy link

Using Ubuntu 23.10, and Qt Creator 11.0.0 from the online installer (not from the distro). Thus, the plugin is version 3.4.0.

I've installed the hunspell-en-us package, but am unable to load the dictionary (en_US.dic) either from /usr/share/hunspell or from my home directory. Selecting the dictionary file from the GUI works fine, but after Apply, Ok and a restart, the path to the dictionary is cleared, and spell checking clearly doesn't work (flags everything as spelled wrong).

The plugin is installed via "Install Plugin", selecting the tar.gz and choosing for a local installation.

When opening and closing Qt Creator, these 5 warnings are always printed:

QVariant::save: unable to save type 'Utils::FilePath' (type id: 65559).

QVariant::save: unable to save type 'Utils::FilePath' (type id: 65559).

QVariant::save: unable to save type 'Utils::FilePath' (type id: 65559).

QVariant::save: unable to save type 'Utils::FilePath' (type id: 65559).

QVariant::save: unable to save type 'Utils::FilePath' (type id: 65559)

Now I'm not sure if these errors are related, but Tools->Debug Qt Creator->Show Logs didn't give me more info.

Happy to provide more details if needed.

@tdyjv
Copy link

tdyjv commented Jan 24, 2024

I can verify this issue with QtCreator v12.0.1 under Ubuntu 22.04. The plugin version installed is 3.5.0 and I also have hunspell-en-us insalled. When I select /usr/share/hunspell/en_US.dic and click Apply and/or OK, close the configuration and reopen, the dictionary file settings have disappeared.
My plugin is installed in $HOME/Qt/Tools/QtCreator/lib/qtcreator/plugins/libSpellChecker.so per the instructions.

These are the messages I get when starting QtCreator from the command line :

$ Qt/Tools/QtCreator/bin/qtcreator.sh 
loadUserAddedWords: User dictionary name empty
Accessing MimeDatabase for text/x-c++src before plugins are initialized
Accessing MimeDatabase for text/x-csrc before plugins are initialized
Accessing MimeDatabase for text/x-c++hdr before plugins are initialized

I tried copying the dictionary files to a local directory which would be writable and that did not help.

Happy to help with debugging if needed.

@CJCombrink
Copy link
Owner

Thanks for reporting
Sorry for the delay, I will see if I can look into this asap.

@tdyjv
Copy link

tdyjv commented Mar 12, 2024

Any movement on this ? Can I assist in some way ?

@CJCombrink
Copy link
Owner

@tdyjv Sorry I never responded on this.

I did install Ubuntu (not sure what version) in a VM and could not reproduce.
I did test with /usr/share/hunspell/en_US.dic as well as dictionaries downloaded to ~/Dictionaries/ and the behaviour was consistent and correct.
Have you tried manually downloading the dictionary and aff file from the link provided in the readme? Also ensure that the 'plain' option is downloaded. When opened it should not look like an html file, but plain text

@JohannesKauffmann
Copy link
Author

I did install Ubuntu (not sure what version) in a VM and could not reproduce.

Ubuntu's version can be queried using lsb_release -a.

What version of Qt Creator + plugin did you test with?

@tdyjv
Copy link

tdyjv commented Mar 13, 2024

Yesterday I was able to get it working. Tried a few things not sure which really helped. I will do more testing today and report back.

@tdyjv
Copy link

tdyjv commented Mar 13, 2024

Ok here we go :
I have two systems - Desktop and Laptop

The Laptop dictionary selection works out of the box without any failures.

The Desktop behaves as follows :

If I select a new dictionary location, either local to my home directory or /usr/share/hunspell it fails to save the new dictionary location.

If I select a new dictionary location, either local to my home directory or /usr/share/hunspell AND change another spellchecker configuration item, for example Uncheck "Only check current editor" it works. I have tested with other configuration items and any changes at the same time as the change in dictionary selection will save the dictionary selection. If I do not change another configuration item it fails every time.

I hope this helps - At least it's a work around

@CJCombrink
Copy link
Owner

@JohannesKauffmann

> lsb_release -a.
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.4 LTS
Release:	22.04
Codename:	jammy

Qt Creator Version

Qt Creator 12.0.2
Based on Qt 6.6.0 (GCC 10.3.1 20210422 (Red Hat 10.3.1-1), x86_64)
Built on Feb 6 2024 10:09:23

@tdyjv Thank you very much for the investigation. I have a Laptop and tested in a Virtual Box with the above ubuntu.
I don't have access to a bare metal Ubuntu machine.

I will look a bit at the code, especially now with Qt Creator 13 coming to see if there is not something that can be done from the source side that might help. I have a suspicion what could cause something like this.

@tdyjv
Copy link

tdyjv commented May 22, 2024

Just to follow up. This seems to work correctly in QtCreator V13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants