- Timestamp:
- May 22, 2019 4:39:59 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/net
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp
r76606 r78668 147 147 while (true) 148 148 { 149 /* Try to open file for writing: */ 149 /* Make sure the file already exists. If we reached 150 * this place, it's already written and checked. */ 150 151 QFile file(target()); 151 if (file.open(QIODevice::WriteOnly)) 152 bool fSuccess = false; 153 /* Check step. Try to open file for reading first. */ 154 if (file.open(QIODevice::ReadOnly)) 155 fSuccess = true; 156 /* Failsafe step. Try to open file for writing otherwise. */ 157 if (!fSuccess && file.open(QIODevice::WriteOnly)) 152 158 { 153 159 /* Write buffer into the file: */ 154 160 file.write(m_receivedData); 155 161 file.close(); 156 162 fSuccess = true; 163 } 164 /* If the file already exists or was just written: */ 165 if (fSuccess) 166 { 157 167 /* Warn the user about additions-image loaded and saved, propose to mount it: */ 158 168 if (msgCenter().proposeMountGuestAdditions(source().toString(), QDir::toNativeSeparators(target()))) -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp
r76606 r78668 149 149 while (true) 150 150 { 151 /* Try to open file for writing: */ 151 /* Make sure the file already exists. If we reached 152 * this place, it's already written and checked. */ 152 153 QFile file(target()); 153 if (file.open(QIODevice::WriteOnly)) 154 bool fSuccess = false; 155 /* Check step. Try to open file for reading first. */ 156 if (file.open(QIODevice::ReadOnly)) 157 fSuccess = true; 158 /* Failsafe step. Try to open file for writing otherwise. */ 159 if (!fSuccess && file.open(QIODevice::WriteOnly)) 154 160 { 155 161 /* Write buffer into the file: */ 156 162 file.write(m_receivedData); 157 163 file.close(); 158 164 fSuccess = true; 165 } 166 /* If the file already exists or was just written: */ 167 if (fSuccess) 168 { 159 169 /* Warn the listener about extension-pack was downloaded: */ 160 170 emit sigDownloadFinished(source().toString(), target(), strCalculatedSumm); -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderUserManual.cpp
r76606 r78668 90 90 while (true) 91 91 { 92 /* Try to open file for writing: */ 92 /* Make sure the file already exists. If we reached 93 * this place, it's already written and checked. */ 93 94 QFile file(target()); 94 if (file.open(QIODevice::WriteOnly)) 95 bool fSuccess = false; 96 /* Check step. Try to open file for reading first. */ 97 if (file.open(QIODevice::ReadOnly)) 98 fSuccess = true; 99 /* Failsafe step. Try to open file for writing otherwise. */ 100 if (!fSuccess && file.open(QIODevice::WriteOnly)) 95 101 { 96 102 /* Write buffer into the file: */ 97 103 file.write(receivedData); 98 104 file.close(); 99 105 fSuccess = true; 106 } 107 /* If the file already exists or was just written: */ 108 if (fSuccess) 109 { 100 110 /* Warn the user about user-manual loaded and saved: */ 101 111 msgCenter().warnAboutUserManualDownloaded(source().toString(), QDir::toNativeSeparators(target()));
Note:
See TracChangeset
for help on using the changeset viewer.