From 747dc30f256606e28fd932a9626da7c328114036 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 20 Apr 2013 16:38:15 +0300 Subject: fix style in gui directory. --- src/gui/updaterwindow.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src/gui/updaterwindow.cpp') diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index 7ec4c42f2..935408714 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -57,15 +57,15 @@ const std::string txtUpdateFile = "resources2.txt"; const std::string updateServer2 = "http://download.evolonline.org/manaplus/updates/"; -std::vector loadXMLFile(const std::string &fileName); -std::vector loadTxtFile(const std::string &fileName); +std::vector loadXMLFile(const std::string &fileName); +std::vector loadTxtFile(const std::string &fileName); /** * Load the given file into a vector of updateFiles. */ -std::vector loadXMLFile(const std::string &fileName) +std::vector loadXMLFile(const std::string &fileName) { - std::vector files; + std::vector files; XML::Document doc(fileName, false); const XmlNodePtr rootNode = doc.rootNode(); @@ -81,7 +81,7 @@ std::vector loadXMLFile(const std::string &fileName) if (!xmlNameEqual(fileNode, "update")) continue; - updateFile file; + UpdateFile file; file.name = XML::getProperty(fileNode, "file", ""); file.hash = XML::getProperty(fileNode, "hash", ""); file.type = XML::getProperty(fileNode, "type", "data"); @@ -98,9 +98,9 @@ std::vector loadXMLFile(const std::string &fileName) return files; } -std::vector loadTxtFile(const std::string &fileName) +std::vector loadTxtFile(const std::string &fileName) { - std::vector files; + std::vector files; std::ifstream fileHandler; fileHandler.open(fileName.c_str(), std::ios::in); @@ -112,7 +112,7 @@ std::vector loadTxtFile(const std::string &fileName) fileHandler.getline(name, 256, ' '); fileHandler.getline(hash, 50); - updateFile thisFile; + UpdateFile thisFile; thisFile.name = name; thisFile.hash = hash; thisFile.type = "data"; @@ -144,7 +144,9 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost, mUpdatesDir(updatesDir), mUpdatesDirReal(updatesDir), mCurrentFile("news.txt"), + mNewLabelCaption(), mDownloadProgress(0.0f), + mDownloadMutex(), mCurrentChecksum(0), mStoreInMemory(true), mDownloadComplete(true), @@ -152,6 +154,8 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost, mDownloadedBytes(0), mMemoryBuffer(nullptr), mDownload(nullptr), + mUpdateFiles(), + mTempUpdateFiles(), mUpdateIndex(0), mUpdateIndexOffset(0), mLoadUpdates(applyUpdates), @@ -549,7 +553,7 @@ void UpdaterWindow::loadLocalUpdates(const std::string &dir) { const ResourceManager *const resman = ResourceManager::getInstance(); - std::vector updateFiles + std::vector updateFiles = loadXMLFile(std::string(dir).append("/").append(xmlUpdateFile)); if (updateFiles.empty()) @@ -575,7 +579,7 @@ void UpdaterWindow::loadManaPlusUpdates(const std::string &dir, const ResourceManager *const resman) { std::string fixPath = dir + "/fix"; - std::vector updateFiles + std::vector updateFiles = loadXMLFile(std::string(fixPath).append("/").append(xmlUpdateFile)); for (unsigned int updateIndex = 0, sz = static_cast( @@ -722,7 +726,7 @@ void UpdaterWindow::logic() { if (mUpdateIndex < mUpdateFiles.size()) { - updateFile thisFile = mUpdateFiles[mUpdateIndex]; + UpdateFile thisFile = mUpdateFiles[mUpdateIndex]; if (!thisFile.required) { // This statement checks to see if the file type @@ -794,7 +798,7 @@ void UpdaterWindow::logic() { if (mUpdateIndex < mTempUpdateFiles.size()) { - updateFile thisFile = mTempUpdateFiles[mUpdateIndex]; + UpdateFile thisFile = mTempUpdateFiles[mUpdateIndex]; mCurrentFile = thisFile.name; std::string checksum; checksum = thisFile.hash; -- cgit v1.2.3-70-g09d2