소스 검색

Clang-tidy fixups

Apply use-nullptr, simplify-boolean-expr and
inconsistent-declaration-parameter-name
Tobias Hieta 8 년 전
부모
커밋
7f4202ff9c
58개의 변경된 파일108개의 추가작업 그리고 114개의 파일을 삭제
  1. 1 1
      src/ComponentManager.cpp
  2. 1 1
      src/ComponentManager.h
  3. 4 4
      src/SignalManager.cpp
  4. 1 1
      src/breakpad/BreakPadOSX.cpp
  5. 2 2
      src/display/DisplayComponent.cpp
  6. 1 1
      src/display/DisplayComponent.h
  7. 1 4
      src/display/DisplayManager.cpp
  8. 2 2
      src/display/osx/DisplayManagerOSX.cpp
  9. 2 2
      src/input/InputCEC.cpp
  10. 1 1
      src/input/InputCEC.h
  11. 1 1
      src/input/InputComponent.cpp
  12. 3 3
      src/input/InputComponent.h
  13. 1 1
      src/input/InputKeyboard.h
  14. 1 1
      src/input/InputMapping.cpp
  15. 1 1
      src/input/InputMapping.h
  16. 1 1
      src/input/InputRoku.h
  17. 2 2
      src/input/InputSDL.cpp
  18. 1 1
      src/input/InputSocket.h
  19. 1 1
      src/input/apple/HIDRemote/HIDRemote.m
  20. 1 1
      src/input/apple/InputAppleMediaKeys.h
  21. 1 1
      src/input/apple/InputAppleRemote.h
  22. 2 2
      src/main.cpp
  23. 2 2
      src/player/PlayerComponent.cpp
  24. 2 2
      src/player/PlayerComponent.h
  25. 8 8
      src/player/PlayerQuickItem.cpp
  26. 1 1
      src/player/PlayerQuickItem.h
  27. 1 1
      src/power/PowerComponent.h
  28. 1 1
      src/power/PowerComponentMac.h
  29. 1 1
      src/remote/GDMManager.h
  30. 12 12
      src/remote/RemoteComponent.cpp
  31. 1 1
      src/remote/RemoteComponent.h
  32. 3 3
      src/remote/RemoteSubscriber.cpp
  33. 2 2
      src/remote/RemoteSubscriber.h
  34. 1 1
      src/settings/AudioSettingsController.h
  35. 2 2
      src/settings/SettingsComponent.cpp
  36. 1 1
      src/settings/SettingsComponent.h
  37. 1 1
      src/settings/SettingsSection.h
  38. 2 2
      src/settings/SettingsValue.h
  39. 1 1
      src/shared/LocalJsonClient.h
  40. 1 1
      src/shared/LocalJsonServer.h
  41. 1 1
      src/shared/UniqueApplication.h
  42. 1 1
      src/system/OEUpdateManager.h
  43. 1 1
      src/system/SystemComponent.cpp
  44. 1 1
      src/system/SystemComponent.h
  45. 1 1
      src/system/UpdateManager.cpp
  46. 1 1
      src/system/UpdateManager.h
  47. 1 1
      src/system/UpdateManagerWin32.h
  48. 7 10
      src/system/UpdaterComponent.cpp
  49. 9 9
      src/system/UpdaterComponent.h
  50. 2 2
      src/tools/helper/HelperMain.cpp
  51. 1 1
      src/tools/helper/HelperSocket.h
  52. 1 1
      src/ui/EventFilter.h
  53. 1 1
      src/ui/KonvergoEngine.h
  54. 1 1
      src/ui/KonvergoWindow.cpp
  55. 1 1
      src/ui/KonvergoWindow.h
  56. 1 1
      src/utils/CachedRegexMatcher.h
  57. 1 1
      src/utils/HelperLaunchd.h
  58. 1 1
      src/utils/HelperLauncher.h

+ 1 - 1
src/ComponentManager.cpp

@@ -23,7 +23,7 @@
 #include "QsLog.h"
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-ComponentManager::ComponentManager() : QObject(0)
+ComponentManager::ComponentManager() : QObject(nullptr)
 {
 }
 

+ 1 - 1
src/ComponentManager.h

