[TD]apply review comments

This commit is contained in:
wandererfan
2025-03-21 09:48:55 -04:00
parent 0884babb4d
commit a10e93befe
2 changed files with 2 additions and 6 deletions

View File

@@ -44,8 +44,6 @@
#include <Base/Vector3D.h>
#include <Base/VectorPy.h>
#include <Gui/Application.h>
#include <Mod/Import/App/dxf/ImpExpDxf.h>
#include <Mod/Part/App/OCCError.h>
#include <Mod/Part/App/TopoShape.h>
@@ -74,7 +72,6 @@
#include "GeometryObject.h"
#include "ProjectionAlgos.h"
#include "TechDrawExport.h"
#include "CosmeticVertexPy.h"
#include "DrawLeaderLinePy.h"
namespace TechDraw {

View File

@@ -1890,9 +1890,8 @@ std::string DrawUtil::cleanFilespecBackslash(const std::string& filespec)
//! returns true if the Gui module and its event loop are active.
bool DrawUtil::isGuiUp()
{
std::string pyCommand{"import FreeCAD\nguiState = FreeCAD.GuiUp"};
std::string result{Base::Interpreter().runStringWithKey(pyCommand.c_str(), "guiState", "None")};
return (result == "1");
auto* app = QCoreApplication::instance();
return (app != nullptr) && app->inherits("QApplication");
}