Skip to content

Commit

Permalink
Trim whitespace from input paths in config setup
Browse files Browse the repository at this point in the history
Removed leading and trailing whitespace from user input paths to prevent potential errors caused by unintended spaces.
  • Loading branch information
cbusillo committed Jun 30, 2024
1 parent fd51333 commit 3c17c47
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bd_to_avp/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ def load_config_and_update_ui(self) -> None:
def toggle_processing(self) -> None:
if self.process_button.text() == self.START_PROCESSING_TEXT:
self.processing_output_textedit.clear()
self.source_folder_widget.set_text(self.source_folder_widget.text().strip())
self.source_file_widget.set_text(self.source_file_widget.text().strip())
self.output_folder_widget.set_text(self.output_folder_widget.text().strip())
source_folder_set = bool(self.source_folder_widget.text())
source_file_set = bool(self.source_file_widget.text())
if self.read_from_disc_checkbox.isChecked():
Expand Down Expand Up @@ -459,13 +462,11 @@ def save_config(self) -> None:
config.source_path = None
else:
config.source_folder_path = (
Path(self.source_folder_widget.text().strip()) if self.source_folder_widget.text() else None
)
config.source_path = (
Path(self.source_file_widget.text().strip()) if self.source_file_widget.text() else None
Path(self.source_folder_widget.text()) if self.source_folder_widget.text() else None
)
config.source_path = Path(self.source_file_widget.text()) if self.source_file_widget.text() else None

config.output_root_path = Path(self.output_folder_widget.text().strip())
config.output_root_path = Path(self.output_folder_widget.text())
config.audio_bitrate = self.audio_bitrate_spinbox.value()
config.mv_hevc_quality = self.mv_hevc_quality_spinbox.value()
config.fov = self.fov_spinbox.value()
Expand Down

0 comments on commit 3c17c47

Please sign in to comment.