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
This commit is contained in:
parent
2ffd4a6fba
commit
212f3ac464
|
@ -193,6 +193,7 @@ int main(int argc, char **argv)
|
||||||
installTranslator();
|
installTranslator();
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
|
QApplication::processEvents();
|
||||||
if (args.file().isEmpty() && !eventListener->file().isEmpty()) {
|
if (args.file().isEmpty() && !eventListener->file().isEmpty()) {
|
||||||
args.setFile(eventListener->file());
|
args.setFile(eventListener->file());
|
||||||
}
|
}
|
||||||
|
@ -301,11 +302,16 @@ bool EventListener::eventFilter(QObject*, QEvent* event){
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
if (event->type() == QEvent::FileOpen) {
|
if (event->type() == QEvent::FileOpen) {
|
||||||
QString filename = static_cast<QFileOpenEvent*>(event)->file();
|
QString filename = static_cast<QFileOpenEvent*>(event)->file();
|
||||||
if (pMainWindow)
|
if (pMainWindow) {
|
||||||
|
if (QApplication::activeModalWidget() == NULL)
|
||||||
pMainWindow->openFile(filename);
|
pMainWindow->openFile(filename);
|
||||||
else
|
else
|
||||||
|
return true; // ignore file open events while a modal dialog is displayed
|
||||||
|
}
|
||||||
|
else {
|
||||||
pFile = filename;
|
pFile = filename;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue