D26181: [KCM/Component] Clean deprecated code, modernize code

Kevin Ottens noreply at phabricator.kde.org
Mon Dec 23 13:11:52 GMT 2019


ervin requested changes to this revision.
ervin added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> componentchooser.cpp:83
>  
> -	for (KService::List::const_iterator tit = offers.begin(); tit != offers.end(); ++tit) {
> -		ComponentSelector->addItem((*tit)->name());
> -		m_lookupDict.insert((*tit)->name(), (*tit)->desktopEntryName());
> -		m_revLookupDict.insert((*tit)->desktopEntryName(), (*tit)->name());
> +    for (const auto &service: offers) {
> +        ComponentSelector->addItem(service->name());

Indentation looks wrong

> componentchooser.cpp:125
>  
> -	const QStringList services=KGlobal::dirs()->findAllResources( "data",QStringLiteral("kcm_componentchooser/*.desktop"),
> -															KStandardDirs::NoDuplicates);
> -	for (QStringList::const_iterator it=services.constBegin(); it!=services.constEnd(); ++it)
> +    const QStringList directories = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("kcm_componentchooser"), QStandardPaths::LocateDirectory);
> +    QStringList services;

Indentation looks wrong

> componentchooser.cpp:127
> +    QStringList services;
> +    for(const QString& directory : directories) {
> +        const QDir dir(directory);

Space before & not after

> componentchooser.cpp:129
> +        const QDir dir(directory);
> +        for(const QString& f: dir.entryList(QStringList("*.desktop"))) {
> +            services += dir.absoluteFilePath(f);

Space before & not after

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D26181

To: meven, ervin, #plasma
Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191223/a79656c5/attachment-0001.html>


More information about the Plasma-devel mailing list