Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
f350e898
Commit
f350e898
authored
10 years ago
by
Van Herck, Walter
Browse files
Options
Downloads
Patches
Plain Diff
Rename enumerations and enumerators (11)
parent
b1157c50
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/coregui/utils/hostosinfo.h
+13
-13
13 additions, 13 deletions
GUI/coregui/utils/hostosinfo.h
with
13 additions
and
13 deletions
GUI/coregui/utils/hostosinfo.h
+
13
−
13
View file @
f350e898
...
...
@@ -8,34 +8,34 @@ namespace Utils {
#define QTC_WIN_EXE_SUFFIX ".exe"
enum
OsType
{
OsTypeWindows
,
OsTypeLinux
,
OsTypeMac
,
OsTypeOtherUnix
,
OsTypeOther
};
enum
E
OsType
{
WINDOWS_OS
,
LINUX_OS
,
MAC_OS
,
OTHER_UNIX_OS
,
OTHER_OS
};
class
BA_CORE_API_
OsSpecificAspects
{
public:
OsSpecificAspects
(
OsType
osType
)
:
m_osType
(
osType
)
{
}
OsSpecificAspects
(
E
OsType
osType
)
:
m_osType
(
osType
)
{
}
QString
withExecutableSuffix
(
const
QString
&
executable
)
const
{
QString
finalName
=
executable
;
if
(
m_osType
==
OsTypeWindows
)
if
(
m_osType
==
WINDOWS_OS
)
finalName
+=
QLatin1String
(
QTC_WIN_EXE_SUFFIX
);
return
finalName
;
}
Qt
::
CaseSensitivity
fileNameCaseSensitivity
()
const
{
return
m_osType
==
OsTypeWindows
?
Qt
::
CaseInsensitive
:
Qt
::
CaseSensitive
;
return
m_osType
==
WINDOWS_OS
?
Qt
::
CaseInsensitive
:
Qt
::
CaseSensitive
;
}
QChar
pathListSeparator
()
const
{
return
QLatin1Char
(
m_osType
==
OsTypeWindows
?
';'
:
':'
);
return
QLatin1Char
(
m_osType
==
WINDOWS_OS
?
';'
:
':'
);
}
Qt
::
KeyboardModifier
controlModifier
()
const
{
return
m_osType
==
OsTypeMac
?
Qt
::
MetaModifier
:
Qt
::
ControlModifier
;
return
m_osType
==
MAC_OS
?
Qt
::
MetaModifier
:
Qt
::
ControlModifier
;
}
private
:
const
OsType
m_osType
;
const
E
OsType
m_osType
;
};
...
...
@@ -43,15 +43,15 @@ class BA_CORE_API_ HostOsInfo
{
public:
static
inline
OsType
hostOs
();
static
inline
E
OsType
hostOs
();
enum
HostArchitecture
{
HostArchitectureX86
,
HostArchitectureAMD64
,
HostArchitectureItanium
,
HostArchitectureArm
,
HostArchitectureUnknown
};
static
HostArchitecture
hostArchitecture
();
static
bool
isWindowsHost
()
{
return
hostOs
()
==
OsTypeWindows
;
}
static
bool
isLinuxHost
()
{
return
hostOs
()
==
OsTypeLinux
;
}
static
bool
isMacHost
()
{
return
hostOs
()
==
OsTypeMac
;
}
static
bool
isWindowsHost
()
{
return
hostOs
()
==
WINDOWS_OS
;
}
static
bool
isLinuxHost
()
{
return
hostOs
()
==
LINUX_OS
;
}
static
bool
isMacHost
()
{
return
hostOs
()
==
MAC_OS
;
}
static
inline
bool
isAnyUnixHost
();
static
QString
withExecutableSuffix
(
const
QString
&
executable
)
...
...
@@ -79,12 +79,12 @@ private:
};
BA_CORE_API_
OsType
HostOsInfo
::
hostOs
()
BA_CORE_API_
E
OsType
HostOsInfo
::
hostOs
()
{
#if defined(Q_OS_WIN)
return
OsTypeWindows
;
#elif defined(Q_OS_LINUX)
return
OsTypeLinux
;
return
LINUX_OS
;
#elif defined(Q_OS_MAC)
return
OsTypeMac
;
#elif defined(Q_OS_UNIX)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment