本文整理汇总了C++中models::ArtworkMetadata::getFilepath方法的典型用法代码示例。如果您正苦于以下问题:C++ ArtworkMetadata::getFilepath方法的具体用法?C++ ArtworkMetadata::getFilepath怎么用?C++ ArtworkMetadata::getFilepath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models::ArtworkMetadata
的用法示例。
在下文中一共展示了ArtworkMetadata::getFilepath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: afterImportHandler
void MetadataIOCoordinator::afterImportHandler(const QVector<Models::ArtworkMetadata*> &itemsToRead, bool ignoreBackups) {
Models::SettingsModel *settingsModel = m_CommandManager->getSettingsModel();
const QHash<QString, ImportDataResult> &importResult = m_ReadingWorker->getImportResult();
const QVector<QPair<int, int> > &rangesToUpdate = m_ReadingWorker->getRangesToUpdate();
if (!ignoreBackups && settingsModel->getSaveBackups()) {
LOG_DEBUG << "Restoring the backups...";
int size = itemsToRead.size();
for (int i = 0; i < size; ++i) {
Models::ArtworkMetadata *metadata = itemsToRead.at(i);
const QString &filepath = metadata->getFilepath();
if (importResult.contains(filepath)) {
const ImportDataResult &importResultItem = importResult.value(filepath);
MetadataSavingCopy copy(importResultItem.BackupDict);
copy.saveToMetadata(metadata);
}
}
} else {
LOG_DEBUG << "Skipped restoring the backups";
}
if (!getHasErrors()) {
m_CommandManager->addToLibrary(itemsToRead);
}
m_CommandManager->updateArtworks(rangesToUpdate);
m_CommandManager->submitForSpellCheck(itemsToRead);
m_CommandManager->submitForWarningsCheck(itemsToRead);
}
示例2: readingFinishedHandler
void MetadataIOCoordinator::readingFinishedHandler(bool ignoreBackups) {
Q_ASSERT(m_CanProcessResults);
m_CanProcessResults = false;
const QHash<QString, ImportDataResult> &importResult = m_ReadingWorker->getImportResult();
const QVector<Models::ArtworkMetadata*> &itemsToRead = m_ReadingWorker->getItemsToRead();
LOG_DEBUG << "Setting imported metadata...";
int size = itemsToRead.size();
for (int i = 0; i < size; ++i) {
Models::ArtworkMetadata *metadata = itemsToRead.at(i);
const QString &filepath = metadata->getFilepath();
if (importResult.contains(filepath)) {
const ImportDataResult &importResultItem = importResult.value(filepath);
metadata->initialize(importResultItem.Title,
importResultItem.Description,
importResultItem.Keywords);
Models::ImageArtwork *image = dynamic_cast<Models::ImageArtwork*>(metadata);
if (image != NULL) {
image->setImageSize(importResultItem.ImageSize);
image->setDateTimeOriginal(importResultItem.DateTimeOriginal);
}
metadata->setFileSize(importResultItem.FileSize);
}
}
afterImportHandler(itemsToRead, ignoreBackups);
LOG_DEBUG << "Metadata import finished";
emit metadataReadingFinished();
}
示例3: finished
void Exiv2ReadingWorker::process() {
LOG_DEBUG << "Worker #" << m_WorkerIndex << "started";
bool anyError = false;
int size = m_ItemsToRead.size();
for (int i = 0; i < size; ++i) {
if (m_Stopped) { break; }
Models::ArtworkMetadata *artwork = m_ItemsToRead.at(i);
const QString &filepath = artwork->getFilepath();
ImportDataResult importResult;
try {
if (readMetadata(artwork, importResult)) {
Q_ASSERT(!m_ImportResult.contains(filepath));
m_ImportResult.insert(filepath, importResult);
}
}
catch(Exiv2::Error &error) {
anyError = true;
LOG_WARNING << "Worker" << m_WorkerIndex << "Exiv2 error:" << error.what();
}
catch(...) {
anyError = true;
LOG_WARNING << "Worker" << m_WorkerIndex << "Reading error for item" << filepath;
}
}
LOG_INFO << "Worker #" << m_WorkerIndex << "finished";
emit finished(anyError);
}
示例4: readingFinishedHandler
void MetadataIOCoordinator::readingFinishedHandler(bool ignoreBackups) {
Q_ASSERT(m_CanProcessResults);
m_CanProcessResults = false;
const QHash<QString, ImportDataResult> &importResult = m_ReadingWorker->getImportResult();
const QVector<Models::ArtworkMetadata*> &itemsToRead = m_ReadingWorker->getArtworksToImport();
qDebug() << "Setting imported metadata...";
int size = itemsToRead.size();
for (int i = 0; i < size; ++i) {
Models::ArtworkMetadata *metadata = itemsToRead.at(i);
const QString &filepath = metadata->getFilepath();
if (importResult.contains(filepath)) {
const ImportDataResult &importResultItem = importResult.value(filepath);
metadata->initialize(importResultItem.Title,
importResultItem.Description,
importResultItem.Keywords);
metadata->setSize(importResultItem.Size);
}
}
afterImportHandler(itemsToRead, ignoreBackups);
qDebug() << "Metadata import finished";
emit metadataReadingFinished();
}
示例5: continueWithoutReading
void MetadataIOCoordinator::continueWithoutReading() {
LOG_DEBUG << "Setting technical data";
const QHash<QString, ImportDataResult> &importResult = m_ReadingWorker->getImportResult();
const QVector<Models::ArtworkMetadata*> &itemsToRead = m_ReadingWorker->getItemsToRead();
int size = itemsToRead.size();
for (int i = 0; i < size; ++i) {
Models::ArtworkMetadata *metadata = itemsToRead.at(i);
const QString &filepath = metadata->getFilepath();
if (importResult.contains(filepath)) {
const ImportDataResult &importResultItem = importResult.value(filepath);
Models::ImageArtwork *image = dynamic_cast<Models::ImageArtwork*>(metadata);
if (image != NULL) {
image->setImageSize(importResultItem.ImageSize);
image->setDateTimeOriginal(importResultItem.DateTimeOriginal);
}
metadata->setFileSize(importResultItem.FileSize);
}
}
}