VirtualBox

Changeset 90540 in vbox for trunk/src


Ignore:
Timestamp:
Aug 6, 2021 9:10:55 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Pass failed signal above from network-request manager to all existing customers; Cleanup network-request and all existing customers on failures; Remove possibility to retry failed networ-request, this functionality will be introduced in customers instead.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/networking
Files:
8 edited

Legend:

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

    r82968 r90540  
    55
    66/*
    7  * Copyright (C) 2006-2020 Oracle Corporation
     7 * Copyright (C) 2006-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    8383}
    8484
     85void UIDownloader::processNetworkReplyFailed(const QString &)
     86{
     87    /* Delete downloader: */
     88    deleteLater();
     89}
     90
    8591void UIDownloader::processNetworkReplyCanceled(UINetworkReply *)
    8692{
     
    158164    deleteLater();
    159165}
    160 
  • trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloader.h

    r86996 r90540  
    55
    66/*
    7  * Copyright (C) 2006-2020 Oracle Corporation
     7 * Copyright (C) 2006-2021 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    109109    /** Handles network-reply progress for @a iReceived bytes of @a iTotal. */
    110110    void processNetworkReplyProgress(qint64 iReceived, qint64 iTotal);
     111    /** Handles network-reply failed with specified @a strError. */
     112    void processNetworkReplyFailed(const QString &strError);
    111113    /** Handles network-reply cancel request for @a pReply. */
    112114    void processNetworkReplyCanceled(UINetworkReply *pReply);
  • trunk/src/VBox/Frontends/VirtualBox/src/networking/UINetworkCustomer.h

    r90524 r90540  
    4949    /** Handles network reply progress for @a iReceived amount of bytes among @a iTotal. */
    5050    virtual void processNetworkReplyProgress(qint64 iReceived, qint64 iTotal) = 0;
     51    /** Handles network reply failed with specified @a strError. */
     52    virtual void processNetworkReplyFailed(const QString &strError) = 0;
    5153    /** Handles network reply canceling for a passed @a pReply. */
    5254    virtual void processNetworkReplyCanceled(UINetworkReply *pReply) = 0;
  • trunk/src/VBox/Frontends/VirtualBox/src/networking/UINetworkRequest.cpp

    r90539 r90540  
    131131}
    132132
    133 void UINetworkRequest::sltRetry()
    134 {
    135     /* Cleanup current network-reply first: */
    136     cleanupNetworkReply();
    137 
    138     /* Choose first url as current: */
    139     m_iUrlIndex = 0;
    140     m_url = m_urls.at(m_iUrlIndex);
    141 
    142     /* Create new network-reply finally: */
    143     prepareNetworkReply();
    144 }
    145 
    146133void UINetworkRequest::sltCancel()
    147134{
  • trunk/src/VBox/Frontends/VirtualBox/src/networking/UINetworkRequest.h

    r90539 r90540  
    3838signals:
    3939
     40    /** Notifies listener about progress started. */
     41    void sigStarted();
    4042    /** Notifies listener about progress changed.
    4143      * @param  iReceived  Brings the amount of bytes received.
    4244      * @param  iTotal     Brings the amount of total bytes to receive. */
    4345    void sigProgress(qint64 iReceived, qint64 iTotal);
    44     /** Notifies listener about progress started. */
    45     void sigStarted();
     46    /** Notifies listener about progress failed.
     47      * @param  strError  Brings the error progress failed with. */
     48    void sigFailed(const QString &strError);
    4649    /** Notifies listener about progress canceled. */
    4750    void sigCanceled();
    4851    /** Notifies listener about progress finished. */
    4952    void sigFinished();
    50     /** Notifies listener about progress failed.
    51       * @param  strError  Brings the error progress failed with . */
    52     void sigFailed(const QString &strError);
    5353
    5454public:
     
    7171public slots:
    7272
    73     /** Initiates request retrying. */
    74     void sltRetry();
    7573    /** Initiates request cancelling. */
    7674    void sltCancel();
  • trunk/src/VBox/Frontends/VirtualBox/src/networking/UINetworkRequestManager.cpp

    r90539 r90540  
    114114}
    115115
     116void UINetworkRequestManager::sltHandleNetworkRequestFailure(const QString &strError)
     117{
     118    /* Make sure we have this request registered: */
     119    UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender());
     120    AssertPtrReturnVoid(pNetworkRequest);
     121    const QUuid uId = m_requests.key(pNetworkRequest);
     122    AssertReturnVoid(!uId.isNull());
     123
     124    /* Delegate request to customer: */
     125    UINetworkCustomer *pNetworkCustomer = m_customers.value(uId);
     126    AssertPtrReturnVoid(pNetworkCustomer);
     127    pNetworkCustomer->processNetworkReplyFailed(strError);
     128
     129    /* Cleanup request: */
     130    cleanupNetworkRequest(uId);
     131}
     132
    116133void UINetworkRequestManager::sltHandleNetworkRequestCancel()
    117134{
     
    148165}
    149166
    150 void UINetworkRequestManager::sltHandleNetworkRequestFailure(const QString &)
    151 {
    152     /* Make sure we have this request registered: */
    153     UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender());
    154     AssertPtrReturnVoid(pNetworkRequest);
    155     const QUuid uId = m_requests.key(pNetworkRequest);
    156     AssertReturnVoid(!uId.isNull());
    157 
    158     /* Delegate request to customer: */
    159     UINetworkCustomer *pNetworkCustomer = m_customers.value(uId);
    160     AssertPtrReturnVoid(pNetworkCustomer);
    161     if (pNetworkCustomer->isItForceCall())
    162     {
    163         /// @todo show notification-center
    164     }
    165 }
    166 
    167167void UINetworkRequestManager::prepare()
    168168{
  • trunk/src/VBox/Frontends/VirtualBox/src/networking/UINetworkRequestManager.h

    r90539 r90540  
    7373    /** Handles progress for @a iReceived amount of bytes among @a iTotal. */
    7474    void sltHandleNetworkRequestProgress(qint64 iReceived, qint64 iTotal);
     75    /** Handles request @a strError. */
     76    void sltHandleNetworkRequestFailure(const QString &strError);
    7577    /** Handles request canceling. */
    7678    void sltHandleNetworkRequestCancel();
    7779    /** Handles request finishing. */
    7880    void sltHandleNetworkRequestFinish();
    79     /** Handles request @a strError. */
    80     void sltHandleNetworkRequestFailure(const QString &strError);
    8181
    8282private:
  • trunk/src/VBox/Frontends/VirtualBox/src/networking/UIUpdateManager.cpp

    r90539 r90540  
    115115    /** Handles network reply progress for @a iReceived amount of bytes among @a iTotal. */
    116116    virtual void processNetworkReplyProgress(qint64 iReceived, qint64 iTotal) /* override */;
     117    /** Handles network reply finishing with specified @a strError. */
     118    virtual void processNetworkReplyFailed(const QString &strError) /* override */;
    117119    /** Handles network reply canceling for a passed @a pReply. */
    118120    virtual void processNetworkReplyCanceled(UINetworkReply *pReply) /* override */;
     
    142144protected:
    143145
     146    /** Handles network reply finishing with specified @a strError. */
     147    virtual void processNetworkReplyFailed(const QString &strError) /* override */;
    144148    /** Handles network reply canceling for a passed @a pReply. */
    145149    virtual void processNetworkReplyCanceled(UINetworkReply *pReply) /* override */;
     
    228232}
    229233
     234void UIUpdateStep::processNetworkReplyFailed(const QString &)
     235{
     236}
     237
    230238void UIUpdateStep::processNetworkReplyCanceled(UINetworkReply *)
    231239{
     
    240248*   Class UIUpdateStepVirtualBox implementation.                                                                                 *
    241249*********************************************************************************************************************************/
     250
     251void UIUpdateStepVirtualBox::processNetworkReplyFailed(const QString &strError)
     252{
     253    Q_UNUSED(strError);
     254
     255    /* Notify about step completion: */
     256    emit sigStepComplete();
     257}
    242258
    243259void UIUpdateStepVirtualBox::processNetworkReplyCanceled(UINetworkReply *pReply)
Note: See TracChangeset for help on using the changeset viewer.

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