diff --git a/src/libs/ssh/sshconnection.cpp b/src/libs/ssh/sshconnection.cpp index 0498b4f2856..9ab280b47f4 100644 --- a/src/libs/ssh/sshconnection.cpp +++ b/src/libs/ssh/sshconnection.cpp @@ -82,7 +82,7 @@ namespace { SshConnectionParameters::SshConnectionParameters() : - timeout(0), authenticationType(AuthenticationByKey), port(0), proxyType(NoProxy) + timeout(0), authenticationType(AuthenticationByKey), port(0), options(SshIgnoreDefaultProxy) { } @@ -226,8 +226,8 @@ SshConnectionPrivate::SshConnectionPrivate(SshConnection *conn, m_conn(conn) { setupPacketHandlers(); - m_socket->setProxy(m_connParams.proxyType == SshConnectionParameters::DefaultProxy - ? QNetworkProxy::DefaultProxy : QNetworkProxy::NoProxy); + m_socket->setProxy((m_connParams.options & SshIgnoreDefaultProxy) + ? QNetworkProxy::NoProxy : QNetworkProxy::DefaultProxy); m_timeoutTimer.setSingleShot(true); m_timeoutTimer.setInterval(m_connParams.timeout * 1000); m_keepAliveTimer.setSingleShot(true); diff --git a/src/libs/ssh/sshconnection.h b/src/libs/ssh/sshconnection.h index 3c982b197e2..6564da32d62 100644 --- a/src/libs/ssh/sshconnection.h +++ b/src/libs/ssh/sshconnection.h @@ -36,6 +36,7 @@ #include "ssh_global.h" #include +#include #include #include #include @@ -50,10 +51,15 @@ namespace Internal { class SshConnectionPrivate; } // namespace Internal +enum SshConnectionOption { + SshIgnoreDefaultProxy = 0x1 +}; + +Q_DECLARE_FLAGS(SshConnectionOptions, SshConnectionOption) + class QSSH_EXPORT SshConnectionParameters { public: - enum ProxyType { DefaultProxy, NoProxy }; enum AuthenticationType { AuthenticationByPassword, AuthenticationByKey }; SshConnectionParameters(); @@ -64,7 +70,7 @@ public: int timeout; // In seconds. AuthenticationType authenticationType; quint16 port; - ProxyType proxyType; + SshConnectionOptions options; }; QSSH_EXPORT bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index a6431b0c1fc..4e69d78942d 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1797,7 +1797,7 @@ void DebuggerPluginPrivate::startRemoteEngine() sp.connParams.timeout = 5; sp.connParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByPassword; sp.connParams.port = 22; - sp.connParams.proxyType = QSsh::SshConnectionParameters::NoProxy; + sp.connParams.options = QSsh::SshIgnoreDefaultProxy; sp.executable = dlg.inferiorPath(); sp.serverStartScript = dlg.enginePath(); diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index d1831c920b9..6049d926f33 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1375,9 +1375,6 @@ public: QString m_currentFileName; - QString m_lastSearch; - bool m_lastSearchForward; - bool m_findPending; int m_findStartPosition; QString m_lastInsertion; QString m_lastDeletion; @@ -1530,7 +1527,8 @@ public: static struct GlobalData { GlobalData() - : mappings(), currentMap(&mappings), inputTimer(-1), currentMessageLevel(MessageInfo) + : mappings(), currentMap(&mappings), inputTimer(-1), currentMessageLevel(MessageInfo), + lastSearchForward(false), findPending(false) { // default mapping state - shouldn't be removed mapStates << MappingState(); @@ -1549,7 +1547,6 @@ public: Inputs pendingInput; MappingsIterator currentMap; int inputTimer; - int lastMapCode; QStack mapStates; // Command line buffers. @@ -1559,6 +1556,11 @@ public: // Current mini buffer message. QString currentMessage; MessageLevel currentMessageLevel; + + // Search state + QString lastSearch; + bool lastSearchForward; + bool findPending; } g; }; @@ -1581,12 +1583,12 @@ void FakeVimHandler::Private::init() m_subsubmode = NoSubSubMode; m_passing = false; m_firstKeyPending = false; - m_findPending = false; + g.findPending = false; m_findStartPosition = -1; m_fakeEnd = false; m_positionPastEnd = false; m_anchorPastEnd = false; - m_lastSearchForward = true; + g.lastSearchForward = true; m_register = '"'; m_gflag = false; m_visualMode = NoVisualMode; @@ -2012,8 +2014,8 @@ void FakeVimHandler::Private::timerEvent(QTimerEvent *ev) void FakeVimHandler::Private::stopIncrementalFind() { - if (m_findPending) { - m_findPending = false; + if (g.findPending) { + g.findPending = false; QTextCursor tc = cursor(); setAnchorAndPosition(m_findStartPosition, tc.selectionStart()); finishMovement(); @@ -2031,7 +2033,7 @@ void FakeVimHandler::Private::updateFind(bool isComplete) const QString &needle = g.searchBuffer.contents(); SearchData sd; sd.needle = needle; - sd.forward = m_lastSearchForward; + sd.forward = g.lastSearchForward; sd.highlightMatches = isComplete; search(sd, isComplete); } @@ -2744,21 +2746,21 @@ EventResult FakeVimHandler::Private::handleCommandMode1(const Input &input) g.commandBuffer.setContents("'<,'>"); updateMiniBuffer(); } else if (input.is('/') || input.is('?')) { - m_lastSearchForward = input.is('/'); + g.lastSearchForward = input.is('/'); if (hasConfig(ConfigUseCoreSearch)) { // re-use the core dialog. - m_findPending = true; + g.findPending = true; m_findStartPosition = position(); m_movetype = MoveExclusive; setAnchor(); // clear selection: otherwise, search is restricted to selection - emit q->findRequested(!m_lastSearchForward); + emit q->findRequested(!g.lastSearchForward); } else { // FIXME: make core find dialog sufficiently flexible to // produce the "default vi" behaviour too. For now, roll our own. g.currentMessage.clear(); m_movetype = MoveExclusive; m_subsubmode = SearchSubSubMode; - g.searchBuffer.setPrompt(m_lastSearchForward ? '/' : '?'); + g.searchBuffer.setPrompt(g.lastSearchForward ? '/' : '?'); m_searchStartPosition = position(); m_searchFromScreenLine = firstVisibleLine(); m_searchCursor = QTextCursor(); @@ -2780,8 +2782,8 @@ EventResult FakeVimHandler::Private::handleCommandMode1(const Input &input) needle = "\\<" + tc.selection().toPlainText() + "\\>"; setAnchorAndPosition(tc.position(), tc.anchor()); g.searchBuffer.historyPush(needle); - m_lastSearch = needle; - m_lastSearchForward = input.is('*'); + g.lastSearch = needle; + g.lastSearchForward = input.is('*'); searchNext(); finishMovement(); } else if (input.is('\'')) { @@ -3171,7 +3173,7 @@ EventResult FakeVimHandler::Private::handleCommandMode2(const Input &input) finishMovement(); } else if (input.is('n') || input.is('N')) { if (hasConfig(ConfigUseCoreSearch)) { - bool forward = (input.is('n')) ? m_lastSearchForward : !m_lastSearchForward; + bool forward = (input.is('n')) ? g.lastSearchForward : !g.lastSearchForward; int pos = position(); emit q->findNextRequested(!forward); if (forward && pos == cursor().selectionStart()) { @@ -3813,12 +3815,12 @@ EventResult FakeVimHandler::Private::handleSearchSubSubMode(const Input &input) } else if (input.isReturn()) { const QString &needle = g.searchBuffer.contents(); if (!needle.isEmpty()) - m_lastSearch = needle; + g.lastSearch = needle; else - g.searchBuffer.setContents(m_lastSearch); - if (!m_lastSearch.isEmpty()) { + g.searchBuffer.setContents(g.lastSearch); + if (!g.lastSearch.isEmpty()) { updateFind(true); - finishMovement(g.searchBuffer.prompt() + m_lastSearch + '\n'); + finishMovement(g.searchBuffer.prompt() + g.lastSearch + '\n'); } else { finishMovement(); } @@ -4722,11 +4724,11 @@ void FakeVimHandler::Private::search(const SearchData &sd, bool showMessages) void FakeVimHandler::Private::searchNext(bool forward) { SearchData sd; - sd.needle = m_lastSearch; - sd.forward = forward ? m_lastSearchForward : !m_lastSearchForward; + sd.needle = g.lastSearch; + sd.forward = forward ? g.lastSearchForward : !g.lastSearchForward; sd.highlightMatches = true; m_searchStartPosition = position(); - showMessage(MessageCommand, (m_lastSearchForward ? '/' : '?') + sd.needle); + showMessage(MessageCommand, (g.lastSearchForward ? '/' : '?') + sd.needle); search(sd); } diff --git a/src/plugins/qnx/blackberrydeviceconfigurationwizard.cpp b/src/plugins/qnx/blackberrydeviceconfigurationwizard.cpp index a83ef2a9072..9c7b26e446d 100644 --- a/src/plugins/qnx/blackberrydeviceconfigurationwizard.cpp +++ b/src/plugins/qnx/blackberrydeviceconfigurationwizard.cpp @@ -68,7 +68,7 @@ BlackBerryDeviceConfigurationWizard::BlackBerryDeviceConfigurationWizard(QWidget ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfigurationWizard::device() { QSsh::SshConnectionParameters sshParams; - sshParams.proxyType = QSsh::SshConnectionParameters::NoProxy; + sshParams.options = QSsh::SshIgnoreDefaultProxy; sshParams.host = m_setupPage->hostName(); sshParams.password = m_setupPage->password(); sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByKey; diff --git a/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp b/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp index a113cb5e07e..c7c88031df6 100644 --- a/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp +++ b/src/plugins/qnx/qnxdeviceconfigurationwizard.cpp @@ -63,7 +63,7 @@ QnxDeviceConfigurationWizard::QnxDeviceConfigurationWizard(QWidget *parent) : IDevice::Ptr QnxDeviceConfigurationWizard::device() { QSsh::SshConnectionParameters sshParams; - sshParams.proxyType = QSsh::SshConnectionParameters::NoProxy; + sshParams.options = QSsh::SshIgnoreDefaultProxy; sshParams.host = m_setupPage->hostName(); sshParams.userName = m_setupPage->userName(); sshParams.port = 22;