| 80 | } |
| 81 | |
| 82 | void EcoNode::initialize() |
| 83 | { |
| 84 | static QMutex mutex; |
| 85 | if (s_root) |
| 86 | return; |
| 87 | |
| 88 | mutex.lock(); |
| 89 | if (!s_root) |
| 90 | { |
| 91 | Q_INIT_RESOURCE(eco); |
| 92 | |
| 93 | QFile file(":/eco.bin"); |
| 94 | if (!file.open(QIODevice::ReadOnly)) |
| 95 | qWarning("Could not open ECO file"); |
| 96 | else |
| 97 | { |
| 98 | QDataStream in(&file); |
| 99 | in.setVersion(QDataStream::Qt_4_6); |
| 100 | in >> s_openings >> s_root; |
| 101 | } |
| 102 | } |
| 103 | mutex.unlock(); |
| 104 | } |
| 105 | |
| 106 | void EcoNode::initialize(PgnStream& in) |
| 107 | { |