1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 03:09:57 +01:00

Use qtsparkle instead of winsparkle

This commit is contained in:
David Sansome 2010-12-30 16:20:33 +00:00
parent bc2eb6ad65
commit 398f5d7f66
4 changed files with 23 additions and 23 deletions

View File

@ -60,7 +60,7 @@ if (WIN32)
find_package(ZLIB REQUIRED)
find_library(MSWMDM_LIBRARIES mswmdm)
find_library(SAC_SHIM_LIBRARIES sac_shim)
find_library(WINSPARKLE_LIBRARIES winsparkle)
find_library(QTSPARKLE_LIBRARIES qtsparkle)
endif (WIN32)
find_library(LASTFM_LIBRARIES lastfm)

View File

@ -889,7 +889,7 @@ set_target_properties(clementine PROPERTIES
)
if(WIN32)
target_link_libraries(clementine ${WINSPARKLE_LIBRARIES})
target_link_libraries(clementine ${QTSPARKLE_LIBRARIES})
endif(WIN32)
if (APPLE)

View File

@ -21,7 +21,6 @@
# define _WIN32_WINNT 0x0500
# include <windows.h>
# include <iostream>
# include <winsparkle.h>
#endif // Q_OS_WIN32
#include "config.h"
@ -155,11 +154,6 @@ int main(int argc, char *argv[]) {
}
#endif
#ifdef Q_OS_WIN32
win_sparkle_set_appcast_url("http://data.clementine-player.org/winsparkle");
win_sparkle_init();
#endif
// This makes us show up nicely in gnome-volume-control
g_type_init();
g_set_application_name(QCoreApplication::applicationName().toLocal8Bit());
@ -287,11 +281,5 @@ int main(int argc, char *argv[]) {
QObject::connect(&a, SIGNAL(messageReceived(QByteArray)), &w, SLOT(CommandlineOptionsReceived(QByteArray)));
w.CommandlineOptionsReceived(options);
int ret = a.exec();
#ifdef Q_OS_WIN32
win_sparkle_cleanup();
#endif
return ret;
return a.exec();
}

View File

@ -26,6 +26,7 @@
#include "core/mergedproxymodel.h"
#include "core/modelfuturewatcher.h"
#include "core/mpris_common.h"
#include "core/network.h"
#include "core/player.h"
#include "core/songloader.h"
#include "core/stylesheetloader.h"
@ -111,6 +112,10 @@
#include <QTimer>
#include <QUndoStack>
#ifdef Q_OS_WIN32
# include <qtsparkle/Updater>
#endif
#include <cmath>
@ -491,14 +496,14 @@ MainWindow::MainWindow(QWidget* parent)
connect(tray_icon_, SIGNAL(ShowHide()), SLOT(ToggleShowHide()));
connect(tray_icon_, SIGNAL(ChangeVolume(int)), SLOT(VolumeWheelEvent(int)));
#ifdef Q_OS_DARWIN
#ifdef HAVE_SPARKLE
// Add check for updates item to application menu.
QAction* check_updates = ui_->menuTools->addAction(tr("Check for updates..."));
check_updates->setMenuRole(QAction::ApplicationSpecificRole);
connect(check_updates, SIGNAL(triggered(bool)), SLOT(CheckForUpdates()));
#endif
#if (defined(Q_OS_DARWIN) && defined(HAVE_SPARKLE)) || defined(Q_OS_WIN32)
// Add check for updates item to application menu.
QAction* check_updates = ui_->menuTools->addAction(tr("Check for updates..."));
check_updates->setMenuRole(QAction::ApplicationSpecificRole);
connect(check_updates, SIGNAL(triggered(bool)), SLOT(CheckForUpdates()));
#endif
#ifdef Q_OS_DARWIN
// Force this menu to be the app "Preferences".
ui_->action_configure->setMenuRole(QAction::PreferencesRole);
// Force this menu to be the app "About".
@ -507,6 +512,13 @@ MainWindow::MainWindow(QWidget* parent)
ui_->action_quit->setMenuRole(QAction::QuitRole);
#endif
#ifdef Q_OS_WIN32
qtsparkle::Updater* updater = new qtsparkle::Updater(
QUrl("http://data.clementine-player.org/sparkle-windows"), this);
updater->SetNetworkAccessManager(new NetworkAccessManager(this));
connect(check_updates, SIGNAL(triggered()), updater, SLOT(CheckNow()));
#endif
// Global shortcuts
connect(global_shortcuts_, SIGNAL(Play()), player_, SLOT(Play()));
connect(global_shortcuts_, SIGNAL(Pause()), player_, SLOT(Pause()));
@ -1468,7 +1480,7 @@ bool MainWindow::LoadUrl(const QString& url) {
}
void MainWindow::CheckForUpdates() {
#ifdef Q_OS_DARWIN
#if defined(Q_OS_DARWIN)
mac::CheckForUpdates();
#endif
}