2 * This file is part of QMAFW
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
7 * Contact: Visa Smolander <visa.smolander@nokia.com>
9 * This software, including documentation, is protected by copyright controlled
10 * by Nokia Corporation. All rights are reserved. Copying, including
11 * reproducing, storing, adapting or translating, any or all of this material
12 * requires the prior written consent of Nokia Corporation. This material also
13 * contains confidential information which may not be disclosed to others
14 * without the prior written consent of Nokia.
18 #include "MafwGstRendererNetworkMonitor.h"
19 #include "MafwGstRendererHaltState.h"
22 #include <QtNetwork/QNetworkConfigurationManager>
24 /********************************************************************
25 * MafwGstRendererNetworkMonitor::MafwGstRendererNetworkMonitor
26 ********************************************************************/
27 MafwGstRendererNetworkMonitor::MafwGstRendererNetworkMonitor()
29 m_networkManager(new QNetworkConfigurationManager(this))
31 connect(m_networkManager, SIGNAL(configurationChanged(QNetworkConfiguration)),
32 this, SLOT(handleConfigurationChange(QNetworkConfiguration)));
35 /********************************************************************
36 * MafwGstRendererNetworkMonitor::MafwGstRendererNetworkMonitor
37 ********************************************************************/
38 MafwGstRendererNetworkMonitor::~MafwGstRendererNetworkMonitor()
43 /********************************************************************
44 * MafwGstRendererNetworkMonitor::handleConfigurationChange
45 ********************************************************************/
46 void MafwGstRendererNetworkMonitor::handleConfigurationChange(const QNetworkConfiguration &config)
48 qDebug() << __PRETTY_FUNCTION__ << "Configs status: " << config.name() << config.state();
50 QNetworkConfiguration::StateFlags flags = config.state();
51 if( flags.testFlag(QNetworkConfiguration::Active) )
53 Q_EMIT networkChangeFinished();
54 m_currentConfiguration = config;
56 else if( !m_currentConfiguration.isValid() || config == m_currentConfiguration )
58 Q_EMIT prepareNetworkChange();