[welcome] Simplify code
- Kevin Kofler pointed out there was a redundant else-if - Only use size for comparison if it's valid
This commit is contained in:
parent
7029c427f1
commit
5cb0ee6cc5
@ -67,11 +67,7 @@ biggestSingleScreen()
|
||||
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() )
|
||||
if ( !s.isValid() || ( s.width() * s.height() < thisScreen.width() * thisScreen.height() ) )
|
||||
{
|
||||
s = thisScreen;
|
||||
}
|
||||
@ -88,7 +84,7 @@ Calamares::RequirementsList GeneralRequirements::checkRequirements()
|
||||
bool hasPower = false;
|
||||
bool hasInternet = false;
|
||||
bool isRoot = false;
|
||||
bool enoughScreen = (availableSize.width() >= CalamaresUtils::windowMinimumWidth) && (availableSize.height() >= CalamaresUtils::windowMinimumHeight);
|
||||
bool enoughScreen = availableSize.isValid() && (availableSize.width() >= CalamaresUtils::windowMinimumWidth) && (availableSize.height() >= CalamaresUtils::windowMinimumHeight);
|
||||
|
||||
qint64 requiredStorageB = CalamaresUtils::GiBtoBytes(m_requiredStorageGiB);
|
||||
cDebug() << "Need at least storage bytes:" << requiredStorageB;
|
||||
|
Loading…
Reference in New Issue
Block a user