Commit fb8f96f2 authored by Méven Car's avatar Méven Car
Browse files

Project git tree : Fix single file click and context menus action

parent 08981495
......@@ -648,7 +648,7 @@ void GitWidget::handleClick(const QModelIndex &idx, ClickAction clickAction)
return;
}
const QString file = m_gitPath + idx.data(GitStatusModel::FileNameRole).toString();
const QString file = idx.data(GitStatusModel::FileNameRole).toString();
bool staged = idx.internalId() == GitStatusModel::NodeStage;
if (clickAction == ClickAction::StageUnstage) {
......@@ -663,7 +663,7 @@ void GitWidget::handleClick(const QModelIndex &idx, ClickAction clickAction)
}
if (clickAction == ClickAction::OpenFile) {
m_mainWin->openUrl(QUrl::fromLocalFile(file));
m_mainWin->openUrl(QUrl::fromLocalFile(m_gitPath + file));
}
}
......@@ -978,7 +978,7 @@ void GitWidget::treeViewContextMenuEvent(QContextMenuEvent *e)
return;
}
const QString file = m_gitPath + idx.data(GitStatusModel::FileNameRole).toString();
const QString file = idx.data(GitStatusModel::FileNameRole).toString();
if (act == stageAct) {
if (staged) {
return unstage({file});
......@@ -1001,7 +1001,7 @@ void GitWidget::treeViewContextMenuEvent(QContextMenuEvent *e)
} else if (act == launchDifftoolAct) {
launchExternalDiffTool(idx.data(GitStatusModel::FileNameRole).toString(), staged);
} else if (act == openFile) {
m_mainWin->openUrl(QUrl::fromLocalFile(file));
m_mainWin->openUrl(QUrl::fromLocalFile(m_gitPath + QLatin1Char('/') + file));
}
} else if (type == GitStatusModel::NodeStage) {
QMenu menu;
......
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