diff options
author | Ken Moore <ken@pcbsd.org> | 2015-03-05 12:52:31 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-03-05 12:52:31 -0500 |
commit | 51223fdf7967adb14c3f84bb1eefc4a2d0f012f8 (patch) | |
tree | 040422b61681ff94484a47d0144490390affcc86 | |
parent | Update the lumina-xconfig screen resolution detection routine to be a bit mor... (diff) | |
download | lumina-51223fdf7967adb14c3f84bb1eefc4a2d0f012f8.tar.gz lumina-51223fdf7967adb14c3f84bb1eefc4a2d0f012f8.tar.bz2 lumina-51223fdf7967adb14c3f84bb1eefc4a2d0f012f8.zip |
Clean up the rest of the xrandr parsing to account for some other variations in the output.
-rw-r--r-- | lumina-xconfig/MainUI.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lumina-xconfig/MainUI.cpp b/lumina-xconfig/MainUI.cpp index 7a4f5174..4fa9236f 100644 --- a/lumina-xconfig/MainUI.cpp +++ b/lumina-xconfig/MainUI.cpp @@ -56,11 +56,13 @@ void MainUI::UpdateScreens(){ SCREENS << cscreen; //current screen finished - save it into the array cscreen = ScreenInfo(); //Now create a new structure } + //qDebug() << "Line:" << info[i]; QString dev = info[i].section(" ",0,0); //device ID //The device resolution can be either the 3rd or 4th output - check both - QString devres = info[i].section(" ",2,2); - if(!devres.contains("x")){ devres = info[i].section(" ",3,3); } - qDebug() << " - ID:" <<dev; + QString devres = info[i].section(" ",2,2, QString::SectionSkipEmpty); + if(!devres.contains("x")){ devres = info[i].section(" ",3,3,QString::SectionSkipEmpty); } + if(!devres.contains("x")){ devres.clear(); } + qDebug() << " - ID:" <<dev << "Current Geometry:" << devres; //qDebug() << " - Res:" << devres; if( !devres.contains("x") || !devres.contains("+") ){ devres.clear(); } //qDebug() << " - Res (modified):" << devres; @@ -76,7 +78,7 @@ void MainUI::UpdateScreens(){ //Note: devres format: "<width>x<height>+<xoffset>+<yoffset>" cscreen.geom.setRect( devres.section("+",-2,-2).toInt(), devres.section("+",-1,-1).toInt(), devres.section("x",0,0).toInt(), devres.section("+",0,0).section("x",1,1).toInt() ); - }else if(info[i].contains(" connected ")){ + }else if(info[i].contains(" connected")){ //Device that is connected, but not attached qDebug() << "Create new Screen entry:" << dev << "none"; cscreen.ID = dev; |