(Qt) Style nits

This commit is contained in:
twinaphex 2020-07-20 22:05:12 +02:00
parent 9ecc30a501
commit 4ca1692174
2 changed files with 34 additions and 30 deletions

View File

@ -55,12 +55,14 @@ public:
QString categoryIconName() const { return m_categoryIconName; }
virtual void load()
{
for (int i = 0; i < m_pages.size(); i++)
size_t size = m_pages.size();
for (int i = 0; i < size; i++)
m_pages.at(i)->load();
}
virtual void apply()
{
for (int i = 0; i < m_pages.size(); i++)
size_t size = m_pages.size();
for (int i = 0; i < size; i++)
m_pages.at(i)->apply();
}
protected:

View File

@ -759,8 +759,9 @@ void MainWindow::updateVisibleItems()
{
unsigned i;
QVector<QModelIndex> indexes = m_gridView->visibleIndexes();
size_t size = indexes.size();
for (i = 0; i < indexes.size(); i++)
for (i = 0; i < size; i++)
m_playlistModel->loadThumbnail(m_proxyModel->mapToSource(indexes.at(i)));
}
}
@ -799,8 +800,9 @@ QVector<QPair<QString, QString> > MainWindow::getPlaylists()
{
unsigned i;
QVector<QPair<QString, QString> > playlists;
size_t size = m_listWidget->count();
for (i = 0; i < m_listWidget->count(); i++)
for (i = 0; i < size; i++)
{
QString label, path;
QPair<QString, QString> pair;
@ -943,7 +945,12 @@ bool MainWindow::setCustomThemeFile(QString filePath)
{
bool opened = file.open(QIODevice::ReadOnly);
if (opened)
if (!opened)
{
QMessageBox::critical(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED));
return false;
}
{
QByteArray fileArray = file.readAll();
QString fileStr = QString::fromUtf8(fileArray);
@ -955,14 +962,9 @@ bool MainWindow::setCustomThemeFile(QString filePath)
QMessageBox::critical(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_IS_EMPTY));
return false;
}
else
setCustomThemeString(fileStr);
}
else
{
QMessageBox::critical(this, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_CUSTOM_THEME), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_FILE_READ_OPEN_FAILED));
return false;
}
}
else
{