File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 <string >@VICINAE_BUNDLE_SHORT_VERSION@</string >
2323 <key >CFBundleVersion</key >
2424 <string >@VICINAE_BUNDLE_VERSION@</string >
25+ <key >CFBundleURLTypes</key >
26+ <array >
27+ <dict >
28+ <key >CFBundleTypeRole</key >
29+ <string >Viewer</string >
30+ <key >CFBundleURLName</key >
31+ <string >@VICINAE_BUNDLE_ID@.deeplink</string >
32+ <key >CFBundleURLSchemes</key >
33+ <array >
34+ <string >vicinae</string >
35+ <string >raycast</string >
36+ <string >com.raycast</string >
37+ </array >
38+ </dict >
39+ </array >
2540 <key >LSMinimumSystemVersion</key >
2641 <string >14.4</string >
2742 <key >LSApplicationCategoryType</key >
Original file line number Diff line number Diff line change 9494#include " server.hpp"
9595
9696#ifdef Q_OS_MACOS
97+ #include " ipc-command-handler.hpp"
9798#include " qml/macos-chrome-attached.hpp"
99+ #include < QFileOpenEvent>
100+ #endif
101+
102+ #ifdef Q_OS_MACOS
103+ class UrlSchemeOpenFilter : public QObject {
104+ public:
105+ UrlSchemeOpenFilter (ApplicationContext &ctx) : m_ctx(ctx) {}
106+
107+ protected:
108+ bool eventFilter (QObject *watched, QEvent *event) override {
109+ if (event->type () == QEvent::FileOpen) {
110+ const QUrl url = static_cast <QFileOpenEvent *>(event)->url ();
111+ if (Omnicast::APP_SCHEMES .contains (url.scheme ())) {
112+ IpcCommandHandler handler (m_ctx);
113+ if (auto res = handler.handleUrl (url); !res) {
114+ qWarning () << " Failed to handle deeplink" << url.toString () << " :" << res.error ();
115+ }
116+ return true ;
117+ }
118+ }
119+ return QObject::eventFilter (watched, event);
120+ }
121+
122+ private:
123+ ApplicationContext &m_ctx;
124+ };
98125#endif
99126
100127static void applyTextRenderingMode (const config::FontConfig &fontConfig) {
@@ -353,6 +380,11 @@ int startServer(const ServerLaunchOptions &launchOpts) {
353380
354381 commandServer.start (Omnicast::commandSocketPath ());
355382
383+ #ifdef Q_OS_MACOS
384+ UrlSchemeOpenFilter urlSchemeOpenFilter (ctx);
385+ qApp->installEventFilter (&urlSchemeOpenFilter);
386+ #endif
387+
356388 QObject::connect (
357389 ctx.services ->fileService ()->indexer (), &AbstractFileIndexer::scanStatusChanged,
358390 ctx.services ->toastService (),
You can’t perform that action at this time.
0 commit comments