Fix bug can not show auth-window when connect a portal wifi

This commit is contained in:
chenlelin 2021-03-27 01:28:07 +08:00
parent 901a4938ff
commit 2ba2334e24
1 changed files with 8 additions and 2 deletions

View File

@ -1,14 +1,20 @@
#include "wifi-auth-thread.h"
#include <QDebug>
void WifiAuthThread::run()
{
sleep(3);
QDBusInterface interface( "org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager",
"org.freedesktop.NetworkManager",
QDBusConnection::systemBus() );
QDBusReply<uint> reply= interface.call("CheckConnectivity");
if (reply.isValid()) {
if (reply.value() == 2)
system("gdbus call --session --dest org.gnome.Shell.PortalHelper --object-path /org/gnome/Shell/PortalHelper --method org.gtk.Application.Activate []");
//qDebug() << "-----------------------> 000000000000000011" << reply.value();
if (reply.value() == 2) {
system("gdbus call --session --dest org.gnome.Shell.PortalHelper --object-path /org/gnome/Shell/PortalHelper --method org.gtk.Application.Activate []");
}
}
}