netwerk/system/qt/nsQtNetworkManager.h
author Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk>
Mon, 04 May 2015 07:15:00 +0200
changeset 273955 5b146d08b2c59b69bd7349b1a1e79355886b29a2
parent 129427 ed46fb258e5394e0d90ee569d2102a9e45906f73
permissions -rw-r--r--
Bug 1160897 - Fixing .ycm_extra_conf for Fennec. r=ehsan Looks like ycmd fails to parse the file if the -march=arm* option is given Removing it doesn't solve all YCM problems for Fennec, but it allows us to use JumpToDefinition, GetType and semantic auto-completion.

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSQTNETWORKMANAGER_H_
#define NSQTNETWORKMANAGER_H_

#include <QNetworkConfigurationManager>
#include <QObject>
#include <QTimer>
#include <QNetworkConfiguration>
#include <QNetworkSession>
#include "nscore.h"

class nsQtNetworkManager;



class nsQtNetworkManager : public QObject
{
  Q_OBJECT
  public:
    static void create();
    static void destroy();
    virtual ~nsQtNetworkManager();

    static nsQtNetworkManager* get() { return gQtNetworkManager; }

    static bool IsConnected();
    static bool GetLinkStatusKnown();
    static void enableInstance();
    bool openConnection(const QString&);
    bool isOnline();
  Q_SIGNALS:
    void openConnectionSignal();

  public Q_SLOTS:
    void closeSession();
    void onlineStateChanged(bool);

  private Q_SLOTS:
    void openSession();

  private:
    explicit nsQtNetworkManager(QObject* parent = 0);

    static nsQtNetworkManager* gQtNetworkManager;
    QNetworkSession* networkSession;
    QNetworkConfiguration networkConfiguration;
    QNetworkConfigurationManager networkConfigurationManager;
    QTimer mBlockTimer;
    bool mOnline;
};

#endif /* NSQTNETWORKMANAGER_H_ */