From 7f5b292b12975f58ced1e445a41c4b21a350ab9b Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 17 Mar 2021 08:53:21 +1100 Subject: Remove DynamicLibrary as loading lexers with SCI_LOADLEXERLIBRARY was removed for Scintilla 5. --- qt/ScintillaEditBase/PlatQt.cpp | 44 ----------------------------------------- 1 file changed, 44 deletions(-) (limited to 'qt/ScintillaEditBase/PlatQt.cpp') diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 72f2b8d5f..d41dbfbf3 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -1134,50 +1134,6 @@ void Menu::Show(Point pt, Window & /*w*/) //---------------------------------------------------------------------- -class DynamicLibraryImpl : public DynamicLibrary { -protected: - QLibrary *lib; -public: - explicit DynamicLibraryImpl(const char *modulePath) { - QString path = QString::fromUtf8(modulePath); - lib = new QLibrary(path); - } - // Deleted so DynamicLibraryImpl objects can not be copied - DynamicLibraryImpl(const DynamicLibraryImpl &) = delete; - DynamicLibraryImpl(DynamicLibraryImpl &&) = delete; - DynamicLibraryImpl &operator=(const DynamicLibraryImpl &) = delete; - DynamicLibraryImpl &operator=(DynamicLibraryImpl &&) = delete; - - virtual ~DynamicLibraryImpl() { - if (lib) - lib->unload(); - lib = nullptr; - } - Function FindFunction(const char *name) override { - if (lib) { - // Use memcpy as it doesn't invoke undefined or conditionally defined behaviour. -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) - QFunctionPointer fp {}; -#else - void *fp = nullptr; -#endif - fp = lib->resolve(name); - Function f = nullptr; - static_assert(sizeof(f) == sizeof(fp)); - memcpy(&f, &fp, sizeof(f)); - return f; - } - return nullptr; - } - bool IsValid() override { - return lib != nullptr; - } -}; -DynamicLibrary *DynamicLibrary::Load(const char *modulePath) -{ - return static_cast(new DynamicLibraryImpl(modulePath)); -} - ColourDesired Platform::Chrome() { QColor c(Qt::gray); -- cgit v1.2.3