summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5cbfa72a..fb88bbad 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -967,13 +967,17 @@ bool MainWindow::registerPlugin(QObject *plugin)
if (verifyPlugin(proxy)) {
QStringList pluginNames = proxy->pluginList(QCoreApplication::applicationDirPath() + "/" + ToQString(AppConfig::pluginPath()));
foreach (const QString &pluginName, pluginNames) {
- QObject *proxiedPlugin = proxy->instantiate(pluginName);
- if (proxiedPlugin != NULL) {
- if (registerPlugin(proxiedPlugin)) {
- qDebug("loaded plugin \"%s\"", pluginName.toUtf8().constData());
- } else {
- qWarning("plugin \"%s\" failed to load", pluginName.toUtf8().constData());
+ try {
+ QObject *proxiedPlugin = proxy->instantiate(pluginName);
+ if (proxiedPlugin != NULL) {
+ if (registerPlugin(proxiedPlugin)) {
+ qDebug("loaded plugin \"%s\"", pluginName.toUtf8().constData());
+ } else {
+ qWarning("plugin \"%s\" failed to load", pluginName.toUtf8().constData());
+ }
}
+ } catch (const std::exception &e) {
+ reportError(tr("failed to init plugin %1: %2").arg(pluginName).arg(e.what()));
}
}
return true;