D14710: Inject default environment group variables into debug process environment.

Sven Brauch noreply at phabricator.kde.org
Wed Aug 15 21:43:21 BST 2018


brauch added a comment.


  Thanks for the patch!
  
  Sorry, it has been years since I looked at the debugger code. Why do you need to set the environment twice, once on the job and once on the process? Otherwise, this looks fine.

INLINE COMMENTS

> Kebianizao wrote in debugsession.cpp:98
> If I'm right, I'm modifying env variable later:
> env.insert(key, value);
> Therefore I'm not allowed to mark it as const, right?

No, you are right, it's fine like you have it

> Kebianizao wrote in pdblauncher.cpp:134
> I well may wrong, but what I can tell is that:
> environment is a QMap<QString,QString>
> when I do:
> for(const auto &i: environment), i type is QString so I should have to write this chunk as:
> 
>   for(const auto &i : environment)
>   {
>       job->m_environment << environment[i];
>   }
> 
> I don't know if this is what you were thinking.
> Now I got to this, maybe this is a good idea. I can submit the patch with this change if you like.
> Reference: https://stackoverflow.com/questions/8517853/iterating-over-a-qmap-with-for#8529237

Either way is fine imo, I would maybe just initialize the iterator inline with auto:

  for (auto i = environment.begin() ...)

It really doesn't matter much though.

REPOSITORY
  R53 KDevelop: Python Support

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

To: Kebianizao, #kdevelop
Cc: brauch, vkorneev, apol, kdevelop-devel, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180815/eff0b22e/attachment-0001.html>


More information about the KDevelop-devel mailing list