Commit 223de052 authored by Alexander Reinholdt's avatar Alexander Reinholdt
Browse files

Fix determination of online state.

Remove unnecessary signal Smb4KHardwareInterface::networkSessionInitialized().
parent c93cd9fb
......@@ -73,27 +73,17 @@ Smb4KHardwareInterface::Smb4KHardwareInterface(QObject *parent)
//
connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceAdded(QString)), this, SLOT(slotDeviceAdded(QString)));
connect(Solid::DeviceNotifier::instance(), SIGNAL(deviceRemoved(QString)), this, SLOT(slotDeviceRemoved(QString)));
//
// Start the network monitoring
// Check the online state
//
QTimer::singleShot(50, [&] () {
//
// Check the online state
//
checkOnlineState(false);
//
// Tell the program that we are ready to check the network accessibilty
//
emit networkSessionInitialized();
//
// Start the timer to continously check the online state
// and, under FreeBSD, additionally the mounted shares.
//
startTimer(1000);
});
checkOnlineState(false);
//
// Start the timer to continously check the online state
// and, under FreeBSD, additionally the mounted shares.
//
startTimer(1000);
}
......@@ -162,9 +152,9 @@ void Smb4KHardwareInterface::checkOnlineState(bool emitSignal)
for (const QNetworkInterface &interface : qAsConst(interfaces))
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
if (interface.isValid() && interface.type() != QNetworkInterface::Loopback && interface.flags() & QNetworkInterface::IsRunning && !online)
if (interface.isValid() && interface.type() != QNetworkInterface::Loopback && interface.flags() & QNetworkInterface::IsRunning)
#else
if (interface.isValid() && !(interface.flags() & QNetworkInterface::IsLoopBack) && interface.flags() & QNetworkInterface::IsRunning && !online)
if (interface.isValid() && !(interface.flags() & QNetworkInterface::IsLoopBack) && interface.flags() & QNetworkInterface::IsRunning)
#endif
{
online = true;
......
......@@ -99,11 +99,6 @@ class Q_DECL_EXPORT Smb4KHardwareInterface : public QObject
*/
void networkShareRemoved();
/**
* This signal is emitted when the network configuration was updated.
*/
void networkSessionInitialized();
/**
* This signal is emitted when the online state changed.
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment