From: dreamer.dead Date: Tue, 28 Apr 2015 22:15:52 +0000 (+0300) Subject: Fix compiler warnings reported by clang. X-Git-Tag: 2.5~83^2~1^2 X-Git-Url: https://git.sur5r.net/?p=minitube;a=commitdiff_plain;h=1cdc0c03b98a4e098f7fc92f08350a31844b3665 Fix compiler warnings reported by clang. --- diff --git a/src/channelitemdelegate.cpp b/src/channelitemdelegate.cpp index 797b82a..4c13dfe 100644 --- a/src/channelitemdelegate.cpp +++ b/src/channelitemdelegate.cpp @@ -56,6 +56,7 @@ void ChannelItemDelegate::paint( QPainter* painter, void ChannelItemDelegate::paintAggregate(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { + Q_UNUSED(index); painter->save(); painter->translate(option.rect.topLeft()); @@ -73,6 +74,7 @@ void ChannelItemDelegate::paintAggregate(QPainter* painter, void ChannelItemDelegate::paintUnwatched(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const { + Q_UNUSED(index); painter->save(); painter->translate(option.rect.topLeft()); diff --git a/src/channelview.cpp b/src/channelview.cpp index 893f891..205618a 100644 --- a/src/channelview.cpp +++ b/src/channelview.cpp @@ -202,7 +202,7 @@ void ChannelView::leaveEvent(QEvent *event) { // channelsModel->clearHover(); } -void ChannelView::itemEntered(const QModelIndex &index) { +void ChannelView::itemEntered(const QModelIndex &) { // channelsModel->setHoveredRow(index.row()); } @@ -285,6 +285,7 @@ void ChannelView::toggleShowUpdated(bool enable) { } void ChannelView::updateQuery(bool transition) { + Q_UNUSED(transition); errorMessage.clear(); if (!Database::exists()) return; diff --git a/src/downloadmodel.h b/src/downloadmodel.h index 7dd8f49..a4348c4 100644 --- a/src/downloadmodel.h +++ b/src/downloadmodel.h @@ -46,9 +46,9 @@ public slots: void updatePlayIcon(); private: - int columnCount() { return 1; } + int columnCount(const QModelIndex &/*parent*/ = QModelIndex()) const { return 1; } - DownloadManager *downloadManager; + DownloadManager *const downloadManager; int hoveredRow; bool playIconHovered; bool playIconPressed; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 08a20a6..81b1e24 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -887,7 +887,7 @@ void MainWindow::goBack() { } void MainWindow::showWidget(QWidget* widget, bool transition) { - + Q_UNUSED(transition); if (compactViewAct->isChecked()) compactViewAct->toggle(); diff --git a/src/mediaview.cpp b/src/mediaview.cpp index a0a36db..4d191fd 100644 --- a/src/mediaview.cpp +++ b/src/mediaview.cpp @@ -64,12 +64,13 @@ MediaView* MediaView::instance() { return i; } -MediaView::MediaView(QWidget *parent) : QWidget(parent), - stopped(false), +MediaView::MediaView(QWidget *parent) : QWidget(parent) + , stopped(false) + , downloadItem(0) #ifdef APP_SNAPSHOT - snapshotSettings(0), + , snapshotSettings(0) #endif - downloadItem(0) { } + { } void MediaView::initialize() { QBoxLayout *layout = new QVBoxLayout(this); @@ -213,6 +214,7 @@ void MediaView::search(SearchParams *searchParams) { } void MediaView::setVideoSource(VideoSource *videoSource, bool addToHistory, bool back) { + Q_UNUSED(back); stopped = false; #ifdef APP_ACTIVATION @@ -900,6 +902,7 @@ void MediaView::startDownloading() { } void MediaView::sliderMoved(int value) { + Q_UNUSED(value); #ifdef APP_PHONON #ifndef APP_PHONON_SEEK diff --git a/src/paginatedvideosource.cpp b/src/paginatedvideosource.cpp index 5ef69dc..fe98ba6 100644 --- a/src/paginatedvideosource.cpp +++ b/src/paginatedvideosource.cpp @@ -35,9 +35,9 @@ QHash* globalActions(); PaginatedVideoSource::PaginatedVideoSource(QObject *parent) : VideoSource(parent) , tokenTimestamp(0) - , reloadingToken(false) , currentMax(0) , currentStartIndex(0) + , reloadingToken(false) , asyncDetails(false) { } bool PaginatedVideoSource::hasMoreVideos() { diff --git a/src/refinesearchbutton.cpp b/src/refinesearchbutton.cpp index aa78fcc..eeb4fe1 100644 --- a/src/refinesearchbutton.cpp +++ b/src/refinesearchbutton.cpp @@ -40,7 +40,7 @@ void RefineSearchButton::paintBackground() const { } -void RefineSearchButton::paintEvent(QPaintEvent *event) { +void RefineSearchButton::paintEvent(QPaintEvent *) { // QPushButton::paintEvent(event); QPainter painter(this); painter.setRenderHints(QPainter::Antialiasing, true); diff --git a/src/regionsview.h b/src/regionsview.h index 7368188..2caacd2 100644 --- a/src/regionsview.h +++ b/src/regionsview.h @@ -27,7 +27,7 @@ $END_LICENSE */ #endif #include "view.h" -class YTRegion; +struct YTRegion; class RegionsView : public QWidget, public View { diff --git a/src/searchlineedit.cpp b/src/searchlineedit.cpp index d316752..dc5115c 100644 --- a/src/searchlineedit.cpp +++ b/src/searchlineedit.cpp @@ -45,12 +45,12 @@ void ClearButton::leaveEvent(QEvent *e) { hovered = false; } -void ClearButton::mousePressEvent(QEvent *e) { +void ClearButton::mousePressEvent(QMouseEvent *e) { Q_UNUSED(e); mousePressed = true; } -void ClearButton::mouseReleaseEvent(QEvent *e) { +void ClearButton::mouseReleaseEvent(QMouseEvent *e) { Q_UNUSED(e); mousePressed = false; } diff --git a/src/searchlineedit.h b/src/searchlineedit.h index 64b0d28..83405d0 100644 --- a/src/searchlineedit.h +++ b/src/searchlineedit.h @@ -33,8 +33,8 @@ protected: void enterEvent(QEvent *e); void leaveEvent(QEvent *e); - void mousePressEvent(QEvent *e); - void mouseReleaseEvent(QEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); private: bool hovered; diff --git a/src/standardfeedsview.h b/src/standardfeedsview.h index f7e1485..94a2be4 100644 --- a/src/standardfeedsview.h +++ b/src/standardfeedsview.h @@ -28,7 +28,7 @@ $END_LICENSE */ #include "view.h" class VideoSource; -class YTCategory; +struct YTCategory; class YTStandardFeed; class StandardFeedsView : public QWidget, public View {