From 1134c17b5524db58579e61860436d67c3bc9f2a4 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Fri, 20 Jul 2012 18:02:21 +0400 Subject: [PATCH] Moved QrcEditor to Internal namespace, fixed namespace usage. Change-Id: I24a142318cd6898ce32991085dcbeb7f00507f4e Reviewed-by: Eike Ziller --- src/plugins/resourceeditor/qrceditor/qrceditor.cpp | 1 + src/plugins/resourceeditor/qrceditor/qrceditor.h | 4 +++- src/plugins/resourceeditor/qrceditor/resourcefile.cpp | 5 ++--- src/plugins/resourceeditor/qrceditor/resourcefile_p.h | 4 +++- src/plugins/resourceeditor/qrceditor/resourceview.cpp | 11 ++++++----- src/plugins/resourceeditor/qrceditor/resourceview.h | 10 +++++----- src/plugins/resourceeditor/qrceditor/undocommands.cpp | 5 ++--- src/plugins/resourceeditor/qrceditor/undocommands_p.h | 4 +++- src/plugins/resourceeditor/resourceeditorw.h | 4 +--- 9 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/plugins/resourceeditor/qrceditor/qrceditor.cpp b/src/plugins/resourceeditor/qrceditor/qrceditor.cpp index e1a2b25ecf3..79120d34cf7 100644 --- a/src/plugins/resourceeditor/qrceditor/qrceditor.cpp +++ b/src/plugins/resourceeditor/qrceditor/qrceditor.cpp @@ -38,6 +38,7 @@ #include using namespace ResourceEditor; +using namespace ResourceEditor::Internal; QrcEditor::QrcEditor(QWidget *parent) : QWidget(parent), diff --git a/src/plugins/resourceeditor/qrceditor/qrceditor.h b/src/plugins/resourceeditor/qrceditor/qrceditor.h index 8641cbded32..0c6dea9b984 100644 --- a/src/plugins/resourceeditor/qrceditor/qrceditor.h +++ b/src/plugins/resourceeditor/qrceditor/qrceditor.h @@ -37,6 +37,7 @@ #include namespace ResourceEditor { +namespace Internal { class QrcEditor : public QWidget { @@ -105,6 +106,7 @@ private: QString m_currentLanguage; }; -} +} // namespace Internal +} // namespace ResourceEditor #endif diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index 9ba65101fe5..33fc8accb4c 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -59,7 +59,8 @@ static QString msgFileNameEmpty() return QCoreApplication::translate("Designer", "The file name is empty."); } -namespace ResourceEditor { +using namespace ResourceEditor; +using namespace ResourceEditor::Internal; /****************************************************************************** ** File @@ -1155,5 +1156,3 @@ QMimeData *ResourceModel::mimeData(const QModelIndexList &indexes) const rc->setText(doc.toString()); return rc; } - -} // namespace ResourceEditor diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h index bc2458cccac..2794ef6946a 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile_p.h +++ b/src/plugins/resourceeditor/qrceditor/resourcefile_p.h @@ -38,6 +38,7 @@ #include namespace ResourceEditor { +namespace Internal { class File; struct Prefix; @@ -274,6 +275,7 @@ private: QIcon m_prefixIcon; }; -} // namespace SharedTools +} // namespace Internal +} // namespace ResourceEditor #endif // RESOURCEFILE_P_H diff --git a/src/plugins/resourceeditor/qrceditor/resourceview.cpp b/src/plugins/resourceeditor/qrceditor/resourceview.cpp index bbd7cdfb934..3762981062c 100644 --- a/src/plugins/resourceeditor/qrceditor/resourceview.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourceview.cpp @@ -48,6 +48,7 @@ #include namespace ResourceEditor { +namespace Internal { /*! \class FileEntryBackup @@ -99,8 +100,6 @@ void PrefixEntryBackup::restore() const } } -namespace Internal { - class RelativeResourceModel : public ResourceModel { public: @@ -184,10 +183,14 @@ EntryBackup * RelativeResourceModel::removeEntry(const QModelIndex &index) } } // namespace Internal +} // namespace ResourceEditor + +using namespace ResourceEditor; +using namespace ResourceEditor::Internal; ResourceView::ResourceView(QUndoStack *history, QWidget *parent) : QTreeView(parent), - m_qrcModel(new Internal::RelativeResourceModel(m_qrcFile, this)), + m_qrcModel(new RelativeResourceModel(m_qrcFile, this)), m_history(history), m_mergeId(-1) { @@ -547,5 +550,3 @@ bool ResourceView::resourceDragEnabled() const { return m_qrcModel->resourceDragEnabled(); } - -} // namespace SharedTools diff --git a/src/plugins/resourceeditor/qrceditor/resourceview.h b/src/plugins/resourceeditor/qrceditor/resourceview.h index e737890e3b5..68ac557ee15 100644 --- a/src/plugins/resourceeditor/qrceditor/resourceview.h +++ b/src/plugins/resourceeditor/qrceditor/resourceview.h @@ -44,6 +44,7 @@ class QUndoStack; QT_END_NAMESPACE namespace ResourceEditor { +namespace Internal { /*! \class EntryBackup @@ -65,9 +66,7 @@ public: virtual ~EntryBackup() { } }; -namespace Internal { - class RelativeResourceModel; -} +class RelativeResourceModel; class ResourceView : public QTreeView { @@ -144,12 +143,13 @@ private: const QString &before, const QString &after); ResourceFile m_qrcFile; - Internal::RelativeResourceModel *m_qrcModel; + RelativeResourceModel *m_qrcModel; QUndoStack *m_history; int m_mergeId; }; -} // namespace SharedTools +} // namespace Internal +} // namespace ResourceEditor #endif // RESOURCEVIEW_H diff --git a/src/plugins/resourceeditor/qrceditor/undocommands.cpp b/src/plugins/resourceeditor/qrceditor/undocommands.cpp index 58bb2ed3399..fa21cec7de6 100644 --- a/src/plugins/resourceeditor/qrceditor/undocommands.cpp +++ b/src/plugins/resourceeditor/qrceditor/undocommands.cpp @@ -32,7 +32,8 @@ #include -namespace ResourceEditor { +using namespace ResourceEditor; +using namespace ResourceEditor::Internal; ViewCommand::ViewCommand(ResourceView *view) : m_view(view) @@ -183,5 +184,3 @@ void AddEmptyPrefixCommand::undo() m_prefixArrayIndex, 0, QModelIndex()); delete m_view->removeEntry(prefixModelIndex); } - -} // namespace SharedTools diff --git a/src/plugins/resourceeditor/qrceditor/undocommands_p.h b/src/plugins/resourceeditor/qrceditor/undocommands_p.h index e943b4f0fe2..66df5c43377 100644 --- a/src/plugins/resourceeditor/qrceditor/undocommands_p.h +++ b/src/plugins/resourceeditor/qrceditor/undocommands_p.h @@ -41,6 +41,7 @@ class QModelIndex; QT_END_NAMESPACE namespace ResourceEditor { +namespace Internal { /*! \class ViewCommand @@ -157,6 +158,7 @@ private: void undo(); }; -} // namespace SharedTools +} // namespace Internal +} // namespace ResourceEditor #endif // UNDO_COMMANDS_H diff --git a/src/plugins/resourceeditor/resourceeditorw.h b/src/plugins/resourceeditor/resourceeditorw.h index f863751e677..38b47b76dd8 100644 --- a/src/plugins/resourceeditor/resourceeditorw.h +++ b/src/plugins/resourceeditor/resourceeditorw.h @@ -42,13 +42,11 @@ class QToolBar; QT_END_NAMESPACE namespace ResourceEditor { - -class QrcEditor; - namespace Internal { class ResourceEditorPlugin; class ResourceEditorW; +class QrcEditor; class ResourceEditorDocument : public virtual Core::IDocument