Ejemplo n.º 1
0
void search_widget::save() const {
    model->save();
    Preferences pref;
    pref.beginGroup("SearchWidget");
    pref.setValue("CheckPlus", checkPlus->isChecked());
    pref.setValue("CheckOwn", checkOwn->isChecked());
    pref.setValue("CurrentTab", tabSearch->currentIndex());
    pref.setValue("SeachListHeader", treeResult->header()->saveState());

    pref.setValue("defValue", defValue->isChecked());
    pref.setValue("defKilos", defKilos->isChecked());
    pref.setValue("defMegas", defMegas->isChecked());

    pref.beginWriteArray("Tabs", tabSearch->count());

    for (int i = 0; i < tabSearch->count(); ++i) {
        pref.setArrayIndex(i);
        pref.setValue("Title", tabSearch->tabText(i));
        qDebug() << "save " << tabSearch->tabText(i);
    }

    pref.endArray();

    // save comboName
    pref.beginWriteArray("ComboNames", comboName->count());

    for(int index = 0; index < comboName->count(); ++index) {
        pref.setArrayIndex(index);
        pref.setValue("CName", comboName->itemText(index));
    }

    pref.endArray();
    pref.endGroup();
}
Ejemplo n.º 2
0
void messages_widget::save() const
{
    Preferences pref;
    pref.beginGroup("ED2KFriends");
    pref.beginWriteArray("Friends", friends.size());

    int i = 0;
    foreach(const USER& u, friends)
    {
        pref.setArrayIndex(i);
        u.save(pref);
        ++i;
    }