[Pkg-owncloud-commits] [owncloud-client] 01/47: Sparkle: Get it working

Sandro Knauß hefee-guest at moszumanska.debian.org
Mon Feb 17 18:06:32 UTC 2014


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit e001e70816d9b1d89a026e3a1abf7c96e5dd5039
Author: Markus Goetz <markus at woboq.com>
Date:   Tue Feb 4 17:32:26 2014 +0100

    Sparkle: Get it working
---
 admin/osx/sparkle/dsa_pub.pem           | 12 ++++++++++++
 cmake/modules/MacOSXBundleInfo.plist.in |  4 ++++
 src/CMakeLists.txt                      |  4 ++++
 src/updater/sparkleupdater_mac.mm       | 26 ++++++++++++++++++++++++++
 src/updater/updater.cpp                 |  5 +++--
 5 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/admin/osx/sparkle/dsa_pub.pem b/admin/osx/sparkle/dsa_pub.pem
new file mode 100644
index 0000000..19cc0e7
--- /dev/null
+++ b/admin/osx/sparkle/dsa_pub.pem
@@ -0,0 +1,12 @@
+-----BEGIN PUBLIC KEY-----
+MIIBtzCCASsGByqGSM44BAEwggEeAoGBANC50nTWzroQwwawgaV4jd5TjjqbGKDH
+6CWbZzyfJ246mJcrwTfM2h5Z80GwLSNFBIjtLGpFd7Wd+CI1dY8oIOYxnYgWDSJC
+Al1RMoUSSwx0LRr8J3gojcvvsrhk/t57o9bjXynE2tiP1fwzPb+B3NH/02fMnzfH
+k+B8/8GOnX8dAhUA9PZ1QrH/mN+7ckiGjmoegZdv9tMCgYBPEj2850r8+9tXljU4
+X0s1NKBfiyhBGw/quJMZ3k0fQ/tpOyYwXYBg+9GBVc4pF1CKMVGoBS6XnLrZ1OkC
+OP9g+NNH5cLOKrBxjtd1GPG8UF/sZpak2sVfuNKzRtFT/6WFHc3f7C+LiDFZ2aPO
+A+Kr5MZJ8xxYDYj16WV2nKgoQgOBhQACgYEAuQzycfUZKm7MR9WZSFF9uQ3N3SQr
+PKYggCl6GTdWYmrsFyXLEBmb3m2qXxx9AcfR2LdkTp/CRCzm+HD6wyHVAAVG2kI2
+mWafcahlx/lVMd2yytdRE5pjpjLxw7rrt/fvSZsGwUswQJLl4iDWoE+mFfaaZnnM
+JKoiKLX7LUFOPaU=
+-----END PUBLIC KEY-----
diff --git a/cmake/modules/MacOSXBundleInfo.plist.in b/cmake/modules/MacOSXBundleInfo.plist.in
index 5dad057..35702e5 100644
--- a/cmake/modules/MacOSXBundleInfo.plist.in
+++ b/cmake/modules/MacOSXBundleInfo.plist.in
@@ -28,5 +28,9 @@
         <string>@MIRALL_VERSION_STRING@</string>
         <key>NSHumanReadableCopyright</key>
         <string>(C) 2014 @APPLICATION_VENDOR@</string>
+        <key>SUShowReleaseNotes</key>
+        <false/>
+        <key>SUPublicDSAKeyFile</key>
+        <string>dsa_pub.pem</string>
 </dict>
 </plist>
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 97f532c..f2f4ffa 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -446,6 +446,10 @@ target_link_libraries(${owncloudcmd_NAME} ${synclib_NAME})
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mirall)
 if(BUILD_OWNCLOUD_OSX_BUNDLE)
     install(TARGETS ${owncloudcmd_NAME} DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/MacOS)
+    if (SPARKLE_FOUND)
+        install(FILES ${CMAKE_SOURCE_DIR}/admin/osx/sparkle/dsa_pub.pem
+                DESTINATION ${OWNCLOUD_OSX_BUNDLE}/Contents/Resources)
+    endif()
 else()
     install(TARGETS ${owncloudcmd_NAME}
 	    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
diff --git a/src/updater/sparkleupdater_mac.mm b/src/updater/sparkleupdater_mac.mm
index eb00e5e..8f26e32 100644
--- a/src/updater/sparkleupdater_mac.mm
+++ b/src/updater/sparkleupdater_mac.mm
@@ -14,11 +14,26 @@
 
 #include <Cocoa/Cocoa.h>
 #include <Sparkle/Sparkle.h>
+#include <Sparkle/SUUpdater.h>
 #include <AppKit/NSApplication.h>
 
 #include "updater/sparkleupdater.h"
 
 #include "mirall/utility.h"
+#include <QDebug>
+
+// Does not work yet
+ at interface DelegateObject : NSObject
+- (BOOL)updaterMayCheckForUpdates:(SUUpdater *)bundle;
+ at end
+ at implementation DelegateObject //(SUUpdaterDelegateInformalProtocol)
+- (BOOL)updaterMayCheckForUpdates:(SUUpdater *)bundle
+{
+    qDebug() << Q_FUNC_INFO << "may check: YES";
+    return YES;
+}
+ at end
+
 
 namespace Mirall {
 
@@ -26,14 +41,24 @@ class SparkleUpdater::Private
 {
     public:
         SUUpdater* updater;
+        DelegateObject *delegate;
 };
 
+// Delete ~/Library//Preferences/com.owncloud.desktopclient.plist to re-test
 SparkleUpdater::SparkleUpdater(const QString& appCastUrl)
     : Updater()
 {
     d = new Private;
 
+    d->delegate = [[DelegateObject alloc] init];
+    [d->delegate retain];
+
     d->updater = [SUUpdater sharedUpdater];
+    [d->updater setDelegate:d->delegate];
+    [d->updater setAutomaticallyChecksForUpdates:YES];
+    [d->updater setAutomaticallyDownloadsUpdates:NO];
+    [d->updater setSendsSystemProfile:NO];
+    [d->updater resetUpdateCycle];
     [d->updater retain];
 
     NSURL* url = [NSURL URLWithString:
@@ -58,6 +83,7 @@ void SparkleUpdater::checkForUpdate()
 
 void SparkleUpdater::backgroundCheckForUpdate()
 {
+    qDebug() << Q_FUNC_INFO << "launching background check";
     [d->updater checkForUpdatesInBackground];
 }
 
diff --git a/src/updater/updater.cpp b/src/updater/updater.cpp
index 4e810cd..65b3ff0 100644
--- a/src/updater/updater.cpp
+++ b/src/updater/updater.cpp
@@ -31,11 +31,12 @@ Updater * Updater::instance()
     return _instance;
 }
 
+// To test, cmake with -DAPPLICATION_UPDATE_URL="http://127.0.0.1:8080/test.rss"
 Updater *Updater::create()
 {
     QString updateBaseUrl(QLatin1String(APPLICATION_UPDATE_URL));
-#if defined(Q_OS_MAC) && defined(SPARKLE_FOUND)
-    return new SparkleUpdater(updateBaseUrl+QLatin1String("/rss/"));
+#if defined(Q_OS_MAC) && defined(HAVE_SPARKLE)
+    return new SparkleUpdater(updateBaseUrl);
 #elif defined (Q_OS_WIN32)
     // the best we can do is notify about updates
     return new NSISUpdater(QUrl(updateBaseUrl));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list