From 285fa4a5b3f667dade669cd6d271cc488f400247 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Mon, 30 Mar 2009 15:38:09 +0200
Subject: [PATCH] fakevim: remove "fakevim" option from text editor settings as
 it has a page of its own now

---
 src/plugins/texteditor/basetexteditor.cpp     |  5 --
 src/plugins/texteditor/basetexteditor.h       |  2 -
 src/plugins/texteditor/basetexteditor_p.h     |  1 -
 .../texteditor/behaviorsettingspage.cpp       | 25 +------
 src/plugins/texteditor/behaviorsettingspage.h |  5 +-
 .../texteditor/behaviorsettingspage.ui        | 21 +-----
 .../texteditor/interactionsettings.cpp        | 69 -------------------
 src/plugins/texteditor/interactionsettings.h  | 58 ----------------
 src/plugins/texteditor/texteditor.pro         |  2 -
 src/plugins/texteditor/texteditorplugin.cpp   |  1 -
 10 files changed, 4 insertions(+), 185 deletions(-)
 delete mode 100644 src/plugins/texteditor/interactionsettings.cpp
 delete mode 100644 src/plugins/texteditor/interactionsettings.h

diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 322039c0cbd..ca9a7faf363 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 c3cae63467f..16005cc1d94 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 d33fa9d7d4c..bed889d5a14 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 8fa6434e81a..1ff95ca1482 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 821e5196106..c94343094c9 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 64febb27e5b..107e6966595 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 &quot;vi&quot; 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 a9179902267..00000000000
--- 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 9cc40762c43..00000000000
--- 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 0ec180bc06a..61f8477dd80 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 bd9556d8328..12e3ef92825 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>
-- 
GitLab