Set object names
This commit is contained in:
@@ -63,6 +63,8 @@ SCollection::SCollection(Application *app, QObject *parent)
|
|||||||
save_playcounts_to_files_(false),
|
save_playcounts_to_files_(false),
|
||||||
save_ratings_to_files_(false) {
|
save_ratings_to_files_(false) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
original_thread_ = thread();
|
original_thread_ = thread();
|
||||||
|
|
||||||
backend_ = make_shared<CollectionBackend>();
|
backend_ = make_shared<CollectionBackend>();
|
||||||
@@ -94,6 +96,7 @@ void SCollection::Init() {
|
|||||||
|
|
||||||
watcher_ = new CollectionWatcher(Song::Source::Collection);
|
watcher_ = new CollectionWatcher(Song::Source::Collection);
|
||||||
watcher_thread_ = new Thread(this);
|
watcher_thread_ = new Thread(this);
|
||||||
|
watcher_thread_->setObjectName(watcher_->objectName());
|
||||||
|
|
||||||
watcher_thread_->SetIoPriority(Utilities::IoPriority::IOPRIO_CLASS_IDLE);
|
watcher_thread_->SetIoPriority(Utilities::IoPriority::IOPRIO_CLASS_IDLE);
|
||||||
|
|
||||||
|
|||||||
@@ -72,17 +72,21 @@ CollectionBackend::CollectionBackend(QObject *parent)
|
|||||||
|
|
||||||
CollectionBackend::~CollectionBackend() {
|
CollectionBackend::~CollectionBackend() {
|
||||||
|
|
||||||
qLog(Debug) << "Collection backend" << this << "for" << Song::TextForSource(source_) << "deleted";
|
qLog(Debug) << "Collection backend" << this << "deleted";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollectionBackend::Init(SharedPtr<Database> db, SharedPtr<TaskManager> task_manager, const Song::Source source, const QString &songs_table, const QString &dirs_table, const QString &subdirs_table) {
|
void CollectionBackend::Init(SharedPtr<Database> db, SharedPtr<TaskManager> task_manager, const Song::Source source, const QString &songs_table, const QString &dirs_table, const QString &subdirs_table) {
|
||||||
|
|
||||||
|
setObjectName(source == Song::Source::Collection ? QLatin1String(metaObject()->className()) : QStringLiteral("%1%2").arg(Song::DescriptionForSource(source), QLatin1String(metaObject()->className())));
|
||||||
|
|
||||||
db_ = db;
|
db_ = db;
|
||||||
task_manager_ = task_manager;
|
task_manager_ = task_manager;
|
||||||
source_ = source;
|
source_ = source;
|
||||||
songs_table_ = songs_table;
|
songs_table_ = songs_table;
|
||||||
dirs_table_ = dirs_table;
|
dirs_table_ = dirs_table;
|
||||||
subdirs_table_ = subdirs_table;
|
subdirs_table_ = subdirs_table;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CollectionBackend::Close() {
|
void CollectionBackend::Close() {
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ CollectionModel::CollectionModel(SharedPtr<CollectionBackend> backend, Applicati
|
|||||||
total_album_count_(0),
|
total_album_count_(0),
|
||||||
loading_(false) {
|
loading_(false) {
|
||||||
|
|
||||||
|
setObjectName(backend_->source() == Song::Source::Collection ? QLatin1String(metaObject()->className()) : QStringLiteral("%1%2").arg(Song::DescriptionForSource(backend_->source()), QLatin1String(metaObject()->className())));
|
||||||
|
|
||||||
filter_->setSourceModel(this);
|
filter_->setSourceModel(this);
|
||||||
filter_->setSortRole(Role_SortText);
|
filter_->setSortRole(Role_SortText);
|
||||||
filter_->sort(0);
|
filter_->sort(0);
|
||||||
@@ -149,7 +151,7 @@ CollectionModel::CollectionModel(SharedPtr<CollectionBackend> backend, Applicati
|
|||||||
|
|
||||||
CollectionModel::~CollectionModel() {
|
CollectionModel::~CollectionModel() {
|
||||||
|
|
||||||
qLog(Debug) << "Collection model" << this << "for" << Song::TextForSource(backend_->source()) << "deleted";
|
qLog(Debug) << "Collection model" << this << "deleted";
|
||||||
|
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
Clear();
|
Clear();
|
||||||
|
|||||||
@@ -104,6 +104,8 @@ CollectionView::CollectionView(QWidget *parent)
|
|||||||
is_in_keyboard_search_(false),
|
is_in_keyboard_search_(false),
|
||||||
delete_files_(false) {
|
delete_files_(false) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
setItemDelegate(new CollectionItemDelegate(this));
|
setItemDelegate(new CollectionItemDelegate(this));
|
||||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||||
setHeaderHidden(true);
|
setHeaderHidden(true);
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ CollectionWatcher::CollectionWatcher(Song::Source source, QObject *parent)
|
|||||||
cue_parser_(new CueParser(backend_, this)),
|
cue_parser_(new CueParser(backend_, this)),
|
||||||
last_scan_time_(0) {
|
last_scan_time_(0) {
|
||||||
|
|
||||||
|
setObjectName(source_ == Song::Source::Collection ? QLatin1String(metaObject()->className()) : QStringLiteral("%1%2").arg(Song::DescriptionForSource(source_), QLatin1String(metaObject()->className())));
|
||||||
|
|
||||||
original_thread_ = thread();
|
original_thread_ = thread();
|
||||||
|
|
||||||
rescan_timer_->setInterval(2s);
|
rescan_timer_->setInterval(2s);
|
||||||
|
|||||||
@@ -248,6 +248,8 @@ class ApplicationImpl {
|
|||||||
Application::Application(QObject *parent)
|
Application::Application(QObject *parent)
|
||||||
: QObject(parent), p_(new ApplicationImpl(this)) {
|
: QObject(parent), p_(new ApplicationImpl(this)) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
device_finders()->Init();
|
device_finders()->Init();
|
||||||
collection()->Init();
|
collection()->Init();
|
||||||
tag_reader_client();
|
tag_reader_client();
|
||||||
@@ -275,6 +277,8 @@ QThread *Application::MoveToNewThread(QObject *object) {
|
|||||||
|
|
||||||
QThread *thread = new QThread(this);
|
QThread *thread = new QThread(this);
|
||||||
|
|
||||||
|
thread->setObjectName(object->objectName());
|
||||||
|
|
||||||
MoveToThread(object, thread);
|
MoveToThread(object, thread);
|
||||||
|
|
||||||
thread->start();
|
thread->start();
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ Database::Database(Application *app, QObject *parent, const QString &database_na
|
|||||||
startup_schema_version_(-1),
|
startup_schema_version_(-1),
|
||||||
original_thread_(nullptr) {
|
original_thread_(nullptr) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
original_thread_ = thread();
|
original_thread_ = thread();
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -101,6 +101,8 @@ Player::Player(Application *app, QObject *parent)
|
|||||||
volume_increment_(5),
|
volume_increment_(5),
|
||||||
play_offset_nanosec_(0) {
|
play_offset_nanosec_(0) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
Settings s;
|
Settings s;
|
||||||
s.beginGroup(BackendSettingsPage::kSettingsGroup);
|
s.beginGroup(BackendSettingsPage::kSettingsGroup);
|
||||||
EngineBase::Type enginetype = EngineBase::TypeFromName(s.value("engine", EngineBase::Name(EngineBase::Type::GStreamer)).toString().toLower());
|
EngineBase::Type enginetype = EngineBase::TypeFromName(s.value("engine", EngineBase::Name(EngineBase::Type::GStreamer)).toString().toLower());
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ TagReaderClient *TagReaderClient::sInstance = nullptr;
|
|||||||
|
|
||||||
TagReaderClient::TagReaderClient(QObject *parent) : QObject(parent), worker_pool_(new WorkerPool<HandlerType>(this)) {
|
TagReaderClient::TagReaderClient(QObject *parent) : QObject(parent), worker_pool_(new WorkerPool<HandlerType>(this)) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
sInstance = this;
|
sInstance = this;
|
||||||
original_thread_ = thread();
|
original_thread_ = thread();
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,11 @@
|
|||||||
|
|
||||||
#include "taskmanager.h"
|
#include "taskmanager.h"
|
||||||
|
|
||||||
TaskManager::TaskManager(QObject *parent) : QObject(parent), next_task_id_(1) {}
|
TaskManager::TaskManager(QObject *parent) : QObject(parent), next_task_id_(1) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
int TaskManager::StartTask(const QString &name) {
|
int TaskManager::StartTask(const QString &name) {
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ AlbumCoverLoader::AlbumCoverLoader(QObject *parent)
|
|||||||
load_image_async_id_(1),
|
load_image_async_id_(1),
|
||||||
original_thread_(nullptr) {
|
original_thread_(nullptr) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
original_thread_ = thread();
|
original_thread_ = thread();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ CurrentAlbumCoverLoader::CurrentAlbumCoverLoader(Application *app, QObject *pare
|
|||||||
temp_file_pattern_(QDir::tempPath() + QStringLiteral("/strawberry-cover-XXXXXX.jpg")),
|
temp_file_pattern_(QDir::tempPath() + QStringLiteral("/strawberry-cover-XXXXXX.jpg")),
|
||||||
id_(0) {
|
id_(0) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
options_.options = AlbumCoverLoaderOptions::Option::RawImageData | AlbumCoverLoaderOptions::Option::OriginalImage | AlbumCoverLoaderOptions::Option::ScaledImage;
|
options_.options = AlbumCoverLoaderOptions::Option::RawImageData | AlbumCoverLoaderOptions::Option::OriginalImage | AlbumCoverLoaderOptions::Option::ScaledImage;
|
||||||
options_.desired_scaled_size = QSize(120, 120);
|
options_.desired_scaled_size = QSize(120, 120);
|
||||||
options_.default_cover = QStringLiteral(":/pictures/cdcase.png");
|
options_.default_cover = QStringLiteral(":/pictures/cdcase.png");
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ DeviceDatabaseBackend::DeviceDatabaseBackend(QObject *parent)
|
|||||||
db_(nullptr),
|
db_(nullptr),
|
||||||
original_thread_(nullptr) {
|
original_thread_(nullptr) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
original_thread_ = thread();
|
original_thread_ = thread();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ DeviceLister::DeviceLister(QObject *parent)
|
|||||||
original_thread_(nullptr),
|
original_thread_(nullptr),
|
||||||
next_mount_request_id_(0) {
|
next_mount_request_id_(0) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
original_thread_ = thread();
|
original_thread_ = thread();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -60,6 +62,7 @@ DeviceLister::~DeviceLister() {
|
|||||||
void DeviceLister::Start() {
|
void DeviceLister::Start() {
|
||||||
|
|
||||||
thread_ = new QThread;
|
thread_ = new QThread;
|
||||||
|
thread_->setObjectName(objectName());
|
||||||
QObject::connect(thread_, &QThread::started, this, &DeviceLister::ThreadStarted);
|
QObject::connect(thread_, &QThread::started, this, &DeviceLister::ThreadStarted);
|
||||||
|
|
||||||
moveToThread(thread_);
|
moveToThread(thread_);
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ DeviceManager::DeviceManager(Application *app, QObject *parent)
|
|||||||
app_(app),
|
app_(app),
|
||||||
not_connected_overlay_(IconLoader::Load(QStringLiteral("edit-delete"))) {
|
not_connected_overlay_(IconLoader::Load(QStringLiteral("edit-delete"))) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
thread_pool_.setMaxThreadCount(1);
|
thread_pool_.setMaxThreadCount(1);
|
||||||
QObject::connect(&*app_->task_manager(), &TaskManager::TasksChanged, this, &DeviceManager::TasksChanged);
|
QObject::connect(&*app_->task_manager(), &TaskManager::TasksChanged, this, &DeviceManager::TasksChanged);
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,11 @@
|
|||||||
# endif // _MSC_VER
|
# endif // _MSC_VER
|
||||||
#endif // Q_OS_WIN32
|
#endif // Q_OS_WIN32
|
||||||
|
|
||||||
DeviceFinders::DeviceFinders(QObject *parent) : QObject(parent) {}
|
DeviceFinders::DeviceFinders(QObject *parent) : QObject(parent) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
DeviceFinders::~DeviceFinders() {
|
DeviceFinders::~DeviceFinders() {
|
||||||
qDeleteAll(device_finders_);
|
qDeleteAll(device_finders_);
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ using std::make_shared;
|
|||||||
|
|
||||||
LyricsProviders::LyricsProviders(QObject *parent) : QObject(parent), thread_(new QThread(this)), network_(make_shared<NetworkAccessManager>()) {
|
LyricsProviders::LyricsProviders(QObject *parent) : QObject(parent), thread_(new QThread(this)), network_(make_shared<NetworkAccessManager>()) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
thread_->setObjectName(objectName());
|
||||||
network_->moveToThread(thread_);
|
network_->moveToThread(thread_);
|
||||||
thread_->start();
|
thread_->start();
|
||||||
|
|
||||||
|
|||||||
@@ -205,6 +205,8 @@ int main(int argc, char *argv[]) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QThread::currentThread()->setObjectName(QStringLiteral("Main"));
|
||||||
|
|
||||||
QGuiApplication::setWindowIcon(IconLoader::Load(QStringLiteral("strawberry")));
|
QGuiApplication::setWindowIcon(IconLoader::Load(QStringLiteral("strawberry")));
|
||||||
|
|
||||||
#if defined(USE_BUNDLE)
|
#if defined(USE_BUNDLE)
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ PlaylistBackend::PlaylistBackend(Application *app, QObject *parent)
|
|||||||
db_(app_->database()),
|
db_(app_->database()),
|
||||||
original_thread_(nullptr) {
|
original_thread_(nullptr) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
original_thread_ = thread();
|
original_thread_ = thread();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ PlaylistManager::PlaylistManager(Application *app, QObject *parent)
|
|||||||
active_(-1),
|
active_(-1),
|
||||||
playlists_loading_(0) {
|
playlists_loading_(0) {
|
||||||
|
|
||||||
|
setObjectName(QLatin1String(metaObject()->className()));
|
||||||
|
|
||||||
QObject::connect(&*app_->player(), &Player::Paused, this, &PlaylistManager::SetActivePaused);
|
QObject::connect(&*app_->player(), &Player::Paused, this, &PlaylistManager::SetActivePaused);
|
||||||
QObject::connect(&*app_->player(), &Player::Playing, this, &PlaylistManager::SetActivePlaying);
|
QObject::connect(&*app_->player(), &Player::Playing, this, &PlaylistManager::SetActivePlaying);
|
||||||
QObject::connect(&*app_->player(), &Player::Stopped, this, &PlaylistManager::SetActiveStopped);
|
QObject::connect(&*app_->player(), &Player::Stopped, this, &PlaylistManager::SetActiveStopped);
|
||||||
|
|||||||
Reference in New Issue
Block a user