Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove TODO FIXME and XXX comments #8057

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,5 @@ def isAudio(self, s):
return s[s.rfind('.') + 1:] in self.audio_extensions


# XXX filter should be stateless
# filter should be stateless
default_xxx_filter = XXXFilter()
4 changes: 1 addition & 3 deletions src/tribler/core/components/database/database_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DatabaseComponent(Component):
tribler_should_stop_on_component_error = True

db: TriblerDatabase = None
mds: MetadataStore = None # TODO: legacy, should be merged into ``db``
mds: MetadataStore = None

async def run(self):
await super().run()
Expand All @@ -22,8 +22,6 @@ async def run(self):

self.db = TriblerDatabase(str(db_path))

# TODO: merge the code below into the TriblerDatabase

channels_dir = config.chant.get_path_as_absolute('channels_dir', config.state_dir)
chant_testnet = config.general.testnet or config.chant.testnet

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def tdef_to_metadata_dict(tdef, category_filter: Category = None) -> Dict:
"""
Helper function to create a TorrentMetadata-compatible dict from TorrentDef
"""
# We only want to determine the type of the data. XXX filtering is done by the receiving side
category_filter = category_filter or default_category_filter
try:
tags = category_filter.calculateCategory(tdef.metainfo, tdef.get_name_as_unicode())
Expand Down
4 changes: 1 addition & 3 deletions src/tribler/core/components/database/db/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@

from ipv8.keyvault.crypto import default_eccrypto
from ipv8.messaging.lazy_payload import VariablePayload, vp_compile
from ipv8.messaging.serialization import VarLenUtf8, default_serializer
from ipv8.messaging.serialization import default_serializer

from tribler.core.utilities.unicode import hexlify

default_serializer.add_packer('varlenIutf8', VarLenUtf8('>I')) # TODO: move to IPv8

EPOCH = datetime(1970, 1, 1)

SIGNATURE_SIZE = 64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,5 @@ async def completions(self, request):
return RESTResponse({"error": "query parameter missing"}, status=HTTP_BAD_REQUEST)

keywords = args['q'].strip().lower()
# TODO: add XXX filtering for completion terms
results = self.mds.get_auto_complete_terms(keywords, max_terms=5)
return RESTResponse({"completions": results})
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def __init__(self,

self.socks_listen_ports = socks_listen_ports

# TODO: Remove the dependency on notifier and refactor it to instead use callbacks injection
self.notifier = notifier
self.peer_mid = peer_mid
self.config = config or LibtorrentSettings()
Expand Down Expand Up @@ -864,7 +863,6 @@ async def sesscb_states_callback(self, states_list):
"""
This method is periodically (every second) called with a list of the download states of the active downloads.
"""
# TODO: refactor this method. It is too long and tightly coupled with higher-level modules.
self.state_cb_count += 1

for ds in states_list:
Expand Down
2 changes: 0 additions & 2 deletions src/tribler/gui/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,6 @@ def html_label(text, background="#e4e4e4", color="#222222", bold=True):

def votes_count(votes=0.0):
votes = float(votes)
# FIXME: this is a temp fix to cap the normalized value to 1.
# The votes should already be normalized before formatting it.
votes = max(0.0, min(votes, 1.0))
# We add sqrt to flatten the votes curve a bit
votes = math.sqrt(votes)
Expand Down
4 changes: 0 additions & 4 deletions src/tribler/gui/widgets/settingspage.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,6 @@ def save_settings(self, checked):
# network statistics
settings_data['ipv8']['statistics'] = self.window().checkbox_enable_network_statistics.isChecked()

# TODO: do it in RESTful style, on the REST return JSON instead
# In case the default save dir has changed, add it to the top of the list of last download locations.
# Otherwise, the user could absentmindedly click through the download dialog and start downloading into
# the last used download dir, and not into the newly designated default download dir.
if self.settings['download_defaults']['saveas'] != settings_data['download_defaults']['saveas']:
self.window().update_recent_download_locations(settings_data['download_defaults']['saveas'])
self.settings = settings_data
Expand Down
2 changes: 0 additions & 2 deletions src/tribler/gui/widgets/tablecontentdelegate.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def __init__(self, parent=None):
self.hovering_over_tag_edit_button: bool = False
self.hovering_over_download_popular_torrent_button: int = -1

# TODO: restore this behavior, so there is really some tolerance zone!
# We have to control if mouse is in the buttons box to add some tolerance for vertical mouse
# misplacement around the buttons. The button box effectively overlaps upper and lower rows.
# row 0
Expand Down Expand Up @@ -566,7 +565,6 @@ class TriblerContentDelegate(
SnippetCreatedColumnMixin,
):
def __init__(self, table_view, parent=None):
# TODO: refactor this not to rely on inheritance order, but instead use interface method pattern
TriblerButtonsDelegate.__init__(self, parent)

self.download_button = DownloadIconButton()
Expand Down
Loading