From 5b0bf616401624e28ba1c0e94e474c2da2e6350a Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 17 Apr 2012 08:01:25 +0200 Subject: qtcassert: move actual printing to separate function and enforce style This also allows simple setting of breakpoints on failed asserts. Change-Id: I6dd84cbfaf659d57e39f3447386cebc0221b2b84 Reviewed-by: Daniel Teske --- src/plugins/cpaster/codepasterprotocol.cpp | 6 +++--- src/plugins/cpaster/cpasterplugin.cpp | 8 ++++---- src/plugins/cpaster/kdepasteprotocol.cpp | 4 ++-- src/plugins/cpaster/pastebindotcaprotocol.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/plugins/cpaster') diff --git a/src/plugins/cpaster/codepasterprotocol.cpp b/src/plugins/cpaster/codepasterprotocol.cpp index 2d720e872f..bf677fe092 100644 --- a/src/plugins/cpaster/codepasterprotocol.cpp +++ b/src/plugins/cpaster/codepasterprotocol.cpp @@ -99,7 +99,7 @@ bool CodePasterProtocol::checkConfiguration(QString *errorMessage) void CodePasterProtocol::fetch(const QString &id) { - QTC_ASSERT(!m_fetchReply, return; ) + QTC_ASSERT(!m_fetchReply, return); QString hostName = m_page->hostName(); const QString httpPrefix = QLatin1String("http://"); @@ -124,7 +124,7 @@ void CodePasterProtocol::fetch(const QString &id) void CodePasterProtocol::list() { - QTC_ASSERT(!m_listReply, return; ) + QTC_ASSERT(!m_listReply, return); QString hostName = m_page->hostName(); QString link = QLatin1String("http://"); @@ -140,7 +140,7 @@ void CodePasterProtocol::paste(const QString &text, const QString &comment, const QString &description) { - QTC_ASSERT(!m_pasteReply, return; ) + QTC_ASSERT(!m_pasteReply, return); const QString hostName = m_page->hostName(); QByteArray data = "command=processcreate&submit=submit&highlight_type=0&description="; diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 9d6da9f2ff..20e5b85d26 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -88,19 +88,19 @@ CodePasterService::CodePasterService(QObject *parent) : void CodePasterService::postText(const QString &text, const QString &mimeType) { - QTC_ASSERT(CodepasterPlugin::instance(), return; ) + QTC_ASSERT(CodepasterPlugin::instance(), return); CodepasterPlugin::instance()->post(text, mimeType); } void CodePasterService::postCurrentEditor() { - QTC_ASSERT(CodepasterPlugin::instance(), return; ) + QTC_ASSERT(CodepasterPlugin::instance(), return); CodepasterPlugin::instance()->postEditor(); } void CodePasterService::postClipboard() { - QTC_ASSERT(CodepasterPlugin::instance(), return; ) + QTC_ASSERT(CodepasterPlugin::instance(), return); CodepasterPlugin::instance()->postClipboard(); } @@ -366,7 +366,7 @@ void CodepasterPlugin::finishFetch(const QString &titleDescription, m_fetchedSnippets.push_back(fileName); // Open editor with title. Core::IEditor* editor = EditorManager::instance()->openEditor(fileName, Core::Id(), EditorManager::ModeSwitch); - QTC_ASSERT(editor, return) + QTC_ASSERT(editor, return); editor->setDisplayName(titleDescription); } diff --git a/src/plugins/cpaster/kdepasteprotocol.cpp b/src/plugins/cpaster/kdepasteprotocol.cpp index 101cbd79fa..c73c6de41c 100644 --- a/src/plugins/cpaster/kdepasteprotocol.cpp +++ b/src/plugins/cpaster/kdepasteprotocol.cpp @@ -108,7 +108,7 @@ void KdePasteProtocol::paste(const QString &text, { Q_UNUSED(comment); Q_UNUSED(description); - QTC_ASSERT(!m_pasteReply, return;) + QTC_ASSERT(!m_pasteReply, return); // Format body QByteArray pasteData = "api_submit=true&mode=xml"; @@ -162,7 +162,7 @@ void KdePasteProtocol::pasteFinished() void KdePasteProtocol::fetch(const QString &id) { - QTC_ASSERT(!m_fetchReply, return;) + QTC_ASSERT(!m_fetchReply, return); // Did we get a complete URL or just an id? m_fetchId = id; diff --git a/src/plugins/cpaster/pastebindotcaprotocol.cpp b/src/plugins/cpaster/pastebindotcaprotocol.cpp index 8448b426dd..d393efb354 100644 --- a/src/plugins/cpaster/pastebindotcaprotocol.cpp +++ b/src/plugins/cpaster/pastebindotcaprotocol.cpp @@ -58,7 +58,7 @@ unsigned PasteBinDotCaProtocol::capabilities() const void PasteBinDotCaProtocol::fetch(const QString &id) { - QTC_ASSERT(!m_fetchReply, return) + QTC_ASSERT(!m_fetchReply, return); const QString url = QLatin1String(urlC); const QString rawPostFix = QLatin1String("raw/"); // Create link as ""http://pastebin.ca/raw/[id]" -- cgit v1.2.1