Commit b4b089f1 authored by Scott Wheeler's avatar Scott Wheeler

Use KConfigGroupSaver

svn path=/trunk/kdemultimedia/juk/; revision=214958
parent 6d969076
......@@ -437,7 +437,7 @@ void PlaylistSplitter::readConfig()
// the last column is just a filler
m_visibleColumns.resize(m_collection->columns() - 1, true);
QValueList<int> l = config->readIntListEntry("VisibleColumns");
m_collection->setSorting( config->readNumEntry("SortColumn", 1) );
m_collection->setSorting(config->readNumEntry("SortColumn", 1));
uint i = 0;
for(QValueList<int>::Iterator it = l.begin(); it != l.end(); ++it) {
......
......@@ -91,15 +91,18 @@ QString FileNameScheme::comment() const
QString FileNameScheme::composeRegExp(const QString &s) const
{
QMap<QChar, QString> substitutions;
KConfig *cfg = kapp->config();
cfg->setGroup("Tag guesser");
{
KConfigGroupSaver(cfg, "TagGuesser");
QMap<QChar, QString> substitutions;
substitutions[ 't' ] = cfg->readEntry("Title regexp", "([\\w\\s']+)");
substitutions[ 'a' ] = cfg->readEntry("Artist regexp", "([\\w\\s]+)");
substitutions[ 'A' ] = cfg->readEntry("Album regexp", "([\\w\\s]+)");
substitutions[ 'T' ] = cfg->readEntry("Track regexp", "(\\d+)");
substitutions[ 'c' ] = cfg->readEntry("Comment regexp", "([\\w\\s]+)");
substitutions[ 't' ] = cfg->readEntry("Title regexp", "([\\w\\s']+)");
substitutions[ 'a' ] = cfg->readEntry("Artist regexp", "([\\w\\s]+)");
substitutions[ 'A' ] = cfg->readEntry("Album regexp", "([\\w\\s]+)");
substitutions[ 'T' ] = cfg->readEntry("Track regexp", "(\\d+)");
substitutions[ 'c' ] = cfg->readEntry("Comment regexp", "([\\w\\s]+)");
}
QString regExp = QRegExp::escape(s.simplifyWhiteSpace());
regExp = ".*" + regExp;
......@@ -118,9 +121,13 @@ QString FileNameScheme::composeRegExp(const QString &s) const
QStringList TagGuesser::schemeStrings()
{
QStringList schemes;
KConfig *cfg = kapp->config();
cfg->setGroup("Tag guesser");
QStringList schemes = cfg->readListEntry( "Filename schemes" );
{
KConfigGroupSaver(cfg, "TagGuesser");
schemes = cfg->readListEntry( "Filename schemes" );
}
if ( schemes.isEmpty() ) {
schemes += "%a/%A/[%T] %t";
schemes += "%a - (%T) - %t [%c]";
......@@ -154,8 +161,10 @@ QStringList TagGuesser::schemeStrings()
void TagGuesser::setSchemeStrings(const QStringList &schemes)
{
KConfig *cfg = kapp->config();
cfg->setGroup("Tag guesser");
cfg->writeEntry("Filename schemes", schemes);
{
KConfigGroupSaver(cfg, "TagGuesser");
cfg->writeEntry("Filename schemes", schemes);
}
cfg->sync();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment