Skip to content

Commit

Permalink
Call QObject::metaObject
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaski committed Jan 17, 2025
1 parent 726c105 commit e6a0945
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/collection/collectionbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ CollectionBackend::~CollectionBackend() {

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())));
setObjectName(source == Song::Source::Collection ? QLatin1String(QObject::metaObject()->className()) : QStringLiteral("%1%2").arg(Song::DescriptionForSource(source), QLatin1String(QObject::metaObject()->className())));

db_ = db;
task_manager_ = task_manager;
Expand Down
2 changes: 1 addition & 1 deletion src/collection/collectionlibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CollectionLibrary::CollectionLibrary(const SharedPtr<Database> database,
save_playcounts_to_files_(false),
save_ratings_to_files_(false) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

original_thread_ = thread();

Expand Down
2 changes: 1 addition & 1 deletion src/collection/collectionmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ CollectionModel::CollectionModel(const SharedPtr<CollectionBackend> backend, con
loading_(false),
icon_disk_cache_(new QNetworkDiskCache(this)) {

setObjectName(backend_->source() == Song::Source::Collection ? QLatin1String(metaObject()->className()) : QStringLiteral("%1%2").arg(Song::DescriptionForSource(backend_->source()), QLatin1String(metaObject()->className())));
setObjectName(backend_->source() == Song::Source::Collection ? QLatin1String(QObject::metaObject()->className()) : QStringLiteral("%1%2").arg(Song::DescriptionForSource(backend_->source()), QLatin1String(QObject::metaObject()->className())));

filter_->setSourceModel(this);
filter_->setSortRole(Role_SortText);
Expand Down
2 changes: 1 addition & 1 deletion src/collection/collectionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ CollectionView::CollectionView(QWidget *parent)
is_in_keyboard_search_(false),
delete_files_(false) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

setItemDelegate(new CollectionItemDelegate(this));
setAttribute(Qt::WA_MacShowFocusRect, false);
Expand Down
2 changes: 1 addition & 1 deletion src/collection/collectionwatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ CollectionWatcher::CollectionWatcher(const Song::Source source,
cue_parser_(new CueParser(tagreader_client, backend, this)),
last_scan_time_(0) {

setObjectName(source_ == Song::Source::Collection ? QLatin1String(metaObject()->className()) : QStringLiteral("%1%2").arg(Song::DescriptionForSource(source_), QLatin1String(metaObject()->className())));
setObjectName(source_ == Song::Source::Collection ? QLatin1String(QObject::metaObject()->className()) : QStringLiteral("%1%2").arg(Song::DescriptionForSource(source_), QLatin1String(QObject::metaObject()->className())));

original_thread_ = thread();

Expand Down
2 changes: 1 addition & 1 deletion src/core/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Application::Application(QObject *parent)
p_(new ApplicationImpl(this)),
g_thread_(nullptr) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

const QMetaObject *mo = QAbstractEventDispatcher::instance(QCoreApplication::instance()->thread())->metaObject();
if (mo && strcmp(mo->className(), "QEventDispatcherGlib") != 0 && strcmp(mo->superClass()->className(), "QEventDispatcherGlib") != 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Database::Database(SharedPtr<TaskManager> task_manager, QObject *parent, const Q
startup_schema_version_(-1),
original_thread_(nullptr) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

original_thread_ = thread();

Expand Down
2 changes: 1 addition & 1 deletion src/core/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Player::Player(const SharedPtr<TaskManager> task_manager, const SharedPtr<UrlHan
volume_increment_(5),
play_offset_nanosec_(0) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

timer_save_volume_->setSingleShot(true);
timer_save_volume_->setInterval(5s);
Expand Down
2 changes: 1 addition & 1 deletion src/core/taskmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using namespace Qt::Literals::StringLiterals;

TaskManager::TaskManager(QObject *parent) : QObject(parent), next_task_id_(1) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

}

Expand Down
2 changes: 1 addition & 1 deletion src/covermanager/albumcoverloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ AlbumCoverLoader::AlbumCoverLoader(const SharedPtr<TagReaderClient> tagreader_cl
load_image_async_id_(1),
original_thread_(nullptr) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

original_thread_ = thread();

Expand Down
2 changes: 1 addition & 1 deletion src/covermanager/currentalbumcoverloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CurrentAlbumCoverLoader::CurrentAlbumCoverLoader(const SharedPtr<AlbumCoverLoade
temp_file_pattern_(StandardPaths::WritableLocation(StandardPaths::StandardLocation::TempLocation) + u"/strawberry-cover-XXXXXX.jpg"_s),
id_(0) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

options_.options = AlbumCoverLoaderOptions::Option::RawImageData | AlbumCoverLoaderOptions::Option::OriginalImage | AlbumCoverLoaderOptions::Option::ScaledImage;
options_.desired_scaled_size = QSize(120, 120);
Expand Down
2 changes: 1 addition & 1 deletion src/device/devicedatabasebackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ DeviceDatabaseBackend::DeviceDatabaseBackend(QObject *parent)
db_(nullptr),
original_thread_(nullptr) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

original_thread_ = thread();

Expand Down
2 changes: 1 addition & 1 deletion src/device/devicelister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ DeviceLister::DeviceLister(QObject *parent)
original_thread_(nullptr),
next_mount_request_id_(0) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

original_thread_ = thread();

Expand Down
2 changes: 1 addition & 1 deletion src/device/devicemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ DeviceManager::DeviceManager(const SharedPtr<TaskManager> task_manager,
albumcover_loader_(albumcover_loader),
not_connected_overlay_(IconLoader::Load(u"edit-delete"_s)) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

thread_pool_.setMaxThreadCount(1);
QObject::connect(&*task_manager, &TaskManager::TasksChanged, this, &DeviceManager::TasksChanged);
Expand Down
2 changes: 1 addition & 1 deletion src/engine/devicefinders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ using namespace Qt::Literals::StringLiterals;

DeviceFinders::DeviceFinders(QObject *parent) : QObject(parent) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

}

Expand Down
2 changes: 1 addition & 1 deletion src/lyrics/lyricsproviders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using std::make_shared;

LyricsProviders::LyricsProviders(QObject *parent) : QObject(parent), thread_(new QThread(this)), network_(make_shared<NetworkAccessManager>()) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));
thread_->setObjectName(objectName());
network_->moveToThread(thread_);
thread_->start();
Expand Down
2 changes: 1 addition & 1 deletion src/moodbar/moodbarloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ MoodbarLoader::MoodbarLoader(QObject *parent)
kMaxActiveRequests(qMax(1, QThread::idealThreadCount() / 2)),
save_(false) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));
thread_->setObjectName(objectName());

cache_->setCacheDirectory(StandardPaths::WritableLocation(StandardPaths::StandardLocation::CacheLocation) + u"/moodbar"_s);
Expand Down
2 changes: 1 addition & 1 deletion src/playlist/playlistbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ PlaylistBackend::PlaylistBackend(const SharedPtr<Database> database,
collection_backend_(collection_backend),
original_thread_(nullptr) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

original_thread_ = thread();

Expand Down
2 changes: 1 addition & 1 deletion src/playlist/playlistmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ PlaylistManager::PlaylistManager(const SharedPtr<TaskManager> task_manager,
active_(-1),
playlists_loading_(0) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

}

Expand Down
2 changes: 1 addition & 1 deletion src/tagreader/tagreaderclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ TagReaderClient::TagReaderClient(QObject *parent)
abort_(false),
processing_(false) {

setObjectName(QLatin1String(metaObject()->className()));
setObjectName(QLatin1String(QObject::metaObject()->className()));

if (!sInstance) {
sInstance = this;
Expand Down

0 comments on commit e6a0945

Please sign in to comment.