VirtualBox

Ignore:
Timestamp:
Mar 21, 2018 2:12:10 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121402
Message:

FE/Qt: bugref:9049: Full and heavy cleanup for UIDownloader and subclasses.

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

Legend:

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

    r71027 r71434  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 /// This class requires proper doxy.
    19 /// For now I'm keeping the old style consistent.
    20 
    2118#ifdef VBOX_WITH_PRECOMPILED_HEADERS
    2219# include <precomp.h>
     
    2421
    2522/* GUI includes: */
    26 # include <UINetworkReply.h>
     23# include "VBoxGlobal.h"
     24# include "VBoxUtils.h"
    2725# include "UIDownloader.h"
    28 # include "VBoxGlobal.h"
    2926# include "UIMessageCenter.h"
    30 # include "VBoxUtils.h"
     27# include "UINetworkReply.h"
    3128
    3229#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3330
    3431
    35 /* Starting routine: */
    3632void UIDownloader::start()
    3733{
     
    3935}
    4036
    41 /* Acknowledging start: */
    4237void UIDownloader::sltStartAcknowledging()
    4338{
     
    4944}
    5045
    51 /* Downloading start: */
    5246void UIDownloader::sltStartDownloading()
    5347{
     
    5953}
    6054
    61 /* Verifying start: */
    6255void UIDownloader::sltStartVerifying()
    6356{
     
    6962}
    7063
    71 /* Constructor: */
    7264UIDownloader::UIDownloader()
    7365    : m_state(UIDownloaderState_Null)
     
    7971}
    8072
    81 /* virtual override */
    8273const QString UIDownloader::description() const
    8374{
     
    9485}
    9586
    96 /* Network-reply progress handler: */
    97 void UIDownloader::processNetworkReplyProgress(qint64 iReceived, qint64 iTotal)
     87void UIDownloader::processNetworkReplyProgress(qint64, qint64)
    9888{
    99     /* Unused variables: */
    100     Q_UNUSED(iReceived);
    101     Q_UNUSED(iTotal);
    10289}
    10390
    104 /* Network-reply canceled handler: */
    105 void UIDownloader::processNetworkReplyCanceled(UINetworkReply *pNetworkReply)
     91void UIDownloader::processNetworkReplyCanceled(UINetworkReply *)
    10692{
    107     /* Unused variables: */
    108     Q_UNUSED(pNetworkReply);
    109 
    11093    /* Delete downloader: */
    11194    deleteLater();
    11295}
    11396
    114 /* Network-reply finished handler: */
    11597void UIDownloader::processNetworkReplyFinished(UINetworkReply *pNetworkReply)
    11698{
     
    138120}
    139121
    140 /* Handle acknowledging result: */
    141122void UIDownloader::handleAcknowledgingResult(UINetworkReply *pNetworkReply)
    142123{
     
    157138}
    158139
    159 /* Handle downloading result: */
    160140void UIDownloader::handleDownloadingResult(UINetworkReply *pNetworkReply)
    161141{
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloader.h

    r71027 r71434  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 /// This class requires proper doxy.
    19 /// For now I'm keeping the old style consistent.
     18#ifndef ___UIDownloader_h___
     19#define ___UIDownloader_h___
    2020
    21 #ifndef __UIDownloader_h__
    22 #define __UIDownloader_h__
    23 
    24 /* Global includes: */
     21/* Qt includes: */
    2522#include <QUrl>
    2623#include <QList>
    2724
    28 /* Local includes: */
     25/* GUI includes: */
     26#include "UINetworkCustomer.h"
    2927#include "UINetworkDefs.h"
    30 #include "UINetworkCustomer.h"
    3128
    3229/* Forward declarations: */
     30class QString;
    3331class UINetworkReply;
    3432
    35 /* Downloader interface.
    36  * UINetworkCustomer class extension which allows background http downloading. */
     33/** Downloader interface.
     34  * UINetworkCustomer class extension which allows background http downloading. */
    3735class UIDownloader : public UINetworkCustomer
    3836{
     
    4139signals:
    4240
    43     /* Signal to start acknowledging: */
     41    /** Signals to start acknowledging. */
    4442    void sigToStartAcknowledging();
    45     /* Signal to start downloading: */
     43    /** Signals to start downloading. */
    4644    void sigToStartDownloading();
    47     /* Signal to start verifying: */
     45    /** Signals to start verifying. */
    4846    void sigToStartVerifying();
    4947
    5048public:
    5149
    52     /* Starting routine: */
     50    /** Starts the sequence. */
    5351    void start();
    5452
    5553protected slots:
    5654
    57     /* Acknowledging part: */
     55    /** Performs acknowledging part. */
    5856    void sltStartAcknowledging();
    59     /* Downloading part: */
     57    /** Performs downloading part. */
    6058    void sltStartDownloading();
    61     /* Verifying part: */
     59    /** Performs verifying part. */
    6260    void sltStartVerifying();
    6361
    6462protected:
    6563
    66     /* UIDownloader states: */
     64    /** UIDownloader states. */
    6765    enum UIDownloaderState
    6866    {
     
    7068        UIDownloaderState_Acknowledging,
    7169        UIDownloaderState_Downloading,
    72         UIDownloaderState_Verifying,
     70        UIDownloaderState_Verifying
    7371    };
    7472
    75     /* Constructor: */
     73    /** Constructs downloader. */
    7674    UIDownloader();
    7775
    78     /* Source stuff,
    79      * allows to set/get one or more sources to try to download from: */
     76    /** Appends subsequent source to try to download from. */
    8077    void addSource(const QString &strSource) { m_sources << QUrl(strSource); }
     78    /** Defines the only one source to try to download from. */
    8179    void setSource(const QString &strSource) { m_sources.clear(); addSource(strSource); }
    82     const QList<QUrl>& sources() const { return m_sources; }
    83     const QUrl& source() const { return m_source; }
     80    /** Returns a list of sources to try to download from. */
     81    const QList<QUrl> &sources() const { return m_sources; }
     82    /** Returns a current source to try to download from. */
     83    const QUrl &source() const { return m_source; }
    8484
    85     /* Target stuff,
    86      * allows to set/get downloaded file destination: */
     85    /** Defines the @a strTarget file-path used to save downloaded file to. */
    8786    void setTarget(const QString &strTarget) { m_strTarget = strTarget; }
    88     const QString& target() const { return m_strTarget; }
     87    /** Returns the target file-path used to save downloaded file to. */
     88    const QString &target() const { return m_strTarget; }
    8989
    90     /* SHA-256 stuff,
    91      * allows to set/get SHA-256 sum dictionary file for downloaded source. */
     90    /** Defines the @a strPathSHA256SumsFile. */
     91    void setPathSHA256SumsFile(const QString &strPathSHA256SumsFile) { m_strPathSHA256SumsFile = strPathSHA256SumsFile; }
     92    /** Returns the SHA-256 sums file-path. */
    9293    QString pathSHA256SumsFile() const { return m_strPathSHA256SumsFile; }
    93     void setPathSHA256SumsFile(const QString &strPathSHA256SumsFile) { m_strPathSHA256SumsFile = strPathSHA256SumsFile; }
    9494
    9595    /** Returns description of the current network operation. */
    9696    virtual const QString description() const;
    9797
    98     /* Start delayed acknowledging: */
     98    /** Starts delayed acknowledging. */
    9999    void startDelayedAcknowledging() { emit sigToStartAcknowledging(); }
    100     /* Start delayed downloading: */
     100    /** Starts delayed downloading. */
    101101    void startDelayedDownloading() { emit sigToStartDownloading(); }
    102     /* Start delayed verifying: */
     102    /** Starts delayed verifying. */
    103103    void startDelayedVerifying() { emit sigToStartVerifying(); }
    104104
    105     /* Network-reply progress handler: */
     105    /** Handles network-reply progress for @a iReceived bytes of @a iTotal. */
    106106    void processNetworkReplyProgress(qint64 iReceived, qint64 iTotal);
    107     /* Network-reply cancel handler: */
    108     void processNetworkReplyCanceled(UINetworkReply *pNetworkReply);
    109     /* Network-reply finish handler: */
    110     void processNetworkReplyFinished(UINetworkReply *pNetworkReply);
     107    /** Handles network-reply cancel request for @a pReply. */
     108    void processNetworkReplyCanceled(UINetworkReply *pReply);
     109    /** Handles network-reply finish for @a pReply. */
     110    void processNetworkReplyFinished(UINetworkReply *pReply);
    111111
    112     /* Handle acknowledging result: */
    113     virtual void handleAcknowledgingResult(UINetworkReply *pNetworkReply);
    114     /* Handle downloading result: */
    115     virtual void handleDownloadingResult(UINetworkReply *pNetworkReply);
    116     /* Handle verifying result: */
    117     virtual void handleVerifyingResult(UINetworkReply *pNetworkReply);
     112    /** Handles acknowledging result. */
     113    virtual void handleAcknowledgingResult(UINetworkReply *pReply);
     114    /** Handles downloading result. */
     115    virtual void handleDownloadingResult(UINetworkReply *pReply);
     116    /** Handles verifying result. */
     117    virtual void handleVerifyingResult(UINetworkReply *pReply);
    118118
    119     /* Pure virtual function to ask user about downloading confirmation: */
    120     virtual bool askForDownloadingConfirmation(UINetworkReply *pNetworkReply) = 0;
    121     /* Pure virtual function to handle downloaded object: */
    122     virtual void handleDownloadedObject(UINetworkReply *pNetworkReply) = 0;
    123     /* Base virtual function to handle verified object: */
    124     virtual void handleVerifiedObject(UINetworkReply * /* pNetworkReply */) {}
     119    /** Asks user for downloading confirmation for passed @a pReply. */
     120    virtual bool askForDownloadingConfirmation(UINetworkReply *pReply) = 0;
     121    /** Handles downloaded object for passed @a pReply. */
     122    virtual void handleDownloadedObject(UINetworkReply *pReply) = 0;
     123    /** Handles verified object for passed @a pReply. */
     124    virtual void handleVerifiedObject(UINetworkReply *pReply) { Q_UNUSED(pReply); }
    125125
    126126private:
    127127
    128     /* Private variables: */
     128    /** Holds the downloader state. */
    129129    UIDownloaderState m_state;
     130
     131    /** Holds the downloading sources. */
    130132    QList<QUrl> m_sources;
    131     QUrl m_source;
     133    /** Holds the current downloading source. */
     134    QUrl        m_source;
     135
     136    /** Holds the downloading target path. */
    132137    QString m_strTarget;
     138
     139    /** Holds the SHA-256 sums file path. */
    133140    QString m_strPathSHA256SumsFile;
    134141};
    135142
    136 #endif // __UIDownloader_h__
     143#endif /* !___UIDownloader_h___ */
    137144
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp

    r71355 r71434  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626
    2727/* GUI includes: */
    28 # include "UIDownloaderAdditions.h"
    29 # include "UINetworkReply.h"
    3028# include "QIFileDialog.h"
    3129# include "VBoxGlobal.h"
     30# include "UIDownloaderAdditions.h"
    3231# include "UIMessageCenter.h"
    3332# include "UIModalWindowManager.h"
     33# include "UINetworkReply.h"
    3434# include "UIVersion.h"
    3535
     
    4141
    4242/* static */
    43 UIDownloaderAdditions* UIDownloaderAdditions::m_spInstance = 0;
     43UIDownloaderAdditions *UIDownloaderAdditions::s_pInstance = 0;
    4444
    4545/* static */
    46 UIDownloaderAdditions* UIDownloaderAdditions::create()
     46UIDownloaderAdditions *UIDownloaderAdditions::create()
    4747{
    48     if (!m_spInstance)
    49         m_spInstance = new UIDownloaderAdditions;
    50     return m_spInstance;
    51 }
    52 
    53 /* static */
    54 UIDownloaderAdditions* UIDownloaderAdditions::current()
    55 {
    56     return m_spInstance;
     48    if (!s_pInstance)
     49        s_pInstance = new UIDownloaderAdditions;
     50    return s_pInstance;
    5751}
    5852
     
    6054{
    6155    /* Prepare instance: */
    62     if (!m_spInstance)
    63         m_spInstance = this;
     56    if (!s_pInstance)
     57        s_pInstance = this;
    6458
    6559    /* Get version number and adjust it for test and trunk builds. The server only has official releases. */
     
    8276{
    8377    /* Cleanup instance: */
    84     if (m_spInstance == this)
    85         m_spInstance = 0;
     78    if (s_pInstance == this)
     79        s_pInstance = 0;
    8680}
    8781
    88 /* virtual override */
    8982const QString UIDownloaderAdditions::description() const
    9083{
     
    9992void UIDownloaderAdditions::handleDownloadedObject(UINetworkReply *pReply)
    10093{
    101     /* Read received data into the buffer: */
    10294    m_receivedData = pReply->readAll();
    10395}
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.h

    r69500 r71434  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIDownloaderAdditions_h__
    19 #define __UIDownloaderAdditions_h__
     18#ifndef ___UIDownloaderAdditions_h___
     19#define ___UIDownloaderAdditions_h___
    2020
    21 /* Local includes: */
     21/* GUI includes: */
    2222#include "UIDownloader.h"
    2323
    24 /* UIDownloader extension for background additions downloading. */
     24/* Forward declarations: */
     25class QByteArray;
     26
     27/** UIDownloader extension for background additions downloading. */
    2528class UIDownloaderAdditions : public UIDownloader
    2629{
     
    2932signals:
    3033
    31     /* Notifies listeners about downloading finished: */
     34    /** Notifies listeners about downloading finished.
     35      * @param  strFile  Brings the downloaded file-name. */
    3236    void sigDownloadFinished(const QString &strFile);
    3337
    3438public:
    3539
    36     /* Static stuff: */
    37     static UIDownloaderAdditions* create();
    38     static UIDownloaderAdditions* current();
     40    /** Creates downloader instance. */
     41    static UIDownloaderAdditions *create();
     42    /** Returns current downloader instance. */
     43    static UIDownloaderAdditions *current() { return s_pInstance; }
    3944
    4045private:
    4146
    42     /* Constructor/destructor: */
     47    /** Constructs downloader. */
    4348    UIDownloaderAdditions();
     49    /** Destructs downloader. */
    4450    ~UIDownloaderAdditions();
    4551
    4652    /** Returns description of the current network operation. */
    47     virtual const QString description() const;
     53    virtual const QString description() const /* override */;
    4854
    49     /* Virtual stuff reimplementations: */
    50     bool askForDownloadingConfirmation(UINetworkReply *pReply);
    51     void handleDownloadedObject(UINetworkReply *pReply);
    52     void handleVerifiedObject(UINetworkReply *pReply);
     55    /** Asks user for downloading confirmation for passed @a pReply. */
     56    virtual bool askForDownloadingConfirmation(UINetworkReply *pReply) /* override */;
     57    /** Handles downloaded object for passed @a pReply. */
     58    virtual void handleDownloadedObject(UINetworkReply *pReply) /* override */;
     59    /** Handles verified object for passed @a pReply. */
     60    virtual void handleVerifiedObject(UINetworkReply *pReply) /* override */;
    5361
    54     /* Variables: */
    55     static UIDownloaderAdditions *m_spInstance;
     62    /** Holds the static singleton instance. */
     63    static UIDownloaderAdditions *s_pInstance;
     64
     65    /** Holds the cached received data awaiting for verification. */
    5666    QByteArray m_receivedData;
    5767};
    5868
    59 #endif // __UIDownloaderAdditions_h__
     69#endif /* !___UIDownloaderAdditions_h___ */
    6070
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp

    r71355 r71434  
    55
    66/*
    7  * Copyright (C) 2011-2017 Oracle Corporation
     7 * Copyright (C) 2011-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626
    2727/* GUI includes: */
    28 # include "UIDownloaderExtensionPack.h"
    29 # include "UINetworkReply.h"
    3028# include "QIFileDialog.h"
    3129# include "VBoxGlobal.h"
     30# include "UIDownloaderExtensionPack.h"
    3231# include "UIMessageCenter.h"
    3332# include "UIModalWindowManager.h"
     33# include "UINetworkReply.h"
    3434# include "UIVersion.h"
    3535
     
    4141
    4242/* static */
    43 UIDownloaderExtensionPack* UIDownloaderExtensionPack::m_spInstance = 0;
     43UIDownloaderExtensionPack *UIDownloaderExtensionPack::s_pInstance = 0;
    4444
    4545/* static */
    46 UIDownloaderExtensionPack* UIDownloaderExtensionPack::create()
     46UIDownloaderExtensionPack *UIDownloaderExtensionPack::create()
    4747{
    48     if (!m_spInstance)
    49         m_spInstance = new UIDownloaderExtensionPack;
    50     return m_spInstance;
    51 }
    52 
    53 /* static */
    54 UIDownloaderExtensionPack* UIDownloaderExtensionPack::current()
    55 {
    56     return m_spInstance;
     48    if (!s_pInstance)
     49        s_pInstance = new UIDownloaderExtensionPack;
     50    return s_pInstance;
    5751}
    5852
     
    6054{
    6155    /* Prepare instance: */
    62     if (!m_spInstance)
    63         m_spInstance = this;
     56    if (!s_pInstance)
     57        s_pInstance = this;
    6458
    6559    /* Get version number and adjust it for test and trunk builds. The server only has official releases. */
     
    8377{
    8478    /* Cleanup instance: */
    85     if (m_spInstance == this)
    86         m_spInstance = 0;
     79    if (s_pInstance == this)
     80        s_pInstance = 0;
    8781}
    8882
    89 /* virtual override */
    9083const QString UIDownloaderExtensionPack::description() const
    9184{
     
    10093void UIDownloaderExtensionPack::handleDownloadedObject(UINetworkReply *pReply)
    10194{
    102     /* Read received data into the buffer: */
    10395    m_receivedData = pReply->readAll();
    10496}
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.h

    r69500 r71434  
    55
    66/*
    7  * Copyright (C) 2011-2017 Oracle Corporation
     7 * Copyright (C) 2011-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIDownloaderExtensionPack_h__
    19 #define __UIDownloaderExtensionPack_h__
     18#ifndef ___UIDownloaderExtensionPack_h___
     19#define ___UIDownloaderExtensionPack_h___
    2020
    21 /* Local includes: */
     21/* GUI includes: */
    2222#include "UIDownloader.h"
    2323
    24 /* UIDownloader extension for background extension-pack downloading. */
     24/* Forward declarations: */
     25class QByteArray;
     26
     27/** UIDownloader extension for background extension-pack downloading. */
    2528class UIDownloaderExtensionPack : public UIDownloader
    2629{
     
    2932signals:
    3033
    31     /* Notifies listeners about downloading finished: */
    32     void sigDownloadFinished(const QString &strSource, const QString &strTarget, QString strHash);
     34    /** Notifies listeners about downloading finished.
     35      * @param  strSource  Brings the downloading source.
     36      * @param  strTarget  Brings the downloading target.
     37      * @param  strHash    Brings the downloaded file hash. */
     38    void sigDownloadFinished(const QString &strSource, const QString &strTarget, const QString &strHash);
    3339
    3440public:
    3541
    36     /* Static stuff: */
    37     static UIDownloaderExtensionPack* create();
    38     static UIDownloaderExtensionPack* current();
     42    /** Creates downloader instance. */
     43    static UIDownloaderExtensionPack *create();
     44    /** Returns current downloader instance. */
     45    static UIDownloaderExtensionPack *current() { return s_pInstance; }
    3946
    4047private:
    4148
    42     /* Constructor/destructor: */
     49    /** Constructs downloader. */
    4350    UIDownloaderExtensionPack();
     51    /** Destructs downloader. */
    4452    ~UIDownloaderExtensionPack();
    4553
    4654    /** Returns description of the current network operation. */
    47     virtual const QString description() const;
     55    virtual const QString description() const /* override */;
    4856
    49     /* Virtual stuff reimplementations: */
    50     bool askForDownloadingConfirmation(UINetworkReply *pReply);
    51     void handleDownloadedObject(UINetworkReply *pReply);
    52     void handleVerifiedObject(UINetworkReply *pReply);
     57    /** Asks user for downloading confirmation for passed @a pReply. */
     58    virtual bool askForDownloadingConfirmation(UINetworkReply *pReply) /* override */;
     59    /** Handles downloaded object for passed @a pReply. */
     60    virtual void handleDownloadedObject(UINetworkReply *pReply) /* override */;
     61    /** Handles verified object for passed @a pReply. */
     62    virtual void handleVerifiedObject(UINetworkReply *pReply) /* override */;
    5363
    54     /* Variables: */
    55     static UIDownloaderExtensionPack *m_spInstance;
     64    /** Holds the static singleton instance. */
     65    static UIDownloaderExtensionPack *s_pInstance;
     66
     67    /** Holds the cached received data awaiting for verification. */
    5668    QByteArray m_receivedData;
    5769};
    5870
    59 #endif // __UIDownloaderExtensionPack_h__
     71#endif /* !___UIDownloaderExtensionPack_h___ */
    6072
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderUserManual.cpp

    r71355 r71434  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626
    2727/* GUI includes: */
    28 # include "UIDownloaderUserManual.h"
    29 # include "UINetworkReply.h"
    3028# include "QIFileDialog.h"
    3129# include "VBoxGlobal.h"
     30# include "UIDownloaderUserManual.h"
    3231# include "UIMessageCenter.h"
    3332# include "UIModalWindowManager.h"
     33# include "UINetworkReply.h"
    3434# include "UIVersion.h"
    3535
     
    3838
    3939/* static */
    40 UIDownloaderUserManual* UIDownloaderUserManual::m_spInstance = 0;
     40UIDownloaderUserManual* UIDownloaderUserManual::s_pInstance = 0;
    4141
    4242/* static */
    4343UIDownloaderUserManual* UIDownloaderUserManual::create()
    4444{
    45     if (!m_spInstance)
    46         m_spInstance = new UIDownloaderUserManual;
    47     return m_spInstance;
    48 }
    49 
    50 /* static */
    51 UIDownloaderUserManual* UIDownloaderUserManual::current()
    52 {
    53     return m_spInstance;
     45    if (!s_pInstance)
     46        s_pInstance = new UIDownloaderUserManual;
     47    return s_pInstance;
    5448}
    5549
     
    5751{
    5852    /* Prepare instance: */
    59     if (!m_spInstance)
    60         m_spInstance = this;
     53    if (!s_pInstance)
     54        s_pInstance = this;
    6155
    6256    /* Get version number and adjust it for test and trunk builds. The server only has official releases. */
     
    8175{
    8276    /* Cleanup instance: */
    83     if (m_spInstance == this)
    84         m_spInstance = 0;
     77    if (s_pInstance == this)
     78        s_pInstance = 0;
    8579}
    8680
    87 /* virtual override */
    8881const QString UIDownloaderUserManual::description() const
    8982{
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderUserManual.h

    r69500 r71434  
    55
    66/*
    7  * Copyright (C) 2010-2017 Oracle Corporation
     7 * Copyright (C) 2010-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1616 */
    1717
    18 #ifndef __UIDownloaderUserManual_h__
    19 #define __UIDownloaderUserManual_h__
     18#ifndef ___UIDownloaderUserManual_h___
     19#define ___UIDownloaderUserManual_h___
    2020
    21 /* Local includes: */
     21/* GUI includes: */
    2222#include "UIDownloader.h"
    2323
    24 /* UIDownloader extension for background user-manual downloading. */
     24/** UIDownloader extension for background user-manual downloading. */
    2525class UIDownloaderUserManual : public UIDownloader
    2626{
     
    2929signals:
    3030
    31     /* Notifies listeners about downloading finished: */
     31    /** Notifies listeners about downloading finished.
     32      * @param  strFile  Brings the downloaded file-name. */
    3233    void sigDownloadFinished(const QString &strFile);
    3334
    3435public:
    3536
    36     /* Static stuff: */
    37     static UIDownloaderUserManual* create();
    38     static UIDownloaderUserManual* current();
     37    /** Creates downloader instance. */
     38    static UIDownloaderUserManual *create();
     39    /** Returns current downloader instance. */
     40    static UIDownloaderUserManual *current() { return s_pInstance; }
    3941
    4042private:
    4143
    42     /* Constructor/destructor: */
     44    /** Constructs downloader. */
    4345    UIDownloaderUserManual();
     46    /** Destructs downloader. */
    4447    ~UIDownloaderUserManual();
    4548
    4649    /** Returns description of the current network operation. */
    47     virtual const QString description() const;
     50    virtual const QString description() const /* override */;
    4851
    49     /* Virtual stuff reimplementations: */
    50     bool askForDownloadingConfirmation(UINetworkReply *pReply);
    51     void handleDownloadedObject(UINetworkReply *pReply);
     52    /** Asks user for downloading confirmation for passed @a pReply. */
     53    virtual bool askForDownloadingConfirmation(UINetworkReply *pReply) /* override */;
     54    /** Handles downloaded object for passed @a pReply. */
     55    virtual void handleDownloadedObject(UINetworkReply *pReply) /* override */;
    5256
    53     /* Variables: */
    54     static UIDownloaderUserManual *m_spInstance;
     57    /** Holds the static singleton instance. */
     58    static UIDownloaderUserManual *s_pInstance;
    5559};
    5660
    57 #endif // __UIDownloaderUserManual_h__
     61#endif /* !___UIDownloaderUserManual_h___ */
    5862
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