Browse Source

Fix some minor issues when turning on more checks in clang-tidy

Tobias Hieta 8 years ago
parent
commit
628daf9866

+ 5 - 0
src/input/apple/InputAppleMediaKeys.mm

@@ -30,6 +30,11 @@
   return self;
 }
 
+- (void)dealloc
+{
+  [super dealloc];
+}
+
 -(void)mediaKeyTap:(SPMediaKeyTap *)keyTap receivedMediaKeyEvent:(NSEvent *)event
 {
   int keyCode = (([event data1] & 0xFFFF0000) >> 16);

+ 0 - 2
src/power/PowerComponent.cpp

@@ -43,8 +43,6 @@ PowerComponent& PowerComponent::Get()
 bool PowerComponent::componentInitialize()
 {
   PlayerComponent* player = &PlayerComponent::Get();
-  if (!player)
-    return false;
 
   connect(player, &PlayerComponent::playing, this, &PowerComponent::playbackStarted);
   connect(player, &PlayerComponent::playbackEnded, this, &PowerComponent::playbackEnded);

+ 1 - 1
src/tools/helper/CrashUploader.cpp

@@ -82,7 +82,7 @@ void CrashUploader::uploadCrashDump(const QString& version, const QString& path)
   QNetworkRequest req(QUrl(UPLOAD_URL));
   req.setRawHeader("X-Plex-Secret", CRASHDUMP_SECRET);
 
-  QHttpMultiPart* multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType);
+  auto multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType);
 
   addFormField(multiPart, "version", version);
   addFormField(multiPart, "product", "plexmediaplayer");

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

@@ -49,7 +49,7 @@ int main(int argc, char** argv)
 
   QLOG_DEBUG() << "Helper (" << Version::GetVersionString() << ") up and running";
 
-  auto  helperObject = new QObject;
+  auto helperObject = new QObject;
 
   try
   {
@@ -68,4 +68,4 @@ int main(int argc, char** argv)
   delete helperObject;
 
   return EXIT_SUCCESS;
-}
+}

+ 12 - 9
src/ui/KonvergoWindow.cpp

@@ -45,8 +45,8 @@ KonvergoWindow::KonvergoWindow(QWindow* parent) : QQuickWindow(parent), m_debugL
   setColor(QColor("#111111"));
 #endif
 
-  loadGeometry();
-  notifyScale(size());
+  QRect loadedGeo = loadGeometry();
+  notifyScale(loadedGeo.size());
 
   connect(SettingsComponent::Get().getSection(SETTINGS_SECTION_MAIN), &SettingsSection::valuesUpdated,
           this, &KonvergoWindow::updateMainSectionSettings);
@@ -122,13 +122,15 @@ void KonvergoWindow::saveGeometry()
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-void KonvergoWindow::loadGeometry()
+QRect KonvergoWindow::loadGeometry()
 {
   QRect rc = loadGeometryRect();
   QScreen* myScreen = loadLastScreen();
   if (!myScreen)
     myScreen = screen();
 
+  QRect nsize = rc;
+
   if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "fullscreen").toBool())
   {
     QLOG_DEBUG() << "Load FullScreen geo...";
@@ -139,19 +141,20 @@ void KonvergoWindow::loadGeometry()
     // resolution for the screen (i.e. fullscreen) otherwise it will
     // just scale the webcontent to the minimum size we have defined
     //
-#ifdef Q_OS_MAC
-    setGeometry(rc);
-#else
-    setGeometry(myScreen->geometry());
+#ifndef Q_OS_MAC
+    nsize = myScreen->geometry();
 #endif
+    setGeometry(nsize);
     
     setScreen(myScreen);
   }
   else
   {
-    setGeometry(rc);
+    setGeometry(nsize);
     saveGeometry();
   }
+
+  return nsize;
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -389,7 +392,7 @@ qreal KonvergoWindow::CalculateScale(const QSize& size)
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
-qreal KonvergoWindow::CalculateWebScale(const QSize& size, qint32 devicePixelRatio)
+qreal KonvergoWindow::CalculateWebScale(const QSize& size, qreal devicePixelRatio)
 {
   qreal horizontalScale = (qreal)size.width() / (qreal)WEBUI_SIZE.width();
   qreal verticalScale = (qreal)size.height() / (qreal)WEBUI_SIZE.height();

+ 2 - 2
src/ui/KonvergoWindow.h

@@ -71,7 +71,7 @@ public:
   QSize webUISize() { return WEBUI_SIZE; }
   QSize windowMinSize() { return WINDOWW_MIN_SIZE; }
   static qreal CalculateScale(const QSize& size);
-  static qreal CalculateWebScale(const QSize& size, qint32 devicePixelRatio);
+  static qreal CalculateWebScale(const QSize& size, qreal devicePixelRatio);
 
 Q_SIGNALS:
   void fullScreenSwitched();
@@ -99,7 +99,7 @@ private slots:
 private:
   void notifyScale(const QSize& size);
   void saveGeometry();
-  void loadGeometry();
+  QRect loadGeometry();
   QRect loadGeometryRect();
   bool fitsInScreens(const QRect& rc);
   QScreen* loadLastScreen();