mirror of https://github.com/nextcloud/desktop
Placeholders: Support for macOS #6290
This commit is contained in:
parent
600b1a72c1
commit
8dcfd50a7d
|
@ -36,5 +36,42 @@
|
|||
<false/>
|
||||
<key>SUPublicDSAKeyFile</key>
|
||||
<string>dsa_pub.pem</string>
|
||||
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>@APPLICATION_REV_DOMAIN@.placeholder</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<string>@APPLICATION_PLACEHOLDER_SUFFIX@</string>
|
||||
<key>public.mime-type</key>
|
||||
<string>application/octet-stream</string>
|
||||
</dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>@APPLICATION_EXECUTABLE@ Download Placeholder</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Owner</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>@APPLICATION_REV_DOMAIN@.placeholder</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
|
@ -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<QFileOpenEvent *>(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
|
||||
|
|
|
@ -83,6 +83,7 @@ protected:
|
|||
void parseOptions(const QStringList &);
|
||||
void setupTranslations();
|
||||
void setupLogging();
|
||||
bool event(QEvent *event);
|
||||
|
||||
signals:
|
||||
void folderRemoved();
|
||||
|
|
Loading…
Reference in New Issue