Commit a735a5ae authored by Stefan Brüns's avatar Stefan Brüns

Remove no longer used IndexedDataRetriever

Summary:
There are no users left, remove it.

Depends on D25250

Reviewers: #baloo, ngraham, astippich

Reviewed By: #baloo, ngraham, astippich

Tags: #baloo

Differential Revision: https://phabricator.kde.org/D25251
parent d202cc38
......@@ -8,17 +8,16 @@ set(widgets_SRCS
tagwidget.cpp
kedittagsdialog.cpp
tagcheckbox.cpp
filefetchjob.cpp
filemetadatawidget.cpp
filemetadataconfigwidget.cpp
filemetadataprovider.cpp
filemetadatautil.cpp
indexeddataretriever.cpp
kcommentwidget.cpp
keditcommentdialog.cpp
metadatafilter.cpp
ondemandextractor.cpp
widgetfactory.cpp
filefetchjob.cpp
)
ecm_qt_declare_logging_category(
......
......@@ -19,7 +19,6 @@
*****************************************************************************/
#include "filemetadataprovider.h"
#include "indexeddataretriever.h"
#include "filefetchjob.h"
#include <KFileMetaData/PropertyInfo>
......@@ -145,16 +144,6 @@ void FileMetaDataProvider::slotFileFetchFinished(KJob* job)
emit loadingFinished();
}
void FileMetaDataProvider::slotLoadingFinished(KJob* job)
{
IndexedDataRetriever* ret = dynamic_cast<IndexedDataRetriever*>(job);
m_data = unite(m_data, ret->data());
m_readOnly = !ret->canEdit();
insertEditableData();
emit loadingFinished();
}
void FileMetaDataProvider::insertSingleFileBasicData()
{
// TODO: Handle case if remote URLs are used properly. isDir() does
......
......@@ -111,7 +111,6 @@ Q_SIGNALS:
void loadingFinished();
private Q_SLOTS:
void slotLoadingFinished(KJob* job);
void slotFileFetchFinished(KJob* job);
private:
......
/*
* <one line to give the library's name and an idea of what it does.>
* Copyright (C) 2012 Vishesh Handa <me@vhanda.in>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "indexeddataretriever.h"
#include "filemetadatautil_p.h"
#include <QFileInfo>
using namespace Baloo;
IndexedDataRetriever::IndexedDataRetriever(const QString& fileUrl, QObject* parent): KJob(parent)
{
QFileInfo fileInfo(fileUrl);
m_url = fileInfo.canonicalFilePath();
m_canEdit = fileInfo.isWritable();
connect(&m_extractor, &Private::OnDemandExtractor::fileFinished, this, &IndexedDataRetriever::slotIndexedFile);
}
IndexedDataRetriever::~IndexedDataRetriever()
{
}
void IndexedDataRetriever::start()
{
m_extractor.process(m_url);
KFileMetaData::UserMetaData umd(m_url);
if (umd.isSupported()) {
m_data = Baloo::Private::convertUserMetaData(umd);
m_canEdit &= true;
} else {
m_data.clear();
m_canEdit &= false;
}
}
void IndexedDataRetriever::slotIndexedFile(QProcess::ExitStatus status)
{
if (status == QProcess::NormalExit) {
QVariantMap properties = Baloo::Private::toNamedVariantMap(m_extractor.properties());
m_data.unite(properties);
}
emitResult();
}
bool IndexedDataRetriever::canEdit() const
{
return m_canEdit;
}
QVariantMap IndexedDataRetriever::data() const
{
return m_data;
}
/*
* <one line to give the library's name and an idea of what it does.>
* Copyright (C) 2012 Vishesh Handa <me@vhanda.in>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef INDEXEDDATARETRIEVER_H
#define INDEXEDDATARETRIEVER_H
#include <KJob>
#include "ondemandextractor.h"
#include <QVariant>
namespace Baloo {
class IndexedDataRetriever : public KJob
{
Q_OBJECT
public:
explicit IndexedDataRetriever(const QString& fileUrl, QObject* parent = nullptr);
~IndexedDataRetriever() override;
void start() override;
QVariantMap data() const;
bool canEdit() const;
private Q_SLOTS:
void slotIndexedFile(QProcess::ExitStatus exitStatus);
private:
QString m_url;
Private::OnDemandExtractor m_extractor;
QVariantMap m_data;
bool m_canEdit = false;
};
}
#endif // INDEXEDDATARETRIEVER_H
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