--- /dev/null
+/*
+ * This file is part of QMAFW
+ *
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). All rights
+ * reserved.
+ *
+ * Contact: Visa Smolander <visa.smolander@nokia.com>
+ *
+ * This software, including documentation, is protected by copyright controlled
+ * by Nokia Corporation. All rights are reserved. Copying, including
+ * reproducing, storing, adapting or translating, any or all of this material
+ * requires the prior written consent of Nokia Corporation. This material also
+ * contains confidential information which may not be disclosed to others
+ * without the prior written consent of Nokia.
+ *
+ */
+
+#include "MafwGstRendererNetworkMonitor.h"
+#include "MafwGstRendererHaltState.h"
+
+#include <QDebug>
+#include <QtNetwork/QNetworkConfigurationManager>
+
+/********************************************************************
+ * MafwGstRendererNetworkMonitor::MafwGstRendererNetworkMonitor
+ ********************************************************************/
+MafwGstRendererNetworkMonitor::MafwGstRendererNetworkMonitor()
+ :
+ m_networkManager(new QNetworkConfigurationManager(this))
+{
+ connect(m_networkManager, SIGNAL(configurationChanged(QNetworkConfiguration)),
+ this, SLOT(handleConfigurationChange(QNetworkConfiguration)));
+}
+
+/********************************************************************
+ * MafwGstRendererNetworkMonitor::MafwGstRendererNetworkMonitor
+ ********************************************************************/
+MafwGstRendererNetworkMonitor::~MafwGstRendererNetworkMonitor()
+{
+
+}
+
+/********************************************************************
+ * MafwGstRendererNetworkMonitor::handleConfigurationChange
+ ********************************************************************/
+void MafwGstRendererNetworkMonitor::handleConfigurationChange(const QNetworkConfiguration &config)
+{
+ qDebug() << __PRETTY_FUNCTION__ << "Configs status: " << config.name() << config.state();
+
+ QNetworkConfiguration::StateFlags flags = config.state();
+ if( flags.testFlag(QNetworkConfiguration::Active) )
+ {
+ Q_EMIT networkChangeFinished();
+ m_currentConfiguration = config;
+ }
+ else if( !m_currentConfiguration.isValid() || config == m_currentConfiguration )
+ {
+ Q_EMIT prepareNetworkChange();
+ }
+}