struct attr attr;
struct item* item;
struct map_rect *mr=NULL;
+ QHash<QString,QString> seenMap;
navit_get_attr(this->object->nav, attr_bookmarks, &attr, NULL);
mr=map_rect_new(bookmarks_get_map(attr.u.bookmarks), NULL);
if (!label.startsWith(this->current_path)) continue;
label=label.right(label.length()-this->current_path.length());
labelList=label.split("/",QString::SkipEmptyParts);
+ if (seenMap[labelList[0]]==labelList[0]) continue;
+ seenMap[labelList[0]]=labelList[0];
curItem->setData(labelList[0],NGQStandardItemModel::ItemName);
curItem->setData(QString(this->current_path).append(labelList[0]).append("/"),NGQStandardItemModel::ItemPath);
if (labelList.size()>1) {
return "Success";
}
}
+ QString Cut(QString description) {
+ struct attr attr;
+ navit_get_attr(this->object->nav, attr_bookmarks, &attr, NULL);
+ if (!bookmarks_cut_bookmark(attr.u.bookmarks, description.toLocal8Bit().constData()) ) {
+ return "Failed!";
+ } else {
+ return "Success";
+ }
+ }
+ QString Copy(QString description) {
+ struct attr attr;
+ navit_get_attr(this->object->nav, attr_bookmarks, &attr, NULL);
+ if (!bookmarks_copy_bookmark(attr.u.bookmarks, description.toLocal8Bit().constData()) ) {
+ return "Failed!";
+ } else {
+ return "Success";
+ }
+ }
+ QString Paste(QString location) {
+ struct attr attr;
+ navit_get_attr(this->object->nav, attr_bookmarks, &attr, NULL);
+ if (!bookmarks_paste_bookmark(attr.u.bookmarks, location.toLocal8Bit().constData()) ) {
+ return "Failed!";
+ } else {
+ return "Success";
+ }
+ }
QString Delete(QString bookmark) {
struct attr attr;
navit_get_attr(this->object->nav, attr_bookmarks, &attr, NULL);
}
Image {
+ id: imgCut; source: gui.iconPath+"zoom_out.svg"; anchors.right: imgCopy.left;anchors.rightMargin: 5;
+ width: 20; height: 20;
+
+ MouseRegion {
+ id:delegateMouseCut
+ anchors.fill: parent
+ onClicked: { bookmarks.Cut(itemId); bookmarks.getAttrList(""); }
+ }
+ }
+ Image {
+ id: imgCopy; source: gui.iconPath+"zoom_in.svg"; anchors.right: imgPaste.left;anchors.rightMargin: 5;
+ width: 20; height: 20;
+
+ MouseRegion {
+ id:delegateMouseCopy
+ anchors.fill: parent
+ onClicked: { bookmarks.Copy(itemId); bookmarks.getAttrList(""); }
+ }
+ }
+ Image {
+ id: imgPaste; source: gui.iconPath+"mark.svg"; anchors.right: imgDelete.left;anchors.rightMargin: 5;
+ width: 20; height: 20;
+
+ MouseRegion {
+ id:delegateMousePaste
+ anchors.fill: parent
+ onClicked: { bookmarks.Paste(bookmarks.currentPath); bookmarks.getAttrList(""); }
+ }
+ }
+ Image {
id: imgDelete; source: gui.iconPath+"gui_inactive.svg"; anchors.right: wrapper.right;anchors.rightMargin: 5;
- width: 20; height: 20
+ width: 20; height: 20;
MouseRegion {
id:delegateMouseDelete