Skip to content

Commit

Permalink
Merge 1ad5d40 into 3ca47ac
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Dec 21, 2018
2 parents 3ca47ac + 1ad5d40 commit 63fa080
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void CellmlAnnotationViewWidget::retranslateUi()
{
// Retranslate our editing widgets

for (auto editingWidget : mEditingWidgets)
for (auto editingWidget : mEditingWidgets.values())
editingWidget->retranslateUi();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ void CellmlTextViewWidget::retranslateUi()
{
// Retranslate all of our data

for (auto data : mData)
for (auto data : mData.values())
data->retranslateUi();
}

Expand Down Expand Up @@ -1277,7 +1277,7 @@ void CellmlTextViewWidget::selectFirstItemInEditorList()

mEditorLists.removeFirst();

for (auto data : mData) {
for (auto data : mData.values()) {
if (data->editingWidget()->editorListWidget() == editorList) {
editorList->selectFirstItem();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void RawCellmlViewWidget::retranslateUi()
{
// Retranslate all our editing widgets

for (auto editingWidget : mEditingWidgets)
for (auto editingWidget : mEditingWidgets.values())
editingWidget->retranslateUi();
}

Expand Down
12 changes: 6 additions & 6 deletions src/plugins/miscellaneous/Core/src/centralwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ CentralWidget::CentralWidget(QWidget *pParent) :
layout->addWidget(mModeTabs);
layout->addWidget(centralWidget);

for (auto mode : mModes)
for (auto mode : mModes.values())
layout->addWidget(mode->viewTabs());

// A connection to handle the case where a file was created or duplicated
Expand Down Expand Up @@ -263,7 +263,7 @@ CentralWidget::CentralWidget(QWidget *pParent) :

// Some connections to handle our mode views tab bar

for (auto mode : mModes) {
for (auto mode : mModes.values()) {
connect(mode->viewTabs(), &TabBarWidget::currentChanged,
this, &CentralWidget::updateGui);
connect(mode->viewTabs(), &TabBarWidget::currentChanged,
Expand Down Expand Up @@ -327,7 +327,7 @@ CentralWidget::~CentralWidget()

// Delete our various modes

for (auto mode : mModes)
for (auto mode : mModes.values())
delete mode;
}

Expand Down Expand Up @@ -634,7 +634,7 @@ void CentralWidget::retranslateUi()

// Retranslate our mode views tab bar

for (auto mode : mModes) {
for (auto mode : mModes.values()) {
TabBarWidget *viewTabs = mode->viewTabs();

for (int i = 0, iMax = viewTabs->count(); i < iMax; ++i)
Expand Down Expand Up @@ -1715,7 +1715,7 @@ void CentralWidget::updateGui()
bool changedModes = sender() == mModeTabs;
bool changedViews = false;

for (auto mode : mModes) {
for (auto mode : mModes.values()) {
if (sender() == mode->viewTabs()) {
changedViews = true;

Expand Down Expand Up @@ -2103,7 +2103,7 @@ void CentralWidget::updateModifiedSettings()
mModeTabs->setEnabled(true);
mModeTabs->setToolTip(QString());

for (auto mode : mModes) {
for (auto mode : mModes.values()) {
TabBarWidget *viewTabs = mode->viewTabs();

viewTabs->setEnabled(true);
Expand Down
8 changes: 5 additions & 3 deletions src/plugins/miscellaneous/Core/src/filemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ FileManager::~FileManager()

// Remove all the managed files

for (auto file : mFiles)
for (auto file : mFiles.values())
delete file;
}

Expand Down Expand Up @@ -715,8 +715,10 @@ void FileManager::checkFiles()
// them, and to check a file that has been removed will crash
// OpenCOR...

for (auto file : mFiles) {
if (!mFiles.values().contains(file))
auto files = mFiles.values();

for (auto file : files) {
if (!files.contains(file))
continue;

QString fileName = file->fileName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,15 @@ void SimulationExperimentViewInformationGraphPanelAndGraphsWidget::retranslateUi

// Retranslate all our property editors

for (auto graphPanelPropertyEditor : mGraphPanelPropertyEditors)
for (auto graphPanelPropertyEditor : mGraphPanelPropertyEditors.values())
graphPanelPropertyEditor->retranslateUi();

for (auto graphsPropertyEditor : mGraphsPropertyEditors)
for (auto graphsPropertyEditor : mGraphsPropertyEditors.values())
graphsPropertyEditor->retranslateUi();

// Retranslate the contents of our graph panel property editors

for (auto graphPanelPropertyEditor : mGraphPanelPropertyEditors)
for (auto graphPanelPropertyEditor : mGraphPanelPropertyEditors.values())
retranslateGraphPanelPropertyEditor(graphPanelPropertyEditor);

// Retranslate the information about our graphs properties
Expand Down Expand Up @@ -275,7 +275,7 @@ void SimulationExperimentViewInformationGraphPanelAndGraphsWidget::finalize()

// Remove all our graphs' runs

for (auto graph : mGraphs)
for (auto graph : mGraphs.values())
graph->removeRuns();
}

Expand Down Expand Up @@ -1656,7 +1656,7 @@ void SimulationExperimentViewInformationGraphPanelAndGraphsWidget::updateAllGrap
// Go through our graphs property editors and update the information about
// the graph properties they hold

for (auto graphsPropertyEditor : mGraphsPropertyEditors) {
for (auto graphsPropertyEditor : mGraphsPropertyEditors.values()) {
mGraphsPropertyEditor = graphsPropertyEditor;

updateGraphsInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void SimulationExperimentViewWidget::retranslateUi()
{
// Retranslate our simulation widgets

for (auto simulationWidget : mSimulationWidgets)
for (auto simulationWidget : mSimulationWidgets.values())
simulationWidget->retranslateUi();
}

Expand Down Expand Up @@ -306,7 +306,7 @@ void SimulationExperimentViewWidget::fileOpened(const QString &pFileName)

// Make sure that the GUI of our simulation widgets is up to date

for (auto simulationWidget : mSimulationWidgets)
for (auto simulationWidget : mSimulationWidgets.values())
simulationWidget->updateGui(true);
}

Expand Down Expand Up @@ -361,7 +361,7 @@ void SimulationExperimentViewWidget::fileReloaded(const QString &pFileName)

// Make sure that the GUI of our simulation widgets is up to date

for (auto simulationWidget : mSimulationWidgets)
for (auto simulationWidget : mSimulationWidgets.values())
simulationWidget->updateGui(true);
}
}
Expand All @@ -388,7 +388,7 @@ void SimulationExperimentViewWidget::fileRenamed(const QString &pOldFileName,

// Let our simulation widgets know that a file has been renamed

for (auto simulationWidget : mSimulationWidgets)
for (auto simulationWidget : mSimulationWidgets.values())
simulationWidget->fileRenamed(pOldFileName, pNewFileName);
}

Expand All @@ -402,7 +402,7 @@ void SimulationExperimentViewWidget::fileClosed(const QString &pFileName)

// Make sure that the GUI of our simulation widgets is up to date

for (auto simulationWidget : mSimulationWidgets)
for (auto simulationWidget : mSimulationWidgets.values())
simulationWidget->updateGui(true);
}

Expand Down Expand Up @@ -521,7 +521,7 @@ void SimulationExperimentViewWidget::checkSimulationResults(const QString &pFile
quint64 previousSimulationResultsSize = simulation->results()->size(simulationRunsCount-2);

if (previousSimulationResultsSize != mSimulationResultsSizes.value(pFileName)) {
for (auto currentSimulationWidget : mSimulationWidgets) {
for (auto currentSimulationWidget : mSimulationWidgets.values()) {
currentSimulationWidget->updateSimulationResults(simulationWidget,
previousSimulationResultsSize,
simulationRunsCount-2,
Expand All @@ -541,7 +541,7 @@ void SimulationExperimentViewWidget::checkSimulationResults(const QString &pFile
|| (simulationResultsSize != mSimulationResultsSizes.value(pFileName))) {
mSimulationResultsSizes.insert(pFileName, simulationResultsSize);

for (auto currentSimulationWidget : mSimulationWidgets) {
for (auto currentSimulationWidget : mSimulationWidgets.values()) {
currentSimulationWidget->updateSimulationResults(simulationWidget,
simulationResultsSize,
simulationRunsCount-1,
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/support/PMRSupport/src/pmrworkspacemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ PmrWorkspaces PmrWorkspaceManager::workspaces() const

PmrWorkspaces res = PmrWorkspaces();

for (auto workspace : mUrlWorkspaces)
for (auto workspace : mUrlWorkspaces.values())
res << workspace;

return res;
Expand Down Expand Up @@ -143,7 +143,7 @@ void PmrWorkspaceManager::clearWorkspaces()
{
// Stop tracking all of our workspaces

for (auto workspace : mUrlWorkspaces)
for (auto workspace : mUrlWorkspaces.values())
workspace->close();

mUrlWorkspaces.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ bool GraphPanelPlotLegendWidget::needScrollBar() const

int legendLabelsHeight = 0;

for (auto legendLabel : mLegendLabels)
for (auto legendLabel : mLegendLabels.values())
legendLabelsHeight += legendLabel->height();

return !pos().y() && (legendLabelsHeight > height());
Expand Down
6 changes: 3 additions & 3 deletions src/pluginsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ PluginsDialog::PluginsDialog(QSettings *pSettings,

// Make a category checkable if it contains selectable plugins

for (auto categoryItem : mCategoryItems) {
for (auto categoryItem : mCategoryItems.values()) {
for (int i = 0, iMax = categoryItem->rowCount(); i < iMax; ++i) {
if (categoryItem->child(i)->isCheckable()) {
categoryItem->setCheckable(true);
Expand Down Expand Up @@ -473,7 +473,7 @@ void PluginsDialog::updatePluginsSelectedState(QStandardItem *pItem,
// Update the selected state of all our categories which have at least one
// selectable plugin

for (auto categoryItem : mCategoryItems) {
for (auto categoryItem : mCategoryItems.values()) {
int nbOfPlugins = categoryItem->rowCount();

if (nbOfPlugins) {
Expand Down Expand Up @@ -659,7 +659,7 @@ void PluginsDialog::selectablePluginsCheckBoxToggled(bool pChecked)

// Show/hide our categories, based on whether they contain visible plugins

for (auto categoryItem : mCategoryItems) {
for (auto categoryItem : mCategoryItems.values()) {
if (categoryItem->hasChildren()) {
// The category contains plugins, but the question is whether they
// are visible
Expand Down
4 changes: 2 additions & 2 deletions src/preferencesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void PreferencesDialog::buttonBoxAccepted()

mPluginNames = QStringList();

for (auto preferencesWidget : mItemPreferencesWidgets) {
for (auto preferencesWidget : mItemPreferencesWidgets.values()) {
if (preferencesWidget->preferencesChanged()) {
preferencesWidget->savePreferences();

Expand Down Expand Up @@ -413,7 +413,7 @@ void PreferencesDialog::resetAll()
{
// Reset all of our general and plugins' preferences

for (auto preferencesWidget : mItemPreferencesWidgets)
for (auto preferencesWidget : mItemPreferencesWidgets.values())
preferencesWidget->resetPreferences();
}

Expand Down

0 comments on commit 63fa080

Please sign in to comment.