PIPluginLoader +1 error

This commit is contained in:
2022-04-30 16:07:30 +03:00
parent 2bbdbc3ac9
commit 8d5730f715
3 changed files with 10 additions and 2 deletions

View File

@@ -60,7 +60,7 @@ public:
//! \~english Read-only access to character by `index`.
//! \~russian Доступ на чтение к символу по индексу `index`.
inline const char & operator [](size_t index) const {return str[index];}
inline char operator [](size_t index) const {return str[index];}
//! \~english Read-only access to character by `index`.
//! \~russian Доступ на чтение к символу по индексу `index`.

View File

@@ -342,7 +342,14 @@ bool PIPluginLoader::load(const PIString & name) {
unload();
PIPluginInfo * ai = PIPluginInfoStorage::instance()->applicationInfo();
PIPluginInfo * pi = PIPluginInfoStorage::instance()->enterPlugin(this);
if (!lib.load(findLibrary(name))) {
PIString fname = findLibrary(name);
if (fname.isEmpty()) {
error = NoSuchFile;
error_str = "Load plugin \"" + lib.path() + "\" error: can`t find lib for \"" + name + "\"";
if (messages) piCout << error_str;
return false;
}
if (!lib.load(fname)) {
unload();
error = LibraryLoadError;
error_str = "Load plugin \"" + lib.path() + "\" error: can`t load lib: " + lib.lastError();

View File

@@ -166,6 +166,7 @@ public:
enum Error {
Unknown /** \~english No \a load() call yet \~russian Не было вызова \a load() */ ,
NoError /** \~english No error \~russian Нет ошибки */ ,
NoSuchFile /** \~english Can`t find library file \~russian Не найден файл библиотеки */ ,
LibraryLoadError /** \~english System can`t load library \~russian Система не смогла загрузить библиотеку */ ,
MissingSymbols /** \~english Can`t find necessary symbols \~russian Нет необходимых методов */ ,
InvalidLoaderVersion /** \~english Internal version mismatch \~russian Неверная внутренняя версия */ ,