mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 19:31:02 +01:00
Port InternetModel to closures.
This commit is contained in:
parent
ff86e07a4b
commit
42fb7f9b42
@ -103,6 +103,8 @@ void InternetModel::AddService(InternetService *service) {
|
||||
connect(service, SIGNAL(AddToPlaylistSignal(QMimeData*)), SIGNAL(AddToPlaylist(QMimeData*)));
|
||||
connect(service, SIGNAL(ScrollToIndex(QModelIndex)), SIGNAL(ScrollToIndex(QModelIndex)));
|
||||
connect(service, SIGNAL(destroyed()), SLOT(ServiceDeleted()));
|
||||
NewClosure(service, SIGNAL(destroyed()), this,
|
||||
SLOT(ServiceDeleted(InternetService*)), service);
|
||||
|
||||
service->ReloadSettings();
|
||||
}
|
||||
@ -127,8 +129,7 @@ void InternetModel::RemoveService(InternetService* service) {
|
||||
disconnect(service, 0, this, 0);
|
||||
}
|
||||
|
||||
void InternetModel::ServiceDeleted() {
|
||||
InternetService* service = qobject_cast<InternetService*>(sender());
|
||||
void InternetModel::ServiceDeleted(InternetService* service) {
|
||||
if (service)
|
||||
RemoveService(service);
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ signals:
|
||||
void ScrollToIndex(const QModelIndex& index);
|
||||
|
||||
private slots:
|
||||
void ServiceDeleted();
|
||||
void ServiceDeleted(InternetService* service);
|
||||
|
||||
private:
|
||||
static QMap<QString, InternetService*>* sServices;
|
||||
|
Loading…
Reference in New Issue
Block a user