forked from osmocom/wireshark
parent
a1e0c34c30
commit
4bb16383a3
|
@ -1245,7 +1245,7 @@ if(BUILD_wireshark OR BUILD_logwolf)
|
||||||
endif()
|
endif()
|
||||||
set(QT_FOUND ON)
|
set(QT_FOUND ON)
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
ws_find_package(Sparkle ENABLE_SPARKLE HAVE_SOFTWARE_UPDATE 1)
|
ws_find_package(Sparkle ENABLE_SPARKLE HAVE_SOFTWARE_UPDATE 2)
|
||||||
endif()
|
endif()
|
||||||
if(Qt${qtver}Multimedia_FOUND)
|
if(Qt${qtver}Multimedia_FOUND)
|
||||||
set(QT_MULTIMEDIA_LIB 1)
|
set(QT_MULTIMEDIA_LIB 1)
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
file(GLOB USR_LOCAL_HINT "/usr/local/Sparkle-[1-9]*/")
|
file(GLOB USR_LOCAL_HINT "/usr/local/Sparkle-[2-9]*/")
|
||||||
file(GLOB HOMEBREW_HINT "/usr/local/Caskroom/sparkle/[1-9]*/")
|
file(GLOB HOMEBREW_HINT "/usr/local/Caskroom/sparkle/[2-9]*/")
|
||||||
|
|
||||||
find_path(SPARKLE_INCLUDE_DIR Sparkle.h
|
find_path(SPARKLE_INCLUDE_DIR Sparkle.h
|
||||||
HINTS ${USR_LOCAL_HINT} ${HOMEBREW_HINT}
|
HINTS ${USR_LOCAL_HINT} ${HOMEBREW_HINT}
|
||||||
|
@ -33,6 +33,8 @@ if(_spustandardupdatercontroller_h)
|
||||||
set(SPARKLE_VERSION 2)
|
set(SPARKLE_VERSION 2)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
unset(_spustandardupdatercontroller_h CACHE)
|
||||||
|
|
||||||
find_package_handle_standard_args(Sparkle
|
find_package_handle_standard_args(Sparkle
|
||||||
REQUIRED_VARS SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY
|
REQUIRED_VARS SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY
|
||||||
VERSION_VAR SPARKLE_VERSION
|
VERSION_VAR SPARKLE_VERSION
|
||||||
|
|
|
@ -15,16 +15,10 @@
|
||||||
|
|
||||||
#import <Sparkle.h>
|
#import <Sparkle.h>
|
||||||
|
|
||||||
// XXX Is there a more reliable way to do this?
|
|
||||||
#ifdef SPUUserUpdateState_h
|
|
||||||
#define HAVE_SPARKLE_2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// https://sparkle-project.org/documentation/customization/
|
// https://sparkle-project.org/documentation/customization/
|
||||||
// Sparkle stores its state in ~/Library/Preferences/org.wireshark.Wireshark.plist.
|
// Sparkle stores its state in ~/Library/Preferences/org.wireshark.Wireshark.plist.
|
||||||
// You can check its log output via `log stream | grep -i sparkle`.
|
// You can check its log output via `log stream | grep -i sparkle`.
|
||||||
|
|
||||||
#ifdef HAVE_SPARKLE_2
|
|
||||||
// The Sparkle 1 UI provided a sharedUpdater singleton, which is deprecated
|
// The Sparkle 1 UI provided a sharedUpdater singleton, which is deprecated
|
||||||
// in Sparkle 2:
|
// in Sparkle 2:
|
||||||
// https://sparkle-project.org/documentation/upgrading/
|
// https://sparkle-project.org/documentation/upgrading/
|
||||||
|
@ -47,28 +41,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
#endif
|
|
||||||
|
|
||||||
void sparkle_software_update_init(const char *url, bool enabled, int interval)
|
void sparkle_software_update_init(const char *url, bool enabled, int interval)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SPARKLE_2
|
|
||||||
[[[SparkleBridge sharedStandardUpdaterController] updater] setAutomaticallyChecksForUpdates: enabled];
|
[[[SparkleBridge sharedStandardUpdaterController] updater] setAutomaticallyChecksForUpdates: enabled];
|
||||||
[[[SparkleBridge sharedStandardUpdaterController] updater] setUpdateCheckInterval: interval];
|
[[[SparkleBridge sharedStandardUpdaterController] updater] setUpdateCheckInterval: interval];
|
||||||
[[[SparkleBridge sharedStandardUpdaterController] updater] setFeedURL: [NSURL URLWithString: [[NSString alloc] initWithUTF8String: url] ]];
|
[[[SparkleBridge sharedStandardUpdaterController] updater] setFeedURL: [NSURL URLWithString: [[NSString alloc] initWithUTF8String: url] ]];
|
||||||
#else
|
|
||||||
[[SUUpdater sharedUpdater] setAutomaticallyChecksForUpdates: enabled];
|
|
||||||
[[SUUpdater sharedUpdater] setUpdateCheckInterval: interval];
|
|
||||||
[[SUUpdater sharedUpdater] setFeedURL: [NSURL URLWithString: [[NSString alloc] initWithUTF8String: url] ]];
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sparkle_software_update_check(void)
|
void sparkle_software_update_check(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SPARKLE_2
|
|
||||||
[[SparkleBridge sharedStandardUpdaterController] checkForUpdates: [[NSApplication sharedApplication] delegate]];
|
[[SparkleBridge sharedStandardUpdaterController] checkForUpdates: [[NSApplication sharedApplication] delegate]];
|
||||||
#else
|
|
||||||
[[SUUpdater sharedUpdater] checkForUpdates: [[NSApplication sharedApplication] delegate]];
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sparkle requires NSApplicationWillTerminateNotification in order to
|
// Sparkle requires NSApplicationWillTerminateNotification in order to
|
||||||
|
|
Loading…
Reference in New Issue