@@ -43,7 +43,6 @@ namespace Core {
4343 ProjectTimeline *projectTimeline;
4444 EditActionsHandlerRegistry *mainEditActionsHandlerRegistry;
4545 ProjectDocumentContext *projectDocumentContext;
46- QList<std::function<bool ()>> closeCallbacks;
4746
4847 void init () {
4948 Q_Q (ProjectWindowInterface);
@@ -188,11 +187,6 @@ namespace Core {
188187 return d->projectDocumentContext ->saveCopy (path);
189188 }
190189
191- void ProjectWindowInterface::addCloseCallback (const std::function<bool ()> &callback) {
192- Q_D (ProjectWindowInterface);
193- d->closeCallbacks .append (callback);
194- }
195-
196190 QWindow *ProjectWindowInterface::createWindow (QObject *parent) const {
197191 Q_D (const ProjectWindowInterface);
198192 QQmlComponent component (RuntimeInterface::qmlEngine (), " DiffScope.Core" , " ProjectWindow" );
@@ -220,25 +214,9 @@ namespace Core {
220214 path = tr (" Untitled" ) + " .dspx" ;
221215 }
222216 win->setFilePath (path);
223- win->installEventFilter (const_cast <ProjectWindowInterface *>(this ));
224217 return win;
225218 }
226219
227- bool ProjectWindowInterface::eventFilter (QObject *watched, QEvent *event) {
228- Q_D (ProjectWindowInterface);
229- if (watched == window ()) {
230- if (event->type () == QEvent::Close) {
231- for (const auto &callback : d->closeCallbacks ) {
232- if (!callback ()) {
233- event->ignore ();
234- return true ;
235- }
236- }
237- }
238- }
239- return ActionWindowInterfaceBase::eventFilter (watched, event);
240- }
241-
242220 ProjectWindowInterface::ProjectWindowInterface (ProjectDocumentContext *projectDocumentContext, QObject *parent) : ProjectWindowInterface(*new ProjectWindowInterfacePrivate, parent) {
243221 Q_D (ProjectWindowInterface);
244222 d->projectDocumentContext = projectDocumentContext;
0 commit comments