diff --git a/src/plugins/designer/designerxmleditor.cpp b/src/plugins/designer/designerxmleditor.cpp index b8d4937092fdb6b19eac8e5640d68c1e30ef06da..eabb9910726055bb3f976596142b985fb9a2d9de 100644 --- a/src/plugins/designer/designerxmleditor.cpp +++ b/src/plugins/designer/designerxmleditor.cpp @@ -37,8 +37,8 @@ #include <coreplugin/uniqueidmanager.h> #include <QDebug> -using namespace Designer::Internal; - +namespace Designer { +namespace Internal { DesignerXmlEditor::DesignerXmlEditor(QWidget *parent) : TextEditor::PlainTextEditor(parent) { setReadOnly(true); @@ -74,11 +74,14 @@ void DesignerXmlEditor::designerOpened() Core::ICore::instance()->modeManager()->activateMode(Core::Constants::MODE_DESIGN); } +} // namespace Internal + QString DesignerXmlEditorEditable::id() const { return QLatin1String(Designer::Constants::K_DESIGNER_XML_EDITOR_ID); } -DesignerXmlEditorEditable::DesignerXmlEditorEditable(DesignerXmlEditor *editor) + +DesignerXmlEditorEditable::DesignerXmlEditorEditable(Internal::DesignerXmlEditor *editor) : TextEditor::PlainTextEditorEditable(editor) { Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance(); @@ -96,3 +99,4 @@ Core::IEditor *DesignerXmlEditorEditable::duplicate(QWidget *parent) Q_UNUSED(parent); return 0; } +} // namespace Designer diff --git a/src/plugins/designer/designerxmleditor.h b/src/plugins/designer/designerxmleditor.h index 90fe1215d1dff16aec923fc17255ec2afbf6185f..09714214ce5db96f2267bf76cf325a5fd179d545 100644 --- a/src/plugins/designer/designerxmleditor.h +++ b/src/plugins/designer/designerxmleditor.h @@ -30,6 +30,7 @@ #ifndef DESIGNERXMLEDITOR_H #define DESIGNERXMLEDITOR_H +#include "designer_export.h" #include <texteditor/plaintexteditor.h> #include <texteditor/basetexteditor.h> @@ -39,15 +40,16 @@ namespace Core { } namespace Designer { -namespace Internal { +namespace Internal { class DesignerXmlEditor; +} -class DesignerXmlEditorEditable : public TextEditor::PlainTextEditorEditable +class DESIGNER_EXPORT DesignerXmlEditorEditable : public TextEditor::PlainTextEditorEditable { Q_OBJECT public: - DesignerXmlEditorEditable(DesignerXmlEditor *editor); + explicit DesignerXmlEditorEditable(Internal::DesignerXmlEditor *editor); QList<int> context() const; bool duplicateSupported() const { return false; } @@ -63,11 +65,13 @@ private: * read/write editor too, but due to lack of XML editor, highlighting and other such * functionality, editing is disabled. */ +namespace Internal { + class DesignerXmlEditor : public TextEditor::PlainTextEditor { Q_OBJECT public: - DesignerXmlEditor(QWidget *parent = 0); + explicit DesignerXmlEditor(QWidget *parent = 0); virtual ~DesignerXmlEditor(); bool open(const QString &fileName = QString()); @@ -79,8 +83,6 @@ protected: virtual TextEditor::BaseTextEditorEditable *createEditableInterface() { return new DesignerXmlEditorEditable(this); } private: - - }; } // Internal diff --git a/src/plugins/designer/formeditorstack.cpp b/src/plugins/designer/formeditorstack.cpp index 77a24bf263c442ae8f9acda755639adc9fc89c4b..c0620b7164c943a14b1e1e3ca20a8ce8b361ed64 100644 --- a/src/plugins/designer/formeditorstack.cpp +++ b/src/plugins/designer/formeditorstack.cpp @@ -43,7 +43,6 @@ namespace Designer { namespace Internal { - FormEditorStack::FormEditorStack() : activeEditor(0) { diff --git a/src/plugins/designer/formeditorstack.h b/src/plugins/designer/formeditorstack.h index 7e7b16f893c508170b6afbd877059191a907634e..8d035cac59bf2e6d557514d72e2b1ad69a635e4f 100644 --- a/src/plugins/designer/formeditorstack.h +++ b/src/plugins/designer/formeditorstack.h @@ -40,9 +40,9 @@ namespace Core { namespace Designer { class FormWindowEditor; +class DesignerXmlEditorEditable; namespace Internal { -class DesignerXmlEditorEditable; /** * A wrapper for Qt Designer form editors, so that they can be used in Design mode. diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp index d9c8480e2551d123981ae0fda0039f623a432d35..3de9c3787991eb2cbc7ceb2088d3a4a112ab6ce1 100644 --- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp +++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp @@ -48,7 +48,7 @@ #include <projectexplorer/project.h> #include <projectexplorer/projectexplorerconstants.h> #include <utils/qtcassert.h> -#include <designer/formwindoweditor.h> +#include <designer/designerxmleditor.h> #include <QtCore/QCoreApplication> #include <QtCore/QDir> @@ -115,7 +115,7 @@ void Qt4Manager::init() void Qt4Manager::editorChanged(Core::IEditor *editor) { // Handle old editor - Designer::FormWindowEditor *lastFormEditor = qobject_cast<Designer::FormWindowEditor *>(m_lastEditor); + Designer::DesignerXmlEditorEditable *lastFormEditor = qobject_cast<Designer::DesignerXmlEditorEditable *>(m_lastEditor); if (lastFormEditor) { disconnect(lastFormEditor, SIGNAL(changed()), this, SLOT(uiEditorContentsChanged())); @@ -130,7 +130,7 @@ void Qt4Manager::editorChanged(Core::IEditor *editor) m_lastEditor = editor; // Handle new editor - if (Designer::FormWindowEditor *fw = qobject_cast<Designer::FormWindowEditor *>(editor)) + if (Designer::DesignerXmlEditorEditable *fw = qobject_cast<Designer::DesignerXmlEditorEditable *>(editor)) connect(fw, SIGNAL(changed()), this, SLOT(uiEditorContentsChanged())); } @@ -139,7 +139,7 @@ void Qt4Manager::editorAboutToClose(Core::IEditor *editor) if (m_lastEditor == editor) { // Oh no our editor is going to be closed // get the content first - Designer::FormWindowEditor *lastEditor = qobject_cast<Designer::FormWindowEditor *>(m_lastEditor); + Designer::DesignerXmlEditorEditable *lastEditor = qobject_cast<Designer::DesignerXmlEditorEditable *>(m_lastEditor); if (lastEditor) { disconnect(lastEditor, SIGNAL(changed()), this, SLOT(uiEditorContentsChanged())); if (m_dirty) { @@ -158,7 +158,7 @@ void Qt4Manager::uiEditorContentsChanged() // cast sender, get filename if (m_dirty) return; - Designer::FormWindowEditor *fw = qobject_cast<Designer::FormWindowEditor *>(sender()); + Designer::DesignerXmlEditorEditable *fw = qobject_cast<Designer::DesignerXmlEditorEditable *>(sender()); if (!fw) return; m_dirty = true;