Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
JuK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
JuK
Commits
9fb8b867
Commit
9fb8b867
authored
Feb 15, 2004
by
Frerich Raabe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Accept "." in the album, artist and title fields
svn path=/trunk/kdemultimedia/juk/; revision=288290
parent
d47bbc63
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
tagguesser.cpp
tagguesser.cpp
+9
-5
tagguessertest.cpp
tagguessertest.cpp
+2
-0
No files found.
tagguesser.cpp
View file @
9fb8b867
...
...
@@ -46,8 +46,12 @@ FileNameScheme::FileNameScheme(const QString &s)
bool
FileNameScheme
::
matches
(
const
QString
&
fileName
)
const
{
if
(
m_regExp
.
exactMatch
(
fileName
)
)
qDebug
(
"'%s' matches"
,
m_regExp
.
pattern
().
latin1
()
);
return
m_regExp
.
exactMatch
(
fileName
);
/* Strip extension ('.mp3') because '.' may be part of a title, and thus
* does not work as a separator.
*/
QString
stripped
=
fileName
;
stripped
.
truncate
(
stripped
.
findRev
(
'.'
));
return
m_regExp
.
exactMatch
(
stripped
);
}
QString
FileNameScheme
::
title
()
const
...
...
@@ -93,9 +97,9 @@ QString FileNameScheme::composeRegExp(const QString &s) const
{
KConfigGroupSaver
saver
(
cfg
,
"TagGuesser"
);
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
(
"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_]+)"
);
}
...
...
tagguessertest.cpp
View file @
9fb8b867
...
...
@@ -94,6 +94,8 @@ int main( int argc, char **argv )
"Block Rockin' Beats"
,
"Chemical Brothers"
,
"01"
,
QString
::
null
,
"Dig Your Own Hole"
);
check
(
QDir
::
homeDirPath
()
+
"/[01] Randy - Religion, religion.mp3"
,
"Religion, Religion"
,
"Randy"
,
"01"
,
QString
::
null
,
QString
::
null
);
check
(
QDir
::
homeDirPath
()
+
"/(3) Mr. Doe - Punk.mp3"
,
"Punk"
,
"Mr. Doe"
,
"3"
,
QString
::
null
,
QString
::
null
);
cout
<<
"All OK"
<<
endl
;
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment