| 150 | } |
| 151 | |
| 152 | void ComicFlowWidget::updateConfig(QSettings *settings) |
| 153 | { |
| 154 | Performance performance = medium; |
| 155 | |
| 156 | switch (settings->value(PERFORMANCE).toInt()) { |
| 157 | case 0: |
| 158 | performance = low; |
| 159 | break; |
| 160 | case 1: |
| 161 | performance = medium; |
| 162 | break; |
| 163 | case 2: |
| 164 | performance = high; |
| 165 | break; |
| 166 | case 3: |
| 167 | performance = ultraHigh; |
| 168 | break; |
| 169 | } |
| 170 | |
| 171 | flow->setPerformance(performance); |
| 172 | if (!settings->contains(V_SYNC)) |
| 173 | flow->useVSync(false); |
| 174 | else |
| 175 | flow->useVSync(settings->value(V_SYNC).toBool()); |
| 176 | |
| 177 | switch (settings->value(FLOW_TYPE_GL).toInt()) { |
| 178 | case 0: |
| 179 | flow->setPreset(presetYACReaderFlowClassicConfig); |
| 180 | return; |
| 181 | case 1: |
| 182 | flow->setPreset(presetYACReaderFlowStripeConfig); |
| 183 | return; |
| 184 | case 2: |
| 185 | flow->setPreset(presetYACReaderFlowOverlappedStripeConfig); |
| 186 | return; |
| 187 | case 3: |
| 188 | flow->setPreset(defaultYACReaderFlowConfig); |
| 189 | return; |
| 190 | case 4: |
| 191 | flow->setPreset(pressetYACReaderFlowDownConfig); |
| 192 | return; |
| 193 | } |
| 194 | |
| 195 | // custom config |
| 196 | flow->setCF_RX(settings->value(X_ROTATION).toInt()); |
| 197 | flow->setCF_Y(settings->value(Y_POSITION).toInt()); |
| 198 | flow->setX_Distance(settings->value(COVER_DISTANCE).toInt()); |
| 199 | flow->setCenter_Distance(settings->value(CENTRAL_DISTANCE).toInt()); |
| 200 | flow->setCF_Z(settings->value(ZOOM_LEVEL).toInt()); |
| 201 | flow->setY_Distance(settings->value(Y_COVER_OFFSET).toInt()); |
| 202 | flow->setZ_Distance(settings->value(Z_COVER_OFFSET).toInt()); |
| 203 | flow->setRotation(settings->value(COVER_ROTATION).toInt()); |
| 204 | flow->setFadeOutDist(settings->value(FADE_OUT_DIST).toInt()); |
| 205 | flow->setLightStrenght(settings->value(LIGHT_STRENGTH).toInt()); |
| 206 | flow->setMaxAngle(settings->value(MAX_ANGLE).toInt()); |
| 207 | } |
| 208 | |
| 209 | void ComicFlowWidget::add(const QString &path, int index) |
nothing calls this directly
no test coverage detected