Fixes to pasting

This commit is contained in:
robotbrainify 2013-12-06 17:13:09 -05:00
parent 5ad95134dc
commit e2728317e7
2 changed files with 5 additions and 4 deletions

View File

@ -52,7 +52,7 @@ void PasteUpload::downloadFinished()
return; return;
} }
QString error; QString error;
if (parseResult(doc, &error)) if (!parseResult(doc, &error))
{ {
emitFailed(error); emitFailed(error);
return; return;
@ -61,7 +61,7 @@ void PasteUpload::downloadFinished()
// else the download failed // else the download failed
else else
{ {
emitFailed(QString("Network error: %s").arg(m_reply->errorString())); emitFailed(QString("Network error: %1").arg(m_reply->errorString()));
m_reply.reset(); m_reply.reset();
return; return;
} }
@ -78,7 +78,7 @@ bool PasteUpload::parseResult(QJsonDocument doc, QString *parseError)
return false; return false;
} }
QString pasteUrl = object.value("paste").toObject().value("link").toString(); QString pasteUrl = object.value("paste").toObject().value("link").toString();
m_messageBox = m_messageBox = CustomMessageBox::selectable(m_window, "Paste upload successful!",
CustomMessageBox::selectable(m_window, "Paste upload successful!", QString("Find your paste at %s").arg(pasteUrl)); QString("Find your paste at %1").arg(pasteUrl));
return true; return true;
} }

View File

@ -6,6 +6,7 @@
class PasteUpload : public Task class PasteUpload : public Task
{ {
Q_OBJECT
public: public:
PasteUpload(QWidget *window, QString text); PasteUpload(QWidget *window, QString text);
QMessageBox *messageBox() const QMessageBox *messageBox() const