fixed emacsmode plugin for QtCreator 2.3.0

This commit is contained in:
rachytski 2011-09-08 14:03:17 +03:00 committed by Alex Zolotarev
parent 15fc30e924
commit fffda48fbf
3 changed files with 22 additions and 14 deletions

View file

@ -13,9 +13,9 @@ Alternatively, this plugin may be used under the terms of the GNU Lesser General
<description>Emacs-style keyboard navigation.</description>
<url></url>
<dependencyList>
<dependency name="CppEditor" version="2.1.81"/><!-- Plugin adds items to the editor's context menu -->
<dependency name="TextEditor" version="2.1.81"/>
<dependency name="ProjectExplorer" version="2.1.81"/>
<dependency name="Core" version="2.1.81"/>
<dependency name="CppEditor" version="2.3.0"/><!-- Plugin adds items to the editor's context menu -->
<dependency name="TextEditor" version="2.3.0"/>
<dependency name="ProjectExplorer" version="2.3.0"/>
<dependency name="Core" version="2.3.0"/>
</dependencyList>
</plugin>

View file

@ -1,12 +1,12 @@
QTC_SOURCE = ../../../qt-creator-2.2.0-beta-src
QTC_BUILD = ../../../qt-creator-2.2.0-beta-src
QTC_SOURCE = ../../../qt-creator-2.3.0-src
QTC_BUILD = ../../../qtcreator-build-desktop-release
TEMPLATE = lib
TARGET = EmacsMode
IDE_SOURCE_TREE = $$QTC_SOURCE
IDE_BUILD_TREE = $$QTC_BUILD
PROVIDER = Spliny
DESTDIR = $$QTC_BUILD/lib/qtcreator/plugins/Spliny
PROVIDER = MapsWithMe
DESTDIR = $$QTC_BUILD/lib/qtcreator/plugins/MapsWithMe
LIBS += -L$$QTC_BUILD/bin/Qt\ Creator.app/Contents/PlugIns/Nokia
include($$QTC_SOURCE/src/qtcreatorplugin.pri)

View file

@ -51,9 +51,10 @@
#include <texteditor/basetextdocumentlayout.h>
#include <texteditor/basetexteditor.h>
#include <texteditor/basetextmark.h>
#include <texteditor/completionsupport.h>
//#include <texteditor/completionsupport.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/tabsettings.h>
#include <texteditor/tabpreferences.h>
#include <texteditor/texteditorsettings.h>
#include <texteditor/indenter.h>
//#include <texteditor/textblockiterator.h>
@ -138,9 +139,16 @@ QWidget *EmacsModeOptionPage::createPage(QWidget *parent)
void EmacsModeOptionPage::copyTextEditorSettings()
{
TextEditor::TabSettings ts =
TextEditor::TextEditorSettings::instance()->tabSettings();
TabSettings ts = TextEditorSettings::instance()->tabPreferences()->settings();
/* m_ui.checkBoxExpandTab->setChecked(ts.m_spacesForTabs);
m_ui.spinBoxTabStop->setValue(ts.m_tabSize);
m_ui.spinBoxShiftWidth->setValue(ts.m_indentSize);
m_ui.checkBoxSmartTab->setChecked(ts.m_smartBackspace);
m_ui.checkBoxAutoIndent->setChecked(true);
m_ui.checkBoxSmartIndent->setChecked(ts.m_autoIndent);
m_ui.checkBoxIncSearch->setChecked(true);
*/
m_ui.checkBoxExpandTab->setChecked(ts.m_spacesForTabs);
m_ui.lineEditTabStop->setText(QString::number(ts.m_tabSize));
m_ui.lineEditShiftWidth->setText(QString::number(ts.m_indentSize));
@ -434,9 +442,9 @@ void EmacsModePluginPrivate::writeFile(bool *handled,
if (editor && editor->file()->fileName() == fileName) {
// Handle that as a special case for nicer interaction with core
Core::IFile *file = editor->file();
Core::ICore::instance()->fileManager()->blockFileChange(file);
Core::ICore::instance()->fileManager()->saveFile(file);/*blockFileChange(file);
file->save(fileName);
Core::ICore::instance()->fileManager()->unblockFileChange(file);
Core::ICore::instance()->fileManager()->unblockFileChange(file);*/
*handled = true;
}
}