MCPcopy Create free account
hub / github.com/bumptop/BumpTop / getUpdateMessageString

Method getUpdateMessageString

trunk/win/Source/BT_UpdateServer.cpp:50–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50QString UpdateServerImpl::getUpdateMessageString()
51{
52 QString existingMessagePath = _downloadDirPath + "\\message.txt";
53 QString existingMessage;
54 if (exists(existingMessagePath))
55 existingMessage = read_file_utf8(existingMessagePath);
56
57 FileTransfer messageFileTransfer(FileTransfer::Download, 0);
58 messageFileTransfer
59 .setUrl(_messageFileUrl)
60 .setTemporaryString();
61 if (ftManager->addTransfer(messageFileTransfer))
62 {
63 QString newMessage = messageFileTransfer.getTemporaryString();
64 if (existingMessage != newMessage)
65 {
66 int i = newMessage.indexOf("<error>", 0, Qt::CaseInsensitive);
67 int j = newMessage.lastIndexOf("</error>", -1, Qt::CaseInsensitive);
68 bool isS3Error = (i > -1) && (j > -1);
69 if (!isS3Error)
70 {
71 QDir().mkpath(native(parent(existingMessagePath)));
72 write_file_utf8(newMessage, existingMessagePath);
73 return newMessage;
74 }
75 }
76 }
77
78 return QString();
79}
80
81QString UpdateServerImpl::getDownloadedInstallerFile()
82{

Callers 1

getUpdateMessageMethod · 0.80

Calls 11

read_file_utf8Function · 0.85
write_file_utf8Function · 0.85
addTransferMethod · 0.80
getTemporaryStringMethod · 0.80
existsFunction · 0.70
nativeFunction · 0.70
parentFunction · 0.70
QDirClass · 0.50
QStringFunction · 0.50
indexOfMethod · 0.45
lastIndexOfMethod · 0.45

Tested by

no test coverage detected