Set GVFS_REMOTE_VOLUME_MONITOR_IGNORE to avoid potential crashes

This should fix the Error calling StartServiceByName for
org.gtk.vfs.Daemon message.
This commit is contained in:
Fushan Wen 2023-08-09 10:27:29 +08:00 committed by Albert Vaca Cintora
parent 944932f342
commit c64d538b7f

View file

@ -16,6 +16,13 @@ K_PLUGIN_CLASS_WITH_JSON(SendNotificationsPlugin, "kdeconnect_sendnotifications.
SendNotificationsPlugin::SendNotificationsPlugin(QObject *parent, const QVariantList &args)
: KdeConnectPlugin(parent, args)
{
// Disable the GVFS remote volume monitor (org.gtk.vfs.Daemon) since it's unused and can cause crashes
if (!qEnvironmentVariableIsSet("GVFS_REMOTE_VOLUME_MONITOR_IGNORE")) {
qputenv("GVFS_REMOTE_VOLUME_MONITOR_IGNORE", "1");
}
if (!qEnvironmentVariableIsSet("GIO_USE_VFS")) {
qputenv("GIO_USE_VFS", "local");
}
notificationsListener = new NotificationsListener(this);
}