From c6840d23565824b99429afaa019cb6cbdb0409d1 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Sun, 12 Mar 2023 18:41:44 +0000 Subject: [PATCH] Improve copying track path --- app/playlists.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/playlists.py b/app/playlists.py index dc935c6..5e6af7e 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -1024,11 +1024,18 @@ class PlaylistTab(QTableWidget): if not track_path: return - pathq = track_path.replace("'", "\\'") - pathqs = pathq.replace(" ", "\\ ") + replacements = [ + ("'", "\\'"), + (" ", "\\ "), + ("(", "\\("), + (")", "\\)"), + ] + for old, new in replacements: + track_path = track_path.replace(old, new) + cb = QApplication.clipboard() cb.clear(mode=cb.Clipboard) - cb.setText(pathqs, mode=cb.Clipboard) + cb.setText(track_path, mode=cb.Clipboard) def _delete_rows(self) -> None: """