コード例 #1
0
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();
    }
}
コード例 #2
0
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();
    }
}
コード例 #3
0
void SoundCloudPlaylistsWindow::showPlaylist(const QModelIndex &index) {
    if (SoundCloudPlaylist *playlist = m_model->get(index.row())) {
        SoundCloudPlaylistWindow *window = new SoundCloudPlaylistWindow(playlist, this);
        window->show();
    }
}