Commit baa4a9aa authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port foreach(...)

parent 6c10c8f5
Pipeline #48166 failed with stage
in 1 minute and 38 seconds
......@@ -104,6 +104,7 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054F00)
add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
add_definitions(-DQT_NO_EMIT)
add_definitions(-DQT_NO_FOREACH)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
......
......@@ -193,7 +193,9 @@ SetupManager *Dialog::setupManager()
void Dialog::clearDynamicPages()
{
foreach (KPageWidgetItem *item, mDynamicPages) {
const auto dynamicPages = mDynamicPages;
for (int i = 0, total = dynamicPages.count(); i < total; ++i) {
KPageWidgetItem *item = mDynamicPages.at(i);
removePage(item);
}
mDynamicPages.clear();
......
......@@ -177,8 +177,10 @@ void SetupManager::rollback()
{
m_page->setStatus(i18n("Failed to set up account, rolling back..."));
const int setupObjectCount = m_objectToSetup.size() + m_setupObjects.size();
int remainingObjectCount = m_setupObjects.size();
foreach (SetupObject *obj, m_setupObjects) {
const int remainingObjectCount = m_setupObjects.size();
const auto setupObjectsList = m_setupObjects;
for (int i = 0; i < setupObjectsList.count(); ++i) {
auto obj = m_setupObjects.at(i);
m_page->setProgress((remainingObjectCount * 100) / setupObjectCount);
if (obj) {
obj->destroy();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment