mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
[welcome] Chase deprecations in Qt (screen geometry)
This commit is contained in:
parent
c2ebfbf6ae
commit
a70b7ad89e
1 changed files with 21 additions and 1 deletions
|
@ -48,6 +48,7 @@
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
#include <QScreen>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <unistd.h> //geteuid
|
#include <unistd.h> //geteuid
|
||||||
|
@ -59,9 +60,28 @@ GeneralRequirements::GeneralRequirements( QObject* parent )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QSize
|
||||||
|
biggestSingleScreen()
|
||||||
|
{
|
||||||
|
QSize s;
|
||||||
|
for ( const auto* screen : QGuiApplication::screens() )
|
||||||
|
{
|
||||||
|
QSize thisScreen = screen->availableSize();
|
||||||
|
if ( !s.isValid() )
|
||||||
|
{
|
||||||
|
s = thisScreen;
|
||||||
|
}
|
||||||
|
else if ( s.width() * s.height() < thisScreen.width() * thisScreen.height() )
|
||||||
|
{
|
||||||
|
s = thisScreen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
Calamares::RequirementsList GeneralRequirements::checkRequirements()
|
Calamares::RequirementsList GeneralRequirements::checkRequirements()
|
||||||
{
|
{
|
||||||
QSize availableSize = qApp->desktop()->availableGeometry().size();
|
QSize availableSize = biggestSingleScreen();
|
||||||
|
|
||||||
bool enoughStorage = false;
|
bool enoughStorage = false;
|
||||||
bool enoughRam = false;
|
bool enoughRam = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue