diff options
author | Eike Ziller <eike.ziller@digia.com> | 2014-06-13 10:51:51 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2014-06-13 10:51:51 +0200 |
commit | 2786250c172138c1ece456305264f7b5039b8f2a (patch) | |
tree | dd0a56d98aefe9e1c6a3042b5cbcc37e87bd903b /src/plugins/cpaster | |
parent | e9d433a99a8fa4769df92f9caaaaaec049596c34 (diff) | |
parent | 27cc89eb4a1e157c68793718602416448547de20 (diff) | |
download | qt-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.cpp | 4 |
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 |