Change listing key from stringlist to bool
Closed, WontfixPublic

Description

Currently the listing key of kio protocols has type stringlist, but it's currently used only to figure out if the slave supports listing (i.e. m_supportsListing = (m_listing.count() > 0);).

We could make the key just a boolean and simplify the protocol definitions.

dfaure added a subscriber: dfaure.Oct 8 2020, 6:47 PM

It's also used to define extra columns.

trash.json:

"listing": [
     "Name",
     "Type",
     "Size",
     "Extra1",
     "Extra2",
     "Date",
     "Access",
     "Owner",
     "Group",
     "Link"
 ],

This is accessible via QStringList KProtocolManager::listing(const QUrl &url) (which ends up using that m_listing variable you mention)

I'm not sure if anyone is still using KProtocolManager::listing(). This used to be the case....

Yeah I could not find any usage of KProtocolManager::listing(), not even in KIO...

What was used for?

As I said, it was used to define extra columns.
It appears that it was used in konqueror before konqueror's file management views were replaced with Dolphin's.
See http://www.davidfaure.fr/2020/konq_listviewwidget.cc

elvisangelaccio closed this task as Wontfix.Oct 11 2020, 4:28 PM
elvisangelaccio claimed this task.

I see, so I guess it doesn't hurt to keep KProtocolManager::listing() around and the gain wouldn't be worth the effort.