diff options
author | RJ Ryan <rryan@mixxx.org> | 2016-05-10 14:51:38 -0700 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2016-05-11 21:06:34 -0700 |
commit | f068295b43453e63d9a8c67ff85f23897cb69cb9 (patch) | |
tree | c4437c1be7010c0814aafefdd4d53c9f24da9ae7 /src/controllers/bulk/bulkcontroller.cpp | |
parent | effbb061a0b0f55c5ece9e5c1df2f5665cca7817 (diff) |
Use a simpler datastructure to represent controller product details.
Diffstat (limited to 'src/controllers/bulk/bulkcontroller.cpp')
-rw-r--r-- | src/controllers/bulk/bulkcontroller.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/controllers/bulk/bulkcontroller.cpp b/src/controllers/bulk/bulkcontroller.cpp index 834ca6948d..9e5e78f5f8 100644 --- a/src/controllers/bulk/bulkcontroller.cpp +++ b/src/controllers/bulk/bulkcontroller.cpp @@ -122,9 +122,8 @@ bool BulkController::savePreset(const QString fileName) const { } bool BulkController::matchPreset(const PresetInfo& preset) { - const QList<QHash<QString, QString> > products = preset.getProducts(); - QHash <QString, QString> product; - foreach (product, products) { + const QList<ProductInfo>& products = preset.getProducts(); + for (const auto& product : products) { if (matchProductInfo(product)) { return true; } @@ -132,13 +131,13 @@ bool BulkController::matchPreset(const PresetInfo& preset) { return false; } -bool BulkController::matchProductInfo(QHash <QString, QString> info) { +bool BulkController::matchProductInfo(const ProductInfo& product) { int value; bool ok; // Product and vendor match is always required - value = info["vendor_id"].toInt(&ok,16); + value = product.vendor_id.toInt(&ok, 16); if (!ok || vendor_id!=value) return false; - value = info["product_id"].toInt(&ok,16); + value = product.product_id.toInt(&ok, 16); if (!ok || product_id!=value) return false; // Match found |