| 558 | } |
| 559 | |
| 560 | int QListDB::insertObjectEntry(const QString &path, const QString &name, int parent_ohfi) |
| 561 | { |
| 562 | QMutexLocker locker(&mutex); |
| 563 | |
| 564 | CMAObject *parent_obj = ohfiToObject(parent_ohfi); |
| 565 | |
| 566 | for(map_list::iterator root = object_list.begin(); root != object_list.end(); ++root) { |
| 567 | root_list *cat_list = &(*root); |
| 568 | root_list::iterator it = std::lower_bound(cat_list->begin(), cat_list->end(), parent_obj, QListDB::lessThanComparator); |
| 569 | |
| 570 | if(it != cat_list->end()) { |
| 571 | CMAObject *newobj = new CMAObject(parent_obj); |
| 572 | |
| 573 | // get the root object |
| 574 | while(parent_obj->parent) { |
| 575 | parent_obj = parent_obj->parent; |
| 576 | } |
| 577 | |
| 578 | QFileInfo info(path, name); |
| 579 | newobj->initObject(info, parent_obj->metadata.dataType); |
| 580 | cat_list->append(newobj); |
| 581 | return newobj->metadata.ohfi; |
| 582 | } |
| 583 | } |
| 584 | |
| 585 | return 0; |
| 586 | } |
| 587 | |
| 588 | QString QListDB::getAbsolutePath(int ohfi) |
| 589 | { |
no test coverage detected