Skip to content

Commit 0c865e7

Browse files
committed
fix(mac): silence deprecated LSSharedFileList warnings in setupFavLink
LSSharedFileList was deprecated in macOS 10.11 with no public replacement for adding items to the Finder sidebar. Wrap the best-effort call in QT_WARNING_DISABLE_DEPRECATED to keep behavior and drop the 4 warnings. Assisted-by: Claude Code:claude-opus-4-8 Signed-off-by: Camila Ayres <camila.ayres@nextcloud.com>
1 parent 97de8ff commit 0c865e7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/common/utility_mac.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
CFURLRef urlRef = CFURLCreateWithFileSystemPath(nullptr, folderCFStr, kCFURLPOSIXPathStyle, true);
3131
QScopeGuard freeUrl([urlRef]() { CFRelease(urlRef); });
3232

33+
// LSSharedFileList was deprecated in macOS 10.11 with no public replacement for
34+
// adding items to the Finder sidebar, so keep the best-effort call and silence the warning.
35+
QT_WARNING_PUSH
36+
QT_WARNING_DISABLE_DEPRECATED
3337
LSSharedFileListRef placesItems = LSSharedFileListCreate(nullptr, kLSSharedFileListFavoriteItems, nullptr);
3438
QScopeGuard freePlaces([placesItems]() { CFRelease(placesItems); });
3539

@@ -40,6 +44,7 @@
4044
CFRelease(item);
4145
}
4246
}
47+
QT_WARNING_POP
4348
}
4449

4550
bool Utility::hasSystemLaunchOnStartup(const QString &appName)

0 commit comments

Comments
 (0)