aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core-utils
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2019-10-29 08:16:05 -0400
committerGitHub <noreply@github.com>2019-10-29 08:16:05 -0400
commitbbf4e940ff2e1c257ffd78c10d85b3681eb72f46 (patch)
tree480c429c743606f09a837ebc652ca57a69c42119 /src-qt5/core-utils
parentMerge pull request #705 from lbartoletti/shortcut_lumina_photo (diff)
parentremove QSignalMapper. Use lambda func instead. (diff)
downloadlumina-bbf4e940ff2e1c257ffd78c10d85b3681eb72f46.tar.gz
lumina-bbf4e940ff2e1c257ffd78c10d85b3681eb72f46.tar.bz2
lumina-bbf4e940ff2e1c257ffd78c10d85b3681eb72f46.zip
Merge pull request #706 from lbartoletti/fix_deprecated
Fix deprecated
Diffstat (limited to 'src-qt5/core-utils')
-rw-r--r--src-qt5/core-utils/lumina-config/pages/page_wallpaper.cpp2
-rw-r--r--src-qt5/core-utils/lumina-xconfig/MainUI.cpp22
2 files changed, 11 insertions, 13 deletions
diff --git a/src-qt5/core-utils/lumina-config/pages/page_wallpaper.cpp b/src-qt5/core-utils/lumina-config/pages/page_wallpaper.cpp
index 7dc9f8f8..639e3f47 100644
--- a/src-qt5/core-utils/lumina-config/pages/page_wallpaper.cpp
+++ b/src-qt5/core-utils/lumina-config/pages/page_wallpaper.cpp
@@ -73,7 +73,7 @@ void page_wallpaper::LoadSettings(int screennum){
else{ ui->radio_desk_single->setChecked(true); }
ui->spin_desk_min->setValue( settings.value(DPrefix+"background/minutesToChange", 5).toInt() );
desktimechanged(); //ensure the display gets updated (in case the radio selection did not change);
- QRect geom = QApplication::desktop()->screenGeometry(cScreen);
+ QRect geom = QGuiApplication::screens().at(cScreen)->availableGeometry();
ui->label_desk_res->setText( tr("Screen Resolution:")+"\n"+QString::number(geom.width())+"x"+QString::number(geom.height()) );
int tmp = ui->combo_desk_layout->findData(settings.value(DPrefix+"background/format","stretch"));
if(tmp>=0){ ui->combo_desk_layout->setCurrentIndex(tmp); }
diff --git a/src-qt5/core-utils/lumina-xconfig/MainUI.cpp b/src-qt5/core-utils/lumina-xconfig/MainUI.cpp
index cbec6443..9abc30b2 100644
--- a/src-qt5/core-utils/lumina-xconfig/MainUI.cpp
+++ b/src-qt5/core-utils/lumina-xconfig/MainUI.cpp
@@ -259,20 +259,19 @@ void MainUI::tileScreensY(bool activeonly){
while(overlap){
QRegion tmp(cur->pos().x(), newy, cur->width(), cur->height());
QRegion diff = tmp.subtracted(total);
- overlap = (diff.boundingRect()!=tmp.boundingRect() || diff.rects().length()>1);
+ overlap = (diff.boundingRect()!=tmp.boundingRect() || diff.rectCount()>1);
//qDebug() << "Check Y Overlap:" << newy << overlap << tmp.boundingRect() << diff.boundingRect();
if(overlap){
- QVector<QRect> rects = diff.rects();
QRect bound = diff.boundingRect();
//qDebug() << " - got Y overlap:" << bound << rects;
- if( bound.isNull() || rects.isEmpty() ){ newy+=cur->height(); }
+ if( bound.isNull() || diff.rectCount() == 0 ){ newy+=cur->height(); }
else{
int orig = newy;
newy = bound.top();
- for(int i=0; i<rects.length(); i++){
+ for( const QRect &rect : diff ){
//qDebug() << " - Check Rect:" << newy << rects[i] << cur->height();
- if(rects[i].height()==cur->height()){ continue; } //skip this one - just the same height
- if(rects[i].top()>newy || newy==bound.bottom()){ newy=rects[i].top(); }
+ if(rect.height()==cur->height()){ continue; } //skip this one - just the same height
+ if(rect.top()>newy || newy==bound.bottom()){ newy=rect.top(); }
}
if(orig==newy){ newy = bound.bottom()+1; } //make sure it always changes - no infinite loops!!
}
@@ -316,20 +315,19 @@ void MainUI::tileScreensX(bool activeonly){
while(overlap){
QRegion tmp(newx, cur->pos().y(), cur->width(), cur->height());
QRegion diff = tmp.subtracted(total);
- overlap = (diff.boundingRect()!=tmp.boundingRect() || diff.rects().length()>1);
+ overlap = (diff.boundingRect()!=tmp.boundingRect() || diff.rectCount()>1);
//qDebug() << "Check X Overlap:" << newx << overlap << total.rects() << tmp.boundingRect() << diff.boundingRect();
if(overlap){
- QVector<QRect> rects = diff.rects();
QRect bound = diff.boundingRect();
//qDebug() << " - got X overlap:" << bound << rects;
- if( bound.isNull() || rects.isEmpty() ){ newx+=cur->width(); }
+ if( bound.isNull() || diff.rectCount() == 0 ){ newx+=cur->width(); }
else{
int orig = newx;
newx = bound.left();
- for(int i=0; i<rects.length(); i++){
+ for( const QRect &rect : diff ) {
//qDebug() << " - Check Rect:" << newx << rects[i] << cur->width();
- if(rects[i].width()==cur->width()){ continue; } //skip this one - just the same width
- if(rects[i].left()>newx || newx==bound.right()){ newx=rects[i].left(); }
+ if(rect.width()==cur->width()){ continue; } //skip this one - just the same width
+ if(rect.left()>newx || newx==bound.right()){ newx=rect.left(); }
}
if(orig==newx){ newx = bound.right()+1; } //make sure it always changes - no infinite loops!!
}
bgstack15