Skip to content

Commit

Permalink
Remove calls to Content method
Browse files Browse the repository at this point in the history
It does seem to be required, and complicates matters
  • Loading branch information
shermp committed Jul 12, 2023
1 parent 89305e3 commit 93520ae
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 1 addition & 10 deletions src/ndb/NDBMetadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ NDBMetadata::NDBMetadata(QObject* parent) : QObject(parent) {
resolveSymbolRTLD("_ZN13VolumeManager7getByIdERK7QStringS2_", nh_symoutptr(symbols.VolumeManager__getById));
resolveSymbolRTLD("_ZN6VolumeC1Ev", nh_symoutptr(symbols.Volume__Volume));
resolveSymbolRTLD("_ZNK6Volume7isValidEv", nh_symoutptr(symbols.Volume__isValid));
resolveSymbolRTLD("_ZNK7Content11getDbValuesEv", nh_symoutptr(symbols.Content__getDbValues));
resolveSymbolRTLD("_ZNK6Volume11getDbValuesEv", nh_symoutptr(symbols.Volume__getDbValues));
resolveSymbolRTLD("_ZN13VolumeManager7forEachERK7QStringRKSt8functionIFvRK6VolumeEE", nh_symoutptr(symbols.Volume__forEach));
resolveSymbolRTLD("_ZN6Volume12setAttributeERK7QStringRK8QVariant", nh_symoutptr(symbols.Volume__setAttribute));
resolveSymbolRTLD("_ZN6Volume4saveERK6Device", nh_symoutptr(symbols.Volume__save));
if (!symbols.VolumeManager__getById ||
!symbols.Content__getDbValues ||
!symbols.Volume__Volume ||
!symbols.Volume__getDbValues ||
!symbols.Volume__isValid ||
Expand Down Expand Up @@ -119,14 +117,7 @@ QVariantMap NDBMetadata::getMetadata(Volume* v) {
NDB_DEBUG("Volume pointer NULL");
return QVariantMap();
}
QVariantMap volMap = symbols.Volume__getDbValues(v);
Content *c = v;
QVariantMap contentMap = symbols.Content__getDbValues(c);
auto merged = contentMap;
for (auto i = volMap.constBegin(); i != volMap.constEnd(); ++i) {
merged.insert(i.key(), i.value());
}
return merged;
return symbols.Volume__getDbValues(v);
}

QStringList NDBMetadata::getBookList(std::function<bool (Volume*)> filter) {
Expand Down
2 changes: 0 additions & 2 deletions src/ndb/NDBMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "ndb.h"

typedef void Content; // It doesn't appear to be a QObject
typedef void Volume; // Inherits Content
typedef QObject VolumeManager; // The VolumeManager is a QObject though
typedef void Device;
Expand Down Expand Up @@ -52,7 +51,6 @@ class NDBMetadata : public QObject {
void (*Volume__Volume)(Volume* _this);
void (*Volume__forEach)(QString const& dbName, std::function<void(Volume /*const&*/ *v)> f);
int (*Volume__isValid)(Volume* _this);
QVariantMap (*Content__getDbValues)(Content* content);
QVariantMap (*Volume__getDbValues)(Volume* volume);
int (*Volume__save)(Volume* _this, Device* device);
void (*Volume__setAttribute)(Volume* _this, QString const& key, QVariant const& val);
Expand Down

0 comments on commit 93520ae

Please sign in to comment.