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
Display the number keys inside each namespace, recursively. (issue #3470) #3481
Conversation
Hello @dmagliola Code looks good but need some improvements:
It will remove usage of RTTI and improve performance. Please fix mentioned issues and I will merge this pull request. Thank you! |
Thank you for reviewing this so quickly! It does work, however, if you define KeyItem::childCount, as such:
Although that's a bit weird... Of course that'd have a big comment explaining what you're doing, but it feels hacky. Up to you, I have very little experience with Qt or the codebase, so you tell me how you'd prefer this. |
@dmagliola Yes, I have missed this. But it's easy to solve this problem without any workarounds, just add
In most cases it's better to extend interface instead of adding hardcode for concreate types. |
…ildCount to accept a "recursive" parameter for all TreeItems.
I like that much more now! :-) |
Display the number keys inside each namespace, recursively. (issue #3470)
Merged! Thanks! Keep doing great improvements in RDM ;) |
Thank you! My ability to do C++ and Qt is very, very limited, so not sure how much i'll be able to contribute, but I use RDM all day, and constantly come up with little tweaks and improbements, so now that I can actually compile, i'll try to implement them! |
@dmagliola Large part of RDM is coded in JS/QML which is very easy to understand and modify (example is Value editor) |
For each namespace, this shows how many keys are inside it, which I find very useful to have a very rough idea of where my Redis memory usage is going, and also a rough idea of what my app is doing with Redis (how many objects of each type are getting cached, things like that).
The implementation is a bit hacky, because
NamespaceItem::getDisplayName
is being used both for actual display, and as the key in hash tables that list child namespaces. To get around this, I added agetOriginalDisplayName
method to use for the hash key. I admit the name could've probably been a bit better, but I don't know the codebase well enough to pick a better one (i'd be happy to rename to whatever you'd like to see).This also required a couple of casts, hope those are OK.
If you think this is a good idea to incorporate, but don't like how it's implemented, i'll be happy to improve it / change it. I'd love to see this on the official app.
Thanks!
Daniel