Changeset 71528 in vbox
- Timestamp:
- Mar 27, 2018 4:30:31 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/net
- Files:
-
- 3 edited
-
UIUpdateDefs.cpp (modified) (14 diffs)
-
UIUpdateDefs.h (modified) (5 diffs)
-
UIUpdateManager.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateDefs.cpp
r70824 r71528 5 5 6 6 /* 7 * Copyright (C) 2006-201 7Oracle Corporation7 * Copyright (C) 2006-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #else /* !VBOX_WITH_PRECOMPILED_HEADERS */ 21 21 22 /* Globalincludes: */22 /* Qt includes: */ 23 23 # include <QCoreApplication> 24 24 # include <QStringList> 25 25 26 /* Local includes: */ 26 /* GUI includes: */ 27 # include "VBoxGlobal.h" 27 28 # include "UIUpdateDefs.h" 28 # include "VBoxGlobal.h"29 29 30 30 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 40 40 m_dayList.clear(); 41 41 42 /* To avoid re-translation complexity 43 * all values will be retranslated separately: */ 42 // WORKAROUND: 43 // To avoid re-translation complexity 44 // all values will be retranslated separately. 44 45 45 46 /* Separately retranslate each day: */ … … 65 66 QStringList result; 66 67 for (int i = 0; i < m_dayList.size(); ++i) 67 result << m_dayList [i].val;68 result << m_dayList.at(i).val; 68 69 return result; 69 70 } … … 71 72 VBoxUpdateData::VBoxUpdateData(const QString &strData) 72 73 : m_strData(strData) 73 , m_ periodIndex(Period1Day)74 , m_ branchIndex(BranchStable)74 , m_enmPeriodIndex(Period1Day) 75 , m_enmBranchIndex(BranchStable) 75 76 { 76 77 decode(); 77 78 } 78 79 79 VBoxUpdateData::VBoxUpdateData(PeriodType periodIndex, BranchType branchIndex)80 VBoxUpdateData::VBoxUpdateData(PeriodType enmPeriodIndex, BranchType enmBranchIndex) 80 81 : m_strData(QString()) 81 , m_ periodIndex(periodIndex)82 , m_ branchIndex(branchIndex)82 , m_enmPeriodIndex(enmPeriodIndex) 83 , m_enmBranchIndex(enmBranchIndex) 83 84 { 84 85 encode(); … … 88 89 { 89 90 /* Return 'false' if Period == Never: */ 90 return m_ periodIndex == PeriodNever;91 return m_enmPeriodIndex == PeriodNever; 91 92 } 92 93 … … 116 117 VBoxUpdateData::PeriodType VBoxUpdateData::periodIndex() const 117 118 { 118 return m_ periodIndex;119 return m_enmPeriodIndex; 119 120 } 120 121 … … 126 127 VBoxUpdateData::BranchType VBoxUpdateData::branchIndex() const 127 128 { 128 return m_ branchIndex;129 return m_enmBranchIndex; 129 130 } 130 131 131 132 QString VBoxUpdateData::branchName() const 132 133 { 133 switch (m_ branchIndex)134 switch (m_enmBranchIndex) 134 135 { 135 136 case BranchStable: … … 152 153 /* Parse standard values: */ 153 154 if (m_strData == "never") 154 m_ periodIndex = PeriodNever;155 m_enmPeriodIndex = PeriodNever; 155 156 /* Parse other values: */ 156 157 else … … 164 165 populate(); 165 166 PeriodType index = (PeriodType)m_dayList.indexOf(VBoxUpdateDay(QString(), parser[0])); 166 m_ periodIndex = index == PeriodUndefined ? Period1Day : index;167 m_enmPeriodIndex = index == PeriodUndefined ? Period1Day : index; 167 168 } 168 169 … … 178 179 { 179 180 QString branch(parser[2]); 180 m_ branchIndex = branch == "withbetas" ? BranchWithBetas :181 m_enmBranchIndex = branch == "withbetas" ? BranchWithBetas : 181 182 branch == "allrelease" ? BranchAllRelease : BranchStable; 182 183 } … … 193 194 { 194 195 /* Encode standard values: */ 195 if (m_ periodIndex == PeriodNever)196 if (m_enmPeriodIndex == PeriodNever) 196 197 m_strData = "never"; 197 198 /* Encode other values: */ … … 201 202 if (m_dayList.isEmpty()) 202 203 populate(); 203 QString remindPeriod = m_dayList[m_ periodIndex].key;204 QString remindPeriod = m_dayList[m_enmPeriodIndex].key; 204 205 205 206 /* Encode 'date' value: */ … … 215 216 216 217 /* Encode 'branch' value: */ 217 QString branchValue = m_ branchIndex == BranchWithBetas ? "withbetas" :218 m_ branchIndex == BranchAllRelease ? "allrelease" : "stable";218 QString branchValue = m_enmBranchIndex == BranchWithBetas ? "withbetas" : 219 m_enmBranchIndex == BranchAllRelease ? "allrelease" : "stable"; 219 220 220 221 /* Encode 'version' value: */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateDefs.h
r70824 r71528 5 5 6 6 /* 7 * Copyright (C) 2006-201 7Oracle Corporation7 * Copyright (C) 2006-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 27 27 28 /* This structure is usedto store retranslated reminder values. */28 /** Structure to store retranslated reminder values. */ 29 29 struct VBoxUpdateDay 30 30 { … … 40 40 41 41 42 /* This class is used to encode/decode update data. */42 /** Class used to encode/decode update data. */ 43 43 class VBoxUpdateData 44 44 { 45 45 public: 46 46 47 /* Period types:*/47 /** Period types. */ 48 48 enum PeriodType 49 49 { … … 62 62 }; 63 63 64 /* Branch types:*/64 /** Branch types. */ 65 65 enum BranchType 66 66 { … … 70 70 }; 71 71 72 /* Public static helpers:*/72 /** Populates a set of update options. */ 73 73 static void populate(); 74 /** Returns a list of update options. */ 74 75 static QStringList list(); 75 76 76 /* Constructors:*/77 /** Constructs update description on the basis of passed @a strData. */ 77 78 VBoxUpdateData(const QString &strData); 78 VBoxUpdateData(PeriodType periodIndex, BranchType branchIndex); 79 /** Constructs update description on the basis of passed @a enmPeriodIndex and @a enmBranchIndex. */ 80 VBoxUpdateData(PeriodType enmPeriodIndex, BranchType enmBranchIndex); 79 81 80 /* Public helpers:*/82 /** Returns whether there is no need to check. */ 81 83 bool isNoNeedToCheck() const; 84 /** Returns whether there is really need to check. */ 82 85 bool isNeedToCheck() const; 86 /** Returns update data. */ 83 87 QString data() const; 88 /** Returns period index. */ 84 89 PeriodType periodIndex() const; 90 /** Returns update date. */ 85 91 QString date() const; 92 /** Returns branch index. */ 86 93 BranchType branchIndex() const; 94 /** Returns period name. */ 87 95 QString branchName() const; 96 /** Returns version. */ 88 97 UIVersion version() const; 89 98 90 99 private: 91 100 92 /* Private helpers:*/101 /** Decodes data. */ 93 102 void decode(); 103 /** Encodes data. */ 94 104 void encode(); 95 105 96 /* Private variables:*/106 /** Holds the populated list of update options. */ 97 107 static VBoxUpdateDayList m_dayList; 98 QString m_strData; 99 PeriodType m_periodIndex; 100 QDate m_date; 101 BranchType m_branchIndex; 102 UIVersion m_version; 108 109 /** Holds the update data. */ 110 QString m_strData; 111 /** Holds the update period index. */ 112 PeriodType m_enmPeriodIndex; 113 /** Holds the update date. */ 114 QDate m_date; 115 /** Holds the update branch index. */ 116 BranchType m_enmBranchIndex; 117 /** Holds the update version. */ 118 UIVersion m_version; 103 119 }; 120 104 121 105 122 #endif /* !___UIUpdateDefs_h___ */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp
r71461 r71528 30 30 # include "QIProcess.h" 31 31 # include "VBoxGlobal.h" 32 # include "VBoxLicenseViewer.h"33 32 # include "VBoxUtils.h" 34 33 # include "UIDownloaderExtensionPack.h"
Note:
See TracChangeset
for help on using the changeset viewer.

