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
74f7f010
Commit
74f7f010
authored
Mar 09, 2002
by
Scott Wheeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added GenreList::findIndex() and fixed TaggerWidget::genreBox to use it.
svn path=/trunk/kdemultimedia/juk/; revision=141942
parent
594de930
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
3 deletions
+33
-3
genrelist.cpp
genrelist.cpp
+26
-1
genrelist.h
genrelist.h
+1
-1
taggerwidget.cpp
taggerwidget.cpp
+6
-1
No files found.
genrelist.cpp
View file @
74f7f010
...
...
@@ -60,6 +60,32 @@ QString GenreList::name(int id3v1)
return
(
QString
::
null
);
}
int
GenreList
::
findIndex
(
QString
item
)
{
// cache the previous search -- since there are a lot of "two in a row"
// searchs this should optimize things a little
static
QString
lastItem
;
static
int
lastIndex
;
if
(
!
lastItem
.
isEmpty
()
&&
lastItem
==
item
)
{
// kdDebug() << "GenreList::findIndex() -- cache hit" << endl;
return
(
lastIndex
);
}
int
i
=
0
;
for
(
GenreList
::
Iterator
it
=
begin
();
it
!=
end
();
++
it
)
{
if
(
item
==
(
*
it
))
{
lastItem
=
item
;
lastIndex
=
i
;
return
(
i
);
}
i
++
;
}
return
(
-
1
);
}
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////
...
...
@@ -75,7 +101,6 @@ void GenreList::initializeIndex()
// kdDebug() << "initializeIndex() - " << (*it).getId3v1() << " - "
// << index.size() << " - " << count() << " - " << (*it) << endl;
index
[(
*
it
).
getId3v1
()]
=
QString
(
*
it
);
// kdDebug() << "id3v1 #" << (*it).getId3v1() << ", Size: " << index.size() << endl;
}
}
}
genrelist.h
View file @
74f7f010
...
...
@@ -32,8 +32,8 @@ public:
~
GenreList
();
void
load
(
QString
file
);
QString
name
(
int
id3v1
);
int
findIndex
(
QString
item
);
private:
QValueVector
<
QString
>
index
;
...
...
taggerwidget.cpp
View file @
74f7f010
...
...
@@ -210,7 +210,12 @@ void TaggerWidget::updateBoxes(FileListItem *item)
artistNameBox
->
setEditText
(
tag
->
getArtist
());
trackNameBox
->
setText
(
tag
->
getTrack
());
albumNameBox
->
setEditText
(
tag
->
getAlbum
());
genreBox
->
setCurrentItem
(
tag
->
getGenreNumber
()
+
1
);
if
(
genreList
&&
genreList
->
findIndex
(
tag
->
getGenre
())
>=
0
)
genreBox
->
setCurrentItem
(
genreList
->
findIndex
(
tag
->
getGenre
())
+
1
);
else
genreBox
->
setCurrentItem
(
0
);
fileNameBox
->
setText
(
fileInfo
->
fileName
());
trackSpin
->
setValue
(
tag
->
getTrackNumber
());
yearSpin
->
setValue
(
tag
->
getYear
());
...
...
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