Explorar el Código

Minor code quality improvements based on feedback

Signed-off-by: AMZN-Phil <[email protected]>
AMZN-Phil hace 2 años
padre
commit
69fc3a16a9

+ 5 - 4
Code/Tools/ProjectManager/Source/AddRemoteProjectDialog.cpp

@@ -201,11 +201,12 @@ namespace O3DE::ProjectManager
             }
         }
 
+        const bool isValidProjectRepo = validRepository && containsProjects;
         m_repoPath->SetValidationState(
-            (validRepository && containsProjects) ? FormLineEditWidget::ValidationState::ValidationSuccess
-                                                  : FormLineEditWidget::ValidationState::ValidationFailed);
-        m_repoPath->setErrorLabelVisible(!(validRepository && containsProjects));
-        SetDialogReady(validRepository && containsProjects);
+            isValidProjectRepo ? FormLineEditWidget::ValidationState::ValidationSuccess
+                               : FormLineEditWidget::ValidationState::ValidationFailed);
+        m_repoPath->setErrorLabelVisible(!isValidProjectRepo);
+        SetDialogReady(isValidProjectRepo);
     }
 
     void AddRemoteProjectDialog::DownloadObject()

+ 1 - 1
Code/Tools/ProjectManager/Source/FormLineEditWidget.h

@@ -66,7 +66,7 @@ namespace O3DE::ProjectManager
         QLabel* m_processingSpinner = nullptr;
         QLabel* m_validationErrorIcon = nullptr;
         QLabel* m_validationSuccessIcon = nullptr;
-        ValidationState m_validationState;
+        ValidationState m_validationState = ValidationState::NotValidating;
 
     private slots:
         void flavorChanged();

+ 1 - 1
Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp

@@ -419,7 +419,7 @@ namespace O3DE::ProjectManager
         m_projectNameLabel->refreshStyle(); // important for styles to work correctly
     }
 
-    void ProjectButton::SetState(enum ProjectButtonState state)
+    void ProjectButton::SetState(ProjectButtonState state)
     {
         m_currentState = state;
         ResetButtonWidgets();

+ 2 - 2
Code/Tools/ProjectManager/Source/ProjectButtonWidget.h

@@ -115,8 +115,8 @@ namespace O3DE::ProjectManager
 
         void SetEngine(const EngineInfo& engine);
         void SetProject(const ProjectInfo& project);
-        void SetState(enum ProjectButtonState state);
-        const ProjectButtonState& GetState() const
+        void SetState(ProjectButtonState state);
+        const ProjectButtonState GetState() const
         {
             return m_currentState;
         }