diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp index 322039c0cbd036c34e365cf16730f82dcfa47eaa..ca9a7faf363ac3b95363a597a161e807b982082b 100644 --- a/src/plugins/texteditor/basetexteditor.cpp +++ b/src/plugins/texteditor/basetexteditor.cpp @@ -2700,11 +2700,6 @@ const DisplaySettings &BaseTextEditor::displaySettings() const return d->m_displaySettings; } -const InteractionSettings &BaseTextEditor::interactionSettings() const -{ - return d->m_interactionSettings; -} - void BaseTextEditor::indentOrUnindent(bool doIndent) { diff --git a/src/plugins/texteditor/basetexteditor.h b/src/plugins/texteditor/basetexteditor.h index c3cae63467fa8afb8058f6b5c6544742748eda5c..16005cc1d94989fcaf516ea02ed14683dde7b314 100644 --- a/src/plugins/texteditor/basetexteditor.h +++ b/src/plugins/texteditor/basetexteditor.h @@ -32,7 +32,6 @@ #include "displaysettings.h" #include "tabsettings.h" -#include "interactionsettings.h" #include "itexteditable.h" #include <QtGui/QPlainTextEdit> @@ -380,7 +379,6 @@ public: const TabSettings &tabSettings() const; const DisplaySettings &displaySettings() const; - const InteractionSettings &interactionSettings() const; void markBlocksAsChanged(QList<int> blockNumbers); diff --git a/src/plugins/texteditor/basetexteditor_p.h b/src/plugins/texteditor/basetexteditor_p.h index d33fa9d7d4c2fdef660fb8967638787d50f2ec17..bed889d5a147fa99df6f578353a678071d915ac3 100644 --- a/src/plugins/texteditor/basetexteditor_p.h +++ b/src/plugins/texteditor/basetexteditor_p.h @@ -162,7 +162,6 @@ public: QWidget *m_extraArea; DisplaySettings m_displaySettings; - InteractionSettings m_interactionSettings; int extraAreaSelectionAnchorBlockNumber; int extraAreaToggleMarkBlockNumber; diff --git a/src/plugins/texteditor/behaviorsettingspage.cpp b/src/plugins/texteditor/behaviorsettingspage.cpp index 8fa6434e81a89ec67ac874041f35ccc1b22b232b..1ff95ca1482e1e5f90cc53949735e71f264b05a5 100644 --- a/src/plugins/texteditor/behaviorsettingspage.cpp +++ b/src/plugins/texteditor/behaviorsettingspage.cpp @@ -28,7 +28,6 @@ **************************************************************************/ #include "behaviorsettingspage.h" -#include "interactionsettings.h" #include "storagesettings.h" #include "tabsettings.h" #include "ui_behaviorsettingspage.h" @@ -47,7 +46,6 @@ struct BehaviorSettingsPage::BehaviorSettingsPagePrivate Ui::BehaviorSettingsPage m_page; TabSettings m_tabSettings; StorageSettings m_storageSettings; - InteractionSettings m_interactionSettings; }; BehaviorSettingsPage::BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate @@ -57,7 +55,6 @@ BehaviorSettingsPage::BehaviorSettingsPagePrivate::BehaviorSettingsPagePrivate if (const QSettings *s = Core::ICore::instance()->settings()) { m_tabSettings.fromSettings(m_parameters.settingsPrefix, s); m_storageSettings.fromSettings(m_parameters.settingsPrefix, s); - m_interactionSettings.fromSettings(m_parameters.settingsPrefix, s); } } @@ -105,9 +102,8 @@ void BehaviorSettingsPage::apply() { TabSettings newTabSettings; StorageSettings newStorageSettings; - InteractionSettings newInteractionSettings; - settingsFromUI(newTabSettings, newStorageSettings, newInteractionSettings); + settingsFromUI(newTabSettings, newStorageSettings); Core::ICore *core = Core::ICore::instance(); QSettings *s = core->settings(); @@ -127,17 +123,10 @@ void BehaviorSettingsPage::apply() emit storageSettingsChanged(newStorageSettings); } - - if (newInteractionSettings != m_d->m_interactionSettings) { - m_d->m_interactionSettings = newInteractionSettings; - if (s) - m_d->m_interactionSettings.toSettings(m_d->m_parameters.settingsPrefix, s); - } } void BehaviorSettingsPage::settingsFromUI(TabSettings &tabSettings, - StorageSettings &storageSettings, - InteractionSettings &interactionSettings) const + StorageSettings &storageSettings) const { tabSettings.m_spacesForTabs = m_d->m_page.insertSpaces->isChecked(); tabSettings.m_autoIndent = m_d->m_page.autoIndent->isChecked(); @@ -149,8 +138,6 @@ void BehaviorSettingsPage::settingsFromUI(TabSettings &tabSettings, storageSettings.m_inEntireDocument = m_d->m_page.inEntireDocument->isChecked(); storageSettings.m_cleanIndentation = m_d->m_page.cleanIndentation->isChecked(); storageSettings.m_addFinalNewLine = m_d->m_page.addFinalNewLine->isChecked(); - - interactionSettings.m_useVim = m_d->m_page.useVim->isChecked(); } void BehaviorSettingsPage::settingsToUI() @@ -167,9 +154,6 @@ void BehaviorSettingsPage::settingsToUI() m_d->m_page.inEntireDocument->setChecked(storageSettings.m_inEntireDocument); m_d->m_page.cleanIndentation->setChecked(storageSettings.m_cleanIndentation); m_d->m_page.addFinalNewLine->setChecked(storageSettings.m_addFinalNewLine); - - const InteractionSettings &interactionSettings = m_d->m_interactionSettings; - m_d->m_page.useVim->setChecked(interactionSettings.m_useVim); } TabSettings BehaviorSettingsPage::tabSettings() const @@ -181,8 +165,3 @@ StorageSettings BehaviorSettingsPage::storageSettings() const { return m_d->m_storageSettings; } - -InteractionSettings BehaviorSettingsPage::interactionSettings() const -{ - return m_d->m_interactionSettings; -} diff --git a/src/plugins/texteditor/behaviorsettingspage.h b/src/plugins/texteditor/behaviorsettingspage.h index 821e5196106fcc23f70772578976f0191e0866d4..c94343094c95741d24886f7e61da236efe6ecec2 100644 --- a/src/plugins/texteditor/behaviorsettingspage.h +++ b/src/plugins/texteditor/behaviorsettingspage.h @@ -40,7 +40,6 @@ namespace TextEditor { struct TabSettings; struct StorageSettings; -struct InteractionSettings; struct BehaviorSettingsPageParameters { @@ -70,7 +69,6 @@ public: TabSettings tabSettings() const; StorageSettings storageSettings() const; - InteractionSettings interactionSettings() const; signals: void tabSettingsChanged(const TextEditor::TabSettings &); @@ -78,8 +76,7 @@ signals: private: void settingsFromUI(TabSettings &rc, - StorageSettings &storageSettings, - InteractionSettings &interactionSettings) const; + StorageSettings &storageSettings) const; void settingsToUI(); struct BehaviorSettingsPagePrivate; BehaviorSettingsPagePrivate *m_d; diff --git a/src/plugins/texteditor/behaviorsettingspage.ui b/src/plugins/texteditor/behaviorsettingspage.ui index 64febb27e5bcd1d43c660170f5ee9153fb206c10..107e6966595aca86f3739473aaae43673654cab1 100644 --- a/src/plugins/texteditor/behaviorsettingspage.ui +++ b/src/plugins/texteditor/behaviorsettingspage.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>428</width> - <height>384</height> + <height>325</height> </rect> </property> <property name="windowTitle"> @@ -107,25 +107,6 @@ </widget> </item> <item row="2" column="0"> - <widget class="QGroupBox" name="groupBoxInteractionSettings"> - <property name="title"> - <string>Interaction</string> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <widget class="QCheckBox" name="useVim"> - <property name="toolTip"> - <string/> - </property> - <property name="text"> - <string>Use "vi" style editing</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="3" column="0"> <spacer name="verticalSpacer"> <property name="orientation"> <enum>Qt::Vertical</enum> diff --git a/src/plugins/texteditor/interactionsettings.cpp b/src/plugins/texteditor/interactionsettings.cpp deleted file mode 100644 index a9179902267780954ee2b89051ce586e8d621a6d..0000000000000000000000000000000000000000 --- a/src/plugins/texteditor/interactionsettings.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -**************************************************************************/ - -#include "interactionsettings.h" - -#include <QSettings> -#include <QString> - -namespace TextEditor { - -static const char *useVimKey = "UseVim"; -static const char *groupPostfix = "InteractionSettings"; - -InteractionSettings::InteractionSettings() - : m_useVim(false) -{ -} - -void InteractionSettings::toSettings(const QString &category, QSettings *s) const -{ - QString group = QLatin1String(groupPostfix); - if (!category.isEmpty()) - group.insert(0, category); - s->beginGroup(group); - s->setValue(QLatin1String(useVimKey), m_useVim); - s->endGroup(); -} - -void InteractionSettings::fromSettings(const QString &category, const QSettings *s) -{ - QString group = QLatin1String(groupPostfix); - if (!category.isEmpty()) - group.insert(0, category); - group += QLatin1Char('/'); - m_useVim = s->value(group + QLatin1String(useVimKey), m_useVim).toBool(); -} - -bool InteractionSettings::equals(const InteractionSettings &ts) const -{ - return m_useVim == ts.m_useVim; -} - -} // namespace TextEditor diff --git a/src/plugins/texteditor/interactionsettings.h b/src/plugins/texteditor/interactionsettings.h deleted file mode 100644 index 9cc40762c436b6bb13735a3a30e42abe0fb7b8ae..0000000000000000000000000000000000000000 --- a/src/plugins/texteditor/interactionsettings.h +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************** -** -** This file is part of Qt Creator -** -** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -** -** Contact: Qt Software Information (qt-info@nokia.com) -** -** Commercial Usage -** -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** -** GNU Lesser General Public License Usage -** -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** -**************************************************************************/ - -#ifndef INTERACTIONSETTINGS_H -#define INTERACTIONSETTINGS_H - -#include "texteditor_global.h" - -QT_BEGIN_NAMESPACE -class QSettings; -QT_END_NAMESPACE - -namespace TextEditor { - -struct TEXTEDITOR_EXPORT InteractionSettings -{ - InteractionSettings(); - - void toSettings(const QString &category, QSettings *s) const; - void fromSettings(const QString &category, const QSettings *s); - - bool equals(const InteractionSettings &ts) const; - - bool m_useVim; -}; - -inline bool operator==(const InteractionSettings &t1, const InteractionSettings &t2) { return t1.equals(t2); } -inline bool operator!=(const InteractionSettings &t1, const InteractionSettings &t2) { return !t1.equals(t2); } - -} // namespace TextEditor - -#endif // INTERACTIONSETTINGS_H diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro index 0ec180bc06a7f778800065e2f8d4e471fc67f76f..61f8477dd8036b21e5a16f512cd04da2e475a5ee 100644 --- a/src/plugins/texteditor/texteditor.pro +++ b/src/plugins/texteditor/texteditor.pro @@ -14,7 +14,6 @@ SOURCES += texteditorplugin.cpp \ completionsupport.cpp \ completionwidget.cpp \ fontsettingspage.cpp \ - interactionsettings.cpp \ tabsettings.cpp \ storagesettings.cpp \ displaysettings.cpp \ @@ -40,7 +39,6 @@ HEADERS += texteditorplugin.h \ texteditoractionhandler.h \ fontsettingspage.h \ icompletioncollector.h \ - interactionsettings.h \ texteditorconstants.h \ tabsettings.h \ storagesettings.h \ diff --git a/src/plugins/texteditor/texteditorplugin.cpp b/src/plugins/texteditor/texteditorplugin.cpp index bd9556d8328b60b487cc76a597ca1fe76b79886a..12e3ef9282520cf58b9af4c1625562085398df30 100644 --- a/src/plugins/texteditor/texteditorplugin.cpp +++ b/src/plugins/texteditor/texteditorplugin.cpp @@ -38,7 +38,6 @@ #include "plaintexteditorfactory.h" #include "plaintexteditor.h" #include "storagesettings.h" -#include "interactionsettings.h" #include <coreplugin/icore.h> #include <coreplugin/coreconstants.h>