From 896e46dcd935dd2dda1f309f2fd17336ed87c4e4 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 14 Jan 2018 12:48:43 +0200 Subject: [PATCH] dont write updated ids if they didnt change --- app/layout.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/layout.cpp b/app/layout.cpp index 09a19d580..0b858fe56 100644 --- a/app/layout.cpp +++ b/app/layout.cpp @@ -955,11 +955,15 @@ QString Layout::newUniqueIdsLayoutFromFile(QString file, bool enforceNewIds) QString fileText = in.readAll(); foreach (auto contId, toInvestigateContainmentIds) { - fileText = fileText.replace("[Containments][" + contId + "]", "[Containments][" + assigned[contId] + "]"); + if (contId != assigned[contId]) { + fileText = fileText.replace("[Containments][" + contId + "]", "[Containments][" + assigned[contId] + "]"); + } } foreach (auto appId, toInvestigateAppletIds) { - fileText = fileText.replace("][Applets][" + appId + "]", "][Applets][" + assigned[appId] + "]"); + if (appId != assigned[appId]) { + fileText = fileText.replace("][Applets][" + appId + "]", "][Applets][" + assigned[appId] + "]"); + } } f.close();