mirror of
https://github.com/chenx-dust/EZ4Connect.git
synced 2026-09-20 10:23:33 +08:00
fix: a potential segment fault
This commit is contained in:
@@ -17,8 +17,10 @@ AuthInfoWindow::AuthInfoWindow(QWidget *parent)
|
||||
setWindowModality(Qt::WindowModal);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, [&]() {
|
||||
connect(this, &QDialog::accepted, [&]() {
|
||||
QListWidgetItem *selectedItem = ui->authInfoListWidget->currentItem();
|
||||
if (!selectedItem)
|
||||
return;
|
||||
emit finishAuthInfo(selectedItem->data(Qt::UserRole).toString(),
|
||||
selectedItem->data(Qt::UserRole + 1).toString(),
|
||||
selectedItem->data(Qt::UserRole + 2).toString());
|
||||
@@ -48,7 +50,7 @@ AuthInfoWindow::AuthInfoWindow(QWidget *parent)
|
||||
QString loginDomain = obj.value("loginDomain").toString();
|
||||
QString loginUrl = obj.value("loginUrl").toString();
|
||||
QListWidgetItem *item =
|
||||
new QListWidgetItem(QString("%1 - %2 - %3 - %4").arg(authName, authType, loginDomain, loginUrl));
|
||||
new QListWidgetItem(QString("%1 - %2 - %3 - %4").arg(authName, authType, loginDomain, loginUrl.isEmpty()? "无" : loginUrl));
|
||||
item->setData(Qt::UserRole, authType);
|
||||
item->setData(Qt::UserRole + 1, loginDomain);
|
||||
item->setData(Qt::UserRole + 2, loginUrl);
|
||||
|
||||
@@ -70,5 +70,21 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>authInfoListWidget</sender>
|
||||
<signal>itemDoubleClicked(QListWidgetItem*)</signal>
|
||||
<receiver>AuthInfoWindow</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>224</x>
|
||||
<y>116</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>224</x>
|
||||
<y>124</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
||||
@@ -10,7 +10,7 @@ ExtraSettingWindow::ExtraSettingWindow(QDialog *parent) :
|
||||
setWindowModality(Qt::WindowModal);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted,
|
||||
connect(this, &QDialog::accepted,
|
||||
[&]()
|
||||
{
|
||||
QStringList tcpPortForwardingList;
|
||||
|
||||
@@ -17,7 +17,7 @@ GraphCaptchaWindow::GraphCaptchaWindow(QWidget *parent) : QDialog(parent), ui(ne
|
||||
setWindowModality(Qt::WindowModal);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::accepted, [&]() {
|
||||
connect(this, &QDialog::accepted, [&]() {
|
||||
QJsonObject obj;
|
||||
QJsonArray points;
|
||||
for (auto &point : ui->canvas->pointsPx())
|
||||
@@ -34,7 +34,7 @@ GraphCaptchaWindow::GraphCaptchaWindow(QWidget *parent) : QDialog(parent), ui(ne
|
||||
emit finishCaptcha(docJson);
|
||||
});
|
||||
|
||||
connect(ui->buttonBox, &QDialogButtonBox::rejected, [&]() {
|
||||
connect(this, &QDialog::rejected, [&]() {
|
||||
emit finishCaptcha(QByteArray("{}"));
|
||||
});
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "ssologinwebview/ssologinwebview.h"
|
||||
#include "zjuconnectcontroller/zjuconnectcontroller.h"
|
||||
#include "settingwindow/settingwindow.h"
|
||||
#include "graphcaptchawindow/graphcaptchawindow.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef ZJUCONNECTCONTROLLER_H
|
||||
#define ZJUCONNECTCONTROLLER_H
|
||||
|
||||
#include "graphcaptchawindow/graphcaptchawindow.h"
|
||||
#include <QtCore>
|
||||
|
||||
enum class ZJU_ERROR
|
||||
|
||||
Reference in New Issue
Block a user