Skip to content

Commit

Permalink
[datareader.cpp] Improve comments & break long code line in two
Browse files Browse the repository at this point in the history
  • Loading branch information
Olf0 authored Mar 12, 2024
1 parent 3973296 commit 7d251e0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/datareader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,17 @@ void DataReader::readFile(QString file)
QDirIterator iterator(info.dir().path(), QDirIterator::Subdirectories);
while (iterator.hasNext()) {
iterator.next();
// we are explicit about two common factors, the suffix .jpeg (ToDo: add .jpg and .png
// throughout all C++ source code files), and basename cover or folder
// we are explicit about two common factors, the suffix `jpeg` (ToDo: add `jpg` and `png`
// throughout all C++ source files), and basename cover or folder
if (iterator.fileInfo().isFile()) {
if ( iterator.fileInfo().suffix() == "jpeg" &&
// (… || iterator.fileInfo().suffix() == "jpg" || iterator.fileInfo().suffix() == "png") &&
// See ToDo above: (… || iterator.fileInfo().suffix() == "jpg" || iterator.fileInfo().suffix() == "png") &&
(iterator.fileInfo().baseName() == "cover" ||
iterator.fileInfo().baseName() == "folder")
)
{
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/media-art/album-"+ doubleHash(m_artist, m_album) + iterator.fileInfo().suffix();
QString th2 = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + \
"/media-art/album-" + doubleHash(m_artist, m_album) + iterator.fileInfo().suffix();
qDebug() << "PROCESSING FILE: " << iterator.filePath() ;
QFile::copy(iterator.filePath(), th2);
}
Expand Down

0 comments on commit 7d251e0

Please sign in to comment.