Exemplo n.º 1
0
void InspectorClientQt::storeSetting(const String& key, const InspectorController::Setting& setting)
{
    QSettings qsettings;
    if (qsettings.status() == QSettings::AccessError) {
        qWarning("QWebInspector: QSettings couldn't persist configuration setting [%s].",
                 qPrintable(static_cast<QString>(key)));
        return;
    }

    QVariant valueToStore = settingToVariant(setting);
    QString settingKey(settingStoragePrefix + key);
    qsettings.setValue(settingKey, valueToStore);
    qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
}
Exemplo n.º 2
0
void InspectorClientQt::storeSetting(const String& key, const String& setting)
{
#ifdef QT_NO_SETTINGS
    Q_UNUSED(key)
    Q_UNUSED(setting)
    qWarning("QWebInspector: QSettings is not supported by Qt.");
#else
    QSettings qsettings;
    if (qsettings.status() == QSettings::AccessError) {
        qWarning("QWebInspector: QSettings couldn't persist configuration setting [%s].",
                 qPrintable(static_cast<QString>(key)));
        return;
    }

    QVariant valueToStore = settingToVariant(setting);
    QString settingKey(settingStoragePrefix + QString(key));
    qsettings.setValue(settingKey, valueToStore);
    qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
#endif // QT_NO_SETTINGS
}