optimize filePrefixRoot()
more efficient use of string functions. Change-Id: I3d95d6379eaab025b18449b706f93631a2132aad Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
parent
eb9db750e9
commit
2b31356ac9
@ -1190,11 +1190,13 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
|
||||
QString
|
||||
MakefileGenerator::filePrefixRoot(const QString &root, const QString &path)
|
||||
{
|
||||
QString ret(root + path);
|
||||
QString ret(path);
|
||||
if(path.length() > 2 && path[1] == ':') //c:\foo
|
||||
ret = QString(path.mid(0, 2) + root + path.mid(2));
|
||||
while(ret.endsWith("\\"))
|
||||
ret = ret.left(ret.length()-1);
|
||||
ret.insert(2, root);
|
||||
else
|
||||
ret.prepend(root);
|
||||
while (ret.endsWith('\\'))
|
||||
ret.chop(1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user