Commit 8af6b8f8 authored by Frerich Raabe's avatar Frerich Raabe

- Don't hardcode the regular expressions used for the macros but read them

  from the configuration file. I'm not sure you want this configurable as
  well (and if so, probably via some "Advanced..." button in the tag guesser
  configuration dialog) so there won't be a GUI for now. Really desperate
  people can now hand-edit the config files though, and this should ensure
  JuK a place in the "KDE Nuts'n'Bolts" magazine.

svn path=/trunk/kdemultimedia/juk/; revision=214256
parent ba0674dc
......@@ -91,12 +91,15 @@ QString FileNameScheme::comment() const
QString FileNameScheme::composeRegExp(const QString &s) const
{
KConfig *cfg;
cfg->setGroup("Tag guesser");
QMap<QChar, QString> substitutions;
substitutions[ 't' ] = "([\\w\\s']+)";
substitutions[ 'a' ] = "([\\w\\s]+)";
substitutions[ 'A' ] = "([\\w\\s]+)";
substitutions[ 'T' ] = "(\\d+)";
substitutions[ 'c' ] = "([\\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;
......
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