diff -Nru clementine-1.2.3-1557/debian/changelog clementine-1.2.3-1562/debian/changelog --- clementine-1.2.3-1557/debian/changelog 2016-02-12 12:25:53.000000000 +0000 +++ clementine-1.2.3-1562/debian/changelog 2016-02-12 17:10:37.000000000 +0000 @@ -1,5 +1,5 @@ -clementine (1.2.3-1557-g0cf83b1~vivid) vivid; urgency=low +clementine (1.2.3-1562-gaffb215~vivid) vivid; urgency=low - * Version 1.2.3-1557-g0cf83b1 + * Version 1.2.3-1562-gaffb215 - -- David Sansome Fri, 12 Feb 2016 12:25:53 +0000 + -- David Sansome Fri, 12 Feb 2016 17:10:37 +0000 diff -Nru clementine-1.2.3-1557/debian/rules clementine-1.2.3-1562/debian/rules --- clementine-1.2.3-1557/debian/rules 2016-02-12 12:25:53.000000000 +0000 +++ clementine-1.2.3-1562/debian/rules 2016-02-12 17:10:37.000000000 +0000 @@ -13,7 +13,7 @@ cd bin && cmake .. \ -DCMAKE_INSTALL_PREFIX=$(CURDIR)/debian/clementine/usr \ -DBUNDLE_PROJECTM_PRESETS=OFF \ - -DFORCE_GIT_REVISION=1.2.3-1557-g0cf83b1 + -DFORCE_GIT_REVISION=1.2.3-1562-gaffb215 touch configure-stamp build: build-stamp diff -Nru clementine-1.2.3-1557/dist/clementine.spec clementine-1.2.3-1562/dist/clementine.spec --- clementine-1.2.3-1557/dist/clementine.spec 2016-02-12 12:25:53.000000000 +0000 +++ clementine-1.2.3-1562/dist/clementine.spec 2016-02-12 17:10:37.000000000 +0000 @@ -1,12 +1,12 @@ Name: clementine Version: 1.2.3 -Release: 2.1557.g0cf83b1%{?dist} +Release: 2.1562.gaffb215%{?dist} Summary: A music player and library organiser Group: Applications/Multimedia License: GPLv3 URL: http://www.clementine-player.org/ -Source0: %{name}-1.2.3-1557-g0cf83b1.tar.xz +Source0: %{name}-1.2.3-1562-gaffb215.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: desktop-file-utils liblastfm-devel taglib-devel gettext @@ -56,7 +56,7 @@ * Queue manager %prep -%setup -q -n %{name}-1.2.3-1557-g0cf83b1 +%setup -q -n %{name}-1.2.3-1562-gaffb215 %build @@ -92,4 +92,4 @@ %changelog * Fri Feb 12 2016 David Sansome - 1.2.3 -- Version 1.2.3-1557-g0cf83b1 +- Version 1.2.3-1562-gaffb215 diff -Nru clementine-1.2.3-1557/dist/Info.plist clementine-1.2.3-1562/dist/Info.plist --- clementine-1.2.3-1557/dist/Info.plist 2016-02-12 12:25:53.000000000 +0000 +++ clementine-1.2.3-1562/dist/Info.plist 2016-02-12 17:10:37.000000000 +0000 @@ -9,7 +9,7 @@ CFBundleExecutable clementine CFBundleGetInfoString - Clementine 1.2.3-1557-g0cf83b1 + Clementine 1.2.3-1562-gaffb215 CFBundleIconFile clementine CFBundleIdentifier @@ -17,15 +17,15 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleLongVersionString - 1.2.3-1557-g0cf83b1 + 1.2.3-1562-gaffb215 CFBundleName Clementine CFBundlePackageType APPL CFBundleShortVersionString - 1.2.3-1557-g0cf83b1 + 1.2.3-1562-gaffb215 CFBundleVersion - 4096.1.2.3.2.1557 + 4096.1.2.3.2.1562 CSResourcesFileMapped LSRequiresCarbon diff -Nru clementine-1.2.3-1557/dist/maketarball.sh clementine-1.2.3-1562/dist/maketarball.sh --- clementine-1.2.3-1557/dist/maketarball.sh 2016-02-12 12:25:53.000000000 +0000 +++ clementine-1.2.3-1562/dist/maketarball.sh 2016-02-12 17:10:37.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/bash name=clementine -version="1.2.3-1557-g0cf83b1" +version="1.2.3-1562-gaffb215" deb_dist="vivid" root=$(cd "${0%/*}/.." && echo $PWD/${0##*/}) root=`dirname "$root"` diff -Nru clementine-1.2.3-1557/dist/windows/clementine.nsi clementine-1.2.3-1562/dist/windows/clementine.nsi --- clementine-1.2.3-1557/dist/windows/clementine.nsi 2016-02-12 12:25:53.000000000 +0000 +++ clementine-1.2.3-1562/dist/windows/clementine.nsi 2016-02-12 17:10:37.000000000 +0000 @@ -3,8 +3,8 @@ !define PRODUCT_PUBLISHER "Clementine" !define PRODUCT_VERSION_MAJOR 1 !define PRODUCT_VERSION_MINOR 2 -!define PRODUCT_DISPLAY_VERSION "1.2.3-1557-g0cf83b1" -!define PRODUCT_DISPLAY_VERSION_SHORT "1.2.3-1557-g0cf83b1" +!define PRODUCT_DISPLAY_VERSION "1.2.3-1562-gaffb215" +!define PRODUCT_DISPLAY_VERSION_SHORT "1.2.3-1562-gaffb215" !define PRODUCT_WEB_SITE "http://www.clementine-player.org/" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" @@ -104,7 +104,7 @@ !insertmacro MUI_LANGUAGE "Esperanto" Name "${PRODUCT_NAME}" -OutFile "${PRODUCT_NAME}Setup-1.2.3-1557-g0cf83b1.exe" +OutFile "${PRODUCT_NAME}Setup-1.2.3-1562-gaffb215.exe" InstallDir "${PRODUCT_INSTALL_DIR}" ; Get the path where Clementine was installed previously and set it as default path diff -Nru clementine-1.2.3-1557/dist/windows/clementine-portable.nsi clementine-1.2.3-1562/dist/windows/clementine-portable.nsi --- clementine-1.2.3-1557/dist/windows/clementine-portable.nsi 2016-02-12 12:25:53.000000000 +0000 +++ clementine-1.2.3-1562/dist/windows/clementine-portable.nsi 2016-02-12 17:10:37.000000000 +0000 @@ -3,8 +3,8 @@ !define PRODUCT_PUBLISHER "Clementine" !define PRODUCT_VERSION_MAJOR 1 !define PRODUCT_VERSION_MINOR 2 -!define PRODUCT_DISPLAY_VERSION "1.2.3-1557-g0cf83b1" -!define PRODUCT_DISPLAY_VERSION_SHORT "1.2.3-1557-g0cf83b1" +!define PRODUCT_DISPLAY_VERSION "1.2.3-1562-gaffb215" +!define PRODUCT_DISPLAY_VERSION_SHORT "1.2.3-1562-gaffb215" !define PRODUCT_WEB_SITE "http://www.clementine-player.org/" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" @@ -104,7 +104,7 @@ !insertmacro MUI_LANGUAGE "Esperanto" Name "${PRODUCT_NAME}" -OutFile "${PRODUCT_NAME}Setup-1.2.3-1557-g0cf83b1.exe" +OutFile "${PRODUCT_NAME}Setup-1.2.3-1562-gaffb215.exe" InstallDir "${PRODUCT_INSTALL_DIR}" ; Get the path where Clementine was installed previously and set it as default path diff -Nru clementine-1.2.3-1557/ext/libclementine-common/core/lazy.h clementine-1.2.3-1562/ext/libclementine-common/core/lazy.h --- clementine-1.2.3-1557/ext/libclementine-common/core/lazy.h 2016-02-12 12:25:49.000000000 +0000 +++ clementine-1.2.3-1562/ext/libclementine-common/core/lazy.h 2016-02-12 17:10:33.000000000 +0000 @@ -29,6 +29,9 @@ public: explicit Lazy(std::function init) : init_(init) {} + // Convenience constructor that will lazily default construct the object. + Lazy() : init_([]() { return new T; }) {} + T* get() const { CheckInitialised(); return ptr_.get(); diff -Nru clementine-1.2.3-1557/src/core/application.cpp clementine-1.2.3-1562/src/core/application.cpp --- clementine-1.2.3-1557/src/core/application.cpp 2016-02-12 12:25:49.000000000 +0000 +++ clementine-1.2.3-1562/src/core/application.cpp 2016-02-12 17:10:33.000000000 +0000 @@ -22,7 +22,11 @@ #include "application.h" +#include "covers/amazoncoverprovider.h" +#include "covers/musicbrainzcoverprovider.h" + #ifdef HAVE_LIBLASTFM +#include "covers/lastfmcoverprovider.h" #include "internet/lastfm/lastfmservice.h" #endif // HAVE_LIBLASTFM @@ -63,7 +67,16 @@ return backend; }), appearance_([=]() { return new Appearance(this); }), - cover_providers_([=]() { return new CoverProviders(this); }), + cover_providers_([=]() { + CoverProviders* cover_providers = new CoverProviders(this); + // Initialize the repository of cover providers. + cover_providers->AddProvider(new AmazonCoverProvider); + cover_providers->AddProvider(new MusicbrainzCoverProvider); + #ifdef HAVE_LIBLASTFM + cover_providers->AddProvider(new LastFmCoverProvider(this)); + #endif + return cover_providers; + }), task_manager_([=]() { return new TaskManager(this); }), player_([=]() { return new Player(this, this); }), playlist_manager_([=]() { return new PlaylistManager(this); }), diff -Nru clementine-1.2.3-1557/src/internet/lastfm/lastfmservice.cpp clementine-1.2.3-1562/src/internet/lastfm/lastfmservice.cpp --- clementine-1.2.3-1557/src/internet/lastfm/lastfmservice.cpp 2016-02-12 12:25:49.000000000 +0000 +++ clementine-1.2.3-1562/src/internet/lastfm/lastfmservice.cpp 2016-02-12 17:10:33.000000000 +0000 @@ -92,8 +92,6 @@ // we emit the signal the first time to be sure the buttons are in the right // state emit ScrobblingEnabledChanged(scrobbling_enabled_); - - app_->cover_providers()->AddProvider(new LastFmCoverProvider(this)); } LastFMService::~LastFMService() {} diff -Nru clementine-1.2.3-1557/src/main.cpp clementine-1.2.3-1562/src/main.cpp --- clementine-1.2.3-1557/src/main.cpp 2016-02-12 12:25:49.000000000 +0000 +++ clementine-1.2.3-1562/src/main.cpp 2016-02-12 17:10:33.000000000 +0000 @@ -56,9 +56,6 @@ #include "core/song.h" #include "core/ubuntuunityhack.h" #include "core/utilities.h" -#include "covers/amazoncoverprovider.h" -#include "covers/coverproviders.h" -#include "covers/musicbrainzcoverprovider.h" #include "engines/enginebase.h" #include "smartplaylists/generator.h" #include "ui/iconloader.h" @@ -448,11 +445,6 @@ QNetworkProxyFactory::setApplicationProxyFactory( NetworkProxyFactory::Instance()); - // Initialize the repository of cover providers. Last.fm registers itself - // when its service is created. - app.cover_providers()->AddProvider(new AmazonCoverProvider); - app.cover_providers()->AddProvider(new MusicbrainzCoverProvider); - #ifdef Q_OS_LINUX // In 11.04 Ubuntu decided that the system tray should be reserved for certain // whitelisted applications. Clementine will override this setting and insert diff -Nru clementine-1.2.3-1557/src/ui/mainwindow.cpp clementine-1.2.3-1562/src/ui/mainwindow.cpp --- clementine-1.2.3-1557/src/ui/mainwindow.cpp 2016-02-12 12:25:49.000000000 +0000 +++ clementine-1.2.3-1562/src/ui/mainwindow.cpp 2016-02-12 17:10:33.000000000 +0000 @@ -172,6 +172,7 @@ app_(app), tray_icon_(tray_icon), osd_(osd), + edit_tag_dialog_(std::bind(&MainWindow::CreateEditTagDialog, this)), global_shortcuts_(new GlobalShortcuts(this)), global_search_view_(new GlobalSearchView(app_, this)), library_view_(new LibraryViewContainer(this)), @@ -182,8 +183,36 @@ device_view_(device_view_container_->view()), song_info_view_(new SongInfoView(this)), artist_info_view_(new ArtistInfoView(this)), + settings_dialog_(std::bind(&MainWindow::CreateSettingsDialog, this)), + add_stream_dialog_([=]() { + AddStreamDialog* add_stream_dialog = new AddStreamDialog; + connect(add_stream_dialog, SIGNAL(accepted()), this, + SLOT(AddStreamAccepted())); + add_stream_dialog->set_add_on_accept( + InternetModel::Service()); + return add_stream_dialog; + }), + cover_manager_([=]() { + AlbumCoverManager* cover_manager = + new AlbumCoverManager(app, app->library_backend()); + cover_manager->Init(); + + // Cover manager connections + connect(cover_manager, SIGNAL(AddToPlaylist(QMimeData*)), this, + SLOT(AddToPlaylist(QMimeData*))); + return cover_manager; + }), equalizer_(new Equalizer), - organise_dialog_(new OrganiseDialog(app_->task_manager())), + organise_dialog_([=]() { + OrganiseDialog* dialog = new OrganiseDialog(app->task_manager()); + dialog->SetDestinationModel(app->library()->model()->directory_model()); + return dialog; + }), + queue_manager_([=]() { + QueueManager* manager = new QueueManager; + manager->SetPlaylistManager(app->playlist_manager()); + return manager; + }), playlist_menu_(new QMenu(this)), playlist_add_to_another_(nullptr), playlistitem_actions_separator_(nullptr), @@ -293,9 +322,6 @@ device_view_->SetApplication(app_); playlist_list_->SetApplication(app_); - organise_dialog_->SetDestinationModel( - app_->library()->model()->directory_model()); - // Icons qLog(Debug) << "Creating UI"; ui_->action_about->setIcon(IconLoader::Load("help-about", IconLoader::Base)); @@ -1831,7 +1857,6 @@ } } - EnsureEditTagDialogCreated(); edit_tag_dialog_->SetSongs(songs, items); edit_tag_dialog_->show(); } @@ -1990,17 +2015,7 @@ AddToPlaylist(data); } -void MainWindow::AddStream() { - if (!add_stream_dialog_) { - add_stream_dialog_.reset(new AddStreamDialog); - connect(add_stream_dialog_.get(), SIGNAL(accepted()), - SLOT(AddStreamAccepted())); - - add_stream_dialog_->set_add_on_accept(InternetModel::Service()); - } - - add_stream_dialog_->show(); -} +void MainWindow::AddStream() { add_stream_dialog_->show(); } void MainWindow::AddStreamAccepted() { MimeData* data = new MimeData; @@ -2194,10 +2209,6 @@ } void MainWindow::AddFilesToTranscoder() { - if (!transcode_dialog_) { - transcode_dialog_.reset(new TranscodeDialog); - } - QStringList filenames; for (const QModelIndex& index : @@ -2216,7 +2227,6 @@ } void MainWindow::ShowLibraryConfig() { - EnsureSettingsDialogCreated(); settings_dialog_->OpenAtPage(SettingsDialog::Page_Library); } @@ -2269,8 +2279,6 @@ } void MainWindow::EditFileTags(const QList& urls) { - EnsureEditTagDialogCreated(); - SongList songs; for (const QUrl& url : urls) { Song song; @@ -2426,81 +2434,49 @@ } } -void MainWindow::ShowCoverManager() { - if (!cover_manager_) { - cover_manager_.reset(new AlbumCoverManager(app_, app_->library_backend())); - cover_manager_->Init(); - - // Cover manager connections - connect(cover_manager_.get(), SIGNAL(AddToPlaylist(QMimeData*)), - SLOT(AddToPlaylist(QMimeData*))); - } - - cover_manager_->show(); -} - -void MainWindow::EnsureSettingsDialogCreated() { - if (settings_dialog_) return; +void MainWindow::ShowCoverManager() { cover_manager_->show(); } - settings_dialog_.reset(new SettingsDialog(app_, background_streams_)); - settings_dialog_->SetGlobalShortcutManager(global_shortcuts_); - settings_dialog_->SetSongInfoView(song_info_view_); +SettingsDialog* MainWindow::CreateSettingsDialog() { + SettingsDialog* settings_dialog = + new SettingsDialog(app_, background_streams_); + settings_dialog->SetGlobalShortcutManager(global_shortcuts_); + settings_dialog->SetSongInfoView(song_info_view_); // Settings - connect(settings_dialog_.get(), SIGNAL(accepted()), - SLOT(ReloadAllSettings())); + connect(settings_dialog, SIGNAL(accepted()), SLOT(ReloadAllSettings())); #ifdef HAVE_WIIMOTEDEV - connect(settings_dialog_.get(), SIGNAL(SetWiimotedevInterfaceActived(bool)), + connect(settings_dialog, SIGNAL(SetWiimotedevInterfaceActived(bool)), wiimotedev_shortcuts_.get(), SLOT(SetWiimotedevInterfaceActived(bool))); #endif // Allows custom notification preview - connect(settings_dialog_.get(), + connect(settings_dialog, SIGNAL(NotificationPreview(OSD::Behaviour, QString, QString)), SLOT(HandleNotificationPreview(OSD::Behaviour, QString, QString))); + return settings_dialog; } -void MainWindow::OpenSettingsDialog() { - EnsureSettingsDialogCreated(); - settings_dialog_->show(); -} +void MainWindow::OpenSettingsDialog() { settings_dialog_->show(); } void MainWindow::OpenSettingsDialogAtPage(SettingsDialog::Page page) { - EnsureSettingsDialogCreated(); settings_dialog_->OpenAtPage(page); } -void MainWindow::EnsureEditTagDialogCreated() { - if (edit_tag_dialog_) return; - - edit_tag_dialog_.reset(new EditTagDialog(app_)); - connect(edit_tag_dialog_.get(), SIGNAL(accepted()), - SLOT(EditTagDialogAccepted())); - connect(edit_tag_dialog_.get(), SIGNAL(Error(QString)), +EditTagDialog* MainWindow::CreateEditTagDialog() { + EditTagDialog* edit_tag_dialog = new EditTagDialog(app_); + connect(edit_tag_dialog, SIGNAL(accepted()), SLOT(EditTagDialogAccepted())); + connect(edit_tag_dialog, SIGNAL(Error(QString)), SLOT(ShowErrorDialog(QString))); + return edit_tag_dialog; } -void MainWindow::ShowAboutDialog() { - if (!about_dialog_) { - about_dialog_.reset(new About); - } - - about_dialog_->show(); -} +void MainWindow::ShowAboutDialog() { about_dialog_->show(); } -void MainWindow::ShowTranscodeDialog() { - if (!transcode_dialog_) { - transcode_dialog_.reset(new TranscodeDialog); - } - transcode_dialog_->show(); -} +void MainWindow::ShowTranscodeDialog() { transcode_dialog_->show(); } void MainWindow::ShowErrorDialog(const QString& message) { - if (!error_dialog_) { - error_dialog_.reset(new ErrorDialog); - } error_dialog_->ShowMessage(message); } @@ -2543,13 +2519,7 @@ } } -void MainWindow::ShowQueueManager() { - if (!queue_manager_) { - queue_manager_.reset(new QueueManager); - queue_manager_->SetPlaylistManager(app_->playlist_manager()); - } - queue_manager_->show(); -} +void MainWindow::ShowQueueManager() { queue_manager_->show(); } void MainWindow::ShowVisualisations() { #ifdef ENABLE_VISUALISATIONS diff -Nru clementine-1.2.3-1557/src/ui/mainwindow.h clementine-1.2.3-1562/src/ui/mainwindow.h --- clementine-1.2.3-1557/src/ui/mainwindow.h 2016-02-12 12:25:49.000000000 +0000 +++ clementine-1.2.3-1562/src/ui/mainwindow.h 2016-02-12 17:10:33.000000000 +0000 @@ -25,11 +25,13 @@ #include #include "config.h" +#include "core/lazy.h" #include "core/mac_startup.h" #include "core/tagreaderclient.h" #include "engines/engine_fwd.h" #include "library/librarymodel.h" #include "playlist/playlistitem.h" +#include "ui/organisedialog.h" #include "ui/settingsdialog.h" class About; @@ -57,7 +59,6 @@ class LibraryViewContainer; class MimeData; class MultiLoadingIndicator; -class OrganiseDialog; class OSD; class Player; class PlaylistBackend; @@ -249,8 +250,8 @@ void ShowErrorDialog(const QString& message); void ShowQueueManager(); void ShowVisualisations(); - void EnsureSettingsDialogCreated(); - void EnsureEditTagDialogCreated(); + SettingsDialog* CreateSettingsDialog(); + EditTagDialog* CreateEditTagDialog(); void OpenSettingsDialog(); void OpenSettingsDialogAtPage(SettingsDialog::Page page); void ShowSongInfoConfig(); @@ -295,8 +296,8 @@ Application* app_; SystemTrayIcon* tray_icon_; OSD* osd_; - std::unique_ptr edit_tag_dialog_; - std::unique_ptr about_dialog_; + Lazy edit_tag_dialog_; + Lazy about_dialog_; GlobalShortcuts* global_shortcuts_; @@ -313,14 +314,14 @@ SongInfoView* song_info_view_; ArtistInfoView* artist_info_view_; - std::unique_ptr settings_dialog_; - std::unique_ptr add_stream_dialog_; - std::unique_ptr cover_manager_; + Lazy settings_dialog_; + Lazy add_stream_dialog_; + Lazy cover_manager_; std::unique_ptr equalizer_; - std::unique_ptr transcode_dialog_; - std::unique_ptr error_dialog_; - std::unique_ptr organise_dialog_; - std::unique_ptr queue_manager_; + Lazy transcode_dialog_; + Lazy error_dialog_; + Lazy organise_dialog_; + Lazy queue_manager_; std::unique_ptr tag_fetcher_; std::unique_ptr track_selection_dialog_;