Hello Devels,<br><br>I am inserting a bookmark in a folder with name folderName which is stored in GeoDataDocument inside BookmarkManager class(submitted a patch to reviewboard). Please suggest me how can I do that.<br><br>

I tried it with the following approach but I realized that it have some really big bugs. In my approach I used folders() function of GeoDataContainer which will return a QVector having all the folders. Then I compared with the name and when it matched append bookmark( which is GeoDataPlacemark ) in the folder.<br>

wrote following code for that :<br><br>void BookmarkManager::addBookmark( const GeoDataPlacemark &amp;bookmark, const QString &amp;folderName )<br>{<br>    QVector&lt;GeoDataFolder&gt; bookmarkFolders = folders();<br>    QVector&lt;GeoDataFolder&gt;::const_iterator i = bookmarkFolders.constBegin();<br>

    QVector&lt;GeoDataFolder&gt;::const_iterator end = bookmarkFolders.constEnd();<br><br>    for (; i != end; ++i ) {<br>        //Folder found where bookmark should be inserted<br>        if( !folderName.compare( i-&gt;name() ) ){<br>

    //        i-&gt;append(bookmark);        uncommenting gives compiler error<br>            break;<br>        }<br>    }<br>}<br><br>QVector&lt;GeoDataFolder&gt; BookmarkManager::folders() const<br>{<br>        return d-&gt;m_bookmarkDocument-&gt;folders();<br>

}<br><br>The problem I see is folders() function creates a local copy of QVector and return that. so adding bookmark to that folder might not work since it is local copy. So please tell me what should I do and why I am getting compiler error when I uncomment the line.<br>

<br>The one way I can think of is declare m_vector as a QVector having pointer to GeoDataFeature ( QVector&lt;GeoDataFeature*&gt; m_vector ) so I can add more child nodes ( like placemarks in folders ) from outside and the changes can be reflected in document. Please suggest me and let me know if I&#39;m not clear with my problem.<br>

<br clear="all"><br>Thanks,<br>Gaurav Gupta<br>Final Year Undergraduate<br>IT BHU<br>GSOC 10 KDE marble<br>Email : <a href="mailto:1989.gaurav@gmail.com">1989.gaurav@gmail.com</a><br>             <a href="mailto:gaurav.gupta@acm.org">gaurav.gupta@acm.org</a><br>