summaryrefslogtreecommitdiff
path: root/src/plugins/cpaster
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2014-06-13 10:51:51 +0200
committerEike Ziller <eike.ziller@digia.com>2014-06-13 10:51:51 +0200
commit2786250c172138c1ece456305264f7b5039b8f2a (patch)
treedd0a56d98aefe9e1c6a3042b5cbcc37e87bd903b /src/plugins/cpaster
parente9d433a99a8fa4769df92f9caaaaaec049596c34 (diff)
parent27cc89eb4a1e157c68793718602416448547de20 (diff)
downloadqt-creator-2786250c172138c1ece456305264f7b5039b8f2a.tar.gz
Merge remote-tracking branch 'origin/3.1'
Conflicts: qtcreator.pri qtcreator.qbs src/shared/qbs Change-Id: Iba59e41db72e2afdf594f1f7003215d7d8d1e6d3
Diffstat (limited to 'src/plugins/cpaster')
-rw-r--r--src/plugins/cpaster/pasteview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/cpaster/pasteview.cpp b/src/plugins/cpaster/pasteview.cpp
index 1bf9dee9a4..c7c90d90e6 100644
--- a/src/plugins/cpaster/pasteview.cpp
+++ b/src/plugins/cpaster/pasteview.cpp
@@ -31,6 +31,7 @@
#include "protocol.h"
#include <coreplugin/icore.h>
+#include <utils/qtcassert.h>
#include <QPushButton>
#include <QSettings>
@@ -112,6 +113,7 @@ void PasteView::contentChanged()
void PasteView::protocolChanged(int p)
{
+ QTC_ASSERT(p >= 0 && p < m_protocols.size(), return);
const unsigned caps = m_protocols.at(p)->capabilities();
m_ui.uiDescription->setEnabled(caps & Protocol::PostDescriptionCapability);
m_ui.uiUsername->setEnabled(caps & Protocol::PostUserNameCapability);
@@ -215,6 +217,8 @@ void PasteView::accept()
void PasteView::setProtocol(const QString &protocol)
{
const int index = m_ui.protocolBox->findText(protocol);
+ if (index < 0)
+ return;
m_ui.protocolBox->setCurrentIndex(index);
if (index == m_ui.protocolBox->currentIndex())
protocolChanged(index); // Force enabling