Miscellaneous fixes and PAL changes required for restricted platforms. (#4021)
* Miscellaneous fixes and PAL changes required for restricted platforms. Signed-off-by: bosnichd <bosnichd@amazon.com> * Rename O3DE::ProjectManager::ProjectUtils::ReplaceFile -> ReplaceProjectFile to prevent conflict with Windows ReplaceFile #define Signed-off-by: bosnichd <bosnichd@amazon.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <AzCore/std/functional.h>
|
||||
#include <AzCore/std/parallel/thread.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/PlatformIncl.h>
|
||||
|
||||
#include <AzFramework/CommandLine/CommandLine.h>
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace AzFramework::ProjectManager
|
||||
return ProjectPathCheckResult::ProjectManagerLaunchFailed;
|
||||
}
|
||||
|
||||
bool LaunchProjectManager(const AZStd::string& commandLineArgs)
|
||||
bool LaunchProjectManager([[maybe_unused]]const AZStd::string& commandLineArgs)
|
||||
{
|
||||
bool launchSuccess = false;
|
||||
#if (AZ_TRAIT_AZFRAMEWORK_USE_PROJECT_MANAGER)
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/AzCore_Traits_Platform.h>
|
||||
|
||||
// Description : Linux/Mac port support for Win32API calls
|
||||
#if !defined(WIN32)
|
||||
#if AZ_TRAIT_LEGACY_CRYCOMMON_USE_WINDOWS_STUBS
|
||||
|
||||
#include "platform.h" // Note: This should be first to get consistent debugging definitions
|
||||
|
||||
@@ -1391,4 +1392,4 @@ __finddata64_t::~__finddata64_t()
|
||||
}
|
||||
#endif //defined(APPLE) || defined(LINUX)
|
||||
|
||||
#endif // !defined(WIN32)
|
||||
#endif // AZ_TRAIT_LEGACY_CRYCOMMON_USE_WINDOWS_STUBS
|
||||
|
||||
@@ -131,7 +131,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
#include "SystemEventDispatcher.h"
|
||||
#include "HMDBus.h"
|
||||
|
||||
#include "zlib.h"
|
||||
#include "RemoteConsole/RemoteConsole.h"
|
||||
|
||||
#include <PNoise3.h>
|
||||
|
||||
@@ -273,11 +273,7 @@ static const char* GetLastSystemErrorMessage()
|
||||
|
||||
return szBuffer;
|
||||
}
|
||||
#else
|
||||
return 0;
|
||||
|
||||
#endif //WIN32
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -441,7 +441,7 @@ namespace O3DE::ProjectManager
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReplaceFile(const QString& origFile, const QString& newFile, QWidget* parent, bool interactive)
|
||||
bool ReplaceProjectFile(const QString& origFile, const QString& newFile, QWidget* parent, bool interactive)
|
||||
{
|
||||
QFileInfo original(origFile);
|
||||
if (original.exists())
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace O3DE::ProjectManager
|
||||
bool DeleteProjectFiles(const QString& path, bool force = false);
|
||||
bool MoveProject(QString origPath, QString newPath, QWidget* parent, bool skipRegister = false);
|
||||
|
||||
bool ReplaceFile(const QString& origFile, const QString& newFile, QWidget* parent = nullptr, bool interactive = true);
|
||||
bool ReplaceProjectFile(const QString& origFile, const QString& newFile, QWidget* parent = nullptr, bool interactive = true);
|
||||
|
||||
bool FindSupportedCompiler(QWidget* parent = nullptr);
|
||||
AZ::Outcome<void, QString> FindSupportedCompilerForPlatform();
|
||||
|
||||
@@ -242,7 +242,7 @@ namespace O3DE::ProjectManager
|
||||
|
||||
if (!newProjectSettings.m_newPreviewImagePath.isEmpty())
|
||||
{
|
||||
if (!ProjectUtils::ReplaceFile(
|
||||
if (!ProjectUtils::ReplaceProjectFile(
|
||||
QDir(newProjectSettings.m_path).filePath(newProjectSettings.m_iconPath), newProjectSettings.m_newPreviewImagePath))
|
||||
{
|
||||
QMessageBox::critical(this, tr("File replace failed"), tr("Failed to replace project preview image."));
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace O3DE::ProjectManager
|
||||
TEST_F(ProjectManagerUtilsTests, ReplaceFile_Succeeds)
|
||||
#endif // !AZ_TRAIT_DISABLE_FAILED_PROJECT_MANAGER_TESTS
|
||||
{
|
||||
EXPECT_TRUE(ReplaceFile(m_projectAOrigFilePath, m_projectAReplaceFilePath, nullptr, false));
|
||||
EXPECT_TRUE(ReplaceProjectFile(m_projectAOrigFilePath, m_projectAReplaceFilePath, nullptr, false));
|
||||
|
||||
QFile origFile(m_projectAOrigFilePath);
|
||||
EXPECT_TRUE(origFile.open(QIODevice::ReadOnly));
|
||||
|
||||
Reference in New Issue
Block a user