diff --git a/Common/File/DiskFree.cpp b/Common/File/DiskFree.cpp index 07c92c9d40..35a0947dfa 100644 --- a/Common/File/DiskFree.cpp +++ b/Common/File/DiskFree.cpp @@ -19,7 +19,6 @@ #include #include "Common/Log.h" -#include "Core/Config.h" #include "Common/File/Path.h" #include "Common/File/AndroidStorage.h" #include "Common/Data/Encoding/Utf8.h" diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index 47b3cdbb27..eb7f403c8e 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -845,12 +845,11 @@ uint64_t GetFileSize(const Path &filename) { #if defined(_WIN32) && defined(UNICODE) WIN32_FILE_ATTRIBUTE_DATA attr; #if PPSSPP_PLATFORM(UWP) - if (!GetFileAttributesExFromAppW(filename.ToWString().c_str(), GetFileExInfoStandard, &attr)) { + if (!GetFileAttributesExFromAppW(filename.ToWString().c_str(), GetFileExInfoStandard, &attr)) #else - if (!GetFileAttributesEx(filename.ToWString().c_str(), GetFileExInfoStandard, &attr)){ + if (!GetFileAttributesEx(filename.ToWString().c_str(), GetFileExInfoStandard, &attr)) #endif return 0; - } if (attr.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) return 0; return ((uint64_t)attr.nFileSizeHigh << 32) | (uint64_t)attr.nFileSizeLow; diff --git a/Common/File/Path.cpp b/Common/File/Path.cpp index 4dd37ca166..8b81d44e04 100644 --- a/Common/File/Path.cpp +++ b/Common/File/Path.cpp @@ -269,6 +269,9 @@ std::string Path::ToVisualString(const char *relativeRoot) const { return AndroidContentURI(path_).ToVisualString(); #if PPSSPP_PLATFORM(WINDOWS) } else if (type_ == PathType::NATIVE) { +#if PPSSPP_PLATFORM(UWP) && !defined(__LIBRETRO__) + return GetPreviewPath(path_); +#else // It can be useful to show the path as relative to the memstick if (relativeRoot) { std::string root = ReplaceAll(relativeRoot, "/", "\\"); @@ -281,6 +284,7 @@ std::string Path::ToVisualString(const char *relativeRoot) const { } else { return ReplaceAll(path_, "/", "\\"); } +#endif #else if (relativeRoot) { std::string root = relativeRoot; @@ -298,14 +302,6 @@ std::string Path::ToVisualString(const char *relativeRoot) const { } } -std::string Path::ToShortFriendlyPath() const { -#if PPSSPP_PLATFORM(UWP) && !defined(__LIBRETRO__) - return GetPreviewPath(path_); -#else - return Path(path_).ToVisualString(); -#endif -} - bool Path::CanNavigateUp() const { if (type_ == PathType::CONTENT_URI) { return AndroidContentURI(path_).CanNavigateUp(); diff --git a/Common/File/Path.h b/Common/File/Path.h index f9a217e75d..ac93f9a9b8 100644 --- a/Common/File/Path.h +++ b/Common/File/Path.h @@ -94,7 +94,6 @@ public: // Pass in a relative root to turn the path into a relative path - if it is one! std::string ToVisualString(const char *relativeRoot = nullptr) const; - std::string ToShortFriendlyPath() const; bool CanNavigateUp() const; Path NavigateUp() const; diff --git a/Common/File/PathBrowser.cpp b/Common/File/PathBrowser.cpp index d9f71e9644..f5ab1a33be 100644 --- a/Common/File/PathBrowser.cpp +++ b/Common/File/PathBrowser.cpp @@ -193,7 +193,7 @@ bool PathBrowser::IsListingReady() { } std::string PathBrowser::GetFriendlyPath() const { - std::string str = GetPath().ToShortFriendlyPath(); + std::string str = GetPath().ToVisualString(); // Show relative to memstick root if there. if (startsWith(str, aliasMatch_)) { return aliasDisplay_ + str.substr(aliasMatch_.size()); diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 5f6f60dd0a..6cea8d1c2b 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -652,10 +652,10 @@ void SystemInfoScreen::CreateViews() { storage->Add(new ItemHeader(si->T("Directories"))); // Intentionally non-translated - storage->Add(new InfoItem("MemStickDirectory", g_Config.memStickDirectory.ToShortFriendlyPath())); - storage->Add(new InfoItem("InternalDataDirectory", g_Config.internalDataDirectory.ToShortFriendlyPath())); - storage->Add(new InfoItem("AppCacheDir", g_Config.appCacheDirectory.ToShortFriendlyPath())); - storage->Add(new InfoItem("DefaultCurrentDir", g_Config.defaultCurrentDirectory.ToShortFriendlyPath())); + storage->Add(new InfoItem("MemStickDirectory", g_Config.memStickDirectory.ToVisualString())); + storage->Add(new InfoItem("InternalDataDirectory", g_Config.internalDataDirectory.ToVisualString())); + storage->Add(new InfoItem("AppCacheDir", g_Config.appCacheDirectory.ToVisualString())); + storage->Add(new InfoItem("DefaultCurrentDir", g_Config.defaultCurrentDirectory.ToVisualString())); #if PPSSPP_PLATFORM(ANDROID) storage->Add(new InfoItem("ExtFilesDir", g_extFilesDir)); diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index eb163fc419..5460dd5ae3 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -115,7 +115,7 @@ void GameScreen::CreateViews() { tvID_ = infoLayout->Add(new TextView("", ALIGN_LEFT | FLAG_WRAP_TEXT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT))); tvID_->SetShadow(true); // This one doesn't need to be updated. - infoLayout->Add(new TextView(gamePath_.ToShortFriendlyPath(), ALIGN_LEFT | FLAG_WRAP_TEXT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetShadow(true); + infoLayout->Add(new TextView(gamePath_.ToVisualString(), ALIGN_LEFT | FLAG_WRAP_TEXT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetShadow(true); tvGameSize_ = infoLayout->Add(new TextView("...", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT))); tvGameSize_->SetShadow(true); tvSaveDataSize_ = infoLayout->Add(new TextView("...", ALIGN_LEFT, true, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT))); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 0a9f3e22c1..9b6be536e2 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -992,7 +992,7 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) { } #elif defined(_WIN32) #if PPSSPP_PLATFORM(UWP) - memstickDisplay_ = g_Config.memStickDirectory.ToShortFriendlyPath(); + memstickDisplay_ = g_Config.memStickDirectory.ToVisualString(); auto memstickPath = systemSettings->Add(new ChoiceWithValueDisplay(&memstickDisplay_, sy->T("Memory Stick folder", "Memory Stick folder"), I18NCat::NONE)); memstickPath->SetEnabled(!PSP_IsInited()); memstickPath->OnClick.Handle(this, &GameSettingsScreen::OnChangeMemStickDir); diff --git a/UI/MemStickScreen.cpp b/UI/MemStickScreen.cpp index 96590a0996..75a996cde3 100644 --- a/UI/MemStickScreen.cpp +++ b/UI/MemStickScreen.cpp @@ -267,7 +267,7 @@ void MemStickScreen::CreateViews() { if (choice_ == CHOICE_BROWSE_FOLDER || choice_ == CHOICE_SET_MANUAL) { UI::View *extraView = nullptr; if (!g_Config.memStickDirectory.empty()) { - extraView = new TextView(StringFromFormat(" %s: %s", iz->T("Current"), g_Config.memStickDirectory.ToShortFriendlyPath().c_str()), ALIGN_LEFT, false); + extraView = new TextView(StringFromFormat(" %s: %s", iz->T("Current"), g_Config.memStickDirectory.ToVisualString().c_str()), ALIGN_LEFT, false); } AddExplanation(leftColumn, (MemStickScreen::Choice)choice_, extraView); } @@ -584,7 +584,7 @@ void ConfirmMemstickMoveScreen::CreateViews() { if (!initialSetup_) { leftColumn->Add(new TextView(iz->T("PPSSPP will restart after the change"), ALIGN_LEFT, false)); } - leftColumn->Add(new TextView(newMemstickFolder_.ToShortFriendlyPath(), ALIGN_LEFT, false)); + leftColumn->Add(new TextView(newMemstickFolder_.ToVisualString(), ALIGN_LEFT, false)); std::string newFreeSpaceText = std::string(iz->T("Free space")) + ": " + FormatSpaceString(freeSpaceNew); leftColumn->Add(new TextView(newFreeSpaceText, ALIGN_LEFT, false)); if (existingFilesInNewFolder_) { @@ -601,7 +601,7 @@ void ConfirmMemstickMoveScreen::CreateViews() { std::string oldFreeSpaceText = std::string(iz->T("Free space")) + ": " + FormatSpaceString(freeSpaceOld); rightColumn->Add(new TextView(std::string(iz->T("Current")) + ":", ALIGN_LEFT, false)); - rightColumn->Add(new TextView(oldMemstickFolder.ToShortFriendlyPath(), ALIGN_LEFT, false)); + rightColumn->Add(new TextView(oldMemstickFolder.ToVisualString(), ALIGN_LEFT, false)); rightColumn->Add(new TextView(oldFreeSpaceText, ALIGN_LEFT, false)); } diff --git a/UWP/App.cpp b/UWP/App.cpp index 0b1afde5ad..ef3a5939e4 100644 --- a/UWP/App.cpp +++ b/UWP/App.cpp @@ -15,7 +15,6 @@ #include #include "UWPHelpers/LaunchItem.h" -#include using namespace UWP; @@ -125,8 +124,7 @@ bool App::HasBackButton() { void App::App_BackRequested(Platform::Object^ sender, Windows::UI::Core::BackRequestedEventArgs^ e) { if (m_isPhone) { e->Handled = m_main->OnHardwareButton(HardwareButton::BACK); - } - else { + } else { e->Handled = true; } } @@ -163,7 +161,7 @@ void App::OnPointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::C float X = args->CurrentPoint->Position.X; float Y = args->CurrentPoint->Position.Y; int64_t timestamp = args->CurrentPoint->Timestamp; - m_main->OnTouchEvent(TOUCH_DOWN | TOUCH_MOVE, pointerId, X, Y, (double)timestamp); + m_main->OnTouchEvent(TOUCH_DOWN|TOUCH_MOVE, pointerId, X, Y, (double)timestamp); if (!m_isPhone) { sender->SetPointerCapture(); } @@ -176,7 +174,7 @@ void App::OnPointerReleased(Windows::UI::Core::CoreWindow^ sender, Windows::UI:: float X = args->CurrentPoint->Position.X; float Y = args->CurrentPoint->Position.Y; int64_t timestamp = args->CurrentPoint->Timestamp; - m_main->OnTouchEvent(TOUCH_UP | TOUCH_MOVE, pointerId, X, Y, (double)timestamp); + m_main->OnTouchEvent(TOUCH_UP|TOUCH_MOVE, pointerId, X, Y, (double)timestamp); if (!m_isPhone) { sender->ReleasePointerCapture(); } @@ -206,8 +204,7 @@ void App::Run() { if (m_main->Render()) { m_deviceResources->Present(); } - } - else { + } else { CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); } } diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index bbef42887f..53713b4de0 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -461,7 +461,7 @@ bool System_GetPropertyBool(SystemProperty prop) { case SYSPROP_HAS_FILE_BROWSER: return true; case SYSPROP_HAS_FOLDER_BROWSER: - return true; // now supported + return true; case SYSPROP_HAS_IMAGE_BROWSER: return true; // we just use the file browser case SYSPROP_HAS_BACK_BUTTON: