forked from qt-creator/qt-creator
VcsBasePlugin: Use FilePath::relativePath
Instead of QDir::relativeFilePath(). Change-Id: Iacd25e51dc87b987402ff3677f6705c6e0e8edbf Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -372,8 +372,7 @@ FilePath VcsBasePluginState::currentFileDirectory() const
|
||||
QString VcsBasePluginState::relativeCurrentFile() const
|
||||
{
|
||||
QTC_ASSERT(hasFile(), return {});
|
||||
return QDir(data->m_state.currentFileTopLevel.toString()).relativeFilePath(
|
||||
data->m_state.currentFile.toString());
|
||||
return data->m_state.currentFile.relativePath(data->m_state.currentFileTopLevel).toString();
|
||||
}
|
||||
|
||||
QString VcsBasePluginState::currentPatchFile() const
|
||||
@@ -406,8 +405,7 @@ QString VcsBasePluginState::relativeCurrentProject() const
|
||||
QTC_ASSERT(hasProject(), return QString());
|
||||
if (data->m_state.currentProjectTopLevel == data->m_state.currentProjectPath)
|
||||
return {};
|
||||
return QDir(data->m_state.currentProjectTopLevel.toString()).relativeFilePath(
|
||||
data->m_state.currentProjectPath.toString());
|
||||
return data->m_state.currentProjectPath.relativePath(data->m_state.currentProjectTopLevel).toString();
|
||||
}
|
||||
|
||||
bool VcsBasePluginState::hasTopLevel() const
|
||||
|
Reference in New Issue
Block a user