/** Save the application mPrefs. */ void kweather::savePrefs(){ kdDebug(12004) << "Saving Prefs..." << endl; TDEConfig *kcConfig = config(); kcConfig->setGroup("General Options"); kcConfig->writeEntry("logging", logOn); kcConfig->writeEntry("report_location", reportLocation); kcConfig->writeEntry("smallview_mode", mViewMode); kcConfig->writePathEntry("log_file_name", fileName ); kcConfig->sync(); }
//******************************************************* // Static utility functions //******************************************************* static void save_pattern(TQComboBox *obj, const TQString & group, const TQString & entry) { // TQComboBox allows insertion of items more than specified by // maxCount() (QT bug?). This API call will truncate list if needed. obj->setMaxCount(15); // make sure the current item is saved first so it will be the // default when started next time TQStringList sl; TQString cur = obj->currentText(); sl.append(cur); for (int i = 0; i < obj->count(); i++) { if( cur != obj->text(i) ) { sl.append(obj->text(i)); } } TDEConfig *conf = TDEGlobal::config(); conf->setGroup(group); conf->writePathEntry(entry, sl); }