From 3213e12ce7411efd05a544645aaa1ecd74e533a2 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 15 Jul 2019 12:50:29 +0200 Subject: [PATCH] rename PythonEditor plugin to Python The plugin does not only contain a pure editor, but all kind of support for a programming language like project and run support. Change-Id: I1251367c8db2e7a54986415ffc5b860cb210de3c Reviewed-by: Christian Stenger --- .../wizards/classes/python/wizard.json | 2 +- .../wizards/files/python/wizard.json | 2 +- .../qtforpythonapplication/empty/wizard.json | 2 +- .../mainwindow/wizard.json | 2 +- src/plugins/CMakeLists.txt | 2 +- src/plugins/plugins.pro | 2 +- src/plugins/plugins.qbs | 2 +- .../{pythoneditor => python}/CMakeLists.txt | 6 ++--- .../Python.json.in} | 4 ++-- .../pythoneditor.pro => python/python.pro} | 8 +++---- .../pythoneditor.qbs => python/python.qbs} | 6 ++--- .../python_dependencies.pri} | 2 +- .../pythonconstants.h} | 4 ++-- .../{pythoneditor => python}/pythoneditor.cpp | 8 +++---- .../{pythoneditor => python}/pythoneditor.h | 4 ++-- .../pythonformattoken.h | 4 ++-- .../pythonhighlighter.cpp | 4 ++-- .../pythonhighlighter.h | 4 ++-- .../pythonindenter.cpp | 4 ++-- .../{pythoneditor => python}/pythonindenter.h | 4 ++-- .../pythonplugin.cpp} | 24 +++++++++---------- .../pythonplugin.h} | 14 +++++------ .../pythonscanner.cpp | 8 +++---- .../{pythoneditor => python}/pythonscanner.h | 4 ++-- 24 files changed, 63 insertions(+), 63 deletions(-) rename src/plugins/{pythoneditor => python}/CMakeLists.txt (71%) rename src/plugins/{pythoneditor/PythonEditor.json.in => python/Python.json.in} (92%) rename src/plugins/{pythoneditor/pythoneditor.pro => python/python.pro} (72%) rename src/plugins/{pythoneditor/pythoneditor.qbs => python/python.qbs} (81%) rename src/plugins/{pythoneditor/pythoneditor_dependencies.pri => python/python_dependencies.pri} (82%) rename src/plugins/{pythoneditor/pythoneditorconstants.h => python/pythonconstants.h} (96%) rename src/plugins/{pythoneditor => python}/pythoneditor.cpp (95%) rename src/plugins/{pythoneditor => python}/pythoneditor.h (96%) rename src/plugins/{pythoneditor => python}/pythonformattoken.h (97%) rename src/plugins/{pythoneditor => python}/pythonhighlighter.cpp (99%) rename src/plugins/{pythoneditor => python}/pythonhighlighter.h (96%) rename src/plugins/{pythoneditor => python}/pythonindenter.cpp (98%) rename src/plugins/{pythoneditor => python}/pythonindenter.h (97%) rename src/plugins/{pythoneditor/pythoneditorplugin.cpp => python/pythonplugin.cpp} (98%) rename src/plugins/{pythoneditor/pythoneditorplugin.h => python/pythonplugin.h} (85%) rename src/plugins/{pythoneditor => python}/pythonscanner.cpp (98%) rename src/plugins/{pythoneditor => python}/pythonscanner.h (98%) diff --git a/share/qtcreator/templates/wizards/classes/python/wizard.json b/share/qtcreator/templates/wizards/classes/python/wizard.json index 233a8bac7a0..552c3f15a0e 100644 --- a/share/qtcreator/templates/wizards/classes/python/wizard.json +++ b/share/qtcreator/templates/wizards/classes/python/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Python Class", "trDisplayCategory": "Python", "icon": "../../files/python/icon.png", - "enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}", "options": [ diff --git a/share/qtcreator/templates/wizards/files/python/wizard.json b/share/qtcreator/templates/wizards/files/python/wizard.json index 262de2d37b1..f3bff037b51 100644 --- a/share/qtcreator/templates/wizards/files/python/wizard.json +++ b/share/qtcreator/templates/wizards/files/python/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Python File", "trDisplayCategory": "Python", "icon": "icon.png", - "enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}", "pages" : [ diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json index 6d734cb0e88..87cc5c0979c 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/empty/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Qt for Python - Empty", "trDisplayCategory": "Application", "icon": "icon.png", - "enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}", "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], "options": diff --git a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json index c8e397d0d82..eedad020e33 100644 --- a/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtforpythonapplication/mainwindow/wizard.json @@ -7,7 +7,7 @@ "trDisplayName": "Qt for Python - Window", "trDisplayCategory": "Application", "icon": "icon.png", - "enabled": "%{JS: value('Plugins').indexOf('PythonEditor') >= 0}", + "enabled": "%{JS: value('Plugins').indexOf('Python') >= 0}", "featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.6" ], "options": diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index 883151c6783..d13ad4adf23 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -52,7 +52,7 @@ add_subdirectory(genericprojectmanager) add_subdirectory(git) add_subdirectory(mercurial) add_subdirectory(perforce) -add_subdirectory(pythoneditor) +add_subdirectory(python) add_subdirectory(qmakeprojectmanager) add_subdirectory(qmljstools) add_subdirectory(qmlprojectmanager) diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 4b9538565eb..ac347f14da3 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -34,7 +34,7 @@ SUBDIRS = \ qmljseditor \ qmlprojectmanager \ glsleditor \ - pythoneditor \ + python \ nim \ mercurial \ bazaar \ diff --git a/src/plugins/plugins.qbs b/src/plugins/plugins.qbs index 3408bd4d16a..d2adbb64492 100644 --- a/src/plugins/plugins.qbs +++ b/src/plugins/plugins.qbs @@ -52,7 +52,7 @@ Project { "perfprofiler/perfprofiler.qbs", "projectexplorer/projectexplorer.qbs", "qbsprojectmanager/qbsprojectmanager.qbs", - "pythoneditor/pythoneditor.qbs", + "python/python.qbs", "qmldesigner/qmldesigner.qbs", "qmljseditor/qmljseditor.qbs", "qmljstools/qmljstools.qbs", diff --git a/src/plugins/pythoneditor/CMakeLists.txt b/src/plugins/python/CMakeLists.txt similarity index 71% rename from src/plugins/pythoneditor/CMakeLists.txt rename to src/plugins/python/CMakeLists.txt index 1f0022ca156..4036e919b38 100644 --- a/src/plugins/pythoneditor/CMakeLists.txt +++ b/src/plugins/python/CMakeLists.txt @@ -1,9 +1,9 @@ -add_qtc_plugin(PythonEditor +add_qtc_plugin(Python PLUGIN_DEPENDS Core QtSupport ProjectExplorer TextEditor SOURCES pythoneditor.cpp pythoneditor.h - pythoneditorconstants.h - pythoneditorplugin.cpp pythoneditorplugin.h + pythonconstants.h + pythonplugin.cpp pythonplugin.h pythonformattoken.h pythonhighlighter.cpp pythonhighlighter.h pythonindenter.cpp pythonindenter.h diff --git a/src/plugins/pythoneditor/PythonEditor.json.in b/src/plugins/python/Python.json.in similarity index 92% rename from src/plugins/pythoneditor/PythonEditor.json.in rename to src/plugins/python/Python.json.in index 89269328b3d..b74b0e48633 100644 --- a/src/plugins/pythoneditor/PythonEditor.json.in +++ b/src/plugins/python/Python.json.in @@ -1,5 +1,5 @@ { - \"Name\" : \"PythonEditor\", + \"Name\" : \"Python\", \"Version\" : \"$$QTCREATOR_VERSION\", \"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\", \"Vendor\" : \"The Qt Company Ltd\", @@ -13,7 +13,7 @@ \"Alternatively, this plugin may be used under the terms of the GNU General Public License version 3 as published by the Free Software Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT included in the packaging of this plugin. Please review the following information to ensure the GNU General Public License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html.\" ], \"Category\" : \"Other Languages\", - \"Description\" : \"Editor and file creation wizards for Python. Example plugin for QtCreator API demonstration.\", + \"Description\" : \"Plugin for supporting the Python language.\", \"Url\" : \"http://www.qt.io\", $$dependencyList, diff --git a/src/plugins/pythoneditor/pythoneditor.pro b/src/plugins/python/python.pro similarity index 72% rename from src/plugins/pythoneditor/pythoneditor.pro rename to src/plugins/python/python.pro index ba8fee64648..8e2b9c3d821 100644 --- a/src/plugins/pythoneditor/pythoneditor.pro +++ b/src/plugins/python/python.pro @@ -1,19 +1,19 @@ include(../../qtcreatorplugin.pri) DEFINES += \ - PYTHONEDITOR_LIBRARY + PYTHON_LIBRARY HEADERS += \ - pythoneditorplugin.h \ + pythonplugin.h \ pythoneditor.h \ - pythoneditorconstants.h \ + pythonconstants.h \ pythonhighlighter.h \ pythonindenter.h \ pythonformattoken.h \ pythonscanner.h \ SOURCES += \ - pythoneditorplugin.cpp \ + pythonplugin.cpp \ pythoneditor.cpp \ pythonhighlighter.cpp \ pythonindenter.cpp \ diff --git a/src/plugins/pythoneditor/pythoneditor.qbs b/src/plugins/python/python.qbs similarity index 81% rename from src/plugins/pythoneditor/pythoneditor.qbs rename to src/plugins/python/python.qbs index e6b36ae262c..d04b0dac437 100644 --- a/src/plugins/pythoneditor/pythoneditor.qbs +++ b/src/plugins/python/python.qbs @@ -1,7 +1,7 @@ import qbs 1.0 QtcPlugin { - name: "PythonEditor" + name: "Python" Depends { name: "Qt.widgets" } Depends { name: "Utils" } @@ -15,8 +15,8 @@ QtcPlugin { name: "General" files: [ "pythoneditor.cpp", "pythoneditor.h", - "pythoneditorconstants.h", - "pythoneditorplugin.cpp", "pythoneditorplugin.h", + "pythonconstants.h", + "pythonplugin.cpp", "pythonplugin.h", "pythonhighlighter.h", "pythonhighlighter.cpp", "pythonindenter.cpp", "pythonindenter.h", "pythonformattoken.h", diff --git a/src/plugins/pythoneditor/pythoneditor_dependencies.pri b/src/plugins/python/python_dependencies.pri similarity index 82% rename from src/plugins/pythoneditor/pythoneditor_dependencies.pri rename to src/plugins/python/python_dependencies.pri index 81fbcab5818..8ca62c74e76 100644 --- a/src/plugins/pythoneditor/pythoneditor_dependencies.pri +++ b/src/plugins/python/python_dependencies.pri @@ -1,4 +1,4 @@ -QTC_PLUGIN_NAME = PythonEditor +QTC_PLUGIN_NAME = Python QTC_LIB_DEPENDS += \ extensionsystem \ utils diff --git a/src/plugins/pythoneditor/pythoneditorconstants.h b/src/plugins/python/pythonconstants.h similarity index 96% rename from src/plugins/pythoneditor/pythoneditorconstants.h rename to src/plugins/python/pythonconstants.h index a84281aaa5a..fbea15eed49 100644 --- a/src/plugins/pythoneditor/pythoneditorconstants.h +++ b/src/plugins/python/pythonconstants.h @@ -27,7 +27,7 @@ #include -namespace PythonEditor { +namespace Python { namespace Constants { const char C_PYTHONEDITOR_ID[] = "PythonEditor.PythonEditor"; @@ -41,4 +41,4 @@ const char C_PY_MIMETYPE[] = "text/x-python"; const char C_PY_MIME_ICON[] = "text-x-python"; } // namespace Constants -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythoneditor.cpp b/src/plugins/python/pythoneditor.cpp similarity index 95% rename from src/plugins/pythoneditor/pythoneditor.cpp rename to src/plugins/python/pythoneditor.cpp index d0f27ae63c2..145e88e1371 100644 --- a/src/plugins/pythoneditor/pythoneditor.cpp +++ b/src/plugins/python/pythoneditor.cpp @@ -24,8 +24,8 @@ ****************************************************************************/ #include "pythoneditor.h" -#include "pythoneditorconstants.h" -#include "pythoneditorplugin.h" +#include "pythonconstants.h" +#include "pythonplugin.h" #include "pythonindenter.h" #include "pythonhighlighter.h" @@ -39,7 +39,7 @@ using namespace TextEditor; -namespace PythonEditor { +namespace Python { namespace Internal { PythonEditorFactory::PythonEditorFactory() @@ -62,4 +62,4 @@ PythonEditorFactory::PythonEditorFactory() } } // namespace Internal -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythoneditor.h b/src/plugins/python/pythoneditor.h similarity index 96% rename from src/plugins/pythoneditor/pythoneditor.h rename to src/plugins/python/pythoneditor.h index 96bcc8c03b0..7224008bd0d 100644 --- a/src/plugins/pythoneditor/pythoneditor.h +++ b/src/plugins/python/pythoneditor.h @@ -27,7 +27,7 @@ #include -namespace PythonEditor { +namespace Python { namespace Internal { class PythonEditorFactory : public TextEditor::TextEditorFactory @@ -37,4 +37,4 @@ public: }; } // namespace Internal -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythonformattoken.h b/src/plugins/python/pythonformattoken.h similarity index 97% rename from src/plugins/pythoneditor/pythonformattoken.h rename to src/plugins/python/pythonformattoken.h index c98f3a1fefa..8a7465d769c 100644 --- a/src/plugins/pythoneditor/pythonformattoken.h +++ b/src/plugins/python/pythonformattoken.h @@ -25,7 +25,7 @@ #pragma once -namespace PythonEditor { +namespace Python { namespace Internal { enum Format { @@ -68,4 +68,4 @@ private: }; } // namespace Internal -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythonhighlighter.cpp b/src/plugins/python/pythonhighlighter.cpp similarity index 99% rename from src/plugins/pythoneditor/pythonhighlighter.cpp rename to src/plugins/python/pythonhighlighter.cpp index b485c2a450e..c809e25b844 100644 --- a/src/plugins/pythoneditor/pythonhighlighter.cpp +++ b/src/plugins/python/pythonhighlighter.cpp @@ -41,7 +41,7 @@ #include #include -namespace PythonEditor { +namespace Python { namespace Internal { /** @@ -198,4 +198,4 @@ void PythonHighlighter::highlightImport(Scanner &scanner) } } // namespace Internal -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythonhighlighter.h b/src/plugins/python/pythonhighlighter.h similarity index 96% rename from src/plugins/pythoneditor/pythonhighlighter.h rename to src/plugins/python/pythonhighlighter.h index 63c35dfaf34..3c798d82d0a 100644 --- a/src/plugins/pythoneditor/pythonhighlighter.h +++ b/src/plugins/python/pythonhighlighter.h @@ -27,7 +27,7 @@ #include -namespace PythonEditor { +namespace Python { namespace Internal { class Scanner; @@ -47,4 +47,4 @@ private: }; } // namespace Internal -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythonindenter.cpp b/src/plugins/python/pythonindenter.cpp similarity index 98% rename from src/plugins/pythoneditor/pythonindenter.cpp rename to src/plugins/python/pythonindenter.cpp index a6fb880dcdc..dff38907ee8 100644 --- a/src/plugins/pythoneditor/pythonindenter.cpp +++ b/src/plugins/python/pythonindenter.cpp @@ -30,7 +30,7 @@ #include -namespace PythonEditor { +namespace Python { static bool isEmptyLine(const QString &t) { @@ -124,4 +124,4 @@ int PythonIndenter::getIndentDiff(const QString &previousLine, return 0; } -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythonindenter.h b/src/plugins/python/pythonindenter.h similarity index 97% rename from src/plugins/pythoneditor/pythonindenter.h rename to src/plugins/python/pythonindenter.h index ff9378e007d..243e6f178c1 100644 --- a/src/plugins/pythoneditor/pythonindenter.h +++ b/src/plugins/python/pythonindenter.h @@ -27,7 +27,7 @@ #include -namespace PythonEditor { +namespace Python { class PythonIndenter : public TextEditor::TextIndenter { @@ -44,4 +44,4 @@ private: const TextEditor::TabSettings &tabSettings) const; }; -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/python/pythonplugin.cpp similarity index 98% rename from src/plugins/pythoneditor/pythoneditorplugin.cpp rename to src/plugins/python/pythonplugin.cpp index 00f5639eb86..97b0a7442c8 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/python/pythonplugin.cpp @@ -23,9 +23,9 @@ ** ****************************************************************************/ -#include "pythoneditorplugin.h" +#include "pythonplugin.h" #include "pythoneditor.h" -#include "pythoneditorconstants.h" +#include "pythonconstants.h" #include "pythonhighlighter.h" #include @@ -69,10 +69,10 @@ using namespace Core; using namespace ProjectExplorer; -using namespace PythonEditor::Constants; +using namespace Python::Constants; using namespace Utils; -namespace PythonEditor { +namespace Python { namespace Internal { const char PythonMimeType[] = "text/x-python-project"; // ### FIXME @@ -711,11 +711,11 @@ bool PythonProjectNode::renameFile(const QString &filePath, const QString &newFi //////////////////////////////////////////////////////////////////////////////////// // -// PythonEditorPlugin +// PythonPlugin // //////////////////////////////////////////////////////////////////////////////////// -class PythonEditorPluginPrivate +class PythonPluginPrivate { public: PythonEditorFactory editorFactory; @@ -723,24 +723,24 @@ public: SimpleRunWorkerFactory runWorkerFactory; }; -PythonEditorPlugin::~PythonEditorPlugin() +PythonPlugin::~PythonPlugin() { delete d; } -bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage) +bool PythonPlugin::initialize(const QStringList &arguments, QString *errorMessage) { Q_UNUSED(arguments) Q_UNUSED(errorMessage) - d = new PythonEditorPluginPrivate; + d = new PythonPluginPrivate; ProjectManager::registerProjectType(PythonMimeType); return true; } -void PythonEditorPlugin::extensionsInitialized() +void PythonPlugin::extensionsInitialized() { // Add MIME overlay icons (these icons displayed at Project dock panel) QString imageFile = creatorTheme()->imageFile(Theme::IconOverlayPro, @@ -751,6 +751,6 @@ void PythonEditorPlugin::extensionsInitialized() } } // namespace Internal -} // namespace PythonEditor +} // namespace Python -#include "pythoneditorplugin.moc" +#include "pythonplugin.moc" diff --git a/src/plugins/pythoneditor/pythoneditorplugin.h b/src/plugins/python/pythonplugin.h similarity index 85% rename from src/plugins/pythoneditor/pythoneditorplugin.h rename to src/plugins/python/pythonplugin.h index d5b9f05acc0..5b2e395d917 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.h +++ b/src/plugins/python/pythonplugin.h @@ -27,24 +27,24 @@ #include -namespace PythonEditor { +namespace Python { namespace Internal { -class PythonEditorPlugin : public ExtensionSystem::IPlugin +class PythonPlugin : public ExtensionSystem::IPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "PythonEditor.json") + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Python.json") public: - PythonEditorPlugin() = default; - ~PythonEditorPlugin() final; + PythonPlugin() = default; + ~PythonPlugin() final; private: bool initialize(const QStringList &arguments, QString *errorMessage) final; void extensionsInitialized() final; - class PythonEditorPluginPrivate *d = nullptr; + class PythonPluginPrivate *d = nullptr; }; } // namespace Internal -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythonscanner.cpp b/src/plugins/python/pythonscanner.cpp similarity index 98% rename from src/plugins/pythoneditor/pythonscanner.cpp rename to src/plugins/python/pythonscanner.cpp index 9e80f30e6f7..abb6251e156 100644 --- a/src/plugins/pythoneditor/pythonscanner.cpp +++ b/src/plugins/python/pythonscanner.cpp @@ -25,10 +25,10 @@ #include "pythonscanner.h" -#include "pythoneditorconstants.h" -#include "pythoneditorplugin.h" +#include "pythonconstants.h" +#include "pythonplugin.h" -namespace PythonEditor { +namespace Python { namespace Internal { Scanner::Scanner(const QChar *text, const int length) @@ -389,4 +389,4 @@ void Scanner::parseState(State &state, QChar &savedData) const } } // namespace Internal -} // namespace PythonEditor +} // namespace Python diff --git a/src/plugins/pythoneditor/pythonscanner.h b/src/plugins/python/pythonscanner.h similarity index 98% rename from src/plugins/pythoneditor/pythonscanner.h rename to src/plugins/python/pythonscanner.h index c6844097de3..5d37f3ba11c 100644 --- a/src/plugins/pythoneditor/pythonscanner.h +++ b/src/plugins/python/pythonscanner.h @@ -29,7 +29,7 @@ #include -namespace PythonEditor { +namespace Python { namespace Internal { /** @@ -95,4 +95,4 @@ private: }; } // namespace Internal -} // namespace PythonEditor +} // namespace Python