Improve copying track path

This commit is contained in:
Keith Edmunds 2023-03-12 18:41:44 +00:00
parent 453e42172b
commit c6840d2356

View File

@ -1024,11 +1024,18 @@ class PlaylistTab(QTableWidget):
if not track_path: if not track_path:
return return
pathq = track_path.replace("'", "\\'") replacements = [
pathqs = pathq.replace(" ", "\\ ") ("'", "\\'"),
(" ", "\\ "),
("(", "\\("),
(")", "\\)"),
]
for old, new in replacements:
track_path = track_path.replace(old, new)
cb = QApplication.clipboard() cb = QApplication.clipboard()
cb.clear(mode=cb.Clipboard) cb.clear(mode=cb.Clipboard)
cb.setText(pathqs, mode=cb.Clipboard) cb.setText(track_path, mode=cb.Clipboard)
def _delete_rows(self) -> None: def _delete_rows(self) -> None:
""" """