comparison src/gui/widgets/sidebar.cpp @ 63:3d2decf093bb

*: fix many clang warnings
author Paper <mrpapersonic@gmail.com>
date Sun, 01 Oct 2023 06:39:47 -0400
parents 4c6dd5999b39
children 2417121d894e
comparison
equal deleted inserted replaced
62:4c6dd5999b39 63:3d2decf093bb
1 #include "gui/widgets/sidebar.h" 1 #include "gui/widgets/sidebar.h"
2 #include <QDebug>
2 #include <QFrame> 3 #include <QFrame>
3 #include <QListWidget> 4 #include <QListWidget>
4 #include <QListWidgetItem> 5 #include <QListWidgetItem>
5 #include <QMessageBox> 6 #include <QMessageBox>
6 #include <QMouseEvent> 7 #include <QMouseEvent>
7 #include <QDebug>
8 8
9 SideBar::SideBar(QWidget* parent) : QListWidget(parent) { 9 SideBar::SideBar(QWidget* parent) : QListWidget(parent) {
10 setFrameShape(QFrame::NoFrame); 10 setFrameShape(QFrame::NoFrame);
11 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 11 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
12 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 12 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
64 return item; 64 return item;
65 } 65 }
66 66
67 int SideBar::AddSeparatorsToIndex(int index) { 67 int SideBar::AddSeparatorsToIndex(int index) {
68 int i, j; 68 int i, j;
69 for (i = 0, j = 0; i < index; ) { 69 for (i = 0, j = 0; i < index;) {
70 i++; 70 i++;
71 if (IndexIsSeparator(indexFromItem(item(i)))) 71 if (IndexIsSeparator(indexFromItem(item(i))))
72 j++; 72 j++;
73 } 73 }
74 return i+j; 74 return i + j;
75 } 75 }
76 76
77 int SideBar::RemoveSeparatorsFromIndex(int index) { 77 int SideBar::RemoveSeparatorsFromIndex(int index) {
78 int i, j; 78 int i, j;
79 for (i = 0, j = 0; i < index; i++) { 79 for (i = 0, j = 0; i < index; i++) {