MCPcopy Create free account
hub / github.com/codestation/qcma / insertObjectEntry

Method insertObjectEntry

common/qlistdb.cpp:560–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560int 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
588QString QListDB::getAbsolutePath(int ohfi)
589{

Callers 2

processAllObjectsMethod · 0.45

Calls 1

initObjectMethod · 0.45

Tested by

no test coverage detected