UICommon: Prevent unnecessary string copies in OpenContainingFolder

This commit is contained in:
Lioncash 2020-07-03 12:59:20 -04:00
parent cacbdd9fc8
commit 1ac105f859
1 changed files with 3 additions and 3 deletions

View File

@ -18,11 +18,11 @@ void OpenContainingFolder(QWidget* parent, const QString& pathIn)
const QFileInfo fileInfo(pathIn); const QFileInfo fileInfo(pathIn);
// Mac, Windows support folder or file. // Mac, Windows support folder or file.
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
QString paths = QProcessEnvironment::systemEnvironment().value(QStringLiteral("Path")); const QString paths = QProcessEnvironment::systemEnvironment().value(QStringLiteral("Path"));
QString explorer; QString explorer;
for (QString path : paths.split(QStringLiteral(";"))) for (const QString& path : paths.split(QLatin1Char(';')))
{ {
QFileInfo finfo(QDir(path), QStringLiteral("explorer.exe")); const QFileInfo finfo(QDir(path), QStringLiteral("explorer.exe"));
if (finfo.exists()) if (finfo.exists())
{ {
explorer = finfo.filePath(); explorer = finfo.filePath();