diff --git a/cmake/modules/MacOSXBundleInfo.plist.in b/cmake/modules/MacOSXBundleInfo.plist.in
index b753d9e5e3..55a9df5522 100644
--- a/cmake/modules/MacOSXBundleInfo.plist.in
+++ b/cmake/modules/MacOSXBundleInfo.plist.in
@@ -36,5 +36,42 @@
SUPublicDSAKeyFile
dsa_pub.pem
+
+UTExportedTypeDeclarations
+
+
+ UTTypeIdentifier
+ @APPLICATION_REV_DOMAIN@.placeholder
+ UTTypeTagSpecification
+
+ public.filename-extension
+ @APPLICATION_PLACEHOLDER_SUFFIX@
+ public.mime-type
+ application/octet-stream
+
+ UTTypeConformsTo
+
+ public.data
+
+
+
+
+CFBundleDocumentTypes
+
+
+ CFBundleTypeName
+ @APPLICATION_EXECUTABLE@ Download Placeholder
+ CFBundleTypeRole
+ Editor
+ LSHandlerRank
+ Owner
+ LSItemContentTypes
+
+ @APPLICATION_REV_DOMAIN@.placeholder
+
+
+
+
+
diff --git a/src/gui/application.cpp b/src/gui/application.cpp
index 77bfaeef0c..8490547c0d 100644
--- a/src/gui/application.cpp
+++ b/src/gui/application.cpp
@@ -706,4 +706,18 @@ void Application::openPlaceholder(const QString &filename)
});
}
+bool Application::event(QEvent *event)
+{
+#ifdef Q_OS_MAC
+ if (event->type() == QEvent::FileOpen) {
+ QFileOpenEvent *openEvent = static_cast(event);
+ qCDebug(lcApplication) << "QFileOpenEvent" << openEvent->file();
+ // placeholder file, open it after the Folder were created (if the app is not terminated)
+ QString fn = openEvent->file();
+ QTimer::singleShot(0, this, [this, fn] { openPlaceholder(fn); });
+ }
+#endif
+ return SharedTools::QtSingleApplication::event(event);
+}
+
} // namespace OCC
diff --git a/src/gui/application.h b/src/gui/application.h
index d771c1422e..546dc809b9 100644
--- a/src/gui/application.h
+++ b/src/gui/application.h
@@ -83,6 +83,7 @@ protected:
void parseOptions(const QStringList &);
void setupTranslations();
void setupLogging();
+ bool event(QEvent *event);
signals:
void folderRemoved();