summaryrefslogtreecommitdiff
path: root/src/commands.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-26 22:34:19 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-26 22:34:19 +0300
commit76fd633b0042f2ab3a161460ee03c1978e7c0db9 (patch)
tree49ac22bd396af6329bfdffe69a775de7dedaa553 /src/commands.cpp
parentf2849928b3eca83581ba77be8bf3b002085fdc9a (diff)
downloadmv-76fd633b0042f2ab3a161460ee03c1978e7c0db9.tar.gz
mv-76fd633b0042f2ab3a161460ee03c1978e7c0db9.tar.bz2
mv-76fd633b0042f2ab3a161460ee03c1978e7c0db9.tar.xz
mv-76fd633b0042f2ab3a161460ee03c1978e7c0db9.zip
Move chat command /dump into actions.
Diffstat (limited to 'src/commands.cpp')
-rw-r--r--src/commands.cpp86
1 files changed, 0 insertions, 86 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index fe49d64d6..b1c6537f6 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -572,92 +572,6 @@ impHandler0(dumpGL)
}
#endif
-#ifdef DEBUG_DUMP_LEAKS1
-void showRes(std::string str, ResourceManager::Resources *res);
-
-void showRes(std::string str, ResourceManager::Resources *res)
-{
- if (!res)
- return;
-
- str.append(toString(res->size()));
- if (debugChatTab)
- debugChatTab->chatLog(str);
- logger->log(str);
- ResourceManager::ResourceIterator iter = res->begin();
- const ResourceManager::ResourceIterator iter_end = res->end();
- while (iter != iter_end)
- {
- if (iter->second && iter->second->getRefCount())
- {
- char type = ' ';
- char isNew = 'N';
- if (iter->second->getDumped())
- isNew = 'O';
- else
- iter->second->setDumped(true);
-
- SubImage *const subImage = dynamic_cast<SubImage *const>(
- iter->second);
- Image *const image = dynamic_cast<Image *const>(iter->second);
- int id = 0;
- if (subImage)
- type = 'S';
- else if (image)
- type = 'I';
- if (image)
- id = image->getGLImage();
- logger->log("Resource %c%c: %s (%d) id=%d", type,
- isNew, iter->second->getIdPath().c_str(),
- iter->second->getRefCount(), id);
- }
- ++ iter;
- }
-}
-
-impHandler(dump)
-{
- if (!debugChatTab)
- return false;
-
- ResourceManager *const resman = ResourceManager::getInstance();
-
- if (!event.args.empty())
- {
- ResourceManager::Resources *res = resman->getResources();
- // TRANSLATORS: dump command
- showRes(_("Resource images:"), res);
- res = resman->getOrphanedResources();
- // TRANSLATORS: dump command
- showRes(_("Resource orphaned images:"), res);
- }
- else
- {
- ResourceManager::Resources *res = resman->getResources();
- // TRANSLATORS: dump command
- debugChatTab->chatLog(_("Resource images:") + toString(res->size()));
- res = resman->getOrphanedResources();
- // TRANSLATORS: dump command
- debugChatTab->chatLog(_("Resource orphaned images:")
- + toString(res->size()));
- }
- return true;
-}
-
-#elif defined ENABLE_MEM_DEBUG
-impHandler0(dump)
-{
- check_leaks();
- return true;
-}
-#else
-impHandler0(dump)
-{
- return true;
-}
-#endif
-
-
impHandler0(dumpOGL)
{
#if defined USE_OPENGL && !defined ANDROID