本文整理汇总了C++中tomahawk::result_ptr::linkUrl方法的典型用法代码示例。如果您正苦于以下问题:C++ result_ptr::linkUrl方法的具体用法?C++ result_ptr::linkUrl怎么用?C++ result_ptr::linkUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tomahawk::result_ptr
的用法示例。
在下文中一共展示了result_ptr::linkUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: disconnect
void
AudioControls::onPlaybackLoading( const Tomahawk::result_ptr result )
{
if ( !m_currentTrack.isNull() )
{
disconnect( m_currentTrack->track().data(), SIGNAL( coverChanged() ), this, SLOT( onCoverUpdated() ) );
disconnect( m_currentTrack->track().data(), SIGNAL( socialActionsLoaded() ), this, SLOT( onSocialActionsLoaded() ) );
}
m_currentTrack = result;
connect( m_currentTrack->track().data(), SIGNAL( coverChanged() ), SLOT( onCoverUpdated() ) );
connect( m_currentTrack->track().data(), SIGNAL( socialActionsLoaded() ), SLOT( onSocialActionsLoaded() ) );
ui->artistLabel->setResult( result );
ui->trackLabel->setResult( result );
const QString duration = TomahawkUtils::timeToString( result.data()->track()->duration() );
ui->timeLabel->setFixedWidth( ui->timeLabel->fontMetrics().width( QString( duration.length(), QChar( '0' ) ) ) );
ui->timeLabel->setText( TomahawkUtils::timeToString( 0 ) );
ui->timeLeftLabel->setFixedWidth( ui->timeLeftLabel->fontMetrics().width( QString( duration.length() + 1, QChar( '0' ) ) ) );
ui->timeLeftLabel->setText( "-" + duration );
m_lastTextSecondShown = 0;
ui->playPauseButton->setVisible( false );
ui->pauseButton->setVisible( true );
/* ui->loveButton->setEnabled( true );
ui->loveButton->setVisible( true );
ui->socialButton->setEnabled( true );
ui->socialButton->setVisible( m_shouldShowShareAction );*/
delete ui->horizontalLayout->takeAt( 1 );
ui->horizontalSpacer = new QSpacerItem( 162, 8, QSizePolicy::Minimum, QSizePolicy::Minimum );
ui->horizontalLayout->insertSpacerItem( 1, ui->horizontalSpacer );
ui->horizontalLayout->invalidate();
ui->dashLabel->setVisible( true );
ui->ownerButton->setEnabled( true );
ui->ownerButton->setVisible( true );
ui->timeLabel->setToolTip( tr( "Time Elapsed" ) );
ui->timeLeftLabel->setToolTip( tr( "Time Remaining" ) );
ui->shuffleButton->setToolTip( tr( "Shuffle" ) );
ui->repeatButton->setToolTip( tr( "Repeat" ) );
// ui->socialButton->setToolTip( tr( "Share" ) );
// ui->loveButton->setToolTip( tr( "Love" ) );
ui->ownerButton->setToolTip( QString( tr( "Playing from %1" ) ).arg( result->friendlySource() ) );
// stop the seek slider while we're still loading the track
ui->seekSlider->setRange( 0, 0 );
ui->seekSlider->setValue( 0 );
ui->seekSlider->setVisible( true );
m_sliderTimeLine.stop();
onControlStateChanged();
QPixmap sourceIcon = result->sourceIcon( TomahawkUtils::RoundedCorners, ui->ownerButton->size() );
if ( !sourceIcon.isNull() )
{
ui->ownerButton->setPixmap( sourceIcon );
}
else
{
ui->ownerButton->clear();
ui->ownerButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultResolver, TomahawkUtils::Original, QSize( 34, 34 ) ) );
}
if ( QUrl( result->linkUrl() ).isValid() || !result->resolvedByCollection().isNull() )
ui->ownerButton->setCursor( Qt::PointingHandCursor );
else
ui->ownerButton->setCursor( Qt::ArrowCursor );
setCover();
setSocialActions();
}
示例2: disconnect
void
AudioControls::onPlaybackLoading( const Tomahawk::result_ptr& result )
{
if ( !m_currentTrack.isNull() )
{
disconnect( m_currentTrack->toQuery().data(), SIGNAL( updated() ), this, SLOT( onCoverUpdated() ) );
disconnect( m_currentTrack->toQuery().data(), SIGNAL( socialActionsLoaded() ), this, SLOT( onSocialActionsLoaded() ) );
}
m_currentTrack = result;
connect( m_currentTrack->toQuery().data(), SIGNAL( updated() ), SLOT( onCoverUpdated() ) );
connect( m_currentTrack->toQuery().data(), SIGNAL( socialActionsLoaded() ), SLOT( onSocialActionsLoaded() ) );
ui->artistTrackLabel->setResult( result );
ui->albumLabel->setResult( result );
const QString duration = TomahawkUtils::timeToString( result.data()->duration() );
ui->timeLabel->setFixedWidth( ui->timeLabel->fontMetrics().width( QString( duration.length(), QChar( '0' ) ) ) );
ui->timeLabel->setText( TomahawkUtils::timeToString( 0 ) );
ui->timeLeftLabel->setFixedWidth( ui->timeLeftLabel->fontMetrics().width( QString( duration.length() + 1, QChar( '0' ) ) ) );
ui->timeLeftLabel->setText( "-" + duration );
m_lastTextSecondShown = 0;
ui->stackedLayout->setCurrentWidget( ui->pauseButton );
ui->loveButton->setEnabled( true );
ui->loveButton->setVisible( true );
ui->socialButton->setEnabled( true );
ui->socialButton->setVisible( true );
ui->ownerButton->setEnabled( true );
ui->ownerButton->setVisible( true );
ui->timeLabel->setToolTip( tr( "Time Elapsed" ) );
ui->timeLeftLabel->setToolTip( tr( "Time Remaining" ) );
ui->shuffleButton->setToolTip( tr( "Shuffle" ) );
ui->repeatButton->setToolTip( tr( "Repeat" ) );
ui->socialButton->setToolTip( tr( "Share" ) );
ui->loveButton->setToolTip( tr( "Love" ) );
ui->ownerButton->setToolTip( QString( tr( "Playing from %1" ) ).arg( result->friendlySource() ) );
// If the ViewManager doesn't know a page for the current interface, we can't offer the jump link
ui->artistTrackLabel->setJumpLinkVisible( ( ViewManager::instance()->pageForInterface( AudioEngine::instance()->currentTrackPlaylist() ) ) );
onControlStateChanged();
QPixmap sourceIcon = result->sourceIcon( TomahawkUtils::RoundedCorners, ui->ownerButton->size() );
if ( !sourceIcon.isNull() )
{
ui->ownerButton->setPixmap( sourceIcon );
}
else
{
ui->ownerButton->clear();
ui->ownerButton->setPixmap( TomahawkUtils::defaultPixmap( TomahawkUtils::DefaultResolver, TomahawkUtils::Original, QSize( 34, 34 ) ) );
}
if ( QUrl( result->linkUrl() ).isValid() || !result->collection().isNull() )
ui->ownerButton->setCursor( Qt::PointingHandCursor );
else
ui->ownerButton->setCursor( Qt::ArrowCursor );
setCover();
setSocialActions();
}