Fix formatting for high_privilege_warning

This commit is contained in:
AdenKoperczak 2024-12-19 17:24:36 -05:00
parent 923dad4e2e
commit 6408e1b876
5 changed files with 23 additions and 17 deletions

View file

@ -85,7 +85,7 @@ int main(int argc, char* argv[])
}
// Test to see if scwx was run with high privilege
std::string appDataPath {
const std::string appDataPath {
QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)
.toStdString()};

View file

@ -32,7 +32,8 @@ HighPrivilegeDialog::HighPrivilegeDialog(QWidget* parent) :
ui->setupUi(this);
}
bool HighPrivilegeDialog::disable_high_privilege_message() {
bool HighPrivilegeDialog::disable_high_privilege_message()
{
return ui->highPrivilegeCheckBox->isChecked();
}
@ -44,4 +45,3 @@ HighPrivilegeDialog::~HighPrivilegeDialog()
} // namespace ui
} // namespace qt
} // namespace scwx

View file

@ -25,7 +25,7 @@ private:
public:
explicit HighPrivilegeDialog(QWidget* parent = nullptr);
~HighPrivilegeDialog();
~HighPrivilegeDialog() override;
bool disable_high_privilege_message();

View file

@ -2,14 +2,17 @@
#include <QtGlobal>
#ifdef _WIN32
#include <windows.h>
# include <windows.h>
#else
#include <unistd.h>
# include <unistd.h>
#endif
namespace scwx {
namespace qt {
namespace util {
namespace scwx
{
namespace qt
{
namespace util
{
bool is_high_privilege()
{
@ -33,7 +36,7 @@ bool is_high_privilege()
CloseHandle(token);
return isAdmin;
#elif defined(Q_OS_UNIX)
// On UNIX root is always uid 0. On Linux this is enforced by the kernal.
// On UNIX root is always uid 0. On Linux this is enforced by the kernel.
return geteuid() == 0;
#endif
}

View file

@ -1,8 +1,11 @@
#pragma once
namespace scwx {
namespace qt {
namespace util {
namespace scwx
{
namespace qt
{
namespace util
{
bool is_high_privilege();