Skip to content

Commit

Permalink
WorkspaceLibraryDb: Remove obsolete method
Browse files Browse the repository at this point in the history
  • Loading branch information
ubruhin committed Apr 19, 2019
1 parent bf7769e commit b54190b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
22 changes: 0 additions & 22 deletions libs/librepcb/workspace/library/workspacelibrarydb.cpp
Expand Up @@ -237,28 +237,6 @@ QList<Uuid> WorkspaceLibraryDb::getElementsBySearchKeyword<Device>(
return getElementsBySearchKeyword("devices", "device_id", keyword);
}

QSet<Uuid> WorkspaceLibraryDb::getComponentsBySearchKeyword(
const QString& keyword) const {
QSqlQuery query = mDb->prepareQuery(
"SELECT components.uuid FROM components, components_tr, devices, "
"devices_tr "
"ON components.id=components_tr.component_id "
"AND devices.id=devices_tr.device_id "
"AND devices.component_uuid=components.uuid "
"WHERE components_tr.name LIKE :keyword "
"OR components_tr.keywords LIKE :keyword "
"OR devices_tr.name LIKE :keyword "
"OR devices_tr.keywords LIKE :keyword ");
query.bindValue(":keyword", "%" + keyword + "%");
mDb->exec(query);

QSet<Uuid> elements;
while (query.next()) {
elements.insert(Uuid::fromString(query.value(0).toString())); // can throw
}
return elements;
}

/*******************************************************************************
* Getters: Library elements of a specified library
******************************************************************************/
Expand Down
1 change: 0 additions & 1 deletion libs/librepcb/workspace/library/workspacelibrarydb.h
Expand Up @@ -95,7 +95,6 @@ class WorkspaceLibraryDb final : public QObject {
// Getters: Library elements by search keyword
template <typename ElementType>
QList<Uuid> getElementsBySearchKeyword(const QString& keyword) const;
QSet<Uuid> getComponentsBySearchKeyword(const QString& keyword) const;

// Getters: Library elements of a specified library
template <typename ElementType>
Expand Down

0 comments on commit b54190b

Please sign in to comment.