Commit 7b367355 authored by Leon Do Castelo's avatar Leon Do Castelo
Browse files

push getListeReseaux()

parent 560af391
......@@ -170,3 +170,25 @@ RegleVoisinage* Database::getRegleVoisinage(const QString& name) const {
return regle;
}
/// Retourne un descriptif des réseaux ("id", "nom", "id", "nom", etc.) liés à un automate
std::vector<QString> Database::getListeReseaux(const QString& name) const
{
QSqlQuery query(db);
query.prepare("SELECT id, nom FROM reseaux WHERE nom = ':nom'");
query.bindValue(":nom", name);
query.exec();
std::vector<QString> names;
if(query.first()) {
names.push_back(query.value("id").toString());
names.push_back(query.value("nom").toString());
}
while(query.next()) {
names.push_back(query.value("id").toString());
names.push_back(query.value("nom").toString());
}
return names;
}
Supports Markdown
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