From e7bcb2c15e8affe6dfadc06180056db5c036658e Mon Sep 17 00:00:00 2001 From: Ladislav Michl Date: Sat, 26 Apr 2025 20:06:18 +0200 Subject: [PATCH] Gui: cleanup includes in *PyImp.cpp Sort includes and implicitely add missing ones. While there consistently explain where generated files some from. --- src/Gui/AxisOriginPyImp.cpp | 4 +++- src/Gui/CommandPyImp.cpp | 11 +++++----- src/Gui/DocumentPyImp.cpp | 15 ++++++------- src/Gui/LinkViewPyImp.cpp | 8 +++---- src/Gui/Navigation/NavigationStylePyImp.cpp | 3 +-- src/Gui/PythonWorkbenchPyImp.cpp | 4 +--- src/Gui/Selection/SelectionObjectPyImp.cpp | 4 +--- src/Gui/ViewProviderDocumentObjectPyImp.cpp | 6 ++---- src/Gui/ViewProviderExtensionPyImp.cpp | 5 ++--- src/Gui/ViewProviderGeometryObjectPyImp.cpp | 5 +---- src/Gui/ViewProviderLinkPyImp.cpp | 5 +---- src/Gui/ViewProviderPyImp.cpp | 24 ++++++++++----------- src/Gui/WorkbenchPyImp.cpp | 3 +-- 13 files changed, 40 insertions(+), 57 deletions(-) diff --git a/src/Gui/AxisOriginPyImp.cpp b/src/Gui/AxisOriginPyImp.cpp index 170c415eaa..151eeace44 100644 --- a/src/Gui/AxisOriginPyImp.cpp +++ b/src/Gui/AxisOriginPyImp.cpp @@ -24,9 +24,11 @@ #include #include +#include + +// generated out of AxisOrigin.pyi #include "AxisOriginPy.h" #include "AxisOriginPy.cpp" -#include using namespace Gui; diff --git a/src/Gui/CommandPyImp.cpp b/src/Gui/CommandPyImp.cpp index d2f5a4f2ce..c718871b01 100644 --- a/src/Gui/CommandPyImp.cpp +++ b/src/Gui/CommandPyImp.cpp @@ -26,19 +26,18 @@ #include -#include "Command.h" #include "Action.h" #include "Application.h" +#include "Command.h" #include "MainWindow.h" -#include "Selection.h" -#include "Window.h" #include "PythonWrapper.h" +#include "Selection.h" +#include "ShortcutManager.h" +#include "Window.h" -// inclusion of the generated files (generated out of CommandPy.pyi) +// generated out of Command.pyi #include "CommandPy.h" #include "CommandPy.cpp" -#include "ShortcutManager.h" - // returns a string which represents the object e.g. when printed in python std::string CommandPy::representation() const diff --git a/src/Gui/DocumentPyImp.cpp b/src/Gui/DocumentPyImp.cpp index a612e8723f..363f04693f 100644 --- a/src/Gui/DocumentPyImp.cpp +++ b/src/Gui/DocumentPyImp.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -30,19 +31,17 @@ #include "Application.h" #include "MergeDocuments.h" #include "MDIView.h" -#include "ViewProviderExtern.h" - -// inclusion of the generated files (generated out of DocumentPy.pyi) -#include "DocumentPy.h" -#include "DocumentPy.cpp" -#include #include "Tree.h" #include "ViewProviderDocumentObject.h" -#include "ViewProviderDocumentObjectPy.h" +#include "ViewProviderExtern.h" + +// generated out of Document.pyi +#include "DocumentPy.h" +#include "DocumentPy.cpp" + #include "ViewProviderPy.h" #include "ViewProviderDocumentObjectPy.h" - using namespace Gui; // returns a string which represent the object e.g. when printed in python diff --git a/src/Gui/LinkViewPyImp.cpp b/src/Gui/LinkViewPyImp.cpp index 8b783c8d78..710259b670 100644 --- a/src/Gui/LinkViewPyImp.cpp +++ b/src/Gui/LinkViewPyImp.cpp @@ -20,16 +20,16 @@ * * ****************************************************************************/ - -#include -#include #include #include +#include +#include +// generated out of LinkView.pyi #include "LinkViewPy.h" #include "LinkViewPy.cpp" -#include "ViewProviderDocumentObjectPy.h" +#include "ViewProviderDocumentObjectPy.h" using namespace Gui; diff --git a/src/Gui/Navigation/NavigationStylePyImp.cpp b/src/Gui/Navigation/NavigationStylePyImp.cpp index 16d58e6bfa..6cac515cb6 100644 --- a/src/Gui/Navigation/NavigationStylePyImp.cpp +++ b/src/Gui/Navigation/NavigationStylePyImp.cpp @@ -20,11 +20,10 @@ * * ***************************************************************************/ -// inclusion of the generated files (generated out of NavigationStylePy.pyi) +// generated out of NavigationStyle.pyi #include "Navigation/NavigationStylePy.h" #include "Navigation/NavigationStylePy.cpp" - using namespace Gui; /** @class NavigationStylePy diff --git a/src/Gui/PythonWorkbenchPyImp.cpp b/src/Gui/PythonWorkbenchPyImp.cpp index 3688fd4ec3..8835095f27 100644 --- a/src/Gui/PythonWorkbenchPyImp.cpp +++ b/src/Gui/PythonWorkbenchPyImp.cpp @@ -20,12 +20,10 @@ * * ***************************************************************************/ - -// inclusion of the generated files (generated out of PythonWorkbenchPy.pyi) +// generated out of PythonWorkbench.pyi #include "PythonWorkbenchPy.h" #include "PythonWorkbenchPy.cpp" - using namespace Gui; /** @class PythonWorkbenchPy diff --git a/src/Gui/Selection/SelectionObjectPyImp.cpp b/src/Gui/Selection/SelectionObjectPyImp.cpp index 4204203aff..9c099ac92d 100644 --- a/src/Gui/Selection/SelectionObjectPyImp.cpp +++ b/src/Gui/Selection/SelectionObjectPyImp.cpp @@ -29,12 +29,10 @@ #include "Selection.h" #include "SelectionObject.h" - -// inclusion of the generated files (generated out of SelectionObjectPy.xml) +// generated out of SelectionObject.pyi #include "Selection/SelectionObjectPy.h" #include "Selection/SelectionObjectPy.cpp" - using namespace Gui; // returns a string which represents the object e.g. when printed in python diff --git a/src/Gui/ViewProviderDocumentObjectPyImp.cpp b/src/Gui/ViewProviderDocumentObjectPyImp.cpp index a0a97f9afd..2cc115c5ee 100644 --- a/src/Gui/ViewProviderDocumentObjectPyImp.cpp +++ b/src/Gui/ViewProviderDocumentObjectPyImp.cpp @@ -20,18 +20,16 @@ * * ***************************************************************************/ - #include - #include + #include "Document.h" -// inclusion of the generated files (generated out of ViewProviderDocumentObjectPy.pyi) +// generated out of ViewProviderDocumentObject.pyi #include "ViewProviderDocumentObjectPy.h" #include "ViewProviderDocumentObjectPy.cpp" - using namespace Gui; // returns a string which represents the object e.g. when printed in python diff --git a/src/Gui/ViewProviderExtensionPyImp.cpp b/src/Gui/ViewProviderExtensionPyImp.cpp index bf89904b26..00319ab9c6 100644 --- a/src/Gui/ViewProviderExtensionPyImp.cpp +++ b/src/Gui/ViewProviderExtensionPyImp.cpp @@ -20,14 +20,13 @@ * * ***************************************************************************/ - #include +#include "ViewProviderDocumentObject.h" -// inclusion of the generated files (generated out of PropertyContainerPy.pyi) +// generated out of ViewProviderExtension.pyi #include "ViewProviderExtensionPy.h" #include "ViewProviderExtensionPy.cpp" -#include "ViewProviderDocumentObject.h" using namespace Gui; diff --git a/src/Gui/ViewProviderGeometryObjectPyImp.cpp b/src/Gui/ViewProviderGeometryObjectPyImp.cpp index d257c7331d..b5ae9d6e60 100644 --- a/src/Gui/ViewProviderGeometryObjectPyImp.cpp +++ b/src/Gui/ViewProviderGeometryObjectPyImp.cpp @@ -21,19 +21,16 @@ * * **************************************************************************/ - #include - #include #include #include +// generated out of ViewProviderGeometryObject.pyi #include "ViewProviderGeometryObjectPy.h" - #include "ViewProviderGeometryObjectPy.cpp" - using namespace Gui; // returns a string which represents the object e.g. when printed in python diff --git a/src/Gui/ViewProviderLinkPyImp.cpp b/src/Gui/ViewProviderLinkPyImp.cpp index 44b51d460f..42f34d3e24 100644 --- a/src/Gui/ViewProviderLinkPyImp.cpp +++ b/src/Gui/ViewProviderLinkPyImp.cpp @@ -20,17 +20,14 @@ * * ****************************************************************************/ - #include - #include -// inclusion of the generated files (generated out of ViewProviderLinkPy.pyi) +// generated out of ViewProviderLink.pyi #include "ViewProviderLinkPy.h" #include "ViewProviderLinkPy.cpp" - using namespace Gui; // returns a string which represents the object e.g. when printed in python diff --git a/src/Gui/ViewProviderPyImp.cpp b/src/Gui/ViewProviderPyImp.cpp index c6305789ea..6a5bf65572 100644 --- a/src/Gui/ViewProviderPyImp.cpp +++ b/src/Gui/ViewProviderPyImp.cpp @@ -20,7 +20,6 @@ * * ***************************************************************************/ - #include #include #include @@ -29,27 +28,26 @@ #include #include - -#include #include - -#include "PythonWrapper.h" -#include "SoFCDB.h" - -// inclusion of the generated files (generated out of ViewProviderPy.pyi) -#include -#include #include #include #include #include -#include #include -#include #include #include -#include +#include "PythonWrapper.h" +#include "SoFCDB.h" + +// generated out of ViewProvider.pyi +#include "ViewProviderPy.h" +#include "ViewProviderPy.cpp" + +#include +#include +#include +#include using namespace Gui; diff --git a/src/Gui/WorkbenchPyImp.cpp b/src/Gui/WorkbenchPyImp.cpp index cc1f927cc8..7e8c167fc6 100644 --- a/src/Gui/WorkbenchPyImp.cpp +++ b/src/Gui/WorkbenchPyImp.cpp @@ -20,11 +20,10 @@ * * ***************************************************************************/ - #include "Workbench.h" #include "WorkbenchManager.h" -// inclusion of the generated files (generated out of WorkbenchPy.xml) +// generated out of Workbench.pyi #include "WorkbenchPy.h" #include "WorkbenchPy.cpp"