Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: VasigaranAndAngel <[email protected]>
  • Loading branch information
python357-1 and VasigaranAndAngel authored Jan 13, 2025
1 parent d49d95e commit 2cb920a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tagstudio/src/core/settings/libsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def open(path_value: Path | str) -> "LibSettings":
return LibSettings(**settings_data)

# either settings file did not exist or was empty - either way, use default settings
settings = LibSettings(**dict(filename=str(path)))
settings = LibSettings(filename=str(path))
return settings

def save(self):
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/core/settings/tssettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def read_settings(path: Path | str) -> "TSSettings":
settings = TSSettings(**settings_data)
return settings

return TSSettings(**dict(filename=str(path)))
return TSSettings(filename=str(path))

def save(self, path: Path | str | None = None) -> None:
path_value: Path = Path(path) if isinstance(path, str) else Path(self.filename)
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/core/tscacheddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def open(path_value: Path | str | None = None) -> "TSCachedData":
logger.info("opening cache file at ", cache_location=path)
return TSCachedData(**cache_data)

return TSCachedData(**dict(path=str(default_cache_location)))
return TSCachedData(path=str(default_cache_location))

def save(self):
with open(self.path, "w") as f:
Expand Down
2 changes: 1 addition & 1 deletion tagstudio/src/qt/modals/file_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self, library: "Library"):
lambda text: self.mode_combobox.setItemText(1, text), "ignore_list.mode.exclude"
)

is_exclude_list = int(bool(self.lib.settings.is_exclude_list))
is_exclude_list = int(self.lib.settings.is_exclude_list)

self.mode_combobox.setCurrentIndex(is_exclude_list)
self.mode_combobox.currentIndexChanged.connect(lambda i: self.update_list_mode(i))
Expand Down

0 comments on commit 2cb920a

Please sign in to comment.