Skip to content

Commit

Permalink
[buteo-mtp] Generic user support to MTP configuration. Contributes to…
Browse files Browse the repository at this point in the history
… JB#47596
  • Loading branch information
Marko Kenttala committed Oct 25, 2019
1 parent e2e2aa1 commit 771eef5
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 771eef5

Please sign in to comment.