void SoundCloudPlaylistWindow::showTrack(const QModelIndex &index) { if (isBusy()) { return; } if (SoundCloudTrack *track = m_model->get(index.row())) { SoundCloudTrackWindow *window = new SoundCloudTrackWindow(track, this); window->show(); } }
void SoundCloudView::showResource(const QString &type, const QString &id) { if (type == Resources::PLAYLIST) { SoundCloudPlaylistWindow *window = new SoundCloudPlaylistWindow(id, StackedWindow::currentWindow()); window->show(); } else if (type == Resources::ARTIST) { SoundCloudArtistWindow *window = new SoundCloudArtistWindow(id, StackedWindow::currentWindow()); window->show(); } else { SoundCloudTrackWindow *window = new SoundCloudTrackWindow(id, StackedWindow::currentWindow()); window->show(); } }
void SoundCloudPlaylistWindow::showResource(const QUrl &url) { QVariantMap resource = Resources::getResourceFromUrl(url.toString()); if (resource.value("service") != Resources::SOUNDCLOUD) { QDesktopServices::openUrl(url); return; } if (resource.value("type") == Resources::PLAYLIST) { SoundCloudPlaylistWindow *window = new SoundCloudPlaylistWindow(resource.value("id").toString(), this); window->show(); } else if (resource.value("type") == Resources::ARTIST) { SoundCloudArtistWindow *window = new SoundCloudArtistWindow(resource.value("id").toString(), this); window->show(); } else { SoundCloudTrackWindow *window = new SoundCloudTrackWindow(resource.value("id").toString(), this); window->show(); } }