mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3512 System : Remove unused functions
This commit is contained in:
@@ -96,39 +96,6 @@ QString RiaFilePathTools::canonicalPath(const QString& path)
|
||||
return QDir(path).absolutePath();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaFilePathTools::commonRootPath(const QStringList& paths)
|
||||
{
|
||||
if (paths.size() < 2) return "";
|
||||
|
||||
int i = 0;
|
||||
int iDir = 0;
|
||||
for(i = 0; ; i++)
|
||||
{
|
||||
bool isCommon = true;
|
||||
QChar ch = i < paths.front().size() ? paths.front()[i] : 0;
|
||||
|
||||
// Remember last directory separator
|
||||
if (i > 0 && (ch == '/' || ch == '\\')) iDir = i;
|
||||
|
||||
// Compare characters at position i
|
||||
for (const QString& path : paths)
|
||||
{
|
||||
if (ch == 0 || path[i] != ch)
|
||||
{
|
||||
isCommon = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isCommon) break;
|
||||
}
|
||||
|
||||
return paths.front().left(iDir + 1);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user