aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/generators/generatordata.h
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-06-02 20:12:10 -0700
committerJake Petroules <jake.petroules@qt.io>2017-06-06 16:45:31 +0000
commite68a7a584f84ed889255341fae21a5e35fdb1132 (patch)
treeca76d94e903a9d5d8cf2bb8701dd9f41858fcf38 /src/lib/corelib/generators/generatordata.h
parent3285bc1b02ebd1a737ec3660502f7aab2850548b (diff)
Fix handling of same subproject names in generated VS solutions
While Qbs product names must be unambiguous, using the same project name several times is perfectly valid, as long as all projects with the same name belong to a different root project. Utilize the project's source file location to distinguish projects that have the same name. Use this in conjunction with the name to create an ID that is used as the key for the solutionFolders map. Change-Id: I47079cd4207d505892e79755a3986614025d2749 Task-number: QBS-1082 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Thomas Epting <thomas.epting@stryker.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/generators/generatordata.h')
-rw-r--r--src/lib/corelib/generators/generatordata.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/corelib/generators/generatordata.h b/src/lib/corelib/generators/generatordata.h
index 2c64bb370..d57f2f510 100644
--- a/src/lib/corelib/generators/generatordata.h
+++ b/src/lib/corelib/generators/generatordata.h
@@ -59,10 +59,22 @@ struct GeneratableProductData {
};
struct GeneratableProjectData {
+ struct Id {
+ private:
+ friend class GeneratableProjectData;
+ Id() { }
+ QString value;
+
+ public:
+ bool operator<(const Id &id) const { return value < id.value; }
+ };
+
GeneratableProjectDataMap data;
QList<GeneratableProjectData> subProjects;
QList<GeneratableProductData> products;
QString name() const;
+ CodeLocation location() const;
+ Id uniqueName() const;
};
struct GeneratableProject : public GeneratableProjectData {