ivan requested changes to this revision.
ivan added a comment.
This revision now requires changes to proceed.


  Thanks for geting involved this much!

INLINE COMMENTS

> GtkEventSpy.cpp:129
> +        // remove "'" caracters wrapping the command
> +        exec = exec.mid(1, exec.size() -2 );
> +

It might be dangerous to assume that the command is wrapped with single quotes

> GtkEventSpy.cpp:133
> +        // See 
> https://techbase.kde.org/Development/Tutorials/Services/Traders#The_KTrader_Query_Language
> +        QString query = QString("exist Exec and ((Exec ~~ '%1') or (exist 
> GenericName and '%1' ~~ GenericName) or (exist Name and '%1' ~~ 
> Name))").arg(exec);
> +        KService::List services = 
> KServiceTypeTrader::self()->query(QStringLiteral("Application"), query);

const auto query

> GtkEventSpy.cpp:134
> +        QString query = QString("exist Exec and ((Exec ~~ '%1') or (exist 
> GenericName and '%1' ~~ GenericName) or (exist Name and '%1' ~~ 
> Name))").arg(exec);
> +        KService::List services = 
> KServiceTypeTrader::self()->query(QStringLiteral("Application"), query);
> +

This should also be `const`, other local variables as well

> GtkEventSpy.cpp:143
> +            // remove space and any caracter after
> +            int spaceIdex = exec.indexOf(" ");
> +            if (spaceIdex != -1) {

Let's hope commands will never have spaces in them :)

REPOSITORY
  R161 KActivity Manager Service

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

To: meven, #frameworks, ivan
Cc: broulik, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, 
GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart

Reply via email to