2525#include < QtCore/QUrlQuery>
2626#include < QtGui/QDesktopServices>
2727
28+ using namespace Qt ::StringLiterals;
29+
2830@implementation NSApplication (ApplicationObjC)
2931
3032- (void )appReopen : (NSAppleEventDescriptor *)event withReplyEvent : (NSAppleEventDescriptor *)replyEvent
@@ -96,7 +98,7 @@ - (void)openCrypto:(NSPasteboard *)pboard userData:(NSString *)data error:(NSStr
9698void Application::mailTo ( const QUrl &url )
9799{
98100 QUrlQuery q (url);
99- if (NSURL *appUrl = CFBridgingRelease ( LSCopyDefaultApplicationURLForURL ((__bridge CFURLRef) url.toNSURL (), kLSRolesAll , nil )) )
101+ if (NSURL *appUrl = [ NSWorkspace .sharedWorkspace URLForApplicationToOpenURL: url.toNSURL ()] )
100102 {
101103 QString p;
102104 QTextStream s ( &p );
@@ -112,24 +114,11 @@ - (void)openCrypto:(NSPasteboard *)pboard userData:(NSString *)data error:(NSStr
112114 << " end tell" << Qt::endl
113115 << " end run" << Qt::endl;
114116 }
115- else if ([appUrl.path rangeOfString: @" Entourage" ].location != NSNotFound )
116- {
117- s << " on run" << Qt::endl
118- << " set vattachment to \" " << q.queryItemValue (QStringLiteral (" attachment" )) << " \" " << Qt::endl
119- << " set vsubject to \" " << q.queryItemValue (QStringLiteral (" subject" )) << " \" " << Qt::endl
120- << " tell application \" Microsoft Entourage\" " << Qt::endl
121- << " set vmessage to make new outgoing message with properties" << Qt::endl
122- << " {subject:vsubject, attachments:vattachment}" << Qt::endl
123- << " open vmessage" << Qt::endl
124- << " activate" << Qt::endl
125- << " end tell" << Qt::endl
126- << " end run" << Qt::endl;
127- }
128117 else if ([appUrl.path rangeOfString: @" Outlook" ].location != NSNotFound )
129118 {
130119 s << " on run" << Qt::endl
131- << " set vattachment to \" " << q.queryItemValue (QStringLiteral ( " attachment" ) ) << " \" as POSIX file" << Qt::endl
132- << " set vsubject to \" " << q.queryItemValue (QStringLiteral ( " subject" ) ) << " \" " << Qt::endl
120+ << " set vattachment to \" " << q.queryItemValue (u " attachment" _s ) << " \" as POSIX file" << Qt::endl
121+ << " set vsubject to \" " << q.queryItemValue (u " subject" _s ) << " \" " << Qt::endl
133122 << " tell application \" Microsoft Outlook\" " << Qt::endl
134123 << " activate" << Qt::endl
135124 << " set vmessage to make new outgoing message with properties {subject:vsubject}" << Qt::endl
@@ -153,3 +142,10 @@ - (void)openCrypto:(NSPasteboard *)pboard userData:(NSString *)data error:(NSStr
153142 }
154143 QDesktopServices::openUrl ( url );
155144}
145+
146+ QString Application::groupContainerPath ()
147+ {
148+ return QString::fromNSString ([NSFileManager .defaultManager
149+ containerURLForSecurityApplicationGroupIdentifier: @" group.ee.ria.qdigidoc4.tsl" ].path );
150+ }
151+
0 commit comments