Commit 4d488345 authored by Knut Petter Svendsen's avatar Knut Petter Svendsen Committed by Eike Ziller
Browse files

ClearCase: Fixed soft assert when currentState has no file



The first time updateStatusActions was executed the currentState
had no file, then currentState().relativeCurrentFile() would
give an soft assert.

Change-Id: I4566ace3e538c9834a4a47857f4234a527c37641
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 5db9e59e
......@@ -607,13 +607,15 @@ ClearCaseSubmitEditor *ClearCasePlugin::openClearCaseSubmitEditor(const QString
void ClearCasePlugin::updateStatusActions()
{
FileStatus fileStatus = FileStatus::Unknown;
bool hasFile = currentState().hasFile();
QString fileName = currentState().relativeCurrentFile();
if (hasFile) {
QString fileName = currentState().relativeCurrentFile();
fileStatus = m_statusMap->value(fileName, FileStatus(FileStatus::Unknown));
FileStatus fileStatus = m_statusMap->value(fileName, FileStatus(FileStatus::Unknown));
if (ClearCase::Constants::debug)
qDebug() << Q_FUNC_INFO << fileName << ", status = " << fileStatus.status;
if (ClearCase::Constants::debug)
qDebug() << Q_FUNC_INFO << fileName << ", status = " << fileStatus.status;
}
m_checkOutAction->setEnabled(hasFile && (fileStatus.status & (FileStatus::CheckedIn | FileStatus::Hijacked)));
m_undoCheckOutAction->setEnabled(hasFile && (fileStatus.status & FileStatus::CheckedOut));
......
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