Fix various clazy warnings
This commit is contained in:
@@ -180,7 +180,8 @@ class FancyTabBar: public QTabBar {
|
||||
|
||||
// if LargeSidebar, restore spacers
|
||||
if (tabWidget->mode() == FancyTabWidget::Mode_LargeSidebar && spacers.count() > 0) {
|
||||
for (int index : spacers.keys()) {
|
||||
QList<int> keys = spacers.keys();
|
||||
for (const int index : keys) {
|
||||
tabWidget->insertTab(index, spacers[index], QIcon(), QString());
|
||||
tabWidget->setTabEnabled(index, false);
|
||||
}
|
||||
@@ -472,7 +473,7 @@ void FancyTabWidget::Load(const QString &kSettingsGroup) {
|
||||
QSettings s;
|
||||
s.beginGroup(kSettingsGroup);
|
||||
QMultiMap <int, TabData*> tabs;
|
||||
for (TabData *tab : tabs_) {
|
||||
for (TabData *tab : qAsConst(tabs_)) {
|
||||
int idx = s.value("tab_" + tab->name(), tab->index()).toInt();
|
||||
while (tabs.contains(idx)) { ++idx; }
|
||||
tabs.insert(idx, tab);
|
||||
@@ -500,7 +501,7 @@ void FancyTabWidget::SaveSettings(const QString &kSettingsGroup) {
|
||||
s.setValue("tab_mode", mode_);
|
||||
s.setValue("current_tab", currentIndex());
|
||||
|
||||
for (TabData *tab : tabs_) {
|
||||
for (TabData *tab : qAsConst(tabs_)) {
|
||||
QString k = "tab_" + tab->name();
|
||||
int idx = QTabWidget::indexOf(tab->page());
|
||||
if (idx < 0) {
|
||||
|
||||
@@ -88,7 +88,7 @@ class FancyTabWidget : public QTabWidget {
|
||||
|
||||
public slots:
|
||||
void setCurrentIndex(int idx);
|
||||
void SetMode(Mode mode);
|
||||
void SetMode(Core::Internal::FancyTabWidget::Mode mode);
|
||||
// Mapper mapped signal needs this convenience function
|
||||
void SetMode(int mode) { SetMode(Mode(mode)); }
|
||||
|
||||
|
||||
@@ -60,6 +60,11 @@ class FileViewList : public QListView {
|
||||
protected:
|
||||
void contextMenuEvent(QContextMenuEvent *e) override;
|
||||
|
||||
private:
|
||||
QStringList FilenamesFromSelection() const;
|
||||
QList<QUrl> UrlListFromSelection() const;
|
||||
MimeData *MimeDataFromSelection() const;
|
||||
|
||||
private slots:
|
||||
void LoadSlot();
|
||||
void AddToPlaylistSlot();
|
||||
@@ -71,10 +76,6 @@ class FileViewList : public QListView {
|
||||
void EditTagsSlot();
|
||||
void ShowInBrowser();
|
||||
|
||||
QStringList FilenamesFromSelection() const;
|
||||
QList<QUrl> UrlListFromSelection() const;
|
||||
MimeData *MimeDataFromSelection() const;
|
||||
|
||||
private:
|
||||
QMenu *menu_;
|
||||
QItemSelection menu_selection_;
|
||||
|
||||
@@ -69,7 +69,7 @@ FreeSpaceBar::FreeSpaceBar(QWidget *parent)
|
||||
additional_text_(tr("New songs")),
|
||||
used_text_(tr("Used"))
|
||||
{
|
||||
setMinimumHeight(sizeHint().height());
|
||||
setMinimumHeight(FreeSpaceBar::sizeHint().height());
|
||||
}
|
||||
|
||||
QSize FreeSpaceBar::sizeHint() const {
|
||||
|
||||
@@ -32,13 +32,14 @@
|
||||
#include "linetextedit.h"
|
||||
|
||||
LineTextEdit::LineTextEdit(QWidget *parent)
|
||||
: QTextEdit(parent)
|
||||
{
|
||||
: QTextEdit(parent) {
|
||||
|
||||
setWordWrapMode(QTextOption::NoWrap);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setTabChangesFocus(true);
|
||||
sizePolicy().setVerticalPolicy(QSizePolicy::Fixed);
|
||||
setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
|
||||
|
||||
}
|
||||
|
||||
QSize LineTextEdit::sizeHint() const {
|
||||
|
||||
@@ -54,7 +54,7 @@ class LoginStateWidget : public QWidget {
|
||||
|
||||
public slots:
|
||||
// Changes the "You are logged in/out" label, shows/hides any QGroupBoxes added with AddCredentialGroup.
|
||||
void SetLoggedIn(const State state, const QString &account_name = QString());
|
||||
void SetLoggedIn(const LoginStateWidget::State state, const QString &account_name = QString());
|
||||
|
||||
// Hides the "You are logged in/out" label completely.
|
||||
void HideLoggedInState();
|
||||
|
||||
@@ -34,9 +34,11 @@ RatingPainter::RatingPainter() {
|
||||
|
||||
// Load the base pixmaps
|
||||
QIcon star_on(":/pictures/star-on.png");
|
||||
QPixmap on(star_on.pixmap(star_on.availableSizes().last()));
|
||||
QList<QSize> star_on_sizes = star_on.availableSizes();
|
||||
QPixmap on(star_on.pixmap(star_on_sizes.last()));
|
||||
QIcon star_off(":/pictures/star-off.png");
|
||||
QPixmap off(star_off.pixmap(star_off.availableSizes().last()));
|
||||
QList<QSize> star_off_sizes = star_off.availableSizes();
|
||||
QPixmap off(star_off.pixmap(star_off_sizes.last()));
|
||||
|
||||
// Generate the 10 states, better to do it now than on the fly
|
||||
for (int i = 0 ; i < kStarCount * 2 + 1 ; ++i) {
|
||||
|
||||
@@ -171,6 +171,7 @@ void PrettySlider::mousePressEvent(QMouseEvent *e) {
|
||||
}
|
||||
|
||||
void PrettySlider::slideEvent(QMouseEvent *e) {
|
||||
|
||||
if (m_mode == Pretty)
|
||||
QSlider::setValue(
|
||||
orientation() == Qt::Horizontal
|
||||
@@ -178,6 +179,7 @@ void PrettySlider::slideEvent(QMouseEvent *e) {
|
||||
: QStyle::sliderValueFromPosition(minimum(), maximum(), e->pos().y(), height() - 2));
|
||||
else
|
||||
SliderSlider::slideEvent(e);
|
||||
|
||||
}
|
||||
|
||||
namespace Amarok {
|
||||
|
||||
Reference in New Issue
Block a user