ProjectInfo.cpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <ProjectInfo.h>
  9. #include <ProjectManagerDefs.h>
  10. namespace O3DE::ProjectManager
  11. {
  12. ProjectInfo::ProjectInfo(
  13. const QString& path,
  14. const QString& projectName,
  15. const QString& displayName,
  16. const QString& id,
  17. const QString& origin,
  18. const QString& summary,
  19. const QString& iconPath,
  20. const QString& newPreviewImagePath,
  21. const QString& newBackgroundImagePath,
  22. bool needsBuild)
  23. : m_path(path)
  24. , m_projectName(projectName)
  25. , m_displayName(displayName)
  26. , m_id(id)
  27. , m_origin(origin)
  28. , m_summary(summary)
  29. , m_iconPath(iconPath)
  30. , m_newPreviewImagePath(newPreviewImagePath)
  31. , m_newBackgroundImagePath(newBackgroundImagePath)
  32. , m_needsBuild(needsBuild)
  33. {
  34. }
  35. bool ProjectInfo::operator==(const ProjectInfo& rhs) const
  36. {
  37. if (m_path != rhs.m_path)
  38. {
  39. return false;
  40. }
  41. if (m_projectName != rhs.m_projectName)
  42. {
  43. return false;
  44. }
  45. if (m_engineName != rhs.m_engineName)
  46. {
  47. return false;
  48. }
  49. if (m_enginePath != rhs.m_enginePath)
  50. {
  51. return false;
  52. }
  53. if (m_displayName != rhs.m_displayName)
  54. {
  55. return false;
  56. }
  57. if (m_id != rhs.m_id)
  58. {
  59. return false;
  60. }
  61. if (m_origin != rhs.m_origin)
  62. {
  63. return false;
  64. }
  65. if (m_summary != rhs.m_summary)
  66. {
  67. return false;
  68. }
  69. if (m_iconPath != rhs.m_iconPath)
  70. {
  71. return false;
  72. }
  73. if (m_newPreviewImagePath != rhs.m_newPreviewImagePath)
  74. {
  75. return false;
  76. }
  77. if (m_newBackgroundImagePath != rhs.m_newBackgroundImagePath)
  78. {
  79. return false;
  80. }
  81. if (m_version != rhs.m_version)
  82. {
  83. return false;
  84. }
  85. return true;
  86. }
  87. bool ProjectInfo::operator!=(const ProjectInfo& rhs) const
  88. {
  89. return !operator==(rhs);
  90. }
  91. bool ProjectInfo::IsValid() const
  92. {
  93. return !m_path.isEmpty() && !m_projectName.isEmpty() && !m_id.isEmpty();
  94. }
  95. const QString& ProjectInfo::GetProjectDisplayName() const
  96. {
  97. if (!m_displayName.isEmpty())
  98. {
  99. return m_displayName;
  100. }
  101. else
  102. {
  103. return m_projectName;
  104. }
  105. }
  106. } // namespace O3DE::ProjectManager