Connection syntax migration (#637)

This commit is contained in:
Jonas Kvinge
2021-01-26 16:48:04 +01:00
committed by GitHub
parent d57f6303f4
commit bf7c8df353
362 changed files with 2452 additions and 2434 deletions

View File

@@ -122,8 +122,8 @@ void InternetCollectionView::SaveFocus() {
switch (type.toInt()) {
case CollectionItem::Type_Song: {
QModelIndex index = qobject_cast<QSortFilterProxyModel*>(model())->mapToSource(current);
SongList songs = collection_model_->GetChildSongs(index);
QModelIndex idx = qobject_cast<QSortFilterProxyModel*>(model())->mapToSource(current);
SongList songs = collection_model_->GetChildSongs(idx);
if (!songs.isEmpty()) {
last_selected_song_ = songs.last();
}
@@ -180,8 +180,8 @@ bool InternetCollectionView::RestoreLevelFocus(const QModelIndex &parent) {
switch (type.toInt()) {
case CollectionItem::Type_Song:
if (!last_selected_song_.url().isEmpty()) {
QModelIndex index = qobject_cast<QSortFilterProxyModel*>(model())->mapToSource(current);
SongList songs = collection_model_->GetChildSongs(index);
QModelIndex idx = qobject_cast<QSortFilterProxyModel*>(model())->mapToSource(current);
SongList songs = collection_model_->GetChildSongs(idx);
for (const Song &song : songs) {
if (song == last_selected_song_) {
setCurrentIndex(current);
@@ -308,18 +308,18 @@ void InternetCollectionView::contextMenuEvent(QContextMenuEvent *e) {
if (!context_menu_) {
context_menu_ = new QMenu(this);
add_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, SLOT(AddToPlaylist()));
load_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, SLOT(Load()));
open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), tr("Open in new playlist"), this, SLOT(OpenInNewPlaylist()));
add_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, &InternetCollectionView::AddToPlaylist);
load_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, &InternetCollectionView::Load);
open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), tr("Open in new playlist"), this, &InternetCollectionView::OpenInNewPlaylist);
context_menu_->addSeparator();
add_to_playlist_enqueue_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue track"), this, SLOT(AddToPlaylistEnqueue()));
add_to_playlist_enqueue_next_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue to play next"), this, SLOT(AddToPlaylistEnqueueNext()));
add_to_playlist_enqueue_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue track"), this, &InternetCollectionView::AddToPlaylistEnqueue);
add_to_playlist_enqueue_next_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue to play next"), this, &InternetCollectionView::AddToPlaylistEnqueueNext);
context_menu_->addSeparator();
if (favorite_) {
remove_songs_ = context_menu_->addAction(IconLoader::Load("edit-delete"), tr("Remove from favorites"), this, SLOT(RemoveSongs()));
remove_songs_ = context_menu_->addAction(IconLoader::Load("edit-delete"), tr("Remove from favorites"), this, &InternetCollectionView::RemoveSelectedSongs);
context_menu_->addSeparator();
}
@@ -391,7 +391,7 @@ void InternetCollectionView::OpenInNewPlaylist() {
}
void InternetCollectionView::RemoveSongs() {
void InternetCollectionView::RemoveSelectedSongs() {
emit RemoveSongs(GetSelectedSongs());
@@ -405,12 +405,12 @@ void InternetCollectionView::keyboardSearch(const QString &search) {
}
void InternetCollectionView::scrollTo(const QModelIndex &index, ScrollHint hint) {
void InternetCollectionView::scrollTo(const QModelIndex &idx, ScrollHint hint) {
if (is_in_keyboard_search_)
QTreeView::scrollTo(index, QAbstractItemView::PositionAtTop);
QTreeView::scrollTo(idx, QAbstractItemView::PositionAtTop);
else
QTreeView::scrollTo(index, hint);
QTreeView::scrollTo(idx, hint);
}

View File

@@ -63,7 +63,7 @@ class InternetCollectionView : public AutoExpandingTreeView {
// QTreeView
void keyboardSearch(const QString &search) override;
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
void scrollTo(const QModelIndex &idx, ScrollHint hint = EnsureVisible) override;
int TotalSongs();
int TotalArtists();
@@ -85,8 +85,8 @@ class InternetCollectionView : public AutoExpandingTreeView {
void TotalSongCountUpdated_();
void TotalArtistCountUpdated_();
void TotalAlbumCountUpdated_();
void Error(const QString &message);
void RemoveSongs(const SongList &songs);
void Error(QString);
void RemoveSongs(SongList);
protected:
// QWidget
@@ -100,7 +100,7 @@ class InternetCollectionView : public AutoExpandingTreeView {
void AddToPlaylistEnqueue();
void AddToPlaylistEnqueueNext();
void OpenInNewPlaylist();
void RemoveSongs();
void RemoveSelectedSongs();
private:
void RecheckIsEmpty();

View File

@@ -32,16 +32,15 @@
InternetCollectionViewContainer::InternetCollectionViewContainer(QWidget *parent) :
QWidget(parent),
ui_(new Ui_InternetCollectionViewContainer)
{
ui_(new Ui_InternetCollectionViewContainer) {
ui_->setupUi(this);
view()->SetFilter(filter());
connect(filter(), SIGNAL(UpPressed()), view(), SLOT(UpAndFocus()));
connect(filter(), SIGNAL(DownPressed()), view(), SLOT(DownAndFocus()));
connect(filter(), SIGNAL(ReturnPressed()), view(), SLOT(FilterReturnPressed()));
connect(view(), SIGNAL(FocusOnFilterSignal(QKeyEvent*)), filter(), SLOT(FocusOnFilter(QKeyEvent*)));
QObject::connect(filter(), &CollectionFilterWidget::UpPressed, view(), &InternetCollectionView::UpAndFocus);
QObject::connect(filter(), &CollectionFilterWidget::DownPressed, view(), &InternetCollectionView::DownAndFocus);
QObject::connect(filter(), &CollectionFilterWidget::ReturnPressed, view(), &InternetCollectionView::FilterReturnPressed);
QObject::connect(view(), &InternetCollectionView::FocusOnFilterSignal, filter(), &CollectionFilterWidget::FocusOnFilter);
ui_->progressbar->hide();

View File

@@ -57,4 +57,4 @@ class InternetPlaylistItem : public PlaylistItem {
Song metadata_;
};
#endif
#endif // INTERNETPLAYLISTITEM_H

View File

@@ -293,8 +293,8 @@ void InternetSearchModel::Clear() {
InternetSearchView::ResultList InternetSearchModel::GetChildResults(const QModelIndexList &indexes) const {
QList<QStandardItem*> items;
for (const QModelIndex &index : indexes) {
items << itemFromIndex(index);
for (const QModelIndex &idx : indexes) {
items << itemFromIndex(idx);
}
return GetChildResults(items);
@@ -327,8 +327,8 @@ void InternetSearchModel::GetChildResults(const QStandardItem *item, InternetSea
// Yes - visit all the children, but do so through the proxy so we get them in the right order.
for (int i = 0 ; i < item->rowCount() ; ++i) {
const QModelIndex proxy_index = parent_proxy_index.model()->index(i, 0, parent_proxy_index);
const QModelIndex index = proxy_->mapToSource(proxy_index);
GetChildResults(itemFromIndex(index), results, visited);
const QModelIndex idx = proxy_->mapToSource(proxy_index);
GetChildResults(itemFromIndex(idx), results, visited);
}
}
else {

View File

@@ -185,30 +185,30 @@ void InternetSearchView::Init(Application *app, InternetService *service) {
QMenu *settings_menu = new QMenu(this);
settings_menu->addActions(group_by_actions_->actions());
settings_menu->addSeparator();
settings_menu->addAction(IconLoader::Load("configure"), tr("Configure %1...").arg(Song::TextForSource(service_->source())), this, SLOT(OpenSettingsDialog()));
settings_menu->addAction(IconLoader::Load("configure"), tr("Configure %1...").arg(Song::TextForSource(service_->source())), this, &InternetSearchView::OpenSettingsDialog);
ui_->settings->setMenu(settings_menu);
swap_models_timer_->setSingleShot(true);
swap_models_timer_->setInterval(kSwapModelsTimeoutMsec);
connect(swap_models_timer_, SIGNAL(timeout()), SLOT(SwapModels()));
QObject::connect(swap_models_timer_, &QTimer::timeout, this, &InternetSearchView::SwapModels);
connect(ui_->radiobutton_search_artists, SIGNAL(clicked(bool)), SLOT(SearchArtistsClicked(bool)));
connect(ui_->radiobutton_search_albums, SIGNAL(clicked(bool)), SLOT(SearchAlbumsClicked(bool)));
connect(ui_->radiobutton_search_songs, SIGNAL(clicked(bool)), SLOT(SearchSongsClicked(bool)));
connect(group_by_actions_, SIGNAL(triggered(QAction*)), SLOT(GroupByClicked(QAction*)));
connect(group_by_actions_, SIGNAL(triggered(QAction*)), SLOT(GroupByClicked(QAction*)));
QObject::connect(ui_->radiobutton_search_artists, &QRadioButton::clicked, this, &InternetSearchView::SearchArtistsClicked);
QObject::connect(ui_->radiobutton_search_albums, &QRadioButton::clicked, this, &InternetSearchView::SearchAlbumsClicked);
QObject::connect(ui_->radiobutton_search_songs, &QRadioButton::clicked, this, &InternetSearchView::SearchSongsClicked);
QObject::connect(group_by_actions_, &QActionGroup::triggered, this, &InternetSearchView::GroupByClicked);
QObject::connect(group_by_actions_, &QActionGroup::triggered, this, &InternetSearchView::GroupByClicked);
connect(ui_->search, SIGNAL(textChanged(QString)), SLOT(TextEdited(QString)));
connect(ui_->results, SIGNAL(AddToPlaylistSignal(QMimeData*)), SIGNAL(AddToPlaylist(QMimeData*)));
connect(ui_->results, SIGNAL(FocusOnFilterSignal(QKeyEvent*)), SLOT(FocusOnFilter(QKeyEvent*)));
QObject::connect(ui_->search, &QSearchField::textChanged, this, &InternetSearchView::TextEdited);
QObject::connect(ui_->results, &AutoExpandingTreeView::AddToPlaylistSignal, this, &InternetSearchView::AddToPlaylist);
QObject::connect(ui_->results, &AutoExpandingTreeView::FocusOnFilterSignal, this, &InternetSearchView::FocusOnFilter);
connect(service_, SIGNAL(SearchUpdateStatus(int, QString)), SLOT(UpdateStatus(int, QString)));
connect(service_, SIGNAL(SearchProgressSetMaximum(int, int)), SLOT(ProgressSetMaximum(int, int)));
connect(service_, SIGNAL(SearchUpdateProgress(int, int)), SLOT(UpdateProgress(int, int)));
connect(service_, SIGNAL(SearchResults(int, SongList, QString)), SLOT(SearchDone(int, SongList, QString)));
QObject::connect(service_, &InternetService::SearchUpdateStatus, this, &InternetSearchView::UpdateStatus);
QObject::connect(service_, &InternetService::SearchProgressSetMaximum, this, &InternetSearchView::ProgressSetMaximum);
QObject::connect(service_, &InternetService::SearchUpdateProgress, this, &InternetSearchView::UpdateProgress);
QObject::connect(service_, &InternetService::SearchResults, this, &InternetSearchView::SearchDone);
connect(app_, SIGNAL(SettingsChanged()), SLOT(ReloadSettings()));
connect(app_->album_cover_loader(), SIGNAL(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)), SLOT(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)));
QObject::connect(app_, &Application::SettingsChanged, this, &InternetSearchView::ReloadSettings);
QObject::connect(app_->album_cover_loader(), &AlbumCoverLoader::AlbumCoverLoaded, this, &InternetSearchView::AlbumCoverLoaded);
ReloadSettings();
@@ -315,36 +315,36 @@ bool InternetSearchView::SearchKeyEvent(QKeyEvent *e) {
bool InternetSearchView::ResultsContextMenuEvent(QContextMenuEvent *e) {
context_menu_ = new QMenu(this);
context_actions_ << context_menu_->addAction( IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, SLOT(AddSelectedToPlaylist()));
context_actions_ << context_menu_->addAction( IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, SLOT(LoadSelected()));
context_actions_ << context_menu_->addAction( IconLoader::Load("document-new"), tr("Open in new playlist"), this, SLOT(OpenSelectedInNewPlaylist()));
context_actions_ << context_menu_->addAction( IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, &InternetSearchView::AddSelectedToPlaylist);
context_actions_ << context_menu_->addAction( IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, &InternetSearchView::LoadSelected);
context_actions_ << context_menu_->addAction( IconLoader::Load("document-new"), tr("Open in new playlist"), this, &InternetSearchView::OpenSelectedInNewPlaylist);
context_menu_->addSeparator();
context_actions_ << context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue track"), this, SLOT(AddSelectedToPlaylistEnqueue()));
context_actions_ << context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue track"), this, &InternetSearchView::AddSelectedToPlaylistEnqueue);
context_menu_->addSeparator();
if (service_->artists_collection_model() || service_->albums_collection_model() || service_->songs_collection_model()) {
if (service_->artists_collection_model()) {
context_actions_ << context_menu_->addAction(IconLoader::Load("folder-new"), tr("Add to artists"), this, SLOT(AddArtists()));
context_actions_ << context_menu_->addAction(IconLoader::Load("folder-new"), tr("Add to artists"), this, &InternetSearchView::AddArtists);
}
if (service_->albums_collection_model()) {
context_actions_ << context_menu_->addAction(IconLoader::Load("folder-new"), tr("Add to albums"), this, SLOT(AddAlbums()));
context_actions_ << context_menu_->addAction(IconLoader::Load("folder-new"), tr("Add to albums"), this, &InternetSearchView::AddAlbums);
}
if (service_->songs_collection_model()) {
context_actions_ << context_menu_->addAction(IconLoader::Load("folder-new"), tr("Add to songs"), this, SLOT(AddSongs()));
context_actions_ << context_menu_->addAction(IconLoader::Load("folder-new"), tr("Add to songs"), this, &InternetSearchView::AddSongs);
}
context_menu_->addSeparator();
}
if (ui_->results->selectionModel() && ui_->results->selectionModel()->selectedRows().length() == 1) {
context_actions_ << context_menu_->addAction(IconLoader::Load("search"), tr("Search for this"), this, SLOT(SearchForThis()));
context_actions_ << context_menu_->addAction(IconLoader::Load("search"), tr("Search for this"), this, &InternetSearchView::SearchForThis);
}
context_menu_->addSeparator();
context_menu_->addMenu(tr("Group by"))->addActions(group_by_actions_->actions());
context_menu_->addAction(IconLoader::Load("configure"), tr("Configure %1...").arg(Song::TextForSource(service_->source())), this, SLOT(OpenSettingsDialog()));
context_menu_->addAction(IconLoader::Load("configure"), tr("Configure %1...").arg(Song::TextForSource(service_->source())), this, &InternetSearchView::OpenSettingsDialog);
const bool enable_context_actions = ui_->results->selectionModel() && ui_->results->selectionModel()->hasSelection();
@@ -589,10 +589,10 @@ MimeData *InternetSearchView::SelectedMimeData() {
if (indexes.isEmpty()) {
// There's nothing selected - take the first thing in the model that isn't a divider.
for (int i = 0 ; i < front_proxy_->rowCount() ; ++i) {
QModelIndex index = front_proxy_->index(i, 0);
if (!index.data(CollectionModel::Role_IsDivider).toBool()) {
indexes << index;
ui_->results->setCurrentIndex(index);
QModelIndex idx = front_proxy_->index(i, 0);
if (!idx.data(CollectionModel::Role_IsDivider).toBool()) {
indexes << idx;
ui_->results->setCurrentIndex(idx);
break;
}
}
@@ -605,8 +605,8 @@ MimeData *InternetSearchView::SelectedMimeData() {
// Get items for these indexes
QList<QStandardItem*> items;
for (const QModelIndex &index : indexes) {
items << (front_model_->itemFromIndex(front_proxy_->mapToSource(index)));
for (const QModelIndex &idx : indexes) {
items << (front_model_->itemFromIndex(front_proxy_->mapToSource(idx)));
}
// Get a MimeData for these items
@@ -675,7 +675,7 @@ void InternetSearchView::GroupByClicked(QAction *action) {
if (action->property("group_by").isNull()) {
if (!group_by_dialog_) {
group_by_dialog_.reset(new GroupByDialog);
connect(group_by_dialog_.get(), SIGNAL(Accepted(CollectionModel::Grouping)), SLOT(SetGroupBy(CollectionModel::Grouping)));
QObject::connect(group_by_dialog_.get(), &GroupByDialog::Accepted, this, &InternetSearchView::SetGroupBy);
}
group_by_dialog_->show();

View File

@@ -86,7 +86,7 @@ class InternetSearchView : public QWidget {
void Init(Application *app, InternetService *service);
void LazyLoadAlbumCover(const QModelIndex &index);
void LazyLoadAlbumCover(const QModelIndex &idx);
protected:
struct PendingState {

View File

@@ -84,51 +84,51 @@ class InternetService : public QObject {
void ExitFinished();
void Login();
void Logout();
void Login(const QString &api_token, const QString &username, const QString &password);
void Login(const QString &hostname, const int, const QString &username, const QString &password);
void LoginWithCredentials(QString api_token, QString username, QString password);
void LoginWithHostname(QString hostname, int, QString username, QString password);
void LoginSuccess();
void LoginFailure(const QString &failure_reason);
void LoginComplete(const bool success, QString error = QString());
void LoginFailure(QString failure_reason);
void LoginComplete(bool success, QString error = QString());
void TestSuccess();
void TestFailure(const QString &failure_reason);
void TestComplete(const bool success, QString error = QString());
void TestFailure(QString failure_reason);
void TestComplete(bool success, QString error = QString());
void Error(const QString &error);
void Results(const SongList &songs, const QString &error);
void UpdateStatus(const QString &text);
void ProgressSetMaximum(const int max);
void UpdateProgress(const int max);
void Error(QString error);
void Results(SongList songs, QString error);
void UpdateStatus(QString text);
void ProgressSetMaximum(int max);
void UpdateProgress(int max);
void ArtistsResults(const SongList &songs, const QString &error);
void ArtistsUpdateStatus(const QString &text);
void ArtistsProgressSetMaximum(const int max);
void ArtistsUpdateProgress(const int max);
void ArtistsResults(SongList songs, QString error);
void ArtistsUpdateStatus(QString text);
void ArtistsProgressSetMaximum(int max);
void ArtistsUpdateProgress(int max);
void AlbumsResults(const SongList &songs, const QString &error);
void AlbumsUpdateStatus(const QString &text);
void AlbumsProgressSetMaximum(const int max);
void AlbumsUpdateProgress(const int max);
void AlbumsResults(SongList songs, QString error);
void AlbumsUpdateStatus(QString text);
void AlbumsProgressSetMaximum(int max);
void AlbumsUpdateProgress(int max);
void SongsResults(const SongList &songs, const QString &error);
void SongsUpdateStatus(const QString &text);
void SongsProgressSetMaximum(const int max);
void SongsUpdateProgress(const int max);
void SongsResults(SongList songs, QString error);
void SongsUpdateStatus(QString text);
void SongsProgressSetMaximum(int max);
void SongsUpdateProgress(int max);
void SearchResults(const int id, const SongList &songs, const QString &error);
void SearchUpdateStatus(const int id, const QString &text);
void SearchProgressSetMaximum(const int id, const int max);
void SearchUpdateProgress(const int id, const int max);
void SearchResults(int id, SongList songs, QString error);
void SearchUpdateStatus(int id, QString text);
void SearchProgressSetMaximum(int id, int max);
void SearchUpdateProgress(int id, int max);
void AddArtists(const SongList& songs);
void AddAlbums(const SongList& songs);
void AddSongs(const SongList& songs);
void AddArtists(SongList);
void AddAlbums(SongList);
void AddSongs(SongList);
void RemoveArtists(const SongList& songs);
void RemoveAlbums(const SongList& songs);
void RemoveSongs(const SongList& songs);
void RemoveArtists(SongList);
void RemoveAlbums(SongList);
void RemoveSongs(SongList);
void StreamURLFinished(const QUrl &original_url, const QUrl &stream_url, const Song::FileType filetype, const int samplerate, const int bit_depth, const qint64 duration, QString error = QString());
void StreamURLFinished(QUrl original_url, QUrl stream_url, Song::FileType filetype, int samplerate, int bit_depth, qint64 duration, QString error = QString());
protected:
Application *app_;
@@ -143,4 +143,4 @@ class InternetService : public QObject {
};
Q_DECLARE_METATYPE(InternetService*)
#endif
#endif // INTERNETSERVICE_H

View File

@@ -54,7 +54,7 @@ void InternetServices::RemoveService(InternetService *service) {
if (!services_.contains(service->source())) return;
services_.remove(service->source());
disconnect(service, nullptr, this, nullptr);
QObject::disconnect(service, nullptr, this, nullptr);
qLog(Debug) << "Removed internet service" << service->name();
@@ -77,7 +77,7 @@ void InternetServices::Exit() {
for (InternetService *service : services_.values()) {
wait_for_exit_ << service;
connect(service, SIGNAL(ExitFinished()), this, SLOT(ExitReceived()));
QObject::connect(service, &InternetService::ExitFinished, this, &InternetServices::ExitReceived);
service->Exit();
}
if (wait_for_exit_.isEmpty()) emit ExitFinished();

View File

@@ -63,4 +63,4 @@ class InternetServices : public QObject {
};
#endif
#endif // INTERNETSERVICES_H

View File

@@ -36,4 +36,4 @@ class InternetSongMimeData : public MimeData {
SongList songs;
};
#endif
#endif // INTERNETSONGMIMEDATA_H

View File

@@ -59,25 +59,25 @@ InternetSongsView::InternetSongsView(Application *app, InternetService *service,
ui_->filter->SetCollectionModel(service_->songs_collection_model());
QAction *action_configure = new QAction(IconLoader::Load("configure"), tr("Configure %1...").arg(Song::TextForSource(service_->source())), this);
connect(action_configure, SIGNAL(triggered()), SLOT(OpenSettingsDialog()));
QObject::connect(action_configure, &QAction::triggered, this, &InternetSongsView::OpenSettingsDialog);
ui_->filter->AddMenuAction(action_configure);
connect(ui_->view, SIGNAL(GetSongs()), SLOT(GetSongs()));
connect(ui_->view, SIGNAL(RemoveSongs(SongList)), service_, SIGNAL(RemoveSongs(SongList)));
QObject::connect(ui_->view, &InternetCollectionView::GetSongs, this, &InternetSongsView::GetSongs);
QObject::connect(ui_->view, &InternetCollectionView::RemoveSongs, service_, &InternetService::RemoveSongs);
connect(ui_->refresh, SIGNAL(clicked()), SLOT(GetSongs()));
connect(ui_->close, SIGNAL(clicked()), SLOT(AbortGetSongs()));
connect(ui_->abort, SIGNAL(clicked()), SLOT(AbortGetSongs()));
connect(service_, SIGNAL(SongsResults(SongList, QString)), SLOT(SongsFinished(SongList, QString)));
connect(service_, SIGNAL(SongsUpdateStatus(QString)), ui_->status, SLOT(setText(QString)));
connect(service_, SIGNAL(SongsProgressSetMaximum(int)), ui_->progressbar, SLOT(setMaximum(int)));
connect(service_, SIGNAL(SongsUpdateProgress(int)), ui_->progressbar, SLOT(setValue(int)));
QObject::connect(ui_->refresh, &QPushButton::clicked, this, &InternetSongsView::GetSongs);
QObject::connect(ui_->close, &QPushButton::clicked, this, &InternetSongsView::AbortGetSongs);
QObject::connect(ui_->abort, &QPushButton::clicked, this, &InternetSongsView::AbortGetSongs);
QObject::connect(service_, &InternetService::SongsResults, this, &InternetSongsView::SongsFinished);
QObject::connect(service_, &InternetService::SongsUpdateStatus, ui_->status, &QLabel::setText);
QObject::connect(service_, &InternetService::SongsProgressSetMaximum, ui_->progressbar, &QProgressBar::setMaximum);
QObject::connect(service_, &InternetService::SongsUpdateProgress, ui_->progressbar, &QProgressBar::setValue);
connect(service_->songs_collection_model(), SIGNAL(TotalArtistCountUpdated(int)), ui_->view, SLOT(TotalArtistCountUpdated(int)));
connect(service_->songs_collection_model(), SIGNAL(TotalAlbumCountUpdated(int)), ui_->view, SLOT(TotalAlbumCountUpdated(int)));
connect(service_->songs_collection_model(), SIGNAL(TotalSongCountUpdated(int)), ui_->view, SLOT(TotalSongCountUpdated(int)));
connect(service_->songs_collection_model(), SIGNAL(modelAboutToBeReset()), ui_->view, SLOT(SaveFocus()));
connect(service_->songs_collection_model(), SIGNAL(modelReset()), ui_->view, SLOT(RestoreFocus()));
QObject::connect(service_->songs_collection_model(), &CollectionModel::TotalArtistCountUpdated, ui_->view, &InternetCollectionView::TotalArtistCountUpdated);
QObject::connect(service_->songs_collection_model(), &CollectionModel::TotalAlbumCountUpdated, ui_->view, &InternetCollectionView::TotalAlbumCountUpdated);
QObject::connect(service_->songs_collection_model(), &CollectionModel::TotalSongCountUpdated, ui_->view, &InternetCollectionView::TotalSongCountUpdated);
QObject::connect(service_->songs_collection_model(), &CollectionModel::modelAboutToBeReset, ui_->view, &InternetCollectionView::SaveFocus);
QObject::connect(service_->songs_collection_model(), &CollectionModel::modelReset, ui_->view, &InternetCollectionView::RestoreFocus);
ReloadSettings();

View File

@@ -56,12 +56,12 @@ InternetTabsView::InternetTabsView(Application *app, InternetService *service, c
ui_->setupUi(this);
ui_->search_view->Init(app, service);
connect(ui_->search_view, SIGNAL(AddArtistsSignal(SongList)), service_, SIGNAL(AddArtists(SongList)));
connect(ui_->search_view, SIGNAL(AddAlbumsSignal(SongList)), service_, SIGNAL(AddAlbums(SongList)));
connect(ui_->search_view, SIGNAL(AddSongsSignal(SongList)), service_, SIGNAL(AddSongs(SongList)));
QObject::connect(ui_->search_view, &InternetSearchView::AddArtistsSignal, service_, &InternetService::AddArtists);
QObject::connect(ui_->search_view, &InternetSearchView::AddAlbumsSignal, service_, &InternetService::AddAlbums);
QObject::connect(ui_->search_view, &InternetSearchView::AddSongsSignal, service_, &InternetService::AddSongs);
QAction *action_configure = new QAction(IconLoader::Load("configure"), tr("Configure %1...").arg(Song::TextForSource(service_->source())), this);
connect(action_configure, SIGNAL(triggered()), SLOT(OpenSettingsDialog()));
QObject::connect(action_configure, &QAction::triggered, this, &InternetTabsView::OpenSettingsDialog);
if (service_->artists_collection_model()) {
ui_->artists_collection->stacked()->setCurrentWidget(ui_->artists_collection->internetcollection_page());
@@ -73,22 +73,22 @@ InternetTabsView::InternetTabsView(Application *app, InternetService *service, c
ui_->artists_collection->filter()->SetCollectionModel(service_->artists_collection_model());
ui_->artists_collection->filter()->AddMenuAction(action_configure);
connect(ui_->artists_collection->view(), SIGNAL(GetSongs()), SLOT(GetArtists()));
connect(ui_->artists_collection->view(), SIGNAL(RemoveSongs(SongList)), service_, SIGNAL(RemoveArtists(SongList)));
QObject::connect(ui_->artists_collection->view(), &InternetCollectionView::GetSongs, this, &InternetTabsView::GetArtists);
QObject::connect(ui_->artists_collection->view(), &InternetCollectionView::RemoveSongs, service_, &InternetService::RemoveArtists);
connect(ui_->artists_collection->button_refresh(), SIGNAL(clicked()), SLOT(GetArtists()));
connect(ui_->artists_collection->button_close(), SIGNAL(clicked()), SLOT(AbortGetArtists()));
connect(ui_->artists_collection->button_abort(), SIGNAL(clicked()), SLOT(AbortGetArtists()));
connect(service_, SIGNAL(ArtistsResults(SongList, QString)), SLOT(ArtistsFinished(SongList, QString)));
connect(service_, SIGNAL(ArtistsUpdateStatus(QString)), ui_->artists_collection->status(), SLOT(setText(QString)));
connect(service_, SIGNAL(ArtistsProgressSetMaximum(int)), ui_->artists_collection->progressbar(), SLOT(setMaximum(int)));
connect(service_, SIGNAL(ArtistsUpdateProgress(int)), ui_->artists_collection->progressbar(), SLOT(setValue(int)));
QObject::connect(ui_->artists_collection->button_refresh(), &QPushButton::clicked, this, &InternetTabsView::GetArtists);
QObject::connect(ui_->artists_collection->button_close(), &QPushButton::clicked, this, &InternetTabsView::AbortGetArtists);
QObject::connect(ui_->artists_collection->button_abort(), &QPushButton::clicked, this, &InternetTabsView::AbortGetArtists);
QObject::connect(service_, &InternetService::ArtistsResults, this, &InternetTabsView::ArtistsFinished);
QObject::connect(service_, &InternetService::ArtistsUpdateStatus, ui_->artists_collection->status(), &QLabel::setText);
QObject::connect(service_, &InternetService::ArtistsProgressSetMaximum, ui_->artists_collection->progressbar(), &QProgressBar::setMaximum);
QObject::connect(service_, &InternetService::ArtistsUpdateProgress, ui_->artists_collection->progressbar(), &QProgressBar::setValue);
connect(service_->artists_collection_model(), SIGNAL(TotalArtistCountUpdated(int)), ui_->artists_collection->view(), SLOT(TotalArtistCountUpdated(int)));
connect(service_->artists_collection_model(), SIGNAL(TotalAlbumCountUpdated(int)), ui_->artists_collection->view(), SLOT(TotalAlbumCountUpdated(int)));
connect(service_->artists_collection_model(), SIGNAL(TotalSongCountUpdated(int)), ui_->artists_collection->view(), SLOT(TotalSongCountUpdated(int)));
connect(service_->artists_collection_model(), SIGNAL(modelAboutToBeReset()), ui_->artists_collection->view(), SLOT(SaveFocus()));
connect(service_->artists_collection_model(), SIGNAL(modelReset()), ui_->artists_collection->view(), SLOT(RestoreFocus()));
QObject::connect(service_->artists_collection_model(), &CollectionModel::TotalArtistCountUpdated, ui_->artists_collection->view(), &InternetCollectionView::TotalArtistCountUpdated);
QObject::connect(service_->artists_collection_model(), &CollectionModel::TotalAlbumCountUpdated, ui_->artists_collection->view(), &InternetCollectionView::TotalAlbumCountUpdated);
QObject::connect(service_->artists_collection_model(), &CollectionModel::TotalSongCountUpdated, ui_->artists_collection->view(), &InternetCollectionView::TotalSongCountUpdated);
QObject::connect(service_->artists_collection_model(), &CollectionModel::modelAboutToBeReset, ui_->artists_collection->view(), &InternetCollectionView::SaveFocus);
QObject::connect(service_->artists_collection_model(), &CollectionModel::modelReset, ui_->artists_collection->view(), &InternetCollectionView::RestoreFocus);
}
else {
@@ -105,22 +105,22 @@ InternetTabsView::InternetTabsView(Application *app, InternetService *service, c
ui_->albums_collection->filter()->SetCollectionModel(service_->albums_collection_model());
ui_->albums_collection->filter()->AddMenuAction(action_configure);
connect(ui_->albums_collection->view(), SIGNAL(GetSongs()), SLOT(GetAlbums()));
connect(ui_->albums_collection->view(), SIGNAL(RemoveSongs(SongList)), service_, SIGNAL(RemoveAlbums(SongList)));
QObject::connect(ui_->albums_collection->view(), &InternetCollectionView::GetSongs, this, &InternetTabsView::GetAlbums);
QObject::connect(ui_->albums_collection->view(), &InternetCollectionView::RemoveSongs, service_, &InternetService::RemoveAlbums);
connect(ui_->albums_collection->button_refresh(), SIGNAL(clicked()), SLOT(GetAlbums()));
connect(ui_->albums_collection->button_close(), SIGNAL(clicked()), SLOT(AbortGetAlbums()));
connect(ui_->albums_collection->button_abort(), SIGNAL(clicked()), SLOT(AbortGetAlbums()));
connect(service_, SIGNAL(AlbumsResults(SongList, QString)), SLOT(AlbumsFinished(SongList, QString)));
connect(service_, SIGNAL(AlbumsUpdateStatus(QString)), ui_->albums_collection->status(), SLOT(setText(QString)));
connect(service_, SIGNAL(AlbumsProgressSetMaximum(int)), ui_->albums_collection->progressbar(), SLOT(setMaximum(int)));
connect(service_, SIGNAL(AlbumsUpdateProgress(int)), ui_->albums_collection->progressbar(), SLOT(setValue(int)));
QObject::connect(ui_->albums_collection->button_refresh(), &QPushButton::clicked, this, &InternetTabsView::GetAlbums);
QObject::connect(ui_->albums_collection->button_close(), &QPushButton::clicked, this, &InternetTabsView::AbortGetAlbums);
QObject::connect(ui_->albums_collection->button_abort(), &QPushButton::clicked, this, &InternetTabsView::AbortGetAlbums);
QObject::connect(service_, &InternetService::AlbumsResults, this, &InternetTabsView::AlbumsFinished);
QObject::connect(service_, &InternetService::AlbumsUpdateStatus, ui_->albums_collection->status(), &QLabel::setText);
QObject::connect(service_, &InternetService::AlbumsProgressSetMaximum, ui_->albums_collection->progressbar(), &QProgressBar::setMaximum);
QObject::connect(service_, &InternetService::AlbumsUpdateProgress, ui_->albums_collection->progressbar(), &QProgressBar::setValue);
connect(service_->albums_collection_model(), SIGNAL(TotalArtistCountUpdated(int)), ui_->albums_collection->view(), SLOT(TotalArtistCountUpdated(int)));
connect(service_->albums_collection_model(), SIGNAL(TotalAlbumCountUpdated(int)), ui_->albums_collection->view(), SLOT(TotalAlbumCountUpdated(int)));
connect(service_->albums_collection_model(), SIGNAL(TotalSongCountUpdated(int)), ui_->albums_collection->view(), SLOT(TotalSongCountUpdated(int)));
connect(service_->albums_collection_model(), SIGNAL(modelAboutToBeReset()), ui_->albums_collection->view(), SLOT(SaveFocus()));
connect(service_->albums_collection_model(), SIGNAL(modelReset()), ui_->albums_collection->view(), SLOT(RestoreFocus()));
QObject::connect(service_->albums_collection_model(), &CollectionModel::TotalArtistCountUpdated, ui_->albums_collection->view(), &InternetCollectionView::TotalArtistCountUpdated);
QObject::connect(service_->albums_collection_model(), &CollectionModel::TotalAlbumCountUpdated, ui_->albums_collection->view(), &InternetCollectionView::TotalAlbumCountUpdated);
QObject::connect(service_->albums_collection_model(), &CollectionModel::TotalSongCountUpdated, ui_->albums_collection->view(), &InternetCollectionView::TotalSongCountUpdated);
QObject::connect(service_->albums_collection_model(), &CollectionModel::modelAboutToBeReset, ui_->albums_collection->view(), &InternetCollectionView::SaveFocus);
QObject::connect(service_->albums_collection_model(), &CollectionModel::modelReset, ui_->albums_collection->view(), &InternetCollectionView::RestoreFocus);
}
else {
@@ -137,22 +137,22 @@ InternetTabsView::InternetTabsView(Application *app, InternetService *service, c
ui_->songs_collection->filter()->SetCollectionModel(service_->songs_collection_model());
ui_->songs_collection->filter()->AddMenuAction(action_configure);
connect(ui_->songs_collection->view(), SIGNAL(GetSongs()), SLOT(GetSongs()));
connect(ui_->songs_collection->view(), SIGNAL(RemoveSongs(SongList)), service_, SIGNAL(RemoveSongs(SongList)));
QObject::connect(ui_->songs_collection->view(), &InternetCollectionView::GetSongs, this, &InternetTabsView::GetSongs);
QObject::connect(ui_->songs_collection->view(), &InternetCollectionView::RemoveSongs, service_, &InternetService::RemoveSongs);
connect(ui_->songs_collection->button_refresh(), SIGNAL(clicked()), SLOT(GetSongs()));
connect(ui_->songs_collection->button_close(), SIGNAL(clicked()), SLOT(AbortGetSongs()));
connect(ui_->songs_collection->button_abort(), SIGNAL(clicked()), SLOT(AbortGetSongs()));
connect(service_, SIGNAL(SongsResults(SongList, QString)), SLOT(SongsFinished(SongList, QString)));
connect(service_, SIGNAL(SongsUpdateStatus(QString)), ui_->songs_collection->status(), SLOT(setText(QString)));
connect(service_, SIGNAL(SongsProgressSetMaximum(int)), ui_->songs_collection->progressbar(), SLOT(setMaximum(int)));
connect(service_, SIGNAL(SongsUpdateProgress(int)), ui_->songs_collection->progressbar(), SLOT(setValue(int)));
QObject::connect(ui_->songs_collection->button_refresh(), &QPushButton::clicked, this, &InternetTabsView::GetSongs);
QObject::connect(ui_->songs_collection->button_close(), &QPushButton::clicked, this, &InternetTabsView::AbortGetSongs);
QObject::connect(ui_->songs_collection->button_abort(), &QPushButton::clicked, this, &InternetTabsView::AbortGetSongs);
QObject::connect(service_, &InternetService::SongsResults, this, &InternetTabsView::SongsFinished);
QObject::connect(service_, &InternetService::SongsUpdateStatus, ui_->songs_collection->status(), &QLabel::setText);
QObject::connect(service_, &InternetService::SongsProgressSetMaximum, ui_->songs_collection->progressbar(), &QProgressBar::setMaximum);
QObject::connect(service_, &InternetService::SongsUpdateProgress, ui_->songs_collection->progressbar(), &QProgressBar::setValue);
connect(service_->songs_collection_model(), SIGNAL(TotalArtistCountUpdated(int)), ui_->songs_collection->view(), SLOT(TotalArtistCountUpdated(int)));
connect(service_->songs_collection_model(), SIGNAL(TotalAlbumCountUpdated(int)), ui_->songs_collection->view(), SLOT(TotalAlbumCountUpdated(int)));
connect(service_->songs_collection_model(), SIGNAL(TotalSongCountUpdated(int)), ui_->songs_collection->view(), SLOT(TotalSongCountUpdated(int)));
connect(service_->songs_collection_model(), SIGNAL(modelAboutToBeReset()), ui_->songs_collection->view(), SLOT(SaveFocus()));
connect(service_->songs_collection_model(), SIGNAL(modelReset()), ui_->songs_collection->view(), SLOT(RestoreFocus()));
QObject::connect(service_->songs_collection_model(), &CollectionModel::TotalArtistCountUpdated, ui_->songs_collection->view(), &InternetCollectionView::TotalArtistCountUpdated);
QObject::connect(service_->songs_collection_model(), &CollectionModel::TotalAlbumCountUpdated, ui_->songs_collection->view(), &InternetCollectionView::TotalAlbumCountUpdated);
QObject::connect(service_->songs_collection_model(), &CollectionModel::TotalSongCountUpdated, ui_->songs_collection->view(), &InternetCollectionView::TotalSongCountUpdated);
QObject::connect(service_->songs_collection_model(), &CollectionModel::modelAboutToBeReset, ui_->songs_collection->view(), &InternetCollectionView::SaveFocus);
QObject::connect(service_->songs_collection_model(), &CollectionModel::modelReset, ui_->songs_collection->view(), &InternetCollectionView::RestoreFocus);
}
else {

View File

@@ -252,7 +252,7 @@ bool LocalRedirectServer::Listen() {
url_.setHost("localhost");
url_.setPort(serverPort());
url_.setPath("/");
connect(this, SIGNAL(newConnection()), this, SLOT(NewConnection()));
QObject::connect(this, &QTcpServer::newConnection, this, &LocalRedirectServer::NewConnection);
return true;
@@ -290,8 +290,8 @@ void LocalRedirectServer::incomingConnection(qintptr socket_descriptor) {
ssl_socket->setProtocol(QSsl::TlsV1_2);
ssl_socket->startServerEncryption();
connect(ssl_socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(SSLErrors(QList<QSslError>)));
connect(ssl_socket, SIGNAL(encrypted()), this, SLOT(Encrypted()));
QObject::connect(ssl_socket, QOverload<const QList<QSslError>&>::of(&QSslSocket::sslErrors), this, &LocalRedirectServer::SSLErrors);
QObject::connect(ssl_socket, &QSslSocket::encrypted, this, &LocalRedirectServer::Encrypted);
socket_ = ssl_socket;
}
@@ -307,9 +307,9 @@ void LocalRedirectServer::incomingConnection(qintptr socket_descriptor) {
socket_ = tcp_socket;
}
connect(socket_, SIGNAL(connected()), this, SLOT(Connected()));
connect(socket_, SIGNAL(disconnected()), this, SLOT(Disconnected()));
connect(socket_, SIGNAL(readyRead()), this, SLOT(ReadyRead()));
QObject::connect(socket_, &QAbstractSocket::connected, this, &LocalRedirectServer::Connected);
QObject::connect(socket_, &QAbstractSocket::disconnected, this, &LocalRedirectServer::Disconnected);
QObject::connect(socket_, &QAbstractSocket::readyRead, this, &LocalRedirectServer::ReadyRead);
}
@@ -334,7 +334,7 @@ void LocalRedirectServer::ReadyRead() {
emit Finished();
}
else {
connect(socket_, SIGNAL(readyRead()), this, SLOT(ReadyRead()));
QObject::connect(socket_, &QAbstractSocket::readyRead, this, &LocalRedirectServer::ReadyRead);
}
}

View File

@@ -79,4 +79,4 @@ class LocalRedirectServer : public QTcpServer {
};
#endif
#endif // LOCALREDIRECTSERVER_H