Commit 97a1f41c authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

I hate `auto`. This creates a QStringRref, not a QString, then crashes.

We can't pass a QStringRef to QUrl::fromLocalFile, this accepts
a const QString& and then QStringRef will decay to a QString()
but it's UB to hold a const ref to a temporary.
parent 5a4aaed3
Pipeline #109887 passed with stage
in 1 minute and 49 seconds
......@@ -205,7 +205,7 @@ QString Project::workingDir() const
KTextEditor::Document* Project::createCodeDocument(const QString& filePath)
{
auto path = d->m_workingDirectory.path() + QLatin1Char('/') + filePath + QStringLiteral(".js");
const QString path = d->m_workingDirectory.path() + QLatin1Char('/') + filePath + QStringLiteral(".js");
auto doc = KTextEditor::Editor::instance()->createDocument(nullptr);
if (!doc->saveAs(QUrl::fromLocalFile(path))) {
......
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