D23112: Add a event Spy for GtkFileChooser recent files

Ivan Čukić noreply at phabricator.kde.org
Tue Aug 13 17:59:26 BST 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190813/188d490f/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list