summaryrefslogtreecommitdiff
path: root/qutebrowser/mainwindow/treetabwidget.py
diff options
context:
space:
mode:
authortoofar <toofar@spalge.com>2024-02-20 18:22:44 +1300
committertoofar <toofar@spalge.com>2024-02-20 18:43:26 +1300
commit3f03a23d899525f0f2ce6aa9457af96e9f4a8a29 (patch)
treea4bd84a3aa62ffa75dbe88be4851571ce28c0463 /qutebrowser/mainwindow/treetabwidget.py
parent7aac8d462cd0e854e5b33ab5df13707972c5aaf2 (diff)
downloadqutebrowser-tree/8078_treetabwidget_misc_cleanups.tar.gz
qutebrowser-tree/8078_treetabwidget_misc_cleanups.zip
Remove unneeded title format string values.tree/8078_treetabwidget_misc_cleanups
These two values are already defaulted in the parent class, so we don't need to set them in the child (and weren't doing it consistently anyway). I'm trying to identify places where we can't keep the tree tabs knowledge self contained and speculate how we could handle that for actually external code like extensions. So, thinking about how we would gracefully handle some non-core code adding tab title format placeholders, especially when that code could be disabled (eg, an extension): TabWidget will throw a KeyError if you have a format specifier which isn't filled in. So we would have to decide how to handle that. Log a warning and ignore it? Silently set it to `''`? Leave it as the literal `{thing}`, curly braces and all? Presumable that API would look something like `register_title_format_placeholder(placeholder: str, getter: Callable[AbstractTab])`. The `FormatString` config type used by `tabs.title.format` would have to change as well to pull allowed placeholders from some global registry instead of having the specified ahead of time in configdata.yml. Even then, if you disabled an extension so it didn't register its placeholder and you have the placeholder configured in your format string, what should happen? PS: jinja defaults to `''` for placeholders without values. ref: #30
Diffstat (limited to 'qutebrowser/mainwindow/treetabwidget.py')
-rw-r--r--qutebrowser/mainwindow/treetabwidget.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/qutebrowser/mainwindow/treetabwidget.py b/qutebrowser/mainwindow/treetabwidget.py
index fac96daee..8e8b6f29e 100644
--- a/qutebrowser/mainwindow/treetabwidget.py
+++ b/qutebrowser/mainwindow/treetabwidget.py
@@ -92,10 +92,6 @@ class TreeTabWidget(TabWidget):
f"difference={difference} tree={rendered_tree[1:]} tabs={tabs}"
)
- # Return dummy entries for now. Once we finish whatever operation is
- # causing the current irregularity we should get proper values.
- fields["tree"] = ""
- fields["collapsed"] = ""
return fields
def update_tree_tab_positions(self):