r24364 by craig - Rearrange error code slightly in case we want to capture it in future.

scribus-commit scribus-commit at lists.scribus.net
Wed Dec 30 10:09:03 UTC 2020


Author: craig
Date: Wed Dec 30 10:09:03 2020
New Revision: 24364

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24364
Log:
Rearrange error code slightly in case we want to capture it in future.
Remove extra dlerror() call

Modified:
    trunk/Scribus/scribus/pluginmanager.cpp

Modified: trunk/Scribus/scribus/pluginmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24364&path=/trunk/Scribus/scribus/pluginmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/pluginmanager.cpp	(original)
+++ trunk/Scribus/scribus/pluginmanager.cpp	Wed Dec 30 10:09:03 2020
@@ -55,11 +55,12 @@
 	if (!lib)
 	{
 		const char* error = dlerror();
-		qDebug("%s: %s",
-				tr("Cannot find plugin", "plugin manager").toLocal8Bit().data(),
-				error ? error : tr("unknown error","plugin manager").toLocal8Bit().data());
-	}
-	dlerror();
+		qDebug() << tr("Error loading plugin", "plugin manager").toLocal8Bit().data();
+		if (error)
+			qDebug("%s", error);
+		else
+			qDebug() << tr("Unknown error","plugin manager").toLocal8Bit().data();
+	}
 #elif defined(DLL_USE_NATIVE_API) && defined(_WIN32)
 	QString libpath = QDir::toNativeSeparators(plugin);
 	HINSTANCE hdll = LoadLibraryW((const wchar_t*) libpath.utf16());
@@ -68,7 +69,10 @@
 	if (QFile::exists(plugin))
 		lib = (void*) new QLibrary(plugin);
 	else
-		qDebug("%s \"%s\"", tr("Cannot find plugin", "plugin manager").toLocal8Bit().data(), plugin.toLocal8Bit().data());
+	{
+		qDebug() << tr("Error loading plugin", "plugin manager").toLocal8Bit().data();
+		qDebug("%s", plugin.toLocal8Bit().data());
+	}
 #endif
 	return lib;
 }




More information about the scribus-commit mailing list