Apply suggestions from code review

Co-authored-by: Alexandru Ionut Tripon <alexandru.tripon97@gmail.com>
Signed-off-by: maskers <97827489+maskersss@users.noreply.github.com>
This commit is contained in:
maskers 2024-08-21 19:42:35 +03:00 committed by GitHub
parent cf914526bf
commit 99bd4a8937
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -115,17 +115,15 @@ std::optional<QString> GuiUtil::uploadPaste(const QString& name, const QString&
QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::No)
->exec();
if (truncateResponse == QMessageBox::Yes)
shouldTruncate = true;
shouldTruncate = truncateResponse == QMessageBox::Yes;
}
}
}
QString textToUpload;
if (shouldTruncate)
QString textToUpload = text;
if (shouldTruncate) {
textToUpload = truncateLogForMclogs(text);
else
textToUpload = text;
}
std::unique_ptr<PasteUpload> paste(new PasteUpload(parentWidget, textToUpload, pasteCustomAPIBaseSetting, pasteTypeSetting));