This sounds also good to me :)<br><br><div class="gmail_quote">2011/6/3 srikanth tiyyagura <span dir="ltr">&lt;<a href="mailto:srikanth.tulasiram@gmail.com">srikanth.tulasiram@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">



        
        
        
        

<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:left">
<b>Hi krita developers,</b></blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
 This is the idea of tagging implementation in krita. Look at it once
and  correct me if I&#39;m wrong . 
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<b>What is Tagging ?</b></blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
Tagging means adding some tags to the resources in krita and call
them according to your use. In Tagging, there are three main
functions</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
1). Adding a Tag – here, we will create a tag and add it to the
resource.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
2). Deleting a Tag – we can delete a tag for resource.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
3). Search for resource – By using tags, we can search for
resources which contains particular resource.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<b>How we are implementing ?</b></blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<b>1. UI Description</b></blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
        In the UI, we thought of placing a text field and three radio
buttons for adding, deleting and searching. How UI works for three
functions is described below 
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;line-height:150%;text-align:justify">
<i><b>For Add functionality, </b></i>
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;line-height:150%;text-align:justify">
<br>
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;line-height:150%;text-align:justify">
        Whenever we click on the resource, the tags associated with them,
will display in the text field separated with comma &#39; , &#39; like this &quot;
round, dark, green, &quot;</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;line-height:150%;text-align:justify">
If we want to add a tag</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
1) we click on the add radio button.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
2).  Next, we select the resource for which we want to add the tag.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
3). Whenever we select the resource, the tags associate with the
resource will be displayed. At the end of the list, the cursor will
appear</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
4) Now we can enter the tag name and press enter to add.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<br>
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<i><b>For Delete  functionality,</b></i></blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<br>
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
If we want to delete  a tag</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
1) we click on the delete radio button.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
2).  Next, we select the resource for which we want to delete the
tag.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
3). Whenever we select the resource, the tags associate with the
resource will be displayed. 
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
4) we can delete the tag which we don&#39;t want and press enter.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<br>
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<i><b>For Search functionality,</b></i></blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<br>
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
1). we need to click on the search radio button</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
2). we enter the tag in the text field and press enter</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
3). we will provide the autocompletion option</blockquote>
<blockquote style="margin-left:0cm;margin-bottom:0cm;line-height:150%;text-align:left">
<br>
</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.05cm;margin-bottom:0cm;line-height:150%;text-align:justify">
<b>2. Code Description</b></blockquote>
<blockquote style="margin-left:0cm;margin-right:0.13cm;line-height:150%;text-align:justify">
  For implementing tagging, the first thing we need to do is to store
the tags with resources. For this, we are using QmultiHash object in
koResourceServer.h file.</blockquote>
<blockquote style="margin-left:0cm;margin-right:0.13cm;line-height:150%;text-align:justify">
QMultiHash &lt;Qstring,key &gt; - Qstring is ResourceFilename and key
is tag</blockquote>
<p style="margin-bottom:0cm">QmultiHash would make the lookup for a
tag much faster .. 
</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm"><i><b>Now Functions :</b></i></p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm;line-height:150%">void addTagObject
(koResource, string);</p>
<p style="margin-bottom:0cm;line-height:150%">void deleteTagObject
(koResource, string);</p>
<p style="margin-bottom:0cm;line-height:150%">koResourceList
filterTagObjects (string);</p>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm"><b>whenever a tag is created for an
object, we call the function addTagObject(koResource, string)</b></p>
<p style="margin-bottom:0cm" align="LEFT"><br>
</p>
<ul><li><p style="margin-bottom:0cm" align="LEFT">we will check for
        whether this tag is valid or is already added to the resource. 
        </p>
        </li><li><p style="margin-bottom:0cm" align="LEFT"> If it is valid and it
        is not added to the resource, we will ad the tag using insert
        (key,value) of QmultiHash object.</p>
        <p style="margin-bottom:0cm" align="LEFT"></p>
</li></ul>
<p style="margin-bottom:0cm"><b>whenever a tag is searched, we call
the function filterTagObjects (string)</b></p>
<p style="margin-bottom:0cm">  
</p>
<ul><li><p style="margin-bottom:0cm">we will check the resource and tag
        pair exists in the QmultiHash object using find(key,value) function.
                </p>
        </li><li><p style="margin-bottom:0cm">Resources names can be retrieved
        from m_resources list in koResourceServer</p>
        </li><li><p style="margin-bottom:0cm">If resource and tag pair found, we
        will display that resource.</p>
</li></ul>
<p style="margin-bottom:0cm"><br>
</p>
<p style="margin-bottom:0cm"><b>whenever a tag is deleted, we will
call the function deleteTagObjects(koResource, string) </b>
</p>
<ul><li><p style="margin-bottom:0cm">we will check for the resource and
        tag pair as in filterTagObjects() .</p>
        </li><li><p style="margin-bottom:0cm">we will delete that tag using
        remove function of QmultiHash object.</p>
        <p style="margin-bottom:0cm"></p>
        <p style="margin-bottom:0cm">We also add two other functions</p>
        <p style="margin-bottom:0cm"></p>
        <p style="margin-bottom:0cm" align="JUSTIFY"><i>writeToXML()</i> -
        this one will be called at the end of the program, which saves the
        data in the QmultiHash object in a XML file in gimp tags.xml format.</p>
        <p style="margin-bottom:0cm" align="JUSTIFY"></p>
        <p style="margin-bottom:0cm" align="JUSTIFY"><i>ReadFromXML()</i> -
        this one will be called at the start up to retrieve the tags and
        store them in QmultiHash object.</p>
        <p style="margin-bottom:0cm" align="JUSTIFY"></p>
        <p style="margin-bottom:0cm" align="JUSTIFY">I think for providing
        auto completion, we need to store tags in QstringList. 
        </p>
        <p style="margin-bottom:0cm" align="JUSTIFY"></p>
        <p style="margin-bottom:0cm" align="JUSTIFY"> This the idea of the
        tagging and its implementation details. Please give me your feed
        back .... 
        </p>
</li></ul>
<p style="margin-bottom:0cm" align="JUSTIFY"><br></p><blockquote style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex" class="gmail_quote"><p style="margin-bottom:0cm" align="JUSTIFY">

 UI Pictures are not in this mail, but they are present in the pdf and odt files attached to this mail
</p></blockquote>
<p style="margin-bottom:0cm"><br>
</p>
<br>Regards<br><font color="#888888">Srikanth Tiyyagura<br><br><br>
</font><br>_______________________________________________<br>
kimageshop mailing list<br>
<a href="mailto:kimageshop@kde.org">kimageshop@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kimageshop" target="_blank">https://mail.kde.org/mailman/listinfo/kimageshop</a><br>
<br></blockquote></div><br>