@@ -12,7 +12,7 @@
 class ComponentBase : public QObject
 {
 public:
-  ComponentBase(QObject* parent = 0) : QObject(parent) { }
+  ComponentBase(QObject* parent = nullptr) : QObject(parent) { }
   
   virtual bool componentInitialize() = 0;
   virtual const char* componentName() = 0;

+ 4 - 4
src/SignalManager.cpp

@@ -9,7 +9,7 @@
 int SignalManager::sigtermFd[2];
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-SignalManager::SignalManager(QGuiApplication* app) : QObject(NULL), m_app(app)
+SignalManager::SignalManager(QGuiApplication* app) : QObject(nullptr), m_app(app)
 {
   if (setupHandlers())
   {
@@ -36,14 +36,14 @@ int SignalManager::setupHandlers()
   sigemptyset(&term.sa_mask);
   term.sa_flags = SA_RESTART | SA_RESETHAND;
 
-  if (sigaction(SIGHUP, &term, 0) < 0)
+  if (sigaction(SIGHUP, &term, nullptr) < 0)
     return -1;
 
-  if (sigaction(SIGTERM, &term, 0) < 0)
+  if (sigaction(SIGTERM, &term, nullptr) < 0)
     return -2;
 
   term.sa_flags = SA_RESTART;
-  if (sigaction(SIGUSR1, &term, 0) < 0)
+  if (sigaction(SIGUSR1, &term, nullptr) < 0)
     return -3;
 
   return 0;

+ 1 - 1
src/breakpad/BreakPadOSX.cpp

@@ -13,5 +13,5 @@ static inline bool BreakPad_MinidumpCallback(const char *dump_dir, const char *m
 void installBreakPadHandler(const QString& name, const QString& destPath)
 {
   Q_UNUSED(name);
-  new google_breakpad::ExceptionHandler(destPath.toStdString(), NULL, BreakPad_MinidumpCallback, NULL, true, NULL);
+  new google_breakpad::ExceptionHandler(destPath.toStdString(), nullptr, BreakPad_MinidumpCallback, nullptr, true, nullptr);
 }

+ 2 - 2
src/display/DisplayComponent.cpp

@@ -22,10 +22,10 @@
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 DisplayComponent::DisplayComponent(QObject* parent) : ComponentBase(parent), m_initTimer(this)
 {
-  m_displayManager = NULL;
+  m_displayManager = nullptr;
   m_lastVideoMode = -1;
   m_lastDisplay = -1;
-  m_applicationWindow = NULL;
+  m_applicationWindow = nullptr;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////

+ 1 - 1
src/display/DisplayComponent.h

@@ -46,7 +46,7 @@ public:
   QString debugInformation();
 
 private:
-  DisplayComponent(QObject *parent = 0);
+  DisplayComponent(QObject *parent = nullptr);
   QString displayName(int display);
   QString modePretty(int display, int mode);
 

+ 1 - 4
src/display/DisplayManager.cpp

@@ -84,10 +84,7 @@ bool DisplayManager::isRateMultipleOf(float refresh, float multiple, bool exact)
 
   int roundedRefresh = (int)round(refresh);
   int roundedMultiple = (int)round(multiple);
-  if (((roundedMultiple % roundedRefresh) == 0) && (!exact))
-    return true;
-
-  return false;
+  return ((roundedMultiple % roundedRefresh) == 0) && (!exact);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////

+ 2 - 2
src/display/osx/DisplayManagerOSX.cpp

@@ -42,7 +42,7 @@ bool DisplayManagerOSX::initialize()
     display->name = QString("Display %1").arg(displayid);
     displays[display->id] = display;
 
-    m_osxDisplayModes[displayid] = CGDisplayCopyAllDisplayModes(m_osxDisplays[displayid], NULL);
+    m_osxDisplayModes[displayid] = CGDisplayCopyAllDisplayModes(m_osxDisplays[displayid], nullptr);
     if (!m_osxDisplayModes[displayid])
       continue;
 
@@ -98,7 +98,7 @@ bool DisplayManagerOSX::setDisplayMode(int display, int mode)
   CGDisplayModeRef displayMode =
   (CGDisplayModeRef)CFArrayGetValueAtIndex(m_osxDisplayModes[display], mode);
 
-  CGError err = CGDisplaySetDisplayMode(m_osxDisplays[display], displayMode, NULL);
+  CGError err = CGDisplaySetDisplayMode(m_osxDisplays[display], displayMode, nullptr);
   if (err)
   {
     QLOG_ERROR() << "CGDisplaySetDisplayMode() returned failure:" << err;

+ 2 - 2
src/input/InputCEC.cpp

@@ -52,7 +52,7 @@ InputCEC::InputCEC(QObject *parent) : InputBase(parent)
   m_cecThread = new QThread(this);
   m_cecThread->setObjectName("InputCEC");
 
-  m_cecWorker = new InputCECWorker(NULL);
+  m_cecWorker = new InputCECWorker(nullptr);
   m_cecWorker->moveToThread(m_cecThread);
 
   m_cecThread->start(QThread::LowPriority);
@@ -143,7 +143,7 @@ bool InputCECWorker::openAdapter()
 
   // try to find devices
   cec_adapter_descriptor devices[10];
-  int devicesCount = m_adapter->DetectAdapters(devices, 10, NULL, false);
+  int devicesCount = m_adapter->DetectAdapters(devices, 10, nullptr, false);
   if (devicesCount > 0)
   {
     // list devices

+ 1 - 1
src/input/InputCEC.h

@@ -33,7 +33,7 @@ class InputCECWorker : public QObject
 {
 Q_OBJECT
 public:
-  InputCECWorker(QObject* parent = 0) : QObject(parent), m_adapter(0), m_adapterPort("")
+  InputCECWorker(QObject* parent = nullptr) : QObject(parent), m_adapter(nullptr), m_adapterPort("")
   {
   }
 

+ 1 - 1
src/input/InputComponent.cpp

@@ -196,7 +196,7 @@ void InputComponent::remapInput(const QString &source, const QString &keycode, b
 /////////////////////////////////////////////////////////////////////////////////////////
 void InputComponent::registerHostCommand(const QString& command, QObject* receiver, const char* slot)
 {
-  ReceiverSlot* recvSlot = new ReceiverSlot;
+  auto  recvSlot = new ReceiverSlot;
   recvSlot->receiver = receiver;
   recvSlot->slot = QMetaObject::normalizedSignature(slot);
   recvSlot->hasArguments = false;

+ 3 - 3
src/input/InputComponent.h

@@ -12,7 +12,7 @@ class InputBase : public QObject
 {
   Q_OBJECT
 public:
-  InputBase(QObject* parent = 0) : QObject(parent) { }
+  InputBase(QObject* parent = nullptr) : QObject(parent) { }
   virtual bool initInput() = 0;
   virtual const char* inputName() = 0;
   
@@ -94,8 +94,8 @@ private Q_SLOTS:
   void remapInput(const QString& source, const QString& keycode, bool pressDown = true);
   
 private:
-  InputComponent(QObject *parent = 0);
-  bool addInput(InputBase* input);
+  InputComponent(QObject *parent = nullptr);
+  bool addInput(InputBase* base);
   void handleAction(const QString& action, bool autoRepeat = true);
 
   QHash<QString, ReceiverSlot*> m_hostCommands;

+ 1 - 1
src/input/InputKeyboard.h

@@ -24,7 +24,7 @@ public:
   }
 
 private:
-  explicit InputKeyboard(QObject* parent = 0) : InputBase(parent) {}
+  explicit InputKeyboard(QObject* parent = nullptr) : InputBase(parent) {}
 };
 
 #endif //KONVERGO_INPUTKEYBOARD_H

+ 1 - 1
src/input/InputMapping.cpp

@@ -144,7 +144,7 @@ bool InputMapping::loadMappingDirectory(const QString& path, bool copy)
         {
           // get the input map and add it to a new CachedMatcher
           QVariantMap inputMap = mapping.second.value("mapping").toMap();
-          CachedRegexMatcher* inputMatcher = new CachedRegexMatcher(this);
+          auto  inputMatcher = new CachedRegexMatcher(this);
           foreach(const QString& pattern, inputMap.keys())
             inputMatcher->addMatcher("^" + pattern + "$", inputMap.value(pattern));
 

+ 1 - 1
src/input/InputMapping.h

@@ -14,7 +14,7 @@ class InputMapping : public QObject
   Q_OBJECT
 
 public:
-  explicit InputMapping(QObject *parent = 0);
+  explicit InputMapping(QObject *parent = nullptr);
   bool loadMappings();
   QVariant mapToAction(const QString& source, const QString& keycode);
 

+ 1 - 1
src/input/InputRoku.h

@@ -14,7 +14,7 @@ class InputRoku : public InputBase
   Q_OBJECT
 
 public:
-  explicit InputRoku(QObject* parent = 0) : InputBase(parent) { }
+  explicit InputRoku(QObject* parent = nullptr) : InputBase(parent) { }
   virtual bool initInput() override;
   virtual const char* inputName() override { return "roku"; };
 

+ 2 - 2
src/input/InputSDL.cpp

@@ -89,7 +89,7 @@ void InputSDLWorker::run()
           emit receivedInput(nameForId(event.jbutton.which), QString("KEY_BUTTON_%1").arg(event.jbutton.button));
           
           // set up the repeat timer for this button
-          QElapsedTimer* repeatTimer = new QElapsedTimer();
+          auto  repeatTimer = new QElapsedTimer();
           m_buttonTimestamps[event.jbutton.button] = repeatTimer;
           repeatTimer->start();
           // reset the repeat count for this button
@@ -249,7 +249,7 @@ void InputSDLWorker::refreshJoystickList()
 InputSDL::InputSDL(QObject* parent) : InputBase(parent)
 {
   m_thread = new QThread(this);
-  m_sdlworker = new InputSDLWorker(NULL);
+  m_sdlworker = new InputSDLWorker(nullptr);
   m_sdlworker->moveToThread(m_thread);
 
   connect(this, &InputSDL::run, m_sdlworker, &InputSDLWorker::run);

+ 1 - 1
src/input/InputSocket.h

@@ -12,7 +12,7 @@ class InputSocket : public InputBase
 {
   Q_OBJECT
 public:
-  explicit InputSocket(QObject* parent = 0) : InputBase(parent)
+  explicit InputSocket(QObject* parent = nullptr) : InputBase(parent)
   {
     m_server = new LocalJsonServer("inputSocket");
     connect(m_server, &LocalJsonServer::clientConnected, this, &InputSocket::clientConnected);

+ 1 - 1
src/input/apple/HIDRemote/HIDRemote.m

@@ -54,7 +54,7 @@
 // Callback Prototypes
 static void HIDEventCallback(	void * target, 
 				IOReturn result,
-				void * refcon,
+				void * refCon,
 				void * sender);
 
 static void ServiceMatchingCallback(	void *refCon,

+ 1 - 1
src/input/apple/InputAppleMediaKeys.h

@@ -11,7 +11,7 @@ class InputAppleMediaKeys : public InputBase
 {
   Q_OBJECT
 public:
-  InputAppleMediaKeys(QObject* parent = 0) : InputBase(parent) { }
+  InputAppleMediaKeys(QObject* parent = nullptr) : InputBase(parent) { }
   bool initInput();
   const char* inputName() { return "AppleMediaKeys"; }
 

+ 1 - 1
src/input/apple/InputAppleRemote.h

@@ -16,7 +16,7 @@ typedef void delegate;
 class InputAppleRemote : public InputBase
 {
 public:
-  InputAppleRemote(QObject* parent = 0) : InputBase(parent) { }
+  InputAppleRemote(QObject* parent = nullptr) : InputBase(parent) { }
   virtual const char* inputName() { return "AppleRemote"; }
   virtual bool initInput();
   

+ 2 - 2
src/main.cpp

@@ -194,7 +194,7 @@ int main(int argc, char *argv[])
     {
       Q_UNUSED(url);
 
-      if (object == 0)
+      if (object == nullptr)
         throw FatalException(QObject::tr("Failed to parse application engine script."));
 
       QObject* rootObject = engine->rootObjects().first();
@@ -225,7 +225,7 @@ int main(int argc, char *argv[])
     QLOG_FATAL() << "Unhandled FatalException:" << qPrintable(e.message());
     QApplication errApp(argc, argv);
 
-    ErrorMessage* msg = new ErrorMessage(e.message(), true);
+    auto  msg = new ErrorMessage(e.message(), true);
     msg->show();
 
     errApp.exec();

+ 2 - 2
src/player/PlayerComponent.cpp

@@ -34,7 +34,7 @@ static void wakeup_cb(void *context)
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 PlayerComponent::PlayerComponent(QObject* parent)
-  : ComponentBase(parent), m_lastPositionUpdate(0.0), m_playbackAudioDelay(0), m_playbackStartSent(false), m_window(0), m_mediaFrameRate(0),
+  : ComponentBase(parent), m_lastPositionUpdate(0.0), m_playbackAudioDelay(0), m_playbackStartSent(false), m_window(nullptr), m_mediaFrameRate(0),
   m_restoreDisplayTimer(this), m_reloadAudioTimer(this),
   m_streamSwitchImminent(false)
 {
@@ -60,7 +60,7 @@ void PlayerComponent::componentPostInitialize()
 PlayerComponent::~PlayerComponent()
 {
   if (m_mpv)
-    mpv_set_wakeup_callback(m_mpv, NULL, NULL);
+    mpv_set_wakeup_callback(m_mpv, nullptr, nullptr);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////

+ 2 - 2
src/player/PlayerComponent.h

@@ -28,7 +28,7 @@ public:
   virtual bool componentInitialize();
   virtual void componentPostInitialize();
   
-  explicit PlayerComponent(QObject* parent = 0);
+  explicit PlayerComponent(QObject* parent = nullptr);
   virtual ~PlayerComponent();
 
   // Deprecated. Corresponds to stop() + queueMedia().
@@ -47,7 +47,7 @@ public:
   // If you want to wipe everything, use stop().
   Q_INVOKABLE void clearQueue();
 
-  Q_INVOKABLE virtual void seekTo(qint64 milliseconds);
+  Q_INVOKABLE virtual void seekTo(qint64 ms);
 
   // Stop playback and clear all queued items.
   Q_INVOKABLE virtual void stop();

+ 8 - 8
src/player/PlayerQuickItem.cpp

@@ -93,7 +93,7 @@ static void* __stdcall MPGetNativeDisplay(const char* name)
 // Unsupported or not needed. Also, not using Windows-specific calling convention.
 static void* MPGetNativeDisplay(const char* name)
 {
-  return NULL;
+  return nullptr;
 }
 #endif
 
@@ -104,7 +104,7 @@ static void* get_proc_address(void* ctx, const char* name)
 
   QOpenGLContext* glctx = QOpenGLContext::currentContext();
   if (!glctx)
-    return NULL;
+    return nullptr;
 
   void *res = (void *)glctx->getProcAddress(QByteArray(name));
   if (strcmp(name, "glMPGetNativeDisplay") == 0)
@@ -153,7 +153,7 @@ private:
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 PlayerRenderer::PlayerRenderer(mpv::qt::Handle mpv, QQuickWindow* window)
-: m_mpv(mpv), m_mpvGL(0), m_window(window), m_size(), m_hAvrtHandle(0)
+: m_mpv(mpv), m_mpvGL(nullptr), m_window(window), m_size(), m_hAvrtHandle(nullptr)
 {
   m_mpvGL = (mpv_opengl_cb_context *)mpv_get_sub_api(m_mpv, MPV_SUB_API_OPENGL_CB);
 }
@@ -170,7 +170,7 @@ bool PlayerRenderer::init()
 
   // Signals presence of MPGetNativeDisplay().
   const char *extensions = "GL_MP_MPGetNativeDisplay";
-  return mpv_opengl_cb_init_gl(m_mpvGL, extensions, get_proc_address, NULL) >= 0;
+  return mpv_opengl_cb_init_gl(m_mpvGL, extensions, get_proc_address, nullptr) >= 0;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -236,7 +236,7 @@ void PlayerRenderer::on_update(void *ctx)
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 PlayerQuickItem::PlayerQuickItem(QQuickItem* parent)
-: QQuickItem(parent), m_mpvGL(NULL), m_renderer(NULL)
+: QQuickItem(parent), m_mpvGL(nullptr), m_renderer(nullptr)
 {
   connect(this, &QQuickItem::windowChanged, this, &PlayerQuickItem::onWindowChanged, Qt::DirectConnection);
   connect(this, &PlayerQuickItem::onFatalError, this, &PlayerQuickItem::onHandleFatalError, Qt::QueuedConnection);
@@ -246,7 +246,7 @@ PlayerQuickItem::PlayerQuickItem(QQuickItem* parent)
 PlayerQuickItem::~PlayerQuickItem()
 {
   if (m_mpvGL)
-    mpv_opengl_cb_set_update_callback(m_mpvGL, NULL, NULL);
+    mpv_opengl_cb_set_update_callback(m_mpvGL, nullptr, nullptr);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -274,7 +274,7 @@ void PlayerQuickItem::onSynchronize()
     if (!m_renderer->init())
     {
       delete m_renderer;
-      m_renderer = NULL;
+      m_renderer = nullptr;
       emit onFatalError(tr("Could not initialize OpenGL."));
       return;
     }
@@ -308,7 +308,7 @@ void PlayerQuickItem::onInvalidate()
 {
   if (m_renderer)
     delete m_renderer;
-  m_renderer = NULL;
+  m_renderer = nullptr;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////

+ 1 - 1
src/player/PlayerQuickItem.h

@@ -45,7 +45,7 @@ class PlayerQuickItem : public QQuickItem
     friend class PlayerRenderer;
 
 public:
-    PlayerQuickItem(QQuickItem* parent = 0);
+    PlayerQuickItem(QQuickItem* parent = nullptr);
     virtual ~PlayerQuickItem();
     void initMpv(PlayerComponent* player);
     QString debugInfo() { return m_debugInfo; }

+ 1 - 1
src/power/PowerComponent.h

@@ -10,7 +10,7 @@ class PowerComponent : public ComponentBase
 public:
   static PowerComponent& Get();
 
-  PowerComponent(QObject* parent = 0)
+  PowerComponent(QObject* parent = nullptr)
   : ComponentBase(parent),
     m_currentScreensaverEnabled(true),
     m_fullscreenState(false),

+ 1 - 1
src/power/PowerComponentMac.h

@@ -7,7 +7,7 @@
 class PowerComponentMac : public PowerComponent
 {
 public:
-  PowerComponentMac() : PowerComponent(0), m_assertion(0) { }
+  PowerComponentMac() : PowerComponent(nullptr), m_assertion(0) { }
   virtual void doDisableScreensaver();
   virtual void doEnableScreensaver();
 

+ 1 - 1
src/remote/GDMManager.h

@@ -11,7 +11,7 @@ class GDMManager : public QObject
 {
   Q_OBJECT
 public:
-  explicit GDMManager(QObject *parent = 0);
+  explicit GDMManager(QObject *parent = nullptr);
   ~GDMManager() { stopAnnouncing(); }
   void startAnnouncing();
   void stopAnnouncing();

+ 12 - 12
src/remote/RemoteComponent.cpp

@@ -221,7 +221,7 @@ void RemoteComponent::handleCommand(QHttpRequest* request, QHttpResponse* respon
   }
   else if ((request->url().path() == "/player/timeline/poll"))
   {
-    if (m_subscriberMap.contains(identifier) == false)
+    if (!m_subscriberMap.contains(identifier))
       handleSubscription(request, response, true);
 
     RemotePollSubscriber *subscriber = (RemotePollSubscriber *)m_subscriberMap[identifier];
@@ -243,7 +243,7 @@ void RemoteComponent::handleCommand(QHttpRequest* request, QHttpResponse* respon
 
 
   // handle commandID
-  if (headerMap.contains("x-plex-client-identifier") == false || queryMap.contains("commandID") == false)
+  if (!headerMap.contains("x-plex-client-identifier") || !queryMap.contains("commandID"))
   {
     QLOG_WARN() << "Can't find a X-Plex-Client-Identifier header";
     response->setStatusCode(qhttp::ESTATUS_NOT_ACCEPTABLE);
@@ -262,7 +262,7 @@ void RemoteComponent::handleCommand(QHttpRequest* request, QHttpResponse* respon
 
   {
     QMutexLocker lk(&m_subscriberLock);
-    if (m_subscriberMap.contains(identifier) == false)
+    if (!m_subscriberMap.contains(identifier))
     {
       QLOG_WARN() << "Failed to lock up subscriber" << identifier;
       response->setStatusCode(qhttp::ESTATUS_NOT_ACCEPTABLE);
@@ -312,8 +312,8 @@ void RemoteComponent::responseDone()
 void RemoteComponent::commandResponse(const QVariantMap& responseArguments)
 {
   // check for minimum requirements in the responseArguments
-  if (responseArguments.contains("commandID") == false ||
-      responseArguments.contains("responseCode") == false)
+  if (!responseArguments.contains("commandID") ||
+      !responseArguments.contains("responseCode"))
   {
     QLOG_WARN() << "responseArguments did not contain a commandId or responseCode";
     return;
@@ -323,7 +323,7 @@ void RemoteComponent::commandResponse(const QVariantMap& responseArguments)
   uint responseCode = responseArguments["responseCode"].toUInt();
 
   QMutexLocker lk(&m_responseLock);
-  if (m_responseMap.contains(commandId) == false)
+  if (!m_responseMap.contains(commandId))
   {
     QLOG_WARN() << "Could not find responseId:" << commandId << " - maybe it was removed because of a timeout?";
     return;
@@ -358,8 +358,8 @@ void RemoteComponent::handleSubscription(QHttpRequest* request, QHttpResponse* r
   QVariantMap headers = HeaderToMap(request->headers());
 
   // check for required headers
-  if (headers.contains("x-plex-client-identifier") == false ||
-      headers.contains("x-plex-device-name") == false)
+  if (!headers.contains("x-plex-client-identifier") ||
+      !headers.contains("x-plex-device-name"))
   {
     QLOG_ERROR() << "Missing X-Plex headers in /timeline/subscribe request";
     response->setStatusCode(qhttp::ESTATUS_BAD_REQUEST);
@@ -370,7 +370,7 @@ void RemoteComponent::handleSubscription(QHttpRequest* request, QHttpResponse* r
   // check for required arguments
   QVariantMap query = QueryToMap(request->url());
 
-  if (query.contains("commandID") == false || ((query.contains("port") == false) && !poll))
+  if (!query.contains("commandID") || ((!query.contains("port")) && !poll))
   {
     QLOG_ERROR() << "Missing arguments to /timeline/subscribe request";
     response->setStatusCode(qhttp::ESTATUS_BAD_REQUEST);
@@ -381,7 +381,7 @@ void RemoteComponent::handleSubscription(QHttpRequest* request, QHttpResponse* r
   QString clientIdentifier(request->headers()["x-plex-client-identifier"]);
 
   QMutexLocker lk(&m_subscriberLock);
-  RemoteSubscriber* subscriber = 0;
+  RemoteSubscriber* subscriber = nullptr;
 
   if (m_subscriberMap.contains(clientIdentifier))
   {
@@ -482,7 +482,7 @@ void RemoteComponent::timelineFinished(QNetworkReply* reply)
     return;
 
   QMutexLocker lk(&m_subscriberLock);
-  if (m_subscriberMap.contains(identifier) == false)
+  if (!m_subscriberMap.contains(identifier))
   {
     QLOG_WARN() << "Got a networkreply with a identifier we don't know about:" << identifier;
     return;
@@ -498,7 +498,7 @@ void RemoteComponent::timelineFinished(QNetworkReply* reply)
 void RemoteComponent::subscriberRemove(const QString& identifier)
 {
   QMutexLocker lk(&m_subscriberLock);
-  if (m_subscriberMap.contains(identifier) == false)
+  if (!m_subscriberMap.contains(identifier))
   {
     QLOG_ERROR() << "Can't remove client:" << identifier << "since we don't know about it.";
     return;

+ 1 - 1
src/remote/RemoteComponent.h

@@ -55,7 +55,7 @@ private Q_SLOTS:
   void responseDone();
 
 private:
-  RemoteComponent(QObject* parent = 0);
+  RemoteComponent(QObject* parent = nullptr);
   void handleSubscription(QHttpRequest * request, QHttpResponse * response, bool poll=false);
   void subscribeToWeb(bool subscribe);
 

+ 3 - 3
src/remote/RemoteSubscriber.cpp

@@ -92,7 +92,7 @@ void RemoteSubscriber::queueTimeline(quint64 playerCommandID, const QByteArray&
   QMutexLocker lk(&m_timelineLock);
 
   QDomDocument doc;
-  if (doc.setContent(timelineData) && doc.firstChildElement("MediaContainer").isNull() == false)
+  if (doc.setContent(timelineData) && !doc.firstChildElement("MediaContainer").isNull())
   {
     QDomElement node = doc.firstChildElement("MediaContainer");
     node.setAttribute("commandID", commandId(playerCommandID));
@@ -193,12 +193,12 @@ void RemotePollSubscriber::sendUpdate()
     m_response->write(getTimeline());
 
     m_response->end();
-    m_response = NULL;
+    m_response = nullptr;
   }
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
 void RemotePollSubscriber::responseDone()
 {
-  m_response = NULL;
+  m_response = nullptr;
 }

+ 2 - 2
src/remote/RemoteSubscriber.h

@@ -18,7 +18,7 @@
 class RemoteSubscriber : public QObject
 {
 public:
-  RemoteSubscriber(const QString& clientIdentifier, const QString& deviceName, const QUrl& address, QObject* parent = 0);
+  RemoteSubscriber(const QString& clientIdentifier, const QString& deviceName, const QUrl& address, QObject* parent = nullptr);
   void reSubscribe();
   int lastSubscribe() const { return m_subscribeTime.elapsed(); }
 
@@ -73,7 +73,7 @@ protected:
 class RemotePollSubscriber : public RemoteSubscriber
 {
 public:
-  RemotePollSubscriber(const QString& clientIdentifier, const QString& deviceName, qhttp::server::QHttpResponse *response, QObject* parent = 0);
+  RemotePollSubscriber(const QString& clientIdentifier, const QString& deviceName, qhttp::server::QHttpResponse *response, QObject* parent = nullptr);
   void setHTTPResponse(qhttp::server::QHttpResponse *response);
   virtual void sendUpdate();
 

+ 1 - 1
src/settings/AudioSettingsController.h

@@ -11,7 +11,7 @@ class AudioSettingsController : public QObject
 {
   Q_OBJECT
 public:
-  AudioSettingsController(QObject* parent = 0);
+  AudioSettingsController(QObject* parent = nullptr);
   Q_SLOT void valuesUpdated(const QVariantMap& values);
   Q_SIGNAL void settingsUpdated(const QString& section, const QVariant& description);
 

+ 2 - 2
src/settings/SettingsComponent.cpp

@@ -383,7 +383,7 @@ void SettingsComponent::parseSection(const QJsonObject& sectionObject)
 
   int platformMask = platformMaskFromObject(sectionObject);
 
-  SettingsSection* section = new SettingsSection(sectionName, (quint8)platformMask, m_sectionIndex ++, this);
+  auto  section = new SettingsSection(sectionName, (quint8)platformMask, m_sectionIndex ++, this);
   section->setHidden(sectionObject.value("hidden").toBool(false));
   section->setStorage(sectionObject.value("storage").toBool(false));
 
@@ -537,7 +537,7 @@ bool SettingsComponent::componentInitialize()
   // then run the signal the first time to make sure that we set the proper visibility
   // on the items from the start.
   //
-  AudioSettingsController* ctrl = new AudioSettingsController(this);
+  auto  ctrl = new AudioSettingsController(this);
   QVariantMap val;
   val.insert("devicetype", value(SETTINGS_SECTION_AUDIO, "devicetype"));
   val.insert("advanced", value(SETTINGS_SECTION_AUDIO, "advanced"));

+ 1 - 1
src/settings/SettingsComponent.h

@@ -75,7 +75,7 @@ public:
   static bool resetAndSaveOldConfiguration();
 
 private:
-  explicit SettingsComponent(QObject *parent = 0);
+  explicit SettingsComponent(QObject *parent = nullptr);
   bool loadDescription();
   void parseSection(const QJsonObject& sectionObject);
   int platformMaskFromObject(const QJsonObject& object);

+ 1 - 1
src/settings/SettingsSection.h

@@ -13,7 +13,7 @@ class SettingsSection : public QObject
   Q_OBJECT
 public:
   explicit SettingsSection(const QString& sectionID, quint8 platforms = PLATFORM_ANY,
-                           int _orderIndex = -1, QObject* parent = 0);
+                           int _orderIndex = -1, QObject* parent = nullptr);
 
   void updatePossibleValues(const QString& key, const QVariantList& possibleValues);
 

+ 2 - 2
src/settings/SettingsValue.h

@@ -13,13 +13,13 @@ class SettingsValue : public QObject
   Q_OBJECT
 
 public:
-  SettingsValue(QObject* parent = 0)
+  SettingsValue(QObject* parent = nullptr)
     : QObject(parent)
     , m_platform(PLATFORM_UNKNOWN)
     , m_hidden(true)
   {}
 
-  SettingsValue(const QString& _key, QVariant _defaultValue=QVariant(), quint8 platforms = PLATFORM_ANY, QObject* parent = 0)
+  SettingsValue(const QString& _key, QVariant _defaultValue=QVariant(), quint8 platforms = PLATFORM_ANY, QObject* parent = nullptr)
     : QObject(parent)
     , m_key(_key)
     , m_value(QVariant())

+ 1 - 1
src/shared/LocalJsonClient.h

@@ -11,7 +11,7 @@ class LocalJsonClient : public QLocalSocket
 {
   Q_OBJECT
 public:
-  explicit LocalJsonClient(const QString serverPath, QObject* parent = 0);
+  explicit LocalJsonClient(const QString serverPath, QObject* parent = nullptr);
   void connectToServer();
   bool sendMessage(const QVariantMap& message);
 

+ 1 - 1
src/shared/LocalJsonServer.h

@@ -14,7 +14,7 @@ class LocalJsonServer : public QObject
 {
   Q_OBJECT
 public:
-  explicit LocalJsonServer(const QString& serverName, QObject* parent = 0);
+  explicit LocalJsonServer(const QString& serverName, QObject* parent = nullptr);
 
   bool listen();
   static bool sendMessage(const QVariantMap& message, QLocalSocket* socket);

+ 1 - 1
src/shared/UniqueApplication.h

@@ -17,7 +17,7 @@ class UniqueApplication : public QObject
 {
   Q_OBJECT
 public:
-  UniqueApplication(QObject* parent = 0, const QString& socketname = SOCKET_NAME) : QObject(parent)
+  UniqueApplication(QObject* parent = nullptr, const QString& socketname = SOCKET_NAME) : QObject(parent)
   {
     m_socketName = socketname;
   }

+ 1 - 1
src/system/OEUpdateManager.h

@@ -6,7 +6,7 @@
 class OEUpdateManager : public UpdateManager
 {
 public:
-  OEUpdateManager(QObject *parent = 0) {};
+  OEUpdateManager(QObject *parent = nullptr) {};
   ~OEUpdateManager() {};
 
   virtual QString HaveUpdate();

+ 1 - 1
src/system/SystemComponent.cpp

@@ -77,7 +77,7 @@ bool SystemComponent::componentInitialize()
 /////////////////////////////////////////////////////////////////////////////////////////
 void SystemComponent::crashApp()
 {
-  *(volatile int*)0=0;
+  *(volatile int*)nullptr=0;
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////

+ 1 - 1
src/system/SystemComponent.h

@@ -76,7 +76,7 @@ signals:
   void scaleChanged(qreal scale);
 
 private:
-  SystemComponent(QObject* parent = 0);
+  SystemComponent(QObject* parent = nullptr);
   static QMap<QString, QString> networkInterfaces();
 
   QTimer* m_mouseOutTimer;

+ 1 - 1
src/system/UpdateManager.cpp

@@ -142,7 +142,7 @@ bool UpdateManager::applyUpdate(const QString& version)
   QFile::remove(GetPath("_readyToApply", version, false));
 
   QLOG_DEBUG() << "Executing:" << updaterPath << args;
-  QProcess* process = new QProcess(NULL);
+  auto  process = new QProcess(nullptr);
   if (process->startDetached(updaterPath, args, QDir::temp().absolutePath()))
   {
     QLOG_DEBUG() << "Updater running, shutting down Plex Media Player";

+ 1 - 1
src/system/UpdateManager.h

@@ -9,7 +9,7 @@ class UpdateManager : public QObject
 public:
   static bool CheckForUpdates();
 
-  explicit UpdateManager(QObject *parent = 0) {};
+  explicit UpdateManager(QObject *parent = nullptr) {};
   ~UpdateManager() {};
 
   static UpdateManager* Get();

+ 1 - 1
src/system/UpdateManagerWin32.h

@@ -10,7 +10,7 @@
 class UpdateManagerWin32 : public UpdateManager
 {
 public:
-  UpdateManagerWin32(QObject *parent = 0) {};
+  UpdateManagerWin32(QObject *parent = nullptr) {};
   ~UpdateManagerWin32() {};
 
   virtual bool applyUpdate(const QString& version) override;

+ 7 - 10
src/system/UpdaterComponent.cpp

@@ -21,8 +21,8 @@
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 UpdaterComponent::UpdaterComponent(QObject *parent) : ComponentBase(parent), m_netManager(this)
 {
-  m_file = NULL;
-  m_manifest = NULL;
+  m_file = nullptr;
+  m_manifest = nullptr;
 
   connect(&m_netManager, &QNetworkAccessManager::finished,
           this, &UpdaterComponent::dlComplete);
@@ -104,8 +104,8 @@ bool UpdaterComponent::fileComplete(Update* update)
     delete m_file;
     delete m_manifest;
 
-    m_file = NULL;
-    m_manifest = NULL;
+    m_file = nullptr;
+    m_manifest = nullptr;
 
     return true;
   }
@@ -167,7 +167,7 @@ void UpdaterComponent::downloadUpdate(const QVariantMap& updateInfo)
 
   // this will first check if the files are done
   // and in that case emit the done signal.
-  if (fileComplete(NULL))
+  if (fileComplete(nullptr))
     return;
 
   if (!m_manifest->isReady() && m_hasManifest)
@@ -180,11 +180,8 @@ void UpdaterComponent::downloadUpdate(const QVariantMap& updateInfo)
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 bool UpdaterComponent::isDownloading()
 {
-  if ((m_manifest && m_manifest->m_reply && m_manifest->m_reply->isRunning()) ||
-      (m_file && m_file->m_reply && m_file->m_reply->isRunning()))
-    return true;
-
-  return false;
+  return (m_manifest && m_manifest->m_reply && m_manifest->m_reply->isRunning()) ||
+      (m_file && m_file->m_reply && m_file->m_reply->isRunning());
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////

+ 9 - 9
src/system/UpdaterComponent.h

@@ -20,12 +20,12 @@ class Update : public QObject
   Q_OBJECT
 public:
   Update(const QString& url = "", const QString& localPath = "",
-         const QString& hash = "", QObject* parent = NULL) : QObject(parent)
+         const QString& hash = "", QObject* parent = nullptr) : QObject(parent)
   {
     m_url = url;
     m_localPath = localPath;
     m_hash = hash;
-    m_reply = NULL;
+    m_reply = nullptr;
     m_openFile = new QFile(m_localPath);
   }
 
@@ -34,14 +34,14 @@ public:
   {
     if (m_reply)
     {
-      disconnect(m_reply, 0, 0, 0);
+      disconnect(m_reply, nullptr, nullptr, nullptr);
       m_reply->deleteLater();
-      m_reply = NULL;
+      m_reply = nullptr;
       m_openFile->close();
     }
 
     m_reply = reply;
-    m_timeStarted = time(NULL);
+    m_timeStarted = time(nullptr);
 
     connect(m_reply, &QNetworkReply::readyRead, this, &Update::write);
     connect(m_reply, &QNetworkReply::finished, this, &Update::finished);
@@ -50,7 +50,7 @@ public:
       return true;
 
     m_reply->deleteLater();
-    m_reply = NULL;
+    m_reply = nullptr;
 
     return false;
   }
@@ -67,9 +67,9 @@ public:
   {
     m_openFile->close();
     m_reply->deleteLater();
-    m_reply = NULL;
+    m_reply = nullptr;
 
-    QLOG_DEBUG() << "Update downloaded, took:" << time(NULL) - m_timeStarted << "seconds";
+    QLOG_DEBUG() << "Update downloaded, took:" << time(nullptr) - m_timeStarted << "seconds";
 
     emit fileDone(this);
   }
@@ -155,7 +155,7 @@ private slots:
   bool fileComplete(Update *update);
 
 private:
-  explicit UpdaterComponent(QObject *parent = 0);
+  explicit UpdaterComponent(QObject *parent = nullptr);
 
   bool isDownloading();
   void downloadFile(Update *update);

+ 2 - 2
src/tools/helper/HelperMain.cpp

@@ -24,7 +24,7 @@ int main(int argc, char** argv)
   QCoreApplication::setApplicationVersion(Version::GetVersionString());
   QCoreApplication::setOrganizationDomain("plex.tv");
 
-  UniqueApplication uapp(NULL, "pmpHelperUniqueApplication");
+  UniqueApplication uapp(nullptr, "pmpHelperUniqueApplication");
   if (!uapp.ensureUnique())
   {
     fprintf(stderr, "Other helper already running, refusing to start.\n");
@@ -49,7 +49,7 @@ int main(int argc, char** argv)
 
   QLOG_DEBUG() << "Helper (" << Version::GetVersionString() << ") up and running";
 
-  QObject* helperObject = new QObject;
+  auto  helperObject = new QObject;
 
   try
   {

+ 1 - 1
src/tools/helper/HelperSocket.h

@@ -14,7 +14,7 @@ class HelperSocket : public QObject
 {
   Q_OBJECT
 public:
-  HelperSocket(QObject* parent = 0);
+  HelperSocket(QObject* parent = nullptr);
 
 private:
   Q_SLOT void clientConnected(QLocalSocket* socket);

+ 1 - 1
src/ui/EventFilter.h

@@ -12,7 +12,7 @@ class EventFilter : public QObject
 {
   Q_OBJECT
 public:
-  EventFilter(QObject* parent = 0) : QObject(parent) {}
+  EventFilter(QObject* parent = nullptr) : QObject(parent) {}
 
 protected:
   bool eventFilter(QObject* watched, QEvent* event);

+ 1 - 1
src/ui/KonvergoEngine.h

@@ -3,7 +3,7 @@
 
 #include <QQmlApplicationEngine>
 
-static QQmlApplicationEngine* g_qmlEngine = NULL;
+static QQmlApplicationEngine* g_qmlEngine = nullptr;
 
 class KonvergoEngine
 {

+ 1 - 1
src/ui/KonvergoWindow.cpp

@@ -89,7 +89,7 @@ void KonvergoWindow::closingWindow()
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 KonvergoWindow::~KonvergoWindow()
 {
-  DisplayComponent::Get().setApplicationWindow(0);
+  DisplayComponent::Get().setApplicationWindow(nullptr);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////

+ 1 - 1
src/ui/KonvergoWindow.h

@@ -37,7 +37,7 @@ class KonvergoWindow : public QQuickWindow
 public:
   static void RegisterClass();
 
-  KonvergoWindow(QWindow* parent = 0);
+  KonvergoWindow(QWindow* parent = nullptr);
   ~KonvergoWindow();
 
   bool isFullScreen()

+ 1 - 1
src/utils/CachedRegexMatcher.h

@@ -16,7 +16,7 @@ typedef QList<MatcherValuePair> MatcherValueList;
 class CachedRegexMatcher : public QObject
 {
 public:
-  CachedRegexMatcher(QObject* parent = 0) : QObject(parent) {}
+  CachedRegexMatcher(QObject* parent = nullptr) : QObject(parent) {}
 
   bool addMatcher(const QString& pattern, const QVariant& result);
   QVariant match(const QString& input);

+ 1 - 1
src/utils/HelperLaunchd.h

@@ -12,7 +12,7 @@ class HelperLaunchd : public QObject
 {
   Q_OBJECT
 public:
-  HelperLaunchd(QObject* parent = 0);
+  HelperLaunchd(QObject* parent = nullptr);
 
   void start();
   void stop();

+ 1 - 1
src/utils/HelperLauncher.h

@@ -38,7 +38,7 @@ private Q_SLOTS:
   bool killHelper();
 
 private:
-  explicit HelperLauncher(QObject* parent = 0);
+  explicit HelperLauncher(QObject* parent = nullptr);
 
   QProcess* m_helperProcess;
   LocalJsonClient* m_jsonClient;