[Libreoffice-commits] online.git: loolwsd/TileCache.cpp loolwsd/TileCache.hpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Sat Mar 26 17:05:36 UTC 2016
loolwsd/TileCache.cpp | 13 ++++---------
loolwsd/TileCache.hpp | 3 ---
2 files changed, 4 insertions(+), 12 deletions(-)
New commits:
commit 92ef78b6084ac8abc80eaa291a4a6fc9495b37f8
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sat Mar 26 08:14:42 2016 -0400
loolwsd: optimized TileCache::toplevelCacheDirName away
Change-Id: Iaac48b77e186e8069017093dffc1c432cfca8572
Reviewed-on: https://gerrit.libreoffice.org/23535
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/TileCache.cpp b/loolwsd/TileCache.cpp
index 201d7c9..c51f83a 100644
--- a/loolwsd/TileCache.cpp
+++ b/loolwsd/TileCache.cpp
@@ -308,11 +308,6 @@ void TileCache::removeFile(const std::string fileName)
Util::removeFile(editingTextFile);
}
-std::string TileCache::toplevelCacheDirName()
-{
- return _rootCacheDir;
-}
-
std::string TileCache::cacheDirName(const bool useEditingCache)
{
return (useEditingCache ? _editCacheDir : _persCacheDir);
@@ -354,7 +349,7 @@ bool TileCache::intersectsTile(const std::string& fileName, int part, int x, int
Timestamp TileCache::getLastModified()
{
- std::fstream modTimeFile(toplevelCacheDirName() + "/modtime.txt", std::ios::in);
+ std::fstream modTimeFile(_rootCacheDir + "/modtime.txt", std::ios::in);
if (!modTimeFile.is_open())
return 0;
@@ -368,7 +363,7 @@ Timestamp TileCache::getLastModified()
void TileCache::saveLastModified(const Poco::Timestamp& timestamp)
{
- std::fstream modTimeFile(toplevelCacheDirName() + "/modtime.txt", std::ios::out);
+ std::fstream modTimeFile(_rootCacheDir + "/modtime.txt", std::ios::out);
modTimeFile << timestamp.raw() << std::endl;
modTimeFile.close();
}
@@ -417,7 +412,7 @@ void TileCache::setup(const std::string& timestamp)
if (cleanEverything)
{
// document changed externally, clean up everything
- const auto path = toplevelCacheDirName();
+ const auto path = _rootCacheDir;
Util::removeFile(path, true);
Log::info("Completely cleared cache: " + path);
}
@@ -429,7 +424,7 @@ void TileCache::setup(const std::string& timestamp)
Log::info("Cleared the editing cache: " + path);
}
- File cacheDir(toplevelCacheDirName());
+ File cacheDir(_rootCacheDir);
cacheDir.createDirectories();
saveLastModified(lastModified);
diff --git a/loolwsd/TileCache.hpp b/loolwsd/TileCache.hpp
index 8b08681..aad3e8d 100644
--- a/loolwsd/TileCache.hpp
+++ b/loolwsd/TileCache.hpp
@@ -67,9 +67,6 @@ public:
void removeFile(const std::string fileName);
private:
- /// Toplevel cache dirname.
- std::string toplevelCacheDirName();
-
/// Path of the (sub-)cache dir, the parameter specifies which (sub-)cache to use.
std::string cacheDirName(bool useEditingCache);
More information about the Libreoffice-commits
mailing list