diff --git a/3rdparty/qocoa/qocoa_mac.h b/3rdparty/qocoa/qocoa_mac.h index f93a56b9d..35a9deb1d 100644 --- a/3rdparty/qocoa/qocoa_mac.h +++ b/3rdparty/qocoa/qocoa_mac.h @@ -22,10 +22,10 @@ THE SOFTWARE. #include #include +#include #include #include #include -#include static inline NSString* fromQString(const QString &string) { @@ -43,14 +43,13 @@ static inline QString toQString(NSString *string) static inline NSImage* fromQPixmap(const QPixmap &pixmap) { - CGImageRef cgImage = QtMac::toCGImageRef(pixmap); - return [[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize]; + CGImageRef cgImage = QtMac::toCGImageRef(pixmap); + return [[NSImage alloc] initWithCGImage:cgImage size:NSZeroSize]; } -static inline void setupLayout(NSView *cocoaView, QWidget *parent) -{ - parent->setAttribute(Qt::WA_NativeWindow); - QVBoxLayout *layout = new QVBoxLayout(parent); - layout->setMargin(0); - layout->addWidget(new QMacCocoaViewContainer(cocoaView, parent)); +static inline void setupLayout(NSView* cocoaView, QWidget* parent) { + parent->setAttribute(Qt::WA_NativeWindow); + QVBoxLayout* layout = new QVBoxLayout(parent); + layout->setMargin(0); + layout->addWidget(new QMacCocoaViewContainer(cocoaView, parent)); } diff --git a/3rdparty/qtsingleapplication/qtlocalpeer.cpp b/3rdparty/qtsingleapplication/qtlocalpeer.cpp index 4b2fac915..d65dda3ee 100644 --- a/3rdparty/qtsingleapplication/qtlocalpeer.cpp +++ b/3rdparty/qtsingleapplication/qtlocalpeer.cpp @@ -111,8 +111,7 @@ bool QtLocalPeer::isClient() if (lockFile.isLocked()) return false; - if (!lockFile.lock(QtLockedFile::WriteLock, false)) - return true; + if (!lockFile.lock(QtLockedFile::WriteLock, false)) return true; bool res = server->listen(socketName); #if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) diff --git a/3rdparty/qtsingleapplication/qtlocalpeer.h b/3rdparty/qtsingleapplication/qtlocalpeer.h index bd25f137a..8b1945b6a 100644 --- a/3rdparty/qtsingleapplication/qtlocalpeer.h +++ b/3rdparty/qtsingleapplication/qtlocalpeer.h @@ -69,7 +69,7 @@ protected: QLocalServer* server; QtLockedFile lockFile; -private: + private: static const char* ack; }; diff --git a/3rdparty/qtsingleapplication/qtlockedfile_win.cpp b/3rdparty/qtsingleapplication/qtlockedfile_win.cpp index 737a23f86..7f37a94e3 100644 --- a/3rdparty/qtsingleapplication/qtlockedfile_win.cpp +++ b/3rdparty/qtsingleapplication/qtlockedfile_win.cpp @@ -59,10 +59,13 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate) Qt::HANDLE mutex; if (doCreate) { #if (QT_VERSION < 0x050000) - QT_WA( { mutex = CreateMutexW(nullptr, FALSE, (WCHAR*)mname.utf16()); }, - { mutex = CreateMutexA(nullptr, FALSE, mname.toLocal8Bit().constData()); } ); + QT_WA({ mutex = CreateMutexW(nullptr, FALSE, (WCHAR*)mname.utf16()); }, + { + mutex = + CreateMutexA(nullptr, FALSE, mname.toLocal8Bit().constData()); + }); #else - mutex = CreateMutexW(nullptr, FALSE, (WCHAR*)mname.utf16()); + mutex = CreateMutexW(nullptr, FALSE, (WCHAR*)mname.utf16()); #endif if (!mutex) { qErrnoWarning("QtLockedFile::lock(): CreateMutex failed"); @@ -71,10 +74,18 @@ Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate) } else { #if (QT_VERSION < 0x050000) - QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (WCHAR*)mname.utf16()); }, - { mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, mname.toLocal8Bit().constData()); } ); + QT_WA( + { + mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, + (WCHAR*)mname.utf16()); + }, + { + mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, + mname.toLocal8Bit().constData()); + }); #else - mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (WCHAR*)mname.utf16()); + mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, + (WCHAR*)mname.utf16()); #endif if (!mutex) { if (GetLastError() != ERROR_FILE_NOT_FOUND) diff --git a/3rdparty/qxt/qxtglobalshortcut.cpp b/3rdparty/qxt/qxtglobalshortcut.cpp index db483060e..cfc8bfbc4 100644 --- a/3rdparty/qxt/qxtglobalshortcut.cpp +++ b/3rdparty/qxt/qxtglobalshortcut.cpp @@ -39,31 +39,31 @@ int QxtGlobalShortcutPrivate::ref = 0; #if QT_VERSION < QT_VERSION_CHECK(5,0,0) QAbstractEventDispatcher::EventFilter QxtGlobalShortcutPrivate::prevEventFilter = 0; #endif -#endif // Q_OS_MAC +#endif // Q_OS_MAC QHash, QxtGlobalShortcut*> QxtGlobalShortcutPrivate::shortcuts; QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() : enabled(true), key(Qt::Key(0)), mods(Qt::NoModifier) { #ifndef Q_OS_MAC - if (!ref++) + if (!ref++) #if QT_VERSION < QT_VERSION_CHECK(5,0,0) prevEventFilter = QAbstractEventDispatcher::instance()->setEventFilter(eventFilter); #else QAbstractEventDispatcher::instance()->installNativeEventFilter(this); #endif -#endif // Q_OS_MAC +#endif // Q_OS_MAC } QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate() { #ifndef Q_OS_MAC - if (!--ref) + if (!--ref) #if QT_VERSION < QT_VERSION_CHECK(5,0,0) QAbstractEventDispatcher::instance()->setEventFilter(prevEventFilter); #else QAbstractEventDispatcher::instance()->removeNativeEventFilter(this); #endif -#endif // Q_OS_MAC +#endif // Q_OS_MAC } bool QxtGlobalShortcutPrivate::setShortcut(const QKeySequence& shortcut) diff --git a/3rdparty/qxt/qxtglobalshortcut_p.h b/3rdparty/qxt/qxtglobalshortcut_p.h index 14088c457..98c6cd543 100644 --- a/3rdparty/qxt/qxtglobalshortcut_p.h +++ b/3rdparty/qxt/qxtglobalshortcut_p.h @@ -67,7 +67,7 @@ public: #else virtual bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); #endif // QT_VERSION < QT_VERSION_CHECK(5,0,0) -#endif // Q_OS_MAC +#endif // Q_OS_MAC static void activateShortcut(quint32 nativeKey, quint32 nativeMods); diff --git a/src/core/gnomeglobalshortcutbackend.cpp b/src/core/gnomeglobalshortcutbackend.cpp index 2d151dae4..a0205cc9f 100644 --- a/src/core/gnomeglobalshortcutbackend.cpp +++ b/src/core/gnomeglobalshortcutbackend.cpp @@ -18,10 +18,10 @@ */ #include "config.h" -#include "gnomeglobalshortcutbackend.h" -#include "globalshortcuts.h" #include "core/closure.h" #include "core/logging.h" +#include "globalshortcuts.h" +#include "gnomeglobalshortcutbackend.h" #ifdef HAVE_DBUS #include diff --git a/src/covers/albumcoverloader.cpp b/src/covers/albumcoverloader.cpp index 214fc8243..a04cd923a 100644 --- a/src/covers/albumcoverloader.cpp +++ b/src/covers/albumcoverloader.cpp @@ -35,7 +35,7 @@ #include "core/utilities.h" #include "internet/core/internetmodel.h" #ifdef HAVE_SPOTIFY -# include "internet/spotify/spotifyservice.h" +#include "internet/spotify/spotifyservice.h" #endif AlbumCoverLoader::AlbumCoverLoader(QObject* parent) diff --git a/src/covers/albumcoverloader.h b/src/covers/albumcoverloader.h index e2b44cde4..c5fae6b4c 100644 --- a/src/covers/albumcoverloader.h +++ b/src/covers/albumcoverloader.h @@ -21,8 +21,8 @@ #ifndef COVERS_ALBUMCOVERLOADER_H_ #define COVERS_ALBUMCOVERLOADER_H_ -#include "config.h" #include "albumcoverloaderoptions.h" +#include "config.h" #include "core/song.h" #include