Connection syntax migration (#637)
This commit is contained in:
parent
d57f6303f4
commit
bf7c8df353
@ -48,8 +48,8 @@ ObjectHelper* ClosureBase::helper() const {
|
|||||||
|
|
||||||
ObjectHelper::ObjectHelper(QObject *sender, const char *signal, ClosureBase *closure) : closure_(closure) {
|
ObjectHelper::ObjectHelper(QObject *sender, const char *signal, ClosureBase *closure) : closure_(closure) {
|
||||||
|
|
||||||
connect(sender, signal, SLOT(Invoked()));
|
QObject::connect(sender, signal, SLOT(Invoked()));
|
||||||
connect(sender, SIGNAL(destroyed()), SLOT(deleteLater()));
|
QObject::connect(sender, &QObject::destroyed, this, &ObjectHelper::deleteLater);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ class Closure : public ClosureBase {
|
|||||||
const int index = meta_receiver->indexOfSlot(normalised_slot.constData());
|
const int index = meta_receiver->indexOfSlot(normalised_slot.constData());
|
||||||
Q_ASSERT(index != -1);
|
Q_ASSERT(index != -1);
|
||||||
slot_ = meta_receiver->method(index);
|
slot_ = meta_receiver->method(index);
|
||||||
QObject::connect(receiver_, SIGNAL(destroyed()), helper_, SLOT(deleteLater()));
|
QObject::connect(receiver_, &QObject::destroyed, helper_, &QObject::deleteLater);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Invoke() override {
|
void Invoke() override {
|
||||||
@ -207,7 +207,7 @@ template <typename T, typename... Args>
|
|||||||
_detail::ClosureBase *NewClosure(QFuture<T> future, QObject *receiver, const char *slot, const Args&... args) {
|
_detail::ClosureBase *NewClosure(QFuture<T> future, QObject *receiver, const char *slot, const Args&... args) {
|
||||||
QFutureWatcher<T> *watcher = new QFutureWatcher<T>;
|
QFutureWatcher<T> *watcher = new QFutureWatcher<T>;
|
||||||
watcher->setFuture(future);
|
watcher->setFuture(future);
|
||||||
QObject::connect(watcher, SIGNAL(finished()), watcher, SLOT(deleteLater()));
|
QObject::connect(watcher, &QFutureWatcher<T>::finished, watcher, &QFutureWatcher<T>::deleteLater);
|
||||||
return NewClosure(watcher, SIGNAL(finished()), receiver, slot, args...);
|
return NewClosure(watcher, SIGNAL(finished()), receiver, slot, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ template <typename T, typename F, typename... Args>
|
|||||||
_detail::ClosureBase *NewClosure(QFuture<T> future, const F &callback, const Args&... args) {
|
_detail::ClosureBase *NewClosure(QFuture<T> future, const F &callback, const Args&... args) {
|
||||||
QFutureWatcher<T> *watcher = new QFutureWatcher<T>;
|
QFutureWatcher<T> *watcher = new QFutureWatcher<T>;
|
||||||
watcher->setFuture(future);
|
watcher->setFuture(future);
|
||||||
QObject::connect(watcher, SIGNAL(finished()), watcher, SLOT(deleteLater()));
|
QObject::connect(watcher, &QFutureWatcher<T>::finished, watcher, &QFutureWatcher<T>::deleteLater);
|
||||||
return NewClosure(watcher, SIGNAL(finished()), callback, args...);
|
return NewClosure(watcher, SIGNAL(finished()), callback, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ void DoAfter(std::function<void()> callback, std::chrono::duration<R, P> duratio
|
|||||||
QTimer *timer = new QTimer;
|
QTimer *timer = new QTimer;
|
||||||
timer->setSingleShot(true);
|
timer->setSingleShot(true);
|
||||||
NewClosure(timer, SIGNAL(timeout()), callback);
|
NewClosure(timer, SIGNAL(timeout()), callback);
|
||||||
QObject::connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
|
QObject::connect(timer, &QTimer::timeout, timer, &QTimer::deleteLater);
|
||||||
std::chrono::milliseconds msec = std::chrono::duration_cast<std::chrono::milliseconds>(duration);
|
std::chrono::milliseconds msec = std::chrono::duration_cast<std::chrono::milliseconds>(duration);
|
||||||
timer->start(msec.count());
|
timer->start(msec.count());
|
||||||
}
|
}
|
||||||
|
@ -44,16 +44,16 @@ void _MessageHandlerBase::SetDevice(QIODevice *device) {
|
|||||||
|
|
||||||
buffer_.open(QIODevice::ReadWrite);
|
buffer_.open(QIODevice::ReadWrite);
|
||||||
|
|
||||||
connect(device, SIGNAL(readyRead()), SLOT(DeviceReadyRead()));
|
QObject::connect(device, &QIODevice::readyRead, this, &_MessageHandlerBase::DeviceReadyRead);
|
||||||
|
|
||||||
// Yeah I know.
|
// Yeah I know.
|
||||||
if (QAbstractSocket *abstractsocket = qobject_cast<QAbstractSocket*>(device)) {
|
if (QAbstractSocket *abstractsocket = qobject_cast<QAbstractSocket*>(device)) {
|
||||||
flush_abstract_socket_ = &QAbstractSocket::flush;
|
flush_abstract_socket_ = &QAbstractSocket::flush;
|
||||||
connect(abstractsocket, SIGNAL(disconnected()), SLOT(DeviceClosed()));
|
QObject::connect(abstractsocket, &QAbstractSocket::disconnected, this, &_MessageHandlerBase::DeviceClosed);
|
||||||
}
|
}
|
||||||
else if (QLocalSocket *localsocket = qobject_cast<QLocalSocket*>(device)) {
|
else if (QLocalSocket *localsocket = qobject_cast<QLocalSocket*>(device)) {
|
||||||
flush_local_socket_ = &QLocalSocket::flush;
|
flush_local_socket_ = &QLocalSocket::flush;
|
||||||
connect(localsocket, SIGNAL(disconnected()), SLOT(DeviceClosed()));
|
QObject::connect(localsocket, &QLocalSocket::disconnected, this, &_MessageHandlerBase::DeviceClosed);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qFatal("Unsupported device type passed to _MessageHandlerBase");
|
qFatal("Unsupported device type passed to _MessageHandlerBase");
|
||||||
|
@ -173,7 +173,7 @@ WorkerPool<HandlerType>::~WorkerPool() {
|
|||||||
|
|
||||||
for (const Worker &worker : workers_) {
|
for (const Worker &worker : workers_) {
|
||||||
if (worker.local_socket_ && worker.process_) {
|
if (worker.local_socket_ && worker.process_) {
|
||||||
disconnect(worker.process_, SIGNAL(errorOccurred(QProcess::ProcessError)), this, SLOT(ProcessError(QProcess::ProcessError)));
|
QObject::disconnect(worker.process_, &QProcess::errorOccurred, this, &WorkerPool::ProcessError);
|
||||||
|
|
||||||
// The worker is connected. Close his socket and wait for him to exit.
|
// The worker is connected. Close his socket and wait for him to exit.
|
||||||
qLog(Debug) << "Closing worker socket";
|
qLog(Debug) << "Closing worker socket";
|
||||||
@ -272,8 +272,8 @@ void WorkerPool<HandlerType>::StartOneWorker(Worker *worker) {
|
|||||||
worker->local_server_ = new QLocalServer(this);
|
worker->local_server_ = new QLocalServer(this);
|
||||||
worker->process_ = new QProcess(this);
|
worker->process_ = new QProcess(this);
|
||||||
|
|
||||||
connect(worker->local_server_, SIGNAL(newConnection()), SLOT(NewConnection()));
|
QObject::connect(worker->local_server_, &QLocalServer::newConnection, this, &WorkerPool::NewConnection);
|
||||||
connect(worker->process_, SIGNAL(errorOccurred(QProcess::ProcessError)), SLOT(ProcessError(QProcess::ProcessError)));
|
QObject::connect(worker->process_, &QProcess::errorOccurred, this, &WorkerPool::ProcessError);
|
||||||
|
|
||||||
// Create a server, find an unused name and start listening
|
// Create a server, find an unused name and start listening
|
||||||
forever {
|
forever {
|
||||||
|
@ -83,7 +83,7 @@ AnalyzerContainer::AnalyzerContainer(QWidget *parent)
|
|||||||
AddAnalyzerType<Rainbow::NyanCatAnalyzer>();
|
AddAnalyzerType<Rainbow::NyanCatAnalyzer>();
|
||||||
AddAnalyzerType<Rainbow::RainbowDashAnalyzer>();
|
AddAnalyzerType<Rainbow::RainbowDashAnalyzer>();
|
||||||
|
|
||||||
disable_action_ = context_menu_->addAction(tr("No analyzer"), this, SLOT(DisableAnalyzer()));
|
disable_action_ = context_menu_->addAction(tr("No analyzer"), this, &AnalyzerContainer::DisableAnalyzer);
|
||||||
disable_action_->setCheckable(true);
|
disable_action_->setCheckable(true);
|
||||||
group_->addAction(disable_action_);
|
group_->addAction(disable_action_);
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ AnalyzerContainer::AnalyzerContainer(QWidget *parent)
|
|||||||
|
|
||||||
double_click_timer_->setSingleShot(true);
|
double_click_timer_->setSingleShot(true);
|
||||||
double_click_timer_->setInterval(250);
|
double_click_timer_->setInterval(250);
|
||||||
connect(double_click_timer_, SIGNAL(timeout()), SLOT(ShowPopupMenu()));
|
QObject::connect(double_click_timer_, &QTimer::timeout, this, &AnalyzerContainer::ShowPopupMenu);
|
||||||
|
|
||||||
Load();
|
Load();
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ void AnalyzerContainer::DisableAnalyzer() {
|
|||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerContainer::ChangeAnalyzer(int id) {
|
void AnalyzerContainer::ChangeAnalyzer(const int id) {
|
||||||
|
|
||||||
QObject *instance = analyzer_types_[id]->newInstance(Q_ARG(QWidget*, this));
|
QObject *instance = analyzer_types_[id]->newInstance(Q_ARG(QWidget*, this));
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ void AnalyzerContainer::Load() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerContainer::SaveFramerate(int framerate) {
|
void AnalyzerContainer::SaveFramerate(const int framerate) {
|
||||||
|
|
||||||
// For now, framerate is common for all analyzers. Maybe each analyzer should have its own framerate?
|
// For now, framerate is common for all analyzers. Maybe each analyzer should have its own framerate?
|
||||||
current_framerate_ = framerate;
|
current_framerate_ = framerate;
|
||||||
@ -221,12 +221,12 @@ void AnalyzerContainer::Save() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerContainer::AddFramerate(const QString& name, int framerate) {
|
void AnalyzerContainer::AddFramerate(const QString& name, const int framerate) {
|
||||||
|
|
||||||
QAction *action = context_menu_framerate_->addAction(name);
|
QAction *action = context_menu_framerate_->addAction(name);
|
||||||
group_framerate_->addAction(action);
|
group_framerate_->addAction(action);
|
||||||
framerate_list_ << framerate;
|
framerate_list_ << framerate;
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
connect(action, &QAction::triggered, [this, framerate]() { ChangeFramerate(framerate); } );
|
QObject::connect(action, &QAction::triggered, [this, framerate]() { ChangeFramerate(framerate); } );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ class AnalyzerContainer : public QWidget {
|
|||||||
void wheelEvent(QWheelEvent *e) override;
|
void wheelEvent(QWheelEvent *e) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ChangeAnalyzer(int id);
|
void ChangeAnalyzer(const int id);
|
||||||
void ChangeFramerate(int new_framerate);
|
void ChangeFramerate(int new_framerate);
|
||||||
void DisableAnalyzer();
|
void DisableAnalyzer();
|
||||||
void ShowPopupMenu();
|
void ShowPopupMenu();
|
||||||
@ -73,10 +73,10 @@ class AnalyzerContainer : public QWidget {
|
|||||||
|
|
||||||
void Load();
|
void Load();
|
||||||
void Save();
|
void Save();
|
||||||
void SaveFramerate(int framerate);
|
void SaveFramerate(const int framerate);
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void AddAnalyzerType();
|
void AddAnalyzerType();
|
||||||
void AddFramerate(const QString& name, int framerate);
|
void AddFramerate(const QString& name, const int framerate);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int current_framerate_; // fps
|
int current_framerate_; // fps
|
||||||
@ -109,7 +109,7 @@ void AnalyzerContainer::AddAnalyzerType() {
|
|||||||
group_->addAction(action);
|
group_->addAction(action);
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
actions_ << action;
|
actions_ << action;
|
||||||
connect(action, &QAction::triggered, [this, id]() { ChangeAnalyzer(id); } );
|
QObject::connect(action, &QAction::triggered, [this, id]() { ChangeAnalyzer(id); } );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,15 +44,15 @@ class BoomAnalyzer : public Analyzer::Base {
|
|||||||
|
|
||||||
static const char* kName;
|
static const char* kName;
|
||||||
|
|
||||||
void transform(Analyzer::Scope& s) override;
|
void transform(Analyzer::Scope &s) override;
|
||||||
void analyze(QPainter& p, const Analyzer::Scope&, bool new_frame) override;
|
void analyze(QPainter &p, const Analyzer::Scope&, bool new_frame) override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void changeK_barHeight(int);
|
void changeK_barHeight(int);
|
||||||
void changeF_peakSpeed(int);
|
void changeF_peakSpeed(int);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resizeEvent(QResizeEvent* e) override;
|
void resizeEvent(QResizeEvent *e) override;
|
||||||
|
|
||||||
static const uint kColumnWidth;
|
static const uint kColumnWidth;
|
||||||
static const uint kMaxBandCount;
|
static const uint kMaxBandCount;
|
||||||
|
@ -50,14 +50,14 @@ class RainbowAnalyzer : public Analyzer::Base {
|
|||||||
Dash = 1
|
Dash = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
RainbowAnalyzer(const RainbowType& rbtype, QWidget* parent);
|
RainbowAnalyzer(const RainbowType &rbtype, QWidget *parent);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void transform(Analyzer::Scope&) override;
|
void transform(Analyzer::Scope&) override;
|
||||||
void analyze(QPainter& p, const Analyzer::Scope&, bool new_frame) override;
|
void analyze(QPainter &p, const Analyzer::Scope&, bool new_frame) override;
|
||||||
|
|
||||||
void timerEvent(QTimerEvent* e) override;
|
void timerEvent(QTimerEvent *e) override;
|
||||||
void resizeEvent(QResizeEvent* e) override;
|
void resizeEvent(QResizeEvent *e) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int kHeight[];
|
static const int kHeight[];
|
||||||
|
@ -97,21 +97,19 @@ void SCollection::Init() {
|
|||||||
watcher_->set_backend(backend_);
|
watcher_->set_backend(backend_);
|
||||||
watcher_->set_task_manager(app_->task_manager());
|
watcher_->set_task_manager(app_->task_manager());
|
||||||
|
|
||||||
connect(backend_, SIGNAL(DirectoryDiscovered(Directory, SubdirectoryList)), watcher_, SLOT(AddDirectory(Directory, SubdirectoryList)));
|
QObject::connect(backend_, &CollectionBackend::DirectoryDiscovered, watcher_, &CollectionWatcher::AddDirectory);
|
||||||
connect(backend_, SIGNAL(DirectoryDeleted(Directory)), watcher_, SLOT(RemoveDirectory(Directory)));
|
QObject::connect(backend_, &CollectionBackend::DirectoryDeleted, watcher_, &CollectionWatcher::RemoveDirectory);
|
||||||
connect(watcher_, SIGNAL(NewOrUpdatedSongs(SongList)), backend_, SLOT(AddOrUpdateSongs(SongList)));
|
QObject::connect(watcher_, &CollectionWatcher::NewOrUpdatedSongs, backend_, &CollectionBackend::AddOrUpdateSongs);
|
||||||
connect(watcher_, SIGNAL(SongsMTimeUpdated(SongList)), backend_, SLOT(UpdateMTimesOnly(SongList)));
|
QObject::connect(watcher_, &CollectionWatcher::SongsMTimeUpdated, backend_, &CollectionBackend::UpdateMTimesOnly);
|
||||||
connect(watcher_, SIGNAL(SongsDeleted(SongList)), backend_, SLOT(DeleteSongs(SongList)));
|
QObject::connect(watcher_, &CollectionWatcher::SongsDeleted, backend_, &CollectionBackend::DeleteSongs);
|
||||||
connect(watcher_, SIGNAL(SongsUnavailable(SongList)), backend_, SLOT(MarkSongsUnavailable(SongList)));
|
QObject::connect(watcher_, &CollectionWatcher::SongsUnavailable, backend_, &CollectionBackend::MarkSongsUnavailable);
|
||||||
connect(watcher_, SIGNAL(SongsReadded(SongList, bool)), backend_, SLOT(MarkSongsUnavailable(SongList, bool)));
|
QObject::connect(watcher_, &CollectionWatcher::SongsReadded, backend_, &CollectionBackend::MarkSongsUnavailable);
|
||||||
connect(watcher_, SIGNAL(SubdirsDiscovered(SubdirectoryList)), backend_, SLOT(AddOrUpdateSubdirs(SubdirectoryList)));
|
QObject::connect(watcher_, &CollectionWatcher::SubdirsDiscovered, backend_, &CollectionBackend::AddOrUpdateSubdirs);
|
||||||
connect(watcher_, SIGNAL(SubdirsMTimeUpdated(SubdirectoryList)), backend_, SLOT(AddOrUpdateSubdirs(SubdirectoryList)));
|
QObject::connect(watcher_, &CollectionWatcher::SubdirsMTimeUpdated, backend_, &CollectionBackend::AddOrUpdateSubdirs);
|
||||||
connect(watcher_, SIGNAL(CompilationsNeedUpdating()), backend_, SLOT(UpdateCompilations()));
|
QObject::connect(watcher_, &CollectionWatcher::CompilationsNeedUpdating, backend_, &CollectionBackend::CompilationsNeedUpdating);
|
||||||
connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), SLOT(CurrentSongChanged(Song)));
|
|
||||||
connect(app_->player(), SIGNAL(Stopped()), SLOT(Stopped()));
|
|
||||||
|
|
||||||
connect(app_->lastfm_import(), SIGNAL(UpdateLastPlayed(QString, QString, QString, qint64)), backend_, SLOT(UpdateLastPlayed(QString, QString, QString, qint64)));
|
QObject::connect(app_->lastfm_import(), &LastFMImport::UpdateLastPlayed, backend_, &CollectionBackend::UpdateLastPlayed);
|
||||||
connect(app_->lastfm_import(), SIGNAL(UpdatePlayCount(QString, QString, int)), backend_, SLOT(UpdatePlayCount(QString, QString, int)));
|
QObject::connect(app_->lastfm_import(), &LastFMImport::UpdatePlayCount, backend_, &CollectionBackend::UpdatePlayCount);
|
||||||
|
|
||||||
// This will start the watcher checking for updates
|
// This will start the watcher checking for updates
|
||||||
backend_->LoadDirectoriesAsync();
|
backend_->LoadDirectoriesAsync();
|
||||||
@ -122,11 +120,11 @@ void SCollection::Exit() {
|
|||||||
|
|
||||||
wait_for_exit_ << backend_ << watcher_;
|
wait_for_exit_ << backend_ << watcher_;
|
||||||
|
|
||||||
disconnect(backend_, nullptr, watcher_, nullptr);
|
QObject::disconnect(backend_, nullptr, watcher_, nullptr);
|
||||||
disconnect(watcher_, nullptr, backend_, nullptr);
|
QObject::disconnect(watcher_, nullptr, backend_, nullptr);
|
||||||
|
|
||||||
connect(backend_, SIGNAL(ExitFinished()), this, SLOT(ExitReceived()));
|
QObject::connect(backend_, &CollectionBackend::ExitFinished, this, &SCollection::ExitReceived);
|
||||||
connect(watcher_, SIGNAL(ExitFinished()), this, SLOT(ExitReceived()));
|
QObject::connect(watcher_, &CollectionWatcher::ExitFinished, this, &SCollection::ExitReceived);
|
||||||
backend_->ExitAsync();
|
backend_->ExitAsync();
|
||||||
watcher_->ExitAsync();
|
watcher_->ExitAsync();
|
||||||
|
|
||||||
@ -135,7 +133,7 @@ void SCollection::Exit() {
|
|||||||
void SCollection::ExitReceived() {
|
void SCollection::ExitReceived() {
|
||||||
|
|
||||||
QObject *obj = qobject_cast<QObject*>(sender());
|
QObject *obj = qobject_cast<QObject*>(sender());
|
||||||
disconnect(obj, nullptr, this, nullptr);
|
QObject::disconnect(obj, nullptr, this, nullptr);
|
||||||
qLog(Debug) << obj << "successfully exited.";
|
qLog(Debug) << obj << "successfully exited.";
|
||||||
wait_for_exit_.removeAll(obj);
|
wait_for_exit_.removeAll(obj);
|
||||||
if (wait_for_exit_.isEmpty()) emit ExitFinished();
|
if (wait_for_exit_.isEmpty()) emit ExitFinished();
|
||||||
@ -165,20 +163,3 @@ void SCollection::ReloadSettings() {
|
|||||||
model_->ReloadSettings();
|
model_->ReloadSettings();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCollection::Stopped() {
|
|
||||||
|
|
||||||
CurrentSongChanged(Song());
|
|
||||||
}
|
|
||||||
|
|
||||||
void SCollection::CurrentSongChanged(const Song &song) { // FIXME
|
|
||||||
|
|
||||||
Q_UNUSED(song);
|
|
||||||
|
|
||||||
TagReaderReply *reply = nullptr;
|
|
||||||
|
|
||||||
if (reply) {
|
|
||||||
connect(reply, SIGNAL(Finished(bool)), reply, SLOT(deleteLater()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -73,13 +73,10 @@ class SCollection : public QObject {
|
|||||||
void AbortScan();
|
void AbortScan();
|
||||||
void Rescan(const SongList &songs);
|
void Rescan(const SongList &songs);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void ExitReceived();
|
|
||||||
|
|
||||||
void IncrementalScan();
|
void IncrementalScan();
|
||||||
|
|
||||||
void CurrentSongChanged(const Song &song);
|
private slots:
|
||||||
void Stopped();
|
void ExitReceived();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void ExitFinished();
|
void ExitFinished();
|
||||||
|
@ -902,7 +902,7 @@ Song::Source CollectionBackend::Source() const {
|
|||||||
return source_;
|
return source_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollectionBackend::UpdateCompilations() {
|
void CollectionBackend::CompilationsNeedUpdating() {
|
||||||
|
|
||||||
QMutexLocker l(db_->Mutex());
|
QMutexLocker l(db_->Mutex());
|
||||||
QSqlDatabase db(db_->Connect());
|
QSqlDatabase db(db_->Connect());
|
||||||
|
@ -204,7 +204,7 @@ class CollectionBackend : public CollectionBackendInterface {
|
|||||||
void DeleteSongs(const SongList &songs);
|
void DeleteSongs(const SongList &songs);
|
||||||
void MarkSongsUnavailable(const SongList &songs, const bool unavailable = true);
|
void MarkSongsUnavailable(const SongList &songs, const bool unavailable = true);
|
||||||
void AddOrUpdateSubdirs(const SubdirectoryList &subdirs);
|
void AddOrUpdateSubdirs(const SubdirectoryList &subdirs);
|
||||||
void UpdateCompilations();
|
void CompilationsNeedUpdating();
|
||||||
void UpdateManualAlbumArt(const QString &artist, const QString &albumartist, const QString &album, const QUrl &cover_url);
|
void UpdateManualAlbumArt(const QString &artist, const QString &albumartist, const QString &album, const QUrl &cover_url);
|
||||||
void ForceCompilation(const QString &album, const QList<QString> &artists, const bool on);
|
void ForceCompilation(const QString &album, const QList<QString> &artists, const bool on);
|
||||||
void IncrementPlayCount(const int id);
|
void IncrementPlayCount(const int id);
|
||||||
|
@ -37,11 +37,10 @@
|
|||||||
CollectionDirectoryModel::CollectionDirectoryModel(CollectionBackend *backend, QObject *parent)
|
CollectionDirectoryModel::CollectionDirectoryModel(CollectionBackend *backend, QObject *parent)
|
||||||
: QStandardItemModel(parent),
|
: QStandardItemModel(parent),
|
||||||
dir_icon_(IconLoader::Load("document-open-folder")),
|
dir_icon_(IconLoader::Load("document-open-folder")),
|
||||||
backend_(backend)
|
backend_(backend) {
|
||||||
{
|
|
||||||
|
|
||||||
connect(backend_, SIGNAL(DirectoryDiscovered(Directory, SubdirectoryList)), SLOT(DirectoryDiscovered(Directory)));
|
QObject::connect(backend_, &CollectionBackend::DirectoryDiscovered, this, &CollectionDirectoryModel::DirectoryDiscovered);
|
||||||
connect(backend_, SIGNAL(DirectoryDeleted(Directory)), SLOT(DirectoryDeleted(Directory)));
|
QObject::connect(backend_, &CollectionBackend::DirectoryDeleted, this, &CollectionDirectoryModel::DirectoryDeleted);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,34 +76,33 @@ void CollectionDirectoryModel::AddDirectory(const QString &path) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollectionDirectoryModel::RemoveDirectory(const QModelIndex &index) {
|
void CollectionDirectoryModel::RemoveDirectory(const QModelIndex &idx) {
|
||||||
|
|
||||||
if (!backend_ || !index.isValid()) return;
|
if (!backend_ || !idx.isValid()) return;
|
||||||
|
|
||||||
Directory dir;
|
Directory dir;
|
||||||
dir.path = index.data().toString();
|
dir.path = idx.data().toString();
|
||||||
dir.id = index.data(kIdRole).toInt();
|
dir.id = idx.data(kIdRole).toInt();
|
||||||
|
|
||||||
backend_->RemoveDirectory(dir);
|
backend_->RemoveDirectory(dir);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant CollectionDirectoryModel::data(const QModelIndex &index, int role) const {
|
QVariant CollectionDirectoryModel::data(const QModelIndex &idx, int role) const {
|
||||||
|
|
||||||
switch (role) {
|
switch (role) {
|
||||||
case MusicStorage::Role_Storage:
|
case MusicStorage::Role_Storage:
|
||||||
case MusicStorage::Role_StorageForceConnect:
|
case MusicStorage::Role_StorageForceConnect:
|
||||||
return QVariant::fromValue(storage_[index.row()]);
|
return QVariant::fromValue(storage_[idx.row()]);
|
||||||
|
|
||||||
case MusicStorage::Role_FreeSpace:
|
case MusicStorage::Role_FreeSpace:
|
||||||
return Utilities::FileSystemFreeSpace(data(index, Qt::DisplayRole).toString());
|
return Utilities::FileSystemFreeSpace(data(idx, Qt::DisplayRole).toString());
|
||||||
|
|
||||||
case MusicStorage::Role_Capacity:
|
case MusicStorage::Role_Capacity:
|
||||||
return Utilities::FileSystemCapacity(data(index, Qt::DisplayRole).toString());
|
return Utilities::FileSystemCapacity(data(idx, Qt::DisplayRole).toString());
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return QStandardItemModel::data(index, role);
|
return QStandardItemModel::data(idx, role);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,14 +42,14 @@ class CollectionDirectoryModel : public QStandardItemModel {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CollectionDirectoryModel(CollectionBackend* backend, QObject *parent = nullptr);
|
explicit CollectionDirectoryModel(CollectionBackend *backend, QObject *parent = nullptr);
|
||||||
~CollectionDirectoryModel() override;
|
~CollectionDirectoryModel() override;
|
||||||
|
|
||||||
// To be called by GUIs
|
// To be called by GUIs
|
||||||
void AddDirectory(const QString &path);
|
void AddDirectory(const QString &path);
|
||||||
void RemoveDirectory(const QModelIndex &index);
|
void RemoveDirectory(const QModelIndex &idx);
|
||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role) const override;
|
QVariant data(const QModelIndex &idx, int role) const override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
// To be called by the backend
|
// To be called by the backend
|
||||||
@ -61,7 +61,7 @@ class CollectionDirectoryModel : public QStandardItemModel {
|
|||||||
|
|
||||||
QIcon dir_icon_;
|
QIcon dir_icon_;
|
||||||
CollectionBackend* backend_;
|
CollectionBackend* backend_;
|
||||||
QList<std::shared_ptr<MusicStorage> > storage_;
|
QList<std::shared_ptr<MusicStorage>> storage_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COLLECTIONDIRECTORYMODEL_H
|
#endif // COLLECTIONDIRECTORYMODEL_H
|
||||||
|
@ -85,8 +85,8 @@ CollectionFilterWidget::CollectionFilterWidget(QWidget *parent)
|
|||||||
QString("</p></body></html>")
|
QString("</p></body></html>")
|
||||||
);
|
);
|
||||||
|
|
||||||
connect(ui_->filter, SIGNAL(returnPressed()), SIGNAL(ReturnPressed()));
|
QObject::connect(ui_->filter, &QSearchField::returnPressed, this, &CollectionFilterWidget::ReturnPressed);
|
||||||
connect(filter_delay_, SIGNAL(timeout()), SLOT(FilterDelayTimeout()));
|
QObject::connect(filter_delay_, &QTimer::timeout, this, &CollectionFilterWidget::FilterDelayTimeout);
|
||||||
|
|
||||||
filter_delay_->setInterval(kFilterDelay);
|
filter_delay_->setInterval(kFilterDelay);
|
||||||
filter_delay_->setSingleShot(true);
|
filter_delay_->setSingleShot(true);
|
||||||
@ -119,9 +119,9 @@ CollectionFilterWidget::CollectionFilterWidget(QWidget *parent)
|
|||||||
group_by_menu_ = new QMenu(tr("Group by"), this);
|
group_by_menu_ = new QMenu(tr("Group by"), this);
|
||||||
group_by_menu_->addActions(group_by_group_->actions());
|
group_by_menu_->addActions(group_by_group_->actions());
|
||||||
|
|
||||||
connect(group_by_group_, SIGNAL(triggered(QAction*)), SLOT(GroupByClicked(QAction*)));
|
QObject::connect(group_by_group_, &QActionGroup::triggered, this, &CollectionFilterWidget::GroupByClicked);
|
||||||
connect(ui_->save_grouping, SIGNAL(triggered()), this, SLOT(SaveGroupBy()));
|
QObject::connect(ui_->save_grouping, &QAction::triggered, this, &CollectionFilterWidget::SaveGroupBy);
|
||||||
connect(ui_->manage_groupings, SIGNAL(triggered()), this, SLOT(ShowGroupingManager()));
|
QObject::connect(ui_->manage_groupings, &QAction::triggered, this, &CollectionFilterWidget::ShowGroupingManager);
|
||||||
|
|
||||||
// Collection config menu
|
// Collection config menu
|
||||||
collection_menu_ = new QMenu(tr("Display options"), this);
|
collection_menu_ = new QMenu(tr("Display options"), this);
|
||||||
@ -133,7 +133,7 @@ CollectionFilterWidget::CollectionFilterWidget(QWidget *parent)
|
|||||||
collection_menu_->addSeparator();
|
collection_menu_->addSeparator();
|
||||||
ui_->options->setMenu(collection_menu_);
|
ui_->options->setMenu(collection_menu_);
|
||||||
|
|
||||||
connect(ui_->filter, SIGNAL(textChanged(QString)), SLOT(FilterTextChanged(QString)));
|
QObject::connect(ui_->filter, &QSearchField::textChanged, this, &CollectionFilterWidget::FilterTextChanged);
|
||||||
|
|
||||||
ReloadSettings();
|
ReloadSettings();
|
||||||
|
|
||||||
@ -179,14 +179,14 @@ QString CollectionFilterWidget::group_by(const int number) { return group_by() +
|
|||||||
void CollectionFilterWidget::UpdateGroupByActions() {
|
void CollectionFilterWidget::UpdateGroupByActions() {
|
||||||
|
|
||||||
if (group_by_group_) {
|
if (group_by_group_) {
|
||||||
disconnect(group_by_group_, nullptr, nullptr, nullptr);
|
QObject::disconnect(group_by_group_, nullptr, this, nullptr);
|
||||||
delete group_by_group_;
|
delete group_by_group_;
|
||||||
}
|
}
|
||||||
|
|
||||||
group_by_group_ = CreateGroupByActions(this);
|
group_by_group_ = CreateGroupByActions(this);
|
||||||
group_by_menu_->clear();
|
group_by_menu_->clear();
|
||||||
group_by_menu_->addActions(group_by_group_->actions());
|
group_by_menu_->addActions(group_by_group_->actions());
|
||||||
connect(group_by_group_, SIGNAL(triggered(QAction*)), SLOT(GroupByClicked(QAction*)));
|
QObject::connect(group_by_group_, &QActionGroup::triggered, this, &CollectionFilterWidget::GroupByClicked);
|
||||||
if (model_) {
|
if (model_) {
|
||||||
CheckCurrentGrouping(model_->GetGroupBy());
|
CheckCurrentGrouping(model_->GetGroupBy());
|
||||||
}
|
}
|
||||||
@ -300,24 +300,24 @@ void CollectionFilterWidget::FocusOnFilter(QKeyEvent *event) {
|
|||||||
void CollectionFilterWidget::SetCollectionModel(CollectionModel *model) {
|
void CollectionFilterWidget::SetCollectionModel(CollectionModel *model) {
|
||||||
|
|
||||||
if (model_) {
|
if (model_) {
|
||||||
disconnect(model_, nullptr, this, nullptr);
|
QObject::disconnect(model_, nullptr, this, nullptr);
|
||||||
disconnect(model_, nullptr, group_by_dialog_.get(), nullptr);
|
QObject::disconnect(model_, nullptr, group_by_dialog_.get(), nullptr);
|
||||||
disconnect(group_by_dialog_.get(), nullptr, model_, nullptr);
|
QObject::disconnect(group_by_dialog_.get(), nullptr, model_, nullptr);
|
||||||
for (QAction *action : filter_ages_.keys()) {
|
for (QAction *action : filter_ages_.keys()) {
|
||||||
disconnect(action, &QAction::triggered, model_, nullptr);
|
QObject::disconnect(action, &QAction::triggered, model_, nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
model_ = model;
|
model_ = model;
|
||||||
|
|
||||||
// Connect signals
|
// Connect signals
|
||||||
connect(model_, SIGNAL(GroupingChanged(CollectionModel::Grouping)), group_by_dialog_.get(), SLOT(CollectionGroupingChanged(CollectionModel::Grouping)));
|
QObject::connect(model_, &CollectionModel::GroupingChanged, group_by_dialog_.get(), &GroupByDialog::CollectionGroupingChanged);
|
||||||
connect(model_, SIGNAL(GroupingChanged(CollectionModel::Grouping)), SLOT(GroupingChanged(CollectionModel::Grouping)));
|
QObject::connect(model_, &CollectionModel::GroupingChanged, this, &CollectionFilterWidget::GroupingChanged);
|
||||||
connect(group_by_dialog_.get(), SIGNAL(Accepted(CollectionModel::Grouping)), model_, SLOT(SetGroupBy(CollectionModel::Grouping)));
|
QObject::connect(group_by_dialog_.get(), &GroupByDialog::Accepted, model_, &CollectionModel::SetGroupBy);
|
||||||
|
|
||||||
for (QAction *action : filter_ages_.keys()) {
|
for (QAction *action : filter_ages_.keys()) {
|
||||||
int age = filter_ages_[action];
|
int age = filter_ages_[action];
|
||||||
connect(action, &QAction::triggered, [this, age]() { model_->SetFilterAge(age); } );
|
QObject::connect(action, &QAction::triggered, [this, age]() { model_->SetFilterAge(age); } );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load settings
|
// Load settings
|
||||||
|
@ -90,7 +90,7 @@ class CollectionFilterWidget : public QWidget {
|
|||||||
void UpPressed();
|
void UpPressed();
|
||||||
void DownPressed();
|
void DownPressed();
|
||||||
void ReturnPressed();
|
void ReturnPressed();
|
||||||
void Filter(const QString &text);
|
void Filter(QString text);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void keyReleaseEvent(QKeyEvent *e) override;
|
void keyReleaseEvent(QKeyEvent *e) override;
|
||||||
|
@ -48,12 +48,12 @@
|
|||||||
|
|
||||||
CollectionItemDelegate::CollectionItemDelegate(QObject *parent) : QStyledItemDelegate(parent) {}
|
CollectionItemDelegate::CollectionItemDelegate(QObject *parent) : QStyledItemDelegate(parent) {}
|
||||||
|
|
||||||
void CollectionItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt, const QModelIndex &index) const {
|
void CollectionItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt, const QModelIndex &idx) const {
|
||||||
|
|
||||||
const bool is_divider = index.data(CollectionModel::Role_IsDivider).toBool();
|
const bool is_divider = idx.data(CollectionModel::Role_IsDivider).toBool();
|
||||||
|
|
||||||
if (is_divider) {
|
if (is_divider) {
|
||||||
QString text(index.data().toString());
|
QString text(idx.data().toString());
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ void CollectionItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
|||||||
|
|
||||||
// Does this item have an icon?
|
// Does this item have an icon?
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
QVariant decoration = index.data(Qt::DecorationRole);
|
QVariant decoration = idx.data(Qt::DecorationRole);
|
||||||
if (!decoration.isNull()) {
|
if (!decoration.isNull()) {
|
||||||
if (decoration.canConvert<QPixmap>()) {
|
if (decoration.canConvert<QPixmap>()) {
|
||||||
pixmap = decoration.value<QPixmap>();
|
pixmap = decoration.value<QPixmap>();
|
||||||
@ -113,35 +113,35 @@ void CollectionItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
|||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QStyledItemDelegate::paint(painter, opt, index);
|
QStyledItemDelegate::paint(painter, opt, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CollectionItemDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index) {
|
bool CollectionItemDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &idx) {
|
||||||
|
|
||||||
Q_UNUSED(option);
|
Q_UNUSED(option);
|
||||||
|
|
||||||
if (!event || !view) return false;
|
if (!event || !view) return false;
|
||||||
|
|
||||||
QHelpEvent *he = static_cast<QHelpEvent*>(event);
|
QHelpEvent *he = static_cast<QHelpEvent*>(event);
|
||||||
QString text = displayText(index.data(), QLocale::system());
|
QString text = displayText(idx.data(), QLocale::system());
|
||||||
|
|
||||||
if (text.isEmpty() || !he) return false;
|
if (text.isEmpty() || !he) return false;
|
||||||
|
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::ToolTip: {
|
case QEvent::ToolTip: {
|
||||||
|
|
||||||
QSize real_text = sizeHint(option, index);
|
QSize real_text = sizeHint(option, idx);
|
||||||
QRect displayed_text = view->visualRect(index);
|
QRect displayed_text = view->visualRect(idx);
|
||||||
bool is_elided = displayed_text.width() < real_text.width();
|
bool is_elided = displayed_text.width() < real_text.width();
|
||||||
|
|
||||||
if (is_elided) {
|
if (is_elided) {
|
||||||
QToolTip::showText(he->globalPos(), text, view);
|
QToolTip::showText(he->globalPos(), text, view);
|
||||||
}
|
}
|
||||||
else if (index.data(Qt::ToolTipRole).isValid()) {
|
else if (idx.data(Qt::ToolTipRole).isValid()) {
|
||||||
// If the item has a tooltip text, display it
|
// If the item has a tooltip text, display it
|
||||||
QString tooltip_text = index.data(Qt::ToolTipRole).toString();
|
QString tooltip_text = idx.data(Qt::ToolTipRole).toString();
|
||||||
QToolTip::showText(he->globalPos(), tooltip_text, view);
|
QToolTip::showText(he->globalPos(), tooltip_text, view);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -37,10 +37,10 @@ class CollectionItemDelegate : public QStyledItemDelegate {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CollectionItemDelegate(QObject *parent);
|
explicit CollectionItemDelegate(QObject *parent);
|
||||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index) override;
|
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &idx) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // COLLECTIONITEMDELEGATE_H
|
#endif // COLLECTIONITEMDELEGATE_H
|
||||||
|
@ -107,7 +107,7 @@ CollectionModel::CollectionModel(CollectionBackend *backend, Application *app, Q
|
|||||||
cover_loader_options_.scale_output_image_ = true;
|
cover_loader_options_.scale_output_image_ = true;
|
||||||
|
|
||||||
if (app_) {
|
if (app_) {
|
||||||
connect(app_->album_cover_loader(), SIGNAL(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)), SLOT(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)));
|
QObject::connect(app_->album_cover_loader(), &AlbumCoverLoader::AlbumCoverLoaded, this, &CollectionModel::AlbumCoverLoaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon nocover = IconLoader::Load("cdcase");
|
QIcon nocover = IconLoader::Load("cdcase");
|
||||||
@ -118,17 +118,17 @@ CollectionModel::CollectionModel(CollectionBackend *backend, Application *app, Q
|
|||||||
if (app_ && !sIconCache) {
|
if (app_ && !sIconCache) {
|
||||||
sIconCache = new QNetworkDiskCache(this);
|
sIconCache = new QNetworkDiskCache(this);
|
||||||
sIconCache->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + kPixmapDiskCacheDir);
|
sIconCache->setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + kPixmapDiskCacheDir);
|
||||||
connect(app_, SIGNAL(ClearPixmapDiskCache()), SLOT(ClearDiskCache()));
|
QObject::connect(app_, &Application::ClearPixmapDiskCache, this, &CollectionModel::ClearDiskCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(backend_, SIGNAL(SongsDiscovered(SongList)), SLOT(SongsDiscovered(SongList)));
|
QObject::connect(backend_, &CollectionBackend::SongsDiscovered, this, &CollectionModel::SongsDiscovered);
|
||||||
connect(backend_, SIGNAL(SongsDeleted(SongList)), SLOT(SongsDeleted(SongList)));
|
QObject::connect(backend_, &CollectionBackend::SongsDeleted, this, &CollectionModel::SongsDeleted);
|
||||||
connect(backend_, SIGNAL(DatabaseReset()), SLOT(Reset()));
|
QObject::connect(backend_, &CollectionBackend::DatabaseReset, this, &CollectionModel::Reset);
|
||||||
connect(backend_, SIGNAL(TotalSongCountUpdated(int)), SLOT(TotalSongCountUpdatedSlot(int)));
|
QObject::connect(backend_, &CollectionBackend::TotalSongCountUpdated, this, &CollectionModel::TotalSongCountUpdatedSlot);
|
||||||
connect(backend_, SIGNAL(TotalArtistCountUpdated(int)), SLOT(TotalArtistCountUpdatedSlot(int)));
|
QObject::connect(backend_, &CollectionBackend::TotalArtistCountUpdated, this, &CollectionModel::TotalArtistCountUpdatedSlot);
|
||||||
connect(backend_, SIGNAL(TotalAlbumCountUpdated(int)), SLOT(TotalAlbumCountUpdatedSlot(int)));
|
QObject::connect(backend_, &CollectionBackend::TotalAlbumCountUpdated, this, &CollectionModel::TotalAlbumCountUpdatedSlot);
|
||||||
connect(backend_, SIGNAL(SongsStatisticsChanged(SongList)), SLOT(SongsSlightlyChanged(SongList)));
|
QObject::connect(backend_, &CollectionBackend::SongsStatisticsChanged, this, &CollectionModel::SongsSlightlyChanged);
|
||||||
connect(backend_, SIGNAL(SongsRatingChanged(SongList)), SLOT(SongsSlightlyChanged(SongList)));
|
QObject::connect(backend_, &CollectionBackend::SongsRatingChanged, this, &CollectionModel::SongsSlightlyChanged);
|
||||||
|
|
||||||
backend_->UpdateTotalSongCountAsync();
|
backend_->UpdateTotalSongCountAsync();
|
||||||
backend_->UpdateTotalArtistCountAsync();
|
backend_->UpdateTotalArtistCountAsync();
|
||||||
@ -909,12 +909,14 @@ void CollectionModel::LazyPopulate(CollectionItem *parent, const bool signal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CollectionModel::ResetAsync() {
|
void CollectionModel::ResetAsync() {
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
QFuture<CollectionModel::QueryResult> future = QtConcurrent::run(&CollectionModel::RunQuery, this, root_);
|
QFuture<CollectionModel::QueryResult> future = QtConcurrent::run(&CollectionModel::RunQuery, this, root_);
|
||||||
#else
|
#else
|
||||||
QFuture<CollectionModel::QueryResult> future = QtConcurrent::run(this, &CollectionModel::RunQuery, root_);
|
QFuture<CollectionModel::QueryResult> future = QtConcurrent::run(this, &CollectionModel::RunQuery, root_);
|
||||||
#endif
|
#endif
|
||||||
NewClosure(future, this, SLOT(ResetAsyncQueryFinished(QFuture<CollectionModel::QueryResult>)), future);
|
NewClosure(future, this, SLOT(ResetAsyncQueryFinished(QFuture<CollectionModel::QueryResult>)), future);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollectionModel::ResetAsyncQueryFinished(QFuture<CollectionModel::QueryResult> future) {
|
void CollectionModel::ResetAsyncQueryFinished(QFuture<CollectionModel::QueryResult> future) {
|
||||||
|
@ -196,10 +196,10 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
|||||||
void ExpandAll(CollectionItem *item = nullptr) const;
|
void ExpandAll(CollectionItem *item = nullptr) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void TotalSongCountUpdated(const int count);
|
void TotalSongCountUpdated(int count);
|
||||||
void TotalArtistCountUpdated(const int count);
|
void TotalArtistCountUpdated(int count);
|
||||||
void TotalAlbumCountUpdated(const int count);
|
void TotalAlbumCountUpdated(int count);
|
||||||
void GroupingChanged(const CollectionModel::Grouping &g);
|
void GroupingChanged(CollectionModel::Grouping g);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void SetFilterAge(const int age);
|
void SetFilterAge(const int age);
|
||||||
@ -212,13 +212,14 @@ class CollectionModel : public SimpleTreeModel<CollectionItem> {
|
|||||||
void Reset();
|
void Reset();
|
||||||
void ResetAsync();
|
void ResetAsync();
|
||||||
|
|
||||||
|
void SongsDiscovered(const SongList &songs);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void LazyPopulate(CollectionItem *item) override { LazyPopulate(item, true); }
|
void LazyPopulate(CollectionItem *item) override { LazyPopulate(item, true); }
|
||||||
void LazyPopulate(CollectionItem *parent, const bool signal);
|
void LazyPopulate(CollectionItem *parent, const bool signal);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
// From CollectionBackend
|
// From CollectionBackend
|
||||||
void SongsDiscovered(const SongList &songs);
|
|
||||||
void SongsDeleted(const SongList &songs);
|
void SongsDeleted(const SongList &songs);
|
||||||
void SongsSlightlyChanged(const SongList &songs);
|
void SongsSlightlyChanged(const SongList &songs);
|
||||||
void TotalSongCountUpdatedSlot(const int count);
|
void TotalSongCountUpdatedSlot(const int count);
|
||||||
|
@ -338,33 +338,33 @@ void CollectionView::contextMenuEvent(QContextMenuEvent *e) {
|
|||||||
|
|
||||||
if (!context_menu_) {
|
if (!context_menu_) {
|
||||||
context_menu_ = new QMenu(this);
|
context_menu_ = new QMenu(this);
|
||||||
action_add_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, SLOT(AddToPlaylist()));
|
action_add_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, &CollectionView::AddToPlaylist);
|
||||||
action_load_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, SLOT(Load()));
|
action_load_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, &CollectionView::Load);
|
||||||
action_open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), tr("Open in new playlist"), this, SLOT(OpenInNewPlaylist()));
|
action_open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), tr("Open in new playlist"), this, &CollectionView::OpenInNewPlaylist);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
action_add_to_playlist_enqueue_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue track"), this, SLOT(AddToPlaylistEnqueue()));
|
action_add_to_playlist_enqueue_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue track"), this, &CollectionView::AddToPlaylistEnqueue);
|
||||||
action_add_to_playlist_enqueue_next_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue to play next"), this, SLOT(AddToPlaylistEnqueueNext()));
|
action_add_to_playlist_enqueue_next_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue to play next"), this, &CollectionView::AddToPlaylistEnqueueNext);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
action_organize_ = context_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organize files..."), this, SLOT(Organize()));
|
action_organize_ = context_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organize files..."), this, &CollectionView::Organize);
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
action_copy_to_device_ = context_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, SLOT(CopyToDevice()));
|
action_copy_to_device_ = context_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, &CollectionView::CopyToDevice);
|
||||||
#endif
|
#endif
|
||||||
action_delete_files_ = context_menu_->addAction(IconLoader::Load("edit-delete"), tr("Delete from disk..."), this, SLOT(Delete()));
|
action_delete_files_ = context_menu_->addAction(IconLoader::Load("edit-delete"), tr("Delete from disk..."), this, &CollectionView::Delete);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
action_edit_track_ = context_menu_->addAction(IconLoader::Load("edit-rename"), tr("Edit track information..."), this, SLOT(EditTracks()));
|
action_edit_track_ = context_menu_->addAction(IconLoader::Load("edit-rename"), tr("Edit track information..."), this, &CollectionView::EditTracks);
|
||||||
action_edit_tracks_ = context_menu_->addAction(IconLoader::Load("edit-rename"), tr("Edit tracks information..."), this, SLOT(EditTracks()));
|
action_edit_tracks_ = context_menu_->addAction(IconLoader::Load("edit-rename"), tr("Edit tracks information..."), this, &CollectionView::EditTracks);
|
||||||
action_show_in_browser_ = context_menu_->addAction(IconLoader::Load("document-open-folder"), tr("Show in file browser..."), this, SLOT(ShowInBrowser()));
|
action_show_in_browser_ = context_menu_->addAction(IconLoader::Load("document-open-folder"), tr("Show in file browser..."), this, &CollectionView::ShowInBrowser);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
|
|
||||||
action_rescan_songs_ = context_menu_->addAction(tr("Rescan song(s)"), this, SLOT(RescanSongs()));
|
action_rescan_songs_ = context_menu_->addAction(tr("Rescan song(s)"), this, &CollectionView::RescanSongs);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
action_show_in_various_ = context_menu_->addAction( tr("Show in various artists"), this, SLOT(ShowInVarious()));
|
action_show_in_various_ = context_menu_->addAction(tr("Show in various artists"), this, &CollectionView::ShowInVarious);
|
||||||
action_no_show_in_various_ = context_menu_->addAction( tr("Don't show in various artists"), this, SLOT(NoShowInVarious()));
|
action_no_show_in_various_ = context_menu_->addAction(tr("Don't show in various artists"), this, &CollectionView::NoShowInVarious);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
|
|
||||||
@ -372,7 +372,7 @@ void CollectionView::contextMenuEvent(QContextMenuEvent *e) {
|
|||||||
|
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
action_copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
action_copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
||||||
connect(app_->device_manager()->connected_devices_model(), SIGNAL(IsEmptyChanged(bool)), action_copy_to_device_, SLOT(setDisabled(bool)));
|
QObject::connect(app_->device_manager()->connected_devices_model(), &DeviceStateFilterModel::IsEmptyChanged, action_copy_to_device_, &QAction::setDisabled);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -387,9 +387,9 @@ void CollectionView::contextMenuEvent(QContextMenuEvent *e) {
|
|||||||
int regular_elements = 0;
|
int regular_elements = 0;
|
||||||
int regular_editable = 0;
|
int regular_editable = 0;
|
||||||
|
|
||||||
for (const QModelIndex &index : selected_indexes) {
|
for (const QModelIndex &idx : selected_indexes) {
|
||||||
++regular_elements;
|
++regular_elements;
|
||||||
if(app_->collection_model()->data(index, CollectionModel::Role_Editable).toBool()) {
|
if (app_->collection_model()->data(idx, CollectionModel::Role_Editable).toBool()) {
|
||||||
++regular_editable;
|
++regular_editable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -442,11 +442,11 @@ void CollectionView::contextMenuEvent(QContextMenuEvent *e) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollectionView::ShowInVarious() { ShowInVarious(true); }
|
void CollectionView::ShowInVarious() { SetShowInVarious(true); }
|
||||||
|
|
||||||
void CollectionView::NoShowInVarious() { ShowInVarious(false); }
|
void CollectionView::NoShowInVarious() { SetShowInVarious(false); }
|
||||||
|
|
||||||
void CollectionView::ShowInVarious(const bool on) {
|
void CollectionView::SetShowInVarious(const bool on) {
|
||||||
|
|
||||||
if (!context_menu_index_.isValid()) return;
|
if (!context_menu_index_.isValid()) return;
|
||||||
|
|
||||||
@ -547,12 +547,12 @@ void CollectionView::keyboardSearch(const QString &search) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollectionView::scrollTo(const QModelIndex &index, ScrollHint hint) {
|
void CollectionView::scrollTo(const QModelIndex &idx, ScrollHint hint) {
|
||||||
|
|
||||||
if (is_in_keyboard_search_)
|
if (is_in_keyboard_search_)
|
||||||
QTreeView::scrollTo(index, QAbstractItemView::PositionAtTop);
|
QTreeView::scrollTo(idx, QAbstractItemView::PositionAtTop);
|
||||||
else
|
else
|
||||||
QTreeView::scrollTo(index, hint);
|
QTreeView::scrollTo(idx, hint);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,7 +582,7 @@ void CollectionView::EditTracks() {
|
|||||||
|
|
||||||
if (!edit_tag_dialog_) {
|
if (!edit_tag_dialog_) {
|
||||||
edit_tag_dialog_.reset(new EditTagDialog(app_, this));
|
edit_tag_dialog_.reset(new EditTagDialog(app_, this));
|
||||||
connect(edit_tag_dialog_.get(), SIGNAL(Error(QString)), SLOT(EditTagError(QString)));
|
QObject::connect(edit_tag_dialog_.get(), &EditTagDialog::Error, this, &CollectionView::EditTagError);
|
||||||
}
|
}
|
||||||
edit_tag_dialog_->SetSongs(GetSelectedSongs());
|
edit_tag_dialog_->SetSongs(GetSelectedSongs());
|
||||||
edit_tag_dialog_->show();
|
edit_tag_dialog_->show();
|
||||||
@ -668,7 +668,7 @@ void CollectionView::Delete() {
|
|||||||
std::shared_ptr<MusicStorage> storage = app_->collection_model()->directory_model()->index(0, 0).data(MusicStorage::Role_Storage).value<std::shared_ptr<MusicStorage>>();
|
std::shared_ptr<MusicStorage> storage = app_->collection_model()->directory_model()->index(0, 0).data(MusicStorage::Role_Storage).value<std::shared_ptr<MusicStorage>>();
|
||||||
|
|
||||||
DeleteFiles *delete_files = new DeleteFiles(app_->task_manager(), storage, true);
|
DeleteFiles *delete_files = new DeleteFiles(app_->task_manager(), storage, true);
|
||||||
connect(delete_files, SIGNAL(Finished(SongList)), SLOT(DeleteFinished(SongList)));
|
QObject::connect(delete_files, &DeleteFiles::Finished, this, &CollectionView::DeleteFilesFinished);
|
||||||
delete_files->Start(selected_songs);
|
delete_files->Start(selected_songs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ class CollectionView : public AutoExpandingTreeView {
|
|||||||
|
|
||||||
// QTreeView
|
// QTreeView
|
||||||
void keyboardSearch(const QString &search) override;
|
void keyboardSearch(const QString &search) override;
|
||||||
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
|
void scrollTo(const QModelIndex &idx, ScrollHint hint = EnsureVisible) override;
|
||||||
|
|
||||||
int TotalSongs();
|
int TotalSongs();
|
||||||
int TotalArtists();
|
int TotalArtists();
|
||||||
@ -114,7 +114,7 @@ class CollectionView : public AutoExpandingTreeView {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void RecheckIsEmpty();
|
void RecheckIsEmpty();
|
||||||
void ShowInVarious(const bool on);
|
void SetShowInVarious(const bool on);
|
||||||
bool RestoreLevelFocus(const QModelIndex &parent = QModelIndex());
|
bool RestoreLevelFocus(const QModelIndex &parent = QModelIndex());
|
||||||
void SaveContainerPath(const QModelIndex &child);
|
void SaveContainerPath(const QModelIndex &child);
|
||||||
|
|
||||||
|
@ -33,10 +33,10 @@ CollectionViewContainer::CollectionViewContainer(QWidget *parent) : QWidget(pare
|
|||||||
ui_->setupUi(this);
|
ui_->setupUi(this);
|
||||||
view()->SetFilter(filter());
|
view()->SetFilter(filter());
|
||||||
|
|
||||||
connect(filter(), SIGNAL(UpPressed()), view(), SLOT(UpAndFocus()));
|
QObject::connect(filter(), &CollectionFilterWidget::UpPressed, view(), &CollectionView::UpAndFocus);
|
||||||
connect(filter(), SIGNAL(DownPressed()), view(), SLOT(DownAndFocus()));
|
QObject::connect(filter(), &CollectionFilterWidget::DownPressed, view(), &CollectionView::DownAndFocus);
|
||||||
connect(filter(), SIGNAL(ReturnPressed()), view(), SLOT(FilterReturnPressed()));
|
QObject::connect(filter(), &CollectionFilterWidget::ReturnPressed, view(), &CollectionView::FilterReturnPressed);
|
||||||
connect(view(), SIGNAL(FocusOnFilterSignal(QKeyEvent*)), filter(), SLOT(FocusOnFilter(QKeyEvent*)));
|
QObject::connect(view(), &CollectionView::FocusOnFilterSignal, filter(), &CollectionFilterWidget::FocusOnFilter);
|
||||||
|
|
||||||
ReloadSettings();
|
ReloadSettings();
|
||||||
|
|
||||||
|
@ -91,7 +91,8 @@ CollectionWatcher::CollectionWatcher(Song::Source source, QObject *parent)
|
|||||||
|
|
||||||
ReloadSettings();
|
ReloadSettings();
|
||||||
|
|
||||||
connect(rescan_timer_, SIGNAL(timeout()), SLOT(RescanPathsNow()));
|
QObject::connect(rescan_timer_, &QTimer::timeout, this, &CollectionWatcher::RescanPathsNow);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollectionWatcher::ExitAsync() {
|
void CollectionWatcher::ExitAsync() {
|
||||||
@ -644,7 +645,7 @@ void CollectionWatcher::AddWatch(const Directory &dir, const QString &path) {
|
|||||||
|
|
||||||
if (!QFile::exists(path)) return;
|
if (!QFile::exists(path)) return;
|
||||||
|
|
||||||
connect(fs_watcher_, SIGNAL(PathChanged(QString)), this, SLOT(DirectoryChanged(QString)), Qt::UniqueConnection);
|
QObject::connect(fs_watcher_, &FileSystemWatcherInterface::PathChanged, this, &CollectionWatcher::DirectoryChanged, Qt::UniqueConnection);
|
||||||
fs_watcher_->AddPath(path);
|
fs_watcher_->AddPath(path);
|
||||||
subdir_mapping_[path] = dir;
|
subdir_mapping_[path] = dir;
|
||||||
|
|
||||||
|
@ -65,13 +65,13 @@ class CollectionWatcher : public QObject {
|
|||||||
void ExitAsync();
|
void ExitAsync();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void NewOrUpdatedSongs(const SongList &songs);
|
void NewOrUpdatedSongs(SongList);
|
||||||
void SongsMTimeUpdated(const SongList &songs);
|
void SongsMTimeUpdated(SongList);
|
||||||
void SongsDeleted(const SongList &songs);
|
void SongsDeleted(SongList);
|
||||||
void SongsUnavailable(const SongList &songs);
|
void SongsUnavailable(SongList songs, bool unavailable = true);
|
||||||
void SongsReadded(const SongList &songs, bool unavailable = false);
|
void SongsReadded(SongList songs, bool unavailable = false);
|
||||||
void SubdirsDiscovered(const SubdirectoryList &subdirs);
|
void SubdirsDiscovered(SubdirectoryList subdirs);
|
||||||
void SubdirsMTimeUpdated(const SubdirectoryList &subdirs);
|
void SubdirsMTimeUpdated(SubdirectoryList subdirs);
|
||||||
void CompilationsNeedUpdating();
|
void CompilationsNeedUpdating();
|
||||||
void ExitFinished();
|
void ExitFinished();
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ GroupByDialog::GroupByDialog(QWidget *parent) : QDialog(parent), ui_(new Ui_Grou
|
|||||||
p_->mapping_.insert(Mapping(CollectionModel::GroupBy_Bitdepth, 18));
|
p_->mapping_.insert(Mapping(CollectionModel::GroupBy_Bitdepth, 18));
|
||||||
p_->mapping_.insert(Mapping(CollectionModel::GroupBy_Bitrate, 19));
|
p_->mapping_.insert(Mapping(CollectionModel::GroupBy_Bitrate, 19));
|
||||||
|
|
||||||
connect(ui_->buttonbox->button(QDialogButtonBox::Reset), SIGNAL(clicked()), SLOT(Reset()));
|
QObject::connect(ui_->buttonbox->button(QDialogButtonBox::Reset), &QPushButton::clicked, this, &GroupByDialog::Reset);
|
||||||
|
|
||||||
resize(sizeHint());
|
resize(sizeHint());
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class GroupByDialog : public QDialog {
|
|||||||
void accept() override;
|
void accept() override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void Accepted(const CollectionModel::Grouping &g);
|
void Accepted(CollectionModel::Grouping g);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void Reset();
|
void Reset();
|
||||||
|
@ -61,9 +61,10 @@ SavedGroupingManager::SavedGroupingManager(QWidget *parent)
|
|||||||
ui_->remove->setEnabled(false);
|
ui_->remove->setEnabled(false);
|
||||||
|
|
||||||
ui_->remove->setShortcut(QKeySequence::Delete);
|
ui_->remove->setShortcut(QKeySequence::Delete);
|
||||||
connect(ui_->list->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), SLOT(UpdateButtonState()));
|
QObject::connect(ui_->list->selectionModel(), &QItemSelectionModel::selectionChanged, this, &SavedGroupingManager::UpdateButtonState);
|
||||||
|
|
||||||
|
QObject::connect(ui_->remove, &QPushButton::clicked, this, &SavedGroupingManager::Remove);
|
||||||
|
|
||||||
connect(ui_->remove, SIGNAL(clicked()), SLOT(Remove()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SavedGroupingManager::~SavedGroupingManager() {
|
SavedGroupingManager::~SavedGroupingManager() {
|
||||||
@ -184,10 +185,10 @@ void SavedGroupingManager::Remove() {
|
|||||||
if (ui_->list->selectionModel()->hasSelection()) {
|
if (ui_->list->selectionModel()->hasSelection()) {
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(CollectionModel::kSavedGroupingsSettingsGroup);
|
s.beginGroup(CollectionModel::kSavedGroupingsSettingsGroup);
|
||||||
for (const QModelIndex &index : ui_->list->selectionModel()->selectedRows()) {
|
for (const QModelIndex &idx : ui_->list->selectionModel()->selectedRows()) {
|
||||||
if (index.isValid()) {
|
if (idx.isValid()) {
|
||||||
qLog(Debug) << "Remove saved grouping: " << model_->item(index.row(), 0)->text();
|
qLog(Debug) << "Remove saved grouping: " << model_->item(idx.row(), 0)->text();
|
||||||
s.remove(model_->item(index.row(), 0)->text());
|
s.remove(model_->item(idx.row(), 0)->text());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
@ -43,7 +43,7 @@ class SavedGroupingManager : public QDialog {
|
|||||||
~SavedGroupingManager() override;
|
~SavedGroupingManager() override;
|
||||||
|
|
||||||
void UpdateModel();
|
void UpdateModel();
|
||||||
void SetFilter(CollectionFilterWidget* filter) { filter_ = filter; }
|
void SetFilter(CollectionFilterWidget *filter) { filter_ = filter; }
|
||||||
|
|
||||||
static QString GroupByToString(const CollectionModel::GroupBy &g);
|
static QString GroupByToString(const CollectionModel::GroupBy &g);
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ class SavedGroupingManager : public QDialog {
|
|||||||
void Remove();
|
void Remove();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui_SavedGroupingManager* ui_;
|
Ui_SavedGroupingManager *ui_;
|
||||||
QStandardItemModel *model_;
|
QStandardItemModel *model_;
|
||||||
CollectionFilterWidget *filter_;
|
CollectionFilterWidget *filter_;
|
||||||
};
|
};
|
||||||
|
@ -65,7 +65,7 @@ ContextAlbum::ContextAlbum(QWidget *parent) :
|
|||||||
QPair<QImage, QImage> images = AlbumCoverLoader::ScaleAndPad(cover_loader_options_, image_strawberry_);
|
QPair<QImage, QImage> images = AlbumCoverLoader::ScaleAndPad(cover_loader_options_, image_strawberry_);
|
||||||
pixmap_current_ = QPixmap::fromImage(images.first);
|
pixmap_current_ = QPixmap::fromImage(images.first);
|
||||||
|
|
||||||
connect(timeline_fade_, SIGNAL(valueChanged(qreal)), SLOT(FadePreviousTrack(qreal)));
|
QObject::connect(timeline_fade_, &QTimeLine::valueChanged, this, &ContextAlbum::FadePreviousTrack);
|
||||||
timeline_fade_->setDirection(QTimeLine::Backward); // 1.0 -> 0.0
|
timeline_fade_->setDirection(QTimeLine::Backward); // 1.0 -> 0.0
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ void ContextAlbum::Init(ContextView *context_view, AlbumCoverChoiceController *a
|
|||||||
context_view_ = context_view;
|
context_view_ = context_view;
|
||||||
|
|
||||||
album_cover_choice_controller_ = album_cover_choice_controller;
|
album_cover_choice_controller_ = album_cover_choice_controller;
|
||||||
connect(album_cover_choice_controller_, SIGNAL(AutomaticCoverSearchDone()), this, SLOT(AutomaticCoverSearchDone()));
|
QObject::connect(album_cover_choice_controller_, &AlbumCoverChoiceController::AutomaticCoverSearchDone, this, &ContextAlbum::AutomaticCoverSearchDone);
|
||||||
|
|
||||||
QList<QAction*> cover_actions = album_cover_choice_controller_->GetAllActions();
|
QList<QAction*> cover_actions = album_cover_choice_controller_->GetAllActions();
|
||||||
cover_actions.append(album_cover_choice_controller_->search_cover_auto_action());
|
cover_actions.append(album_cover_choice_controller_->search_cover_auto_action());
|
||||||
@ -188,7 +188,7 @@ void ContextAlbum::SearchCoverInProgress() {
|
|||||||
|
|
||||||
// Show a spinner animation
|
// Show a spinner animation
|
||||||
spinner_animation_.reset(new QMovie(":/pictures/spinner.gif", QByteArray(), this));
|
spinner_animation_.reset(new QMovie(":/pictures/spinner.gif", QByteArray(), this));
|
||||||
connect(spinner_animation_.get(), SIGNAL(updated(QRect)), SLOT(update()));
|
QObject::connect(spinner_animation_.get(), &QMovie::updated, this, &ContextAlbum::Update);
|
||||||
spinner_animation_->start();
|
spinner_animation_->start();
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
@ -65,10 +65,13 @@ class ContextAlbum : public QWidget {
|
|||||||
void FadeStopFinished();
|
void FadeStopFinished();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void SearchCoverInProgress();
|
void Update() { update(); }
|
||||||
void AutomaticCoverSearchDone();
|
void AutomaticCoverSearchDone();
|
||||||
void FadePreviousTrack(const qreal value);
|
void FadePreviousTrack(const qreal value);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void SearchCoverInProgress();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int kWidgetSpacing;
|
static const int kWidgetSpacing;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ ContextAlbumsModel::ContextAlbumsModel(CollectionBackend *backend, Application *
|
|||||||
cover_loader_options_.pad_output_image_ = true;
|
cover_loader_options_.pad_output_image_ = true;
|
||||||
cover_loader_options_.scale_output_image_ = true;
|
cover_loader_options_.scale_output_image_ = true;
|
||||||
|
|
||||||
connect(app_->album_cover_loader(), SIGNAL(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)), SLOT(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)));
|
QObject::connect(app_->album_cover_loader(), &AlbumCoverLoader::AlbumCoverLoaded, this, &ContextAlbumsModel::AlbumCoverLoaded);
|
||||||
|
|
||||||
QIcon nocover = IconLoader::Load("cdcase");
|
QIcon nocover = IconLoader::Load("cdcase");
|
||||||
no_cover_icon_ = nocover.pixmap(nocover.availableSizes().last()).scaled(kPrettyCoverSize, kPrettyCoverSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
no_cover_icon_ = nocover.pixmap(nocover.availableSizes().last()).scaled(kPrettyCoverSize, kPrettyCoverSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||||
@ -104,10 +104,10 @@ void ContextAlbumsModel::AddSongs(const SongList &songs) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ContextAlbumsModel::AlbumIconPixmapCacheKey(const QModelIndex &index) const {
|
QString ContextAlbumsModel::AlbumIconPixmapCacheKey(const QModelIndex &idx) const {
|
||||||
|
|
||||||
QStringList path;
|
QStringList path;
|
||||||
QModelIndex index_copy(index);
|
QModelIndex index_copy(idx);
|
||||||
while (index_copy.isValid()) {
|
while (index_copy.isValid()) {
|
||||||
path.prepend(index_copy.data().toString());
|
path.prepend(index_copy.data().toString());
|
||||||
index_copy = index_copy.parent();
|
index_copy = index_copy.parent();
|
||||||
@ -116,13 +116,13 @@ QString ContextAlbumsModel::AlbumIconPixmapCacheKey(const QModelIndex &index) co
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant ContextAlbumsModel::AlbumIcon(const QModelIndex &index) {
|
QVariant ContextAlbumsModel::AlbumIcon(const QModelIndex &idx) {
|
||||||
|
|
||||||
CollectionItem *item = IndexToItem(index);
|
CollectionItem *item = IndexToItem(idx);
|
||||||
if (!item) return no_cover_icon_;
|
if (!item) return no_cover_icon_;
|
||||||
|
|
||||||
// Check the cache for a pixmap we already loaded.
|
// Check the cache for a pixmap we already loaded.
|
||||||
const QString cache_key = AlbumIconPixmapCacheKey(index);
|
const QString cache_key = AlbumIconPixmapCacheKey(idx);
|
||||||
|
|
||||||
QPixmap cached_pixmap;
|
QPixmap cached_pixmap;
|
||||||
if (QPixmapCache::find(cache_key, &cached_pixmap)) {
|
if (QPixmapCache::find(cache_key, &cached_pixmap)) {
|
||||||
@ -135,7 +135,7 @@ QVariant ContextAlbumsModel::AlbumIcon(const QModelIndex &index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// No art is cached and we're not loading it already. Load art for the first song in the album.
|
// No art is cached and we're not loading it already. Load art for the first song in the album.
|
||||||
SongList songs = GetChildSongs(index);
|
SongList songs = GetChildSongs(idx);
|
||||||
if (!songs.isEmpty()) {
|
if (!songs.isEmpty()) {
|
||||||
const quint64 id = app_->album_cover_loader()->LoadImageAsync(cover_loader_options_, songs.first());
|
const quint64 id = app_->album_cover_loader()->LoadImageAsync(cover_loader_options_, songs.first());
|
||||||
pending_art_[id] = ItemAndCacheKey(item, cache_key);
|
pending_art_[id] = ItemAndCacheKey(item, cache_key);
|
||||||
@ -169,17 +169,17 @@ void ContextAlbumsModel::AlbumCoverLoaded(const quint64 id, const AlbumCoverLoad
|
|||||||
QPixmapCache::insert(cache_key, image_pixmap);
|
QPixmapCache::insert(cache_key, image_pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QModelIndex index = ItemToIndex(item);
|
const QModelIndex idx = ItemToIndex(item);
|
||||||
emit dataChanged(index, index);
|
emit dataChanged(idx, idx);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant ContextAlbumsModel::data(const QModelIndex &index, int role) const {
|
QVariant ContextAlbumsModel::data(const QModelIndex &idx, int role) const {
|
||||||
|
|
||||||
const CollectionItem *item = IndexToItem(index);
|
const CollectionItem *item = IndexToItem(idx);
|
||||||
|
|
||||||
if (role == Qt::DecorationRole && item->type == CollectionItem::Type_Container && item->container_level == 0) {
|
if (role == Qt::DecorationRole && item->type == CollectionItem::Type_Container && item->container_level == 0) {
|
||||||
return const_cast<ContextAlbumsModel*>(this)->AlbumIcon(index);
|
return const_cast<ContextAlbumsModel*>(this)->AlbumIcon(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
return data(item, role);
|
return data(item, role);
|
||||||
@ -401,9 +401,9 @@ QString ContextAlbumsModel::SortTextForSong(const Song &song) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ItemFlags ContextAlbumsModel::flags(const QModelIndex &index) const {
|
Qt::ItemFlags ContextAlbumsModel::flags(const QModelIndex &idx) const {
|
||||||
|
|
||||||
switch (IndexToItem(index)->type) {
|
switch (IndexToItem(idx)->type) {
|
||||||
case CollectionItem::Type_Song:
|
case CollectionItem::Type_Song:
|
||||||
case CollectionItem::Type_Container:
|
case CollectionItem::Type_Container:
|
||||||
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled;
|
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled;
|
||||||
@ -429,8 +429,8 @@ QMimeData *ContextAlbumsModel::mimeData(const QModelIndexList &indexes) const {
|
|||||||
|
|
||||||
data->backend = backend_;
|
data->backend = backend_;
|
||||||
|
|
||||||
for (const QModelIndex &index : indexes) {
|
for (const QModelIndex &idx : indexes) {
|
||||||
GetChildSongs(IndexToItem(index), &urls, &data->songs, &song_ids);
|
GetChildSongs(IndexToItem(idx), &urls, &data->songs, &song_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
data->setUrls(urls);
|
data->setUrls(urls);
|
||||||
@ -489,15 +489,15 @@ SongList ContextAlbumsModel::GetChildSongs(const QModelIndexList &indexes) const
|
|||||||
SongList ret;
|
SongList ret;
|
||||||
QSet<int> song_ids;
|
QSet<int> song_ids;
|
||||||
|
|
||||||
for (const QModelIndex &index : indexes) {
|
for (const QModelIndex &idx : indexes) {
|
||||||
GetChildSongs(IndexToItem(index), &dontcare, &ret, &song_ids);
|
GetChildSongs(IndexToItem(idx), &dontcare, &ret, &song_ids);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SongList ContextAlbumsModel::GetChildSongs(const QModelIndex &index) const {
|
SongList ContextAlbumsModel::GetChildSongs(const QModelIndex &idx) const {
|
||||||
return GetChildSongs(QModelIndexList() << index);
|
return GetChildSongs(QModelIndexList() << idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ContextAlbumsModel::canFetchMore(const QModelIndex &parent) const {
|
bool ContextAlbumsModel::canFetchMore(const QModelIndex &parent) const {
|
||||||
|
@ -78,11 +78,11 @@ class ContextAlbumsModel : public SimpleTreeModel<CollectionItem> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void GetChildSongs(CollectionItem *item, QList<QUrl> *urls, SongList *songs, QSet<int> *song_ids) const;
|
void GetChildSongs(CollectionItem *item, QList<QUrl> *urls, SongList *songs, QSet<int> *song_ids) const;
|
||||||
SongList GetChildSongs(const QModelIndex &index) const;
|
SongList GetChildSongs(const QModelIndex &idx) const;
|
||||||
SongList GetChildSongs(const QModelIndexList &indexes) const;
|
SongList GetChildSongs(const QModelIndexList &indexes) const;
|
||||||
|
|
||||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const override;
|
||||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
Qt::ItemFlags flags(const QModelIndex &idx) const override;
|
||||||
QStringList mimeTypes() const override;
|
QStringList mimeTypes() const override;
|
||||||
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
||||||
bool canFetchMore(const QModelIndex &parent) const override;
|
bool canFetchMore(const QModelIndex &parent) const override;
|
||||||
@ -107,8 +107,8 @@ class ContextAlbumsModel : public SimpleTreeModel<CollectionItem> {
|
|||||||
void PostQuery(CollectionItem *parent, const QueryResult &result, bool signal);
|
void PostQuery(CollectionItem *parent, const QueryResult &result, bool signal);
|
||||||
CollectionItem *ItemFromSong(CollectionItem::Type item_type, bool signal, CollectionItem *parent, const Song &s, int container_level);
|
CollectionItem *ItemFromSong(CollectionItem::Type item_type, bool signal, CollectionItem *parent, const Song &s, int container_level);
|
||||||
|
|
||||||
QString AlbumIconPixmapCacheKey(const QModelIndex &index) const;
|
QString AlbumIconPixmapCacheKey(const QModelIndex &idx) const;
|
||||||
QVariant AlbumIcon(const QModelIndex &index);
|
QVariant AlbumIcon(const QModelIndex &idx);
|
||||||
QVariant data(const CollectionItem *item, int role) const;
|
QVariant data(const CollectionItem *item, int role) const;
|
||||||
bool CompareItems(const CollectionItem *a, const CollectionItem *b) const;
|
bool CompareItems(const CollectionItem *a, const CollectionItem *b) const;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
|
|
||||||
ContextItemDelegate::ContextItemDelegate(QObject *parent) : QStyledItemDelegate(parent) {}
|
ContextItemDelegate::ContextItemDelegate(QObject *parent) : QStyledItemDelegate(parent) {}
|
||||||
|
|
||||||
bool ContextItemDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index) {
|
bool ContextItemDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &idx) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -72,23 +72,23 @@ bool ContextItemDelegate::helpEvent(QHelpEvent *event, QAbstractItemView *view,
|
|||||||
if (!event || !view) return false;
|
if (!event || !view) return false;
|
||||||
|
|
||||||
QHelpEvent *he = static_cast<QHelpEvent*>(event);
|
QHelpEvent *he = static_cast<QHelpEvent*>(event);
|
||||||
QString text = displayText(index.data(), QLocale::system());
|
QString text = displayText(idx.data(), QLocale::system());
|
||||||
|
|
||||||
if (text.isEmpty() || !he) return false;
|
if (text.isEmpty() || !he) return false;
|
||||||
|
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::ToolTip: {
|
case QEvent::ToolTip: {
|
||||||
|
|
||||||
QSize real_text = sizeHint(option, index);
|
QSize real_text = sizeHint(option, idx);
|
||||||
QRect displayed_text = view->visualRect(index);
|
QRect displayed_text = view->visualRect(idx);
|
||||||
bool is_elided = displayed_text.width() < real_text.width();
|
bool is_elided = displayed_text.width() < real_text.width();
|
||||||
|
|
||||||
if (is_elided) {
|
if (is_elided) {
|
||||||
QToolTip::showText(he->globalPos(), text, view);
|
QToolTip::showText(he->globalPos(), text, view);
|
||||||
}
|
}
|
||||||
else if (index.data(Qt::ToolTipRole).isValid()) {
|
else if (idx.data(Qt::ToolTipRole).isValid()) {
|
||||||
// If the item has a tooltip text, display it
|
// If the item has a tooltip text, display it
|
||||||
QString tooltip_text = index.data(Qt::ToolTipRole).toString();
|
QString tooltip_text = idx.data(Qt::ToolTipRole).toString();
|
||||||
QToolTip::showText(he->globalPos(), tooltip_text, view);
|
QToolTip::showText(he->globalPos(), tooltip_text, view);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -231,8 +231,8 @@ void ContextAlbumsView::Init(Application *app) {
|
|||||||
|
|
||||||
setModel(model_);
|
setModel(model_);
|
||||||
|
|
||||||
connect(model_, SIGNAL(modelAboutToBeReset()), this, SLOT(SaveFocus()));
|
QObject::connect(model_, &ContextAlbumsModel::modelAboutToBeReset, this, &ContextAlbumsView::SaveFocus);
|
||||||
connect(model_, SIGNAL(modelReset()), this, SLOT(RestoreFocus()));
|
QObject::connect(model_, &ContextAlbumsModel::modelReset, this, &ContextAlbumsView::RestoreFocus);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,29 +249,29 @@ void ContextAlbumsView::contextMenuEvent(QContextMenuEvent *e) {
|
|||||||
if (!context_menu_) {
|
if (!context_menu_) {
|
||||||
context_menu_ = new QMenu(this);
|
context_menu_ = new QMenu(this);
|
||||||
|
|
||||||
add_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, SLOT(AddToPlaylist()));
|
add_to_playlist_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Append to current playlist"), this, &ContextAlbumsView::AddToPlaylist);
|
||||||
load_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, SLOT(Load()));
|
load_ = context_menu_->addAction(IconLoader::Load("media-playback-start"), tr("Replace current playlist"), this, &ContextAlbumsView::Load);
|
||||||
open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), tr("Open in new playlist"), this, SLOT(OpenInNewPlaylist()));
|
open_in_new_playlist_ = context_menu_->addAction(IconLoader::Load("document-new"), tr("Open in new playlist"), this, &ContextAlbumsView::OpenInNewPlaylist);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
add_to_playlist_enqueue_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue track"), this, SLOT(AddToPlaylistEnqueue()));
|
add_to_playlist_enqueue_ = context_menu_->addAction(IconLoader::Load("go-next"), tr("Queue track"), this, &ContextAlbumsView::AddToPlaylistEnqueue);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
organize_ = context_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organize files..."), this, SLOT(Organize()));
|
organize_ = context_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organize files..."), this, &ContextAlbumsView::Organize);
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
copy_to_device_ = context_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, SLOT(CopyToDevice()));
|
copy_to_device_ = context_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, &ContextAlbumsView::CopyToDevice);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
edit_track_ = context_menu_->addAction(IconLoader::Load("edit-rename"), tr("Edit track information..."), this, SLOT(EditTracks()));
|
edit_track_ = context_menu_->addAction(IconLoader::Load("edit-rename"), tr("Edit track information..."), this, &ContextAlbumsView::EditTracks);
|
||||||
edit_tracks_ = context_menu_->addAction(IconLoader::Load("edit-rename"), tr("Edit tracks information..."), this, SLOT(EditTracks()));
|
edit_tracks_ = context_menu_->addAction(IconLoader::Load("edit-rename"), tr("Edit tracks information..."), this, &ContextAlbumsView::EditTracks);
|
||||||
show_in_browser_ = context_menu_->addAction(IconLoader::Load("document-open-folder"), tr("Show in file browser..."), this, SLOT(ShowInBrowser()));
|
show_in_browser_ = context_menu_->addAction(IconLoader::Load("document-open-folder"), tr("Show in file browser..."), this, &ContextAlbumsView::ShowInBrowser);
|
||||||
|
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
|
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
||||||
connect(app_->device_manager()->connected_devices_model(), SIGNAL(IsEmptyChanged(bool)), copy_to_device_, SLOT(setDisabled(bool)));
|
QObject::connect(app_->device_manager()->connected_devices_model(), &DeviceStateFilterModel::IsEmptyChanged, copy_to_device_, &QAction::setDisabled);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -283,9 +283,9 @@ void ContextAlbumsView::contextMenuEvent(QContextMenuEvent *e) {
|
|||||||
int regular_elements = 0;
|
int regular_elements = 0;
|
||||||
int regular_editable = 0;
|
int regular_editable = 0;
|
||||||
|
|
||||||
for (const QModelIndex &index : selected_indexes) {
|
for (const QModelIndex &idx : selected_indexes) {
|
||||||
regular_elements++;
|
regular_elements++;
|
||||||
if(model_->data(index, ContextAlbumsModel::Role_Editable).toBool()) {
|
if (model_->data(idx, ContextAlbumsModel::Role_Editable).toBool()) {
|
||||||
regular_editable++;
|
regular_editable++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,12 +355,12 @@ void ContextAlbumsView::OpenInNewPlaylist() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContextAlbumsView::scrollTo(const QModelIndex &index, ScrollHint hint) {
|
void ContextAlbumsView::scrollTo(const QModelIndex &idx, ScrollHint hint) {
|
||||||
|
|
||||||
if (is_in_keyboard_search_)
|
if (is_in_keyboard_search_)
|
||||||
QTreeView::scrollTo(index, QAbstractItemView::PositionAtTop);
|
QTreeView::scrollTo(idx, QAbstractItemView::PositionAtTop);
|
||||||
else
|
else
|
||||||
QTreeView::scrollTo(index, hint);
|
QTreeView::scrollTo(idx, hint);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,4 +414,5 @@ void ContextAlbumsView::ShowInBrowser() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Utilities::OpenInFileBrowser(urls);
|
Utilities::OpenInFileBrowser(urls);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ class ContextItemDelegate : public QStyledItemDelegate {
|
|||||||
explicit ContextItemDelegate(QObject *parent);
|
explicit ContextItemDelegate(QObject *parent);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index) override;
|
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &idx) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ContextAlbumsView : public AutoExpandingTreeView {
|
class ContextAlbumsView : public AutoExpandingTreeView {
|
||||||
@ -74,7 +74,7 @@ class ContextAlbumsView : public AutoExpandingTreeView {
|
|||||||
void Init(Application *app);
|
void Init(Application *app);
|
||||||
|
|
||||||
// QTreeView
|
// QTreeView
|
||||||
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
|
void scrollTo(const QModelIndex &idx, ScrollHint hint = EnsureVisible) override;
|
||||||
|
|
||||||
ContextAlbumsModel *albums_model() { return model_; }
|
ContextAlbumsModel *albums_model() { return model_; }
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ ContextView::ContextView(QWidget *parent) :
|
|||||||
|
|
||||||
QFontDatabase::addApplicationFont(":/fonts/HumongousofEternitySt.ttf");
|
QFontDatabase::addApplicationFont(":/fonts/HumongousofEternitySt.ttf");
|
||||||
|
|
||||||
connect(widget_album_, SIGNAL(FadeStopFinished()), SLOT(FadeStopFinished()));
|
QObject::connect(widget_album_, &ContextAlbum::FadeStopFinished, this, &ContextView::FadeStopFinished);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,10 +305,10 @@ void ContextView::Init(Application *app, CollectionView *collectionview, AlbumCo
|
|||||||
widget_albums_->Init(app_);
|
widget_albums_->Init(app_);
|
||||||
lyrics_fetcher_ = new LyricsFetcher(app_->lyrics_providers(), this);
|
lyrics_fetcher_ = new LyricsFetcher(app_->lyrics_providers(), this);
|
||||||
|
|
||||||
connect(collectionview_, SIGNAL(TotalSongCountUpdated_()), this, SLOT(UpdateNoSong()));
|
QObject::connect(collectionview_, &CollectionView::TotalSongCountUpdated_, this, &ContextView::UpdateNoSong);
|
||||||
connect(collectionview_, SIGNAL(TotalArtistCountUpdated_()), this, SLOT(UpdateNoSong()));
|
QObject::connect(collectionview_, &CollectionView::TotalArtistCountUpdated_, this, &ContextView::UpdateNoSong);
|
||||||
connect(collectionview_, SIGNAL(TotalAlbumCountUpdated_()), this, SLOT(UpdateNoSong()));
|
QObject::connect(collectionview_, &CollectionView::TotalAlbumCountUpdated_, this, &ContextView::UpdateNoSong);
|
||||||
connect(lyrics_fetcher_, SIGNAL(LyricsFetched(quint64, QString, QString)), this, SLOT(UpdateLyrics(quint64, QString, QString)));
|
QObject::connect(lyrics_fetcher_, &LyricsFetcher::LyricsFetched, this, &ContextView::UpdateLyrics);
|
||||||
|
|
||||||
AddActions();
|
AddActions();
|
||||||
|
|
||||||
@ -350,12 +350,12 @@ void ContextView::AddActions() {
|
|||||||
|
|
||||||
ReloadSettings();
|
ReloadSettings();
|
||||||
|
|
||||||
connect(action_show_album_, SIGNAL(triggered()), this, SLOT(ActionShowAlbums()));
|
QObject::connect(action_show_album_, &QAction::triggered, this, &ContextView::ActionShowAlbums);
|
||||||
connect(action_show_data_, SIGNAL(triggered()), this, SLOT(ActionShowData()));
|
QObject::connect(action_show_data_, &QAction::triggered, this, &ContextView::ActionShowData);
|
||||||
connect(action_show_output_, SIGNAL(triggered()), this, SLOT(ActionShowOutput()));
|
QObject::connect(action_show_output_, &QAction::triggered, this, &ContextView::ActionShowOutput);
|
||||||
connect(action_show_albums_, SIGNAL(triggered()), this, SLOT(ActionShowAlbums()));
|
QObject::connect(action_show_albums_, &QAction::triggered, this, &ContextView::ActionShowAlbums);
|
||||||
connect(action_show_lyrics_, SIGNAL(triggered()), this, SLOT(ActionShowLyrics()));
|
QObject::connect(action_show_lyrics_, &QAction::triggered, this, &ContextView::ActionShowLyrics);
|
||||||
connect(action_search_lyrics_, SIGNAL(triggered()), this, SLOT(ActionSearchLyrics()));
|
QObject::connect(action_search_lyrics_, &QAction::triggered, this, &ContextView::ActionSearchLyrics);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,16 +92,16 @@ class ContextView : public QWidget {
|
|||||||
void ActionShowLyrics();
|
void ActionShowLyrics();
|
||||||
void ActionSearchLyrics();
|
void ActionSearchLyrics();
|
||||||
void UpdateNoSong();
|
void UpdateNoSong();
|
||||||
void Playing();
|
|
||||||
void Stopped();
|
|
||||||
void Error();
|
|
||||||
void SongChanged(const Song &song);
|
|
||||||
void AlbumCoverLoaded(const Song &song, const QImage &image);
|
|
||||||
void FadeStopFinished();
|
void FadeStopFinished();
|
||||||
void UpdateLyrics(const quint64 id, const QString &provider, const QString &lyrics);
|
void UpdateLyrics(const quint64 id, const QString &provider, const QString &lyrics);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void ReloadSettings();
|
void ReloadSettings();
|
||||||
|
void Playing();
|
||||||
|
void Stopped();
|
||||||
|
void Error();
|
||||||
|
void SongChanged(const Song &song);
|
||||||
|
void AlbumCoverLoaded(const Song &song, const QImage &image);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Application *app_;
|
Application *app_;
|
||||||
|
@ -265,24 +265,24 @@ void Application::Exit() {
|
|||||||
#endif
|
#endif
|
||||||
<< internet_services();
|
<< internet_services();
|
||||||
|
|
||||||
connect(tag_reader_client(), SIGNAL(ExitFinished()), this, SLOT(ExitReceived()));
|
QObject::connect(tag_reader_client(), &TagReaderClient::ExitFinished, this, &Application::ExitReceived);
|
||||||
tag_reader_client()->ExitAsync();
|
tag_reader_client()->ExitAsync();
|
||||||
|
|
||||||
connect(collection(), SIGNAL(ExitFinished()), this, SLOT(ExitReceived()));
|
QObject::connect(collection(), &SCollection::ExitFinished, this, &Application::ExitReceived);
|
||||||
collection()->Exit();
|
collection()->Exit();
|
||||||
|
|
||||||
connect(playlist_backend(), SIGNAL(ExitFinished()), this, SLOT(ExitReceived()));
|
QObject::connect(playlist_backend(), &PlaylistBackend::ExitFinished, this, &Application::ExitReceived);
|
||||||
playlist_backend()->ExitAsync();
|
playlist_backend()->ExitAsync();
|
||||||
|
|
||||||
connect(album_cover_loader(), SIGNAL(ExitFinished()), this, SLOT(ExitReceived()));
|
QObject::connect(album_cover_loader(), &AlbumCoverLoader::ExitFinished, this, &Application::ExitReceived);
|
||||||
album_cover_loader()->ExitAsync();
|
album_cover_loader()->ExitAsync();
|
||||||
|
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
connect(device_manager(), SIGNAL(ExitFinished()), this, SLOT(ExitReceived()));
|
QObject::connect(device_manager(), &DeviceManager::ExitFinished, this, &Application::ExitReceived);
|
||||||
device_manager()->Exit();
|
device_manager()->Exit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect(internet_services(), SIGNAL(ExitFinished()), this, SLOT(ExitReceived()));
|
QObject::connect(internet_services(), &InternetServices::ExitFinished, this, &Application::ExitReceived);
|
||||||
internet_services()->Exit();
|
internet_services()->Exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -290,14 +290,14 @@ void Application::Exit() {
|
|||||||
void Application::ExitReceived() {
|
void Application::ExitReceived() {
|
||||||
|
|
||||||
QObject *obj = static_cast<QObject*>(sender());
|
QObject *obj = static_cast<QObject*>(sender());
|
||||||
disconnect(obj, nullptr, this, nullptr);
|
QObject::disconnect(obj, nullptr, this, nullptr);
|
||||||
|
|
||||||
qLog(Debug) << obj << "successfully exited.";
|
qLog(Debug) << obj << "successfully exited.";
|
||||||
|
|
||||||
wait_for_exit_.removeAll(obj);
|
wait_for_exit_.removeAll(obj);
|
||||||
if (wait_for_exit_.isEmpty()) {
|
if (wait_for_exit_.isEmpty()) {
|
||||||
database()->Close();
|
database()->Close();
|
||||||
connect(database(), SIGNAL(ExitFinished()), this, SIGNAL(ExitFinished()));
|
QObject::connect(database(), &Database::ExitFinished, this, &Application::ExitFinished);
|
||||||
database()->ExitAsync();
|
database()->ExitAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ class Application : public QObject {
|
|||||||
void OpenSettingsDialogAtPage(SettingsDialog::Page page);
|
void OpenSettingsDialogAtPage(SettingsDialog::Page page);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void ErrorAdded(const QString &message);
|
void ErrorAdded(QString message);
|
||||||
void SettingsChanged();
|
void SettingsChanged();
|
||||||
void SettingsDialogRequested(SettingsDialog::Page page);
|
void SettingsDialogRequested(SettingsDialog::Page page);
|
||||||
void ExitFinished();
|
void ExitFinished();
|
||||||
|
@ -128,4 +128,3 @@ QDataStream &operator<<(QDataStream &s, const CommandlineOptions &a);
|
|||||||
QDataStream &operator>>(QDataStream &s, CommandlineOptions &a);
|
QDataStream &operator>>(QDataStream &s, CommandlineOptions &a);
|
||||||
|
|
||||||
#endif // COMMANDLINEOPTIONS_H
|
#endif // COMMANDLINEOPTIONS_H
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ class Database : public QObject {
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void ExitFinished();
|
void ExitFinished();
|
||||||
void Error(const QString &message);
|
void Error(QString message);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void Exit();
|
void Exit();
|
||||||
|
@ -57,7 +57,7 @@ void DeleteFiles::Start(const SongList &songs) {
|
|||||||
task_manager_->SetTaskBlocksCollectionScans(true);
|
task_manager_->SetTaskBlocksCollectionScans(true);
|
||||||
|
|
||||||
thread_ = new QThread(this);
|
thread_ = new QThread(this);
|
||||||
connect(thread_, SIGNAL(started()), SLOT(ProcessSomeFiles()));
|
QObject::connect(thread_, &QThread::started, this, &DeleteFiles::ProcessSomeFiles);
|
||||||
|
|
||||||
moveToThread(thread_);
|
moveToThread(thread_);
|
||||||
thread_->start();
|
thread_->start();
|
||||||
@ -120,7 +120,7 @@ void DeleteFiles::ProcessSomeFiles() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QTimer::singleShot(0, this, SLOT(ProcessSomeFiles()));
|
QTimer::singleShot(0, this, &DeleteFiles::ProcessSomeFiles);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ class DeleteFiles : public QObject {
|
|||||||
void Start(const SongList &songs);
|
void Start(const SongList &songs);
|
||||||
void Start(const QStringList &filenames);
|
void Start(const QStringList &filenames);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void Finished(const SongList &songs_with_errors);
|
void Finished(SongList songs_with_errors);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ProcessSomeFiles();
|
void ProcessSomeFiles();
|
||||||
|
@ -43,8 +43,8 @@ class MacFSListener : public FileSystemWatcherInterface {
|
|||||||
void RemovePath(const QString &path);
|
void RemovePath(const QString &path);
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void PathChanged(const QString &path);
|
void PathChanged(QString path);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void UpdateStream();
|
void UpdateStream();
|
||||||
|
@ -39,7 +39,7 @@ MacFSListener::MacFSListener(QObject* parent)
|
|||||||
|
|
||||||
update_timer_->setSingleShot(true);
|
update_timer_->setSingleShot(true);
|
||||||
update_timer_->setInterval(2000);
|
update_timer_->setInterval(2000);
|
||||||
connect(update_timer_, SIGNAL(timeout()), SLOT(UpdateStream()));
|
QObject::connect(update_timer_, &QTimer::timeout, this, &MacFSListener::UpdateStream);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,17 +46,17 @@ class MacSystemTrayIcon : public SystemTrayIcon {
|
|||||||
void SetNowPlaying(const Song& song, const QUrl &cover_url);
|
void SetNowPlaying(const Song& song, const QUrl &cover_url);
|
||||||
void ClearNowPlaying();
|
void ClearNowPlaying();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetupMenuItem(QAction *action);
|
void SetupMenuItem(QAction *action);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ActionChanged();
|
void ActionChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// SystemTrayIcon
|
// SystemTrayIcon
|
||||||
void UpdateIcon();
|
void UpdateIcon();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPixmap normal_icon_;
|
QPixmap normal_icon_;
|
||||||
QPixmap grey_icon_;
|
QPixmap grey_icon_;
|
||||||
std::unique_ptr<MacSystemTrayIconPrivate> p_;
|
std::unique_ptr<MacSystemTrayIconPrivate> p_;
|
||||||
|
@ -191,7 +191,7 @@ void MacSystemTrayIcon::SetupMenu(QAction* previous, QAction* play, QAction* sto
|
|||||||
|
|
||||||
void MacSystemTrayIcon::SetupMenuItem(QAction* action) {
|
void MacSystemTrayIcon::SetupMenuItem(QAction* action) {
|
||||||
p_->AddMenuItem(action);
|
p_->AddMenuItem(action);
|
||||||
connect(action, SIGNAL(changed()), SLOT(ActionChanged()));
|
QObject::connect(action, &QAction::changed, this, &MacSystemTrayIcon::ActionChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacSystemTrayIcon::UpdateIcon() {
|
void MacSystemTrayIcon::UpdateIcon() {
|
||||||
|
@ -245,7 +245,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
cover_manager->Init();
|
cover_manager->Init();
|
||||||
|
|
||||||
// Cover manager connections
|
// Cover manager connections
|
||||||
connect(cover_manager, SIGNAL(AddToPlaylist(QMimeData*)), this, SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(cover_manager, &AlbumCoverManager::AddToPlaylist, this, &MainWindow::AddToPlaylist);
|
||||||
return cover_manager;
|
return cover_manager;
|
||||||
}),
|
}),
|
||||||
equalizer_(new Equalizer),
|
equalizer_(new Equalizer),
|
||||||
@ -262,7 +262,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
#endif
|
#endif
|
||||||
add_stream_dialog_([=]() {
|
add_stream_dialog_([=]() {
|
||||||
AddStreamDialog *add_stream_dialog = new AddStreamDialog;
|
AddStreamDialog *add_stream_dialog = new AddStreamDialog;
|
||||||
connect(add_stream_dialog, SIGNAL(accepted()), this, SLOT(AddStreamAccepted()));
|
QObject::connect(add_stream_dialog, &AddStreamDialog::accepted, this, &MainWindow::AddStreamAccepted);
|
||||||
return add_stream_dialog;
|
return add_stream_dialog;
|
||||||
}),
|
}),
|
||||||
smartplaylists_view_(new SmartPlaylistsViewContainer(app, this)),
|
smartplaylists_view_(new SmartPlaylistsViewContainer(app, this)),
|
||||||
@ -318,8 +318,8 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
|
|
||||||
qLog(Debug) << "Starting";
|
qLog(Debug) << "Starting";
|
||||||
|
|
||||||
connect(app, SIGNAL(ErrorAdded(QString)), SLOT(ShowErrorDialog(QString)));
|
QObject::connect(app, &Application::ErrorAdded, this, &MainWindow::ShowErrorDialog);
|
||||||
connect(app, SIGNAL(SettingsDialogRequested(SettingsDialog::Page)), SLOT(OpenSettingsDialogAtPage(SettingsDialog::Page)));
|
QObject::connect(app, &Application::SettingsDialogRequested, this, &MainWindow::OpenSettingsDialogAtPage);
|
||||||
|
|
||||||
// Initialize the UI
|
// Initialize the UI
|
||||||
ui_->setupUi(this);
|
ui_->setupUi(this);
|
||||||
@ -359,9 +359,9 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
ui_->tabs->Load(kSettingsGroup);
|
ui_->tabs->Load(kSettingsGroup);
|
||||||
|
|
||||||
track_position_timer_->setInterval(kTrackPositionUpdateTimeMs);
|
track_position_timer_->setInterval(kTrackPositionUpdateTimeMs);
|
||||||
connect(track_position_timer_, SIGNAL(timeout()), SLOT(UpdateTrackPosition()));
|
QObject::connect(track_position_timer_, &QTimer::timeout, this, &MainWindow::UpdateTrackPosition);
|
||||||
track_slider_timer_->setInterval(kTrackSliderUpdateTimeMs);
|
track_slider_timer_->setInterval(kTrackSliderUpdateTimeMs);
|
||||||
connect(track_slider_timer_, SIGNAL(timeout()), SLOT(UpdateTrackSliderPosition()));
|
QObject::connect(track_slider_timer_, &QTimer::timeout, this, &MainWindow::UpdateTrackSliderPosition);
|
||||||
|
|
||||||
// Start initializing the player
|
// Start initializing the player
|
||||||
qLog(Debug) << "Initializing player";
|
qLog(Debug) << "Initializing player";
|
||||||
@ -383,7 +383,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
|
|
||||||
qLog(Debug) << "Creating models finished";
|
qLog(Debug) << "Creating models finished";
|
||||||
|
|
||||||
connect(ui_->playlist, SIGNAL(ViewSelectionModelChanged()), SLOT(PlaylistViewSelectionModelChanged()));
|
QObject::connect(ui_->playlist, &PlaylistContainer::ViewSelectionModelChanged, this, &MainWindow::PlaylistViewSelectionModelChanged);
|
||||||
|
|
||||||
ui_->playlist->SetManager(app_->playlist_manager());
|
ui_->playlist->SetManager(app_->playlist_manager());
|
||||||
|
|
||||||
@ -453,70 +453,70 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
ui_->action_love->setIcon(IconLoader::Load("love"));
|
ui_->action_love->setIcon(IconLoader::Load("love"));
|
||||||
|
|
||||||
// File view connections
|
// File view connections
|
||||||
connect(file_view_, SIGNAL(AddToPlaylist(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(file_view_, &FileView::AddToPlaylist, this, &MainWindow::AddToPlaylist);
|
||||||
connect(file_view_, SIGNAL(PathChanged(QString)), SLOT(FilePathChanged(QString)));
|
QObject::connect(file_view_, &FileView::PathChanged, this, &MainWindow::FilePathChanged);
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
connect(file_view_, SIGNAL(CopyToCollection(QList<QUrl>)), SLOT(CopyFilesToCollection(QList<QUrl>)));
|
QObject::connect(file_view_, &FileView::CopyToCollection, this, &MainWindow::CopyFilesToCollection);
|
||||||
connect(file_view_, SIGNAL(MoveToCollection(QList<QUrl>)), SLOT(MoveFilesToCollection(QList<QUrl>)));
|
QObject::connect(file_view_, &FileView::MoveToCollection, this, &MainWindow::MoveFilesToCollection);
|
||||||
connect(file_view_, SIGNAL(EditTags(QList<QUrl>)), SLOT(EditFileTags(QList<QUrl>)));
|
QObject::connect(file_view_, &FileView::EditTags, this, &MainWindow::EditFileTags);
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
connect(file_view_, SIGNAL(CopyToDevice(QList<QUrl>)), SLOT(CopyFilesToDevice(QList<QUrl>)));
|
QObject::connect(file_view_, &FileView::CopyToDevice, this, &MainWindow::CopyFilesToDevice);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
file_view_->SetTaskManager(app_->task_manager());
|
file_view_->SetTaskManager(app_->task_manager());
|
||||||
|
|
||||||
// Action connections
|
// Action connections
|
||||||
connect(ui_->action_next_track, SIGNAL(triggered()), app_->player(), SLOT(Next()));
|
QObject::connect(ui_->action_next_track, &QAction::triggered, app_->player(), &Player::Next);
|
||||||
connect(ui_->action_previous_track, SIGNAL(triggered()), app_->player(), SLOT(Previous()));
|
QObject::connect(ui_->action_previous_track, &QAction::triggered, app_->player(), &Player::Previous);
|
||||||
connect(ui_->action_play_pause, SIGNAL(triggered()), app_->player(), SLOT(PlayPause()));
|
QObject::connect(ui_->action_play_pause, &QAction::triggered, app_->player(), &Player::PlayPauseHelper);
|
||||||
connect(ui_->action_stop, SIGNAL(triggered()), app_->player(), SLOT(Stop()));
|
QObject::connect(ui_->action_stop, &QAction::triggered, app_->player(), &Player::Stop);
|
||||||
connect(ui_->action_quit, SIGNAL(triggered()), SLOT(Exit()));
|
QObject::connect(ui_->action_quit, &QAction::triggered, this, &MainWindow::Exit);
|
||||||
connect(ui_->action_stop_after_this_track, SIGNAL(triggered()), SLOT(StopAfterCurrent()));
|
QObject::connect(ui_->action_stop_after_this_track, &QAction::triggered, this, &MainWindow::StopAfterCurrent);
|
||||||
connect(ui_->action_mute, SIGNAL(triggered()), app_->player(), SLOT(Mute()));
|
QObject::connect(ui_->action_mute, &QAction::triggered, app_->player(), &Player::Mute);
|
||||||
|
|
||||||
connect(ui_->action_clear_playlist, SIGNAL(triggered()), SLOT(PlaylistClearCurrent()));
|
QObject::connect(ui_->action_clear_playlist, &QAction::triggered, this, &MainWindow::PlaylistClearCurrent);
|
||||||
connect(ui_->action_remove_duplicates, SIGNAL(triggered()), app_->playlist_manager(), SLOT(RemoveDuplicatesCurrent()));
|
QObject::connect(ui_->action_remove_duplicates, &QAction::triggered, app_->playlist_manager(), &PlaylistManager::RemoveDuplicatesCurrent);
|
||||||
connect(ui_->action_remove_unavailable, SIGNAL(triggered()), app_->playlist_manager(), SLOT(RemoveUnavailableCurrent()));
|
QObject::connect(ui_->action_remove_unavailable, &QAction::triggered, app_->playlist_manager(), &PlaylistManager::RemoveUnavailableCurrent);
|
||||||
connect(ui_->action_remove_from_playlist, SIGNAL(triggered()), SLOT(PlaylistRemoveCurrent()));
|
QObject::connect(ui_->action_remove_from_playlist, &QAction::triggered, this, &MainWindow::PlaylistRemoveCurrent);
|
||||||
connect(ui_->action_edit_track, SIGNAL(triggered()), SLOT(EditTracks()));
|
QObject::connect(ui_->action_edit_track, &QAction::triggered, this, &MainWindow::EditTracks);
|
||||||
connect(ui_->action_renumber_tracks, SIGNAL(triggered()), SLOT(RenumberTracks()));
|
QObject::connect(ui_->action_renumber_tracks, &QAction::triggered, this, &MainWindow::RenumberTracks);
|
||||||
connect(ui_->action_selection_set_value, SIGNAL(triggered()), SLOT(SelectionSetValue()));
|
QObject::connect(ui_->action_selection_set_value, &QAction::triggered, this, &MainWindow::SelectionSetValue);
|
||||||
connect(ui_->action_edit_value, SIGNAL(triggered()), SLOT(EditValue()));
|
QObject::connect(ui_->action_edit_value, &QAction::triggered, this, &MainWindow::EditValue);
|
||||||
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT)
|
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT)
|
||||||
connect(ui_->action_auto_complete_tags, SIGNAL(triggered()), SLOT(AutoCompleteTags()));
|
QObject::connect(ui_->action_auto_complete_tags, &QAction::triggered, this, &MainWindow::AutoCompleteTags);
|
||||||
#endif
|
#endif
|
||||||
connect(ui_->action_settings, SIGNAL(triggered()), SLOT(OpenSettingsDialog()));
|
QObject::connect(ui_->action_settings, &QAction::triggered, this, &MainWindow::OpenSettingsDialog);
|
||||||
connect(ui_->action_import_data_from_last_fm, SIGNAL(triggered()), lastfm_import_dialog_, SLOT(show()));
|
QObject::connect(ui_->action_import_data_from_last_fm, &QAction::triggered, lastfm_import_dialog_, &LastFMImportDialog::show);
|
||||||
connect(ui_->action_toggle_show_sidebar, SIGNAL(toggled(bool)), SLOT(ToggleSidebar(bool)));
|
QObject::connect(ui_->action_toggle_show_sidebar, &QAction::toggled, this, &MainWindow::ToggleSidebar);
|
||||||
connect(ui_->action_about_strawberry, SIGNAL(triggered()), SLOT(ShowAboutDialog()));
|
QObject::connect(ui_->action_about_strawberry, &QAction::triggered, this, &MainWindow::ShowAboutDialog);
|
||||||
connect(ui_->action_about_qt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
|
QObject::connect(ui_->action_about_qt, &QAction::triggered, qApp, &QApplication::aboutQt);
|
||||||
connect(ui_->action_shuffle, SIGNAL(triggered()), app_->playlist_manager(), SLOT(ShuffleCurrent()));
|
QObject::connect(ui_->action_shuffle, &QAction::triggered, app_->playlist_manager(), &PlaylistManager::ShuffleCurrent);
|
||||||
connect(ui_->action_open_file, SIGNAL(triggered()), SLOT(AddFile()));
|
QObject::connect(ui_->action_open_file, &QAction::triggered, this, &MainWindow::AddFile);
|
||||||
connect(ui_->action_open_cd, SIGNAL(triggered()), SLOT(AddCDTracks()));
|
QObject::connect(ui_->action_open_cd, &QAction::triggered, this, &MainWindow::AddCDTracks);
|
||||||
connect(ui_->action_add_file, SIGNAL(triggered()), SLOT(AddFile()));
|
QObject::connect(ui_->action_add_file, &QAction::triggered, this, &MainWindow::AddFile);
|
||||||
connect(ui_->action_add_folder, SIGNAL(triggered()), SLOT(AddFolder()));
|
QObject::connect(ui_->action_add_folder, &QAction::triggered, this, &MainWindow::AddFolder);
|
||||||
connect(ui_->action_add_stream, SIGNAL(triggered()), SLOT(AddStream()));
|
QObject::connect(ui_->action_add_stream, &QAction::triggered, this, &MainWindow::AddStream);
|
||||||
connect(ui_->action_cover_manager, SIGNAL(triggered()), SLOT(ShowCoverManager()));
|
QObject::connect(ui_->action_cover_manager, &QAction::triggered, this, &MainWindow::ShowCoverManager);
|
||||||
connect(ui_->action_equalizer, SIGNAL(triggered()), SLOT(ShowEqualizer()));
|
QObject::connect(ui_->action_equalizer, &QAction::triggered, this, &MainWindow::ShowEqualizer);
|
||||||
#if defined(HAVE_GSTREAMER)
|
#if defined(HAVE_GSTREAMER)
|
||||||
connect(ui_->action_transcoder, SIGNAL(triggered()), SLOT(ShowTranscodeDialog()));
|
QObject::connect(ui_->action_transcoder, &QAction::triggered, this, &MainWindow::ShowTranscodeDialog);
|
||||||
#else
|
#else
|
||||||
ui_->action_transcoder->setDisabled(true);
|
ui_->action_transcoder->setDisabled(true);
|
||||||
#endif
|
#endif
|
||||||
connect(ui_->action_jump, SIGNAL(triggered()), ui_->playlist->view(), SLOT(JumpToCurrentlyPlayingTrack()));
|
QObject::connect(ui_->action_jump, &QAction::triggered, ui_->playlist->view(), &PlaylistView::JumpToCurrentlyPlayingTrack);
|
||||||
connect(ui_->action_update_collection, SIGNAL(triggered()), app_->collection(), SLOT(IncrementalScan()));
|
QObject::connect(ui_->action_update_collection, &QAction::triggered, app_->collection(), &SCollection::IncrementalScan);
|
||||||
connect(ui_->action_full_collection_scan, SIGNAL(triggered()), app_->collection(), SLOT(FullScan()));
|
QObject::connect(ui_->action_full_collection_scan, &QAction::triggered, app_->collection(), &SCollection::FullScan);
|
||||||
connect(ui_->action_abort_collection_scan, SIGNAL(triggered()), app_->collection(), SLOT(AbortScan()));
|
QObject::connect(ui_->action_abort_collection_scan, &QAction::triggered, app_->collection(), &SCollection::AbortScan);
|
||||||
#if defined(HAVE_GSTREAMER)
|
#if defined(HAVE_GSTREAMER)
|
||||||
connect(ui_->action_add_files_to_transcoder, SIGNAL(triggered()), SLOT(AddFilesToTranscoder()));
|
QObject::connect(ui_->action_add_files_to_transcoder, &QAction::triggered, this, &MainWindow::AddFilesToTranscoder);
|
||||||
ui_->action_add_files_to_transcoder->setIcon(IconLoader::Load("tools-wizard"));
|
ui_->action_add_files_to_transcoder->setIcon(IconLoader::Load("tools-wizard"));
|
||||||
#else
|
#else
|
||||||
ui_->action_add_files_to_transcoder->setDisabled(true);
|
ui_->action_add_files_to_transcoder->setDisabled(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect(ui_->action_toggle_scrobbling, SIGNAL(triggered()), app_->scrobbler(), SLOT(ToggleScrobbling()));
|
QObject::connect(ui_->action_toggle_scrobbling, &QAction::triggered, app_->scrobbler(), &AudioScrobbler::ToggleScrobbling);
|
||||||
connect(ui_->action_love, SIGNAL(triggered()), SLOT(Love()));
|
QObject::connect(ui_->action_love, &QAction::triggered, this, &MainWindow::Love);
|
||||||
connect(app_->scrobbler(), SIGNAL(ErrorMessage(QString)), SLOT(ShowErrorDialog(QString)));
|
QObject::connect(app_->scrobbler(), &AudioScrobbler::ErrorMessage, this, &MainWindow::ShowErrorDialog);
|
||||||
|
|
||||||
// Playlist view actions
|
// Playlist view actions
|
||||||
ui_->action_next_playlist->setShortcuts(QList<QKeySequence>() << QKeySequence::fromString("Ctrl+Tab")<< QKeySequence::fromString("Ctrl+PgDown"));
|
ui_->action_next_playlist->setShortcuts(QList<QKeySequence>() << QKeySequence::fromString("Ctrl+Tab")<< QKeySequence::fromString("Ctrl+PgDown"));
|
||||||
@ -547,79 +547,79 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
ui_->stop_button->setMenu(stop_menu);
|
ui_->stop_button->setMenu(stop_menu);
|
||||||
|
|
||||||
// Player connections
|
// Player connections
|
||||||
connect(ui_->volume, SIGNAL(valueChanged(int)), app_->player(), SLOT(SetVolume(int)));
|
QObject::connect(ui_->volume, &VolumeSlider::valueChanged, app_->player(), &Player::SetVolume);
|
||||||
|
|
||||||
connect(app_->player(), SIGNAL(EngineChanged(Engine::EngineType)), SLOT(EngineChanged(Engine::EngineType)));
|
QObject::connect(app_->player(), &Player::EngineChanged, this, &MainWindow::EngineChanged);
|
||||||
connect(app_->player(), SIGNAL(Error(QString)), SLOT(ShowErrorDialog(QString)));
|
QObject::connect(app_->player(), &Player::Error, this, &MainWindow::ShowErrorDialog);
|
||||||
connect(app_->player(), SIGNAL(SongChangeRequestProcessed(QUrl,bool)), app_->playlist_manager(), SLOT(SongChangeRequestProcessed(QUrl,bool)));
|
QObject::connect(app_->player(), &Player::SongChangeRequestProcessed, app_->playlist_manager(), &PlaylistManager::SongChangeRequestProcessed);
|
||||||
|
|
||||||
connect(app_->player(), SIGNAL(Paused()), SLOT(MediaPaused()));
|
QObject::connect(app_->player(), &Player::Paused, this, &MainWindow::MediaPaused);
|
||||||
connect(app_->player(), SIGNAL(Playing()), SLOT(MediaPlaying()));
|
QObject::connect(app_->player(), &Player::Playing, this, &MainWindow::MediaPlaying);
|
||||||
connect(app_->player(), SIGNAL(Stopped()), SLOT(MediaStopped()));
|
QObject::connect(app_->player(), &Player::Stopped, this, &MainWindow::MediaStopped);
|
||||||
connect(app_->player(), SIGNAL(Seeked(qlonglong)), SLOT(Seeked(qlonglong)));
|
QObject::connect(app_->player(), &Player::Seeked, this, &MainWindow::Seeked);
|
||||||
connect(app_->player(), SIGNAL(TrackSkipped(PlaylistItemPtr)), SLOT(TrackSkipped(PlaylistItemPtr)));
|
QObject::connect(app_->player(), &Player::TrackSkipped, this, &MainWindow::TrackSkipped);
|
||||||
connect(app_->player(), SIGNAL(VolumeChanged(int)), SLOT(VolumeChanged(int)));
|
QObject::connect(app_->player(), &Player::VolumeChanged, this, &MainWindow::VolumeChanged);
|
||||||
|
|
||||||
connect(app_->player(), SIGNAL(Paused()), ui_->playlist, SLOT(ActivePaused()));
|
QObject::connect(app_->player(), &Player::Paused, ui_->playlist, &PlaylistContainer::ActivePaused);
|
||||||
connect(app_->player(), SIGNAL(Playing()), ui_->playlist, SLOT(ActivePlaying()));
|
QObject::connect(app_->player(), &Player::Playing, ui_->playlist, &PlaylistContainer::ActivePlaying);
|
||||||
connect(app_->player(), SIGNAL(Stopped()), ui_->playlist, SLOT(ActiveStopped()));
|
QObject::connect(app_->player(), &Player::Stopped, ui_->playlist, &PlaylistContainer::ActiveStopped);
|
||||||
|
|
||||||
connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), osd_, SLOT(SongChanged(Song)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::CurrentSongChanged, osd_, &OSDBase::SongChanged);
|
||||||
connect(app_->player(), SIGNAL(Paused()), osd_, SLOT(Paused()));
|
QObject::connect(app_->player(), &Player::Paused, osd_, &OSDBase::Paused);
|
||||||
connect(app_->player(), SIGNAL(Resumed()), osd_, SLOT(Resumed()));
|
QObject::connect(app_->player(), &Player::Resumed, osd_, &OSDBase::Resumed);
|
||||||
connect(app_->player(), SIGNAL(Stopped()), osd_, SLOT(Stopped()));
|
QObject::connect(app_->player(), &Player::Stopped, osd_, &OSDBase::Stopped);
|
||||||
connect(app_->player(), SIGNAL(PlaylistFinished()), osd_, SLOT(PlaylistFinished()));
|
QObject::connect(app_->player(), &Player::PlaylistFinished, osd_, &OSDBase::PlaylistFinished);
|
||||||
connect(app_->player(), SIGNAL(VolumeChanged(int)), osd_, SLOT(VolumeChanged(int)));
|
QObject::connect(app_->player(), &Player::VolumeChanged, osd_, &OSDBase::VolumeChanged);
|
||||||
connect(app_->player(), SIGNAL(VolumeChanged(int)), ui_->volume, SLOT(setValue(int)));
|
QObject::connect(app_->player(), &Player::VolumeChanged, ui_->volume, &VolumeSlider::setValue);
|
||||||
connect(app_->player(), SIGNAL(ForceShowOSD(Song, bool)), SLOT(ForceShowOSD(Song, bool)));
|
QObject::connect(app_->player(), &Player::ForceShowOSD, this, &MainWindow::ForceShowOSD);
|
||||||
|
|
||||||
connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), SLOT(SongChanged(Song)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::CurrentSongChanged, this, &MainWindow::SongChanged);
|
||||||
connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), app_->player(), SLOT(CurrentMetadataChanged(Song)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::CurrentSongChanged, app_->player(), &Player::CurrentMetadataChanged);
|
||||||
connect(app_->playlist_manager(), SIGNAL(EditingFinished(QModelIndex)), SLOT(PlaylistEditFinished(QModelIndex)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::EditingFinished, this, &MainWindow::PlaylistEditFinished);
|
||||||
connect(app_->playlist_manager(), SIGNAL(Error(QString)), SLOT(ShowErrorDialog(QString)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::Error, this, &MainWindow::ShowErrorDialog);
|
||||||
connect(app_->playlist_manager(), SIGNAL(SummaryTextChanged(QString)), ui_->playlist_summary, SLOT(setText(QString)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::SummaryTextChanged, ui_->playlist_summary, &QLabel::setText);
|
||||||
connect(app_->playlist_manager(), SIGNAL(PlayRequested(QModelIndex, Playlist::AutoScroll)), SLOT(PlayIndex(QModelIndex, Playlist::AutoScroll)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::PlayRequested, this, &MainWindow::PlayIndex);
|
||||||
|
|
||||||
connect(ui_->playlist->view(), SIGNAL(doubleClicked(QModelIndex)), SLOT(PlaylistDoubleClick(QModelIndex)));
|
QObject::connect(ui_->playlist->view(), &PlaylistView::doubleClicked, this, &MainWindow::PlaylistDoubleClick);
|
||||||
connect(ui_->playlist->view(), SIGNAL(PlayItem(QModelIndex, Playlist::AutoScroll)), SLOT(PlayIndex(QModelIndex, Playlist::AutoScroll)));
|
QObject::connect(ui_->playlist->view(), &PlaylistView::PlayItem, this, &MainWindow::PlayIndex);
|
||||||
connect(ui_->playlist->view(), SIGNAL(PlayPause(Playlist::AutoScroll)), app_->player(), SLOT(PlayPause(Playlist::AutoScroll)));
|
QObject::connect(ui_->playlist->view(), &PlaylistView::PlayPause, app_->player(), &Player::PlayPause);
|
||||||
connect(ui_->playlist->view(), SIGNAL(RightClicked(QPoint, QModelIndex)), SLOT(PlaylistRightClick(QPoint, QModelIndex)));
|
QObject::connect(ui_->playlist->view(), &PlaylistView::RightClicked, this, &MainWindow::PlaylistRightClick);
|
||||||
connect(ui_->playlist->view(), SIGNAL(SeekForward()), app_->player(), SLOT(SeekForward()));
|
QObject::connect(ui_->playlist->view(), &PlaylistView::SeekForward, app_->player(), &Player::SeekForward);
|
||||||
connect(ui_->playlist->view(), SIGNAL(SeekBackward()), app_->player(), SLOT(SeekBackward()));
|
QObject::connect(ui_->playlist->view(), &PlaylistView::SeekBackward, app_->player(), &Player::SeekBackward);
|
||||||
connect(ui_->playlist->view(), SIGNAL(BackgroundPropertyChanged()), SLOT(RefreshStyleSheet()));
|
QObject::connect(ui_->playlist->view(), &PlaylistView::BackgroundPropertyChanged, this, &MainWindow::RefreshStyleSheet);
|
||||||
|
|
||||||
connect(ui_->track_slider, SIGNAL(ValueChangedSeconds(int)), app_->player(), SLOT(SeekTo(int)));
|
QObject::connect(ui_->track_slider, &TrackSlider::ValueChangedSeconds, app_->player(), &Player::SeekTo);
|
||||||
connect(ui_->track_slider, SIGNAL(SeekForward()), app_->player(), SLOT(SeekForward()));
|
QObject::connect(ui_->track_slider, &TrackSlider::SeekForward, app_->player(), &Player::SeekForward);
|
||||||
connect(ui_->track_slider, SIGNAL(SeekBackward()), app_->player(), SLOT(SeekBackward()));
|
QObject::connect(ui_->track_slider, &TrackSlider::SeekBackward, app_->player(), &Player::SeekBackward);
|
||||||
connect(ui_->track_slider, SIGNAL(Previous()), app_->player(), SLOT(Previous()));
|
QObject::connect(ui_->track_slider, &TrackSlider::Previous, app_->player(), &Player::Previous);
|
||||||
connect(ui_->track_slider, SIGNAL(Next()), app_->player(), SLOT(Next()));
|
QObject::connect(ui_->track_slider, &TrackSlider::Next, app_->player(), &Player::Next);
|
||||||
|
|
||||||
// Collection connections
|
// Collection connections
|
||||||
connect(collection_view_->view(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(collection_view_->view(), &CollectionView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
connect(collection_view_->view(), SIGNAL(ShowConfigDialog()), SLOT(ShowCollectionConfig()));
|
QObject::connect(collection_view_->view(), &CollectionView::ShowConfigDialog, this, &MainWindow::ShowCollectionConfig);
|
||||||
connect(collection_view_->view(), SIGNAL(Error(QString)), SLOT(ShowErrorDialog(QString)));
|
QObject::connect(collection_view_->view(), &CollectionView::Error, this, &MainWindow::ShowErrorDialog);
|
||||||
connect(app_->collection_model(), SIGNAL(TotalSongCountUpdated(int)), collection_view_->view(), SLOT(TotalSongCountUpdated(int)));
|
QObject::connect(app_->collection_model(), &CollectionModel::TotalSongCountUpdated, collection_view_->view(), &CollectionView::TotalSongCountUpdated);
|
||||||
connect(app_->collection_model(), SIGNAL(TotalArtistCountUpdated(int)), collection_view_->view(), SLOT(TotalArtistCountUpdated(int)));
|
QObject::connect(app_->collection_model(), &CollectionModel::TotalArtistCountUpdated, collection_view_->view(), &CollectionView::TotalArtistCountUpdated);
|
||||||
connect(app_->collection_model(), SIGNAL(TotalAlbumCountUpdated(int)), collection_view_->view(), SLOT(TotalAlbumCountUpdated(int)));
|
QObject::connect(app_->collection_model(), &CollectionModel::TotalAlbumCountUpdated, collection_view_->view(), &CollectionView::TotalAlbumCountUpdated);
|
||||||
connect(app_->collection_model(), SIGNAL(modelAboutToBeReset()), collection_view_->view(), SLOT(SaveFocus()));
|
QObject::connect(app_->collection_model(), &CollectionModel::modelAboutToBeReset, collection_view_->view(), &CollectionView::SaveFocus);
|
||||||
connect(app_->collection_model(), SIGNAL(modelReset()), collection_view_->view(), SLOT(RestoreFocus()));
|
QObject::connect(app_->collection_model(), &CollectionModel::modelReset, collection_view_->view(), &CollectionView::RestoreFocus);
|
||||||
|
|
||||||
connect(app_->task_manager(), SIGNAL(PauseCollectionWatchers()), app_->collection(), SLOT(PauseWatcher()));
|
QObject::connect(app_->task_manager(), &TaskManager::PauseCollectionWatchers, app_->collection(), &SCollection::PauseWatcher);
|
||||||
connect(app_->task_manager(), SIGNAL(ResumeCollectionWatchers()), app_->collection(), SLOT(ResumeWatcher()));
|
QObject::connect(app_->task_manager(), &TaskManager::ResumeCollectionWatchers, app_->collection(), &SCollection::ResumeWatcher);
|
||||||
|
|
||||||
connect(app_->current_albumcover_loader(), SIGNAL(AlbumCoverLoaded(Song, AlbumCoverLoaderResult)), SLOT(AlbumCoverLoaded(Song, AlbumCoverLoaderResult)));
|
QObject::connect(app_->current_albumcover_loader(), &CurrentAlbumCoverLoader::AlbumCoverLoaded, this, &MainWindow::AlbumCoverLoaded);
|
||||||
connect(album_cover_choice_controller_->cover_from_file_action(), SIGNAL(triggered()), this, SLOT(LoadCoverFromFile()));
|
QObject::connect(album_cover_choice_controller_->cover_from_file_action(), &QAction::triggered, this, &MainWindow::LoadCoverFromFile);
|
||||||
connect(album_cover_choice_controller_->cover_to_file_action(), SIGNAL(triggered()), this, SLOT(SaveCoverToFile()));
|
QObject::connect(album_cover_choice_controller_->cover_to_file_action(), &QAction::triggered, this, &MainWindow::SaveCoverToFile);
|
||||||
connect(album_cover_choice_controller_->cover_from_url_action(), SIGNAL(triggered()), this, SLOT(LoadCoverFromURL()));
|
QObject::connect(album_cover_choice_controller_->cover_from_url_action(), &QAction::triggered, this, &MainWindow::LoadCoverFromURL);
|
||||||
connect(album_cover_choice_controller_->search_for_cover_action(), SIGNAL(triggered()), this, SLOT(SearchForCover()));
|
QObject::connect(album_cover_choice_controller_->search_for_cover_action(), &QAction::triggered, this, &MainWindow::SearchForCover);
|
||||||
connect(album_cover_choice_controller_->unset_cover_action(), SIGNAL(triggered()), this, SLOT(UnsetCover()));
|
QObject::connect(album_cover_choice_controller_->unset_cover_action(), &QAction::triggered, this, &MainWindow::UnsetCover);
|
||||||
connect(album_cover_choice_controller_->show_cover_action(), SIGNAL(triggered()), this, SLOT(ShowCover()));
|
QObject::connect(album_cover_choice_controller_->show_cover_action(), &QAction::triggered, this, &MainWindow::ShowCover);
|
||||||
connect(album_cover_choice_controller_->search_cover_auto_action(), SIGNAL(triggered()), this, SLOT(SearchCoverAutomatically()));
|
QObject::connect(album_cover_choice_controller_->search_cover_auto_action(), &QAction::triggered, this, &MainWindow::SearchCoverAutomatically);
|
||||||
connect(album_cover_choice_controller_->search_cover_auto_action(), SIGNAL(toggled(bool)), SLOT(ToggleSearchCoverAuto(bool)));
|
QObject::connect(album_cover_choice_controller_->search_cover_auto_action(), &QAction::toggled, this, &MainWindow::ToggleSearchCoverAuto);
|
||||||
|
|
||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
// Devices connections
|
// Devices connections
|
||||||
connect(device_view_->view(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(device_view_->view(), &DeviceView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Collection filter widget
|
// Collection filter widget
|
||||||
@ -634,10 +634,10 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
collection_show_untagged_->setCheckable(true);
|
collection_show_untagged_->setCheckable(true);
|
||||||
collection_show_all_->setChecked(true);
|
collection_show_all_->setChecked(true);
|
||||||
|
|
||||||
connect(collection_view_group, SIGNAL(triggered(QAction*)), SLOT(ChangeCollectionQueryMode(QAction*)));
|
QObject::connect(collection_view_group, &QActionGroup::triggered, this, &MainWindow::ChangeCollectionQueryMode);
|
||||||
|
|
||||||
QAction *collection_config_action = new QAction(IconLoader::Load("configure"), tr("Configure collection..."), this);
|
QAction *collection_config_action = new QAction(IconLoader::Load("configure"), tr("Configure collection..."), this);
|
||||||
connect(collection_config_action, SIGNAL(triggered()), SLOT(ShowCollectionConfig()));
|
QObject::connect(collection_config_action, &QAction::triggered, this, &MainWindow::ShowCollectionConfig);
|
||||||
collection_view_->filter()->SetSettingsGroup(CollectionSettingsPage::kSettingsGroup);
|
collection_view_->filter()->SetSettingsGroup(CollectionSettingsPage::kSettingsGroup);
|
||||||
collection_view_->filter()->SetCollectionModel(app_->collection()->model());
|
collection_view_->filter()->SetCollectionModel(app_->collection()->model());
|
||||||
|
|
||||||
@ -651,37 +651,37 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
collection_view_->filter()->AddMenuAction(collection_config_action);
|
collection_view_->filter()->AddMenuAction(collection_config_action);
|
||||||
|
|
||||||
#ifdef HAVE_SUBSONIC
|
#ifdef HAVE_SUBSONIC
|
||||||
connect(subsonic_view_->view(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(subsonic_view_->view(), &InternetCollectionView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_TIDAL
|
#ifdef HAVE_TIDAL
|
||||||
connect(tidal_view_->artists_collection_view(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(tidal_view_->artists_collection_view(), &InternetCollectionView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
connect(tidal_view_->albums_collection_view(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(tidal_view_->albums_collection_view(), &InternetCollectionView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
connect(tidal_view_->songs_collection_view(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(tidal_view_->songs_collection_view(), &InternetCollectionView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
connect(tidal_view_->search_view(), SIGNAL(AddToPlaylist(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(tidal_view_->search_view(), &InternetSearchView::AddToPlaylist, this, &MainWindow::AddToPlaylist);
|
||||||
if (TidalService *tidalservice = qobject_cast<TidalService*> (app_->internet_services()->ServiceBySource(Song::Source_Tidal)))
|
if (TidalService *tidalservice = qobject_cast<TidalService*> (app_->internet_services()->ServiceBySource(Song::Source_Tidal)))
|
||||||
connect(this, SIGNAL(AuthorizationUrlReceived(QUrl)), tidalservice, SLOT(AuthorizationUrlReceived(QUrl)));
|
QObject::connect(this, &MainWindow::AuthorizationUrlReceived, tidalservice, &TidalService::AuthorizationUrlReceived);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_QOBUZ
|
#ifdef HAVE_QOBUZ
|
||||||
connect(qobuz_view_->artists_collection_view(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(qobuz_view_->artists_collection_view(), &InternetCollectionView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
connect(qobuz_view_->albums_collection_view(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(qobuz_view_->albums_collection_view(), &InternetCollectionView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
connect(qobuz_view_->songs_collection_view(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(qobuz_view_->songs_collection_view(), &InternetCollectionView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
connect(qobuz_view_->search_view(), SIGNAL(AddToPlaylist(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(qobuz_view_->search_view(), &InternetSearchView::AddToPlaylist, this, &MainWindow::AddToPlaylist);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Playlist menu
|
// Playlist menu
|
||||||
connect(playlist_menu_, SIGNAL(aboutToHide()), SLOT(PlaylistMenuHidden()));
|
QObject::connect(playlist_menu_, &QMenu::aboutToHide, this, &MainWindow::PlaylistMenuHidden);
|
||||||
playlist_play_pause_ = playlist_menu_->addAction(tr("Play"), this, SLOT(PlaylistPlay()));
|
playlist_play_pause_ = playlist_menu_->addAction(tr("Play"), this, &MainWindow::PlaylistPlay);
|
||||||
playlist_menu_->addAction(ui_->action_stop);
|
playlist_menu_->addAction(ui_->action_stop);
|
||||||
playlist_stop_after_ = playlist_menu_->addAction(IconLoader::Load("media-playback-stop"), tr("Stop after this track"), this, SLOT(PlaylistStopAfter()));
|
playlist_stop_after_ = playlist_menu_->addAction(IconLoader::Load("media-playback-stop"), tr("Stop after this track"), this, &MainWindow::PlaylistStopAfter);
|
||||||
playlist_queue_ = playlist_menu_->addAction(IconLoader::Load("go-next"), tr("Toggle queue status"), this, SLOT(PlaylistQueue()));
|
playlist_queue_ = playlist_menu_->addAction(IconLoader::Load("go-next"), tr("Toggle queue status"), this, &MainWindow::PlaylistQueue);
|
||||||
playlist_queue_->setShortcut(QKeySequence("Ctrl+D"));
|
playlist_queue_->setShortcut(QKeySequence("Ctrl+D"));
|
||||||
ui_->playlist->addAction(playlist_queue_);
|
ui_->playlist->addAction(playlist_queue_);
|
||||||
playlist_queue_play_next_ = playlist_menu_->addAction(IconLoader::Load("go-next"), tr("Queue selected tracks to play next"), this, SLOT(PlaylistQueuePlayNext()));
|
playlist_queue_play_next_ = playlist_menu_->addAction(IconLoader::Load("go-next"), tr("Queue selected tracks to play next"), this, &MainWindow::PlaylistQueuePlayNext);
|
||||||
playlist_queue_play_next_->setShortcut(QKeySequence("Ctrl+Shift+D"));
|
playlist_queue_play_next_->setShortcut(QKeySequence("Ctrl+Shift+D"));
|
||||||
ui_->playlist->addAction(playlist_queue_play_next_);
|
ui_->playlist->addAction(playlist_queue_play_next_);
|
||||||
playlist_skip_ = playlist_menu_->addAction(IconLoader::Load("media-skip-forward"), tr("Toggle skip status"), this, SLOT(PlaylistSkip()));
|
playlist_skip_ = playlist_menu_->addAction(IconLoader::Load("media-skip-forward"), tr("Toggle skip status"), this, &MainWindow::PlaylistSkip);
|
||||||
ui_->playlist->addAction(playlist_skip_);
|
ui_->playlist->addAction(playlist_skip_);
|
||||||
|
|
||||||
playlist_menu_->addSeparator();
|
playlist_menu_->addSeparator();
|
||||||
@ -694,22 +694,22 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT)
|
#if defined(HAVE_GSTREAMER) && defined(HAVE_CHROMAPRINT)
|
||||||
playlist_menu_->addAction(ui_->action_auto_complete_tags);
|
playlist_menu_->addAction(ui_->action_auto_complete_tags);
|
||||||
#endif
|
#endif
|
||||||
playlist_rescan_songs_ = playlist_menu_->addAction(IconLoader::Load("view-refresh"), tr("Rescan song(s)..."), this, SLOT(RescanSongs()));
|
playlist_rescan_songs_ = playlist_menu_->addAction(IconLoader::Load("view-refresh"), tr("Rescan song(s)..."), this, &MainWindow::RescanSongs);
|
||||||
playlist_menu_->addAction(playlist_rescan_songs_);
|
playlist_menu_->addAction(playlist_rescan_songs_);
|
||||||
#ifdef HAVE_GSTREAMER
|
#ifdef HAVE_GSTREAMER
|
||||||
playlist_menu_->addAction(ui_->action_add_files_to_transcoder);
|
playlist_menu_->addAction(ui_->action_add_files_to_transcoder);
|
||||||
#endif
|
#endif
|
||||||
playlist_menu_->addSeparator();
|
playlist_menu_->addSeparator();
|
||||||
playlist_copy_url_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Copy URL(s)..."), this, SLOT(PlaylistCopyUrl()));
|
playlist_copy_url_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Copy URL(s)..."), this, &MainWindow::PlaylistCopyUrl);
|
||||||
playlist_show_in_collection_ = playlist_menu_->addAction(IconLoader::Load("edit-find"), tr("Show in collection..."), this, SLOT(ShowInCollection()));
|
playlist_show_in_collection_ = playlist_menu_->addAction(IconLoader::Load("edit-find"), tr("Show in collection..."), this, &MainWindow::ShowInCollection);
|
||||||
playlist_open_in_browser_ = playlist_menu_->addAction(IconLoader::Load("document-open-folder"), tr("Show in file browser..."), this, SLOT(PlaylistOpenInBrowser()));
|
playlist_open_in_browser_ = playlist_menu_->addAction(IconLoader::Load("document-open-folder"), tr("Show in file browser..."), this, &MainWindow::PlaylistOpenInBrowser);
|
||||||
playlist_organize_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organize files..."), this, SLOT(PlaylistMoveToCollection()));
|
playlist_organize_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Organize files..."), this, &MainWindow::PlaylistMoveToCollection);
|
||||||
playlist_copy_to_collection_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Copy to collection..."), this, SLOT(PlaylistCopyToCollection()));
|
playlist_copy_to_collection_ = playlist_menu_->addAction(IconLoader::Load("edit-copy"), tr("Copy to collection..."), this, &MainWindow::PlaylistCopyToCollection);
|
||||||
playlist_move_to_collection_ = playlist_menu_->addAction(IconLoader::Load("go-jump"), tr("Move to collection..."), this, SLOT(PlaylistMoveToCollection()));
|
playlist_move_to_collection_ = playlist_menu_->addAction(IconLoader::Load("go-jump"), tr("Move to collection..."), this, &MainWindow::PlaylistMoveToCollection);
|
||||||
#if defined(HAVE_GSTREAMER) && !defined(Q_OS_WIN)
|
#if defined(HAVE_GSTREAMER) && !defined(Q_OS_WIN)
|
||||||
playlist_copy_to_device_ = playlist_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, SLOT(PlaylistCopyToDevice()));
|
playlist_copy_to_device_ = playlist_menu_->addAction(IconLoader::Load("device"), tr("Copy to device..."), this, &MainWindow::PlaylistCopyToDevice);
|
||||||
#endif
|
#endif
|
||||||
playlist_delete_ = playlist_menu_->addAction(IconLoader::Load("edit-delete"), tr("Delete from disk..."), this, SLOT(PlaylistDelete()));
|
playlist_delete_ = playlist_menu_->addAction(IconLoader::Load("edit-delete"), tr("Delete from disk..."), this, &MainWindow::PlaylistDelete);
|
||||||
playlist_menu_->addSeparator();
|
playlist_menu_->addSeparator();
|
||||||
playlistitem_actions_separator_ = playlist_menu_->addSeparator();
|
playlistitem_actions_separator_ = playlist_menu_->addSeparator();
|
||||||
playlist_menu_->addAction(ui_->action_clear_playlist);
|
playlist_menu_->addAction(ui_->action_clear_playlist);
|
||||||
@ -724,16 +724,16 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
// We have to add the actions on the playlist menu to this QWidget otherwise their shortcut keys don't work
|
// We have to add the actions on the playlist menu to this QWidget otherwise their shortcut keys don't work
|
||||||
addActions(playlist_menu_->actions());
|
addActions(playlist_menu_->actions());
|
||||||
|
|
||||||
connect(ui_->playlist, SIGNAL(UndoRedoActionsChanged(QAction*, QAction*)), SLOT(PlaylistUndoRedoChanged(QAction*, QAction*)));
|
QObject::connect(ui_->playlist, &PlaylistContainer::UndoRedoActionsChanged, this, &MainWindow::PlaylistUndoRedoChanged);
|
||||||
|
|
||||||
#if defined(HAVE_GSTREAMER) && !defined(Q_OS_WIN)
|
#if defined(HAVE_GSTREAMER) && !defined(Q_OS_WIN)
|
||||||
playlist_copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
playlist_copy_to_device_->setDisabled(app_->device_manager()->connected_devices_model()->rowCount() == 0);
|
||||||
connect(app_->device_manager()->connected_devices_model(), SIGNAL(IsEmptyChanged(bool)), playlist_copy_to_device_, SLOT(setDisabled(bool)));
|
QObject::connect(app_->device_manager()->connected_devices_model(), &DeviceStateFilterModel::IsEmptyChanged, playlist_copy_to_device_, &QAction::setDisabled);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
connect(app_->scrobbler(), SIGNAL(ScrobblingEnabledChanged(bool)), SLOT(ScrobblingEnabledChanged(bool)));
|
QObject::connect(app_->scrobbler(), &AudioScrobbler::ScrobblingEnabledChanged, this, &MainWindow::ScrobblingEnabledChanged);
|
||||||
connect(app_->scrobbler(), SIGNAL(ScrobbleButtonVisibilityChanged(bool)), SLOT(ScrobbleButtonVisibilityChanged(bool)));
|
QObject::connect(app_->scrobbler(), &AudioScrobbler::ScrobbleButtonVisibilityChanged, this, &MainWindow::ScrobbleButtonVisibilityChanged);
|
||||||
connect(app_->scrobbler(), SIGNAL(LoveButtonVisibilityChanged(bool)), SLOT(LoveButtonVisibilityChanged(bool)));
|
QObject::connect(app_->scrobbler(), &AudioScrobbler::LoveButtonVisibilityChanged, this, &MainWindow::LoveButtonVisibilityChanged);
|
||||||
|
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
mac::SetApplicationHandler(this);
|
mac::SetApplicationHandler(this);
|
||||||
@ -741,13 +741,13 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
// Tray icon
|
// Tray icon
|
||||||
if (tray_icon_) {
|
if (tray_icon_) {
|
||||||
tray_icon_->SetupMenu(ui_->action_previous_track, ui_->action_play_pause, ui_->action_stop, ui_->action_stop_after_this_track, ui_->action_next_track, ui_->action_mute, ui_->action_love, ui_->action_quit);
|
tray_icon_->SetupMenu(ui_->action_previous_track, ui_->action_play_pause, ui_->action_stop, ui_->action_stop_after_this_track, ui_->action_next_track, ui_->action_mute, ui_->action_love, ui_->action_quit);
|
||||||
connect(tray_icon_, SIGNAL(PlayPause()), app_->player(), SLOT(PlayPause()));
|
QObject::connect(tray_icon_, &SystemTrayIcon::PlayPause, app_->player(), &Player::PlayPauseHelper);
|
||||||
connect(tray_icon_, SIGNAL(SeekForward()), app_->player(), SLOT(SeekForward()));
|
QObject::connect(tray_icon_, &SystemTrayIcon::SeekForward, app_->player(), &Player::SeekForward);
|
||||||
connect(tray_icon_, SIGNAL(SeekBackward()), app_->player(), SLOT(SeekBackward()));
|
QObject::connect(tray_icon_, &SystemTrayIcon::SeekBackward, app_->player(), &Player::SeekBackward);
|
||||||
connect(tray_icon_, SIGNAL(NextTrack()), app_->player(), SLOT(Next()));
|
QObject::connect(tray_icon_, &SystemTrayIcon::NextTrack, app_->player(), &Player::Next);
|
||||||
connect(tray_icon_, SIGNAL(PreviousTrack()), app_->player(), SLOT(Previous()));
|
QObject::connect(tray_icon_, &SystemTrayIcon::PreviousTrack, app_->player(), &Player::Previous);
|
||||||
connect(tray_icon_, SIGNAL(ShowHide()), SLOT(ToggleShowHide()));
|
QObject::connect(tray_icon_, &SystemTrayIcon::ShowHide, this, &MainWindow::ToggleShowHide);
|
||||||
connect(tray_icon_, SIGNAL(ChangeVolume(int)), SLOT(VolumeWheelEvent(int)));
|
QObject::connect(tray_icon_, &SystemTrayIcon::ChangeVolume, this, &MainWindow::VolumeWheelEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Windows 7 thumbbar buttons
|
// Windows 7 thumbbar buttons
|
||||||
@ -758,47 +758,47 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
#if defined(HAVE_SPARKLE) || defined(HAVE_QTSPARKLE)
|
#if defined(HAVE_SPARKLE) || defined(HAVE_QTSPARKLE)
|
||||||
QAction *check_updates = ui_->menu_tools->addAction(tr("Check for updates..."));
|
QAction *check_updates = ui_->menu_tools->addAction(tr("Check for updates..."));
|
||||||
check_updates->setMenuRole(QAction::ApplicationSpecificRole);
|
check_updates->setMenuRole(QAction::ApplicationSpecificRole);
|
||||||
connect(check_updates, SIGNAL(triggered(bool)), SLOT(CheckForUpdates()));
|
QObject::connect(check_updates, &QAction::triggered, this, &MainWindow::CheckForUpdates);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_GLOBALSHORTCUTS
|
#ifdef HAVE_GLOBALSHORTCUTS
|
||||||
// Global shortcuts
|
// Global shortcuts
|
||||||
connect(global_shortcuts_, SIGNAL(Play()), app_->player(), SLOT(Play()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::Play, app_->player(), &Player::Play);
|
||||||
connect(global_shortcuts_, SIGNAL(Pause()), app_->player(), SLOT(Pause()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::Pause, app_->player(), &Player::Pause);
|
||||||
connect(global_shortcuts_, SIGNAL(PlayPause()), ui_->action_play_pause, SLOT(trigger()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::PlayPause, ui_->action_play_pause, &QAction::trigger);
|
||||||
connect(global_shortcuts_, SIGNAL(Stop()), ui_->action_stop, SLOT(trigger()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::Stop, ui_->action_stop, &QAction::trigger);
|
||||||
connect(global_shortcuts_, SIGNAL(StopAfter()), ui_->action_stop_after_this_track, SLOT(trigger()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::StopAfter, ui_->action_stop_after_this_track, &QAction::trigger);
|
||||||
connect(global_shortcuts_, SIGNAL(Next()), ui_->action_next_track, SLOT(trigger()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::Next, ui_->action_next_track, &QAction::trigger);
|
||||||
connect(global_shortcuts_, SIGNAL(Previous()), ui_->action_previous_track, SLOT(trigger()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::Previous, ui_->action_previous_track, &QAction::trigger);
|
||||||
connect(global_shortcuts_, SIGNAL(IncVolume()), app_->player(), SLOT(VolumeUp()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::IncVolume, app_->player(), &Player::VolumeUp);
|
||||||
connect(global_shortcuts_, SIGNAL(DecVolume()), app_->player(), SLOT(VolumeDown()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::DecVolume, app_->player(), &Player::VolumeDown);
|
||||||
connect(global_shortcuts_, SIGNAL(Mute()), app_->player(), SLOT(Mute()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::Mute, app_->player(), &Player::Mute);
|
||||||
connect(global_shortcuts_, SIGNAL(SeekForward()), app_->player(), SLOT(SeekForward()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::SeekForward, app_->player(), &Player::SeekForward);
|
||||||
connect(global_shortcuts_, SIGNAL(SeekBackward()), app_->player(), SLOT(SeekBackward()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::SeekBackward, app_->player(), &Player::SeekBackward);
|
||||||
connect(global_shortcuts_, SIGNAL(ShowHide()), SLOT(ToggleShowHide()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::ShowHide, this, &MainWindow::ToggleShowHide);
|
||||||
connect(global_shortcuts_, SIGNAL(ShowOSD()), app_->player(), SLOT(ShowOSD()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::ShowOSD, app_->player(), &Player::ShowOSD);
|
||||||
connect(global_shortcuts_, SIGNAL(TogglePrettyOSD()), app_->player(), SLOT(TogglePrettyOSD()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::TogglePrettyOSD, app_->player(), &Player::TogglePrettyOSD);
|
||||||
connect(global_shortcuts_, SIGNAL(ToggleScrobbling()), app_->scrobbler(), SLOT(ToggleScrobbling()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::ToggleScrobbling, app_->scrobbler(), &AudioScrobbler::ToggleScrobbling);
|
||||||
connect(global_shortcuts_, SIGNAL(Love()), app_->scrobbler(), SLOT(Love()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::Love, app_->scrobbler(), &AudioScrobbler::Love);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Fancy tabs
|
// Fancy tabs
|
||||||
connect(ui_->tabs, SIGNAL(CurrentChanged(int)), SLOT(TabSwitched()));
|
QObject::connect(ui_->tabs, &FancyTabWidget::CurrentChanged, this, &MainWindow::TabSwitched);
|
||||||
|
|
||||||
// Context
|
// Context
|
||||||
connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), context_view_, SLOT(SongChanged(Song)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::CurrentSongChanged, context_view_, &ContextView::SongChanged);
|
||||||
connect(app_->playlist_manager(), SIGNAL(SongMetadataChanged(Song)), context_view_, SLOT(SongChanged(Song)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::SongMetadataChanged, context_view_, &ContextView::SongChanged);
|
||||||
connect(app_->player(), SIGNAL(PlaylistFinished()), context_view_, SLOT(Stopped()));
|
QObject::connect(app_->player(), &Player::PlaylistFinished, context_view_, &ContextView::Stopped);
|
||||||
connect(app_->player(), SIGNAL(Playing()), context_view_, SLOT(Playing()));
|
QObject::connect(app_->player(), &Player::Playing, context_view_, &ContextView::Playing);
|
||||||
connect(app_->player(), SIGNAL(Stopped()), context_view_, SLOT(Stopped()));
|
QObject::connect(app_->player(), &Player::Stopped, context_view_, &ContextView::Stopped);
|
||||||
connect(app_->player(), SIGNAL(Error()), context_view_, SLOT(Error()));
|
QObject::connect(app_->player(), &Player::Error, context_view_, &ContextView::Error);
|
||||||
connect(this, SIGNAL(AlbumCoverReady(Song, QImage)), context_view_, SLOT(AlbumCoverLoaded(Song, QImage)));
|
QObject::connect(this, &MainWindow::AlbumCoverReady, context_view_, &ContextView::AlbumCoverLoaded);
|
||||||
connect(this, SIGNAL(SearchCoverInProgress()), context_view_->album_widget(), SLOT(SearchCoverInProgress()));
|
QObject::connect(this, &MainWindow::SearchCoverInProgress, context_view_->album_widget(), &ContextAlbum::SearchCoverInProgress);
|
||||||
connect(context_view_, SIGNAL(AlbumEnabledChanged()), SLOT(TabSwitched()));
|
QObject::connect(context_view_, &ContextView::AlbumEnabledChanged, this, &MainWindow::TabSwitched);
|
||||||
connect(context_view_->albums_widget(), SIGNAL(AddToPlaylistSignal(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(context_view_->albums_widget(), &ContextAlbumsView::AddToPlaylistSignal, this, &MainWindow::AddToPlaylist);
|
||||||
|
|
||||||
// Analyzer
|
// Analyzer
|
||||||
connect(ui_->analyzer, SIGNAL(WheelEvent(int)), SLOT(VolumeWheelEvent(int)));
|
QObject::connect(ui_->analyzer, &AnalyzerContainer::WheelEvent, this, &MainWindow::VolumeWheelEvent);
|
||||||
|
|
||||||
// Statusbar widgets
|
// Statusbar widgets
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
|
||||||
@ -807,28 +807,28 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
ui_->playlist_summary->setMinimumWidth(QFontMetrics(font()).width("WW selected of WW tracks - [ WW:WW ]"));
|
ui_->playlist_summary->setMinimumWidth(QFontMetrics(font()).width("WW selected of WW tracks - [ WW:WW ]"));
|
||||||
#endif
|
#endif
|
||||||
ui_->status_bar_stack->setCurrentWidget(ui_->playlist_summary_page);
|
ui_->status_bar_stack->setCurrentWidget(ui_->playlist_summary_page);
|
||||||
connect(ui_->multi_loading_indicator, SIGNAL(TaskCountChange(int)), SLOT(TaskCountChanged(int)));
|
QObject::connect(ui_->multi_loading_indicator, &MultiLoadingIndicator::TaskCountChange, this, &MainWindow::TaskCountChanged);
|
||||||
|
|
||||||
ui_->track_slider->SetApplication(app);
|
ui_->track_slider->SetApplication(app);
|
||||||
|
|
||||||
#ifdef HAVE_MOODBAR
|
#ifdef HAVE_MOODBAR
|
||||||
// Moodbar connections
|
// Moodbar connections
|
||||||
connect(app_->moodbar_controller(), SIGNAL(CurrentMoodbarDataChanged(QByteArray)), ui_->track_slider->moodbar_style(), SLOT(SetMoodbarData(QByteArray)));
|
QObject::connect(app_->moodbar_controller(), &MoodbarController::CurrentMoodbarDataChanged, ui_->track_slider->moodbar_style(), &MoodbarProxyStyle::SetMoodbarData);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Playing widget
|
// Playing widget
|
||||||
qLog(Debug) << "Creating playing widget";
|
qLog(Debug) << "Creating playing widget";
|
||||||
ui_->widget_playing->set_ideal_height(ui_->status_bar->sizeHint().height() + ui_->player_controls->sizeHint().height());
|
ui_->widget_playing->set_ideal_height(ui_->status_bar->sizeHint().height() + ui_->player_controls->sizeHint().height());
|
||||||
connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), ui_->widget_playing, SLOT(SongChanged(Song)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::CurrentSongChanged, ui_->widget_playing, &PlayingWidget::SongChanged);
|
||||||
connect(app_->player(), SIGNAL(PlaylistFinished()), ui_->widget_playing, SLOT(Stopped()));
|
QObject::connect(app_->player(), &Player::PlaylistFinished, ui_->widget_playing, &PlayingWidget::Stopped);
|
||||||
connect(app_->player(), SIGNAL(Playing()), ui_->widget_playing, SLOT(Playing()));
|
QObject::connect(app_->player(), &Player::Playing, ui_->widget_playing, &PlayingWidget::Playing);
|
||||||
connect(app_->player(), SIGNAL(Stopped()), ui_->widget_playing, SLOT(Stopped()));
|
QObject::connect(app_->player(), &Player::Stopped, ui_->widget_playing, &PlayingWidget::Stopped);
|
||||||
connect(app_->player(), SIGNAL(Error()), ui_->widget_playing, SLOT(Error()));
|
QObject::connect(app_->player(), &Player::Error, ui_->widget_playing, &PlayingWidget::Error);
|
||||||
connect(ui_->widget_playing, SIGNAL(ShowAboveStatusBarChanged(bool)), SLOT(PlayingWidgetPositionChanged(bool)));
|
QObject::connect(ui_->widget_playing, &PlayingWidget::ShowAboveStatusBarChanged, this, &MainWindow::PlayingWidgetPositionChanged);
|
||||||
connect(this, SIGNAL(AlbumCoverReady(Song, QImage)), ui_->widget_playing, SLOT(AlbumCoverLoaded(Song, QImage)));
|
QObject::connect(this, &MainWindow::AlbumCoverReady, ui_->widget_playing, &PlayingWidget::AlbumCoverLoaded);
|
||||||
connect(this, SIGNAL(SearchCoverInProgress()), ui_->widget_playing, SLOT(SearchCoverInProgress()));
|
QObject::connect(this, &MainWindow::SearchCoverInProgress, ui_->widget_playing, &PlayingWidget::SearchCoverInProgress);
|
||||||
|
|
||||||
connect(ui_->action_console, SIGNAL(triggered()), SLOT(ShowConsole()));
|
QObject::connect(ui_->action_console, &QAction::triggered, this, &MainWindow::ShowConsole);
|
||||||
PlayingWidgetPositionChanged(ui_->widget_playing->show_above_status_bar());
|
PlayingWidgetPositionChanged(ui_->widget_playing->show_above_status_bar());
|
||||||
|
|
||||||
// Load theme
|
// Load theme
|
||||||
@ -845,28 +845,28 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
queue_view_->SetPlaylistManager(app_->playlist_manager());
|
queue_view_->SetPlaylistManager(app_->playlist_manager());
|
||||||
|
|
||||||
// This connection must be done after the playlists have been initialized.
|
// This connection must be done after the playlists have been initialized.
|
||||||
connect(this, SIGNAL(StopAfterToggled(bool)), osd_, SLOT(StopAfterToggle(bool)));
|
QObject::connect(this, &MainWindow::StopAfterToggled, osd_, &OSDBase::StopAfterToggle);
|
||||||
|
|
||||||
// We need to connect these global shortcuts here after the playlist have been initialized
|
// We need to connect these global shortcuts here after the playlist have been initialized
|
||||||
#ifdef HAVE_GLOBALSHORTCUTS
|
#ifdef HAVE_GLOBALSHORTCUTS
|
||||||
connect(global_shortcuts_, SIGNAL(CycleShuffleMode()), app_->playlist_manager()->sequence(), SLOT(CycleShuffleMode()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::CycleShuffleMode, app_->playlist_manager()->sequence(), &PlaylistSequence::CycleShuffleMode);
|
||||||
connect(global_shortcuts_, SIGNAL(CycleRepeatMode()), app_->playlist_manager()->sequence(), SLOT(CycleRepeatMode()));
|
QObject::connect(global_shortcuts_, &GlobalShortcuts::CycleRepeatMode, app_->playlist_manager()->sequence(), &PlaylistSequence::CycleRepeatMode);
|
||||||
#endif
|
#endif
|
||||||
connect(app_->playlist_manager()->sequence(), SIGNAL(RepeatModeChanged(PlaylistSequence::RepeatMode)), osd_, SLOT(RepeatModeChanged(PlaylistSequence::RepeatMode)));
|
QObject::connect(app_->playlist_manager()->sequence(), &PlaylistSequence::RepeatModeChanged, osd_, &OSDBase::RepeatModeChanged);
|
||||||
connect(app_->playlist_manager()->sequence(), SIGNAL(ShuffleModeChanged(PlaylistSequence::ShuffleMode)), osd_, SLOT(ShuffleModeChanged(PlaylistSequence::ShuffleMode)));
|
QObject::connect(app_->playlist_manager()->sequence(), &PlaylistSequence::ShuffleModeChanged, osd_, &OSDBase::ShuffleModeChanged);
|
||||||
|
|
||||||
// Smart playlists
|
// Smart playlists
|
||||||
connect(smartplaylists_view_, SIGNAL(AddToPlaylist(QMimeData*)), SLOT(AddToPlaylist(QMimeData*)));
|
QObject::connect(smartplaylists_view_, &SmartPlaylistsViewContainer::AddToPlaylist, this, &MainWindow::AddToPlaylist);
|
||||||
|
|
||||||
ScrobbleButtonVisibilityChanged(app_->scrobbler()->ScrobbleButton());
|
ScrobbleButtonVisibilityChanged(app_->scrobbler()->ScrobbleButton());
|
||||||
LoveButtonVisibilityChanged(app_->scrobbler()->LoveButton());
|
LoveButtonVisibilityChanged(app_->scrobbler()->LoveButton());
|
||||||
ScrobblingEnabledChanged(app_->scrobbler()->IsEnabled());
|
ScrobblingEnabledChanged(app_->scrobbler()->IsEnabled());
|
||||||
|
|
||||||
// Last.fm ImportData
|
// Last.fm ImportData
|
||||||
connect(app_->lastfm_import(), SIGNAL(Finished()), lastfm_import_dialog_, SLOT(Finished()));
|
QObject::connect(app_->lastfm_import(), &LastFMImport::Finished, lastfm_import_dialog_, &LastFMImportDialog::Finished);
|
||||||
connect(app_->lastfm_import(), SIGNAL(FinishedWithError(QString)), lastfm_import_dialog_, SLOT(FinishedWithError(QString)));
|
QObject::connect(app_->lastfm_import(), &LastFMImport::FinishedWithError, lastfm_import_dialog_, &LastFMImportDialog::FinishedWithError);
|
||||||
connect(app_->lastfm_import(), SIGNAL(UpdateTotal(int, int)), lastfm_import_dialog_, SLOT(UpdateTotal(int, int)));
|
QObject::connect(app_->lastfm_import(), &LastFMImport::UpdateTotal, lastfm_import_dialog_, &LastFMImportDialog::UpdateTotal);
|
||||||
connect(app_->lastfm_import(), SIGNAL(UpdateProgress(int, int)), lastfm_import_dialog_, SLOT(UpdateProgress(int, int)));
|
QObject::connect(app_->lastfm_import(), &LastFMImport::UpdateProgress, lastfm_import_dialog_, &LastFMImportDialog::UpdateProgress);
|
||||||
|
|
||||||
// Load settings
|
// Load settings
|
||||||
qLog(Debug) << "Loading settings";
|
qLog(Debug) << "Loading settings";
|
||||||
@ -958,7 +958,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
|
|
||||||
QShortcut *close_window_shortcut = new QShortcut(this);
|
QShortcut *close_window_shortcut = new QShortcut(this);
|
||||||
close_window_shortcut->setKey(Qt::CTRL | Qt::Key_W);
|
close_window_shortcut->setKey(Qt::CTRL | Qt::Key_W);
|
||||||
connect(close_window_shortcut, SIGNAL(activated()), SLOT(SetHiddenInTray()));
|
QObject::connect(close_window_shortcut, &QShortcut::activated, this, &MainWindow::ToggleHide);
|
||||||
|
|
||||||
CheckFullRescanRevisions();
|
CheckFullRescanRevisions();
|
||||||
|
|
||||||
@ -983,7 +983,7 @@ MainWindow::MainWindow(Application *app, SystemTrayIcon *tray_icon, OSDBase *osd
|
|||||||
qtsparkle::Updater *updater = new qtsparkle::Updater(sparkle_url, this);
|
qtsparkle::Updater *updater = new qtsparkle::Updater(sparkle_url, this);
|
||||||
updater->SetNetworkAccessManager(new NetworkAccessManager(this));
|
updater->SetNetworkAccessManager(new NetworkAccessManager(this));
|
||||||
updater->SetVersion(STRAWBERRY_VERSION_PACKAGE);
|
updater->SetVersion(STRAWBERRY_VERSION_PACKAGE);
|
||||||
connect(check_updates, SIGNAL(triggered()), updater, SLOT(CheckNow()));
|
QObject::connect(check_updates, &QAction::triggered, updater, &qtsparkle::Updater::CheckNow);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1169,7 +1169,7 @@ void MainWindow::Exit() {
|
|||||||
else {
|
else {
|
||||||
if (app_->player()->engine()->is_fadeout_enabled()) {
|
if (app_->player()->engine()->is_fadeout_enabled()) {
|
||||||
// To shut down the application when fadeout will be finished
|
// To shut down the application when fadeout will be finished
|
||||||
connect(app_->player()->engine(), SIGNAL(FadeoutFinishedSignal()), this, SLOT(DoExit()));
|
QObject::connect(app_->player()->engine(), &EngineBase::FadeoutFinishedSignal, this, &MainWindow::DoExit);
|
||||||
if (app_->player()->GetState() == Engine::Playing) {
|
if (app_->player()->GetState() == Engine::Playing) {
|
||||||
app_->player()->Stop();
|
app_->player()->Stop();
|
||||||
hide();
|
hide();
|
||||||
@ -1184,7 +1184,7 @@ void MainWindow::Exit() {
|
|||||||
|
|
||||||
void MainWindow::DoExit() {
|
void MainWindow::DoExit() {
|
||||||
|
|
||||||
connect(app_, SIGNAL(ExitFinished()), this, SLOT(ExitFinished()));
|
QObject::connect(app_, &Application::ExitFinished, this, &MainWindow::ExitFinished);
|
||||||
app_->Exit();
|
app_->Exit();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1400,7 +1400,7 @@ void MainWindow::LoadPlaybackStatus() {
|
|||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
if (resume_playback && playback_state != Engine::Empty && playback_state != Engine::Idle) {
|
if (resume_playback && playback_state != Engine::Empty && playback_state != Engine::Idle) {
|
||||||
connect(app_->playlist_manager(), SIGNAL(AllPlaylistsLoaded()), SLOT(ResumePlayback()));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::AllPlaylistsLoaded, this, &MainWindow::ResumePlayback);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1409,7 +1409,7 @@ void MainWindow::ResumePlayback() {
|
|||||||
|
|
||||||
qLog(Debug) << "Resuming playback";
|
qLog(Debug) << "Resuming playback";
|
||||||
|
|
||||||
disconnect(app_->playlist_manager(), SIGNAL(AllPlaylistsLoaded()), this, SLOT(ResumePlayback()));
|
QObject::disconnect(app_->playlist_manager(), &PlaylistManager::AllPlaylistsLoaded, this, &MainWindow::ResumePlayback);
|
||||||
|
|
||||||
QSettings s;
|
QSettings s;
|
||||||
s.beginGroup(Player::kSettingsGroup);
|
s.beginGroup(Player::kSettingsGroup);
|
||||||
@ -1520,6 +1520,10 @@ void MainWindow::ToggleShowHide() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::ToggleHide() {
|
||||||
|
if (!hidden_) SetHiddenInTray(true);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::StopAfterCurrent() {
|
void MainWindow::StopAfterCurrent() {
|
||||||
app_->playlist_manager()->current()->StopAfter(app_->playlist_manager()->current()->current_row());
|
app_->playlist_manager()->current()->StopAfter(app_->playlist_manager()->current()->current_row());
|
||||||
emit StopAfterToggled(app_->playlist_manager()->active()->stop_after_current());
|
emit StopAfterToggled(app_->playlist_manager()->active()->stop_after_current());
|
||||||
@ -1687,7 +1691,7 @@ void MainWindow::AddToPlaylist(QMimeData *q_mimedata) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::AddToPlaylist(QAction *action) {
|
void MainWindow::AddToPlaylistFromAction(QAction *action) {
|
||||||
|
|
||||||
const int destination = action->data().toInt();
|
const int destination = action->data().toInt();
|
||||||
PlaylistItemList items;
|
PlaylistItemList items;
|
||||||
@ -1951,7 +1955,7 @@ void MainWindow::PlaylistRightClick(const QPoint &global_pos, const QModelIndex
|
|||||||
add_to_another_menu->addAction(new_playlist);
|
add_to_another_menu->addAction(new_playlist);
|
||||||
playlist_add_to_another_ = playlist_menu_->insertMenu(ui_->action_remove_from_playlist, add_to_another_menu);
|
playlist_add_to_another_ = playlist_menu_->insertMenu(ui_->action_remove_from_playlist, add_to_another_menu);
|
||||||
|
|
||||||
connect(add_to_another_menu, SIGNAL(triggered(QAction*)), SLOT(AddToPlaylist(QAction*)));
|
QObject::connect(add_to_another_menu, &QMenu::triggered, this, &MainWindow::AddToPlaylistFromAction);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2058,7 +2062,7 @@ void MainWindow::RenumberTracks() {
|
|||||||
if (song.IsEditable()) {
|
if (song.IsEditable()) {
|
||||||
song.set_track(track);
|
song.set_track(track);
|
||||||
TagReaderReply *reply = TagReaderClient::Instance()->SaveFile(song.url().toLocalFile(), song);
|
TagReaderReply *reply = TagReaderClient::Instance()->SaveFile(song.url().toLocalFile(), song);
|
||||||
NewClosure(reply, SIGNAL(Finished(bool)), this, SLOT(SongSaveComplete(TagReaderReply*, QPersistentModelIndex)),reply, QPersistentModelIndex(source_index));
|
NewClosure(reply, SIGNAL(Finished(bool)), this, SLOT(SongSaveComplete(TagReaderReply*, QPersistentModelIndex)), reply, QPersistentModelIndex(source_index));
|
||||||
}
|
}
|
||||||
++track;
|
++track;
|
||||||
}
|
}
|
||||||
@ -2658,10 +2662,11 @@ SettingsDialog *MainWindow::CreateSettingsDialog() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
connect(settings_dialog, SIGNAL(ReloadSettings()), SLOT(ReloadAllSettings()));
|
QObject::connect(settings_dialog, &SettingsDialog::ReloadSettings, this, &MainWindow::ReloadAllSettings);
|
||||||
|
|
||||||
// Allows custom notification preview
|
// Allows custom notification preview
|
||||||
connect(settings_dialog, SIGNAL(NotificationPreview(OSDBase::Behaviour, QString, QString)), SLOT(HandleNotificationPreview(OSDBase::Behaviour, QString, QString)));
|
QObject::connect(settings_dialog, &SettingsDialog::NotificationPreview, this, &MainWindow::HandleNotificationPreview);
|
||||||
|
|
||||||
return settings_dialog;
|
return settings_dialog;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2680,8 +2685,8 @@ void MainWindow::OpenSettingsDialogAtPage(SettingsDialog::Page page) {
|
|||||||
EditTagDialog *MainWindow::CreateEditTagDialog() {
|
EditTagDialog *MainWindow::CreateEditTagDialog() {
|
||||||
|
|
||||||
EditTagDialog *edit_tag_dialog = new EditTagDialog(app_);
|
EditTagDialog *edit_tag_dialog = new EditTagDialog(app_);
|
||||||
connect(edit_tag_dialog, SIGNAL(accepted()), SLOT(EditTagDialogAccepted()));
|
QObject::connect(edit_tag_dialog, &EditTagDialog::accepted, this, &MainWindow::EditTagDialogAccepted);
|
||||||
connect(edit_tag_dialog, SIGNAL(Error(QString)), SLOT(ShowErrorDialog(QString)));
|
QObject::connect(edit_tag_dialog, &EditTagDialog::Error, this, &MainWindow::ShowErrorDialog);
|
||||||
return edit_tag_dialog;
|
return edit_tag_dialog;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2740,7 +2745,7 @@ void MainWindow::CheckFullRescanRevisions() {
|
|||||||
|
|
||||||
void MainWindow::PlaylistViewSelectionModelChanged() {
|
void MainWindow::PlaylistViewSelectionModelChanged() {
|
||||||
|
|
||||||
connect(ui_->playlist->view()->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(PlaylistCurrentChanged(QModelIndex)));
|
QObject::connect(ui_->playlist->view()->selectionModel(), &QItemSelectionModel::currentChanged, this, &MainWindow::PlaylistCurrentChanged);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2790,11 +2795,11 @@ void MainWindow::AutoCompleteTags() {
|
|||||||
track_selection_dialog_.reset(new TrackSelectionDialog);
|
track_selection_dialog_.reset(new TrackSelectionDialog);
|
||||||
track_selection_dialog_->set_save_on_close(true);
|
track_selection_dialog_->set_save_on_close(true);
|
||||||
|
|
||||||
connect(tag_fetcher_.get(), SIGNAL(ResultAvailable(Song, SongList)), track_selection_dialog_.get(), SLOT(FetchTagFinished(Song, SongList)), Qt::QueuedConnection);
|
QObject::connect(tag_fetcher_.get(), &TagFetcher::ResultAvailable, track_selection_dialog_.get(), &TrackSelectionDialog::FetchTagFinished, Qt::QueuedConnection);
|
||||||
connect(tag_fetcher_.get(), SIGNAL(Progress(Song, QString)), track_selection_dialog_.get(), SLOT(FetchTagProgress(Song, QString)));
|
QObject::connect(tag_fetcher_.get(), &TagFetcher::Progress, track_selection_dialog_.get(), &TrackSelectionDialog::FetchTagProgress);
|
||||||
connect(track_selection_dialog_.get(), SIGNAL(accepted()), SLOT(AutoCompleteTagsAccepted()));
|
QObject::connect(track_selection_dialog_.get(), &TrackSelectionDialog::accepted, this, &MainWindow::AutoCompleteTagsAccepted);
|
||||||
connect(track_selection_dialog_.get(), SIGNAL(finished(int)), tag_fetcher_.get(), SLOT(Cancel()));
|
QObject::connect(track_selection_dialog_.get(), &TrackSelectionDialog::finished, tag_fetcher_.get(), &TagFetcher::Cancel);
|
||||||
connect(track_selection_dialog_.get(), SIGNAL(Error(QString)), SLOT(ShowErrorDialog(QString)));
|
QObject::connect(track_selection_dialog_.get(), &TrackSelectionDialog::Error, this, &MainWindow::ShowErrorDialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the selected songs and start fetching tags for them
|
// Get the selected songs and start fetching tags for them
|
||||||
@ -3022,7 +3027,7 @@ void MainWindow::PlaylistDelete() {
|
|||||||
|
|
||||||
std::shared_ptr<MusicStorage> storage(new FilesystemMusicStorage("/"));
|
std::shared_ptr<MusicStorage> storage(new FilesystemMusicStorage("/"));
|
||||||
DeleteFiles *delete_files = new DeleteFiles(app_->task_manager(), storage, true);
|
DeleteFiles *delete_files = new DeleteFiles(app_->task_manager(), storage, true);
|
||||||
connect(delete_files, SIGNAL(Finished(SongList)), SLOT(DeleteFinished(SongList)));
|
//QObject::connect(delete_files, &DeleteFiles::Finished, this, &MainWindow::DeleteFinished);
|
||||||
delete_files->Start(selected_songs);
|
delete_files->Start(selected_songs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -130,12 +130,12 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||||||
bool LoadUrl(const QString &url) override;
|
bool LoadUrl(const QString &url) override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void AlbumCoverReady(const Song &song, const QImage &image);
|
void AlbumCoverReady(Song song, QImage image);
|
||||||
void SearchCoverInProgress();
|
void SearchCoverInProgress();
|
||||||
// Signals that stop playing after track was toggled.
|
// Signals that stop playing after track was toggled.
|
||||||
void StopAfterToggled(bool stop);
|
void StopAfterToggled(bool stop);
|
||||||
|
|
||||||
void AuthorizationUrlReceived(const QUrl &url);
|
void AuthorizationUrlReceived(QUrl url);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void FilePathChanged(const QString &path);
|
void FilePathChanged(const QString &path);
|
||||||
@ -148,7 +148,7 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||||||
void ForceShowOSD(const Song &song, const bool toggle);
|
void ForceShowOSD(const Song &song, const bool toggle);
|
||||||
|
|
||||||
void PlaylistMenuHidden();
|
void PlaylistMenuHidden();
|
||||||
void PlaylistRightClick(const QPoint &global_pos, const QModelIndex &index);
|
void PlaylistRightClick(const QPoint &global_pos, const QModelIndex &idx);
|
||||||
void PlaylistCurrentChanged(const QModelIndex ¤t);
|
void PlaylistCurrentChanged(const QModelIndex ¤t);
|
||||||
void PlaylistViewSelectionModelChanged();
|
void PlaylistViewSelectionModelChanged();
|
||||||
void PlaylistPlay();
|
void PlaylistPlay();
|
||||||
@ -193,10 +193,11 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||||||
void EditFileTags(const QList<QUrl> &urls);
|
void EditFileTags(const QList<QUrl> &urls);
|
||||||
|
|
||||||
void AddToPlaylist(QMimeData *q_mimedata);
|
void AddToPlaylist(QMimeData *q_mimedata);
|
||||||
void AddToPlaylist(QAction *action);
|
void AddToPlaylistFromAction(QAction *action);
|
||||||
|
|
||||||
void VolumeWheelEvent(const int delta);
|
void VolumeWheelEvent(const int delta);
|
||||||
void ToggleShowHide();
|
void ToggleShowHide();
|
||||||
|
void ToggleHide();
|
||||||
|
|
||||||
void Seeked(const qlonglong microseconds);
|
void Seeked(const qlonglong microseconds);
|
||||||
void UpdateTrackPosition();
|
void UpdateTrackPosition();
|
||||||
@ -216,8 +217,6 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||||||
void AddStream();
|
void AddStream();
|
||||||
void AddStreamAccepted();
|
void AddStreamAccepted();
|
||||||
|
|
||||||
void CommandlineOptionsReceived(const quint32 instanceId, const QByteArray &string_options);
|
|
||||||
|
|
||||||
void CheckForUpdates();
|
void CheckForUpdates();
|
||||||
|
|
||||||
void PlayingWidgetPositionChanged(const bool above_status_bar);
|
void PlayingWidgetPositionChanged(const bool above_status_bar);
|
||||||
@ -244,8 +243,6 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||||||
void ResumePlayback();
|
void ResumePlayback();
|
||||||
void ResumePlaybackSeek(const int playback_position);
|
void ResumePlaybackSeek(const int playback_position);
|
||||||
|
|
||||||
void Raise();
|
|
||||||
|
|
||||||
void Exit();
|
void Exit();
|
||||||
void DoExit();
|
void DoExit();
|
||||||
|
|
||||||
@ -272,6 +269,10 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
|||||||
|
|
||||||
void PlaylistDelete();
|
void PlaylistDelete();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void CommandlineOptionsReceived(const quint32 instanceId, const QByteArray &string_options);
|
||||||
|
void Raise();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void SaveSettings();
|
void SaveSettings();
|
||||||
|
@ -56,7 +56,7 @@ using boost::multi_index::multi_index_container;
|
|||||||
using boost::multi_index::ordered_unique;
|
using boost::multi_index::ordered_unique;
|
||||||
using boost::multi_index::tag;
|
using boost::multi_index::tag;
|
||||||
|
|
||||||
std::size_t hash_value(const QModelIndex &index) { return qHash(index); }
|
std::size_t hash_value(const QModelIndex &idx) { return qHash(idx); }
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@ -100,13 +100,13 @@ void MergedProxyModel::DeleteAllMappings() {
|
|||||||
|
|
||||||
void MergedProxyModel::AddSubModel(const QModelIndex &source_parent, QAbstractItemModel *submodel) {
|
void MergedProxyModel::AddSubModel(const QModelIndex &source_parent, QAbstractItemModel *submodel) {
|
||||||
|
|
||||||
connect(submodel, SIGNAL(modelAboutToBeReset()), this, SLOT(SubModelAboutToBeReset()));
|
QObject::connect(submodel, &QAbstractItemModel::modelAboutToBeReset, this, &MergedProxyModel::SubModelAboutToBeReset);
|
||||||
connect(submodel, SIGNAL(modelReset()), this, SLOT(SubModelReset()));
|
QObject::connect(submodel, &QAbstractItemModel::modelReset, this, &MergedProxyModel::SubModelResetSlot);
|
||||||
connect(submodel, SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)), this, SLOT(RowsAboutToBeInserted(QModelIndex, int, int)));
|
QObject::connect(submodel, &QAbstractItemModel::rowsAboutToBeInserted, this, &MergedProxyModel::RowsAboutToBeInserted);
|
||||||
connect(submodel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), this, SLOT(RowsAboutToBeRemoved(QModelIndex, int, int)));
|
QObject::connect(submodel, &QAbstractItemModel::rowsAboutToBeRemoved, this, &MergedProxyModel::RowsAboutToBeRemoved);
|
||||||
connect(submodel, SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(RowsInserted(QModelIndex, int, int)));
|
QObject::connect(submodel, &QAbstractItemModel::rowsInserted, this, &MergedProxyModel::RowsInserted);
|
||||||
connect(submodel, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(RowsRemoved(QModelIndex, int, int)));
|
QObject::connect(submodel, &QAbstractItemModel::rowsRemoved, this, &MergedProxyModel::RowsRemoved);
|
||||||
connect(submodel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(DataChanged(QModelIndex, QModelIndex)));
|
QObject::connect(submodel, &QAbstractItemModel::dataChanged, this, &MergedProxyModel::DataChanged);
|
||||||
|
|
||||||
QModelIndex proxy_parent = mapFromSource(source_parent);
|
QModelIndex proxy_parent = mapFromSource(source_parent);
|
||||||
const int rows = submodel->rowCount();
|
const int rows = submodel->rowCount();
|
||||||
@ -153,26 +153,26 @@ void MergedProxyModel::RemoveSubModel(const QModelIndex &source_parent) {
|
|||||||
void MergedProxyModel::setSourceModel(QAbstractItemModel *source_model) {
|
void MergedProxyModel::setSourceModel(QAbstractItemModel *source_model) {
|
||||||
|
|
||||||
if (sourceModel()) {
|
if (sourceModel()) {
|
||||||
disconnect(sourceModel(), SIGNAL(modelReset()), this, SLOT(SourceModelReset()));
|
QObject::disconnect(sourceModel(), &QAbstractItemModel::modelReset, this, &MergedProxyModel::SourceModelReset);
|
||||||
disconnect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), this, SLOT(RowsAboutToBeInserted(QModelIndex,int,int)));
|
QObject::disconnect(sourceModel(), &QAbstractItemModel::rowsAboutToBeInserted, this, &MergedProxyModel::RowsAboutToBeInserted);
|
||||||
disconnect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), this, SLOT(RowsAboutToBeRemoved(QModelIndex,int,int)));
|
QObject::disconnect(sourceModel(), &QAbstractItemModel::rowsAboutToBeRemoved, this, &MergedProxyModel::RowsAboutToBeRemoved);
|
||||||
disconnect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(RowsInserted(QModelIndex,int,int)));
|
QObject::disconnect(sourceModel(), &QAbstractItemModel::rowsInserted, this, &MergedProxyModel::RowsInserted);
|
||||||
disconnect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(RowsRemoved(QModelIndex,int,int)));
|
QObject::disconnect(sourceModel(), &QAbstractItemModel::rowsRemoved, this, &MergedProxyModel::RowsRemoved);
|
||||||
disconnect(sourceModel(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(DataChanged(QModelIndex, QModelIndex)));
|
QObject::disconnect(sourceModel(), &QAbstractItemModel::dataChanged, this, &MergedProxyModel::DataChanged);
|
||||||
disconnect(sourceModel(), SIGNAL(layoutAboutToBeChanged()), this, SLOT(LayoutAboutToBeChanged()));
|
QObject::disconnect(sourceModel(), &QAbstractItemModel::layoutAboutToBeChanged, this, &MergedProxyModel::LayoutAboutToBeChanged);
|
||||||
disconnect(sourceModel(), SIGNAL(layoutChanged()), this, SLOT(LayoutChanged()));
|
QObject::disconnect(sourceModel(), &QAbstractItemModel::layoutChanged, this, &MergedProxyModel::LayoutChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
QAbstractProxyModel::setSourceModel(source_model);
|
QAbstractProxyModel::setSourceModel(source_model);
|
||||||
|
|
||||||
connect(sourceModel(), SIGNAL(modelReset()), this, SLOT(SourceModelReset()));
|
QObject::connect(sourceModel(), &QAbstractItemModel::modelReset, this, &MergedProxyModel::SourceModelReset);
|
||||||
connect(sourceModel(), SIGNAL(rowsAboutToBeInserted(QModelIndex, int, int)), this, SLOT(RowsAboutToBeInserted(QModelIndex, int, int)));
|
QObject::connect(sourceModel(), &QAbstractItemModel::rowsAboutToBeInserted, this, &MergedProxyModel::RowsAboutToBeInserted);
|
||||||
connect(sourceModel(), SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), this, SLOT(RowsAboutToBeRemoved(QModelIndex, int, int)));
|
QObject::connect(sourceModel(), &QAbstractItemModel::rowsAboutToBeRemoved, this, &MergedProxyModel::RowsAboutToBeRemoved);
|
||||||
connect(sourceModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(RowsInserted(QModelIndex,int,int)));
|
QObject::connect(sourceModel(), &QAbstractItemModel::rowsInserted, this, &MergedProxyModel::RowsInserted);
|
||||||
connect(sourceModel(), SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(RowsRemoved(QModelIndex,int,int)));
|
QObject::connect(sourceModel(), &QAbstractItemModel::rowsRemoved, this, &MergedProxyModel::RowsRemoved);
|
||||||
connect(sourceModel(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(DataChanged(QModelIndex,QModelIndex)));
|
QObject::connect(sourceModel(), &QAbstractItemModel::dataChanged, this, &MergedProxyModel::DataChanged);
|
||||||
connect(sourceModel(), SIGNAL(layoutAboutToBeChanged()), this, SLOT(LayoutAboutToBeChanged()));
|
QObject::connect(sourceModel(), &QAbstractItemModel::layoutAboutToBeChanged, this, &MergedProxyModel::LayoutAboutToBeChanged);
|
||||||
connect(sourceModel(), SIGNAL(layoutChanged()), this, SLOT(LayoutChanged()));
|
QObject::connect(sourceModel(), &QAbstractItemModel::layoutChanged, this, &MergedProxyModel::LayoutChanged);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ void MergedProxyModel::SubModelAboutToBeReset() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MergedProxyModel::SubModelReset() {
|
void MergedProxyModel::SubModelResetSlot() {
|
||||||
|
|
||||||
QAbstractItemModel *submodel = static_cast<QAbstractItemModel*>(sender());
|
QAbstractItemModel *submodel = static_cast<QAbstractItemModel*>(sender());
|
||||||
|
|
||||||
@ -393,22 +393,22 @@ QMap<int, QVariant> MergedProxyModel::itemData(const QModelIndex &proxy_index) c
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt::ItemFlags MergedProxyModel::flags(const QModelIndex &index) const {
|
Qt::ItemFlags MergedProxyModel::flags(const QModelIndex &idx) const {
|
||||||
|
|
||||||
QModelIndex source_index = mapToSource(index);
|
QModelIndex source_index = mapToSource(idx);
|
||||||
|
|
||||||
if (!source_index.isValid()) return sourceModel()->flags(QModelIndex());
|
if (!source_index.isValid()) return sourceModel()->flags(QModelIndex());
|
||||||
return source_index.model()->flags(source_index);
|
return source_index.model()->flags(source_index);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MergedProxyModel::setData(const QModelIndex &index, const QVariant &value, int role) {
|
bool MergedProxyModel::setData(const QModelIndex &idx, const QVariant &value, int role) {
|
||||||
|
|
||||||
QModelIndex source_index = mapToSource(index);
|
QModelIndex source_index = mapToSource(idx);
|
||||||
|
|
||||||
if (!source_index.isValid())
|
if (!source_index.isValid())
|
||||||
return sourceModel()->setData(index, value, role);
|
return sourceModel()->setData(idx, value, role);
|
||||||
return GetModel(index)->setData(index, value, role);
|
return GetModel(idx)->setData(idx, value, role);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,8 +542,8 @@ bool MergedProxyModel::IsKnownModel(const QAbstractItemModel *model) const {
|
|||||||
QModelIndexList MergedProxyModel::mapFromSource(const QModelIndexList &source_indexes) const {
|
QModelIndexList MergedProxyModel::mapFromSource(const QModelIndexList &source_indexes) const {
|
||||||
|
|
||||||
QModelIndexList ret;
|
QModelIndexList ret;
|
||||||
for (const QModelIndex &index : source_indexes) {
|
for (const QModelIndex &idx : source_indexes) {
|
||||||
ret << mapFromSource(index);
|
ret << mapFromSource(idx);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -552,8 +552,8 @@ QModelIndexList MergedProxyModel::mapFromSource(const QModelIndexList &source_in
|
|||||||
QModelIndexList MergedProxyModel::mapToSource(const QModelIndexList &proxy_indexes) const {
|
QModelIndexList MergedProxyModel::mapToSource(const QModelIndexList &proxy_indexes) const {
|
||||||
|
|
||||||
QModelIndexList ret;
|
QModelIndexList ret;
|
||||||
for (const QModelIndex &index : proxy_indexes) {
|
for (const QModelIndex &idx : proxy_indexes) {
|
||||||
ret << mapToSource(index);
|
ret << mapToSource(idx);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
class QMimeData;
|
class QMimeData;
|
||||||
|
|
||||||
std::size_t hash_value(const QModelIndex &index);
|
std::size_t hash_value(const QModelIndex &idx);
|
||||||
|
|
||||||
class MergedProxyModelPrivate;
|
class MergedProxyModelPrivate;
|
||||||
|
|
||||||
@ -63,8 +63,8 @@ class MergedProxyModel : public QAbstractProxyModel {
|
|||||||
QVariant data(const QModelIndex &proxy_index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex &proxy_index, int role = Qt::DisplayRole) const override;
|
||||||
bool hasChildren(const QModelIndex &parent) const override;
|
bool hasChildren(const QModelIndex &parent) const override;
|
||||||
QMap<int, QVariant> itemData(const QModelIndex &proxy_index) const override;
|
QMap<int, QVariant> itemData(const QModelIndex &proxy_index) const override;
|
||||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
Qt::ItemFlags flags(const QModelIndex &idx) const override;
|
||||||
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
|
bool setData(const QModelIndex &idx, const QVariant &value, int role) override;
|
||||||
QStringList mimeTypes() const override;
|
QStringList mimeTypes() const override;
|
||||||
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
||||||
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
|
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
|
||||||
@ -83,12 +83,12 @@ class MergedProxyModel : public QAbstractProxyModel {
|
|||||||
QModelIndexList mapToSource(const QModelIndexList &proxy_indexes) const;
|
QModelIndexList mapToSource(const QModelIndexList &proxy_indexes) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void SubModelReset(const QModelIndex &root, QAbstractItemModel *model);
|
void SubModelReset(QModelIndex root, QAbstractItemModel *model);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void SourceModelReset();
|
void SourceModelReset();
|
||||||
void SubModelAboutToBeReset();
|
void SubModelAboutToBeReset();
|
||||||
void SubModelReset();
|
void SubModelResetSlot();
|
||||||
|
|
||||||
void RowsAboutToBeInserted(const QModelIndex &source_parent, int start, int end);
|
void RowsAboutToBeInserted(const QModelIndex &source_parent, int start, int end);
|
||||||
void RowsInserted(const QModelIndex &source_parent, int start, int end);
|
void RowsInserted(const QModelIndex &source_parent, int start, int end);
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
namespace mpris {
|
namespace mpris {
|
||||||
|
|
||||||
Mpris::Mpris(Application *app, QObject *parent) : QObject(parent), mpris2_(new mpris::Mpris2(app, this)) {
|
Mpris::Mpris(Application *app, QObject *parent) : QObject(parent), mpris2_(new mpris::Mpris2(app, this)) {
|
||||||
connect(mpris2_, SIGNAL(RaiseMainWindow()), SIGNAL(RaiseMainWindow()));
|
QObject::connect(mpris2_, &Mpris2::RaiseMainWindow, this, &Mpris::RaiseMainWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace mpris
|
} // namespace mpris
|
||||||
|
@ -38,7 +38,7 @@ class Mpris : public QObject {
|
|||||||
public:
|
public:
|
||||||
explicit Mpris(Application *app, QObject *parent = nullptr);
|
explicit Mpris(Application *app, QObject *parent = nullptr);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void RaiseMainWindow();
|
void RaiseMainWindow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -48,4 +48,3 @@ signals:
|
|||||||
} // namespace mpris
|
} // namespace mpris
|
||||||
|
|
||||||
#endif // MPRIS_H
|
#endif // MPRIS_H
|
||||||
|
|
||||||
|
@ -120,16 +120,16 @@ Mpris2::Mpris2(Application *app, QObject *parent)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(app_->current_albumcover_loader(), SIGNAL(AlbumCoverLoaded(Song, AlbumCoverLoaderResult)), SLOT(AlbumCoverLoaded(Song, AlbumCoverLoaderResult)));
|
QObject::connect(app_->current_albumcover_loader(), &CurrentAlbumCoverLoader::AlbumCoverLoaded, this, &Mpris2::AlbumCoverLoaded);
|
||||||
|
|
||||||
connect(app_->player()->engine(), SIGNAL(StateChanged(Engine::State)), SLOT(EngineStateChanged(Engine::State)));
|
QObject::connect(app_->player()->engine(), &EngineBase::StateChanged, this, &Mpris2::EngineStateChanged);
|
||||||
connect(app_->player(), SIGNAL(VolumeChanged(int)), SLOT(VolumeChanged()));
|
QObject::connect(app_->player(), &Player::VolumeChanged, this, &Mpris2::VolumeChanged);
|
||||||
connect(app_->player(), SIGNAL(Seeked(qlonglong)), SIGNAL(Seeked(qlonglong)));
|
QObject::connect(app_->player(), &Player::Seeked, this, &Mpris2::Seeked);
|
||||||
|
|
||||||
connect(app_->playlist_manager(), SIGNAL(PlaylistManagerInitialized()), SLOT(PlaylistManagerInitialized()));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::PlaylistManagerInitialized, this, &Mpris2::PlaylistManagerInitialized);
|
||||||
connect(app_->playlist_manager(), SIGNAL(CurrentSongChanged(Song)), SLOT(CurrentSongChanged(Song)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::CurrentSongChanged, this, &Mpris2::CurrentSongChanged);
|
||||||
connect(app_->playlist_manager(), SIGNAL(PlaylistChanged(Playlist*)), SLOT(PlaylistChanged(Playlist*)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::PlaylistChanged, this, &Mpris2::PlaylistChangedSlot);
|
||||||
connect(app_->playlist_manager(), SIGNAL(CurrentChanged(Playlist*)), SLOT(PlaylistCollectionChanged(Playlist*)));
|
QObject::connect(app_->playlist_manager(), &PlaylistManager::CurrentChanged, this, &Mpris2::PlaylistCollectionChanged);
|
||||||
|
|
||||||
app_name_[0] = app_name_[0].toUpper();
|
app_name_[0] = app_name_[0].toUpper();
|
||||||
|
|
||||||
@ -159,8 +159,8 @@ Mpris2::Mpris2(Application *app, QObject *parent)
|
|||||||
|
|
||||||
// when PlaylistManager gets it ready, we connect PlaylistSequence with this
|
// when PlaylistManager gets it ready, we connect PlaylistSequence with this
|
||||||
void Mpris2::PlaylistManagerInitialized() {
|
void Mpris2::PlaylistManagerInitialized() {
|
||||||
connect(app_->playlist_manager()->sequence(), SIGNAL(ShuffleModeChanged(PlaylistSequence::ShuffleMode)), SLOT(ShuffleModeChanged()));
|
QObject::connect(app_->playlist_manager()->sequence(), &PlaylistSequence::ShuffleModeChanged, this, &Mpris2::ShuffleModeChanged);
|
||||||
connect(app_->playlist_manager()->sequence(), SIGNAL(RepeatModeChanged(PlaylistSequence::RepeatMode)), SLOT(RepeatModeChanged()));
|
QObject::connect(app_->playlist_manager()->sequence(), &PlaylistSequence::RepeatModeChanged, this, &Mpris2::RepeatModeChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mpris2::EngineStateChanged(Engine::State newState) {
|
void Mpris2::EngineStateChanged(Engine::State newState) {
|
||||||
@ -605,11 +605,12 @@ MprisPlaylistList Mpris2::GetPlaylists(quint32 index, quint32 max_count, const Q
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mpris2::PlaylistChanged(Playlist *playlist) {
|
void Mpris2::PlaylistChangedSlot(Playlist *playlist) {
|
||||||
|
|
||||||
MprisPlaylist mpris_playlist;
|
MprisPlaylist mpris_playlist;
|
||||||
mpris_playlist.id = MakePlaylistPath(playlist->id());
|
mpris_playlist.id = MakePlaylistPath(playlist->id());
|
||||||
mpris_playlist.name = app_->playlist_manager()->GetPlaylistName(playlist->id());
|
mpris_playlist.name = app_->playlist_manager()->GetPlaylistName(playlist->id());
|
||||||
|
|
||||||
emit PlaylistChanged(mpris_playlist);
|
emit PlaylistChanged(mpris_playlist);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -185,7 +185,7 @@ class Mpris2 : public QObject {
|
|||||||
void ActivatePlaylist(const QDBusObjectPath &playlist_id);
|
void ActivatePlaylist(const QDBusObjectPath &playlist_id);
|
||||||
QList<MprisPlaylist> GetPlaylists(quint32 index, quint32 max_count, const QString &order, bool reverse_order);
|
QList<MprisPlaylist> GetPlaylists(quint32 index, quint32 max_count, const QString &order, bool reverse_order);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// Player
|
// Player
|
||||||
void Seeked(qlonglong position);
|
void Seeked(qlonglong position);
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ signals:
|
|||||||
void CurrentSongChanged(const Song &song);
|
void CurrentSongChanged(const Song &song);
|
||||||
void ShuffleModeChanged();
|
void ShuffleModeChanged();
|
||||||
void RepeatModeChanged();
|
void RepeatModeChanged();
|
||||||
void PlaylistChanged(Playlist *playlist);
|
void PlaylistChangedSlot(Playlist *playlist);
|
||||||
void PlaylistCollectionChanged(Playlist *playlist);
|
void PlaylistCollectionChanged(Playlist *playlist);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -62,4 +62,3 @@ inline QString AsMPRISDateTimeType(const int time) {
|
|||||||
} // namespace mpris
|
} // namespace mpris
|
||||||
|
|
||||||
#endif // MPRIS_COMMON_H
|
#endif // MPRIS_COMMON_H
|
||||||
|
|
||||||
|
@ -47,4 +47,3 @@ class MultiSortFilterProxy : public QSortFilterProxyModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // MULTISORTFILTERPROXY_H
|
#endif // MULTISORTFILTERPROXY_H
|
||||||
|
|
||||||
|
@ -97,4 +97,3 @@ Q_DECLARE_METATYPE(MusicStorage*)
|
|||||||
Q_DECLARE_METATYPE(std::shared_ptr<MusicStorage>)
|
Q_DECLARE_METATYPE(std::shared_ptr<MusicStorage>)
|
||||||
|
|
||||||
#endif // MUSICSTORAGE_H
|
#endif // MUSICSTORAGE_H
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ void NetworkTimeouts::AddReply(QNetworkReply *reply) {
|
|||||||
|
|
||||||
if (timers_.contains(reply)) return;
|
if (timers_.contains(reply)) return;
|
||||||
|
|
||||||
connect(reply, SIGNAL(destroyed()), SLOT(ReplyFinished()));
|
QObject::connect(reply, &QNetworkReply::destroyed, this, &NetworkTimeouts::ReplyFinished);
|
||||||
connect(reply, SIGNAL(finished()), SLOT(ReplyFinished()));
|
QObject::connect(reply, &QNetworkReply::finished, this, &NetworkTimeouts::ReplyFinished);
|
||||||
timers_[reply] = startTimer(timeout_msec_);
|
timers_[reply] = startTimer(timeout_msec_);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -170,20 +170,20 @@ void Player::Init() {
|
|||||||
|
|
||||||
analyzer_->SetEngine(engine_.get());
|
analyzer_->SetEngine(engine_.get());
|
||||||
|
|
||||||
connect(engine_.get(), SIGNAL(Error(QString)), SIGNAL(Error(QString)));
|
QObject::connect(engine_.get(), &EngineBase::Error, this, &Player::Error);
|
||||||
connect(engine_.get(), SIGNAL(FatalError()), SLOT(FatalError()));
|
QObject::connect(engine_.get(), &EngineBase::FatalError, this, &Player::FatalError);
|
||||||
connect(engine_.get(), SIGNAL(ValidSongRequested(QUrl)), SLOT(ValidSongRequested(QUrl)));
|
QObject::connect(engine_.get(), &EngineBase::ValidSongRequested, this, &Player::ValidSongRequested);
|
||||||
connect(engine_.get(), SIGNAL(InvalidSongRequested(QUrl)), SLOT(InvalidSongRequested(QUrl)));
|
QObject::connect(engine_.get(), &EngineBase::InvalidSongRequested, this, &Player::InvalidSongRequested);
|
||||||
connect(engine_.get(), SIGNAL(StateChanged(Engine::State)), SLOT(EngineStateChanged(Engine::State)));
|
QObject::connect(engine_.get(), &EngineBase::StateChanged, this, &Player::EngineStateChanged);
|
||||||
connect(engine_.get(), SIGNAL(TrackAboutToEnd()), SLOT(TrackAboutToEnd()));
|
QObject::connect(engine_.get(), &EngineBase::TrackAboutToEnd, this, &Player::TrackAboutToEnd);
|
||||||
connect(engine_.get(), SIGNAL(TrackEnded()), SLOT(TrackEnded()));
|
QObject::connect(engine_.get(), &EngineBase::TrackEnded, this, &Player::TrackEnded);
|
||||||
connect(engine_.get(), SIGNAL(MetaData(Engine::SimpleMetaBundle)), SLOT(EngineMetadataReceived(Engine::SimpleMetaBundle)));
|
QObject::connect(engine_.get(), &EngineBase::MetaData, this, &Player::EngineMetadataReceived);
|
||||||
|
|
||||||
// Equalizer
|
// Equalizer
|
||||||
connect(equalizer_, SIGNAL(StereoBalancerEnabledChanged(bool)), app_->player()->engine(), SLOT(SetStereoBalancerEnabled(bool)));
|
QObject::connect(equalizer_, &Equalizer::StereoBalancerEnabledChanged, app_->player()->engine(), &EngineBase::SetStereoBalancerEnabled);
|
||||||
connect(equalizer_, SIGNAL(StereoBalanceChanged(float)), app_->player()->engine(), SLOT(SetStereoBalance(float)));
|
QObject::connect(equalizer_, &Equalizer::StereoBalanceChanged, app_->player()->engine(), &EngineBase::SetStereoBalance);
|
||||||
connect(equalizer_, SIGNAL(EqualizerEnabledChanged(bool)), app_->player()->engine(), SLOT(SetEqualizerEnabled(bool)));
|
QObject::connect(equalizer_, &Equalizer::EqualizerEnabledChanged, app_->player()->engine(), &EngineBase::SetEqualizerEnabled);
|
||||||
connect(equalizer_, SIGNAL(EqualizerParametersChanged(int, QList<int>)), app_->player()->engine(), SLOT(SetEqualizerParameters(int, QList<int>)));
|
QObject::connect(equalizer_, &Equalizer::EqualizerParametersChanged, app_->player()->engine(), &EngineBase::SetEqualizerParameters);
|
||||||
|
|
||||||
engine_->SetStereoBalancerEnabled(equalizer_->is_stereo_balancer_enabled());
|
engine_->SetStereoBalancerEnabled(equalizer_->is_stereo_balancer_enabled());
|
||||||
engine_->SetStereoBalance(equalizer_->stereo_balance());
|
engine_->SetStereoBalance(equalizer_->stereo_balance());
|
||||||
@ -828,8 +828,8 @@ void Player::RegisterUrlHandler(UrlHandler *handler) {
|
|||||||
|
|
||||||
qLog(Info) << "Registered URL handler for" << scheme;
|
qLog(Info) << "Registered URL handler for" << scheme;
|
||||||
url_handlers_.insert(scheme, handler);
|
url_handlers_.insert(scheme, handler);
|
||||||
connect(handler, SIGNAL(destroyed(QObject*)), SLOT(UrlHandlerDestroyed(QObject*)));
|
QObject::connect(handler, &UrlHandler::destroyed, this, &Player::UrlHandlerDestroyed);
|
||||||
connect(handler, SIGNAL(AsyncLoadComplete(UrlHandler::LoadResult)), SLOT(HandleLoadResult(UrlHandler::LoadResult)));
|
QObject::connect(handler, &UrlHandler::AsyncLoadComplete, this, &Player::HandleLoadResult);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -843,8 +843,8 @@ void Player::UnregisterUrlHandler(UrlHandler *handler) {
|
|||||||
|
|
||||||
qLog(Info) << "Unregistered URL handler for" << scheme;
|
qLog(Info) << "Unregistered URL handler for" << scheme;
|
||||||
url_handlers_.remove(scheme);
|
url_handlers_.remove(scheme);
|
||||||
disconnect(handler, SIGNAL(destroyed(QObject*)), this, SLOT(UrlHandlerDestroyed(QObject*)));
|
QObject::disconnect(handler, &UrlHandler::destroyed, this, &Player::UrlHandlerDestroyed);
|
||||||
disconnect(handler, SIGNAL(AsyncLoadComplete(UrlHandler::LoadResult)), this, SLOT(HandleLoadResult(UrlHandler::LoadResult)));
|
QObject::disconnect(handler, &UrlHandler::AsyncLoadComplete, this, &Player::HandleLoadResult);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,6 +77,7 @@ class PlayerInterface : public QObject {
|
|||||||
|
|
||||||
// If there's currently a song playing, pause it, otherwise play the track that was playing last, or the first one on the playlist
|
// If there's currently a song playing, pause it, otherwise play the track that was playing last, or the first one on the playlist
|
||||||
virtual void PlayPause(Playlist::AutoScroll autoscroll = Playlist::AutoScroll_Always) = 0;
|
virtual void PlayPause(Playlist::AutoScroll autoscroll = Playlist::AutoScroll_Always) = 0;
|
||||||
|
virtual void PlayPauseHelper() = 0;
|
||||||
virtual void RestartOrPrevious() = 0;
|
virtual void RestartOrPrevious() = 0;
|
||||||
|
|
||||||
// Skips this track. Might load more of the current radio station.
|
// Skips this track. Might load more of the current radio station.
|
||||||
@ -106,11 +107,10 @@ class PlayerInterface : public QObject {
|
|||||||
// Emitted only when playback is manually resumed
|
// Emitted only when playback is manually resumed
|
||||||
void Resumed();
|
void Resumed();
|
||||||
void Stopped();
|
void Stopped();
|
||||||
void Error();
|
void Error(QString message = QString());
|
||||||
void PlaylistFinished();
|
void PlaylistFinished();
|
||||||
void VolumeEnabled(bool);
|
void VolumeEnabled(bool);
|
||||||
void VolumeChanged(int volume);
|
void VolumeChanged(int volume);
|
||||||
void Error(QString message);
|
|
||||||
void TrackSkipped(PlaylistItemPtr old_track);
|
void TrackSkipped(PlaylistItemPtr old_track);
|
||||||
// Emitted when there's a manual change to the current's track position.
|
// Emitted when there's a manual change to the current's track position.
|
||||||
void Seeked(qlonglong microseconds);
|
void Seeked(qlonglong microseconds);
|
||||||
@ -160,6 +160,7 @@ class Player : public PlayerInterface {
|
|||||||
|
|
||||||
void PlayAt(const int index, Engine::TrackChangeFlags change, const Playlist::AutoScroll autoscroll, const bool reshuffle, const bool force_inform = false) override;
|
void PlayAt(const int index, Engine::TrackChangeFlags change, const Playlist::AutoScroll autoscroll, const bool reshuffle, const bool force_inform = false) override;
|
||||||
void PlayPause(Playlist::AutoScroll autoscroll = Playlist::AutoScroll_Always) override;
|
void PlayPause(Playlist::AutoScroll autoscroll = Playlist::AutoScroll_Always) override;
|
||||||
|
void PlayPauseHelper() override { PlayPause(); }
|
||||||
void RestartOrPrevious() override;
|
void RestartOrPrevious() override;
|
||||||
void Next() override;
|
void Next() override;
|
||||||
void Previous() override;
|
void Previous() override;
|
||||||
|
@ -26,4 +26,4 @@
|
|||||||
// Exported by QtGui
|
// Exported by QtGui
|
||||||
void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0);
|
void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0);
|
||||||
|
|
||||||
#endif // QT_BLURIMAGE_H
|
#endif // QT_BLURIMAGE_H
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
QtFSListener::QtFSListener(QObject *parent) : FileSystemWatcherInterface(parent), watcher_(this) {
|
QtFSListener::QtFSListener(QObject *parent) : FileSystemWatcherInterface(parent), watcher_(this) {
|
||||||
|
|
||||||
connect(&watcher_, SIGNAL(directoryChanged(QString)), SIGNAL(PathChanged(QString)));
|
QObject::connect(&watcher_, &QFileSystemWatcher::directoryChanged, this, &QtFSListener::PathChanged);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,4 +43,4 @@ class QtFSListener : public FileSystemWatcherInterface {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif // QTFSLISTENER_H
|
||||||
|
@ -62,7 +62,7 @@ QtSystemTrayIcon::QtSystemTrayIcon(QObject *parent)
|
|||||||
tray_->installEventFilter(this);
|
tray_->installEventFilter(this);
|
||||||
ClearNowPlaying();
|
ClearNowPlaying();
|
||||||
|
|
||||||
connect(tray_, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(Clicked(QSystemTrayIcon::ActivationReason)));
|
QObject::connect(tray_, &QSystemTrayIcon::activated, this, &QtSystemTrayIcon::Clicked);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,23 +122,23 @@ void QtSystemTrayIcon::SetupMenu(QAction *previous, QAction *play, QAction *stop
|
|||||||
|
|
||||||
// Creating new actions and connecting them to old ones.
|
// Creating new actions and connecting them to old ones.
|
||||||
// This allows us to use old actions without displaying shortcuts that can not be used when Strawberry's window is hidden
|
// This allows us to use old actions without displaying shortcuts that can not be used when Strawberry's window is hidden
|
||||||
menu_->addAction(previous->icon(), previous->text(), previous, SLOT(trigger()));
|
menu_->addAction(previous->icon(), previous->text(), previous, &QAction::trigger);
|
||||||
action_play_pause_ = menu_->addAction(play->icon(), play->text(), play, SLOT(trigger()));
|
action_play_pause_ = menu_->addAction(play->icon(), play->text(), play, &QAction::trigger);
|
||||||
action_stop_ = menu_->addAction(stop->icon(), stop->text(), stop, SLOT(trigger()));
|
action_stop_ = menu_->addAction(stop->icon(), stop->text(), stop, &QAction::trigger);
|
||||||
action_stop_after_this_track_ = menu_->addAction(stop_after->icon(), stop_after->text(), stop_after, SLOT(trigger()));
|
action_stop_after_this_track_ = menu_->addAction(stop_after->icon(), stop_after->text(), stop_after, &QAction::trigger);
|
||||||
menu_->addAction(next->icon(), next->text(), next, SLOT(trigger()));
|
menu_->addAction(next->icon(), next->text(), next, &QAction::trigger);
|
||||||
|
|
||||||
menu_->addSeparator();
|
menu_->addSeparator();
|
||||||
action_mute_ = menu_->addAction(mute->icon(), mute->text(), mute, SLOT(trigger()));
|
action_mute_ = menu_->addAction(mute->icon(), mute->text(), mute, &QAction::trigger);
|
||||||
action_mute_->setCheckable(true);
|
action_mute_->setCheckable(true);
|
||||||
action_mute_->setChecked(mute->isChecked());
|
action_mute_->setChecked(mute->isChecked());
|
||||||
|
|
||||||
menu_->addSeparator();
|
menu_->addSeparator();
|
||||||
action_love_ = menu_->addAction(love->icon(), love->text(), love, SLOT(trigger()));
|
action_love_ = menu_->addAction(love->icon(), love->text(), love, &QAction::trigger);
|
||||||
action_love_->setVisible(love->isVisible());
|
action_love_->setVisible(love->isVisible());
|
||||||
action_love_->setEnabled(love->isEnabled());
|
action_love_->setEnabled(love->isEnabled());
|
||||||
menu_->addSeparator();
|
menu_->addSeparator();
|
||||||
menu_->addAction(quit->icon(), quit->text(), quit, SLOT(trigger()));
|
menu_->addAction(quit->icon(), quit->text(), quit, &QAction::trigger);
|
||||||
|
|
||||||
tray_->setContextMenu(menu_);
|
tray_->setContextMenu(menu_);
|
||||||
|
|
||||||
|
@ -68,4 +68,3 @@ class ScopedGObject {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // SCOPEDGOBJECT_H
|
#endif // SCOPEDGOBJECT_H
|
||||||
|
|
||||||
|
@ -41,4 +41,4 @@ class ScopedTransaction : boost::noncopyable {
|
|||||||
bool pending_;
|
bool pending_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SCOPEDTRANSACTION_H
|
#endif // SCOPEDTRANSACTION_H
|
||||||
|
@ -159,4 +159,3 @@ T *SimpleTreeItem<T>::ChildByKey(const QString &_key) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // SIMPLETREEITEM_H
|
#endif // SIMPLETREEITEM_H
|
||||||
|
|
||||||
|
@ -35,13 +35,13 @@ class SimpleTreeModel : public QAbstractItemModel {
|
|||||||
// QAbstractItemModel
|
// QAbstractItemModel
|
||||||
int columnCount(const QModelIndex &parent) const override;
|
int columnCount(const QModelIndex &parent) const override;
|
||||||
QModelIndex index(int row, int, const QModelIndex &parent = QModelIndex()) const override;
|
QModelIndex index(int row, int, const QModelIndex &parent = QModelIndex()) const override;
|
||||||
QModelIndex parent(const QModelIndex &index) const override;
|
QModelIndex parent(const QModelIndex &idx) const override;
|
||||||
int rowCount(const QModelIndex &parent) const override;
|
int rowCount(const QModelIndex &parent) const override;
|
||||||
bool hasChildren(const QModelIndex &parent) const override;
|
bool hasChildren(const QModelIndex &parent) const override;
|
||||||
bool canFetchMore(const QModelIndex &parent) const override;
|
bool canFetchMore(const QModelIndex &parent) const override;
|
||||||
void fetchMore(const QModelIndex &parent) override;
|
void fetchMore(const QModelIndex &parent) override;
|
||||||
|
|
||||||
T *IndexToItem(const QModelIndex &index) const;
|
T *IndexToItem(const QModelIndex &idx) const;
|
||||||
QModelIndex ItemToIndex(T *item) const;
|
QModelIndex ItemToIndex(T *item) const;
|
||||||
|
|
||||||
// Called by items
|
// Called by items
|
||||||
@ -63,9 +63,9 @@ SimpleTreeModel<T>::SimpleTreeModel(T *root, QObject *parent)
|
|||||||
: QAbstractItemModel(parent), root_(root) {}
|
: QAbstractItemModel(parent), root_(root) {}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T *SimpleTreeModel<T>::IndexToItem(const QModelIndex &index) const {
|
T *SimpleTreeModel<T>::IndexToItem(const QModelIndex &idx) const {
|
||||||
if (!index.isValid()) return root_;
|
if (!idx.isValid()) return root_;
|
||||||
return reinterpret_cast<T*>(index.internalPointer());
|
return reinterpret_cast<T*>(idx.internalPointer());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -81,16 +81,18 @@ int SimpleTreeModel<T>::columnCount(const QModelIndex&) const {
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
QModelIndex SimpleTreeModel<T>::index(int row, int, const QModelIndex &parent) const {
|
QModelIndex SimpleTreeModel<T>::index(int row, int, const QModelIndex &parent) const {
|
||||||
|
|
||||||
T *parent_item = IndexToItem(parent);
|
T *parent_item = IndexToItem(parent);
|
||||||
if (!parent_item || row < 0 || parent_item->children.count() <= row)
|
if (!parent_item || row < 0 || parent_item->children.count() <= row)
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
return ItemToIndex(parent_item->children[row]);
|
return ItemToIndex(parent_item->children[row]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
QModelIndex SimpleTreeModel<T>::parent(const QModelIndex &index) const {
|
QModelIndex SimpleTreeModel<T>::parent(const QModelIndex &idx) const {
|
||||||
return ItemToIndex(IndexToItem(index)->parent);
|
return ItemToIndex(IndexToItem(idx)->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -388,4 +388,3 @@ uint qHash(const Song &song);
|
|||||||
uint HashSimilar(const Song &song);
|
uint HashSimilar(const Song &song);
|
||||||
|
|
||||||
#endif // SONG_H
|
#endif // SONG_H
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ SongLoader::SongLoader(CollectionBackendInterface *collection, const Player *pla
|
|||||||
|
|
||||||
timeout_timer_->setSingleShot(true);
|
timeout_timer_->setSingleShot(true);
|
||||||
|
|
||||||
connect(timeout_timer_, SIGNAL(timeout()), SLOT(Timeout()));
|
QObject::connect(timeout_timer_, &QTimer::timeout, this, &SongLoader::Timeout);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,8 +182,8 @@ SongLoader::Result SongLoader::LoadAudioCD() {
|
|||||||
#if defined(HAVE_AUDIOCD) && defined(HAVE_GSTREAMER)
|
#if defined(HAVE_AUDIOCD) && defined(HAVE_GSTREAMER)
|
||||||
if (player_->engine()->type() == Engine::GStreamer) {
|
if (player_->engine()->type() == Engine::GStreamer) {
|
||||||
CddaSongLoader *cdda_song_loader = new CddaSongLoader(QUrl(), this);
|
CddaSongLoader *cdda_song_loader = new CddaSongLoader(QUrl(), this);
|
||||||
connect(cdda_song_loader, SIGNAL(SongsDurationLoaded(SongList, QString)), this, SLOT(AudioCDTracksLoadFinishedSlot(SongList, QString)));
|
QObject::connect(cdda_song_loader, &CddaSongLoader::SongsDurationLoaded, this, &SongLoader::AudioCDTracksLoadFinishedSlot);
|
||||||
connect(cdda_song_loader, SIGNAL(SongsMetadataLoaded(SongList)), this, SLOT(AudioCDTracksTagsLoaded(SongList)));
|
QObject::connect(cdda_song_loader, &CddaSongLoader::SongsMetadataLoaded, this, &SongLoader::AudioCDTracksTagsLoaded);
|
||||||
cdda_song_loader->LoadSongs();
|
cdda_song_loader->LoadSongs();
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
@ -460,7 +460,7 @@ SongLoader::Result SongLoader::LoadRemote() {
|
|||||||
gst_object_unref(pad);
|
gst_object_unref(pad);
|
||||||
|
|
||||||
QEventLoop loop;
|
QEventLoop loop;
|
||||||
loop.connect(this, SIGNAL(LoadRemoteFinished()), SLOT(quit()));
|
loop.connect(this, &SongLoader::LoadRemoteFinished, &loop, &QEventLoop::quit);
|
||||||
|
|
||||||
// Start "playing"
|
// Start "playing"
|
||||||
gst_element_set_state(pipeline.get(), GST_STATE_PLAYING);
|
gst_element_set_state(pipeline.get(), GST_STATE_PLAYING);
|
||||||
|
@ -88,7 +88,7 @@ class SongLoader : public QObject {
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void AudioCDTracksLoadFinished();
|
void AudioCDTracksLoadFinished();
|
||||||
void LoadAudioCDFinished(const bool success);
|
void LoadAudioCDFinished(bool success);
|
||||||
void LoadRemoteFinished();
|
void LoadRemoteFinished();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -159,4 +159,3 @@ class SongLoader : public QObject {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // SONGLOADER_H
|
#endif // SONGLOADER_H
|
||||||
|
|
||||||
|
@ -40,19 +40,20 @@ StandardItemIconLoader::StandardItemIconLoader(AlbumCoverLoader *cover_loader, Q
|
|||||||
|
|
||||||
cover_options_.desired_height_ = 16;
|
cover_options_.desired_height_ = 16;
|
||||||
|
|
||||||
connect(cover_loader_, SIGNAL(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)), SLOT(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)));
|
QObject::connect(cover_loader_, &AlbumCoverLoader::AlbumCoverLoaded, this, &StandardItemIconLoader::AlbumCoverLoaded);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StandardItemIconLoader::SetModel(QAbstractItemModel *model) {
|
void StandardItemIconLoader::SetModel(QAbstractItemModel *model) {
|
||||||
|
|
||||||
if (model_) {
|
if (model_) {
|
||||||
disconnect(model_, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)), this, SLOT(RowsAboutToBeRemoved(QModelIndex, int, int)));
|
QObject::disconnect(model_, &QAbstractItemModel::rowsAboutToBeRemoved, this, &StandardItemIconLoader::RowsAboutToBeRemoved);
|
||||||
}
|
}
|
||||||
|
|
||||||
model_ = model;
|
model_ = model;
|
||||||
|
|
||||||
connect(model_, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), SLOT(RowsAboutToBeRemoved(QModelIndex,int,int)));
|
QObject::connect(model_, &QAbstractItemModel::rowsAboutToBeRemoved, this, &StandardItemIconLoader::RowsAboutToBeRemoved);
|
||||||
connect(model_, SIGNAL(modelAboutToBeReset()), SLOT(ModelReset()));
|
QObject::connect(model_, &QAbstractItemModel::modelAboutToBeReset, this, &StandardItemIconLoader::ModelReset);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,4 +105,3 @@ private:
|
|||||||
|
|
||||||
using Utils::StyleHelper;
|
using Utils::StyleHelper;
|
||||||
#endif // STYLEHELPER_H
|
#endif // STYLEHELPER_H
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ StyleSheetLoader::StyleSheetLoader(QObject *parent) : QObject(parent), timer_res
|
|||||||
timer_reset_counter_->setSingleShot(true);
|
timer_reset_counter_->setSingleShot(true);
|
||||||
timer_reset_counter_->setInterval(1000);
|
timer_reset_counter_->setInterval(1000);
|
||||||
|
|
||||||
connect(timer_reset_counter_, SIGNAL(timeout()), this, SLOT(ResetCounters()));
|
QObject::connect(timer_reset_counter_, &QTimer::timeout, this, &StyleSheetLoader::ResetCounters);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ TagReaderClient::TagReaderClient(QObject *parent) : QObject(parent), worker_pool
|
|||||||
|
|
||||||
worker_pool_->SetExecutableName(kWorkerExecutableName);
|
worker_pool_->SetExecutableName(kWorkerExecutableName);
|
||||||
worker_pool_->SetWorkerCount(qBound(1, QThread::idealThreadCount() / 2, 4));
|
worker_pool_->SetWorkerCount(qBound(1, QThread::idealThreadCount() / 2, 4));
|
||||||
connect(worker_pool_, SIGNAL(WorkerFailedToStart()), SLOT(WorkerFailedToStart()));
|
QObject::connect(worker_pool_, &WorkerPool<HandlerType>::WorkerFailedToStart, this, &TagReaderClient::WorkerFailedToStart);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,4 +83,3 @@ class TaskManager : public QObject {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // TASKMANAGER_H
|
#endif // TASKMANAGER_H
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
@ -90,7 +90,7 @@ class UrlHandler : public QObject {
|
|||||||
virtual LoadResult StartLoading(const QUrl &url) { return LoadResult(url); }
|
virtual LoadResult StartLoading(const QUrl &url) { return LoadResult(url); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void AsyncLoadComplete(const UrlHandler::LoadResult &result);
|
void AsyncLoadComplete(UrlHandler::LoadResult result);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ Windows7ThumbBar::Windows7ThumbBar(QWidget *widget)
|
|||||||
|
|
||||||
timer_->setSingleShot(true);
|
timer_->setSingleShot(true);
|
||||||
timer_->setInterval(300);
|
timer_->setInterval(300);
|
||||||
connect(timer_, SIGNAL(timeout()), SLOT(ActionChanged()));
|
QObject::connect(timer_, &QTimer::timeout, this, &Windows7ThumbBar::ActionChanged);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ void Windows7ThumbBar::SetActions(const QList<QAction*> &actions) {
|
|||||||
actions_ = actions;
|
actions_ = actions;
|
||||||
for (QAction *action : actions) {
|
for (QAction *action : actions) {
|
||||||
if (action) {
|
if (action) {
|
||||||
connect(action, SIGNAL(changed()), SLOT(ActionChangedTriggered()));
|
QObject::connect(action, &QAction::changed, this, &Windows7ThumbBar::ActionChangedTriggered);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qLog(Debug) << "Done";
|
qLog(Debug) << "Done";
|
||||||
|
@ -112,7 +112,7 @@ void AlbumCoverChoiceController::Init(Application *app) {
|
|||||||
cover_searcher_ = new AlbumCoverSearcher(QIcon(":/pictures/cdcase.png"), app, this);
|
cover_searcher_ = new AlbumCoverSearcher(QIcon(":/pictures/cdcase.png"), app, this);
|
||||||
cover_searcher_->Init(cover_fetcher_);
|
cover_searcher_->Init(cover_fetcher_);
|
||||||
|
|
||||||
connect(cover_fetcher_, SIGNAL(AlbumCoverFetched(quint64, QUrl, QImage, CoverSearchStatistics)), this, SLOT(AlbumCoverFetched(quint64, QUrl, QImage, CoverSearchStatistics)));
|
QObject::connect(cover_fetcher_, &AlbumCoverFetcher::AlbumCoverFetched, this, &AlbumCoverChoiceController::AlbumCoverFetched);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ AlbumCoverExport::AlbumCoverExport(QWidget *parent) : QDialog(parent), ui_(new U
|
|||||||
|
|
||||||
ui_->setupUi(this);
|
ui_->setupUi(this);
|
||||||
|
|
||||||
connect(ui_->forceSize, SIGNAL(stateChanged(int)), SLOT(ForceSizeToggled(int)));
|
QObject::connect(ui_->forceSize, &QCheckBox::stateChanged, this, &AlbumCoverExport::ForceSizeToggled);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,4 +77,3 @@ class AlbumCoverExport : public QDialog {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // ALBUMCOVEREXPORT_H
|
#endif // ALBUMCOVEREXPORT_H
|
||||||
|
|
||||||
|
@ -61,8 +61,8 @@ void AlbumCoverExporter::AddJobsToPool() {
|
|||||||
while (!requests_.isEmpty() && thread_pool_->activeThreadCount() < thread_pool_->maxThreadCount()) {
|
while (!requests_.isEmpty() && thread_pool_->activeThreadCount() < thread_pool_->maxThreadCount()) {
|
||||||
CoverExportRunnable *runnable = requests_.dequeue();
|
CoverExportRunnable *runnable = requests_.dequeue();
|
||||||
|
|
||||||
connect(runnable, SIGNAL(CoverExported()), SLOT(CoverExported()));
|
QObject::connect(runnable, &CoverExportRunnable::CoverExported, this, &AlbumCoverExporter::CoverExported);
|
||||||
connect(runnable, SIGNAL(CoverSkipped()), SLOT(CoverSkipped()));
|
QObject::connect(runnable, &CoverExportRunnable::CoverSkipped, this, &AlbumCoverExporter::CoverSkipped);
|
||||||
|
|
||||||
thread_pool_->start(runnable);
|
thread_pool_->start(runnable);
|
||||||
}
|
}
|
||||||
@ -80,4 +80,3 @@ void AlbumCoverExporter::CoverSkipped() {
|
|||||||
emit AlbumCoversExportUpdate(exported_, skipped_, all_);
|
emit AlbumCoversExportUpdate(exported_, skipped_, all_);
|
||||||
AddJobsToPool();
|
AddJobsToPool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class AlbumCoverExporter : public QObject {
|
|||||||
|
|
||||||
int request_count() { return requests_.size(); }
|
int request_count() { return requests_.size(); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void AlbumCoversExportUpdate(int exported, int skipped, int all);
|
void AlbumCoversExportUpdate(int exported, int skipped, int all);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -42,7 +42,7 @@ AlbumCoverFetcher::AlbumCoverFetcher(CoverProviders *cover_providers, QObject *p
|
|||||||
request_starter_(new QTimer(this)) {
|
request_starter_(new QTimer(this)) {
|
||||||
|
|
||||||
request_starter_->setInterval(1000);
|
request_starter_->setInterval(1000);
|
||||||
connect(request_starter_, SIGNAL(timeout()), SLOT(StartRequests()));
|
QObject::connect(request_starter_, &QTimer::timeout, this, &AlbumCoverFetcher::StartRequests);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,8 +127,8 @@ void AlbumCoverFetcher::StartRequests() {
|
|||||||
AlbumCoverFetcherSearch *search = new AlbumCoverFetcherSearch(request, network_, this);
|
AlbumCoverFetcherSearch *search = new AlbumCoverFetcherSearch(request, network_, this);
|
||||||
active_requests_.insert(request.id, search);
|
active_requests_.insert(request.id, search);
|
||||||
|
|
||||||
connect(search, SIGNAL(SearchFinished(quint64, CoverSearchResults)), SLOT(SingleSearchFinished(quint64, CoverSearchResults)));
|
QObject::connect(search, &AlbumCoverFetcherSearch::SearchFinished, this, &AlbumCoverFetcher::SingleSearchFinished);
|
||||||
connect(search, SIGNAL(AlbumCoverFetched(quint64, QUrl, QImage)), SLOT(SingleCoverFetched(quint64, QUrl, QImage)));
|
QObject::connect(search, &AlbumCoverFetcherSearch::AlbumCoverFetched, this, &AlbumCoverFetcher::SingleCoverFetched);
|
||||||
|
|
||||||
search->Start(cover_providers_);
|
search->Start(cover_providers_);
|
||||||
}
|
}
|
||||||
|
@ -35,11 +35,12 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
|
|
||||||
|
#include "coversearchstatistics.h"
|
||||||
|
|
||||||
class QTimer;
|
class QTimer;
|
||||||
class NetworkAccessManager;
|
class NetworkAccessManager;
|
||||||
class CoverProviders;
|
class CoverProviders;
|
||||||
class AlbumCoverFetcherSearch;
|
class AlbumCoverFetcherSearch;
|
||||||
struct CoverSearchStatistics;
|
|
||||||
|
|
||||||
// This class represents a single search-for-cover request. It identifies and describes the request.
|
// This class represents a single search-for-cover request. It identifies and describes the request.
|
||||||
struct CoverSearchRequest {
|
struct CoverSearchRequest {
|
||||||
@ -115,8 +116,8 @@ class AlbumCoverFetcher : public QObject {
|
|||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void AlbumCoverFetched(const quint64 request_id, const QUrl &cover_url, const QImage &cover, const CoverSearchStatistics &statistics);
|
void AlbumCoverFetched(quint64 request_id, QUrl cover_url, QImage cover, CoverSearchStatistics statistics);
|
||||||
void SearchFinished(const quint64 request_id, const CoverSearchResults &results, const CoverSearchStatistics &statistics);
|
void SearchFinished(quint64 request_id, CoverSearchResults results, CoverSearchStatistics statistics);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void SingleSearchFinished(const quint64, const CoverSearchResults results);
|
void SingleSearchFinished(const quint64, const CoverSearchResults results);
|
||||||
|
@ -60,7 +60,7 @@ AlbumCoverFetcherSearch::AlbumCoverFetcherSearch(const CoverSearchRequest &reque
|
|||||||
cancel_requested_(false) {
|
cancel_requested_(false) {
|
||||||
|
|
||||||
// We will terminate the search after kSearchTimeoutMs milliseconds if we are not able to find all of the results before that point in time
|
// We will terminate the search after kSearchTimeoutMs milliseconds if we are not able to find all of the results before that point in time
|
||||||
QTimer::singleShot(kSearchTimeoutMs, this, SLOT(TerminateSearch()));
|
QTimer::singleShot(kSearchTimeoutMs, this, &AlbumCoverFetcherSearch::TerminateSearch);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,8 +109,8 @@ void AlbumCoverFetcherSearch::Start(CoverProviders *cover_providers) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(provider, SIGNAL(SearchResults(int, CoverSearchResults)), SLOT(ProviderSearchResults(int, CoverSearchResults)));
|
QObject::connect(provider, &CoverProvider::SearchResults, this, QOverload<const int, const CoverSearchResults&>::of(&AlbumCoverFetcherSearch::ProviderSearchResults));
|
||||||
connect(provider, SIGNAL(SearchFinished(int, CoverSearchResults)), SLOT(ProviderSearchFinished(int, CoverSearchResults)));
|
QObject::connect(provider, &CoverProvider::SearchFinished, this, &AlbumCoverFetcherSearch::ProviderSearchFinished);
|
||||||
const int id = cover_providers->NextId();
|
const int id = cover_providers->NextId();
|
||||||
const bool success = provider->StartSearch(request_.artist, request_.album, request_.title, id);
|
const bool success = provider->StartSearch(request_.artist, request_.album, request_.title, id);
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ void AlbumCoverFetcherSearch::FetchMoreImages() {
|
|||||||
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
#endif
|
#endif
|
||||||
QNetworkReply *image_reply = network_->get(req);
|
QNetworkReply *image_reply = network_->get(req);
|
||||||
connect(image_reply, &QNetworkReply::finished, [=] { ProviderCoverFetchFinished(image_reply); });
|
QObject::connect(image_reply, &QNetworkReply::finished, [this, image_reply]() { ProviderCoverFetchFinished(image_reply); });
|
||||||
pending_image_loads_[image_reply] = result;
|
pending_image_loads_[image_reply] = result;
|
||||||
image_load_timeout_->AddReply(image_reply);
|
image_load_timeout_->AddReply(image_reply);
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ void AlbumCoverFetcherSearch::FetchMoreImages() {
|
|||||||
|
|
||||||
void AlbumCoverFetcherSearch::ProviderCoverFetchFinished(QNetworkReply *reply) {
|
void AlbumCoverFetcherSearch::ProviderCoverFetchFinished(QNetworkReply *reply) {
|
||||||
|
|
||||||
disconnect(reply, nullptr, this, nullptr);
|
QObject::disconnect(reply, nullptr, this, nullptr);
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
|
|
||||||
if (!pending_image_loads_.contains(reply)) return;
|
if (!pending_image_loads_.contains(reply)) return;
|
||||||
@ -412,7 +412,7 @@ void AlbumCoverFetcherSearch::Cancel() {
|
|||||||
}
|
}
|
||||||
else if (!pending_image_loads_.isEmpty()) {
|
else if (!pending_image_loads_.isEmpty()) {
|
||||||
for (QNetworkReply *reply : pending_image_loads_.keys()) {
|
for (QNetworkReply *reply : pending_image_loads_.keys()) {
|
||||||
disconnect(reply, &QNetworkReply::finished, this, nullptr);
|
QObject::disconnect(reply, &QNetworkReply::finished, this, nullptr);
|
||||||
reply->abort();
|
reply->abort();
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
}
|
}
|
||||||
|
@ -63,19 +63,19 @@ class AlbumCoverFetcherSearch : public QObject {
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
// It's the end of search (when there was no fetch-me-a-cover request).
|
// It's the end of search (when there was no fetch-me-a-cover request).
|
||||||
void SearchFinished(const quint64, const CoverSearchResults &results);
|
void SearchFinished(quint64, CoverSearchResults results);
|
||||||
|
|
||||||
// It's the end of search and we've fetched a cover.
|
// It's the end of search and we've fetched a cover.
|
||||||
void AlbumCoverFetched(const quint64, const QUrl &cover_url, const QImage &cover);
|
void AlbumCoverFetched(const quint64, const QUrl &cover_url, const QImage &cover);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void ProviderSearchResults(const int id, const CoverSearchResults &results);
|
void ProviderSearchResults(const int id, const CoverSearchResults &results);
|
||||||
void ProviderSearchResults(CoverProvider *provider, const CoverSearchResults &results);
|
|
||||||
void ProviderSearchFinished(const int id, const CoverSearchResults &results);
|
void ProviderSearchFinished(const int id, const CoverSearchResults &results);
|
||||||
void ProviderCoverFetchFinished(QNetworkReply *reply);
|
void ProviderCoverFetchFinished(QNetworkReply *reply);
|
||||||
void TerminateSearch();
|
void TerminateSearch();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void ProviderSearchResults(CoverProvider *provider, const CoverSearchResults &results);
|
||||||
void AllProvidersFinished();
|
void AllProvidersFinished();
|
||||||
|
|
||||||
void FetchMoreImages();
|
void FetchMoreImages();
|
||||||
|
@ -385,7 +385,7 @@ AlbumCoverLoader::TryLoadResult AlbumCoverLoader::TryLoadImage(Task *task) {
|
|||||||
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
#endif
|
#endif
|
||||||
QNetworkReply *reply = network_->get(request);
|
QNetworkReply *reply = network_->get(request);
|
||||||
connect(reply, &QNetworkReply::finished, [=] { RemoteFetchFinished(reply, cover_url); });
|
QObject::connect(reply, &QNetworkReply::finished, [this, reply, cover_url]() { RemoteFetchFinished(reply, cover_url); });
|
||||||
|
|
||||||
remote_tasks_.insert(reply, *task);
|
remote_tasks_.insert(reply, *task);
|
||||||
return TryLoadResult(true, false, type, cover_url, QImage());
|
return TryLoadResult(true, false, type, cover_url, QImage());
|
||||||
@ -417,7 +417,7 @@ void AlbumCoverLoader::RemoteFetchFinished(QNetworkReply *reply, const QUrl &cov
|
|||||||
#endif
|
#endif
|
||||||
request.setUrl(redirect.toUrl());
|
request.setUrl(redirect.toUrl());
|
||||||
QNetworkReply *redirected_reply = network_->get(request);
|
QNetworkReply *redirected_reply = network_->get(request);
|
||||||
connect(redirected_reply, &QNetworkReply::finished, [=] { RemoteFetchFinished(redirected_reply, redirect.toUrl()); });
|
QObject::connect(redirected_reply, &QNetworkReply::finished, [this, redirected_reply, redirect]() { RemoteFetchFinished(redirected_reply, redirect.toUrl()); });
|
||||||
|
|
||||||
remote_tasks_.insert(redirected_reply, task);
|
remote_tasks_.insert(redirected_reply, task);
|
||||||
return;
|
return;
|
||||||
|
@ -131,13 +131,13 @@ AlbumCoverManager::AlbumCoverManager(Application *app, CollectionBackend *collec
|
|||||||
progress_bar_->hide();
|
progress_bar_->hide();
|
||||||
abort_progress_->hide();
|
abort_progress_->hide();
|
||||||
abort_progress_->setText(tr("Abort"));
|
abort_progress_->setText(tr("Abort"));
|
||||||
connect(abort_progress_, SIGNAL(clicked()), this, SLOT(CancelRequests()));
|
QObject::connect(abort_progress_, &QPushButton::clicked, this, &AlbumCoverManager::CancelRequests);
|
||||||
|
|
||||||
ui_->albums->setAttribute(Qt::WA_MacShowFocusRect, false);
|
ui_->albums->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
ui_->artists->setAttribute(Qt::WA_MacShowFocusRect, false);
|
ui_->artists->setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
|
|
||||||
QShortcut *close = new QShortcut(QKeySequence::Close, this);
|
QShortcut *close = new QShortcut(QKeySequence::Close, this);
|
||||||
connect(close, SIGNAL(activated()), SLOT(close()));
|
QObject::connect(close, &QShortcut::activated, this, &AlbumCoverManager::close);
|
||||||
|
|
||||||
EnableCoversButtons();
|
EnableCoversButtons();
|
||||||
|
|
||||||
@ -180,14 +180,14 @@ void AlbumCoverManager::Init() {
|
|||||||
|
|
||||||
QList<QAction*> actions = album_cover_choice_controller_->GetAllActions();
|
QList<QAction*> actions = album_cover_choice_controller_->GetAllActions();
|
||||||
|
|
||||||
connect(album_cover_choice_controller_->cover_from_file_action(), SIGNAL(triggered()), this, SLOT(LoadCoverFromFile()));
|
QObject::connect(album_cover_choice_controller_->cover_from_file_action(), &QAction::triggered, this, &AlbumCoverManager::LoadCoverFromFile);
|
||||||
connect(album_cover_choice_controller_->cover_to_file_action(), SIGNAL(triggered()), this, SLOT(SaveCoverToFile()));
|
QObject::connect(album_cover_choice_controller_->cover_to_file_action(), &QAction::triggered, this, &AlbumCoverManager::SaveCoverToFile);
|
||||||
connect(album_cover_choice_controller_->cover_from_url_action(), SIGNAL(triggered()), this, SLOT(LoadCoverFromURL()));
|
QObject::connect(album_cover_choice_controller_->cover_from_url_action(), &QAction::triggered, this, &AlbumCoverManager::LoadCoverFromURL);
|
||||||
connect(album_cover_choice_controller_->search_for_cover_action(), SIGNAL(triggered()), this, SLOT(SearchForCover()));
|
QObject::connect(album_cover_choice_controller_->search_for_cover_action(), &QAction::triggered, this, &AlbumCoverManager::SearchForCover);
|
||||||
connect(album_cover_choice_controller_->unset_cover_action(), SIGNAL(triggered()), this, SLOT(UnsetCover()));
|
QObject::connect(album_cover_choice_controller_->unset_cover_action(), &QAction::triggered, this, &AlbumCoverManager::UnsetCover);
|
||||||
connect(album_cover_choice_controller_->show_cover_action(), SIGNAL(triggered()), this, SLOT(ShowCover()));
|
QObject::connect(album_cover_choice_controller_->show_cover_action(), &QAction::triggered, this, &AlbumCoverManager::ShowCover);
|
||||||
|
|
||||||
connect(cover_exporter_, SIGNAL(AlbumCoversExportUpdate(int, int, int)), SLOT(UpdateExportStatus(int, int, int)));
|
QObject::connect(cover_exporter_, &AlbumCoverExporter::AlbumCoversExportUpdate, this, &AlbumCoverManager::UpdateExportStatus);
|
||||||
|
|
||||||
context_menu_->addActions(actions);
|
context_menu_->addActions(actions);
|
||||||
context_menu_->addSeparator();
|
context_menu_->addSeparator();
|
||||||
@ -197,17 +197,17 @@ void AlbumCoverManager::Init() {
|
|||||||
ui_->albums->installEventFilter(this);
|
ui_->albums->installEventFilter(this);
|
||||||
|
|
||||||
// Connections
|
// Connections
|
||||||
connect(ui_->artists, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), SLOT(ArtistChanged(QListWidgetItem*)));
|
QObject::connect(ui_->artists, &QListWidget::currentItemChanged, this, &AlbumCoverManager::ArtistChanged);
|
||||||
connect(ui_->filter, SIGNAL(textChanged(QString)), SLOT(UpdateFilter()));
|
QObject::connect(ui_->filter, &QSearchField::textChanged, this, &AlbumCoverManager::UpdateFilter);
|
||||||
connect(filter_group, SIGNAL(triggered(QAction*)), SLOT(UpdateFilter()));
|
QObject::connect(filter_group, &QActionGroup::triggered, this, &AlbumCoverManager::UpdateFilter);
|
||||||
connect(ui_->view, SIGNAL(clicked()), ui_->view, SLOT(showMenu()));
|
QObject::connect(ui_->view, &QToolButton::clicked, ui_->view, &QToolButton::showMenu);
|
||||||
connect(ui_->button_fetch, SIGNAL(clicked()), SLOT(FetchAlbumCovers()));
|
QObject::connect(ui_->button_fetch, &QPushButton::clicked, this, &AlbumCoverManager::FetchAlbumCovers);
|
||||||
connect(ui_->export_covers, SIGNAL(clicked()), SLOT(ExportCovers()));
|
QObject::connect(ui_->export_covers, &QPushButton::clicked, this, &AlbumCoverManager::ExportCovers);
|
||||||
connect(cover_fetcher_, SIGNAL(AlbumCoverFetched(quint64, QUrl, QImage, CoverSearchStatistics)), SLOT(AlbumCoverFetched(quint64, QUrl, QImage, CoverSearchStatistics)));
|
QObject::connect(cover_fetcher_, &AlbumCoverFetcher::AlbumCoverFetched, this, &AlbumCoverManager::AlbumCoverFetched);
|
||||||
connect(ui_->action_fetch, SIGNAL(triggered()), SLOT(FetchSingleCover()));
|
QObject::connect(ui_->action_fetch, &QAction::triggered, this, &AlbumCoverManager::FetchSingleCover);
|
||||||
connect(ui_->albums, SIGNAL(doubleClicked(QModelIndex)), SLOT(AlbumDoubleClicked(QModelIndex)));
|
QObject::connect(ui_->albums, &QListWidget::doubleClicked, this, &AlbumCoverManager::AlbumDoubleClicked);
|
||||||
connect(ui_->action_add_to_playlist, SIGNAL(triggered()), SLOT(AddSelectedToPlaylist()));
|
QObject::connect(ui_->action_add_to_playlist, &QAction::triggered, this, &AlbumCoverManager::AddSelectedToPlaylist);
|
||||||
connect(ui_->action_load, SIGNAL(triggered()), SLOT(LoadSelectedToPlaylist()));
|
QObject::connect(ui_->action_load, &QAction::triggered, this, &AlbumCoverManager::LoadSelectedToPlaylist);
|
||||||
|
|
||||||
// Restore settings
|
// Restore settings
|
||||||
QSettings s;
|
QSettings s;
|
||||||
@ -219,7 +219,7 @@ void AlbumCoverManager::Init() {
|
|||||||
ui_->splitter->setSizes(QList<int>() << 200 << width() - 200);
|
ui_->splitter->setSizes(QList<int>() << 200 << width() - 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(app_->album_cover_loader(), SIGNAL(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)), SLOT(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)));
|
QObject::connect(app_->album_cover_loader(), &AlbumCoverLoader::AlbumCoverLoaded, this, &AlbumCoverManager::AlbumCoverLoaded);
|
||||||
|
|
||||||
cover_searcher_->Init(cover_fetcher_);
|
cover_searcher_->Init(cover_fetcher_);
|
||||||
|
|
||||||
@ -541,7 +541,7 @@ void AlbumCoverManager::UpdateStatusText() {
|
|||||||
progress_bar_->setValue(fetch_statistics_.chosen_images_ + fetch_statistics_.missing_images_);
|
progress_bar_->setValue(fetch_statistics_.chosen_images_ + fetch_statistics_.missing_images_);
|
||||||
|
|
||||||
if (cover_fetching_tasks_.isEmpty()) {
|
if (cover_fetching_tasks_.isEmpty()) {
|
||||||
QTimer::singleShot(2000, statusBar(), SLOT(clearMessage()));
|
QTimer::singleShot(2000, statusBar(), &QStatusBar::clearMessage);
|
||||||
progress_bar_->hide();
|
progress_bar_->hide();
|
||||||
abort_progress_->hide();
|
abort_progress_->hide();
|
||||||
|
|
||||||
@ -757,17 +757,17 @@ void AlbumCoverManager::UnsetCover() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SongList AlbumCoverManager::GetSongsInAlbum(const QModelIndex &index) const {
|
SongList AlbumCoverManager::GetSongsInAlbum(const QModelIndex &idx) const {
|
||||||
|
|
||||||
SongList ret;
|
SongList ret;
|
||||||
|
|
||||||
CollectionQuery q;
|
CollectionQuery q;
|
||||||
q.SetColumnSpec("ROWID," + Song::kColumnSpec);
|
q.SetColumnSpec("ROWID," + Song::kColumnSpec);
|
||||||
q.AddWhere("album", index.data(Role_AlbumName).toString());
|
q.AddWhere("album", idx.data(Role_AlbumName).toString());
|
||||||
q.SetOrderBy("disc, track, title");
|
q.SetOrderBy("disc, track, title");
|
||||||
|
|
||||||
QString artist = index.data(Role_ArtistName).toString();
|
QString artist = idx.data(Role_ArtistName).toString();
|
||||||
QString albumartist = index.data(Role_AlbumArtistName).toString();
|
QString albumartist = idx.data(Role_AlbumArtistName).toString();
|
||||||
|
|
||||||
if (!albumartist.isEmpty()) {
|
if (!albumartist.isEmpty()) {
|
||||||
q.AddWhere("albumartist", albumartist);
|
q.AddWhere("albumartist", albumartist);
|
||||||
@ -792,8 +792,8 @@ SongList AlbumCoverManager::GetSongsInAlbum(const QModelIndex &index) const {
|
|||||||
SongList AlbumCoverManager::GetSongsInAlbums(const QModelIndexList &indexes) const {
|
SongList AlbumCoverManager::GetSongsInAlbums(const QModelIndexList &indexes) const {
|
||||||
|
|
||||||
SongList ret;
|
SongList ret;
|
||||||
for (const QModelIndex &index : indexes) {
|
for (const QModelIndex &idx : indexes) {
|
||||||
ret << GetSongsInAlbum(index);
|
ret << GetSongsInAlbum(idx);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -904,7 +904,7 @@ void AlbumCoverManager::UpdateExportStatus(const int exported, const int skipped
|
|||||||
|
|
||||||
// End of the current process
|
// End of the current process
|
||||||
if (exported + skipped >= max) {
|
if (exported + skipped >= max) {
|
||||||
QTimer::singleShot(2000, statusBar(), SLOT(clearMessage()));
|
QTimer::singleShot(2000, statusBar(), &QStatusBar::clearMessage);
|
||||||
|
|
||||||
progress_bar_->hide();
|
progress_bar_->hide();
|
||||||
abort_progress_->hide();
|
abort_progress_->hide();
|
||||||
|
@ -79,7 +79,7 @@ class AlbumCoverManager : public QMainWindow {
|
|||||||
void EnableCoversButtons();
|
void EnableCoversButtons();
|
||||||
void DisableCoversButtons();
|
void DisableCoversButtons();
|
||||||
|
|
||||||
SongList GetSongsInAlbum(const QModelIndex &index) const;
|
SongList GetSongsInAlbum(const QModelIndex &idx) const;
|
||||||
SongList GetSongsInAlbums(const QModelIndexList &indexes) const;
|
SongList GetSongsInAlbums(const QModelIndexList &indexes) const;
|
||||||
SongMimeData *GetMimeDataForAlbums(const QModelIndexList &indexes) const;
|
SongMimeData *GetMimeDataForAlbums(const QModelIndexList &indexes) const;
|
||||||
|
|
||||||
|
@ -57,4 +57,3 @@ class AlbumCoverManagerList : public QListWidget {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // ALBUMCOVERMANAGERLIST_H
|
#endif // ALBUMCOVERMANAGERLIST_H
|
||||||
|
|
||||||
|
@ -71,15 +71,15 @@ const int SizeOverlayDelegate::kBackgroundAlpha = 175;
|
|||||||
SizeOverlayDelegate::SizeOverlayDelegate(QObject *parent)
|
SizeOverlayDelegate::SizeOverlayDelegate(QObject *parent)
|
||||||
: QStyledItemDelegate(parent) {}
|
: QStyledItemDelegate(parent) {}
|
||||||
|
|
||||||
void SizeOverlayDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
void SizeOverlayDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &idx) const {
|
||||||
|
|
||||||
QStyledItemDelegate::paint(painter, option, index);
|
QStyledItemDelegate::paint(painter, option, idx);
|
||||||
|
|
||||||
if (!index.data(AlbumCoverSearcher::Role_ImageFetchFinished).toBool()) {
|
if (!idx.data(AlbumCoverSearcher::Role_ImageFetchFinished).toBool()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QSize size = index.data(AlbumCoverSearcher::Role_ImageSize).toSize();
|
const QSize size = idx.data(AlbumCoverSearcher::Role_ImageSize).toSize();
|
||||||
const QString text = Utilities::PrettySize(size);
|
const QString text = Utilities::PrettySize(size);
|
||||||
|
|
||||||
QFont font(option.font);
|
QFont font(option.font);
|
||||||
@ -136,10 +136,9 @@ AlbumCoverSearcher::AlbumCoverSearcher(const QIcon &no_cover_icon, Application *
|
|||||||
options_.pad_thumbnail_image_ = true;
|
options_.pad_thumbnail_image_ = true;
|
||||||
options_.thumbnail_size_ = ui_->covers->iconSize();
|
options_.thumbnail_size_ = ui_->covers->iconSize();
|
||||||
|
|
||||||
connect(app_->album_cover_loader(), SIGNAL(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)), SLOT(AlbumCoverLoaded(quint64, AlbumCoverLoaderResult)));
|
QObject::connect(app_->album_cover_loader(), &AlbumCoverLoader::AlbumCoverLoaded, this, &AlbumCoverSearcher::AlbumCoverLoaded);
|
||||||
|
QObject::connect(ui_->search, &QPushButton::clicked, this, &AlbumCoverSearcher::Search);
|
||||||
connect(ui_->search, SIGNAL(clicked()), SLOT(Search()));
|
QObject::connect(ui_->covers, &GroupedIconView::doubleClicked, this, &AlbumCoverSearcher::CoverDoubleClicked);
|
||||||
connect(ui_->covers, SIGNAL(doubleClicked(QModelIndex)), SLOT(CoverDoubleClicked(QModelIndex)));
|
|
||||||
|
|
||||||
new ForceScrollPerPixel(ui_->covers, this);
|
new ForceScrollPerPixel(ui_->covers, this);
|
||||||
|
|
||||||
@ -154,7 +153,7 @@ AlbumCoverSearcher::~AlbumCoverSearcher() {
|
|||||||
void AlbumCoverSearcher::Init(AlbumCoverFetcher *fetcher) {
|
void AlbumCoverSearcher::Init(AlbumCoverFetcher *fetcher) {
|
||||||
|
|
||||||
fetcher_ = fetcher;
|
fetcher_ = fetcher;
|
||||||
connect(fetcher_, SIGNAL(SearchFinished(quint64, CoverSearchResults, CoverSearchStatistics)), this, SLOT(SearchFinished(quint64, CoverSearchResults)), Qt::QueuedConnection);
|
QObject::connect(fetcher_, &AlbumCoverFetcher::SearchFinished, this, &AlbumCoverSearcher::SearchFinished, Qt::QueuedConnection);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,7 +282,7 @@ void AlbumCoverSearcher::keyPressEvent(QKeyEvent *e) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlbumCoverSearcher::CoverDoubleClicked(const QModelIndex &index) {
|
void AlbumCoverSearcher::CoverDoubleClicked(const QModelIndex &idx) {
|
||||||
if (index.isValid()) accept();
|
if (idx.isValid()) accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Strawberry Music Player
|
* Strawberry Music Player
|
||||||
* This file was part of Clementine.
|
* This file was part of Clementine.
|
||||||
@ -61,7 +62,7 @@ class SizeOverlayDelegate : public QStyledItemDelegate {
|
|||||||
|
|
||||||
explicit SizeOverlayDelegate(QObject *parent = nullptr);
|
explicit SizeOverlayDelegate(QObject *parent = nullptr);
|
||||||
|
|
||||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is a dialog that lets the user search for album covers
|
// This is a dialog that lets the user search for album covers
|
||||||
@ -92,7 +93,7 @@ class AlbumCoverSearcher : public QDialog {
|
|||||||
void SearchFinished(const quint64 id, const CoverSearchResults &results);
|
void SearchFinished(const quint64 id, const CoverSearchResults &results);
|
||||||
void AlbumCoverLoaded(const quint64 id, const AlbumCoverLoaderResult &result);
|
void AlbumCoverLoaded(const quint64 id, const AlbumCoverLoaderResult &result);
|
||||||
|
|
||||||
void CoverDoubleClicked(const QModelIndex &index);
|
void CoverDoubleClicked(const QModelIndex &idx);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui_AlbumCoverSearcher *ui_;
|
Ui_AlbumCoverSearcher *ui_;
|
||||||
|
@ -56,4 +56,3 @@ class CoverExportRunnable : public QObject, public QRunnable {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // COVEREXPORTRUNNABLE_H
|
#endif // COVEREXPORTRUNNABLE_H
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void CoverFromURLDialog::accept() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QNetworkReply *reply = network_->get(req);
|
QNetworkReply *reply = network_->get(req);
|
||||||
connect(reply, SIGNAL(finished()), SLOT(LoadCoverFromURLFinished()));
|
QObject::connect(reply, &QNetworkReply::finished, this, &CoverFromURLDialog::LoadCoverFromURLFinished);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,4 +56,3 @@ class CoverFromURLDialog : public QDialog {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // COVERFROMURLDIALOG_H
|
#endif // COVERFROMURLDIALOG_H
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ void CoverProviders::AddProvider(CoverProvider *provider) {
|
|||||||
{
|
{
|
||||||
QMutexLocker locker(&mutex_);
|
QMutexLocker locker(&mutex_);
|
||||||
cover_providers_.insert(provider, provider->name());
|
cover_providers_.insert(provider, provider->name());
|
||||||
connect(provider, SIGNAL(destroyed()), SLOT(ProviderDestroyed()));
|
QObject::connect(provider, &CoverProvider::destroyed, this, &CoverProviders::ProviderDestroyed);
|
||||||
}
|
}
|
||||||
|
|
||||||
provider->set_order(++NextOrderId);
|
provider->set_order(++NextOrderId);
|
||||||
|
@ -52,4 +52,3 @@ class CoverSearchStatisticsDialog : public QDialog {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // COVERSEARCHSTATISTICSDIALOG_H
|
#endif // COVERSEARCHSTATISTICSDIALOG_H
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user