summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-15 22:23:26 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-15 22:23:26 +0300
commitf03edb38328aa5ddb48e10198621bf2353096440 (patch)
treea7fe17c3e7ceee0f646663d115273852c632e0dd /src/resources
parentd0cdad7bf81a07ba4b2f13c73a65fe1c68bb702f (diff)
downloadmanaverse-f03edb38328aa5ddb48e10198621bf2353096440.tar.gz
manaverse-f03edb38328aa5ddb48e10198621bf2353096440.tar.bz2
manaverse-f03edb38328aa5ddb48e10198621bf2353096440.tar.xz
manaverse-f03edb38328aa5ddb48e10198621bf2353096440.zip
in updater window cut news to 50 lines and show link to full news.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/resourcemanager.cpp9
-rw-r--r--src/resources/resourcemanager.h4
2 files changed, 6 insertions, 7 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index 193647a6e..143cf467e 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -1001,25 +1001,24 @@ bool ResourceManager::loadTextFile(const std::string &fileName,
return true;
}
-StringVect ResourceManager::loadTextFileLocal(
- const std::string &fileName)
+bool ResourceManager::loadTextFileLocal(const std::string &fileName,
+ StringVect &lines)
{
std::ifstream file;
char line[501];
- StringVect lines;
file.open(fileName.c_str(), std::ios::in);
if (!file.is_open())
{
logger->log("Couldn't load text file: %s", fileName.c_str());
- return lines;
+ return false;
}
while (file.getline(line, 500))
lines.push_back(line);
- return lines;
+ return true;
}
void ResourceManager::saveTextFile(std::string path, const std::string &name,
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index 88e958245..9fa612e7c 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -268,8 +268,8 @@ class ResourceManager final
/**
* Retrieves the contents of a text file.
*/
- static StringVect loadTextFileLocal(const std::string &fileName)
- A_WARN_UNUSED;
+ static bool loadTextFileLocal(const std::string &fileName,
+ StringVect &lines);
void saveTextFile(std::string path, const std::string &name,
const std::string &text) const;