feat: register as zip/mrpack handler on macOS

Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
This commit is contained in:
Ryan Cao 2022-10-22 20:51:46 +08:00
parent 7a8c963722
commit a406aeb3ea
No known key found for this signature in database
2 changed files with 30 additions and 0 deletions

View File

@ -44,5 +44,28 @@
<string>${MACOSX_SPARKLE_UPDATE_PUBLIC_KEY}</string> <string>${MACOSX_SPARKLE_UPDATE_PUBLIC_KEY}</string>
<key>SUFeedURL</key> <key>SUFeedURL</key>
<string>${MACOSX_SPARKLE_UPDATE_FEED_URL}</string> <string>${MACOSX_SPARKLE_UPDATE_FEED_URL}</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>zip</string>
<string>mrpack</string>
</array>
<key>CFBundleTypeName</key>
<string>Prism Launcher instance</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
<string>TUTX</string>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
</dict>
</array>
</dict> </dict>
</plist> </plist>

View File

@ -943,6 +943,13 @@ bool Application::event(QEvent* event) {
emit clickedOnDock(); emit clickedOnDock();
} }
m_prevAppState = ev->applicationState(); m_prevAppState = ev->applicationState();
return true;
}
if (event->type() == QEvent::FileOpen) {
auto ev = static_cast<QFileOpenEvent*>(event);
m_mainWindow->droppedURLs({ ev->url() });
return true;
} }
#endif #endif
return QApplication::event(event); return QApplication::event(event);