Don't make QCA a requirement if we're bundling the spotify blob (since we won't need to download anything at runtime)

This commit is contained in:
David Sansome 2011-11-05 15:31:29 +00:00
parent 568f78d874
commit fccd0a5458
5 changed files with 29 additions and 12 deletions

View File

@ -234,13 +234,23 @@ if(ENABLE_BREAKPAD)
set(HAVE_BREAKPAD ON)
endif(ENABLE_BREAKPAD)
if(ENABLE_SPOTIFY AND PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE AND QCA_FOUND)
if(ENABLE_SPOTIFY AND PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE)
set(HAVE_SPOTIFY ON)
endif(ENABLE_SPOTIFY AND PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE AND QCA_FOUND)
endif(ENABLE_SPOTIFY AND PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE)
if(HAVE_SPOTIFY AND SPOTIFY_FOUND)
if(ENABLE_SPOTIFY_BLOB AND PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE AND SPOTIFY_FOUND)
set(HAVE_SPOTIFY_BLOB ON)
endif(HAVE_SPOTIFY AND SPOTIFY_FOUND)
endif(ENABLE_SPOTIFY_BLOB AND PROTOBUF_FOUND AND PROTOBUF_PROTOC_EXECUTABLE AND SPOTIFY_FOUND)
if((NOT HAVE_SPOTIFY_BLOB) AND (NOT QCA_FOUND))
# If we're not bundling the spotify blob then we must ensure QCA is available
# so we can verify the blob we download at runtime.
unset(HAVE_SPOTIFY)
endif((NOT HAVE_SPOTIFY_BLOB) AND (NOT QCA_FOUND))
if(QCA_FOUND)
set(HAVE_QCA ON)
endif(QCA_FOUND)
if(ENABLE_VISUALISATIONS)

View File

@ -32,6 +32,7 @@
#cmakedefine HAVE_LIBINDICATE
#cmakedefine HAVE_LIBLASTFM
#cmakedefine HAVE_LIBMTP
#cmakedefine HAVE_QCA
#cmakedefine HAVE_REMOTE
#cmakedefine HAVE_SPARKLE
#cmakedefine HAVE_SPOTIFY

View File

@ -15,6 +15,7 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "spotifyblobdownloader.h"
#include "spotifyservice.h"
#include "core/logging.h"
@ -25,7 +26,10 @@
#include <QMessageBox>
#include <QNetworkReply>
#include <QProgressDialog>
#ifdef HAVE_QCA
#include <QtCrypto>
#endif // HAVE_QCA
const char* SpotifyBlobDownloader::kSignatureSuffix = ".sha1";
@ -109,6 +113,7 @@ void SpotifyBlobDownloader::ReplyFinished() {
file_data[filename] = reply->readAll();
}
#ifdef HAVE_QCA
// Load the public key
QCA::ConvertResult conversion_result;
QCA::PublicKey key = QCA::PublicKey::fromPEMFile(":/clementine-spotify-public.pem",
@ -132,6 +137,7 @@ void SpotifyBlobDownloader::ReplyFinished() {
return;
}
}
#endif
// Make the destination directory and write the files into it
QDir().mkpath(path_);

View File

@ -78,7 +78,7 @@ using boost::scoped_ptr;
#include <echonest/Config.h>
#ifdef HAVE_SPOTIFY
#ifdef HAVE_QCA
#include <QtCrypto>
#endif
@ -373,7 +373,7 @@ int main(int argc, char *argv[]) {
}
#endif
#ifdef HAVE_SPOTIFY
#ifdef HAVE_QCA
QCA::Initializer qca_initializer;
#endif

View File

@ -566,7 +566,7 @@ msgstr ""
msgid "Always start playing"
msgstr ""
#: internet/spotifyblobdownloader.cpp:55
#: internet/spotifyblobdownloader.cpp:59
msgid ""
"An additional plugin is required to use Spotify in Clementine. Would you "
"like to download and install it now?"
@ -793,7 +793,7 @@ msgstr ""
msgid "CUE sheet support"
msgstr ""
#: internet/spotifyblobdownloader.cpp:39
#: internet/spotifyblobdownloader.cpp:43
msgid "Cancel"
msgstr ""
@ -1432,7 +1432,7 @@ msgstr ""
msgid "Downloading Magnatune catalogue"
msgstr ""
#: internet/spotifyblobdownloader.cpp:39
#: internet/spotifyblobdownloader.cpp:43
msgid "Downloading Spotify plugin"
msgstr ""
@ -1584,7 +1584,7 @@ msgstr ""
msgid "Error deleting songs"
msgstr ""
#: internet/spotifyblobdownloader.cpp:187
#: internet/spotifyblobdownloader.cpp:193
msgid "Error downloading Spotify plugin"
msgstr ""
@ -3696,7 +3696,7 @@ msgstr ""
msgid "Spotify plugin"
msgstr ""
#: internet/spotifyblobdownloader.cpp:54
#: internet/spotifyblobdownloader.cpp:58
msgid "Spotify plugin not installed"
msgstr ""