forked from qt-creator/qt-creator
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:
committed by
Orgad Shaneh
parent
af2e5adb62
commit
25b9124411
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user