Make flatpak check more backward compatible
Since 68de00e0d4
, the check doesn't work
with flatpak versions lesser than 1.13.1. Checking the file in the root
directory works since flatpak 0.6.10.
Pick-to: 6.5 6.2
Change-Id: Icc83ea5de4a962b52a737c9842248df3b60b1331
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
2f35879649
commit
5c4a94ba85
@ -18,7 +18,7 @@
|
||||
#include <qpa/qplatformintegration.h>
|
||||
|
||||
#include <QtCore/QAbstractEventDispatcher>
|
||||
#include <QtCore/QStandardPaths>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/private/qcoreapplication_p.h>
|
||||
#include <QtCore/private/qabstracteventdispatcher_p.h>
|
||||
@ -231,7 +231,7 @@ static void initThemeHints()
|
||||
static bool checkNeedPortalSupport()
|
||||
{
|
||||
#if QT_CONFIG(dbus)
|
||||
return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, "flatpak-info"_L1).isEmpty() || qEnvironmentVariableIsSet("SNAP");
|
||||
return QFileInfo::exists("/.flatpak-info"_L1) || qEnvironmentVariableIsSet("SNAP");
|
||||
#else
|
||||
return false;
|
||||
#endif // QT_CONFIG(dbus)
|
||||
|
@ -162,7 +162,7 @@ static inline bool launch(const QString &launcher, const QUrl &url,
|
||||
#if QT_CONFIG(dbus)
|
||||
static inline bool checkNeedPortalSupport()
|
||||
{
|
||||
return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, "flatpak-info"_L1).isEmpty() || qEnvironmentVariableIsSet("SNAP");
|
||||
return QFileInfo::exists("/.flatpak-info"_L1) || qEnvironmentVariableIsSet("SNAP");
|
||||
}
|
||||
|
||||
static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url, const QString &parentWindow,
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <QWindow>
|
||||
#include <QEvent>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QStandardPaths>
|
||||
#include <QDBusVariant>
|
||||
#include <QDBusPendingReply>
|
||||
@ -596,8 +597,7 @@ void QIBusPlatformInputContext::connectToContextSignals()
|
||||
|
||||
static inline bool checkNeedPortalSupport()
|
||||
{
|
||||
return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, "flatpak-info"_L1).isEmpty()
|
||||
|| qEnvironmentVariableIsSet("SNAP");
|
||||
return QFileInfo::exists("/.flatpak-info"_L1) || qEnvironmentVariableIsSet("SNAP");
|
||||
}
|
||||
|
||||
static bool shouldConnectIbusPortal()
|
||||
|
Loading…
Reference in New Issue
Block a user