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

Let Qt determine the paths #1611

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

proletarius101
Copy link
Contributor

Hardcoding the path (i.e. a generic path + a hardcoded dir name) is redundant and prone to triggering errors. And it creates error inside a Flatpak.

Hardcoding the path (i.e. a generic path + a hardcoded dir name) is redundant and prone to triggering errors. And it creates error inside a Flatpak.
@@ -2396,11 +2400,7 @@ QString getCacheDir() throw()
{
return isPortableVersion() ? portableHomeDirPath() + "/cache"
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
#ifdef HAVE_X11
: QStandardPaths::writableLocation( QStandardPaths::GenericCacheLocation ) + "/goldendict";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the directory name become GoldenDict (camel case) with this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They become all lowercase due to the setting of the application, because you define the application name so:

TARGET = goldendict
. This approach is actually more standard.

Do you want me to change the application name to Carmel Case, or add a backward compatible handling?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you define the application name

No, the application name is defined here:

app.setApplicationName( "GoldenDict" );

The TARGET is the executable name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a consensus in comments to #1411 to use the lower-case directory name. Though I had slightly preferred the Qt-default camel-case myself. Because of backward compatibility concerns, changing to camel-case now should be done only in case of very strong consensus, which is highly unlikely. Find an approach that fixes the Flatpak issue without affecting the application behavior.

@vedgy
Copy link
Member

vedgy commented May 12, 2023

@proletarius101, what is the exact issue for Flatpak that this PR aims to solve? Are QStandardPaths::AppDataLocation and QStandardPaths::CacheLocation different inside the Flatpak? Not as specified in the Qt documentation? Could GoldenDict detect being a Flatpak and conditionally change the paths?

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

Successfully merging this pull request may close these issues.

None yet

3 participants