Commit edd8dac2 authored by Eike Ziller's avatar Eike Ziller
Browse files

Make showInGraphicalShell select a file on Win + Mac again.

Change-Id: I25e93f9f51ba8589d308700e9478ca31efbcc9c1
Reviewed-on: http://codereview.qt.nokia.com/1869

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent a09851e4
...@@ -421,7 +421,7 @@ void FolderNavigationWidget::showInGraphicalShell(QWidget *parent, const QString ...@@ -421,7 +421,7 @@ void FolderNavigationWidget::showInGraphicalShell(QWidget *parent, const QString
#else #else
// we cannot select a file here, because no file browser really supports it... // we cannot select a file here, because no file browser really supports it...
const QFileInfo fileInfo(pathIn); const QFileInfo fileInfo(pathIn);
const QString folder = fileInfo.absoluteFilePath(); const QString folder = fileInfo.isDir() ? fileInfo.absoluteFilePath() : fileInfo.filePath();
const QString app = Utils::UnixUtils::fileBrowser(Core::ICore::instance()->settings()); const QString app = Utils::UnixUtils::fileBrowser(Core::ICore::instance()->settings());
QProcess browserProc; QProcess browserProc;
const QString browserArgs = Utils::UnixUtils::substituteFileBrowserParameters(app, folder); const QString browserArgs = Utils::UnixUtils::substituteFileBrowserParameters(app, folder);
......
...@@ -2354,7 +2354,11 @@ QString pathOrDirectoryFor(Node *node, bool dir) ...@@ -2354,7 +2354,11 @@ QString pathOrDirectoryFor(Node *node, bool dir)
location = Utils::commonPath(list); location = Utils::commonPath(list);
} else { } else {
QFileInfo fi(path); QFileInfo fi(path);
location = (fi.isDir() && dir) ? fi.absoluteFilePath() : fi.absolutePath(); if (dir) {
location = fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath();
} else {
location = fi.absoluteFilePath();
}
} }
return location; return location;
} }
...@@ -2489,7 +2493,7 @@ void ProjectExplorerPlugin::showInGraphicalShell() ...@@ -2489,7 +2493,7 @@ void ProjectExplorerPlugin::showInGraphicalShell()
void ProjectExplorerPlugin::openTerminalHere() void ProjectExplorerPlugin::openTerminalHere()
{ {
QTC_ASSERT(d->m_currentNode, return) QTC_ASSERT(d->m_currentNode, return)
FolderNavigationWidget::openTerminal(pathFor(d->m_currentNode)); FolderNavigationWidget::openTerminal(directoryFor(d->m_currentNode));
} }
void ProjectExplorerPlugin::removeFile() void ProjectExplorerPlugin::removeFile()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment