Commit 6c921090 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

DiffEditor: Avoid "jump to file" for directories and nonexistent files



Submodule diff sample (sub is the submodule's root directory):

diff --git a/sub b/sub
index 6ae5025..4b26500 160000
--- a/sub
+++ b/sub
@@ -1 +1 @@
-Subproject commit 6ae5025c9a66767e90cd320f9661e7694f7ea8b5
+Subproject commit 4b2650066d4143e8b7a9f4b19e46b96996a1dd90

Change-Id: I388de5bc50ceb1fcfc31a3a70ce8328c83fafa71
Reviewed-by: default avatarJarek Kobus <jaroslaw.kobus@digia.com>
parent ed8677b3
......@@ -1236,7 +1236,9 @@ void SideBySideDiffEditorWidget::jumpToOriginalFile(const QString &fileName,
const QDir dir(m_controller->workingDirectory());
const QString absoluteFileName = dir.absoluteFilePath(fileName);
Core::EditorManager::openEditorAt(absoluteFileName, lineNumber, columnNumber);
QFileInfo fi(absoluteFileName);
if (fi.exists() && !fi.isDir())
Core::EditorManager::openEditorAt(absoluteFileName, lineNumber, columnNumber);
}
void SideBySideDiffEditorWidget::slotLeftContextMenuRequested(QMenu *menu,
......
......@@ -758,7 +758,9 @@ void UnifiedDiffEditorWidget::jumpToOriginalFile(const QString &fileName,
const QDir dir(m_controller->workingDirectory());
const QString absoluteFileName = dir.absoluteFilePath(fileName);
Core::EditorManager::openEditorAt(absoluteFileName, lineNumber, columnNumber);
QFileInfo fi(absoluteFileName);
if (fi.exists() && !fi.isDir())
Core::EditorManager::openEditorAt(absoluteFileName, lineNumber, columnNumber);
}
void UnifiedDiffEditorWidget::setCurrentDiffFileIndex(int diffFileIndex)
......
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