Commit 23d04f05 authored by Daniel Teske's avatar Daniel Teske
Browse files

CodePaster: Adjust to MessageManager api change



Change-Id: I24d70aa0ceac742f1ffd25458a97b947af4749c6
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent f4b19e0e
...@@ -205,7 +205,7 @@ void CodePasterProtocol::fetchFinished() ...@@ -205,7 +205,7 @@ void CodePasterProtocol::fetchFinished()
void CodePasterProtocol::listFinished() void CodePasterProtocol::listFinished()
{ {
if (m_listReply->error()) { if (m_listReply->error()) {
Core::ICore::messageManager()->printToOutputPane(m_listReply->errorString(), true); Core::ICore::messageManager()->printToOutputPane(m_listReply->errorString(), Core::MessageManager::NoModeSwitch);
} else { } else {
const QByteArray data = m_listReply->readAll(); const QByteArray data = m_listReply->readAll();
const QStringList lines = QString::fromLatin1(data).split(QLatin1Char('\n')); const QStringList lines = QString::fromLatin1(data).split(QLatin1Char('\n'));
......
...@@ -313,7 +313,7 @@ void CodepasterPlugin::finishPost(const QString &link) ...@@ -313,7 +313,7 @@ void CodepasterPlugin::finishPost(const QString &link)
{ {
if (m_settings->copyToClipboard) if (m_settings->copyToClipboard)
QApplication::clipboard()->setText(link); QApplication::clipboard()->setText(link);
ICore::messageManager()->printToOutputPane(link, m_settings->displayOutput); ICore::messageManager()->printToOutputPane(link, m_settings->displayOutput ? Core::MessageManager::ModeSwitch : Core::MessageManager::Silent);
} }
// Extract the characters that can be used for a file name from a title // Extract the characters that can be used for a file name from a title
...@@ -356,11 +356,11 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription, ...@@ -356,11 +356,11 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription,
Core::MessageManager *messageManager = ICore::messageManager(); Core::MessageManager *messageManager = ICore::messageManager();
// Failure? // Failure?
if (error) { if (error) {
messageManager->printToOutputPane(content, true); messageManager->printToOutputPane(content, Core::MessageManager::NoModeSwitch);
return; return;
} }
if (content.isEmpty()) { if (content.isEmpty()) {
messageManager->printToOutputPane(tr("Empty snippet received for \"%1\".").arg(titleDescription), true); messageManager->printToOutputPane(tr("Empty snippet received for \"%1\".").arg(titleDescription), Core::MessageManager::NoModeSwitch);
return; return;
} }
// If the mime type has a preferred suffix (cpp/h/patch...), use that for // If the mime type has a preferred suffix (cpp/h/patch...), use that for
...@@ -379,7 +379,7 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription, ...@@ -379,7 +379,7 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription,
saver.setAutoRemove(false); saver.setAutoRemove(false);
saver.write(byteContent); saver.write(byteContent);
if (!saver.finalize()) { if (!saver.finalize()) {
messageManager->printToOutputPane(saver.errorString()); messageManager->printToOutputPane(saver.errorString(), Core::MessageManager::NoModeSwitch);
return; return;
} }
const QString fileName = saver.fileName(); const QString fileName = saver.fileName();
......
...@@ -209,11 +209,11 @@ void FileShareProtocol::paste(const QString &text, ...@@ -209,11 +209,11 @@ void FileShareProtocol::paste(const QString &text,
saver.setResult(&writer); saver.setResult(&writer);
} }
if (!saver.finalize()) { if (!saver.finalize()) {
Core::ICore::messageManager()->printToOutputPanePopup(saver.errorString()); Core::ICore::messageManager()->printToOutputPane(saver.errorString(), Core::MessageManager::NoModeSwitch);
return; return;
} }
const QString msg = tr("Pasted: %1").arg(saver.fileName()); const QString msg = tr("Pasted: %1").arg(saver.fileName());
Core::ICore::messageManager()->printToOutputPanePopup(msg); Core::ICore::messageManager()->printToOutputPane(msg, Core::MessageManager::NoModeSwitch);
} }
} // namespace CodePaster } // namespace CodePaster
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