<div dir="ltr"><div><br><br>Hello ,<br><br></div>I am done implementing the backend part .I have tried it and it's working fine .The only thing left is to decide where to put the search icon  and connecting it to  Textfield. <br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 5, 2016 at 3:24 AM, Bruno Coudoin <span dir="ltr"><<a href="mailto:bruno.coudoin@gcompris.net" target="_blank">bruno.coudoin@gcompris.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><span class="">
    <br>
    <br>
    <div>Le 04/01/2016 20:22, RISHABH GUPTA a
      écrit :<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Mon, Jan 4, 2016 at 12:35 AM,
            Bruno Coudoin <span dir="ltr"><<a href="mailto:bruno.coudoin@gcompris.net" target="_blank">bruno.coudoin@gcompris.net</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF"><span> <br>
                  <br>
                  <div>Le 03/01/2016 19:34, Aruna S a écrit :<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>Hey Rishabh!<br>
                        <br>
                      </div>
                      The search feature is much needed, so it'll be
                      great to have you work on this.<br>
                      <div>
                        <div>
                          <div>
                            <div class="gmail_extra">
                              <div class="gmail_quote">
                                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                  <div bgcolor="#FFFFFF" text="#000000">
                                    <blockquote type="cite">
                                      <div>
                                        <div>
                                          <div dir="ltr">
                                            <div>The only thing I have
                                              figured out is to use a
                                              hash table since it
                                              provides a faster lookup
                                              .I would  need little
                                              guidance and input from
                                              all of you to complete
                                              it.  </div>
                                          </div>
                                        </div>
                                      </div>
                                    </blockquote>
                                  </div>
                                </blockquote>
                                <div>A simple and quick way to implement
                                  a hash lookup in Javascript would be
                                  to create a searchable JSON object
                                  where the keys and values in the JSON
                                  object pertain to each activity. <br>
                                  The key would have to be unique for
                                  each activity(the name of the
                                  activity? Or a hash of the activity
                                  code or some other way), and the value
                                  of the key has to be a way to bring
                                  the activity to the forefront. <br>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </span> Hi, I am not convince we need to maintain a hash
                for faster lookup. I made the following test using grep:<br>
                <br>
                time grep -i mouse src/activities/*/ActivityInfo.qml<br>
                0,00s user 0,00s system 0% cpu 0,003 total<br>
                <br>
                So it take 3ms to get the list of all activities
                containing the word mouse in upper or lower case. No big
                deal. We may have a worse result in javascript but doing
                so in C++ would get us to close results.<span><br>
                  <br>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>
                        <div>
                          <div>
                            <div class="gmail_extra">
                              <div class="gmail_quote">
                                <div><br>
                                  Not sure if this solution is the best
                                  one, but a brute force way to present
                                  games that match a search query might
                                  be to create an invisible section(like
                                  the favourites, maths, strategy
                                  section etc) to present the matches
                                  from a search query, and add this
                                  section name to the ActivityInfo.qml.
                                  The section can be made visible/active
                                  only when a "Search" is in progress
                                  and is presenting results.<br>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                  <br>
                </span> I like the concept. Just going further on it I
                propose something along these lines:<br>
                <br>
                - there is a search icon in the section list (top rigth
                in horizontal mode).<br>
                - when clicked the section icons are replaced by a
                search entry box (and a virtual keyboard appears if
                needed)<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div><br>
              <br>
              In my opinion instead of having the search icon on the top
              right we can place it on the bottom next to configuration
              icon .  <br>
            </div>
            <div>- On clicking it the icon would expand into a search
              entry box .<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></span>
    This is a good idea but I prefer to have it in the section bar. The
    section bar is the logical place to filter activities, it is done
    for this.<span class=""><br></span></div></blockquote><div><br></div><div><br>sections at present  already cover the entire space at the top ,how do we place the search icon there . Sorry if i misunderstood something.<br><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><span class="">
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div><br>
              <br>
            </div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF"> - the search is
                done incrementally, uppon each letter entry a 'grep' is
                performed and the list of matching activity is shown<br>
              </div>
            </blockquote>
            <div><br>
            </div>
            <div><br>
              if for every letter a matching activity is to be shown
              then we cannot use hash table.<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></span>
    Another reason not to have one.<span class=""><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>-We can store activities by their name in a QList ,this
              would allow to display all the activities matching every
              letter the user types.<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></span>
    This is what we do at the moment in ActivityInfoTree.cpp to manage
    tags. The new filtering is just an added feature to the current
    system, nothing more. <br><span class="">
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div><br>
               </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF"> - when we get back
                from an activity we are again in thesame search if we
                started the activity from here<br>
                - a 'stop search' icon allows to get back to the normal
                mode<span><font color="#888888"><br>
                  </font></span></div>
              <div><span></span><br>
                 </div>
            </blockquote>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF"><span><font color="#888888"> Bruno.<br>
                  </font></span></div>
              <br>
            </blockquote>
            <div><br>
              Also how should  I debug qml files  ?like setting
              breakpoints ,stepping  etc .? is there any way to do that?<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></span>
    I used it once when I started Qt Quick and saw the debugger working
    in javascript files but last time I tried it was not working. I just
    do it old school by putting debug traces with console.log().<span class=""><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div><br>
            </div>
            <div>thank you all for your inputs  :)<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></span>
    Your welcome.<span class="HOEnZb"><font color="#888888"><br>
    <br>
    Bruno.<br>
  </font></span></div>

<br>_______________________________________________<br>
GCompris-devel mailing list<br>
<a href="mailto:GCompris-devel@kde.org">GCompris-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/gcompris-devel" rel="noreferrer" target="_blank">https://mail.kde.org/mailman/listinfo/gcompris-devel</a><br>
<br></blockquote></div><br></div></div>