Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 4a13db1a rédigé par Kubat's avatar Kubat
Parcourir les fichiers

MISC: The 'new' operator will throw an exception in out-of-memory, don't...

MISC: The 'new' operator will throw an exception in out-of-memory, don't manually check the 'nullptr' as it will never be true
parent 06337b89
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!15Video playback with mpv
...@@ -37,9 +37,7 @@ AudioVisualizer::AudioVisualizer(AudioContext::StreamPtr stream, QWidget *parent ...@@ -37,9 +37,7 @@ AudioVisualizer::AudioVisualizer(AudioContext::StreamPtr stream, QWidget *parent
RDFTContextPtr ctx(av_rdft_init((static_cast<int>(log2(static_cast<int>(height)))), DFT_R2C), RDFTContextPtr ctx(av_rdft_init((static_cast<int>(log2(static_cast<int>(height)))), DFT_R2C),
rdftContextDeleter); rdftContextDeleter);
if (!pixels) { if (!(chunkData && ctx)) {
throw std::runtime_error("out of memory");
} else if (!(chunkData && ctx)) {
delete[] pixels; delete[] pixels;
throw std::runtime_error("out of memory"); throw std::runtime_error("out of memory");
} }
......
#include "VivyDocumentView.hh" #include "VivyDocumentView.hh"
#include "PropertyModel.hh" #include "PropertyModel.hh"
#include "Utils.hh"
#include "DocumentViews/AudioVisualizer.hh" #include "DocumentViews/AudioVisualizer.hh"
#include "DocumentViews/AssLinesView.hh" #include "DocumentViews/AssLinesView.hh"
#include "DocumentViews/AssLinesModel.hh" #include "DocumentViews/AssLinesModel.hh"
...@@ -86,6 +87,8 @@ VivyDocumentView::loadVideoView() noexcept ...@@ -86,6 +87,8 @@ VivyDocumentView::loadVideoView() noexcept
QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetFloatable |
QDockWidget::DockWidgetClosable); QDockWidget::DockWidgetClosable);
addDockWidget(Qt::BottomDockWidgetArea, videoView, Qt::Vertical); addDockWidget(Qt::BottomDockWidgetArea, videoView, Qt::Vertical);
videoView->setTitleBarWidget(new QWidget(this));
Utils::setTransparentBackgroundForWidget(videoView->titleBarWidget());
} }
// Kubat: because the dock is "closable", when closed the widget itself // Kubat: because the dock is "closable", when closed the widget itself
...@@ -107,6 +110,8 @@ VivyDocumentView::loadAssView() noexcept ...@@ -107,6 +110,8 @@ VivyDocumentView::loadAssView() noexcept
assLines->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | assLines->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea |
Qt::BottomDockWidgetArea); Qt::BottomDockWidgetArea);
addDockWidget(Qt::BottomDockWidgetArea, assLines, Qt::Vertical); addDockWidget(Qt::BottomDockWidgetArea, assLines, Qt::Vertical);
assLines->setTitleBarWidget(new QWidget(this));
Utils::setTransparentBackgroundForWidget(assLines->titleBarWidget());
} }
assModel.reset(new AssLinesModel(document->getAssSubDocument()->getLines())); assModel.reset(new AssLinesModel(document->getAssSubDocument()->getLines()));
...@@ -137,6 +142,8 @@ VivyDocumentView::loadAudioView() noexcept ...@@ -137,6 +142,8 @@ VivyDocumentView::loadAudioView() noexcept
visualizer->setFeatures(QDockWidget::DockWidgetMovable | visualizer->setFeatures(QDockWidget::DockWidgetMovable |
QDockWidget::DockWidgetClosable); QDockWidget::DockWidgetClosable);
addDockWidget(Qt::LeftDockWidgetArea, visualizer, Qt::Horizontal); addDockWidget(Qt::LeftDockWidgetArea, visualizer, Qt::Horizontal);
visualizer->setTitleBarWidget(new QWidget(this));
Utils::setTransparentBackgroundForWidget(visualizer->titleBarWidget());
} }
// Kubat: don't check, may throw an error but don't think we can // Kubat: don't check, may throw an error but don't think we can
...@@ -184,6 +191,8 @@ VivyDocumentView::openProperties() noexcept ...@@ -184,6 +191,8 @@ VivyDocumentView::openProperties() noexcept
property = new QDockWidget("Properties", this); property = new QDockWidget("Properties", this);
property->setAllowedAreas(Qt::AllDockWidgetAreas); property->setAllowedAreas(Qt::AllDockWidgetAreas);
addDockWidget(Qt::RightDockWidgetArea, property, Qt::Vertical); addDockWidget(Qt::RightDockWidgetArea, property, Qt::Vertical);
property->setTitleBarWidget(new QWidget(this));
Utils::setTransparentBackgroundForWidget(property->titleBarWidget());
} }
property->setWidget(view); property->setWidget(view);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter