Move lyrics providers to own thread

This commit is contained in:
Jonas Kvinge
2024-08-24 20:07:36 +02:00
parent 77e934beab
commit 2c0ad2fc88
26 changed files with 182 additions and 92 deletions

View File

@@ -17,7 +17,8 @@
*
*/
#include <QObject>
#include <QApplication>
#include <QThread>
#include <QString>
#include <QUrl>
#include <QRegularExpression>
@@ -45,6 +46,8 @@ QUrl SongLyricsComLyricsProvider::Url(const LyricsSearchRequest &request) {
QString SongLyricsComLyricsProvider::StringFixup(QString text) {
Q_ASSERT(QThread::currentThread() != qApp->thread());
static const QRegularExpression regex_illegal_characters(QStringLiteral("[^\\w0-9\\- ]"));
static const QRegularExpression regex_multiple_whitespaces(QStringLiteral(" {2,}"));
static const QRegularExpression regex_multiple_dashes(QStringLiteral("(-)\\1+"));