From 91fe5f84d94ff52c311664d37c55bdee04497952 Mon Sep 17 00:00:00 2001 From: Knut Petter Svendsen Date: Tue, 2 Apr 2013 13:10:07 +0200 Subject: [PATCH] ClearCase: Fix: Status actions was not correct for unix A set view on unix will get / as topLevel. The output of "cleartool -ls" with / as topLevel listed files with absolute path, while with relative path for the the other cases (working directory view and on windows). Root as topLevel is not 100% correct and should be fixed in another patch. However, this patch fixes an annoying bug for unix. (Before this patch multiple entries for the same file was inserted in the status map - one with relative path and one with absolute. Resulting in wrong lookup in updateStatusActions and thus wrong status on the active file. Change-Id: I178bafd21d712a445aca8e60ae3346549b55faaf Reviewed-by: Orgad Shaneh --- src/plugins/clearcase/clearcasesync.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/clearcase/clearcasesync.cpp b/src/plugins/clearcase/clearcasesync.cpp index a65dfd6b72f..a9b97ea4735 100644 --- a/src/plugins/clearcase/clearcasesync.cpp +++ b/src/plugins/clearcase/clearcasesync.cpp @@ -114,21 +114,21 @@ void ClearCaseSync::run(QFutureInterface &future, const QString &topLevel, if (atatpos != -1) { // probably managed file // find first whitespace. anything before that is not interesting int wspos = buffer.indexOf(QRegExp(QLatin1String("\\s"))); - const QString file = QDir::fromNativeSeparators(buffer.left(atatpos)); + const QString relFile = topLevelDir.relativeFilePath(QDir::fromNativeSeparators(buffer.left(atatpos))); QString ccState; QRegExp reState(QLatin1String("^\\s*\\[[^\\]]*\\]")); // [hijacked]; [loaded but missing] if (reState.indexIn(buffer, wspos + 1, QRegExp::CaretAtOffset) != -1) { ccState = reState.cap(); if (ccState.indexOf(QLatin1String("hijacked")) != -1) - m_plugin->setStatus(file, FileStatus::Hijacked, true); + m_plugin->setStatus(relFile, FileStatus::Hijacked, true); else if (ccState.indexOf(QLatin1String("loaded but missing")) != -1) - m_plugin->setStatus(file, FileStatus::Missing, false); + m_plugin->setStatus(relFile, FileStatus::Missing, false); } else if (buffer.lastIndexOf(QLatin1String("CHECKEDOUT"), wspos) != -1) - m_plugin->setStatus(file, FileStatus::CheckedOut, true); + m_plugin->setStatus(relFile, FileStatus::CheckedOut, true); // don't care about checked-in files not listed in project - else if (m_statusMap->contains(file)) - m_plugin->setStatus(file, FileStatus::CheckedIn, true); + else if (m_statusMap->contains(relFile)) + m_plugin->setStatus(relFile, FileStatus::CheckedIn, true); } buffer.clear(); future.setProgressValue(qMin(total, ++processed));