From bugtracker:
Based on it's content it makes more sense to have it after right after "General". Also if the tabs are supposed to be sorted by most
used, then it surely shouldn't be at the end.
After:
FEATURE: 411861
No Linters Available |
No Unit Test Coverage |
Buildable 16479 | |
Build 16497: arc lint + arc unit |
+1
Next time please also add VDG as a subsriber and reviewer if there is a UI related change :-)
+1 for the general idea. However this implementation only incidentally does what you want it to do. I apologize for steering you this way in the bug report, because it looks a bit more complicated than I thought, and we may have to puzzle through a more complex change.
So right now, the ordering goes like this:
So if we just move the auto-generated section to the second position, we can't actually guarantee that Details always comes first in that list.
What you could maybe do is add a new function KPropertiesDialog::insertPluginAt() that takes an int value index and inserts the plugin at that position in the index with d->m_pageList.insert(index, plugin);, then around line 628, check to see if the plugin we've just created is the Details plugin, and use the new function to specifically insert it at index 1 (which is position 2 since we start counting from zero).
Does that sound like a plan? I'll be happy to help you through it!
I didn't know what to do with this
...check to see if the plugin we've just created is the Details plugin,...
Also the "Generator" should probably go back where it was right?
More or less! A new things:
if (plugin == "details" /* this is pseudocode */) { q->insertPluginAt(plugin, 1); } else { q->insertPlugin(plugin); }
I'm actually not sure how to check for what the plugin is though. Maybe someone from Frameworks can help.
- Instead of unconditionally doing q->insertPluginAt(plugin, 1);, you'd want to do something more like this:
if (plugin == "details" /* this is pseudocode */) { q->insertPluginAt(plugin, 1); } else { q->insertPlugin(plugin); }I'm actually not sure how to check for what the plugin is though. Maybe someone from Frameworks can help.
This is mostly done but we still need to do this the check, but neither me nor @ngraham know how to do it.
An alternative would be to move the whole block inserting KPropertiesDialog/Plugin before "KChecksumsPlugin".
AFAIK there are only two KPropertiesDialog/Plugin, so this would move details and baloo both of before the rest, which is fine IMO.
You would not need an integer parameter to insertPluginAt anymore.
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
586 ↗ | (On Diff #65986) | Not needed, if you could remove |
Well no I missed @ngraham points that still stands.
And your current code result with the same effect anyway as long as we miss the condition "only if details plugin"
We don't have a "clean" way to do this.
One way to do the trick would be to look at the KService::Ptr &ptr icon() which will return "baloo" or the storageId() that should give "baloofilepropertiesplugin.desktop" for the baloo details plugin.
The storageId method should be preferred as less likely to change.
if (ptr->serviceId() == QStringLitteral("baloofilepropertiesplugin")) { q->insertPluginAt(plugin,1); } else { q->insertPlugin(plugin); }
Should be close enough to a working somewhat satisfying solution
I hope this helps.
This needs a rebase.
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
619 ↗ | (On Diff #65986) | space before the comma |
I don't really know how to do a rebase propertly so I hope I managed to do the same manually.
For future reference, you can rebase like so:
git fetch git rebase origin/master
Also please make sure your code at least compiles before submitting a patch or a change to an existing patch.
src/widgets/kpropertiesdialog.cpp | ||
---|---|---|
619 ↗ | (On Diff #65986) | /home/nate/kde/src/kio/src/widgets/kpropertiesdialog.cpp:645:18: error: ‘class KService’ has no member named ‘serviceId’ QStringLiteral |
src/widgets/kpropertiesdialog.h | ||
251 ↗ | (On Diff #77445) | missing the semicolon |
I don't have the time (nor skill really) to work on this. Feel free to take over if you want to.