From 212f3ac46481ae7bea2d65c645019f72c409a048 Mon Sep 17 00:00:00 2001 From: sniperbeamer Date: Sun, 22 Mar 2009 21:23:43 +0000 Subject: [PATCH] Some fixes for Mac OS file opening git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@301 b624d157-de02-0410-bad0-e51aec6abb33 --- src/main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 738f14d..d0f9258 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -193,6 +193,7 @@ int main(int argc, char **argv) installTranslator(); #ifdef Q_WS_MAC + QApplication::processEvents(); if (args.file().isEmpty() && !eventListener->file().isEmpty()) { args.setFile(eventListener->file()); } @@ -301,10 +302,15 @@ bool EventListener::eventFilter(QObject*, QEvent* event){ #ifdef Q_WS_MAC if (event->type() == QEvent::FileOpen) { QString filename = static_cast(event)->file(); - if (pMainWindow) - pMainWindow->openFile(filename); - else + if (pMainWindow) { + if (QApplication::activeModalWidget() == NULL) + pMainWindow->openFile(filename); + else + return true; // ignore file open events while a modal dialog is displayed + } + else { pFile = filename; + } } #endif