mirror of
https://github.com/FAUSheppy/speech-server-client-qt
synced 2025-12-06 00:41:35 +01:00
fix windows crash
This commit is contained in:
@@ -56,7 +56,11 @@ Settings::Settings(QWidget *parent) :
|
||||
}
|
||||
|
||||
void Settings::selectSettings(QSettings *selectedSettings){
|
||||
|
||||
|
||||
this->mySettings = selectedSettings;
|
||||
sc = new ServerConnection(this, mySettings);
|
||||
connect(sc->getNetworkManager(), SIGNAL(finished(QNetworkReply*)), this, SLOT(handleTestConnectionResult(QNetworkReply*)));
|
||||
|
||||
/* config options layout */
|
||||
auto cw = this->findChild<QWidget*>("centralwidget");
|
||||
@@ -98,8 +102,6 @@ void Settings::selectSettings(QSettings *selectedSettings){
|
||||
|
||||
void Settings::checkConfig(){
|
||||
saveSetting();
|
||||
ServerConnection *sc = new ServerConnection(this, mySettings);
|
||||
connect(sc->getNetworkManager(), SIGNAL(finished(QNetworkReply*)), this, SLOT(handleTestConnectionResult(QNetworkReply*)));
|
||||
sc->queryServerVersion();
|
||||
}
|
||||
|
||||
@@ -135,7 +137,9 @@ void Settings::handleTestConnectionResult(QNetworkReply* reply){
|
||||
|
||||
auto cw = this->findChild<QWidget*>("centralwidget");
|
||||
QGridLayout *layout = static_cast<QGridLayout*>(cw->layout());
|
||||
if(currentConfigCheckDisplay != nullptr){
|
||||
delete currentConfigCheckDisplay; //this removes it from the layout
|
||||
}
|
||||
currentConfigCheckDisplay = testResult;
|
||||
layout->addWidget(testResult, configOptions->length(), 1);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef SETTINGS_H
|
||||
#define SETTINGS_H
|
||||
|
||||
#include "serverconnection.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QLineEdit>
|
||||
#include <QSettings>
|
||||
@@ -26,6 +28,7 @@ private slots:
|
||||
void checkConfig();
|
||||
void handleTestConnectionResult(QNetworkReply *reply);
|
||||
private:
|
||||
ServerConnection *sc;
|
||||
Ui::settings *ui;
|
||||
QSettings *mySettings;
|
||||
QHash<QString, QLineEdit*> *configLineEditMap;
|
||||
|
||||
Reference in New Issue
Block a user