mirror of
https://github.com/clementine-player/Clementine
synced 2025-02-04 13:17:32 +01:00
Fix formatting
This commit is contained in:
parent
8c198a99a5
commit
1d5783b846
17
3rdparty/qocoa/qocoa_mac.h
vendored
17
3rdparty/qocoa/qocoa_mac.h
vendored
@ -22,10 +22,10 @@ THE SOFTWARE.
|
||||
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <QMacCocoaViewContainer>
|
||||
#include <QString>
|
||||
#include <QVBoxLayout>
|
||||
#include <QtMacExtras>
|
||||
#include <QMacCocoaViewContainer>
|
||||
|
||||
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));
|
||||
}
|
||||
|
3
3rdparty/qtsingleapplication/qtlocalpeer.cpp
vendored
3
3rdparty/qtsingleapplication/qtlocalpeer.cpp
vendored
@ -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))
|
||||
|
2
3rdparty/qtsingleapplication/qtlocalpeer.h
vendored
2
3rdparty/qtsingleapplication/qtlocalpeer.h
vendored
@ -69,7 +69,7 @@ protected:
|
||||
QLocalServer* server;
|
||||
QtLockedFile lockFile;
|
||||
|
||||
private:
|
||||
private:
|
||||
static const char* ack;
|
||||
};
|
||||
|
||||
|
@ -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)
|
||||
|
10
3rdparty/qxt/qxtglobalshortcut.cpp
vendored
10
3rdparty/qxt/qxtglobalshortcut.cpp
vendored
@ -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<QPair<quint32, quint32>, 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)
|
||||
|
2
3rdparty/qxt/qxtglobalshortcut_p.h
vendored
2
3rdparty/qxt/qxtglobalshortcut_p.h
vendored
@ -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);
|
||||
|
||||
|
@ -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 <dbus/gnomesettingsdaemon.h>
|
||||
|
@ -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)
|
||||
|
@ -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 <QImage>
|
||||
|
Loading…
x
Reference in New Issue
Block a user