All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
ef997f2259
commit
9fe130cd73
@@ -24,19 +24,19 @@
|
||||
#include <FCConfig.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif // HAVE_CONFIG_H
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4005)
|
||||
# pragma warning(disable : 4005)
|
||||
#endif
|
||||
|
||||
#include <QApplication>
|
||||
#include <QIcon>
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <windows.h>
|
||||
# include <windows.h>
|
||||
#elif defined(Q_WS_X11)
|
||||
#include <QX11EmbedWidget>
|
||||
# include <QX11EmbedWidget>
|
||||
#endif
|
||||
#include <thread>
|
||||
|
||||
@@ -94,8 +94,10 @@ LRESULT CALLBACK FilterProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
static PyObject* FreeCADGui_showMainWindow(PyObject* /*self*/, PyObject* args)
|
||||
{
|
||||
if (_isSetupWithoutGui) {
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"Cannot call showMainWindow() after calling setupWithoutGUI()\n");
|
||||
PyErr_SetString(
|
||||
PyExc_RuntimeError,
|
||||
"Cannot call showMainWindow() after calling setupWithoutGUI()\n"
|
||||
);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -137,8 +139,7 @@ static PyObject* FreeCADGui_showMainWindow(PyObject* /*self*/, PyObject* args)
|
||||
static char** argv = {nullptr};
|
||||
(void)new QApplication(argc, argv);
|
||||
#else
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"Must construct a QApplication before a QPaintDevice\n");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Must construct a QApplication before a QPaintDevice\n");
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
@@ -174,8 +175,7 @@ static PyObject* FreeCADGui_exec_loop(PyObject* /*self*/, PyObject* args)
|
||||
}
|
||||
|
||||
if (!qApp) {
|
||||
PyErr_SetString(PyExc_RuntimeError,
|
||||
"Must construct a QApplication before a QPaintDevice\n");
|
||||
PyErr_SetString(PyExc_RuntimeError, "Must construct a QApplication before a QPaintDevice\n");
|
||||
return nullptr;
|
||||
}
|
||||
else if (!qobject_cast<QApplication*>(qApp)) {
|
||||
@@ -310,7 +310,8 @@ static QWidget* setupMainWindow()
|
||||
QIcon icon = qApp->windowIcon();
|
||||
if (icon.isNull()) {
|
||||
qApp->setWindowIcon(
|
||||
Gui::BitmapFactory().pixmap(App::Application::Config()["AppIcon"].c_str()));
|
||||
Gui::BitmapFactory().pixmap(App::Application::Config()["AppIcon"].c_str())
|
||||
);
|
||||
}
|
||||
mw->setWindowIcon(qApp->windowIcon());
|
||||
|
||||
@@ -347,15 +348,17 @@ PyMOD_INIT_FUNC(FreeCADGui)
|
||||
if (Base::Type::fromName("Gui::BaseView").isBad()) {
|
||||
Gui::Application::initApplication();
|
||||
}
|
||||
static struct PyModuleDef FreeCADGuiModuleDef = {PyModuleDef_HEAD_INIT,
|
||||
"FreeCADGui",
|
||||
"FreeCAD GUI module\n",
|
||||
-1,
|
||||
FreeCADGui_methods,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr};
|
||||
static struct PyModuleDef FreeCADGuiModuleDef = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
"FreeCADGui",
|
||||
"FreeCAD GUI module\n",
|
||||
-1,
|
||||
FreeCADGui_methods,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr
|
||||
};
|
||||
PyObject* module = PyModule_Create(&FreeCADGuiModuleDef);
|
||||
return module;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user