Commit 32b45799 authored by dt_'s avatar dt_ Committed by Daniel Teske

Fix "Show in shell/terminal" to use the correct directory

Change-Id: I6a33e3f47e6b4ca5256f4cababd4f452be298676
Task-Nr: QTCREATORBUG-4851
Reviewed-on: http://codereview.qt.nokia.com/121Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 5809bc07
......@@ -2235,7 +2235,7 @@ void ProjectExplorerPlugin::updateContextMenuActions()
}
}
QString ProjectExplorerPlugin::directoryFor(Node *node)
QString pathOrDirectoryFor(Node *node, bool dir)
{
QString path = node->path();
QString location;
......@@ -2252,11 +2252,22 @@ QString ProjectExplorerPlugin::directoryFor(Node *node)
location = Utils::commonPath(list);
} else {
QFileInfo fi(path);
location = (fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath());
location = (fi.isDir() && dir) ? fi.absoluteFilePath() : fi.absolutePath();
}
return location;
}
QString ProjectExplorerPlugin::pathFor(Node *node)
{
return pathOrDirectoryFor(node, false);
}
QString ProjectExplorerPlugin::directoryFor(Node *node)
{
return pathOrDirectoryFor(node, true);
}
void ProjectExplorerPlugin::addNewFile()
{
QTC_ASSERT(d->m_currentNode, return)
......@@ -2371,13 +2382,13 @@ void ProjectExplorerPlugin::showInGraphicalShell()
{
QTC_ASSERT(d->m_currentNode, return)
FolderNavigationWidget::showInGraphicalShell(Core::ICore::instance()->mainWindow(),
directoryFor(d->m_currentNode));
pathFor(d->m_currentNode));
}
void ProjectExplorerPlugin::openTerminalHere()
{
QTC_ASSERT(d->m_currentNode, return)
FolderNavigationWidget::openTerminal(directoryFor(d->m_currentNode));
FolderNavigationWidget::openTerminal(pathFor(d->m_currentNode));
}
void ProjectExplorerPlugin::removeFile()
......
......@@ -249,6 +249,7 @@ private slots:
private:
QString directoryFor(Node *node);
QString pathFor(Node *node);
void deploy(QList<Project *>);
int queue(QList<Project *>, QStringList stepIds);
void updateContextMenuActions();
......
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