Revert revision 42fb7f9b4249.

Was generated SIGABRT while exiting Clementine, when calling ServiceDeleted SLOT, because of an assert in moc_internetmodel.
Seems that the receiver (so the parent) of the created Closure object isn't the same at the beginning (InternetModel) and when the Closure::Invoked method is called (QObject).
Reverting this until I can figure out what is going wrong.
This commit is contained in:
Arnaud Bienner 2012-10-15 23:02:13 +02:00
parent 95ce26a556
commit 60f22f5594
2 changed files with 4 additions and 4 deletions

View File

@ -104,8 +104,7 @@ void InternetModel::AddService(InternetService *service) {
connect(service, SIGNAL(StreamMetadataFound(QUrl,Song)), SIGNAL(StreamMetadataFound(QUrl,Song)));
connect(service, SIGNAL(AddToPlaylistSignal(QMimeData*)), SIGNAL(AddToPlaylist(QMimeData*)));
connect(service, SIGNAL(ScrollToIndex(QModelIndex)), SIGNAL(ScrollToIndex(QModelIndex)));
NewClosure(service, SIGNAL(destroyed()), this,
SLOT(ServiceDeleted(InternetService*)), service);
connect(service, SIGNAL(destroyed()), SLOT(ServiceDeleted()));
service->ReloadSettings();
}
@ -130,7 +129,8 @@ void InternetModel::RemoveService(InternetService* service) {
disconnect(service, 0, this, 0);
}
void InternetModel::ServiceDeleted(InternetService* service) {
void InternetModel::ServiceDeleted() {
InternetService* service = qobject_cast<InternetService*>(sender());
if (service)
RemoveService(service);
}

View File

@ -166,7 +166,7 @@ signals:
void ScrollToIndex(const QModelIndex& index);
private slots:
void ServiceDeleted(InternetService* service);
void ServiceDeleted();
private:
static QMap<QString, InternetService*>* sServices;