Make flatpak check more backward compatible
Since 68de00e0d4f2c574162a6e033d41786e3757d25d, 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 <qpa/qplatformintegration.h>
|
||||||
|
|
||||||
#include <QtCore/QAbstractEventDispatcher>
|
#include <QtCore/QAbstractEventDispatcher>
|
||||||
#include <QtCore/QStandardPaths>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtCore/QVariant>
|
#include <QtCore/QVariant>
|
||||||
#include <QtCore/private/qcoreapplication_p.h>
|
#include <QtCore/private/qcoreapplication_p.h>
|
||||||
#include <QtCore/private/qabstracteventdispatcher_p.h>
|
#include <QtCore/private/qabstracteventdispatcher_p.h>
|
||||||
@ -231,7 +231,7 @@ static void initThemeHints()
|
|||||||
static bool checkNeedPortalSupport()
|
static bool checkNeedPortalSupport()
|
||||||
{
|
{
|
||||||
#if QT_CONFIG(dbus)
|
#if QT_CONFIG(dbus)
|
||||||
return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, "flatpak-info"_L1).isEmpty() || qEnvironmentVariableIsSet("SNAP");
|
return QFileInfo::exists("/.flatpak-info"_L1) || qEnvironmentVariableIsSet("SNAP");
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif // QT_CONFIG(dbus)
|
#endif // QT_CONFIG(dbus)
|
||||||
|
@ -162,7 +162,7 @@ static inline bool launch(const QString &launcher, const QUrl &url,
|
|||||||
#if QT_CONFIG(dbus)
|
#if QT_CONFIG(dbus)
|
||||||
static inline bool checkNeedPortalSupport()
|
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,
|
static inline QDBusMessage xdgDesktopPortalOpenFile(const QUrl &url, const QString &parentWindow,
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QDBusVariant>
|
#include <QDBusVariant>
|
||||||
#include <QDBusPendingReply>
|
#include <QDBusPendingReply>
|
||||||
@ -596,8 +597,7 @@ void QIBusPlatformInputContext::connectToContextSignals()
|
|||||||
|
|
||||||
static inline bool checkNeedPortalSupport()
|
static inline bool checkNeedPortalSupport()
|
||||||
{
|
{
|
||||||
return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, "flatpak-info"_L1).isEmpty()
|
return QFileInfo::exists("/.flatpak-info"_L1) || qEnvironmentVariableIsSet("SNAP");
|
||||||
|| qEnvironmentVariableIsSet("SNAP");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool shouldConnectIbusPortal()
|
static bool shouldConnectIbusPortal()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user