Skip to content

Commit

Permalink
[buteo-mtp] Add %h to export home directory. Contributes to JB#51442
Browse files Browse the repository at this point in the history
This adds %h that expands to user's home directory allowing
configuration to refer directly to user's home instead of using /home/%u
which can be incorrect.

Signed-off-by: Tomi Leppänen <tomi.leppanen@jolla.com>
  • Loading branch information
Tomin1 committed Oct 28, 2020
1 parent 61c4067 commit 43c7eb6
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -136,6 +136,10 @@ QList<StoragePlugin *>FSStoragePluginFactory::create(quint32 storageId)
if (pattern.contains("%u")) {
pattern.replace("%u", QProcessEnvironment::systemEnvironment().value("USER"));
}
// If path contains "%h" replace it with the current home directory
if (pattern.contains("%h")) {
pattern.replace("%h", QProcessEnvironment::systemEnvironment().value("HOME"));
}
QString description;
if (!pattern.contains('*') && !pattern.contains('?')) {
description = storage.attribute("description");
Expand Down

0 comments on commit 43c7eb6

Please sign in to comment.