diff options
author | swirl <roachh@protonmail.com> | 2021-12-31 14:27:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-31 14:27:21 -0500 |
commit | 541e2f0d8d56b1e808ac98b6cf5b3600f324f2fa (patch) | |
tree | 5a300af57c0207d38980319d54dc04218828aa1e /libraries | |
parent | 0c177b1086d69993e012ba1fbed1adf6bfe04144 (diff) | |
parent | fa98ed3ccd74cbf0228baf13851b6bb6d17d51a3 (diff) | |
download | PrismLauncher-541e2f0d8d56b1e808ac98b6cf5b3600f324f2fa.tar.gz PrismLauncher-541e2f0d8d56b1e808ac98b6cf5b3600f324f2fa.tar.bz2 PrismLauncher-541e2f0d8d56b1e808ac98b6cf5b3600f324f2fa.zip |
Merge pull request #8 from dada513/upstream_update
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/iconfix/internal/qiconloader.cpp | 2 | ||||
-rw-r--r-- | libraries/systeminfo/src/sys_unix.cpp | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/libraries/iconfix/internal/qiconloader.cpp b/libraries/iconfix/internal/qiconloader.cpp index 41cf3d50..0d8466f0 100644 --- a/libraries/iconfix/internal/qiconloader.cpp +++ b/libraries/iconfix/internal/qiconloader.cpp @@ -320,7 +320,7 @@ Description: Make it so that the QIcon loader honors /usr/share/pixmaps icon theme specification. Bug: https://bugreports.qt.nokia.com/browse/QTBUG-12874 *********************************************************************/ -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) /* Freedesktop standard says to look in /usr/share/pixmaps last */ if (entries.isEmpty()) { diff --git a/libraries/systeminfo/src/sys_unix.cpp b/libraries/systeminfo/src/sys_unix.cpp index fb96c72c..b3098522 100644 --- a/libraries/systeminfo/src/sys_unix.cpp +++ b/libraries/systeminfo/src/sys_unix.cpp @@ -47,6 +47,7 @@ Sys::KernelInfo Sys::getKernelInfo() uint64_t Sys::getSystemRam() { std::string token; +#ifdef Q_OS_LINUX std::ifstream file("/proc/meminfo"); while(file >> token) { @@ -65,6 +66,19 @@ uint64_t Sys::getSystemRam() // ignore rest of the line file.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); } +#elif defined(Q_OS_FREEBSD) + char buff[512]; + FILE *fp = popen("sysctl hw.physmem", "r"); + if (fp != NULL) + { + while(fgets(buff, 512, fp) != NULL) + { + std::string str(buff); + uint64_t mem = std::stoull(str.substr(12, std::string::npos)); + return mem * 1024ull; + } + } +#endif return 0; // nothing found } |