From 07ed7ec567702e76ca829f29bc3e23d44caf68c0 Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@digia.com>
Date: Mon, 18 Feb 2013 11:43:12 +0100
Subject: [PATCH] Qt: Reduce size of BaseQtVersion by reordering member
 variables

Old size on 64bit: 176 byte, new 152 byte

Change-Id: Icfca471e921b919b88b58f3df128d025ccb76da8
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
---
 src/plugins/qtsupport/baseqtversion.cpp |  4 ++--
 src/plugins/qtsupport/baseqtversion.h   | 26 +++++++++++++------------
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp
index 382872686ff..064f1f4d072 100644
--- a/src/plugins/qtsupport/baseqtversion.cpp
+++ b/src/plugins/qtsupport/baseqtversion.cpp
@@ -169,7 +169,6 @@ int BaseQtVersion::getUniqueId()
 BaseQtVersion::BaseQtVersion(const FileName &qmakeCommand, bool isAutodetected, const QString &autodetectionSource)
     : m_id(getUniqueId()),
       m_isAutodetected(isAutodetected),
-      m_autodetectionSource(autodetectionSource),
       m_hasDebuggingHelper(false),
       m_hasQmlDump(false),
       m_hasQmlDebuggingLibrary(false),
@@ -183,7 +182,8 @@ BaseQtVersion::BaseQtVersion(const FileName &qmakeCommand, bool isAutodetected,
       m_hasExamples(false),
       m_hasDemos(false),
       m_hasDocumentation(false),
-      m_qmakeIsExecutable(true)
+      m_qmakeIsExecutable(true),
+      m_autodetectionSource(autodetectionSource)
 {
     ctor(qmakeCommand);
 }
diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h
index f9f9cf76cdf..e4908d24c0b 100644
--- a/src/plugins/qtsupport/baseqtversion.h
+++ b/src/plugins/qtsupport/baseqtversion.h
@@ -250,32 +250,35 @@ private:
     void updateMkspec() const;
     void setId(int id); // used by the qtversionmanager for legacy restore
                         // and by the qtoptionspage to replace Qt versions
-    QString m_displayName;
+
     int m_id;
-    bool m_isAutodetected;
-    QString m_autodetectionSource;
 
-    mutable Utils::FileName m_sourcePath;
+    bool m_isAutodetected;
     mutable bool m_hasDebuggingHelper; // controlled by m_versionInfoUpToDate
     mutable bool m_hasQmlDump;         // controlled by m_versionInfoUpToDate
     mutable bool m_hasQmlDebuggingLibrary; // controlled by m_versionInfoUpdate
     mutable bool m_hasQmlObserver;     // controlled by m_versionInfoUpToDate
-
     mutable bool m_mkspecUpToDate;
-    mutable Utils::FileName m_mkspec;
-    mutable Utils::FileName m_mkspecFullPath;
-
     mutable bool m_mkspecReadUpToDate;
     mutable bool m_defaultConfigIsDebug;
     mutable bool m_defaultConfigIsDebugAndRelease;
-    mutable QHash<QString, QString> m_mkspecValues;
-
     mutable bool m_versionInfoUpToDate;
-    mutable QHash<QString,QString> m_versionInfo;
     mutable bool m_installed;
     mutable bool m_hasExamples;
     mutable bool m_hasDemos;
     mutable bool m_hasDocumentation;
+    mutable bool m_qmakeIsExecutable;
+
+    QString m_displayName;
+    QString m_autodetectionSource;
+    mutable Utils::FileName m_sourcePath;
+
+    mutable Utils::FileName m_mkspec;
+    mutable Utils::FileName m_mkspecFullPath;
+
+    mutable QHash<QString, QString> m_mkspecValues;
+
+    mutable QHash<QString,QString> m_versionInfo;
 
     mutable Utils::FileName m_qmakeCommand;
     mutable QString m_qtVersionString;
@@ -285,7 +288,6 @@ private:
     mutable QString m_qmlsceneCommand;
     mutable QString m_qmlviewerCommand;
 
-    mutable bool m_qmakeIsExecutable;
     mutable QList<ProjectExplorer::Abi> m_qtAbis;
 };
 }
-- 
GitLab