Review Request 115485: Porting KTranscript from KJS to QtScript

Chusslove Illich caslav.ilic at gmx.net
Sat Feb 22 13:35:17 UTC 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/115485/#review50522
-----------------------------------------------------------


I tried to run a standalone non-GUI program using ki18n:

  #include <QDebug>
  #include <KLocalizedString>

  int main (int argc, char *argv[])
  {
      setlocale (LC_ALL, "");
      KLocalizedString::setApplicationDomain("test-ki18n-01");
      qDebug() << i18n("Delete %1?", i18n("file"));
      return 0;
  }

and got abort with this message:

  QScriptEngine: Must construct a Q(Core)Application before a QScriptEngine

It does work when I add only

  #include <QCoreApplication>
  ...
  QCoreApplication a(argc, argv);

What is the reason that this is necessary? If one does want to use ki18n in
non-Qt-UI program, would it be inappropriate (in whatever way) to
nevertheless require creation of QCoreApplication?


- Chusslove Illich


On Feb. 21, 2014, 5:30 p.m., Kevin Krammer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/115485/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2014, 5:30 p.m.)
> 
> 
> Review request for KDE Frameworks and Chusslove Illich.
> 
> 
> Repository: ki18n
> 
> 
> Description
> -------
> 
> Attempt at replacing the KJS dependency with a QtScript, i.e. making ki18n a tier1 framework.
> Needs more testing and likely fixing
> 
> 
> Diffs
> -----
> 
>   CMakeLists.txt 3e099d5 
>   src/CMakeLists.txt 9e3ce9f 
>   src/ktranscript.cpp c922e91 
> 
> Diff: https://git.reviewboard.kde.org/r/115485/diff/
> 
> 
> Testing
> -------
> 
> Unittest runs, but the test script is very minimal and would need to be extendedb by someone who understands the scripting requirements.
> There is also a weird crash at test shutdown, in QThreadStorage. As far as I can tell I did not change anything related to threads though.
> 
> 
> Thanks,
> 
> Kevin Krammer
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140222/bde4a879/attachment.html>


More information about the Kde-frameworks-devel mailing list