<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/124703/">https://git.reviewboard.kde.org/r/124703/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On August 12th, 2015, 1:13 p.m. UTC, <b>Dennis Nienhüser</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  


<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://git.reviewboard.kde.org/r/124703/diff/1/?file=393526#file393526line19" style="color: black; font-weight: bold; text-decoration: underline;">src/apps/marble-maps/package/src/org/kde/marble/maps/TextToSpeechClient.java</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">19</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">m_instance</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Is this supposed to be a singleton? Then it's not implemented safely, m_instance would be overwritten when the next TextToSpeechClient() is created.
Here's some discussion how to create a singleton in Java: http://stackoverflow.com/questions/70689/what-is-an-efficient-way-to-implement-a-singleton-pattern-in-java</p></pre>
 </blockquote>



 <p>On August 13th, 2015, 5:36 p.m. UTC, <b>Dennis Nienhüser</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">If the enum variant mentioned in the link is problematic to implement, number 2) in http://codebalance.blogspot.de/2010/08/singleton-pattern-and-beyond.html seems a good alternative.</p></pre>
 </blockquote>





 <p>On August 13th, 2015, 8:49 p.m. UTC, <b>Gábor Péterffy</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Seems, we can not handle it as a singleton, because android.app.Instrumentation have to be able to instantiate it.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Here is the crash log:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">FATAL EXCEPTION: main
E/AndroidRuntime( 9294): Process: org.kde.marble.maps, PID: 9294
E/AndroidRuntime( 9294): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.kde.marble.maps/org.kde.marble.maps.TextToSpeechClient}: java.lang.IllegalAccessException: private org.kde.marble.maps.TextToSpeechClient() is not accessible from class android.app.Instrumentation
E/AndroidRuntime( 9294):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2240)
E/AndroidRuntime( 9294):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
E/AndroidRuntime( 9294):        at android.app.ActivityThread.access$900(ActivityThread.java:147)
E/AndroidRuntime( 9294):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296)
E/AndroidRuntime( 9294):        at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 9294):        at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 9294):        at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime( 9294):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 9294):        at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 9294):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
E/AndroidRuntime( 9294):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
E/AndroidRuntime( 9294): Caused by: java.lang.IllegalAccessException: private org.kde.marble.maps.TextToSpeechClient() is not accessible from class android.app.Instrumentation
E/AndroidRuntime( 9294):        at java.lang.Class.newInstance(Class.java:1569)
E/AndroidRuntime( 9294):        at android.app.Instrumentation.newActivity(Instrumentation.java:1065)
E/AndroidRuntime( 9294):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2230)
E/AndroidRuntime( 9294):        ... 10 more
W/ActivityManager(  779):   Force finishing activity org.kde.marble.maps/.TextToSpeechClient</p></pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I wonder if it is possible to implement it using some Java class that is independent of the activity and provided as a supplementary java file with the apk. So the original QtActivity would still be used. This doesn't seem to need immediate attention right now, so let's keep it in mind and push the code as-is.</p></pre>
<br />




<p>- Dennis</p>


<br />
<p>On August 15th, 2015, 3:09 p.m. UTC, Gábor Péterffy wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Marble.</div>
<div>By Gábor Péterffy.</div>


<p style="color: grey;"><i>Updated Aug. 15, 2015, 3:09 p.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
marble
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Text to speech can be used from qml like this:
textToSpeechClient.readText("Have a pleasant journey!");</p></pre>
  </td>
 </tr>
</table>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/apps/marble-maps/CMakeLists.txt <span style="color: grey">(15d01a5)</span></li>

 <li>src/apps/marble-maps/TextToSpeechClient.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/apps/marble-maps/TextToSpeechClient.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/apps/marble-maps/main.cpp <span style="color: grey">(e1a74d6)</span></li>

 <li>src/apps/marble-maps/package/AndroidManifest.xml <span style="color: grey">(dfb3061)</span></li>

 <li>src/apps/marble-maps/package/src/org/kde/marble/maps/TextToSpeechClient.java <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/124703/diff/" style="margin-left: 3em;">View Diff</a></p>






  </td>
 </tr>
</table>







  </div>
 </body>
</html>