コード例 #1
0
void UploaderConfigWidget::loadSettings()
{
    qDebug() << "load uploder common settings";

    UploaderConfig config;
    QVariantMap loadValues;
    loadValues.insert("autoCopyDirectLink", QVariant(false));
    loadValues.insert(KEY_DEFAULT_HOST, "");
    loadValues = config.loadSettings("common", loadValues);

    QString defaultHost = loadValues[KEY_DEFAULT_HOST].toString();
    if (defaultHost.isEmpty() == true)
    {
        _ui->cbxDefaultHost->setCurrentIndex(0);
    }
    else
    {
        qint8 index = config.labelsList().indexOf(defaultHost);

        if (index == -1)
        {
            index++;
        }

        _ui->cbxDefaultHost->setCurrentIndex(index);
    }

    _ui->checkAutoCopyMainLink->setChecked(loadValues["autoCopyDirectLink"].toBool());
}
UploaderConfigWidget_MediaCrush::UploaderConfigWidget_MediaCrush(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::UploaderConfigWidget_MediaCrush)
{
    ui->setupUi(this);

    // load settings
    UploaderConfig config;

    QVariantMap loadedValues;
    loadedValues.insert(KEY_MCSH_URL, "");

    loadedValues = config.loadSettings("mediacru.sh", loadedValues);
    ui->editUrl->setText(loadedValues[KEY_MCSH_URL].toString());

}