Changeset 2934
- Timestamp:
- 04/25/06 10:47:37 (3 years ago)
- Files:
-
- hydranode/hncore/metadata.cpp (modified) (1 diff)
- hydranode/hncore/metadata.h (modified) (1 diff)
- hydranode/hncore/sharedfile.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
hydranode/hncore/metadata.cpp
r2694 r2934 1029 1029 getEventTable().postEvent(this, MD_ADDED_IMAGE); 1030 1030 } 1031 1032 void MetaData::mergeCustom(MetaData *other) { 1033 CHECK_THROW(other); 1034 1035 m_fileNames = other->m_fileNames; 1036 m_customData = other->m_customData; 1037 m_comments = other->m_comments; 1038 } hydranode/hncore/metadata.h
r2924 r2934 584 584 //@} 585 585 586 /** 587 * Merges names, comments and custom fields from other metadata to 588 * this metadata. 589 * 590 * \note All existing names, comments and custom fields in this object 591 * are destroyed. 592 */ 593 void mergeCustom(MetaData *other); 586 594 private: 587 595 MetaData(const MetaData &md); //!< Copy construct forbidden hydranode/hncore/sharedfile.cpp
r2894 r2934 449 449 ) % hw->getFileName().native_file_string()); 450 450 destroy(); 451 } else if (m_metaData) {452 logDebug("TODO! Implement MetaData combining.");453 451 } else { 454 452 CHECK_THROW(hw->getMetaData()); 455 453 CHECK_THROW(hw->getMetaData()->getHashSetCount()); 454 MetaData *nmd = hw->getMetaData(); 455 MetaData *found = 0; 456 for (uint32_t i = 0; i < nmd->getHashSetCount(); ++i) { 457 found = MetaDb::instance().find( 458 nmd->getHashSet(i)->getFileHash() 459 ); 460 if (found) { 461 break; 462 } 463 } 464 if (found) { 465 logDebug( 466 boost::format( 467 "Found existing MetaData for file " 468 "%s, merging custom data." 469 ) % getName() 470 ); 471 nmd->mergeCustom(found); 472 // TODO: remove the found entry from MetaDb 473 } 474 456 475 m_metaData = hw->getMetaData(); 457 476 m_metaData->setName(getName());
