void recurseNKRecord(NKRecord::NKRecordPtr nkRecord, const std::wstring& prefix) { printNKRecord(nkRecord, prefix); NKRecord::AutoNKRecordPtrList subkeyList(nkRecord->getSubkeyList()->getSubkeys()); NKRecord::NKRecordPtrList::iterator it = subkeyList.begin(); for (; it != subkeyList.end(); ++it) { std::wcout << prefix << " key: " << (*it)->getName() << std::endl; recurseNKRecord((*it), L" " + prefix); } }
void dvbcut_settings::save_settings() { setValue("/version", 2); // latest config version beginGroup("/wheel"); setValue("/incr_normal", wheel_increments[WHEEL_INCR_NORMAL]); setValue("/incr_shift", wheel_increments[WHEEL_INCR_SHIFT]); setValue("/incr_ctrl", wheel_increments[WHEEL_INCR_CTRL]); setValue("/incr_alt", wheel_increments[WHEEL_INCR_ALT]); setValue("/threshold", wheel_threshold); setValue("/delta", wheel_delta); endGroup(); // wheel beginGroup("/slider"); setValue("/jog_maximum", jog_maximum); setValue("/jog_threshold", jog_threshold); setValue("/jog_offset", jog_offset); setValue("/jog_interval", jog_interval); setValue("/lin_interval", lin_interval); endGroup(); // slider beginGroup("/lastdir"); setValue("/name", lastdir); setValue("/update", lastdir_update); endGroup(); // lastdir beginGroup("/filter"); setValue("/idxfilter", idxfilter); setValue("/prjfilter", prjfilter); setValue("/loadfilter", loadfilter); endGroup(); // filter beginGroup("/viewscalefactor"); setValue("/current", viewscalefactor); setValue("/custom", viewscalefactor_custom); endGroup(); // viewscalefactor setValue("/export_format", export_format); beginGroup("/recentfiles"); // first remove any OLD recentfiles entries to clean the settings file (<revision 108)!!! QStringList keys = entryList("/"); for ( QStringList::Iterator it = keys.begin(); it != keys.end(); ++it ) remove("/" + *it); // then remove ALL new recentfiles entries!!! // (otherwise it would be a mess with erased&inserted muliple file entries of different size) QStringList subkeys = subkeyList("/"); for ( QStringList::Iterator its = subkeys.begin(); its != subkeys.end(); ++its ) { QStringList keys = entryList("/" + *its); for ( QStringList::Iterator itk = keys.begin(); itk != keys.end(); ++itk ) remove("/" + *its + "/" + *itk); } setValue("/max", int(recentfiles_max)); // and NOW write the updated list from scratch!!! for (unsigned int i = 0; i < recentfiles.size(); ++i) { QString key = "/" + QString::number(i); beginGroup(key); int j=0; for(std::list<std::string>::iterator it=settings().recentfiles[i].first.begin(); it!=settings().recentfiles[i].first.end(); it++, j++) setValue("/" + QString::number(j), QString::fromStdString(*it)); setValue("/idx", QString::fromStdString(recentfiles[i].second)); endGroup(); // key } endGroup(); // recentfiles beginGroup("/labels"); setValue("/start", start_label); setValue("/stop", stop_label); setValue("/chapter", chapter_label); setValue("/bookmark", bookmark_label); endGroup(); // labels setValue("/start_bof", start_bof); setValue("/stop_eof", stop_eof); beginGroup("/snapshots"); setValue("/type", snapshot_type); setValue("/quality", snapshot_quality); setValue("/prefix", snapshot_prefix); setValue("/delimiter", snapshot_delimiter); setValue("/first", snapshot_first); setValue("/width", snapshot_width); setValue("/extension", snapshot_extension); setValue("/range", snapshot_range); setValue("/samples", snapshot_samples); endGroup(); // snapshots beginGroup("/pipe"); for (unsigned int i = 0; i < pipe_command.size(); ++i) { QString key = "/" + QString::number(i); beginGroup(key); setValue("/command", pipe_command[i]); setValue("/post", pipe_post[i]); setValue("/label", pipe_label[i]); setValue("/format", pipe_format[i]); endGroup(); // key } endGroup(); // pipe beginGroup("/chapters"); setValue("/interval", chapter_interval); setValue("/tolerance", chapter_tolerance); setValue("/threshold", chapter_threshold); setValue("/minimum", chapter_minimum); endGroup(); // auto chapters }