File: ConnectionLoader.cpp

package info (click to toggle)
dataquay 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 852 kB
  • sloc: cpp: 8,808; sh: 26; ansic: 13; makefile: 10
file content (35 lines) | stat: -rw-r--r-- 1,264 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*!!! pulled out from ObjectLoader.cpp: can we do this using a callback, as an example?
void
ObjectLoader::D::loadConnections(NodeObjectMap &map)
{
    QString slotTemplate = SLOT(xxx());
    QString signalTemplate = SIGNAL(xxx());

    // The store does not necessarily know m_relationshipPrefix

    ResultSet rs = m_s->query
        (QString
         (" PREFIX rel: <%1> "
          " SELECT ?sobj ?ssig ?tobj ?tslot WHERE { "
          " ?conn a rel:Connection; rel:source ?s; rel:target ?t. "
          " ?s rel:object ?sobj; rel:signal ?ssig. "
          " ?t rel:object ?tobj; rel:slot ?tslot. "
          " } ").arg(m_tm.getRelationshipPrefix().toString()));

    foreach (Dictionary d, rs) {

        Uri sourceUri(d["sobj"].value);
        Uri targetUri(d["tobj"].value);
        if (!map.contains(sourceUri) || !map.contains(targetUri)) continue;

        QString sourceSignal = signalTemplate.replace("xxx", d["ssig"].value);
        QString targetSlot = slotTemplate.replace("xxx", d["tslot"].value);

        QByteArray sigba = sourceSignal.toLocal8Bit();
        QByteArray slotba = targetSlot.toLocal8Bit();
                
        QObject::connect(map[sourceUri], sigba.data(),
                         map[targetUri], slotba.data());
    }
}
*/