Change screenshot filename to one likely to work on all modern filesystems
authorCraig Robbins <kde.psych@gmail.com>
Mon, 6 Apr 2015 01:07:51 +0000 (11:07 +1000)
committerCraig Robbins <kde.psych@gmail.com>
Mon, 6 Apr 2015 01:07:51 +0000 (11:07 +1000)
Fixes #2603

src/client.cpp

index d2bbdc284a95d65264aa3607ab0c99d5a83e7b31..a0740a1e85c7b3d41d29cd95eaf76ef458e0a96e 100644 (file)
@@ -1709,7 +1709,7 @@ void Client::makeScreenshot(IrrlichtDevice *device)
        struct tm *tm = localtime(&t);
 
        char timetstamp_c[64];
-       strftime(timetstamp_c, sizeof(timetstamp_c), "%FT%T", tm);
+       strftime(timetstamp_c, sizeof(timetstamp_c), "%Y%m%d_%H%M%S", tm);
 
        std::string filename_base = g_settings->get("screenshot_path")
                        + DIR_DELIM
@@ -1722,7 +1722,7 @@ void Client::makeScreenshot(IrrlichtDevice *device)
        unsigned serial = 0;
 
        while (serial < SCREENSHOT_MAX_SERIAL_TRIES) {
-               filename = filename_base + (serial > 0 ? ("-" + itos(serial)) : "") + filename_ext;
+               filename = filename_base + (serial > 0 ? ("_" + itos(serial)) : "") + filename_ext;
                std::ifstream tmp(filename.c_str());
                if (!tmp.good())
                        break;  // File did not apparently exist, we'll go with it