Formatting

This commit is contained in:
Jonas Kvinge 2022-03-22 21:19:59 +01:00
parent f6b70fda71
commit a6c05df362
14 changed files with 30 additions and 1 deletions

View File

@ -85,6 +85,7 @@ void GLog(const char *domain, int level, const char *message, void*) {
qLogCat(Debug, domain) << message; qLogCat(Debug, domain) << message;
break; break;
} }
} }
template<class T> template<class T>

View File

@ -174,6 +174,7 @@ WorkerPool<HandlerType>::WorkerPool(QObject *parent)
if (local_server_name_.isEmpty()) { if (local_server_name_.isEmpty()) {
local_server_name_ = "workerpool"; local_server_name_ = "workerpool";
} }
} }
template<typename HandlerType> template<typename HandlerType>
@ -204,6 +205,7 @@ WorkerPool<HandlerType>::~WorkerPool() {
for (ReplyType *reply : message_queue_) { for (ReplyType *reply : message_queue_) {
reply->Abort(); reply->Abort();
} }
} }
template<typename HandlerType> template<typename HandlerType>
@ -265,6 +267,7 @@ void WorkerPool<HandlerType>::DoStart() {
workers_ << worker; workers_ << worker;
} }
} }
template<typename HandlerType> template<typename HandlerType>
@ -335,6 +338,7 @@ void WorkerPool<HandlerType>::NewConnection() {
worker->handler_ = new HandlerType(worker->local_socket_, this); worker->handler_ = new HandlerType(worker->local_socket_, this);
SendQueuedMessages(); SendQueuedMessages();
} }
template<typename HandlerType> template<typename HandlerType>
@ -362,6 +366,7 @@ void WorkerPool<HandlerType>::ProcessError(QProcess::ProcessError error) {
StartOneWorker(worker); StartOneWorker(worker);
break; break;
} }
} }
template<typename HandlerType> template<typename HandlerType>
@ -374,6 +379,7 @@ void WorkerPool<HandlerType>::ProcessReadyReadStandardOutput() {
fprintf(stdout, "%s", data.data()); fprintf(stdout, "%s", data.data());
fflush(stdout); fflush(stdout);
} }
template<typename HandlerType> template<typename HandlerType>
@ -416,6 +422,7 @@ WorkerPool<HandlerType>::SendMessageWithReply(MessageType *message) {
QMetaObject::invokeMethod(this, "SendQueuedMessages", Qt::QueuedConnection); QMetaObject::invokeMethod(this, "SendQueuedMessages", Qt::QueuedConnection);
return reply; return reply;
} }
template<typename HandlerType> template<typename HandlerType>
@ -437,6 +444,7 @@ void WorkerPool<HandlerType>::SendQueuedMessages() {
handler->SendRequest(reply); handler->SendRequest(reply);
} }
} }
template<typename HandlerType> template<typename HandlerType>

View File

@ -58,7 +58,7 @@ class SimpleTreeItem {
bool lazy_loaded; bool lazy_loaded;
T *parent; T *parent;
QList<T *> children; QList<T*> children;
QAbstractItemModel *child_model; QAbstractItemModel *child_model;
SimpleTreeModel<T> *model; SimpleTreeModel<T> *model;

View File

@ -88,6 +88,7 @@ QModelIndex SimpleTreeModel<T>::index(int row, int, const QModelIndex &parent) c
return QModelIndex(); return QModelIndex();
return ItemToIndex(parent_item->children[row]); return ItemToIndex(parent_item->children[row]);
} }
template<typename T> template<typename T>

View File

