mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-14 14:43:15 +00:00
Fix SSH remote links (#3025)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
This commit is contained in:
parent
6bdd83684b
commit
1930a2132c
4 changed files with 29 additions and 18 deletions
|
@ -1,6 +1,8 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "common/scm_rev.h"
|
#include "common/scm_rev.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
@ -15,5 +17,26 @@ constexpr char g_scm_remote_name[] = "@GIT_REMOTE_NAME@";
|
||||||
constexpr char g_scm_remote_url[] = "@GIT_REMOTE_URL@";
|
constexpr char g_scm_remote_url[] = "@GIT_REMOTE_URL@";
|
||||||
constexpr char g_scm_date[] = "@BUILD_DATE@";
|
constexpr char g_scm_date[] = "@BUILD_DATE@";
|
||||||
|
|
||||||
|
const std::string GetRemoteNameFromLink() {
|
||||||
|
std::string remote_url(Common::g_scm_remote_url);
|
||||||
|
std::string remote_host;
|
||||||
|
try {
|
||||||
|
if (remote_url.starts_with("http")) {
|
||||||
|
if (*remote_url.rbegin() == '/') {
|
||||||
|
remote_url.pop_back();
|
||||||
|
}
|
||||||
|
remote_host = remote_url.substr(19, remote_url.rfind('/') - 19);
|
||||||
|
} else if (remote_url.starts_with("git@")) {
|
||||||
|
auto after_comma_pos = remote_url.find(':') + 1, slash_pos = remote_url.find('/');
|
||||||
|
remote_host = remote_url.substr(after_comma_pos, slash_pos - after_comma_pos);
|
||||||
|
} else {
|
||||||
|
remote_host = "unknown";
|
||||||
|
}
|
||||||
|
} catch (...) {
|
||||||
|
remote_host = "unknown";
|
||||||
|
}
|
||||||
|
return remote_host;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
||||||
extern const char g_version[];
|
extern const char g_version[];
|
||||||
|
@ -15,4 +17,6 @@ extern const char g_scm_remote_name[];
|
||||||
extern const char g_scm_remote_url[];
|
extern const char g_scm_remote_url[];
|
||||||
extern const char g_scm_date[];
|
extern const char g_scm_date[];
|
||||||
|
|
||||||
|
const std::string GetRemoteNameFromLink();
|
||||||
|
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
|
|
@ -194,15 +194,7 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
|
||||||
std::string game_title = fmt::format("{} - {} <{}>", id, title, app_version);
|
std::string game_title = fmt::format("{} - {} <{}>", id, title, app_version);
|
||||||
std::string window_title = "";
|
std::string window_title = "";
|
||||||
std::string remote_url(Common::g_scm_remote_url);
|
std::string remote_url(Common::g_scm_remote_url);
|
||||||
std::string remote_host;
|
std::string remote_host = Common::GetRemoteNameFromLink();
|
||||||
try {
|
|
||||||
if (*remote_url.rbegin() == '/') {
|
|
||||||
remote_url.pop_back();
|
|
||||||
}
|
|
||||||
remote_host = remote_url.substr(19, remote_url.rfind('/') - 19);
|
|
||||||
} catch (...) {
|
|
||||||
remote_host = "unknown";
|
|
||||||
}
|
|
||||||
if (Common::g_is_release) {
|
if (Common::g_is_release) {
|
||||||
if (remote_host == "shadps4-emu" || remote_url.length() == 0) {
|
if (remote_host == "shadps4-emu" || remote_url.length() == 0) {
|
||||||
window_title = fmt::format("shadPS4 v{} | {}", Common::g_version, game_title);
|
window_title = fmt::format("shadPS4 v{} | {}", Common::g_version, game_title);
|
||||||
|
|
|
@ -56,15 +56,7 @@ bool MainWindow::Init() {
|
||||||
setMinimumSize(720, 405);
|
setMinimumSize(720, 405);
|
||||||
std::string window_title = "";
|
std::string window_title = "";
|
||||||
std::string remote_url(Common::g_scm_remote_url);
|
std::string remote_url(Common::g_scm_remote_url);
|
||||||
std::string remote_host;
|
std::string remote_host = Common::GetRemoteNameFromLink();
|
||||||
try {
|
|
||||||
if (*remote_url.rbegin() == '/') {
|
|
||||||
remote_url.pop_back();
|
|
||||||
}
|
|
||||||
remote_host = remote_url.substr(19, remote_url.rfind('/') - 19);
|
|
||||||
} catch (...) {
|
|
||||||
remote_host = "unknown";
|
|
||||||
}
|
|
||||||
if (Common::g_is_release) {
|
if (Common::g_is_release) {
|
||||||
if (remote_host == "shadps4-emu" || remote_url.length() == 0) {
|
if (remote_host == "shadps4-emu" || remote_url.length() == 0) {
|
||||||
window_title = fmt::format("shadPS4 v{}", Common::g_version);
|
window_title = fmt::format("shadPS4 v{}", Common::g_version);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue