Initial import.
6 /////////////////////////////////////////////////////////////////
8 /////////////////////////////////////////////////////////////////
18 void Settings::clear()
25 void Settings::clearLocal(const QString &s)
27 QStringList::Iterator itp=pathlist.begin();
28 QStringList::Iterator itk=keylist.begin();
29 QStringList::Iterator itv=valuelist.begin();
31 while (itp !=pathlist.end() )
33 if ((*itk).startsWith (s))
35 itp=pathlist.remove (itp);
36 itk=keylist.remove (itk);
37 itv=valuelist.remove (itv);
47 QString Settings::readLocalEntry ( const QString &fpath, const QString & key, const QString & def = QString::null )
49 QStringList::Iterator itp=pathlist.begin();
50 QStringList::Iterator itk=keylist.begin();
51 QStringList::Iterator itv=valuelist.begin();
53 // First search for value in settings saved in map
54 while (itp !=pathlist.end() )
56 if (*itp == fpath && *itk == key)
63 // Fall back to global vym settings
65 return readEntry (key,def, &ok);
68 void Settings::setLocalEntry (const QString &fpath, const QString &key, const QString &value)
70 QStringList::Iterator itp=pathlist.begin();
71 QStringList::Iterator itk=keylist.begin();
72 QStringList::Iterator itv=valuelist.begin();
74 if (!fpath.isEmpty() && !key.isEmpty() && !value.isEmpty() )
76 // Search for existing entry first
77 while (itp !=pathlist.end() )
79 if (*itp == fpath && *itk == key)
89 // If no entry exists, append a new one
90 pathlist.append (fpath);
92 valuelist.append (value);
96 QString Settings::getXMLData (const QString &fpath)
99 QStringList::Iterator itp=pathlist.begin();
100 QStringList::Iterator itk=keylist.begin();
101 QStringList::Iterator itv=valuelist.begin();
103 while (itp !=pathlist.end() )
106 if (!(*itv).isEmpty())
109 attribut ("key",*itk)
110 +attribut ("value",*itv)
119 void Settings::write()
121 QStringList::Iterator itp=pathlist.begin();
122 QStringList::Iterator itk=keylist.begin();
123 QStringList::Iterator itv=valuelist.begin();
125 while (itp !=pathlist.end() )