@ -94,6 +94,7 @@ ITaskbarList3 *Windows7ThumbBar::CreateTaskbarList() {
} }
return taskbar_list; return taskbar_list;
} }
void Windows7ThumbBar::SetupButton(const QAction *action, THUMBBUTTON *button) { void Windows7ThumbBar::SetupButton(const QAction *action, THUMBBUTTON *button) {

View File

@ -70,6 +70,7 @@ bool GioLister::DeviceInfo::is_suitable() const {
if (filesystem_type.isEmpty()) return true; if (filesystem_type.isEmpty()) return true;
return filesystem_type != "udf" && filesystem_type != "smb" && filesystem_type != "cifs" && filesystem_type != "ssh" && filesystem_type != "isofs"; return filesystem_type != "udf" && filesystem_type != "smb" && filesystem_type != "cifs" && filesystem_type != "ssh" && filesystem_type != "isofs";
} }
template<typename T, typename F> template<typename T, typename F>

View File

@ -94,12 +94,14 @@ bool Engine::Base::Play(const QUrl &stream_url, const QUrl &original_url, const
} }
return Play(offset_nanosec); return Play(offset_nanosec);
} }
void Engine::Base::SetVolume(const uint value) { void Engine::Base::SetVolume(const uint value) {
volume_ = value; volume_ = value;
SetVolumeSW(MakeVolumeLogarithmic(value)); SetVolumeSW(MakeVolumeLogarithmic(value));
} }
uint Engine::Base::MakeVolumeLogarithmic(const uint volume) { uint Engine::Base::MakeVolumeLogarithmic(const uint volume) {

View File

@ -170,16 +170,19 @@ GlobalShortcutsManager::Shortcut GlobalShortcutsManager::AddShortcut(const QStri
bool GlobalShortcutsManager::IsKdeAvailable() { bool GlobalShortcutsManager::IsKdeAvailable() {
return GlobalShortcutsBackendKDE::IsKDEAvailable(); return GlobalShortcutsBackendKDE::IsKDEAvailable();
} }
bool GlobalShortcutsManager::IsGnomeAvailable() { bool GlobalShortcutsManager::IsGnomeAvailable() {
return GlobalShortcutsBackendGnome::IsGnomeAvailable(); return GlobalShortcutsBackendGnome::IsGnomeAvailable();
} }
bool GlobalShortcutsManager::IsMateAvailable() { bool GlobalShortcutsManager::IsMateAvailable() {
return GlobalShortcutsBackendMate::IsMateAvailable(); return GlobalShortcutsBackendMate::IsMateAvailable();
} }
#endif // defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && defined(HAVE_DBUS) #endif // defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) && defined(HAVE_DBUS)
@ -189,6 +192,7 @@ bool GlobalShortcutsManager::IsMateAvailable() {
bool GlobalShortcutsManager::IsX11Available() { bool GlobalShortcutsManager::IsX11Available() {
return GlobalShortcutsBackendX11::IsX11Available(); return GlobalShortcutsBackendX11::IsX11Available();
} }
#endif // HAVE_X11_GLOBALSHORTCUTS #endif // HAVE_X11_GLOBALSHORTCUTS

View File

@ -2168,6 +2168,7 @@ void Playlist::RemoveDeletedSongs() {
} }
removeRows(rows_to_remove); removeRows(rows_to_remove);
} }
namespace { namespace {

View File

@ -716,12 +716,14 @@ void QobuzService::SendSearch() {
search_request_->Search(search_id_, search_text_); search_request_->Search(search_id_, search_text_);
search_request_->Process(); search_request_->Process();
} }
void QobuzService::SearchResultsReceived(const int id, const SongMap &songs, const QString &error) { void QobuzService::SearchResultsReceived(const int id, const SongMap &songs, const QString &error) {
search_request_.reset(); search_request_.reset();
emit SearchResults(id, songs, error); emit SearchResults(id, songs, error);
} }
uint QobuzService::GetStreamURL(const QUrl &url, QString &error) { uint QobuzService::GetStreamURL(const QUrl &url, QString &error) {

View File

@ -247,6 +247,7 @@ void SmartPlaylistsViewContainer::DeleteSmartPlaylistFromButton() {
if (ui_->view->selectionModel()->selectedIndexes().count() == 0) return; if (ui_->view->selectionModel()->selectedIndexes().count() == 0) return;
DeleteSmartPlaylist(ui_->view->selectionModel()->selectedIndexes().first()); DeleteSmartPlaylist(ui_->view->selectionModel()->selectedIndexes().first());
} }
void SmartPlaylistsViewContainer::NewSmartPlaylistFinished() { void SmartPlaylistsViewContainer::NewSmartPlaylistFinished() {
@ -255,6 +256,7 @@ void SmartPlaylistsViewContainer::NewSmartPlaylistFinished() {
if (!wizard) return; if (!wizard) return;
QObject::disconnect(wizard, &SmartPlaylistWizard::accepted, this, &SmartPlaylistsViewContainer::NewSmartPlaylistFinished); QObject::disconnect(wizard, &SmartPlaylistWizard::accepted, this, &SmartPlaylistsViewContainer::NewSmartPlaylistFinished);
model_->AddGenerator(wizard->CreateGenerator()); model_->AddGenerator(wizard->CreateGenerator());
} }
void SmartPlaylistsViewContainer::EditSmartPlaylistFinished() { void SmartPlaylistsViewContainer::EditSmartPlaylistFinished() {

View File

@ -346,6 +346,7 @@ class FancyTabBar : public QTabBar { // clazy:exclude=missing-qobject-macro
} }
} }
} }
}; };
class TabData : public QObject { // clazy:exclude=missing-qobject-macro class TabData : public QObject { // clazy:exclude=missing-qobject-macro

View File

@ -203,6 +203,7 @@ TextEdit::TextEdit(QWidget *parent)
QObject::connect(reset_button_, &QToolButton::clicked, this, &TextEdit::Reset); QObject::connect(reset_button_, &QToolButton::clicked, this, &TextEdit::Reset);
QObject::connect(this, &TextEdit::textChanged, [this]() { viewport()->update(); }); // To clear the hint QObject::connect(this, &TextEdit::textChanged, [this]() { viewport()->update(); }); // To clear the hint
} }
void TextEdit::paintEvent(QPaintEvent *e) { void TextEdit::paintEvent(QPaintEvent *e) {
@ -237,6 +238,7 @@ CheckBox::CheckBox(QWidget *parent)
: QCheckBox(parent), ExtendedEditor(this, 14, false) { : QCheckBox(parent), ExtendedEditor(this, 14, false) {
QObject::connect(reset_button_, &QToolButton::clicked, this, &CheckBox::Reset); QObject::connect(reset_button_, &QToolButton::clicked, this, &CheckBox::Reset);
} }
void CheckBox::paintEvent(QPaintEvent *e) { void CheckBox::paintEvent(QPaintEvent *e) {
@ -255,6 +257,7 @@ QString SpinBox::textFromValue(int val) const {
return "-"; return "-";
} }
return QSpinBox::textFromValue(val); return QSpinBox::textFromValue(val);
} }
RatingBox::RatingBox(QWidget *parent) RatingBox::RatingBox(QWidget *parent)
@ -263,4 +266,5 @@ RatingBox::RatingBox(QWidget *parent)
clear_button_->hide(); clear_button_->hide();
reset_button_->hide(); reset_button_->hide();
} }

View File

@ -80,6 +80,7 @@ QRect RatingPainter::Contents(const QRect rect) {
const int x = rect.x() + (rect.width() - width) / 2; const int x = rect.x() + (rect.width() - width) / 2;
return QRect(x, rect.y(), width, rect.height()); return QRect(x, rect.y(), width, rect.height());
} }
float RatingPainter::RatingForPos(const QPoint pos, const QRect rect) { float RatingPainter::RatingForPos(const QPoint pos, const QRect rect) {