Commit 2113669f authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

don't use fromRawData() for the file name parts.

the sub-strings "escaped" from the evaluator through the accessor, so
things did go boom, after all.

Reviewed-by: thorbjorn
parent 239bd540
......@@ -61,11 +61,10 @@ ProFile::ProFile(const QString &fileName)
setBlockKind(ProBlock::ProFileKind);
m_fileName = fileName;
// If the full name does not outlive the parts, things will go boom ...
int nameOff = fileName.lastIndexOf(QLatin1Char('/'));
m_displayFileName = QString::fromRawData(fileName.constData() + nameOff + 1,
fileName.length() - nameOff - 1);
m_directoryName = QString::fromRawData(fileName.constData(), nameOff);
m_displayFileName = QString(fileName.constData() + nameOff + 1,
fileName.length() - nameOff - 1);
m_directoryName = QString(fileName.constData(), nameOff);
}
QT_END_NAMESPACE
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment