| 92 | } |
| 93 | |
| 94 | void SettingsPrivate::enableSync(bool enable) |
| 95 | { |
| 96 | if (syncEnabled == enable) |
| 97 | return; |
| 98 | |
| 99 | syncEnabled = enable; |
| 100 | if (!autoSync || !syncTimer) |
| 101 | return; |
| 102 | |
| 103 | if (QThread::currentThread() == syncTimer->thread()) { |
| 104 | if (enable) { |
| 105 | syncTimer->start(); |
| 106 | } else { |
| 107 | syncTimer->stop(); |
| 108 | } |
| 109 | } else { |
| 110 | syncTimer->metaObject()->invokeMethod(syncTimer, enable ? "start" : "stop", Qt::QueuedConnection); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | bool SettingsPrivate::makeFilePath(const QString &fileName) |
| 115 | { |