Commit 1041c55c authored by Laurent Montel's avatar Laurent Montel 😁

Use lamdba

parent 5ad6fced
......@@ -894,15 +894,11 @@ void ComposerEditorWebEnginePrivate::_k_slotReplace()
//TODO
}
struct SetPlainTextFunctor {
QString fn;
explicit SetPlainTextFunctor(const QString &filename)
: fn(filename)
{
}
void operator()(const QString &result)
{
QFile file(fn);
void ComposerEditorWebEnginePrivate::saveHtml(QWebEnginePage *page, const QString &fileName)
{
if (page) {
page->toHtml([fileName](const QString &result) {
QFile file(fileName);
bool success = file.open(QIODevice::WriteOnly);
if (success) {
// FIXME: here we always use UTF-8 encoding
......@@ -910,12 +906,7 @@ struct SetPlainTextFunctor {
const qint64 c = file.write(data);
}
}
};
void ComposerEditorWebEnginePrivate::saveHtml(QWebEnginePage *page, const QString &fileName)
{
if (page) {
page->toHtml(SetPlainTextFunctor(fileName));
);
}
}
......
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