Skip to content

Commit 49d57dd

Browse files
committedMay 12, 2022
Fixed Qt6 porting issues
1 parent c073e2b commit 49d57dd

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed
 

‎src/editor/codeeditor/markdowneditor.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ void MarkdownEditor::updatePreview()
4646
launchRender();
4747
}
4848

49-
QByteArray MarkdownEditor::renderProcess(const QByteArray &textIn)
49+
QByteArray renderProcess(const QByteArray &textIn)
5050
{
5151
maddy::QMaddy markdownParser;
5252
markdownParser.setCss("https://sindresorhus.com/github-markdown-css/github-markdown.css");
53-
const QByteArray &dataOut = markdownParser.toHtml(textIn);
53+
QByteArray dataOut = markdownParser.toHtml(textIn);
5454
return dataOut;
5555
}
5656

5757
void MarkdownEditor::launchRender()
5858
{
5959
QByteArray textIn = _editorWidget->textDocument()->text().toLocal8Bit();
60-
QFuture<QByteArray> future = QtConcurrent::run([&]() {return this->renderProcess(textIn);});
60+
QFuture<QByteArray> future = QtConcurrent::run(renderProcess, textIn);
6161
watcher.setFuture(future);
6262
}
6363

‎src/editor/codeeditor/markdowneditor.h

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ protected slots:
3737

3838
protected:
3939
QFutureWatcher<QByteArray> watcher;
40-
QByteArray renderProcess(const QByteArray &textIn);
4140
};
4241

4342
#endif // MARKDOWNEDITOR_H

‎src/project/projectitem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void ProjectItem::updateModif()
278278
oldFiles.subtract(files);
279279
for (const QString &removedFile : oldFiles)
280280
{
281-
QHash<QString, ProjectItem *>::const_iterator i = _childrensMap.find(removedFile);
281+
QHash<QString, ProjectItem *>::const_iterator i = _childrensMap.constFind(removedFile);
282282
if (i != _childrensMap.cend())
283283
{
284284
removeChild(*i);

0 commit comments

Comments
 (0)
Please sign in to comment.