From 45a7780f95176a321697c78fa62b5f508ee7b4eb Mon Sep 17 00:00:00 2001 From: David Sansome Date: Wed, 29 Dec 2010 17:53:28 +0000 Subject: [PATCH] Add winsparkle support (doesn't work yet) --- CMakeLists.txt | 3 ++- dist/windows/clementine.nsi.in | 2 ++ src/CMakeLists.txt | 4 ++++ src/main.cpp | 16 +++++++++++++++- src/ui/edittagdialog.cpp | 2 +- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79e6b8796..0195e6b7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +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) endif (WIN32) find_library(LASTFM_LIBRARIES lastfm) @@ -276,6 +277,6 @@ summary_add("D-Bus support" HAVE_DBUS) summary_add("Gnome sound menu integration" HAVE_LIBINDICATE) summary_add("Wiimote support" ENABLE_WIIMOTEDEV) summary_add("Visualisations" ENABLE_VISUALISATIONS) -summary_add("Sparkle integration" HAVE_SPARKLE) summary_add("Last.fm support" HAVE_LIBLASTFM) +summary_add("(Mac OS X) Sparkle integration" HAVE_SPARKLE) summary_show() diff --git a/dist/windows/clementine.nsi.in b/dist/windows/clementine.nsi.in index bec1d7bec..1cd53381f 100644 --- a/dist/windows/clementine.nsi.in +++ b/dist/windows/clementine.nsi.in @@ -151,6 +151,7 @@ Section "Clementine" Clementine File "libusbmuxd.dll" File "libvorbis-0.dll" File "libvorbisenc-2.dll" + File "libwinsparkle.dll" File "libxml2-2.dll" File "mingwm10.dll" File "pthreadGC2.dll" @@ -970,6 +971,7 @@ Section "Uninstall" Delete "$INSTDIR\libusbmuxd.dll" Delete "$INSTDIR\libvorbis-0.dll" Delete "$INSTDIR\libvorbisenc-2.dll" + Delete "$INSTDIR\libwinsparkle.dll" Delete "$INSTDIR\libxml2-2.dll" Delete "$INSTDIR\mingwm10.dll" Delete "$INSTDIR\pthreadGC2.dll" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5209ffbe1..868ed84af 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -881,6 +881,10 @@ set_target_properties(clementine PROPERTIES MACOSX_BUNDLE_INFO_PLIST "../dist/Info.plist" ) +if(WIN32) + target_link_libraries(clementine ${WINSPARKLE_LIBRARIES}) +endif(WIN32) + if (APPLE) install(FILES ../dist/clementine.icns DESTINATION "${CMAKE_BINARY_DIR}/clementine.app/Contents/Resources") diff --git a/src/main.cpp b/src/main.cpp index bd00e1d5e..04231115d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,10 +15,13 @@ along with Clementine. If not, see . */ +#include + #ifdef Q_OS_WIN32 # define _WIN32_WINNT 0x0500 # include # include +# include #endif // Q_OS_WIN32 #include "config.h" @@ -148,6 +151,11 @@ 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()); @@ -267,5 +275,11 @@ int main(int argc, char *argv[]) { QObject::connect(&a, SIGNAL(messageReceived(QByteArray)), &w, SLOT(CommandlineOptionsReceived(QByteArray))); w.CommandlineOptionsReceived(options); - return a.exec(); + int ret = a.exec(); + +#ifdef Q_OS_WIN32 + win_sparkle_cleanup(); +#endif + + return ret; } diff --git a/src/ui/edittagdialog.cpp b/src/ui/edittagdialog.cpp index bc4075032..3cc4ebb5d 100644 --- a/src/ui/edittagdialog.cpp +++ b/src/ui/edittagdialog.cpp @@ -413,7 +413,7 @@ void EditTagDialog::UpdateSummaryTab(const Song& song) { QLocale::system().dateTimeFormat(QLocale::LongFormat))); ui_->filesize->setText(Utilities::PrettySize(song.filesize())); ui_->filetype->setText(song.TextForFiletype()); - ui_->filename->setText(song.filename()); + ui_->filename->setText(QDir::toNativeSeparators(song.filename())); } void EditTagDialog::UpdateStatisticsTab(const Song& song) {