mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Port Tools::platform() to Qt 5.
The Q_WS_* definitions are gone.
This commit is contained in:
parent
6502da549b
commit
03a330a4dd
@ -17,7 +17,7 @@
|
||||
|
||||
#include "Tools.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QApplication>
|
||||
#include <QImageReader>
|
||||
#include <QIODevice>
|
||||
#include <QLocale>
|
||||
@ -211,15 +211,22 @@ void wait(int ms)
|
||||
|
||||
QString platform()
|
||||
{
|
||||
#if defined(Q_WS_X11)
|
||||
return "x11";
|
||||
#elif defined(Q_WS_MAC)
|
||||
return "mac";
|
||||
#elif defined(Q_WS_WIN)
|
||||
return "win";
|
||||
#else
|
||||
return QString();
|
||||
#endif
|
||||
// TODO: move callers to QApplication::platformName()
|
||||
|
||||
QString platform = QApplication::platformName();
|
||||
|
||||
if (platform == "xcb") {
|
||||
return "x11";
|
||||
}
|
||||
else if (platform == "cocoa") {
|
||||
return "mac";
|
||||
}
|
||||
else if (platform == "windows") {
|
||||
return "win";
|
||||
}
|
||||
else {
|
||||
return platform;
|
||||
}
|
||||
}
|
||||
|
||||
void disableCoreDumps()
|
||||
|
Loading…
Reference in New Issue
Block a user