drop commented code
This commit is contained in:
parent
c18ec356e8
commit
cecab6a4be
@ -22,95 +22,6 @@ Translator::~Translator()
|
|||||||
m_translatorContexts.clear();
|
m_translatorContexts.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
//DeviceClass Translator::translate(DevicePlugin* plugin, const DeviceClass &deviceClass, const QLocale &locale)
|
|
||||||
//{
|
|
||||||
// if (!m_translatorContexts.contains(deviceClass.pluginId()) || !m_translatorContexts.value(deviceClass.pluginId()).translators.contains(locale)) {
|
|
||||||
// loadTranslator(plugin, locale);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// QTranslator* translator = m_translatorContexts.value(deviceClass.pluginId()).translators.value(locale);
|
|
||||||
|
|
||||||
// DeviceClass translatedDeviceClass(deviceClass);
|
|
||||||
// QString translatedDisplayName = translator->translate(plugin->pluginName().toUtf8(), deviceClass.displayName().toUtf8());
|
|
||||||
// if (!translatedDisplayName.isEmpty()) {
|
|
||||||
// translatedDeviceClass.setDisplayName(translatedDisplayName);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // ParamTypes
|
|
||||||
// ParamTypes translatedParamTypes;
|
|
||||||
// foreach (ParamType paramType, deviceClass.paramTypes()) {
|
|
||||||
// QString translated = translator->translate(plugin->pluginName().toUtf8(), paramType.displayName().toUtf8());
|
|
||||||
// if (!translated.isEmpty()) {
|
|
||||||
// paramType.setDisplayName(translated);
|
|
||||||
// }
|
|
||||||
// translatedParamTypes.append(paramType);
|
|
||||||
// }
|
|
||||||
// translatedDeviceClass.setParamTypes(translatedParamTypes);
|
|
||||||
|
|
||||||
// // DiscoveryParamTypes
|
|
||||||
// ParamTypes translatedDiscoveryParamTypes;
|
|
||||||
// foreach (ParamType discoveryParamType, deviceClass.discoveryParamTypes()) {
|
|
||||||
// QString translated = translator->translate(plugin->pluginName().toUtf8(), discoveryParamType.displayName().toUtf8());
|
|
||||||
// if (!translated.isEmpty()) {
|
|
||||||
// discoveryParamType.setDisplayName(translated);
|
|
||||||
// }
|
|
||||||
// translatedParamTypes.append(discoveryParamType);
|
|
||||||
// }
|
|
||||||
// translatedDeviceClass.setDiscoveryParamTypes(translatedDiscoveryParamTypes);
|
|
||||||
|
|
||||||
// // EventTypes
|
|
||||||
// EventTypes translatedEventTypes;
|
|
||||||
// foreach (EventType eventType, deviceClass.eventTypes()) {
|
|
||||||
// QString translated = translator->translate(plugin->pluginName().toUtf8(), eventType.displayName().toUtf8());
|
|
||||||
// if (!translated.isEmpty()) {
|
|
||||||
// eventType.setDisplayName(translated);
|
|
||||||
// }
|
|
||||||
// ParamTypes translatedEventParamTypes;
|
|
||||||
// foreach (ParamType paramType, eventType.paramTypes()) {
|
|
||||||
// translated = translator->translate(plugin->pluginName().toUtf8(), paramType.displayName().toUtf8());
|
|
||||||
// if (!translated.isEmpty()) {
|
|
||||||
// paramType.setDisplayName(translated);
|
|
||||||
// }
|
|
||||||
// translatedEventParamTypes.append(paramType);
|
|
||||||
// }
|
|
||||||
// eventType.setParamTypes(translatedEventParamTypes);
|
|
||||||
// translatedEventTypes.append(eventType);
|
|
||||||
// }
|
|
||||||
// translatedDeviceClass.setEventTypes(translatedEventTypes);
|
|
||||||
|
|
||||||
// // StateTypes
|
|
||||||
// StateTypes translatedStateTypes;
|
|
||||||
// foreach (StateType stateType, deviceClass.stateTypes()) {
|
|
||||||
// QString translated = translator->translate(plugin->pluginName().toUtf8(), stateType.displayName().toUtf8());
|
|
||||||
// if (!translated.isEmpty()) {
|
|
||||||
// stateType.setDisplayName(translated);
|
|
||||||
// }
|
|
||||||
// translatedStateTypes.append(stateType);
|
|
||||||
// }
|
|
||||||
// translatedDeviceClass.setStateTypes(translatedStateTypes);
|
|
||||||
|
|
||||||
// // ActionTypes
|
|
||||||
// ActionTypes translatedActionTypes;
|
|
||||||
// foreach (ActionType actionType, deviceClass.actionTypes()) {
|
|
||||||
// QString translated = translator->translate(plugin->pluginName().toUtf8(), actionType.displayName().toUtf8());
|
|
||||||
// if (!translated.isEmpty()) {
|
|
||||||
// actionType.setDisplayName(translated);
|
|
||||||
// }
|
|
||||||
// ParamTypes translatedEventParamTypes;
|
|
||||||
// foreach (ParamType paramType, actionType.paramTypes()) {
|
|
||||||
// translated = translator->translate(plugin->pluginName().toUtf8(), paramType.displayName().toUtf8());
|
|
||||||
// if (!translated.isEmpty()) {
|
|
||||||
// paramType.setDisplayName(translated);
|
|
||||||
// }
|
|
||||||
// translatedEventParamTypes.append(paramType);
|
|
||||||
// }
|
|
||||||
// actionType.setParamTypes(translatedEventParamTypes);
|
|
||||||
// translatedActionTypes.append(actionType);
|
|
||||||
// }
|
|
||||||
// translatedDeviceClass.setActionTypes(translatedActionTypes);
|
|
||||||
// return translatedDeviceClass;
|
|
||||||
//}
|
|
||||||
|
|
||||||
QString Translator::translate(const PluginId &pluginId, const QString &string, const QLocale &locale)
|
QString Translator::translate(const PluginId &pluginId, const QString &string, const QLocale &locale)
|
||||||
{
|
{
|
||||||
DevicePlugin *plugin = m_deviceManager->plugin(pluginId);
|
DevicePlugin *plugin = m_deviceManager->plugin(pluginId);
|
||||||
|
|||||||
Reference in New Issue
Block a user