Repository navigation
frontend: Import a profile from a path with a trailing slash - #2312
Merged
Merged
Conversation
Importing a profile from a folder path that ends in a separator copies the profile's files into the profiles folder itself: the directory name is the path's filename(), which is empty for "/x/MyProfile/". The macOS folder dialog returns such a path, and a path typed into Qt's dialog can end in a separator too. on_actionImportProfile_triggered() now takes the directory name and does the copy through frontend/utility/profile-import.hpp, which keeps the current behaviour. test_profile_import builds it with QtCore only: the directory name for "/x/MyProfile/", "/x/My Profile//", "C:/x/P/" and "/x/.." (fails), "/x/MyProfile" and "/" (pass); an import from a path with a trailing separator into a temporary profiles folder must put the files in profiles/MyProfile/ (fails), and an import with no directory name must copy nothing into the profiles folder (fails). Refs obs-rust#2295
Port of obsproject/obs-studio PR 13863 (obsproject/obs-studio#13862): clean the selected folder path with QDir::cleanPath() before taking the profile directory name from it, so "/x/MyProfile/" gives "MyProfile" instead of an empty name that put the profile's files into the profiles folder itself. A path that still has no folder name after cleaning ("/", "C:/", or one ending in "..") is now refused with a log warning, and the import helper also refuses an empty directory name, so nothing is ever copied into the profiles folder itself. Upstream's change still imports into the profiles folder for "/". test_profile_import passes 7/7. Fixes obs-rust#2295 Co-authored-by: Ushkalovk <[email protected]>
rdoupe
force-pushed
the
fix/profile-import-slash
branch
from
October 25, 2026 02:13
6d5f4cd to
fdc3a00
Compare
rdoupe
marked this pull request as ready for review
October 25, 2026 02:14
zackees
reviewed
Oct 25, 2026
zackees
left a comment
Member
There was a problem hiding this comment.
Coordinator review: looks good. RED test (test_profile_import.cpp, cmocka) then GREEN; import logic moved to a header-only helper the test drives; cleanPath drops the trailing slash; '.'/'..' rejected; ledger line present. No C tests or public headers touched. Verdict: approve once CI is green.
zackees
enabled auto-merge
October 25, 2026 02:29
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 25, 2026
This was referenced Oct 25, 2026
chriscoveries
pushed a commit
to chriscoveries/obsrust-fork
that referenced
this pull request
Oct 25, 2026
…bs-rust#2355) canonical_remux_queue_runs_unchanged pinned the Qt suite at one test. obs-rust#2312 added test_profile_import to the suite, so the test fails on macOS and Windows (left: 2, right: 1). Master's own lanes don't run it there; it surfaced when obs-rust#2310, which touches rust/obs-build, was ejected from the merge queue three times (run 40171262955). Count the graph's Qt suite tests instead, so every one still has to build and run and a new Qt test doesn't break the count.
4 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2295
What and why
Profile > Import from a folder path that ends in a separator (the macOS folder dialog returns one, and a path typed into Qt's dialog can end in one too) copied the profile's files into the profiles folder itself, because
std::filesystem::path("/x/MyProfile/").filename()is empty. No profile showed up, and a second import failed with "File exists". Upstream: obsproject/obs-studio#13862.This ports the upstream fix (obsproject/obs-studio PR 13863, credited with a
Co-authored-bytrailer): clean the selected path withQDir::cleanPath()before taking the folder name from it. Upstream's change still imports into the profiles folder itself when the path has no folder name, such as/. Here a path like that (/,C:/, or one ending in..) is refused with a log warning, and the import helper also refuses an empty directory name.The RED commit moves the folder name and the copy out of
on_actionImportProfile_triggered()intofrontend/utility/profile-import.hppwithout changing behaviour, so they can be tested with QtCore only.Checked for the same bug elsewhere: Profile > Export joins the chosen folder with
operator/, which handles a trailing separator. Scene collection import (OBSImporter) works with files, not folders. The frontend has no other "import from folder" path.RED → GREEN
d2f17ef4c(test_profile_import). On the C lane and the hybrid lane, 6 of 7 cases fail. The folder name is wrong for/x/MyProfile/,/x/My Profile//,C:/x/P/and/x/... An import from.../MyProfile/into a temporary profiles folder puts the files inprofiles/instead ofprofiles/MyProfile/. An import with no folder name is not refused and copies intoprofiles/./x/MyProfilepasses.fdc3a0088.test_profile_importpasses 7/7 on the C lane (OBS_LIBOBS_BACKEND=C) and the hybrid lane (withlibobs-c-reference), andtest_profile_removeandtest_profile_activatestill pass. Both lanes build the full app.Checklist
master(or the description starts with a Stacked: note)docs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): built with scripting ON (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC