Skip to content

Commit 5cc8c01

Browse files
committed
Update svscraft
1 parent e9cd76b commit 5cc8c01

3 files changed

Lines changed: 3 additions & 27 deletions

File tree

‎src/plugins/coreplugin/windows/ProjectWindowInterface.cpp‎

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "ProjectWindowInterface.h"
22

33
#include <QAbstractItemModel>
4-
#include <QEventLoop>
54
#include <QFileDialog>
65
#include <QFileInfo>
76
#include <QJSValue>
@@ -38,21 +37,6 @@ namespace Core {
3837

3938
static ProjectWindowInterface *m_instance = nullptr;
4039

41-
class MessageBoxDialogDoneListener : public QObject {
42-
Q_OBJECT
43-
public:
44-
inline explicit MessageBoxDialogDoneListener(QEventLoop *eventLoop) : eventLoop(eventLoop) {
45-
}
46-
47-
public slots:
48-
void done(const QVariant &id) const {
49-
eventLoop->exit(id.toInt());
50-
}
51-
52-
private:
53-
QEventLoop *eventLoop;
54-
};
55-
5640
class ProjectWindowInterfacePrivate {
5741
Q_DECLARE_PUBLIC(ProjectWindowInterface)
5842
public:
@@ -141,12 +125,7 @@ namespace Core {
141125
{"icon", SVS::SVSCraft::Warning},
142126
{"transientParent", QVariant::fromValue(q->window())}}
143127
)));
144-
Q_ASSERT(mb);
145-
QEventLoop eventLoop;
146-
MessageBoxDialogDoneListener listener(&eventLoop);
147-
QObject::connect(mb.get(), SIGNAL(done(QVariant)), &listener, SLOT(done(QVariant)));
148-
mb->show();
149-
return static_cast<ExternalChangeOperation>(eventLoop.exec());
128+
return static_cast<ExternalChangeOperation>(SVS::MessageBox::customExec(mb.get()).toInt());
150129
}
151130
};
152131

‎src/plugins/maintenance/internal/addons/MaintenanceAddOn.cpp‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,7 @@ namespace Maintenance {
148148
{"content", QVariant::fromValue(textField.get())},
149149
{"transientParent", QVariant::fromValue(windowInterface->window())},
150150
}));
151-
QEventLoop eventLoop;
152-
connect(dialog.get(), SIGNAL(done(QVariant)), &eventLoop, SLOT(quit()));
153-
QMetaObject::invokeMethod(dialog.get(), "show");
154-
eventLoop.exec();
151+
SVS::MessageBox::customExec(dialog.get());
155152
}
156153

157154
}

0 commit comments

Comments
 (0)