Skip to content

Commit

Permalink
Merge branch 'jb47596' into 'master'
Browse files Browse the repository at this point in the history
[buteo-mtp] Generic user support to MTP configuration. Contributes to JB#47596

See merge request mer-core/buteo-mtp!30
  • Loading branch information
kende committed Nov 1, 2019
2 parents e2e2aa1 + 771eef5 commit 87b68a4
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -36,6 +36,7 @@

#include <QDirIterator>
#include <QDomDocument>
#include <QProcessEnvironment>
#include <sys/types.h>
#include <sys/stat.h>
#include <mntent.h>
Expand Down Expand Up @@ -131,6 +132,10 @@ QList<StoragePlugin *>FSStoragePluginFactory::create(quint32 storageId)
* contains wildcard characters, use basenames of matching
* directories as substitute for 'description' attribute. */
QString pattern = storage.attribute("path");
// If path contains "%u" replace it with the current user name
if (pattern.contains("%u")) {
pattern.replace("%u", QProcessEnvironment::systemEnvironment().value("USER"));
}
QString description;
if (!pattern.contains('*') && !pattern.contains('?')) {
description = storage.attribute("description");
Expand Down

0 comments on commit 87b68a4

Please sign in to comment.