D18907: Handle the case if createSpeller is passed an unavailable language

Ahmad Samir noreply at phabricator.kde.org
Tue Feb 12 20:58:14 GMT 2019


ahmadsamir added a comment.


  In D18907#410973 <https://phabricator.kde.org/D18907#410973>, @cullmann wrote:
  
  > I think the const at the end for the signal is not wanted, otherwise, this seems to make sense for me.
  
  
  The **this** pointer of Loader::createSpeller is const, so the signal has to be const.
  
    In member function ‘Sonnet::SpellerPlugin* Sonnet::Loader::createSpeller(const QString&, const QString&) const’:
    /home/ahmad/rpmbuild/kf5-sonnet/git/src/core/loader.cpp:98:43: error: passing ‘const Sonnet::Loader’ as ‘this’ argument discards qualifiers [-fpermissive]
             emit loadingDictionaryFailed(plang);
  
  
  
  > I would appreciate a comment what the "lang" param is and that "lang" is "language", we don't need to shorten that in the API.
  
  Yes, of course.
  
  > Code-wise:
  > 
  > Could you not just use "find" on the d->languageClients and check the iterator? That way we avoid searching twice (in different data structures).
  
  Makes, much, more sense. Will do.

REPOSITORY
  R246 Sonnet

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

To: ahmadsamir, sandsmark, cullmann, dhaumann
Cc: dhaumann, cullmann, loh.tar, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190212/51dbba14/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list