Skip to content

Commit

Permalink
Merge pull request #11768 from Pokechu22/temporary-debug-command-line
Browse files Browse the repository at this point in the history
Treat --debugger command line as a temporary setting
  • Loading branch information
AdmiralCurtiss committed Apr 18, 2023
2 parents 361ffd5 + 801fa8e commit a239af1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 0 additions & 2 deletions Source/Core/DolphinQt/Main.cpp
Expand Up @@ -257,8 +257,6 @@ int main(int argc, char* argv[])

MainWindow win{std::move(boot), static_cast<const char*>(options.get("movie"))};
Settings::Instance().SetCurrentUserStyle(Settings::Instance().GetCurrentUserStyle());
if (options.is_set("debugger"))
Settings::Instance().SetDebugModeEnabled(true);
win.Show();

#if defined(USE_ANALYTICS) && USE_ANALYTICS
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/DolphinQt/Settings.cpp
Expand Up @@ -465,9 +465,9 @@ void Settings::SetDebugModeEnabled(bool enabled)
{
Config::SetBaseOrCurrent(Config::MAIN_ENABLE_DEBUGGING, enabled);
emit DebugModeToggled(enabled);
if (enabled)
SetCodeVisible(true);
}
if (enabled)
SetCodeVisible(true);
}

bool Settings::IsDebugModeEnabled() const
Expand Down
7 changes: 5 additions & 2 deletions Source/Core/UICommon/CommandLineParse.cpp
Expand Up @@ -22,7 +22,7 @@ class CommandLineConfigLayerLoader final : public Config::ConfigLayerLoader
{
public:
CommandLineConfigLayerLoader(const std::list<std::string>& args, const std::string& video_backend,
const std::string& audio_backend, bool batch)
const std::string& audio_backend, bool batch, bool debugger)
: ConfigLayerLoader(Config::LayerType::CommandLine)
{
if (!video_backend.empty())
Expand All @@ -39,6 +39,9 @@ class CommandLineConfigLayerLoader final : public Config::ConfigLayerLoader
if (batch)
m_values.emplace_back(Config::MAIN_RENDER_TO_MAIN.GetLocation(), ValueToString(false));

if (debugger)
m_values.emplace_back(Config::MAIN_ENABLE_DEBUGGING.GetLocation(), ValueToString(true));

// Arguments are in the format of <System>.<Section>.<Key>=Value
for (const auto& arg : args)
{
Expand Down Expand Up @@ -134,7 +137,7 @@ static void AddConfigLayer(const optparse::Values& options)
Config::AddLayer(std::make_unique<CommandLineConfigLayerLoader>(
std::move(config_args), static_cast<const char*>(options.get("video_backend")),
static_cast<const char*>(options.get("audio_emulation")),
static_cast<bool>(options.get("batch"))));
static_cast<bool>(options.get("batch")), static_cast<bool>(options.get("debugger"))));
}

optparse::Values& ParseArguments(optparse::OptionParser* parser, int argc, char** argv)
Expand Down

0 comments on commit a239af1

Please sign in to comment.