Utils: Avoid copy on FileName::toString()

Takes ~6% of project loading

Change-Id: Id277f6cc9d5666b9a383419959cfd37b936437f8
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-02-27 09:42:48 +02:00
committed by Orgad Shaneh
parent 25096de511
commit 736168497a
2 changed files with 3 additions and 3 deletions

View File

@@ -548,9 +548,9 @@ QFileInfo FileName::toFileInfo() const
}
/// \returns a QString for passing on to QString based APIs
QString FileName::toString() const
const QString &FileName::toString() const
{
return QString(*this);
return *this;
}
/// \returns a QString to display to the user

View File

@@ -71,7 +71,7 @@ public:
static FileName fromLatin1(const QByteArray &filename);
static FileName fromUserInput(const QString &filename);
static FileName fromUtf8(const char *filename, int filenameSize = -1);
QString toString() const;
const QString &toString() const;
QString toUserOutput() const;
QString fileName(int pathComponents = 0) const;
bool exists() const;