Skip to content

Commit

Permalink
Add JUS support (need a configuration item to be able to switch) + co…
Browse files Browse the repository at this point in the history
…nvert files to unix format
  • Loading branch information
dguihal committed Sep 20, 2016
1 parent cc3bd6f commit ed38d00
Show file tree
Hide file tree
Showing 13 changed files with 469 additions and 419 deletions.
18 changes: 9 additions & 9 deletions core/qqbigornoitem.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "qqbigornoitem.h"

QQBigornoItem::QQBigornoItem(int postition, const QString & word)
{
m_position = postition;
m_word = word;
m_wasNotified = false;
}

#include "qqbigornoitem.h"

QQBigornoItem::QQBigornoItem(int postition, const QString & word)
{
m_position = postition;
m_word = word;
m_wasNotified = false;
}

44 changes: 22 additions & 22 deletions core/qqbigornoitem.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#ifndef QQBIGORNOITEM_H
#define QQBIGORNOITEM_H

#include <QString>

class QQBigornoItem
{
public:
QQBigornoItem(int postition, const QString & word);

int position() { return m_position; }
QString word() { return m_word; }
bool wasNotified() { return m_wasNotified; }
void setNotified() { m_wasNotified = true; }

private:
int m_position;
QString m_word;
bool m_wasNotified;
};

#endif // QQBIGORNOITEM_H
#ifndef QQBIGORNOITEM_H
#define QQBIGORNOITEM_H

#include <QString>

class QQBigornoItem
{
public:
QQBigornoItem(int postition, const QString & word);

int position() { return m_position; }
QString word() { return m_word; }
bool wasNotified() { return m_wasNotified; }
void setNotified() { m_wasNotified = true; }

private:
int m_position;
QString m_word;
bool m_wasNotified;
};

#endif // QQBIGORNOITEM_H
5 changes: 5 additions & 0 deletions core/qqnetworkaccessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ QNetworkReply * QQNetworkAccessor::httpPost(const QNetworkRequest &request, QHtt
return m_qnam->post(request, multiPart);
}

QNetworkReply * QQNetworkAccessor::httpPut(const QNetworkRequest &request, QIODevice *data)
{
return m_qnam->put(request, data);
}

// Gestion du proxy
QMutex QQNetworkAccessor::m_proxyPopupMutex;
QString QQNetworkAccessor::m_proxyUser;
Expand Down
112 changes: 57 additions & 55 deletions core/qqnetworkaccessor.h
Original file line number Diff line number Diff line change
@@ -1,55 +1,57 @@
#ifndef QQNETWORKACCESSOR_H
#define QQNETWORKACCESSOR_H

#include <QDateTime>
#include <QMap>
#include <QMutex>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QObject>
#include <QPointer>
#include <QTimer>

class QAbstractNetworkCache;

class QQNetworkAccessor : public QObject
{
Q_OBJECT

public:
QQNetworkAccessor(QObject *parent);

static void updateProxySettings();

protected slots:
virtual void requestFinishedSlot(QNetworkReply *reply) = 0;

protected:
int name_to_month(QByteArray month_str);
QDateTime parseRC822(QString string);

protected:
QNetworkReply *httpGet(const QNetworkRequest &request);
QNetworkReply *httpHead(const QNetworkRequest &request);
QNetworkReply *httpPost(const QNetworkRequest &request,
const QByteArray &postData);
QNetworkReply *httpPost(const QNetworkRequest &request,
QHttpMultiPart *multiPart);
void setNetCacheManager(QAbstractNetworkCache *networkCache) { m_qnam->setCache(networkCache); }

protected slots:
void onProxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
void onRemoveTimer(QObject *obj);
void onRequestTimeout();

private:
QPointer<QNetworkAccessManager> m_qnam;
QMap<QNetworkReply *, QTimer *> m_replyTimers;

// Gestion du proxy
static QMutex m_proxyPopupMutex;
static QString m_proxyUser;
static QString m_proxyPasswd;
};

#endif // QQNETWORKACCESSOR_H
#ifndef QQNETWORKACCESSOR_H
#define QQNETWORKACCESSOR_H

#include <QDateTime>
#include <QMap>
#include <QMutex>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QObject>
#include <QPointer>
#include <QTimer>

class QAbstractNetworkCache;

class QQNetworkAccessor : public QObject
{
Q_OBJECT

public:
QQNetworkAccessor(QObject *parent);

static void updateProxySettings();

protected slots:
virtual void requestFinishedSlot(QNetworkReply *reply) = 0;

protected:
int name_to_month(QByteArray month_str);
QDateTime parseRC822(QString string);

protected:
QNetworkReply *httpGet(const QNetworkRequest &request);
QNetworkReply *httpHead(const QNetworkRequest &request);
QNetworkReply *httpPost(const QNetworkRequest &request,
const QByteArray &postData);
QNetworkReply *httpPost(const QNetworkRequest &request,
QHttpMultiPart *multiPart);
QNetworkReply *httpPut(const QNetworkRequest &request,
QIODevice *data);
void setNetCacheManager(QAbstractNetworkCache *networkCache) { m_qnam->setCache(networkCache); }

protected slots:
void onProxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
void onRemoveTimer(QObject *obj);
void onRequestTimeout();

private:
QPointer<QNetworkAccessManager> m_qnam;
QMap<QNetworkReply *, QTimer *> m_replyTimers;

// Gestion du proxy
static QMutex m_proxyPopupMutex;
static QString m_proxyUser;
static QString m_proxyPasswd;
};

#endif // QQNETWORKACCESSOR_H
18 changes: 9 additions & 9 deletions core/qqpurgebouchothistoevent.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "qqpurgebouchothistoevent.h"

const QEvent::Type QQPurgeBouchotHistoEvent::PURGE_BOUCHOT_HISTO =
(QEvent::Type)QEvent::registerEventType();

QQPurgeBouchotHistoEvent::QQPurgeBouchotHistoEvent() :
QEvent(PURGE_BOUCHOT_HISTO)
{
}
#include "qqpurgebouchothistoevent.h"

const QEvent::Type QQPurgeBouchotHistoEvent::PURGE_BOUCHOT_HISTO =
(QEvent::Type)QEvent::registerEventType();

QQPurgeBouchotHistoEvent::QQPurgeBouchotHistoEvent() :
QEvent(PURGE_BOUCHOT_HISTO)
{
}
28 changes: 14 additions & 14 deletions core/qqpurgebouchothistoevent.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#ifndef QQPURGEBOUCHOTHISTOEVENT_H
#define QQPURGEBOUCHOTHISTOEVENT_H

#include <QEvent>
#include <QString>

class QQPurgeBouchotHistoEvent : public QEvent
{
public:
static const QEvent::Type PURGE_BOUCHOT_HISTO;
QQPurgeBouchotHistoEvent();
};

#endif // QQPURGEBOUCHOTHISTOEVENT_H
#ifndef QQPURGEBOUCHOTHISTOEVENT_H
#define QQPURGEBOUCHOTHISTOEVENT_H

#include <QEvent>
#include <QString>

class QQPurgeBouchotHistoEvent : public QEvent
{
public:
static const QEvent::Type PURGE_BOUCHOT_HISTO;
QQPurgeBouchotHistoEvent();
};

#endif // QQPURGEBOUCHOTHISTOEVENT_H
48 changes: 24 additions & 24 deletions rc/Point_exclamation_rouge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ed38d00

Please sign in to comment.