Replace emit with Q_EMIT

This commit is contained in:
Jonas Kvinge
2024-08-25 01:06:30 +02:00
parent cb0db8750f
commit 8da616491d
158 changed files with 891 additions and 891 deletions

View File

@@ -398,7 +398,7 @@ QVariant Playlist::data(const QModelIndex &idx, const int role) const {
#ifdef HAVE_MOODBAR
void Playlist::MoodbarUpdated(const QModelIndex &idx) {
emit dataChanged(idx.sibling(idx.row(), static_cast<int>(Column::Mood)), idx.sibling(idx.row(), static_cast<int>(Column::Mood)));
Q_EMIT dataChanged(idx.sibling(idx.row(), static_cast<int>(Column::Mood)), idx.sibling(idx.row(), static_cast<int>(Column::Mood)));
}
#endif
@@ -436,10 +436,10 @@ void Playlist::SongSaveComplete(TagReaderReply *reply, const QPersistentModelInd
}
else {
if (reply->request_message().write_file_response().has_error()) {
emit Error(tr("Could not write metadata to %1: %2").arg(QString::fromStdString(reply->request_message().write_file_request().filename()), QString::fromStdString(reply->request_message().write_file_response().error())));
Q_EMIT Error(tr("Could not write metadata to %1: %2").arg(QString::fromStdString(reply->request_message().write_file_request().filename()), QString::fromStdString(reply->request_message().write_file_response().error())));
}
else {
emit Error(tr("Could not write metadata to %1").arg(QString::fromStdString(reply->request_message().write_file_request().filename())));
Q_EMIT Error(tr("Could not write metadata to %1").arg(QString::fromStdString(reply->request_message().write_file_request().filename())));
}
}
}
@@ -473,14 +473,14 @@ void Playlist::ItemReloadComplete(const QPersistentModelIndex &idx, const Song &
ItemChanged(idx.row(), ChangedColumns(old_metadata, item->Metadata()));
if (idx.row() == current_row()) {
if (MinorMetadataChange(old_metadata, item->Metadata())) {
emit CurrentSongMetadataChanged(item->Metadata());
Q_EMIT CurrentSongMetadataChanged(item->Metadata());
}
else {
emit CurrentSongChanged(item->Metadata());
Q_EMIT CurrentSongChanged(item->Metadata());
}
}
if (metadata_edit) {
emit EditingFinished(id_, idx);
Q_EMIT EditingFinished(id_, idx);
}
ScheduleSaveAsync();
}
@@ -668,7 +668,7 @@ void Playlist::set_current_row(const int i, const AutoScroll autoscroll, const b
PlaylistItemPtr next_item = item_at(nextrow);
if (next_item) {
next_item->ClearTemporaryMetadata();
emit dataChanged(index(nextrow, 0), index(nextrow, ColumnCount - 1));
Q_EMIT dataChanged(index(nextrow, 0), index(nextrow, ColumnCount - 1));
}
}
@@ -685,7 +685,7 @@ void Playlist::set_current_row(const int i, const AutoScroll autoscroll, const b
}
if (old_current_item_index.isValid()) {
emit dataChanged(old_current_item_index, old_current_item_index.sibling(old_current_item_index.row(), ColumnCount - 1));
Q_EMIT dataChanged(old_current_item_index, old_current_item_index.sibling(old_current_item_index.row(), ColumnCount - 1));
}
// Update the virtual index
@@ -710,8 +710,8 @@ void Playlist::set_current_row(const int i, const AutoScroll autoscroll, const b
if (current_item_index_.isValid() && !is_stopping) {
InformOfCurrentSongChange(false);
emit dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
emit MaybeAutoscroll(autoscroll);
Q_EMIT dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
Q_EMIT MaybeAutoscroll(autoscroll);
}
// The structure of a dynamic playlist is as follows:
@@ -925,7 +925,7 @@ void Playlist::TurnOnDynamicPlaylist(PlaylistGeneratorPtr gen) {
dynamic_playlist_ = gen;
ShuffleModeChanged(PlaylistSequence::ShuffleMode::Off);
emit DynamicModeChanged(true);
Q_EMIT DynamicModeChanged(true);
ScheduleSave();
@@ -937,7 +937,7 @@ void Playlist::MoveItemWithoutUndo(const int source, const int dest) {
void Playlist::MoveItemsWithoutUndo(const QList<int> &source_rows, int pos) {
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
PlaylistItemPtrList old_items = items_;
PlaylistItemPtrList moved_items;
@@ -999,7 +999,7 @@ void Playlist::MoveItemsWithoutUndo(const QList<int> &source_rows, int pos) {
current_virtual_index_ = -1;
}
emit layoutChanged();
Q_EMIT layoutChanged();
ScheduleSave();
@@ -1007,7 +1007,7 @@ void Playlist::MoveItemsWithoutUndo(const QList<int> &source_rows, int pos) {
void Playlist::MoveItemsWithoutUndo(int start, const QList<int> &dest_rows) {
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
PlaylistItemPtrList old_items = items_;
PlaylistItemPtrList moved_items;
@@ -1072,7 +1072,7 @@ void Playlist::MoveItemsWithoutUndo(int start, const QList<int> &dest_rows) {
current_virtual_index_ = -1;
}
emit layoutChanged();
Q_EMIT layoutChanged();
ScheduleSave();
@@ -1097,7 +1097,7 @@ void Playlist::InsertItems(const PlaylistItemPtrList &itemsIn, const int pos, co
undo_stack_->push(new PlaylistUndoCommands::InsertItems(this, items, pos, enqueue, enqueue_next));
}
if (play_now) emit PlayRequested(index(start, 0), AutoScroll::Maybe);
if (play_now) Q_EMIT PlayRequested(index(start, 0), AutoScroll::Maybe);
}
@@ -1249,7 +1249,7 @@ void Playlist::UpdateItems(SongList songs) {
}
}
items_[i] = new_item;
emit dataChanged(index(i, 0), index(i, ColumnCount - 1));
Q_EMIT dataChanged(index(i, 0), index(i, ColumnCount - 1));
// Also update undo actions
for (int y = 0; y < undo_stack_->count(); y++) {
QUndoCommand *undo_action = const_cast<QUndoCommand*>(undo_stack_->command(i));
@@ -1265,7 +1265,7 @@ void Playlist::UpdateItems(SongList songs) {
}
}
emit PlaylistChanged();
Q_EMIT PlaylistChanged();
ScheduleSave();
@@ -1486,7 +1486,7 @@ void Playlist::sort(const int column_number, const Qt::SortOrder order) {
void Playlist::ReOrderWithoutUndo(const PlaylistItemPtrList &new_items) {
emit layoutAboutToBeChanged();
Q_EMIT layoutAboutToBeChanged();
PlaylistItemPtrList old_items = items_;
items_ = new_items;
@@ -1518,9 +1518,9 @@ void Playlist::ReOrderWithoutUndo(const PlaylistItemPtrList &new_items) {
current_virtual_index_ = -1;
}
emit layoutChanged();
Q_EMIT layoutChanged();
emit PlaylistChanged();
Q_EMIT PlaylistChanged();
ScheduleSave();
@@ -1539,7 +1539,7 @@ void Playlist::SetCurrentIsPaused(const bool paused) {
current_is_paused_ = paused;
if (current_item_index_.isValid()) {
emit dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
Q_EMIT dataChanged(index(current_item_index_.row(), 0), index(current_item_index_.row(), ColumnCount - 1));
}
}
@@ -1634,7 +1634,7 @@ void Playlist::ItemsLoaded() {
}
}
emit RestoreFinished();
Q_EMIT RestoreFinished();
Settings s;
s.beginGroup(kSettingsGroup);
@@ -1650,7 +1650,7 @@ void Playlist::ItemsLoaded() {
#endif
}
emit PlaylistLoaded();
Q_EMIT PlaylistLoaded();
}
@@ -1795,10 +1795,10 @@ void Playlist::StopAfter(const int row) {
}
if (old_stop_after.isValid()) {
emit dataChanged(old_stop_after, old_stop_after.sibling(old_stop_after.row(), ColumnCount - 1));
Q_EMIT dataChanged(old_stop_after, old_stop_after.sibling(old_stop_after.row(), ColumnCount - 1));
}
if (stop_after_.isValid()) {
emit dataChanged(stop_after_, stop_after_.sibling(stop_after_.row(), ColumnCount - 1));
Q_EMIT dataChanged(stop_after_, stop_after_.sibling(stop_after_.row(), ColumnCount - 1));
}
}
@@ -2101,10 +2101,10 @@ void Playlist::TracksAboutToBeDequeued(const QModelIndex&, const int begin, cons
void Playlist::TracksDequeued() {
for (const QModelIndex &idx : std::as_const(temp_dequeue_change_indexes_)) {
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
temp_dequeue_change_indexes_.clear();
emit QueueChanged();
Q_EMIT QueueChanged();
}
@@ -2112,7 +2112,7 @@ void Playlist::TracksEnqueued(const QModelIndex&, const int begin, const int end
const QModelIndex &b = queue_->mapToSource(queue_->index(begin, static_cast<int>(Column::Title)));
const QModelIndex &e = queue_->mapToSource(queue_->index(end, static_cast<int>(Column::Title)));
emit dataChanged(b, e);
Q_EMIT dataChanged(b, e);
}
@@ -2120,7 +2120,7 @@ void Playlist::QueueLayoutChanged() {
for (int i = 0; i < queue_->rowCount(); ++i) {
const QModelIndex &idx = queue_->mapToSource(queue_->index(i, static_cast<int>(Column::Title)));
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
}
@@ -2280,14 +2280,14 @@ void Playlist::ItemChanged(const int row, const Columns columns) {
const QModelIndex idx_column_first = index(row, 0);
const QModelIndex idx_column_last = index(row, ColumnCount - 1);
if (idx_column_first.isValid() && idx_column_last.isValid()) {
emit dataChanged(index(row, 0), index(row, ColumnCount - 1));
Q_EMIT dataChanged(index(row, 0), index(row, ColumnCount - 1));
}
}
else {
for (const Column &column : columns) {
const QModelIndex idx = index(row, static_cast<int>(column));
if (idx.isValid()) {
emit dataChanged(idx, idx);
Q_EMIT dataChanged(idx, idx);
}
}
}
@@ -2302,10 +2302,10 @@ void Playlist::InformOfCurrentSongChange(const bool minor) {
}
if (minor) {
emit CurrentSongMetadataChanged(metadata);
Q_EMIT CurrentSongMetadataChanged(metadata);
}
else {
emit CurrentSongChanged(metadata);
Q_EMIT CurrentSongChanged(metadata);
}
}
@@ -2465,7 +2465,7 @@ void Playlist::SkipTracks(const QModelIndexList &source_indexes) {
for (const QModelIndex &source_index : source_indexes) {
PlaylistItemPtr track_to_skip = item_at(source_index.row());
track_to_skip->SetShouldSkip(!((track_to_skip)->GetShouldSkip()));
emit dataChanged(source_index, source_index);
Q_EMIT dataChanged(source_index, source_index);
}
}
@@ -2521,7 +2521,7 @@ void Playlist::TurnOffDynamicPlaylist() {
ShuffleModeChanged(ShuffleMode());
}
emit DynamicModeChanged(false);
Q_EMIT DynamicModeChanged(false);
ScheduleSave();

View File

@@ -87,7 +87,7 @@ void PlaylistBackend::Exit() {
Q_ASSERT(QThread::currentThread() == thread());
moveToThread(original_thread_);
emit ExitFinished();
Q_EMIT ExitFinished();
}

View File

@@ -204,7 +204,7 @@ void PlaylistContainer::SetViewModel(Playlist *playlist, const int scroll_positi
playlist->IgnoreSorting(false);
QObject::connect(view()->selectionModel(), &QItemSelectionModel::selectionChanged, this, &PlaylistContainer::SelectionChanged);
emit ViewSelectionModelChanged();
Q_EMIT ViewSelectionModelChanged();
// Update filter
ui_->search_field->setText(playlist->filter()->filter_string());
@@ -236,7 +236,7 @@ void PlaylistContainer::SetViewModel(Playlist *playlist, const int scroll_positi
ui_->undo->setDefaultAction(undo_);
ui_->redo->setDefaultAction(redo_);
emit UndoRedoActionsChanged(undo_, redo_);
Q_EMIT UndoRedoActionsChanged(undo_, redo_);
}

View File

@@ -161,7 +161,7 @@ void PlaylistHeader::SetColumnAlignment(QAction *action) {
void PlaylistHeader::ToggleVisible(const int section) {
SetSectionHidden(section, !isSectionHidden(section));
emit SectionVisibilityChanged(section, !isSectionHidden(section));
Q_EMIT SectionVisibilityChanged(section, !isSectionHidden(section));
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
@@ -169,7 +169,7 @@ void PlaylistHeader::enterEvent(QEnterEvent*) {
#else
void PlaylistHeader::enterEvent(QEvent*) {
#endif
emit MouseEntered();
Q_EMIT MouseEntered();
}
void PlaylistHeader::ResetColumns() {
@@ -177,5 +177,5 @@ void PlaylistHeader::ResetColumns() {
}
void PlaylistHeader::ToggleRatingEditStatus() {
emit SectionRatingLockStatusChanged(action_rating_lock_->isChecked());
Q_EMIT SectionRatingLockStatusChanged(action_rating_lock_->isChecked());
}

View File

@@ -105,7 +105,7 @@ void PlaylistListModel::AddRowItem(QStandardItem *item, const QString &parent_pa
playlists_by_id_[id] = item;
if (dropping_rows_) {
emit PlaylistPathChanged(id, parent_path);
Q_EMIT PlaylistPathChanged(id, parent_path);
}
break;
@@ -227,7 +227,7 @@ bool PlaylistListModel::setData(const QModelIndex &idx, const QVariant &value, i
switch (idx.data(Role_Type).toInt()) {
case Type_Playlist:
emit PlaylistRenamed(idx.data(Role_PlaylistId).toInt(), value.toString());
Q_EMIT PlaylistRenamed(idx.data(Role_PlaylistId).toInt(), value.toString());
break;
case Type_Folder:
@@ -247,7 +247,7 @@ void PlaylistListModel::UpdatePathsRecursive(const QModelIndex &parent) {
switch (parent.data(Role_Type).toInt()) {
case Type_Playlist:
emit PlaylistPathChanged(parent.data(Role_PlaylistId).toInt(), ItemPath(itemFromIndex(parent)));
Q_EMIT PlaylistPathChanged(parent.data(Role_PlaylistId).toInt(), ItemPath(itemFromIndex(parent)));
break;
case Type_Folder:

View File

@@ -68,7 +68,7 @@ bool PlaylistListView::ItemsSelected() const {
}
void PlaylistListView::selectionChanged(const QItemSelection&, const QItemSelection&) {
emit ItemsSelectedChanged(selectionModel()->selectedRows().count() > 0);
Q_EMIT ItemsSelectedChanged(selectionModel()->selectedRows().count() > 0);
}
void PlaylistListView::dragEnterEvent(QDragEnterEvent *e) {
@@ -121,7 +121,7 @@ void PlaylistListView::timerEvent(QTimerEvent *e) {
QTreeView::timerEvent(e);
if (e->timerId() == drag_hover_timer_.timerId()) {
drag_hover_timer_.stop();
emit doubleClicked(currentIndex());
Q_EMIT doubleClicked(currentIndex());
}
}
@@ -132,7 +132,7 @@ void PlaylistListView::dropEvent(QDropEvent *e) {
if (drag_hover_timer_.isActive()) {
drag_hover_timer_.stop();
}
emit ItemMimeDataDroppedSignal(currentIndex(), e->mimeData());
Q_EMIT ItemMimeDataDroppedSignal(currentIndex(), e->mimeData());
}
else {
AutoExpandingTreeView::dropEvent(e);

View File

@@ -112,7 +112,7 @@ void PlaylistManager::Init(SharedPtr<CollectionBackend> collection_backend, Shar
// If no playlist exists then make a new one
if (playlists_.isEmpty()) New(tr("Playlist"));
emit PlaylistManagerInitialized();
Q_EMIT PlaylistManagerInitialized();
}
@@ -123,7 +123,7 @@ void PlaylistManager::PlaylistLoaded() {
QObject::disconnect(playlist, &Playlist::PlaylistLoaded, this, &PlaylistManager::PlaylistLoaded);
--playlists_loading_;
if (playlists_loading_ == 0) {
emit AllPlaylistsLoaded();
Q_EMIT AllPlaylistsLoaded();
}
}
@@ -165,7 +165,7 @@ Playlist *PlaylistManager::AddPlaylist(const int id, const QString &name, const
playlists_[id] = Data(ret, name);
emit PlaylistAdded(id, name, favorite);
Q_EMIT PlaylistAdded(id, name, favorite);
if (current_ == -1) {
SetCurrentPlaylist(id);
@@ -205,7 +205,7 @@ void PlaylistManager::Load(const QString &filename) {
int id = playlist_backend_->CreatePlaylist(fileinfo.completeBaseName(), QString());
if (id == -1) {
emit Error(tr("Couldn't create playlist"));
Q_EMIT Error(tr("Couldn't create playlist"));
return;
}
@@ -292,7 +292,7 @@ void PlaylistManager::Rename(const int id, const QString &new_name) {
playlist_backend_->RenamePlaylist(id, new_name);
playlists_[id].name = new_name;
emit PlaylistRenamed(id, new_name);
Q_EMIT PlaylistRenamed(id, new_name);
}
@@ -309,7 +309,7 @@ void PlaylistManager::Favorite(const int id, const bool favorite) {
// while it's not visible in the playlist tabbar either, because it has been closed: delete it.
playlist_backend_->RemovePlaylist(id);
}
emit PlaylistFavorited(id, favorite);
Q_EMIT PlaylistFavorited(id, favorite);
}
@@ -332,11 +332,11 @@ bool PlaylistManager::Close(const int id) {
if (id == current_) SetCurrentPlaylist(next_id);
Data data = playlists_.take(id);
emit PlaylistClosed(id);
Q_EMIT PlaylistClosed(id);
if (!data.p->is_favorite()) {
playlist_backend_->RemovePlaylist(id);
emit PlaylistDeleted(id);
Q_EMIT PlaylistDeleted(id);
}
delete data.p;
@@ -351,12 +351,12 @@ void PlaylistManager::Delete(const int id) {
}
playlist_backend_->RemovePlaylist(id);
emit PlaylistDeleted(id);
Q_EMIT PlaylistDeleted(id);
}
void PlaylistManager::OneOfPlaylistsChanged() {
emit PlaylistChanged(qobject_cast<Playlist*>(sender()));
Q_EMIT PlaylistChanged(qobject_cast<Playlist*>(sender()));
}
void PlaylistManager::SetCurrentPlaylist(const int id) {
@@ -369,7 +369,7 @@ void PlaylistManager::SetCurrentPlaylist(const int id) {
}
current_ = id;
emit CurrentChanged(current(), playlists_[id].scroll_position);
Q_EMIT CurrentChanged(current(), playlists_[id].scroll_position);
UpdateSummaryText();
}
@@ -383,7 +383,7 @@ void PlaylistManager::SetActivePlaylist(const int id) {
active_ = id;
emit ActiveChanged(active());
Q_EMIT ActiveChanged(active());
}
@@ -458,7 +458,7 @@ void PlaylistManager::UpdateSummaryText() {
summary += QLatin1String(" - [ ") + Utilities::WordyTimeNanosec(nanoseconds) + QLatin1String(" ]");
}
emit SummaryTextChanged(summary);
Q_EMIT SummaryTextChanged(summary);
}

View File

@@ -181,7 +181,7 @@ void PlaylistSequence::SetRepeatMode(const RepeatMode mode) {
if (mode != repeat_mode_) {
repeat_mode_ = mode;
emit RepeatModeChanged(mode);
Q_EMIT RepeatModeChanged(mode);
}
Save();
@@ -201,7 +201,7 @@ void PlaylistSequence::SetShuffleMode(const ShuffleMode mode) {
if (mode != shuffle_mode_) {
shuffle_mode_ = mode;
emit ShuffleModeChanged(mode);
Q_EMIT ShuffleModeChanged(mode);
}
Save();

View File

@@ -183,12 +183,12 @@ void PlaylistTabBar::RenameSlot() {
if (new_name.isEmpty() || new_name == old_name) return;
emit Rename(playlist_id, new_name);
Q_EMIT Rename(playlist_id, new_name);
}
void PlaylistTabBar::RenameInline() {
emit Rename(tabData(menu_index_).toInt(), rename_editor_->text());
Q_EMIT Rename(tabData(menu_index_).toInt(), rename_editor_->text());
HideEditor();
}
@@ -267,7 +267,7 @@ void PlaylistTabBar::CloseSlot() {
// Close the playlist. If the playlist is not a favorite playlist, it will be deleted, as it will not be visible after being closed.
// Otherwise, the tab is closed but the playlist still exists and can be resurrected from the "Playlists" tab.
emit Close(playlist_id);
Q_EMIT Close(playlist_id);
// Select the nearest tab.
if (menu_index_ > 1) {
@@ -291,7 +291,7 @@ void PlaylistTabBar::SaveSlot() {
if (menu_index_ == -1) return;
emit Save(tabData(menu_index_).toInt());
Q_EMIT Save(tabData(menu_index_).toInt());
}
@@ -341,7 +341,7 @@ void PlaylistTabBar::set_text_by_id(const int id, const QString &text) {
}
void PlaylistTabBar::CurrentIndexChanged(const int index) {
if (!suppress_current_changed_) emit CurrentIdChanged(tabData(index).toInt());
if (!suppress_current_changed_) Q_EMIT CurrentIdChanged(tabData(index).toInt());
}
void PlaylistTabBar::InsertTab(const int id, const int index, const QString &text, const bool favorite) {
@@ -363,7 +363,7 @@ void PlaylistTabBar::InsertTab(const int id, const int index, const QString &tex
// If we are still starting up, we don't need to do this, as the tab ordering after startup will be the same as was already in the db.
if (initialized_) {
if (currentIndex() == index) emit CurrentIdChanged(id);
if (currentIndex() == index) Q_EMIT CurrentIdChanged(id);
// Update playlist tab order/visibility
TabMoved();
@@ -378,7 +378,7 @@ void PlaylistTabBar::TabMoved() {
for (int i = 0; i < count(); ++i) {
ids << tabData(i).toInt();
}
emit PlaylistOrderChanged(ids);
Q_EMIT PlaylistOrderChanged(ids);
}

View File

@@ -411,7 +411,7 @@ void PlaylistView::RestoreHeaderState() {
header_state_restored_ = true;
emit ColumnAlignmentChanged(column_alignment_);
Q_EMIT ColumnAlignmentChanged(column_alignment_);
}
@@ -671,23 +671,23 @@ void PlaylistView::keyPressEvent(QKeyEvent *event) {
CopyCurrentSongToClipboard();
}
else if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
if (currentIndex().isValid()) emit PlayItem(currentIndex(), Playlist::AutoScroll::Never);
if (currentIndex().isValid()) Q_EMIT PlayItem(currentIndex(), Playlist::AutoScroll::Never);
event->accept();
}
else if (event->modifiers() != Qt::ControlModifier && event->key() == Qt::Key_Space) {
emit PlayPause();
Q_EMIT PlayPause();
event->accept();
}
else if (event->key() == Qt::Key_Left) {
emit SeekBackward();
Q_EMIT SeekBackward();
event->accept();
}
else if (event->key() == Qt::Key_Right) {
emit SeekForward();
Q_EMIT SeekForward();
event->accept();
}
else if (event->modifiers() == Qt::NoModifier && ((event->key() >= Qt::Key_Exclam && event->key() <= Qt::Key_Z) || event->key() == Qt::Key_Backspace || event->key() == Qt::Key_Escape)) {
emit FocusOnFilterSignal(event);
Q_EMIT FocusOnFilterSignal(event);
event->accept();
}
else {
@@ -697,7 +697,7 @@ void PlaylistView::keyPressEvent(QKeyEvent *event) {
}
void PlaylistView::contextMenuEvent(QContextMenuEvent *e) {
emit RightClicked(e->globalPos(), indexAt(e->pos()));
Q_EMIT RightClicked(e->globalPos(), indexAt(e->pos()));
e->accept();
}
@@ -1271,7 +1271,7 @@ void PlaylistView::ReloadSettings() {
}
setProperty("default_background_enabled", background_image_type_ == AppearanceSettingsPage::BackgroundImageType::Default);
setProperty("strawbs_background_enabled", background_image_type_ == AppearanceSettingsPage::BackgroundImageType::Strawbs);
emit BackgroundPropertyChanged();
Q_EMIT BackgroundPropertyChanged();
force_background_redraw_ = true;
}
@@ -1365,7 +1365,7 @@ void PlaylistView::SetColumnAlignment(const int section, const Qt::Alignment ali
if (section < 0) return;
column_alignment_[section] = alignment;
emit ColumnAlignmentChanged(column_alignment_);
Q_EMIT ColumnAlignmentChanged(column_alignment_);
SaveSettings();
}

View File

@@ -177,7 +177,7 @@ class PlaylistView : public QTreeView {
void set_background_image_type(AppearanceSettingsPage::BackgroundImageType bg) {
background_image_type_ = bg;
emit BackgroundPropertyChanged(); // clazy:exclude=incorrect-emit
Q_EMIT BackgroundPropertyChanged(); // clazy:exclude=incorrect-emit
}
// Save image as the background_image_ after applying some modifications (opacity, ...).
// Should be used instead of modifying background_image_ directly

View File

@@ -76,7 +76,7 @@ void SongLoaderInserter::Load(Playlist *destination, int row, bool play_now, boo
else {
const QStringList errors = loader->errors();
for (const QString &error : errors) {
emit Error(error);
Q_EMIT Error(error);
}
}
delete loader;
@@ -114,11 +114,11 @@ void SongLoaderInserter::LoadAudioCD(Playlist *destination, int row, bool play_n
SongLoader::Result ret = loader->LoadAudioCD();
if (ret == SongLoader::Result::Error) {
if (loader->errors().isEmpty())
emit Error(tr("Error while loading audio CD."));
Q_EMIT Error(tr("Error while loading audio CD."));
else {
const QStringList errors = loader->errors();
for (const QString &error : errors) {
emit Error(error);
Q_EMIT Error(error);
}
}
delete loader;
@@ -135,7 +135,7 @@ void SongLoaderInserter::AudioCDTracksLoadFinished(SongLoader *loader) {
if (songs_.isEmpty()) {
const QStringList errors = loader->errors();
for (const QString &error : errors) {
emit Error(error);
Q_EMIT Error(error);
}
}
else {
@@ -184,7 +184,7 @@ void SongLoaderInserter::AsyncLoad() {
if (res == SongLoader::Result::Error) {
const QStringList errors = loader->errors();
for (const QString &error : errors) {
emit Error(error);
Q_EMIT Error(error);
}
continue;
}
@@ -200,7 +200,7 @@ void SongLoaderInserter::AsyncLoad() {
}
task_manager_->SetTaskFinished(async_load_id);
emit PreloadFinished();
Q_EMIT PreloadFinished();
// Songs are inserted in playlist, now load them completely.
async_progress = 0;
@@ -219,7 +219,7 @@ void SongLoaderInserter::AsyncLoad() {
task_manager_->SetTaskFinished(async_load_id);
// Replace the partially-loaded items by the new ones, fully loaded.
emit EffectiveLoadFinished(songs);
Q_EMIT EffectiveLoadFinished(songs);
deleteLater();