mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-08 10:02:29 +02:00
Remove compile warnings
This commit is contained in:
parent
1721a0b693
commit
999e0ad4c2
@ -177,7 +177,6 @@ GetNewStuffDelegate::paint( QPainter* painter, const QStyleOptionViewItem& optio
|
||||
int rating = index.data( GetNewStuffModel::RatingRole ).toInt();
|
||||
const int paddingBetweenStars = 2;
|
||||
const int ratingWidth = 5 * ( m_ratingStarPositive.width() + paddingBetweenStars );
|
||||
const int ratingY = ( btnRect.y() - ( btnRect.top() - opt.rect.y() ) / 2 ) - m_ratingStarNegative.height() / 2;
|
||||
int runningEdge = ( btnRect.right() - btnRect.width() / 2 ) - ratingWidth / 2;
|
||||
for ( int i = 1; i < 6; i++ )
|
||||
{
|
||||
@ -230,12 +229,15 @@ GetNewStuffDelegate::paint( QPainter* painter, const QStyleOptionViewItem& optio
|
||||
QSize
|
||||
GetNewStuffDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const
|
||||
{
|
||||
Q_UNUSED( option );
|
||||
Q_UNUSED( index );
|
||||
return QSize( 200, SIZEHINT_HEIGHT );
|
||||
}
|
||||
|
||||
bool
|
||||
GetNewStuffDelegate::editorEvent( QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index )
|
||||
{
|
||||
Q_UNUSED( option );
|
||||
if ( event->type() == QEvent::MouseButtonRelease && m_cachedButtonRects.contains( QPair<int, int>( index.row(), index.column() ) ) )
|
||||
{
|
||||
QRect rect = m_cachedButtonRects[ QPair<int, int>( index.row(), index.column() ) ];
|
||||
|
@ -101,12 +101,15 @@ GetNewStuffModel::data( const QModelIndex& index, int role ) const
|
||||
int
|
||||
GetNewStuffModel::rowCount( const QModelIndex& parent ) const
|
||||
{
|
||||
Q_UNUSED( parent );
|
||||
return m_contentList.count();
|
||||
}
|
||||
|
||||
bool
|
||||
GetNewStuffModel::setData( const QModelIndex &index, const QVariant &value, int role )
|
||||
{
|
||||
Q_UNUSED( value );
|
||||
Q_UNUSED( role );
|
||||
if ( !hasIndex( index.row(), index.column(), index.parent() ) )
|
||||
return false;
|
||||
|
||||
@ -132,6 +135,9 @@ GetNewStuffModel::setData( const QModelIndex &index, const QVariant &value, int
|
||||
case AtticaManager::NeedsUpgrade:
|
||||
AtticaManager::instance()->upgradeResolver( resolver );
|
||||
break;
|
||||
default:
|
||||
//FIXME -- this handles e.g. Failed
|
||||
break;
|
||||
};
|
||||
emit dataChanged( index, index );
|
||||
|
||||
|
@ -67,6 +67,7 @@ DropJob::mimeTypes()
|
||||
bool
|
||||
DropJob::acceptsMimeData( const QMimeData* data, DropJob::DropTypes acceptedType, DropJob::DropAction acceptedAction )
|
||||
{
|
||||
Q_UNUSED( acceptedAction );
|
||||
if ( data->hasFormat( "application/tomahawk.query.list" )
|
||||
|| data->hasFormat( "application/tomahawk.plentry.list" )
|
||||
|| data->hasFormat( "application/tomahawk.result.list" )
|
||||
|
@ -434,6 +434,8 @@ MprisPlugin::Stop()
|
||||
void
|
||||
MprisPlugin::getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData requestData )
|
||||
{
|
||||
Q_UNUSED( requestId );
|
||||
Q_UNUSED( requestData );
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
return;
|
||||
@ -442,6 +444,7 @@ MprisPlugin::getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData requ
|
||||
void
|
||||
MprisPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input )
|
||||
{
|
||||
Q_UNUSED( caller );
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
bool isPlayingInfo = false;
|
||||
|
||||
@ -476,7 +479,8 @@ MprisPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVar
|
||||
void
|
||||
MprisPlugin::stateChanged( AudioState newState, AudioState oldState )
|
||||
{
|
||||
|
||||
Q_UNUSED( newState );
|
||||
Q_UNUSED( oldState );
|
||||
}
|
||||
|
||||
/** Audio state slots */
|
||||
@ -504,6 +508,7 @@ MprisPlugin::audioStarted( const QVariant &input )
|
||||
void
|
||||
MprisPlugin::audioFinished( const QVariant &input )
|
||||
{
|
||||
Q_UNUSED( input );
|
||||
//qDebug() << Q_FUNC_INFO;
|
||||
}
|
||||
|
||||
|
@ -44,77 +44,77 @@ public:
|
||||
|
||||
// org.mpris.MediaPlayer2
|
||||
|
||||
Q_PROPERTY(bool CanQuit READ canQuit)
|
||||
Q_PROPERTY( bool CanQuit READ canQuit )
|
||||
bool canQuit() const;
|
||||
|
||||
Q_PROPERTY(bool CanRaise READ canRaise)
|
||||
Q_PROPERTY( bool CanRaise READ canRaise )
|
||||
bool canRaise() const;
|
||||
|
||||
Q_PROPERTY(QString DesktopEntry READ desktopEntry)
|
||||
Q_PROPERTY( QString DesktopEntry READ desktopEntry )
|
||||
QString desktopEntry() const;
|
||||
|
||||
Q_PROPERTY(bool HasTrackList READ hasTrackList)
|
||||
Q_PROPERTY( bool HasTrackList READ hasTrackList )
|
||||
bool hasTrackList() const;
|
||||
|
||||
Q_PROPERTY(QString Identity READ identity)
|
||||
Q_PROPERTY( QString Identity READ identity )
|
||||
QString identity() const;
|
||||
|
||||
Q_PROPERTY(QStringList SupportedMimeTypes READ supportedMimeTypes)
|
||||
Q_PROPERTY( QStringList SupportedMimeTypes READ supportedMimeTypes )
|
||||
QStringList supportedMimeTypes() const;
|
||||
|
||||
Q_PROPERTY(QStringList SupportedUriSchemes READ supportedUriSchemes)
|
||||
Q_PROPERTY( QStringList SupportedUriSchemes READ supportedUriSchemes )
|
||||
QStringList supportedUriSchemes() const;
|
||||
|
||||
// org.mpris.MediaPlayer2.Player
|
||||
|
||||
Q_PROPERTY(bool CanControl READ canControl)
|
||||
Q_PROPERTY( bool CanControl READ canControl )
|
||||
bool canControl() const;
|
||||
|
||||
Q_PROPERTY(bool CanGoNext READ canGoNext)
|
||||
Q_PROPERTY( bool CanGoNext READ canGoNext )
|
||||
bool canGoNext() const;
|
||||
|
||||
Q_PROPERTY(bool CanGoPrevious READ canGoPrevious)
|
||||
Q_PROPERTY( bool CanGoPrevious READ canGoPrevious )
|
||||
bool canGoPrevious() const;
|
||||
|
||||
Q_PROPERTY(bool CanPause READ canPause)
|
||||
Q_PROPERTY( bool CanPause READ canPause )
|
||||
bool canPause() const;
|
||||
|
||||
Q_PROPERTY(bool CanPlay READ canPlay)
|
||||
Q_PROPERTY( bool CanPlay READ canPlay )
|
||||
bool canPlay() const;
|
||||
|
||||
Q_PROPERTY(bool CanSeek READ canSeek)
|
||||
Q_PROPERTY( bool CanSeek READ canSeek )
|
||||
bool canSeek() const;
|
||||
|
||||
Q_PROPERTY(QString LoopStatus READ loopStatus WRITE setLoopStatus)
|
||||
Q_PROPERTY( QString LoopStatus READ loopStatus WRITE setLoopStatus )
|
||||
QString loopStatus() const;
|
||||
void setLoopStatus(const QString &value);
|
||||
void setLoopStatus( const QString &value );
|
||||
|
||||
Q_PROPERTY(double MaximumRate READ maximumRate)
|
||||
Q_PROPERTY( double MaximumRate READ maximumRate )
|
||||
double maximumRate() const;
|
||||
|
||||
Q_PROPERTY(QVariantMap Metadata READ metadata)
|
||||
Q_PROPERTY( QVariantMap Metadata READ metadata )
|
||||
QVariantMap metadata() const;
|
||||
|
||||
Q_PROPERTY(double MinimumRate READ minimumRate)
|
||||
Q_PROPERTY( double MinimumRate READ minimumRate )
|
||||
double minimumRate() const;
|
||||
|
||||
Q_PROPERTY(QString PlaybackStatus READ playbackStatus)
|
||||
Q_PROPERTY( QString PlaybackStatus READ playbackStatus )
|
||||
QString playbackStatus() const;
|
||||
|
||||
Q_PROPERTY(qlonglong Position READ position)
|
||||
Q_PROPERTY( qlonglong Position READ position )
|
||||
qlonglong position() const;
|
||||
|
||||
Q_PROPERTY(double Rate READ rate WRITE setRate)
|
||||
Q_PROPERTY( double Rate READ rate WRITE setRate )
|
||||
double rate() const;
|
||||
void setRate(double value);
|
||||
void setRate( double value );
|
||||
|
||||
Q_PROPERTY(bool Shuffle READ shuffle WRITE setShuffle)
|
||||
Q_PROPERTY( bool Shuffle READ shuffle WRITE setShuffle )
|
||||
bool shuffle() const;
|
||||
void setShuffle(bool value);
|
||||
void setShuffle( bool value );
|
||||
|
||||
Q_PROPERTY(double Volume READ volume WRITE setVolume)
|
||||
Q_PROPERTY( double Volume READ volume WRITE setVolume )
|
||||
double volume() const;
|
||||
void setVolume(double value);
|
||||
void setVolume( double value );
|
||||
|
||||
public slots:
|
||||
void namChangedSlot( QNetworkAccessManager* /*nam*/ ) {} // unused
|
||||
@ -132,13 +132,13 @@ public slots:
|
||||
|
||||
// org.mpris.MediaPlayer2.Player
|
||||
void Next();
|
||||
void OpenUri(const QString &Uri);
|
||||
void OpenUri( const QString &Uri );
|
||||
void Pause();
|
||||
void Play();
|
||||
void PlayPause();
|
||||
void Previous();
|
||||
void Seek(qlonglong Offset);
|
||||
void SetPosition(const QDBusObjectPath &TrackId, qlonglong Position);
|
||||
void Seek( qlonglong Offset );
|
||||
void SetPosition( const QDBusObjectPath &TrackId, qlonglong Position );
|
||||
void Stop();
|
||||
|
||||
|
||||
|
@ -63,6 +63,7 @@ JobStatusModel::addJob( JobStatusItem* item )
|
||||
Qt::ItemFlags
|
||||
JobStatusModel::flags( const QModelIndex& index ) const
|
||||
{
|
||||
Q_UNUSED( index );
|
||||
// Don't let the items be selectable
|
||||
return Qt::ItemIsEnabled;
|
||||
}
|
||||
@ -102,6 +103,7 @@ JobStatusModel::data( const QModelIndex& index, int role ) const
|
||||
int
|
||||
JobStatusModel::rowCount( const QModelIndex& parent ) const
|
||||
{
|
||||
Q_UNUSED( parent );
|
||||
return m_items.count();
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ PipelineStatusItem::resolving( const Tomahawk::query_ptr& query )
|
||||
}
|
||||
|
||||
PipelineStatusManager::PipelineStatusManager( QObject* parent )
|
||||
: QObject(parent)
|
||||
: QObject( parent )
|
||||
{
|
||||
connect( Tomahawk::Pipeline::instance(), SIGNAL( resolving( Tomahawk::query_ptr ) ), this, SLOT( resolving( Tomahawk::query_ptr ) ) );
|
||||
}
|
||||
@ -73,6 +73,7 @@ PipelineStatusManager::PipelineStatusManager( QObject* parent )
|
||||
void
|
||||
PipelineStatusManager::resolving( const Tomahawk::query_ptr& p )
|
||||
{
|
||||
Q_UNUSED( p );
|
||||
if ( m_curItem.isNull() )
|
||||
{
|
||||
// No current query item and we're resolving something, so show it
|
||||
|
@ -40,6 +40,7 @@ DatabaseControl::DatabaseControl( const QString& sql, const QString& summary, co
|
||||
, m_sql( sql )
|
||||
, m_sqlSummary( summary )
|
||||
{
|
||||
Q_UNUSED( parent );
|
||||
setType( "database" );
|
||||
}
|
||||
|
||||
@ -72,6 +73,7 @@ QString DatabaseControl::matchString() const
|
||||
|
||||
void DatabaseControl::setInput ( const QString& input )
|
||||
{
|
||||
Q_UNUSED( input );
|
||||
// TODO
|
||||
updateWidgets();
|
||||
}
|
||||
|
@ -68,6 +68,8 @@ ToggleButton::mouseReleaseEvent( QMouseEvent* event )
|
||||
void
|
||||
ToggleButton::paintEvent( QPaintEvent* event )
|
||||
{
|
||||
Q_UNUSED( event );
|
||||
|
||||
QPainter p( this );
|
||||
|
||||
p.save();
|
||||
|
@ -32,48 +32,48 @@
|
||||
#include "utils/logger.h"
|
||||
|
||||
|
||||
BreadcrumbBar::BreadcrumbBar(BreadcrumbButtonFactory *buttonFactory, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_model(0)
|
||||
, m_selectionModel(0)
|
||||
, m_layout(new QHBoxLayout(this))
|
||||
, m_buttonFactory(buttonFactory)
|
||||
, m_useAnimation(false)
|
||||
BreadcrumbBar::BreadcrumbBar( BreadcrumbButtonFactory *buttonFactory, QWidget *parent )
|
||||
: QWidget( parent )
|
||||
, m_buttonFactory( buttonFactory )
|
||||
, m_model( 0 )
|
||||
, m_selectionModel( 0 )
|
||||
, m_layout( new QHBoxLayout( this ) )
|
||||
, m_useAnimation( false )
|
||||
|
||||
{
|
||||
m_layout->setSpacing(0);
|
||||
m_layout->setMargin(0);
|
||||
m_layout->setAlignment(Qt::AlignLeft);
|
||||
m_layout->setSpacing( 0 );
|
||||
m_layout->setMargin( 0 );
|
||||
m_layout->setAlignment( Qt::AlignLeft );
|
||||
|
||||
setAutoFillBackground(false);
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
setAutoFillBackground( false );
|
||||
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
||||
|
||||
setLayoutDirection(Qt::LeftToRight);
|
||||
setLayout(m_layout);
|
||||
setMinimumWidth(100);
|
||||
setLayoutDirection( Qt::LeftToRight );
|
||||
setLayout( m_layout );
|
||||
setMinimumWidth( 100 );
|
||||
show();
|
||||
}
|
||||
|
||||
|
||||
BreadcrumbBar::BreadcrumbBar(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_model(0)
|
||||
, m_selectionModel(0)
|
||||
, m_layout(new QHBoxLayout(this))
|
||||
, m_buttonFactory(0)
|
||||
, m_useAnimation(false)
|
||||
BreadcrumbBar::BreadcrumbBar( QWidget *parent )
|
||||
: QWidget( parent )
|
||||
, m_buttonFactory( 0 )
|
||||
, m_model( 0 )
|
||||
, m_selectionModel( 0 )
|
||||
, m_layout( new QHBoxLayout( this ) )
|
||||
, m_useAnimation( false )
|
||||
|
||||
{
|
||||
m_layout->setSpacing(0);
|
||||
m_layout->setMargin(0);
|
||||
m_layout->setAlignment(Qt::AlignLeft);
|
||||
m_layout->setSpacing( 0 );
|
||||
m_layout->setMargin( 0 );
|
||||
m_layout->setAlignment( Qt::AlignLeft );
|
||||
|
||||
setAutoFillBackground(false);
|
||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
setAutoFillBackground( false );
|
||||
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
||||
|
||||
setLayoutDirection(Qt::LeftToRight);
|
||||
setLayout(m_layout);
|
||||
setMinimumWidth(100);
|
||||
setLayoutDirection( Qt::LeftToRight );
|
||||
setLayout( m_layout );
|
||||
setMinimumWidth( 100 );
|
||||
show();
|
||||
}
|
||||
|
||||
@ -339,5 +339,6 @@ void BreadcrumbBar::currentChangedTriggered(QModelIndex const& index)
|
||||
|
||||
void BreadcrumbBar::resizeEvent ( QResizeEvent * event )
|
||||
{
|
||||
Q_UNUSED( event );
|
||||
collapseButtons();
|
||||
}
|
||||
|
@ -44,10 +44,10 @@ SiblingCrumbButton::SiblingCrumbButton(
|
||||
// QTimer::singleShot(0, this, SLOT(activateSelf()));
|
||||
}
|
||||
|
||||
void SiblingCrumbButton::setIndex(QModelIndex index)
|
||||
void SiblingCrumbButton::setIndex( QModelIndex index )
|
||||
{
|
||||
m_index = index;
|
||||
setText(index.data().toString());
|
||||
setText( index.data().toString() );
|
||||
qDebug() << "i am " << text();
|
||||
fillCombo();
|
||||
}
|
||||
@ -57,8 +57,9 @@ QModelIndex SiblingCrumbButton::index() const
|
||||
return m_index;
|
||||
}
|
||||
|
||||
void SiblingCrumbButton::setActive(bool active)
|
||||
void SiblingCrumbButton::setActive( bool active )
|
||||
{
|
||||
Q_UNUSED( active );
|
||||
}
|
||||
|
||||
bool SiblingCrumbButton::isActive() const
|
||||
@ -70,19 +71,19 @@ QSize SiblingCrumbButton::sizeHint() const
|
||||
{
|
||||
// our width = width of combo + 20px for right-arrow and spacing
|
||||
const int padding = hasChildren() ? 20 : 5;
|
||||
return m_combo->sizeHint() + QSize(padding,0);
|
||||
return m_combo->sizeHint() + QSize( padding, 0 );
|
||||
}
|
||||
|
||||
void SiblingCrumbButton::paintEvent(QPaintEvent *event)
|
||||
void SiblingCrumbButton::paintEvent( QPaintEvent *event )
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
Q_UNUSED( event );
|
||||
|
||||
QPainter p(this);
|
||||
QPainter p( this );
|
||||
QStyleOption opt;
|
||||
opt.initFrom(this);
|
||||
opt.initFrom( this );
|
||||
QRect r = opt.rect;
|
||||
|
||||
StyleHelper::horizontalHeader(&p, r); // draw the background
|
||||
StyleHelper::horizontalHeader( &p, r ); // draw the background
|
||||
|
||||
if( !hasChildren() )
|
||||
return;
|
||||
@ -93,31 +94,31 @@ void SiblingCrumbButton::paintEvent(QPaintEvent *event)
|
||||
int left = !reverse ? r.right()-rightSpacing - menuButtonWidth : r.left();
|
||||
int right = !reverse ? r.right()-rightSpacing : r.left() + menuButtonWidth;
|
||||
int height = sizeHint().height();
|
||||
QRect arrowRect((left + right) / 2 + (reverse ? 6 : -6), 0, height, height);
|
||||
QRect arrowRect( ( left + right ) / 2 + ( reverse ? 6 : -6 ), 0, height, height );
|
||||
|
||||
QStyleOption arrowOpt = opt;
|
||||
arrowOpt.rect = arrowRect;
|
||||
|
||||
|
||||
QLine l1(left, 0, right, height/2);
|
||||
QLine l2(left, height, right, height/2);
|
||||
QLine l1( left, 0, right, height/2 );
|
||||
QLine l2( left, height, right, height/2 );
|
||||
|
||||
|
||||
p.setRenderHint(QPainter::Antialiasing, true);
|
||||
p.setRenderHint( QPainter::Antialiasing, true );
|
||||
|
||||
// Draw the shadow
|
||||
QColor shadow(0, 0, 0, 100);
|
||||
p.translate(0, -1);
|
||||
p.setPen(shadow);
|
||||
p.drawLine(l1);
|
||||
p.drawLine(l2);
|
||||
QColor shadow( 0, 0, 0, 100 );
|
||||
p.translate( 0, -1 );
|
||||
p.setPen( shadow );
|
||||
p.drawLine( l1 );
|
||||
p.drawLine( l2 );
|
||||
|
||||
// Draw the main arrow
|
||||
QColor foreGround("#747474");
|
||||
p.translate(0, 1);
|
||||
p.setPen(foreGround);
|
||||
p.drawLine(l1);
|
||||
p.drawLine(l2);
|
||||
QColor foreGround( "#747474" );
|
||||
p.translate( 0, 1 );
|
||||
p.setPen( foreGround );
|
||||
p.drawLine( l1 );
|
||||
p.drawLine( l2 );
|
||||
}
|
||||
|
||||
void SiblingCrumbButton::fillCombo()
|
||||
|
@ -149,7 +149,7 @@ void
|
||||
WelcomeWidget::onPlaybackFinished( const Tomahawk::query_ptr& query )
|
||||
{
|
||||
int count = m_tracksModel->trackCount();
|
||||
int playtime = query->playedBy().second;
|
||||
unsigned int playtime = query->playedBy().second;
|
||||
|
||||
if ( count )
|
||||
{
|
||||
|
@ -285,6 +285,7 @@ WhatsHotWidget::changeEvent( QEvent* e )
|
||||
QStandardItem*
|
||||
WhatsHotWidget::parseNode(QStandardItem* parentItem, const QString &label, const QVariant &data)
|
||||
{
|
||||
Q_UNUSED( parentItem );
|
||||
tDebug( LOGVERBOSE ) << "WhatsHot:: parsing " << label;
|
||||
|
||||
QStandardItem *sourceItem = new QStandardItem(label);
|
||||
|
@ -550,6 +550,7 @@ SettingsDialog::getMoreResolvers()
|
||||
#elif defined(LIBATTICA_FOUND)
|
||||
GetNewStuffDialog diag( this );
|
||||
int ret = diag.exec();
|
||||
Q_UNUSED( ret );
|
||||
#endif
|
||||
|
||||
}
|
||||
@ -584,7 +585,7 @@ SettingsDialog::scriptSelectionChanged()
|
||||
void
|
||||
SettingsDialog::getMoreResolversFinished( int ret )
|
||||
{
|
||||
|
||||
Q_UNUSED( ret );
|
||||
}
|
||||
|
||||
|
||||
|
@ -401,6 +401,7 @@ SourceTreeView::doLatchOff( const source_ptr& source )
|
||||
void
|
||||
SourceTreeView::playlistChanged( PlaylistInterface* newInterface )
|
||||
{
|
||||
Q_UNUSED( newInterface );
|
||||
// If we were latched on and changed, send the listening along stop
|
||||
if ( m_latch.isNull() )
|
||||
{
|
||||
|
@ -511,6 +511,9 @@ TomahawkWindow::onXSPFError( XSPFLoader::XSPFErrorCode error )
|
||||
case XSPFLoader::InvalidTrackError:
|
||||
QMessageBox::warning( this, tr( "Failed to save tracks" ), tr( "Some tracks in the playlist do not contain an artist and a title. They will be ignored." ), QMessageBox::Ok );
|
||||
break;
|
||||
default:
|
||||
//FIXME: This includes FetchError
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user