chore: unsingletonize Resources/Resources2 (#5460)

This commit is contained in:
pajlada 2024-06-16 15:17:07 +02:00 committed by GitHub
parent d053a681a0
commit 85d6ff1e6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 6 deletions

View file

@ -28,6 +28,7 @@
- Dev: Refactor `TwitchIrcServer`, making it abstracted. (#5421, #5435) - Dev: Refactor `TwitchIrcServer`, making it abstracted. (#5421, #5435)
- Dev: Reduced the amount of scale events. (#5404, #5406) - Dev: Reduced the amount of scale events. (#5404, #5406)
- Dev: Removed unused timegate settings. (#5361) - Dev: Removed unused timegate settings. (#5361)
- Dev: Unsingletonize `Resources2`. (#5460)
- Dev: All Lua globals now show in the `c2` global in the LuaLS metadata. (#5385) - Dev: All Lua globals now show in the `c2` global in the LuaLS metadata. (#5385)
- Dev: Images are now loaded in worker threads. (#5431) - Dev: Images are now loaded in worker threads. (#5431)
- Dev: Qt Creator now auto-configures Conan when loading the project and skips vcpkg. (#5305) - Dev: Qt Creator now auto-configures Conan when loading the project and skips vcpkg. (#5305)

View file

@ -3,15 +3,14 @@
** WARNING! All changes made in this file will be lost! ** WARNING! All changes made in this file will be lost!
*****************************************************************************/ *****************************************************************************/
#include <QPixmap> #include <QPixmap>
#include "common/Singleton.hpp"
namespace chatterino { namespace chatterino {
class Resources2 : public Singleton class Resources2
{ {
public: public:
Resources2(); Resources2();
@RES_HEADER_CONTENT@ @RES_HEADER_CONTENT@
}; };
} // namespace chatterino } // namespace chatterino

View file

@ -2,10 +2,15 @@
#include "debug/AssertInGuiThread.hpp" #include "debug/AssertInGuiThread.hpp"
namespace chatterino {
namespace { namespace {
static Resources2 *resources = nullptr;
} using namespace chatterino;
static Resources2 *resources = nullptr;
} // namespace
namespace chatterino {
Resources2 &getResources() Resources2 &getResources()
{ {