Commit 09e58fb9 authored by Alexander Stippich's avatar Alexander Stippich

Unify inserting data between FileFetchJob and IndexedDataRetriever

Summary:
Unify how the data is updated between the different jobs.
Also fixes a case where editable data was added before
actually checking that editing is possible.

Reviewers: bruns, ngraham

Reviewed By: ngraham

Subscribers: #baloo

Tags: #baloo

Differential Revision: https://phabricator.kde.org/D23220
parent c88f03ea
......@@ -137,8 +137,7 @@ void FileMetaDataProvider::slotFileFetchFinished(KJob* job)
if (files.size() > 1) {
insertCommonData(files);
} else {
m_data = files.first();
insertSingleFileBasicData();
m_data = unite(m_data, files.first());
}
m_readOnly = !fetchJob->canEditAll();
......@@ -152,6 +151,7 @@ void FileMetaDataProvider::slotLoadingFinished(KJob* job)
m_data = unite(m_data, ret->data());
m_readOnly = !ret->canEdit();
insertEditableData();
emit loadingFinished();
}
......@@ -303,11 +303,11 @@ void FileMetaDataProvider::setFileItem()
// * Not Indexed
// * Indexed
//
insertSingleFileBasicData();
const QUrl url = m_fileItems.first().targetUrl();
if (!url.isLocalFile()) {
// FIXME - are extended attributes supported for remote files?
m_readOnly = true;
insertSingleFileBasicData();
emit loadingFinished();
return;
}
......@@ -318,9 +318,6 @@ void FileMetaDataProvider::setFileItem()
|| m_config.onlyBasicIndexing()) {
m_realTimeIndexing = true;
insertSingleFileBasicData();
insertEditableData();
IndexedDataRetriever *ret = new IndexedDataRetriever(filePath, this);
connect(ret, &IndexedDataRetriever::finished, this, &FileMetaDataProvider::slotLoadingFinished);
ret->start();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment