VCS: Disable file actions for directories

Directory is used as current file in case a VCS editor is open

Change-Id: Ibf4e8a1f69cb1b618af84461ecebcc65f933e2ed
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
This commit is contained in:
Orgad Shaneh
2013-09-22 11:28:33 +03:00
committed by Orgad Shaneh
parent af2e5adb62
commit 25b9124411

View File

@@ -274,14 +274,18 @@ void StateListener::slotStateChanged()
if (!state.currentFile.isEmpty()) {
if (currentFileInfo.isNull())
currentFileInfo.reset(new QFileInfo(state.currentFile));
state.currentFileDirectory =
currentFileInfo->isDir() ? currentFileInfo->absoluteFilePath() :
currentFileInfo->absolutePath();
state.currentFileName = currentFileInfo->fileName();
fileControl = Core::VcsManager::findVersionControlForDirectory(state.currentFileDirectory,
&state.currentFileTopLevel);
if (!fileControl)
state.clearFile();
if (currentFileInfo->isDir()) {
state.currentFile.clear();
state.currentFileDirectory = currentFileInfo->absoluteFilePath();
} else {
state.currentFileDirectory = currentFileInfo->absolutePath();
state.currentFileName = currentFileInfo->fileName();
fileControl = Core::VcsManager::findVersionControlForDirectory(
state.currentFileDirectory,
&state.currentFileTopLevel);
if (!fileControl)
state.clearFile();
}
}
// Check for project, find the control
Core::IVersionControl *projectControl = 0;