QStandardPaths::ApplicationsLocation strange path
-
Hello!
I've discovered something I do not understand.
I have made a non GUI application. In my * .pro fileQT -= gui TARGET = veryStrange
The printout from the following code snippets
QStringList allAppDataLocations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); foreach(QString path, allAppDataLocations) { qInfo() << path; }
is
"/home/ingemar/.local/share/veryStrange" "/usr/share/ubuntu/veryStrange" "/usr/local/share/veryStrange" "/usr/share/veryStrange" "/var/lib/snapd/desktop/veryStrange"
Why "veryStrange"
At the end of the paths? (The value of "TARGET" in my * .pro file) ?
It is not a standard. -
@mrjj said in QStandardPaths::ApplicationsLocation strange path:
This is an application-specific directory.
Thanks for your quick answer!
Yes, I have read
"Returns the directory containing the user applications (either executables, application bundles, or shortcuts to them). This is a generic value. Note that installing applications may require additional, platform-specific operations. Files, folders or shortcuts in this directory are platform -specific. "I work in Linux. Make a program that looks for dead .desktop files. And removes them.
Can be solved with
path.truncate (path.lastIndexOf (QChar ( '/'))); path.append ("/ applications");
It just feels a little weird. But maybe it's something I do not understand.
@posktomten
I think what you need is notAppDataLocation
butApplicationsLocation
-
Hello!
I've discovered something I do not understand.
I have made a non GUI application. In my * .pro fileQT -= gui TARGET = veryStrange
The printout from the following code snippets
QStringList allAppDataLocations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); foreach(QString path, allAppDataLocations) { qInfo() << path; }
is
"/home/ingemar/.local/share/veryStrange" "/usr/share/ubuntu/veryStrange" "/usr/local/share/veryStrange" "/usr/share/veryStrange" "/var/lib/snapd/desktop/veryStrange"
Why "veryStrange"
At the end of the paths? (The value of "TARGET" in my * .pro file) ?
It is not a standard.@posktomten
Hi
Also does that on Windows so seems its intended,
The docs says
Returns a directory location where persistent application data can be stored. This is an application-specific directory.So that is maybe why TARGET is used.
-
@mrjj said in QStandardPaths::ApplicationsLocation strange path:
This is an application-specific directory.
Thanks for your quick answer!
Yes, I have read
"Returns the directory containing the user applications (either executables, application bundles, or shortcuts to them). This is a generic value. Note that installing applications may require additional, platform-specific operations. Files, folders or shortcuts in this directory are platform -specific. "I work in Linux. Make a program that looks for dead .desktop files. And removes them.
Can be solved with
path.truncate (path.lastIndexOf (QChar ( '/'))); path.append ("/ applications");
It just feels a little weird. But maybe it's something I do not understand.
-
@mrjj said in QStandardPaths::ApplicationsLocation strange path:
This is an application-specific directory.
Thanks for your quick answer!
Yes, I have read
"Returns the directory containing the user applications (either executables, application bundles, or shortcuts to them). This is a generic value. Note that installing applications may require additional, platform-specific operations. Files, folders or shortcuts in this directory are platform -specific. "I work in Linux. Make a program that looks for dead .desktop files. And removes them.
Can be solved with
path.truncate (path.lastIndexOf (QChar ( '/'))); path.append ("/ applications");
It just feels a little weird. But maybe it's something I do not understand.
@posktomten
I think what you need is notAppDataLocation
butApplicationsLocation
-
@posktomten
Hi
Also does that on Windows so seems its intended,
The docs says
Returns a directory location where persistent application data can be stored. This is an application-specific directory.So that is maybe why TARGET is used.
Aha!
Thank you very much and I apologize. You should always read the documentation carefully before asking!
Thank you everyone on this friendly forum!
Ingemar Ceicer