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
Vvave
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
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
Maui
Vvave
Commits
2a3507a6
Commit
2a3507a6
authored
Jun 25, 2019
by
camilo higuita
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start using std algorithms
parent
ad2354dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
22 deletions
+23
-22
models/albums/albumsmodel.cpp
models/albums/albumsmodel.cpp
+2
-2
settings/fileloader.h
settings/fileloader.h
+21
-17
widgets/SearchView/SearchTable.qml
widgets/SearchView/SearchTable.qml
+0
-3
No files found.
models/albums/albumsmodel.cpp
View file @
2a3507a6
...
...
@@ -201,13 +201,13 @@ void AlbumsModel::fetchInformation()
for
(
const
auto
&
req
:
requests
)
{
pulpo
.
request
(
req
);
loop
.
exec
();
if
(
stop
)
{
loop
.
quit
();
return
;
}
pulpo
.
request
(
req
);
loop
.
exec
();
}
};
...
...
settings/fileloader.h
View file @
2a3507a6
...
...
@@ -10,29 +10,33 @@
namespace
FLoader
{
inline
QStringList
getPathContents
(
QStringList
urls
,
QString
path
)
{
if
(
!
FMH
::
fileExists
(
path
))
return
urls
;
if
(
QFileInfo
(
path
).
isDir
())
{
QDirIterator
it
(
path
,
QStringList
()
<<
FMH
::
FILTER_LIST
[
FMH
::
FILTER_TYPE
::
AUDIO
]
<<
"*.m4a"
,
QDir
::
Files
,
QDirIterator
::
Subdirectories
);
while
(
it
.
hasNext
())
urls
<<
it
.
next
();
}
else
if
(
QFileInfo
(
path
).
isFile
())
urls
<<
path
;
return
urls
;
}
// returns the number of new items added to the collection db
inline
uint
getTracks
(
const
QStringList
&
paths
)
{
QStringList
urls
;
auto
db
=
CollectionDB
::
getInstance
();
const
auto
urls
=
std
::
accumulate
(
paths
.
begin
(),
paths
.
end
(),
QStringList
(),
getPathContents
);
for
(
const
auto
&
path
:
paths
)
{
if
(
!
FMH
::
fileExists
(
path
))
continue
;
if
(
QFileInfo
(
path
).
isDir
())
{
if
(
FMH
::
fileExists
(
path
))
db
->
addFolder
(
path
);
QDirIterator
it
(
path
,
QStringList
()
<<
FMH
::
FILTER_LIST
[
FMH
::
FILTER_TYPE
::
AUDIO
]
<<
"*.m4a"
,
QDir
::
Files
,
QDirIterator
::
Subdirectories
);
while
(
it
.
hasNext
())
urls
<<
it
.
next
();
}
else
if
(
QFileInfo
(
path
).
isFile
())
urls
<<
path
;
}
uint
newTracks
=
0
;
...
...
@@ -40,7 +44,7 @@ inline uint getTracks(const QStringList& paths)
return
newTracks
;
TagInfo
info
;
for
(
auto
url
:
urls
)
for
(
const
auto
&
url
:
urls
)
{
if
(
db
->
check_existance
(
BAE
::
TABLEMAP
[
BAE
::
TABLE
::
TRACKS
],
FMH
::
MODEL_NAME
[
FMH
::
MODEL_KEY
::
URL
],
url
))
continue
;
...
...
widgets/SearchView/SearchTable.qml
View file @
2a3507a6
...
...
@@ -20,9 +20,6 @@ BabeTable
// property bool autoSuggestions : bae.loadSetting("AUTOSUGGESTIONS", "BABE", false) === "true" ? true : false
property
bool
autoSuggestions
:
false
Layout.fillHeight
:
true
Layout.fillWidth
:
true
trackNumberVisible
:
false
headBar.visible
:
true
headBarExit
:
true
...
...
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