TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicconnecttransferthread.cpp
Go to the documentation of this file.
2 
3 #include <QFileInfo>
4 
6  : TTKAbstractThread(parent)
7 {
8 
9 }
10 
11 void MusicConnectTransferThread::setFilePath(const QString &target, const QStringList &path)
12 {
13  m_target = target;
14  m_path << path;
15 }
16 
18 {
19  for(const QString &path : qAsConst(m_path))
20  {
21  if(m_running && !m_target.isEmpty())
22  {
23  const QString &targetPath = QString("%1%2").arg(m_target, QFileInfo(path).fileName());
24  QFile::copy(path, targetPath);
25  Q_EMIT transferFileFinished(targetPath);
26  }
27  }
28 }
virtual void run() overridefinal
void transferFileFinished(const QString &name)
MusicConnectTransferThread(QObject *parent=nullptr)
#define qAsConst
Definition: ttkqtglobal.h:53
The class of the ttk abstract thread.
void setFilePath(const QString &target, const QStringList &path)