ProjectInfo.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 isScriptOnly,
  23. bool needsBuild)
  24. : m_path(path)
  25. , m_projectName(projectName)
  26. , m_displayName(displayName)
  27. , m_id(id)
  28. , m_origin(origin)
  29. , m_summary(summary)
  30. , m_iconPath(iconPath)
  31. , m_newPreviewImagePath(newPreviewImagePath)
  32. , m_newBackgroundImagePath(newBackgroundImagePath)
  33. , m_isScriptOnly(isScriptOnly)
  34. , m_needsBuild(needsBuild)
  35. {
  36. }
  37. bool ProjectInfo::operator==(const ProjectInfo& rhs) const
  38. {
  39. if (m_path != rhs.m_path)
  40. {
  41. return false;
  42. }
  43. if (m_projectName != rhs.m_projectName)
  44. {
  45. return false;
  46. }
  47. if (m_engineName != rhs.m_engineName)
  48. {
  49. return false;
  50. }
  51. if (m_enginePath != rhs.m_enginePath)
  52. {
  53. return false;
  54. }
  55. if (m_displayName != rhs.m_displayName)
  56. {
  57. return false;
  58. }
  59. if (m_id != rhs.m_id)
  60. {
  61. return false;
  62. }
  63. if (m_origin != rhs.m_origin)
  64. {
  65. return false;
  66. }
  67. if (m_summary != rhs.m_summary)
  68. {
  69. return false;
  70. }
  71. if (m_iconPath != rhs.m_iconPath)
  72. {
  73. return false;
  74. }
  75. if (m_newPreviewImagePath != rhs.m_newPreviewImagePath)
  76. {
  77. return false;
  78. }
  79. if (m_newBackgroundImagePath != rhs.m_newBackgroundImagePath)
  80. {
  81. return false;
  82. }
  83. if (m_version != rhs.m_version)
  84. {
  85. return false;
  86. }
  87. if (m_isScriptOnly != rhs.m_isScriptOnly)
  88. {
  89. return false;
  90. }
  91. return true;
  92. }
  93. bool ProjectInfo::operator!=(const ProjectInfo& rhs) const
  94. {
  95. return !operator==(rhs);
  96. }
  97. bool ProjectInfo::IsValid() const
  98. {
  99. return !m_path.isEmpty() && !m_projectName.isEmpty() && !m_id.isEmpty();
  100. }
  101. const QString& ProjectInfo::GetProjectDisplayName() const
  102. {
  103. if (!m_displayName.isEmpty())
  104. {
  105. return m_displayName;
  106. }
  107. else
  108. {
  109. return m_projectName;
  110. }
  111. }
  112. } // namespace O3DE::ProjectManager