VirtualBox

Changeset 58423 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Oct 26, 2015 6:00:31 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103679
Message:

FE/Qt: Networking cleanup/rework (part 22): Cleanup/refactor some excessive stuff.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/net
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloader.cpp

    r58394 r58423  
    4848
    4949    /* Create network request set: */
    50     createNetworkRequest(requests, UINetworkRequestType_HEAD);
     50    createNetworkRequest(UINetworkRequestType_HEAD, requests);
    5151}
    5252
     
    6161
    6262    /* Create network request: */
    63     createNetworkRequest(request, UINetworkRequestType_GET);
     63    createNetworkRequest(UINetworkRequestType_GET, QList<QNetworkRequest>() << request);
    6464}
    6565
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.cpp

    r58394 r58423  
    4242}
    4343
    44 void UINetworkCustomer::createNetworkRequest(const QNetworkRequest &request, UINetworkRequestType type)
     44void UINetworkCustomer::createNetworkRequest(UINetworkRequestType type, const QList<QNetworkRequest> requests)
    4545{
    46     gNetworkManager->createNetworkRequest(request, type, this);
     46    gNetworkManager->createNetworkRequest(type, requests, this);
    4747}
    4848
    49 void UINetworkCustomer::createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type)
    50 {
    51     gNetworkManager->createNetworkRequest(requests, type, this);
    52 }
    53 
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.h

    r58394 r58423  
    5555protected:
    5656
    57     /* Network-request wrapper: */
    58     void createNetworkRequest(const QNetworkRequest &request, UINetworkRequestType type);
    59     /* Network-request wrapper (set): */
    60     void createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type);
     57    /** Creates network-request of the passed @a type on the basis of the passed @a requests. */
     58    void createNetworkRequest(UINetworkRequestType type, const QList<QNetworkRequest> requests);
    6159
    6260private:
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.cpp

    r58394 r58423  
    107107}
    108108
    109 void UINetworkManager::createNetworkRequest(const QNetworkRequest &request, UINetworkRequestType type,
     109void UINetworkManager::createNetworkRequest(UINetworkRequestType type, const QList<QNetworkRequest> &requests,
    110110                                            UINetworkCustomer *pCustomer)
    111111{
    112112    /* Create network-request: */
    113     UINetworkRequest *pNetworkRequest = new UINetworkRequest(request, type, pCustomer, this);
    114     /* Prepare created network-request: */
    115     prepareNetworkRequest(pNetworkRequest);
    116 }
    117 
    118 void UINetworkManager::createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type,
    119                                             UINetworkCustomer *pCustomer)
    120 {
    121     /* Create network-request: */
    122     UINetworkRequest *pNetworkRequest = new UINetworkRequest(requests, type, pCustomer, this);
     113    UINetworkRequest *pNetworkRequest = new UINetworkRequest(type, requests, pCustomer, this);
    123114    /* Prepare created network-request: */
    124115    prepareNetworkRequest(pNetworkRequest);
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.h

    r58394 r58423  
    8181    /* Allow UINetworkCustomer to create network-request: */
    8282    friend class UINetworkCustomer;
    83     /* Network-request creation wrappers for UINetworkCustomer: */
    84     void createNetworkRequest(const QNetworkRequest &request, UINetworkRequestType type,
    85                               UINetworkCustomer *pCustomer);
    86     void createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type,
     83    /** Creates network-request of the passed @a type
     84      * on the basis of the passed @a requests for the @a pCustomer specified. */
     85    void createNetworkRequest(UINetworkRequestType type, const QList<QNetworkRequest> &requests,
    8786                              UINetworkCustomer *pCustomer);
    8887
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp

    r58422 r58423  
    7070public:
    7171
    72     /** Constructs reply thread for the passed @a request of the passed @a type. */
    73     UINetworkReplyPrivateThread(const QNetworkRequest &request, UINetworkRequestType type);
     72    /** Constructs network-reply thread of the passed @a type for the passed @a request. */
     73    UINetworkReplyPrivateThread(UINetworkRequestType type, const QNetworkRequest &request);
    7474
    7575    /** @name APIs
     
    189189    } CERTINFO;
    190190
     191    /** Holds the request type. */
     192    const UINetworkRequestType m_type;
    191193    /** Holds the request instance. */
    192194    QNetworkRequest m_request;
    193     /** Holds the request type. */
    194     UINetworkRequestType m_type;
    195195
    196196    /** Holds the IPRT HTTP client instance handle. */
     
    242242public:
    243243
    244     /** Constructs reply private data for the passed @a request of the passed @a type. */
    245     UINetworkReplyPrivate(const QNetworkRequest &request, UINetworkRequestType type);
     244    /** Constructs network-reply private data of the passed @a type for the passed @a request. */
     245    UINetworkReplyPrivate(UINetworkRequestType type, const QNetworkRequest &request);
    246246    /** Destructs reply private data. */
    247247    ~UINetworkReplyPrivate();
     
    342342const QString UINetworkReplyPrivateThread::s_strCertificateFileName = QString("vbox-ssl-cacertificate.crt");
    343343
    344 UINetworkReplyPrivateThread::UINetworkReplyPrivateThread(const QNetworkRequest &request, UINetworkRequestType type)
    345     : m_request(request)
    346     , m_type(type)
     344UINetworkReplyPrivateThread::UINetworkReplyPrivateThread(UINetworkRequestType type, const QNetworkRequest &request)
     345    : m_type(type)
     346    , m_request(request)
    347347    , m_hHttp(NIL_RTHTTP)
    348348    , m_iError(VINF_SUCCESS)
     
    918918*********************************************************************************************************************************/
    919919
    920 UINetworkReplyPrivate::UINetworkReplyPrivate(const QNetworkRequest &request, UINetworkRequestType type)
     920UINetworkReplyPrivate::UINetworkReplyPrivate(UINetworkRequestType type, const QNetworkRequest &request)
    921921    : m_error(UINetworkReply::NoError)
    922922    , m_pThread(0)
     
    926926
    927927    /* Create and run reply thread: */
    928     m_pThread = new UINetworkReplyPrivateThread(request, type);
     928    m_pThread = new UINetworkReplyPrivateThread(type, request);
    929929    connect(m_pThread, SIGNAL(sigDownloadProgress(qint64, qint64)),
    930930            this, SIGNAL(downloadProgress(qint64, qint64)), Qt::QueuedConnection);
     
    991991*********************************************************************************************************************************/
    992992
    993 UINetworkReply::UINetworkReply(const QNetworkRequest &request, UINetworkRequestType type)
    994     : m_pReply(new UINetworkReplyPrivate(request, type))
     993UINetworkReply::UINetworkReply(UINetworkRequestType type, const QNetworkRequest &request)
     994    : m_pReply(new UINetworkReplyPrivate(type, request))
    995995{
    996996    /* Prepare network-reply object connections: */
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.h

    r58422 r58423  
    8484    };
    8585
    86     /** Constructs reply for the passed @a request of the passed @a type. */
    87     UINetworkReply(const QNetworkRequest &request, UINetworkRequestType type);
     86    /** Constructs network-reply of the passed @a type for the passed @a request. */
     87    UINetworkReply(UINetworkRequestType type, const QNetworkRequest &request);
    8888    /** Destructs reply. */
    8989    ~UINetworkReply();
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.cpp

    r58422 r58423  
    3535
    3636
    37 /* Constructor: */
    38 UINetworkRequest::UINetworkRequest(const QNetworkRequest &request, UINetworkRequestType type,
     37UINetworkRequest::UINetworkRequest(UINetworkRequestType type,
     38                                   const QList<QNetworkRequest> &requests,
    3939                                   UINetworkCustomer *pCustomer,
    4040                                   UINetworkManager *pNetworkManager)
    4141    : QObject(pNetworkManager)
    42     , m_uuid(QUuid::createUuid())
    43     , m_requests(QList<QNetworkRequest>() << request)
    44     , m_iCurrentRequestIndex(0)
    4542    , m_type(type)
    46     , m_pCustomer(pCustomer)
    47     , m_fRunning(false)
    48 {
    49     /* Initialize: */
    50     initialize();
    51 }
    52 
    53 UINetworkRequest::UINetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type,
    54                                    UINetworkCustomer *pCustomer,
    55                                    UINetworkManager *pNetworkManager)
    56     : QObject(pNetworkManager)
    5743    , m_uuid(QUuid::createUuid())
    5844    , m_requests(requests)
    5945    , m_iCurrentRequestIndex(0)
    60     , m_type(type)
    6146    , m_pCustomer(pCustomer)
    6247    , m_fRunning(false)
     
    6651}
    6752
    68 /* Destructor: */
    6953UINetworkRequest::~UINetworkRequest()
    7054{
     
    204188{
    205189    /* Make network-request: */
    206     m_pReply = new UINetworkReply(m_request, m_type);
     190    m_pReply = new UINetworkReply(m_type, m_request);
    207191    AssertMsg(m_pReply, ("Unable to make network-request!\n"));
    208192    /* Prepare listeners for m_pReply: */
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.h

    r58394 r58423  
    5757public:
    5858
    59     /* Constructor/destructor: */
    60     UINetworkRequest(const QNetworkRequest &request, UINetworkRequestType type,
     59    /** Constructs network-request of the passed @a type
     60      * on the basis of the @a requests
     61      * for the @a pCustomer and @a pNetworkManager specified. */
     62    UINetworkRequest(UINetworkRequestType type,
     63                     const QList<QNetworkRequest> &requests,
    6164                     UINetworkCustomer *pCustomer,
    6265                     UINetworkManager *pNetworkManager);
    63     UINetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type,
    64                      UINetworkCustomer *pCustomer,
    65                      UINetworkManager *pNetworkManager);
     66    /** Destructs network request. */
    6667    ~UINetworkRequest();
    6768
     
    99100
    100101    /* Variables: */
     102    UINetworkRequestType m_type;
    101103    QUuid m_uuid;
    102104    QList<QNetworkRequest> m_requests;
    103105    QNetworkRequest m_request;
    104106    int m_iCurrentRequestIndex;
    105     UINetworkRequestType m_type;
    106107    QString m_strDescription;
    107108    UINetworkCustomer *m_pCustomer;
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp

    r58394 r58423  
    199199        request.setUrl(url);
    200200        request.setRawHeader("User-Agent", strUserAgent.toAscii());
    201         createNetworkRequest(request, UINetworkRequestType_GET);
     201        createNetworkRequest(UINetworkRequestType_GET, QList<QNetworkRequest>() << request);
    202202    }
    203203
  • trunk/src/VBox/Frontends/VirtualBox/src/net/tstSSLCertDownloads.cpp

    r58365 r58423  
    4646    NOREF(hTest);
    4747    QNetworkRequest Dummy;
    48     UINetworkReplyPrivateThread TestObj(Dummy, UINetworkRequestType_GET);
     48    UINetworkReplyPrivateThread TestObj(UINetworkRequestType_GET, Dummy);
    4949
    5050    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette