diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-09-08 11:49:28 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2019-09-08 11:49:28 +0000 |
| commit | 463f4e95cff0e100b4c8c8b5378cfe1b2604c138 (patch) | |
| tree | cb73da70a910165d5715d6fc20c11587454c4133 /src/plugins/Ui/qsui | |
| parent | 1e31fe896524513577911e382897b841e40a4814 (diff) | |
| download | qmmp-463f4e95cff0e100b4c8c8b5378cfe1b2604c138.tar.gz qmmp-463f4e95cff0e100b4c8c8b5378cfe1b2604c138.tar.bz2 qmmp-463f4e95cff0e100b4c8c8b5378cfe1b2604c138.zip | |
fixed possible regressions
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@9068 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/Ui/qsui')
| -rw-r--r-- | src/plugins/Ui/qsui/actionmanager.cpp | 7 | ||||
| -rw-r--r-- | src/plugins/Ui/qsui/mainwindow.cpp | 12 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/plugins/Ui/qsui/actionmanager.cpp b/src/plugins/Ui/qsui/actionmanager.cpp index 8e8e0ca7c..795014bc6 100644 --- a/src/plugins/Ui/qsui/actionmanager.cpp +++ b/src/plugins/Ui/qsui/actionmanager.cpp @@ -272,9 +272,10 @@ void ActionManager::updateToolBar(QToolBar *toolBar, ActionManager::ToolBarInfo ActionManager::ToolBarInfo ActionManager::defaultToolBar() const { - QList <Type> idList; - idList << PL_ADD_FILE << PL_ADD_DIRECTORY << PREVIOUS << PLAY << PAUSE << STOP << NEXT << EJECT; - idList << UI_SEPARATOR << UI_POS_SLIDER << UI_SEPARATOR << UI_VOL_SLIDER << VOL_MUTE; + const QList<Type> idList = { + PL_ADD_FILE, PL_ADD_DIRECTORY, PREVIOUS, PLAY, PAUSE, STOP, NEXT, EJECT, + UI_SEPARATOR, UI_POS_SLIDER, UI_SEPARATOR, UI_VOL_SLIDER, VOL_MUTE + }; QStringList names; for(const Type &id : qAsConst(idList)) { diff --git a/src/plugins/Ui/qsui/mainwindow.cpp b/src/plugins/Ui/qsui/mainwindow.cpp index 73891daf3..83563325b 100644 --- a/src/plugins/Ui/qsui/mainwindow.cpp +++ b/src/plugins/Ui/qsui/mainwindow.cpp @@ -688,7 +688,7 @@ void MainWindow::readSettings() m_titleFormatter.setPattern(settings.value("window_title_format","%if(%p,%p - %t,%t)").toString()); //update toolbars - QList<ActionManager::ToolBarInfo> toolBarInfoList = ActionManager::instance()->readToolBarSettings(); + const QList<ActionManager::ToolBarInfo> toolBarInfoList = ActionManager::instance()->readToolBarSettings(); QList<QToolBar *> toolBars = findChildren<QToolBar*>(); //clear toolbars to avoid conflicts @@ -698,15 +698,17 @@ void MainWindow::readSettings() for(const ActionManager::ToolBarInfo &info : qAsConst(toolBarInfoList)) { bool found = false; - for(QToolBar *toolBar : qAsConst(toolBars)) + QList<QToolBar *>::iterator it = toolBars.begin(); + while(it != toolBars.end()) { - if(toolBar->property("uid").toString() == info.uid) + if((*it)->property("uid").toString() == info.uid) { found = true; - toolBars.removeAll(toolBar); - ActionManager::instance()->updateToolBar(toolBar, info); + ActionManager::instance()->updateToolBar(*it, info); + toolBars.erase(it); break; } + it++; } if(!found) |
