-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Completion model/view revamping #74
Comments
AFAIK joining several models in one meta model is extremely hard, possibly impossible... Using several Views and layout them sounds ugly to me - especially filtering could get a performance/maintainance issue. What about this approach:
Instead of the last point we could create separate models for each task - as the logic is factored out into sources this could be a single class that e.g. accepts a list of source names it should complete. Don't know how sane this is... At least it would seperate tasks but still create one single model+view (in contrast to multiple models merged into one model or show multiple views). |
Some links I found about joining models:
So it certainly seems possible. I don't really understand your proposotion - is it to have all completions in a single model and then filtering the view accordingly? After all, the point should be to be able to write new completion models more easily, ideally as a table model. Why do you think it'd be a performance/maintainance issue to filter the sub models? You just apply the |
I've now opened a question on StackOverflow to see if there's some easier way I haven't found yet. |
Here's the battle plan:
Here are the advantages I anticipate:
* I guess instead of functions they could be subclasses of |
Well, I can say that looked a lot shorter in Here's an abridged version:
|
Just realized that in order to handle setting option/value completion, we may need to pass along the current positional args to construct the completer. This could later be extended to pass along kwargs as well, which would allow |
That sounds good! Some comments:
|
As for the last point, we'd like to cache content and e.g. hints for column widths (see #1584), which will probably be hard to combine in a generic code. As for ditching |
For the lambda, I meant something like
as opposed to:
Unfortunately, I think
You mean performance-wise?
|
Aw crap, I forgot about column widths. |
Thanks for the clarification! A Using functions seems more KISS to me, you could even simply pass a function object to def quickmarks(...):
cat = CompletionCategory(deletion_func=delete_quickmark)
# ...
return cat
Aw, damn. That'd have been quite handy to have though... I wonder if we're reaching the point where it'd be easier to do our own argument parsing compared to using
I mainly meant style-wise - I agree caching isn't needed for most completions, but where it is, it might still make more sense to have it generalized and implemented once. |
Great, I liked that one better too, and its even simpler passing
Yeah, I started to wonder that while trying to implement
Hmm ... maybe. I can play around with both and see which feels better. I also realized that until we have dynamically-determined column widths from #1584, I probably can't do completions by category, as I need to manually specify |
Some more quick thoughts:
def setting_value(args):
return ('Current/Default', _setting_values_special(args),
'Completions', _setting_values_available(args)) which is nice as well. |
Me as well. That's what I meant by organizing it by category rather than by model. However, I don't think I can do this as long as |
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
First step of Completion Model/View revamping (qutebrowser#74). Rewrite the completion models as functions that each return an instance of a CompletionModel class. Caching is removed from all models except the UrlModel. Models other than the UrlModel can be generated very quickly so caching just adds needless complexity and can lead to incorrect results if one forgets to wire up a signal.
The new completion API no longer needs either of these. Instead of referencing an enum member, cmdutils.argument.completion now points to a function that returnsthe desired completion model. This vastly simplifies the addition of new completion types. Previously it was necessary to define the new model as well as editing usertypes and completion.models.instances. Now it is only necessary to define a single function under completion.models. This is the next step of Completion Model/View Revamping (qutebrowser#74).
Done with #2295. |
The current way the completion model and view is handled might be improved. Some ideas:
QAbstractProxyModel
which converts it into a tree modelQHBoxLayout
of list viewsThe text was updated successfully, but these errors were encountered: