Skip to content

Commit

Permalink
UI: Open active profile directory via File menu
Browse files Browse the repository at this point in the history
  • Loading branch information
WizardCM authored and RytoEX committed Oct 30, 2024
1 parent 038c91d commit 0be9d9f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ template<typename T> static void SetOBSRef(QListWidgetItem *item, T &&val)
item->setData(static_cast<int>(QtDataRole::OBSRef), QVariant::fromValue(val));
}

constexpr std::string_view OBSProfilePath = "/obs-studio/basic/profiles/";

static void AddExtraModulePaths()
{
string plugins_path, plugins_data_path;
Expand Down Expand Up @@ -7627,13 +7625,14 @@ void OBSBasic::on_actionShowSettingsFolder_triggered()

void OBSBasic::on_actionShowProfileFolder_triggered()
{
std::string userProfilePath;
userProfilePath.reserve(App()->userProfilesLocation.u8string().size() + OBSProfilePath.size());
userProfilePath.append(App()->userProfilesLocation.u8string()).append(OBSProfilePath);

const QString userProfileLocation = QString::fromStdString(userProfilePath);
try {
const OBSProfile &currentProfile = GetCurrentProfile();
QString currentProfileLocation = QString::fromStdString(currentProfile.path.u8string());

QDesktopServices::openUrl(QUrl::fromLocalFile(userProfileLocation));
QDesktopServices::openUrl(QUrl::fromLocalFile(currentProfileLocation));
} catch (const std::invalid_argument &error) {
blog(LOG_ERROR, "%s", error.what());
}
}

int OBSBasic::GetTopSelectedSourceItem()
Expand Down

0 comments on commit 0be9d9f

Please sign in to comment.