Skip to content

Commit

Permalink
[buteo-mtp] Remove remainings of Tracker usage. JB#54462 OMP#JOLLA-170
Browse files Browse the repository at this point in the history
Now after removing dead code and suspicious implementations, the rest
doesn't seem to provide much while still being a slightly hard fit
for new tracker graph model with content type specific in separate
graphs.

Some parts weren't even working anyway: getting video metadata resulted
in tracker parser stack overflow and seemed like commonly only the mass
query was done, not file specific which would allow more precise
query.
  • Loading branch information
pvuorela committed Jun 8, 2021
1 parent e9e829b commit 4a1cfc4
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 1,351 deletions.
49 changes: 0 additions & 49 deletions mts/platform/storage/fsstorageplugin/fsstorageplugin.cpp
Expand Up @@ -33,7 +33,6 @@

#include "fsstorageplugin.h"
#include "fsinotify.h"
#include "storagetracker.h"
#include "storageitem.h"
#include "thumbnailer.h"
#include "trace.h"
Expand Down Expand Up @@ -436,7 +435,6 @@ FSStoragePlugin::FSStoragePlugin( quint32 storageId, MTPStorageType storageType,
// Register this type before creating the Thumbnailer
qDBusRegisterMetaType<ThumbnailPathList>();

m_tracker = new StorageTracker();
m_thumbnailer = new Thumbnailer();
QObject::connect( m_thumbnailer, SIGNAL( thumbnailReady( const QString& ) ), this, SLOT( receiveThumbnail( const QString& ) ) );
clearCachedInotifyEvent(); // initialize
Expand Down Expand Up @@ -502,8 +500,6 @@ FSStoragePlugin::~FSStoragePlugin()
}
}

delete m_tracker;
m_tracker = 0;
delete m_thumbnailer;
m_thumbnailer = 0;
delete m_inotify;
Expand Down Expand Up @@ -3054,9 +3050,6 @@ MTPResponseCode FSStoragePlugin::getObjectPropertyValue(const ObjHandle &handle,
return response;
}
}

// Fetch whatever else remains from Tracker.
m_tracker->getPropVals(storageItem->m_path, propValList);
}
return MTP_RESP_OK;
}
Expand Down Expand Up @@ -3087,48 +3080,6 @@ MTPResponseCode FSStoragePlugin::getChildPropertyValues(ObjHandle handle,
}
}

QList<const MtpObjPropDesc *> trackerSupportedProperties;
foreach (const MtpObjPropDesc *desc, properties) {
if (m_tracker->supportsProperty(desc->uPropCode)) {
trackerSupportedProperties.append(desc);
}
}

QMap<QString, QList<QVariant> > trackerValues;
m_tracker->getChildPropVals(item->m_path, trackerSupportedProperties,
trackerValues);
if (trackerValues.isEmpty()) {
// Nothing more in Tracker, return immediately.
return MTP_RESP_OK;
}

// Merge the results.
QMap<ObjHandle, QList<QVariant> >::iterator it;
for (it = values.begin(); it != values.end(); ++it) {
StorageItem *child = m_objectHandlesMap[it.key()];
QList<QVariant> &childValues = it.value();
if (!trackerValues.contains(child->m_path)) {
MTP_LOG_INFO("Object" << child->m_path << "not found in tracker "
"result set.");
continue;
}

QList<QVariant>::iterator trackerValuesIt =
trackerValues[child->m_path].begin();
for (int i = 0; i != properties.size(); ++i) {
if (!m_tracker->supportsProperty(properties[i]->uPropCode)) {
// Not in Tracker result set.
continue;
}

QVariant &value = childValues[i];
if (value.isNull()) {
value = *trackerValuesIt;
}
++trackerValuesIt;
}
}

return MTP_RESP_OK;
}

Expand Down
2 changes: 0 additions & 2 deletions mts/platform/storage/fsstorageplugin/fsstorageplugin.h
Expand Up @@ -46,7 +46,6 @@ class QDir;
namespace meegomtp1dot0
{
class FSInotify;
class StorageTracker;
class Thumbnailer;
class StorageItem;
}
Expand Down Expand Up @@ -387,7 +386,6 @@ private slots:
QString m_puoidsDbPath; ///< path where puoids will be stored persistently.
QString m_objectReferencesDbPath; ///< path where references will be stored persistently.
ObjHandle m_writeObjectHandle; ///< The obj handle for which a write operation is currently is progress. 0 means invalid handle, NOT root node!!
StorageTracker* m_tracker; ///< pointer to the tracker object
Thumbnailer* m_thumbnailer; ///< pointer to the thumbnailer object
FSInotify* m_inotify; ///< pointer to the inotify wrapper
QHash<QString,quint16> m_formatByExtTable;
Expand Down
4 changes: 1 addition & 3 deletions mts/platform/storage/fsstorageplugin/fsstorageplugin.pro
Expand Up @@ -3,7 +3,7 @@ include(../../../common.pri)
TEMPLATE = lib
TARGET = fsstorage

CONFIG += plugin debug qtsparql
CONFIG += plugin debug

QT += dbus xml
QT -= gui
Expand All @@ -29,7 +29,6 @@ INCLUDEPATH += . \

# Input
HEADERS += fsstorageplugin.h \
storagetracker.h \
../storageplugin.h \
thumbnailerproxy.h \
thumbnailer.h \
Expand All @@ -38,7 +37,6 @@ HEADERS += fsstorageplugin.h \

SOURCES += fsstorageplugin.cpp \
fsstoragepluginfactory.cpp \
storagetracker.cpp \
thumbnailerproxy.cpp \
thumbnailer.cpp \
fsinotify.cpp \
Expand Down

0 comments on commit 4a1cfc4

Please sign in to comment.