remove unnecessary plugin loaders
imageformats plugins are loaded automatically, we just need to check if they were actually loaded
This commit is contained in:
		
							parent
							
								
									8004477d0c
								
							
						
					
					
						commit
						25ef804ae7
					
				
							
								
								
									
										13
									
								
								src/main.cpp
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/main.cpp
									
									
									
									
									
								
							@ -8,8 +8,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <QDebug>
 | 
					#include <QDebug>
 | 
				
			||||||
#include <QDirIterator>
 | 
					#include <QDirIterator>
 | 
				
			||||||
 | 
					#include <QImageReader>
 | 
				
			||||||
#include <QLibraryInfo>
 | 
					#include <QLibraryInfo>
 | 
				
			||||||
#include <QPluginLoader>
 | 
					 | 
				
			||||||
#include <QResource>
 | 
					#include <QResource>
 | 
				
			||||||
#include <QTranslator>
 | 
					#include <QTranslator>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -28,7 +28,6 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  AOApplication::addLibraryPath(AOApplication::applicationDirPath() + "/lib");
 | 
					 | 
				
			||||||
  QResource::registerResource(main_app.get_asset("themes/" + Options::getInstance().theme() + ".rcc"));
 | 
					  QResource::registerResource(main_app.get_asset("themes/" + Options::getInstance().theme() + ".rcc"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QFont main_font = main_app.font();
 | 
					  QFont main_font = main_app.font();
 | 
				
			||||||
@ -46,16 +45,14 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
    fontDatabase.addApplicationFont(it.next());
 | 
					    fontDatabase.addApplicationFont(it.next());
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QPluginLoader apngPlugin("qapng");
 | 
					  if (!QImageReader::supportedImageFormats().contains("apng"))
 | 
				
			||||||
  if (!apngPlugin.load())
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    qCritical() << "QApng plugin could not be loaded";
 | 
					    qCritical() << "QApng plugin could not be loaded. Errors may occur when loading .apng files.";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QPluginLoader webpPlugin("qwebp");
 | 
					  if (!QImageReader::supportedImageFormats().contains("webp"))
 | 
				
			||||||
  if (!webpPlugin.load())
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    qCritical() << "QWebp plugin could not be loaded";
 | 
					    qCritical() << "QWebP plugin could not be loaded. Errors may occur when loading .webp files.";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  QString p_language = Options::getInstance().language();
 | 
					  QString p_language = Options::getInstance().language();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user