mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Workaround for crash when running job (conversion to PDF or MOBI/reading metadata from epub without cover) that requires Qt WebKit on Ubuntu. Fixes #1360693 [Ubuntu: Import EPUB, Metadata Error](https://bugs.launchpad.net/calibre/+bug/1360693)
See https://bugreports.qt-project.org/browse/QTBUG-40946
This commit is contained in:
parent
a9dab307fb
commit
83b3e2cf19
@ -14,6 +14,15 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class GenericUnixServices : public QGenericUnixServices {
|
||||
/* We must return desktop environment as UNKNOWN otherwise other parts of
|
||||
* Qt will try to query the nativeInterface() without checking if it exists
|
||||
* leading to a segfault. For example, defaultHintStyleFromMatch() queries
|
||||
* the nativeInterface() without checking that it is NULL. See
|
||||
* https://bugreports.qt-project.org/browse/QTBUG-40946 */
|
||||
QByteArray desktopEnvironment() const { return QByteArrayLiteral("UNKNOWN"); }
|
||||
};
|
||||
|
||||
HeadlessIntegration::HeadlessIntegration(const QStringList ¶meters)
|
||||
{
|
||||
Q_UNUSED(parameters);
|
||||
@ -26,7 +35,7 @@ HeadlessIntegration::HeadlessIntegration(const QStringList ¶meters)
|
||||
screenAdded(mPrimaryScreen);
|
||||
m_fontDatabase.reset(new QFontconfigDatabase());
|
||||
|
||||
platform_services.reset(new QGenericUnixServices());
|
||||
platform_services.reset(new GenericUnixServices());
|
||||
}
|
||||
|
||||
HeadlessIntegration::~HeadlessIntegration()
|
||||
|
Loading…
x
Reference in New Issue
Block a user