MCPcopy Create free account
hub / github.com/KDE/kdevelop / errorCodeToString

Function errorCodeToString

app/3rdparty/qtsingleapplication/qtlockedfile_win.cpp:37–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35#define SEMAPHORE_MAX 100
36
37static QString errorCodeToString(DWORD errorCode)
38{
39 QString result;
40 char *data = 0;
41 FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
42 0, errorCode, 0,
43 (char*)&data, 0, 0);
44 result = QString::fromLocal8Bit(data);
45 if (data != 0)
46 LocalFree(data);
47
48 if (result.endsWith(QLatin1Char('\n')))
49 result.truncate(result.length() - 1);
50
51 return result;
52}
53
54bool QtLockedFile::lock(LockMode mode, bool block)
55{

Callers 3

lockMethod · 0.85
unlockMethod · 0.85
~QtLockedFileMethod · 0.85

Calls 2

endsWithMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected