forked from qt-creator/qt-creator
FilePath: Return QString copy from toString()
Returning a const reference is different from our usual coding style,
and can lead to crashes when assigning to a const reference, like
const QString &path = filePath.pathAppended("foo").toString();
Make it behave like our other API.
Change-Id: Iab1cf1a944be405227b135c12029f58869893911
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -78,7 +78,7 @@ public:
|
||||
static FilePath fromUtf8(const char *filepath, int filepathSize = -1);
|
||||
static FilePath fromVariant(const QVariant &variant);
|
||||
|
||||
const QString &toString() const;
|
||||
QString toString() const;
|
||||
QFileInfo toFileInfo() const;
|
||||
QVariant toVariant() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user