Support paste.gg, hastebin, and mclo.gs

This commit is contained in:
Lenny McLennington
2022-05-11 21:44:06 +01:00
parent 9a0d6124f3
commit 35f71f5793
7 changed files with 272 additions and 75 deletions

View File

@ -16,8 +16,9 @@
QString GuiUtil::uploadPaste(const QString &text, QWidget *parentWidget)
{
ProgressDialog dialog(parentWidget);
auto pasteUrlSetting = APPLICATION->settings()->get("PastebinURL").toString();
std::unique_ptr<PasteUpload> paste(new PasteUpload(parentWidget, text, pasteUrlSetting));
auto pasteTypeSetting = static_cast<PasteUpload::PasteType>(APPLICATION->settings()->get("PastebinType").toUInt());
auto pasteCustomAPIBaseSetting = APPLICATION->settings()->get("PastebinCustomAPIBase").toString();
std::unique_ptr<PasteUpload> paste(new PasteUpload(parentWidget, text, pasteCustomAPIBaseSetting, pasteTypeSetting));
dialog.execWithTask(paste.get());
if (!paste->wasSuccessful())