ClearCase: Handle read-only view private files

View private files have state NotManaged. In the corner case
where a NotManaged file is read-only they should be made
writeable by the ReadOnlyFilesDialog, and not vcsOpen()-ed.

Change-Id: Icfeab6bebb76cc01da693b3bfff7b46c45b106b4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Knut Petter Svendsen
2013-11-07 12:31:22 +01:00
parent 4c0d07a9aa
commit 16b4c2e032
8 changed files with 29 additions and 14 deletions

View File

@@ -389,7 +389,7 @@ void ReadOnlyFilesDialog::initDialog(const QStringList &fileNames)
IVersionControl *versionControlForFile =
VcsManager::findVersionControlForDirectory(directory);
const bool fileManagedByVCS = versionControlForFile
&& versionControlForFile->openSupportMode() != IVersionControl::NoOpen;
&& versionControlForFile->openSupportMode(fileName) != IVersionControl::NoOpen;
if (fileManagedByVCS) {
const QString vcsOpenTextForFile =
versionControlForFile->vcsOpenText().remove(QLatin1Char('&'));
@@ -407,7 +407,7 @@ void ReadOnlyFilesDialog::initDialog(const QStringList &fileNames)
vcsMakeWritableTextForAll.clear();
}
// Add make writable if it is supported by the reposetory.
if (versionControlForFile->openSupportMode() == IVersionControl::OpenOptional) {
if (versionControlForFile->openSupportMode(fileName) == IVersionControl::OpenOptional) {
useMakeWritable = true;
createRadioButtonForItem(item, radioButtonGroup, MakeWritable);
}