void HandlersManager::setHandler(const QString &type, const HandlerDefinition &definition) { if (SessionsManager::isReadOnly()) { return; } const QString path(SessionsManager::getWritableDataPath(QLatin1String("handlers.ini"))); Settings settings(QFile::exists(path) ? path : SessionsManager::getReadableDataPath(QLatin1String("handlers.ini"))); QString transferMode(QLatin1String("ask")); if (definition.transferMode == IgnoreTransferMode) { transferMode = QLatin1String("ignore"); } else if (definition.transferMode == OpenTransferMode) { transferMode = QLatin1String("open"); } else if (definition.transferMode == SaveTransferMode) { transferMode = QLatin1String("save"); } else if (definition.transferMode == SaveAsTransferMode) { transferMode = QLatin1String("saveAs"); } settings.beginGroup(type); settings.setValue(QLatin1String("openCommand"), definition.openCommand); settings.setValue(QLatin1String("downloadsPath"), definition.downloadsPath); settings.setValue(QLatin1String("transferMode"), transferMode); settings.save(path); }
void CAddonCallbacksADSP::ADSPUnregisterMode(void* addonData, AE_DSP_MODES::AE_DSP_MODE* mode) { CActiveAEDSPAddon *addon = GetAudioDSPAddon(addonData); if (!mode || !addon) { CLog::Log(LOGERROR, "Audio DSP - %s - invalid mode data", __FUNCTION__); return; } CActiveAEDSPMode transferMode(*mode, addon->GetID()); transferMode.Delete(); }
void CAddonCallbacksADSP::ADSPRegisterMode(void* addonData, AE_DSP_MODES::AE_DSP_MODE* mode) { CActiveAEDSPAddon *addon = GetAudioDSPAddon(addonData); if (!mode || !addon) { CLog::Log(LOGERROR, "Audio DSP - %s - invalid mode data", __FUNCTION__); return; } CActiveAEDSPMode transferMode(*mode, addon->GetID()); int idMode = transferMode.AddUpdate(); mode->iUniqueDBModeId = idMode; if (idMode > AE_DSP_INVALID_ADDON_ID) { CLog::Log(LOGDEBUG, "Audio DSP - %s - successfull registered mode %s of %s adsp-addon", __FUNCTION__, mode->strModeName, addon->Name().c_str()); } else { CLog::Log(LOGERROR, "Audio DSP - %s - failed to register mode %s of %s adsp-addon", __FUNCTION__, mode->strModeName, addon->Name().c_str()); } }