diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-12-04 19:32:11 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-12-04 19:32:11 +0100 |
| commit | 8b02a5a7965440b883e9601ece0e30bca1169a65 (patch) | |
| tree | 89ec90646a82c46928d722a5ebd379476307bc5a /src/previewgenerator.cpp | |
| parent | a1ab717e9e4fd72071cd01d9ceb74e7ba10ffafd (diff) | |
Fix crash when starting MO2 without instance.
Diffstat (limited to 'src/previewgenerator.cpp')
| -rw-r--r-- | src/previewgenerator.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/previewgenerator.cpp b/src/previewgenerator.cpp index 904d679f..22332af3 100644 --- a/src/previewgenerator.cpp +++ b/src/previewgenerator.cpp @@ -29,14 +29,14 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. using namespace MOBase;
-PreviewGenerator::PreviewGenerator(const PluginContainer* pluginContainer) :
+PreviewGenerator::PreviewGenerator(const PluginContainer& pluginContainer) :
m_PluginContainer(pluginContainer) {
m_MaxSize = QGuiApplication::primaryScreen()->size() * 0.8;
}
bool PreviewGenerator::previewSupported(const QString &fileExtension) const
{
- auto& previews = m_PluginContainer->plugins<IPluginPreview>();
+ auto& previews = m_PluginContainer.plugins<IPluginPreview>();
for (auto* preview : previews) {
if (preview->supportedExtensions().contains(fileExtension)) {
return true;
@@ -48,9 +48,9 @@ bool PreviewGenerator::previewSupported(const QString &fileExtension) const QWidget *PreviewGenerator::genPreview(const QString &fileName) const
{
const QString ext = QFileInfo(fileName).suffix().toLower();
- auto& previews = m_PluginContainer->plugins<IPluginPreview>();
+ auto& previews = m_PluginContainer.plugins<IPluginPreview>();
for (auto* preview : previews) {
- if (m_PluginContainer->isEnabled(preview) && preview->supportedExtensions().contains(ext)) {
+ if (m_PluginContainer.isEnabled(preview) && preview->supportedExtensions().contains(ext)) {
return preview->genFilePreview(fileName, m_MaxSize);
}
}
|
