Skip to content

Commit 4e27a5f

Browse files
authored
Merge pull request #286 from machinekoder/fixes1
Small set of fixes
2 parents 168b417 + 7f9820e commit 4e27a5f

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

src/application/plugin/plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ QString MachinekitApplicationPlugin::fileLocation() const
118118
bool MachinekitApplicationPlugin::isLoadedFromResource() const
119119
{
120120
// If one file is missing, it will load all the files from the resource
121-
QFile file(baseUrl().toLocalFile() + "/ApplicationCore.qml");
121+
QFile file(baseUrl().toLocalFile() + "/" + qmldir[0].type + ".qml");
122122
if (!file.exists())
123123
return true;
124124
return false;

src/applicationcontrols/plugin/plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ QString MachinekitApplicationControlsPlugin::fileLocation() const
151151
bool MachinekitApplicationControlsPlugin::isLoadedFromResource() const
152152
{
153153
// If one file is missing, it will load all the files from the resource
154-
QFile file(baseUrl().toLocalFile() + "/EstopAction.qml");
154+
QFile file(baseUrl().toLocalFile() + "/" + qmldir[0].type + ".qml");
155155
if (!file.exists())
156156
return true;
157157
return false;

src/controls/plugin/plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ QString MachinekitControlsPlugin::fileLocation() const
105105
bool MachinekitControlsPlugin::isLoadedFromResource() const
106106
{
107107
// If one file is missing, it will load all the files from the resource
108-
QFile file(baseUrl().toLocalFile() + "/ColorPicker.qml");
108+
QFile file(baseUrl().toLocalFile() + "/" + qmldir[0].type + ".qml");
109109
if (!file.exists())
110110
return true;
111111
return false;

src/halremotecontrols/plugin/plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ QString MachinekitHalRemoteControlsPlugin::fileLocation() const
9898
bool MachinekitHalRemoteControlsPlugin::isLoadedFromResource() const
9999
{
100100
// If one file is missing, it will load all the files from the resource
101-
QFile file(baseUrl().toLocalFile() + "/HalApplicationWindow.qml");
101+
QFile file(baseUrl().toLocalFile() + "/" + qmldir[0].type + ".qml");
102102
if (!file.exists())
103103
return true;
104104
return false;

src/pathview/glview.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,20 @@ void GLView::setupShaders()
554554
m_textSelectionModeLocation = m_textProgram->uniformLocation("selectionMode");
555555
}
556556

557-
void GLView::setupWindow()
557+
bool GLView::setupWindow()
558558
{
559+
if (!window()) {
560+
return false;
561+
}
559562
connect(window()->openglContext(), &QOpenGLContext::aboutToBeDestroyed,
560563
this, &GLView::cleanup, Qt::DirectConnection);
561564

562565
QSurfaceFormat format = window()->format();
563566
format.setDepthBufferSize(24);
564567
format.setSamples(4);
565568
window()->setFormat(format);
569+
570+
return true;
566571
}
567572

568573
void GLView::setupCylinder(GLfloat r2, QVector3D P2, GLfloat r1, QVector3D P1, int detail, ModelType type)
@@ -1637,9 +1642,11 @@ void GLView::sync()
16371642
{
16381643
if (!m_initialized)
16391644
{
1645+
if (setupWindow() == false) {
1646+
return;
1647+
}
16401648
initializeOpenGLFunctions();
16411649
setupShaders();
1642-
setupWindow();
16431650
setupVBOs();
16441651
setupStack();
16451652
m_initialized = true;

src/pathview/glview.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ private slots:
395395
void setupGenericVertexBuffer(ModelType type);
396396
void setupTextVertexBuffer();
397397
void setupShaders();
398-
void setupWindow();
398+
bool setupWindow();
399399
void setupCube();
400400
void setupCylinder(GLfloat originRadius, QVector3D originPoint, GLfloat endRadius, QVector3D endPoint, int detail, ModelType type);
401401
void setupSphere(int detail);

src/pathview/plugin/plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ QString MachinekitPathViewPlugin::fileLocation() const
121121
bool MachinekitPathViewPlugin::isLoadedFromResource() const
122122
{
123123
// If one file is missing, it will load all the files from the resource
124-
QFile file(baseUrl().toLocalFile() + "/PathView3D.qml");
124+
QFile file(baseUrl().toLocalFile() + "/" + qmldir[0].type + ".qml");
125125
if (!file.exists())
126126
return true;
127127
return false;

0 commit comments

Comments
 (0)