亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

運行最新版本時沒有“最新”消息?

運行最新版本時沒有“最新”消息?

Go
拉莫斯之舞 2023-05-15 15:03:08
我正在嘗試將Sparkle與 Qt(Go 綁定)應用程序結合使用。閃閃發光.m:#import <Headers/SUUpdater.h>static SUUpdater* updater = nil;void sparkle_checkUpdates(){    if (!updater) {        updater = [[SUUpdater sharedUpdater] retain];    }    [updater setUpdateCheckInterval:3600];    [updater checkForUpdatesInBackground];}火花.去:// +build darwin windowspackage main/*#cgo CFLAGS: -I ${SRCDIR}/Sparkle.framework#cgo LDFLAGS: -F ${SRCDIR} -framework Sparklevoid sparkle_checkUpdates();*/import "C"func sparkle_checkUpdates() {    C.sparkle_checkUpdates()}在 中main.go,我添加了一個菜單來調用該函數:package mainimport (    "github.com/therecipe/qt/widgets")func main() {    action := widgets.NewQMenuBar(nil).AddMenu2("").AddAction("Check for Updates...")    // http://doc.qt.io/qt-5/qaction.html#MenuRole-enum    action.SetMenuRole(widgets.QAction__ApplicationSpecificRole)    action.ConnectTriggered(func(bool) { sparkle_checkUpdates() })}有更新時它工作正常:下載、提取、安裝、重新啟動……但是當運行最新版本時,單擊“檢查更新……”菜單沒有任何反應。沒有彈出窗口說我們是最新的,像這樣:在控制臺中,我只看到這個:[3 <private> stream, pid: 90977, url: https://example.com/appcast.xml, traffic class: 200, tls] cancelled    [3.1 70A1F65B-7E7A-4ED2-AB8B-A21621ED7658 <private>.58040<-><private>]    Connected Path: satisfied (Path is satisfied), interface: en0, ipv4, dns    Duration: 0.497s, DNS @0.000s took 0.001s, TCP @0.003s took 0.051s, TLS took 0.113s    bytes in/out: 4481/675, packets in/out: 6/3, rtt: 0.053s, retransmitted packets: 0, out-of-order packets: 0應用廣播.xml:<?xml version="1.0" standalone="yes"?><rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">  <channel>    <title>Premium VPN</title>    <item>      <title>1.0.0.2905</title>      <pubDate>Tue, 11 Dec 2018 11:09:10 +0800</pubDate>      <sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>      <enclosure url="https://example.com/x.zip" sparkle:version="1.0.0.2905" sparkle:shortVersionString="1.0.0.2905" sparkle:edSignature="x" length="104408678" type="application/octet-stream"/>    </item>  </channel></rss>我錯過了什么?
查看完整描述

1 回答

?
慕絲7291255

TA貢獻1859條經驗 獲得超6個贊

仔細看checkForUpdatesInBackground

/*!

?Checks for updates, but does not display any UI unless an update is found.


?This is meant for programmatically initating a check for updates. That is,

?it will display no UI unless it actually finds an update, in which case it

?proceeds as usual.


?If automatic downloading of updates it turned on and allowed, however,

?this will invoke that behavior, and if an update is found, it will be downloaded

?in the background silently and will be prepped for installation.


?This will not find updates that the user has opted into skipping.

?*/

- (void)checkForUpdatesInBackground;

因此,使用此方法,只有在找到更新時才會顯示 UI。

我想要的是checkForUpdates

/*!

?Explicitly checks for updates and displays a progress dialog while doing so.


?This method is meant for a main menu item.

?Connect any menu item to this action in Interface Builder,

?and Sparkle will check for updates and report back its findings verbosely

?when it is invoked.


?This will find updates that the user has opted into skipping.

?*/

?- (IBAction)checkForUpdates:(id)sender;

http://img1.sycdn.imooc.com/6461d97900011c8d06470310.jpg

查看完整回答
反對 回復 2023-05-15
  • 1 回答
  • 0 關注
  • 154 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號