| 1244 | } |
| 1245 | |
| 1246 | void MusicApplication::writeSystemConfigToFile() |
| 1247 | { |
| 1248 | MusicConfigManager manager; |
| 1249 | if(!manager.load(COFIG_PATH_FULL)) |
| 1250 | { |
| 1251 | TTK_ERROR_STREAM("Load config file error:" << COFIG_PATH_FULL); |
| 1252 | return; |
| 1253 | } |
| 1254 | |
| 1255 | m_applicationModule->updateSoundEffectConfig(false); |
| 1256 | |
| 1257 | G_SETTING_PTR->setValue(MusicSettingManager::WidgetPosition, pos()); |
| 1258 | G_SETTING_PTR->setValue(MusicSettingManager::EnhancedMusicIndex, TTKStaticCast(int, m_player->enhance())); |
| 1259 | G_SETTING_PTR->setValue(MusicSettingManager::PlayMode, TTKStaticCast(int, m_playlist->playbackMode())); |
| 1260 | G_SETTING_PTR->setValue(MusicSettingManager::Volume, m_ui->soundButton->value()); |
| 1261 | |
| 1262 | QStringList lastPlayIndex = G_SETTING_PTR->value(MusicSettingManager::LastPlayIndex).toStringList(); |
| 1263 | if(lastPlayIndex.isEmpty()) |
| 1264 | { |
| 1265 | lastPlayIndex << "1" << "-1" << "-1"; |
| 1266 | } |
| 1267 | else |
| 1268 | { |
| 1269 | const MusicPlayItem &item = m_playlist->currentItem(); |
| 1270 | lastPlayIndex[1] = QString::number(item.m_playlistRow); |
| 1271 | lastPlayIndex[2] = QString::number(m_songTreeWidget->mapSongIndexByFilePath(item.m_playlistRow, item.m_path)); |
| 1272 | } |
| 1273 | |
| 1274 | G_SETTING_PTR->setValue(MusicSettingManager::LastPlayIndex, lastPlayIndex); |
| 1275 | G_SETTING_PTR->setValue(MusicSettingManager::BackgroundThemeValue, m_topAreaWidget->backgroundPath()); |
| 1276 | G_SETTING_PTR->setValue(MusicSettingManager::BackgroundTransparent, m_topAreaWidget->backgroundTransparent()); |
| 1277 | G_SETTING_PTR->setValue(MusicSettingManager::BackgroundListTransparent, m_topAreaWidget->backgroundListTransparent()); |
| 1278 | G_SETTING_PTR->setValue(MusicSettingManager::BackgroundTransparentEnable, m_topAreaWidget->backgroundTransparentEnabled()); |
| 1279 | G_SETTING_PTR->setValue(MusicSettingManager::ShowDesktopLrc, m_rightAreaWidget->destopLrcVisible()); |
| 1280 | manager.writeBuffer(); |
| 1281 | |
| 1282 | { |
| 1283 | MusicTKPLConfigManager manager; |
| 1284 | if(!manager.load(PLAYLIST_PATH_FULL)) |
| 1285 | { |
| 1286 | return; |
| 1287 | } |
| 1288 | |
| 1289 | manager.writeBuffer(m_songTreeWidget->items()); |
| 1290 | } |
| 1291 | } |
nothing calls this directly
no test coverage detected