This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit e21b7c3b08291a527c622ccbc89e56ef9c82a01f Author: Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> Date: Tue Oct 14 12:31:23 2014 +0200 Fix placing sessions folders in broker mode. --- debian/changelog | 1 + sessionexplorer.cpp | 67 ++++++++++++++++++++++++++++----------------------- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/debian/changelog b/debian/changelog index aa9543c..44252cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,7 @@ x2goclient (4.0.3.0-0x2go1) UNRELEASED; urgency=low - Remove deprecated workaround in wapi.cpp. - Save folder icons Base64 coded. Save icons under General\icon_<PATH>. (Fixes: #580). + - Fix placing sessions folders in broker mode. [ Mike DePaulo ] * New upstream release (4.0.3.0): diff --git a/sessionexplorer.cpp b/sessionexplorer.cpp index 209ee99..4d6ceac 100644 --- a/sessionexplorer.cpp +++ b/sessionexplorer.cpp @@ -113,7 +113,7 @@ void SessionExplorer::getFoldersFromConfig() { if(folder.indexOf("icon_")==0) { - folder=folder.mid(strlen("icon_")); + folder=folder.mid(strlen("icon_")); folder.replace("::","/"); if(findFolder(folder)==-1) createFolder(folder); @@ -268,7 +268,7 @@ void SessionExplorer::placeButtons() setNavigationVisible(currentPath.length()>0); resize(); - int currentIndex=0; + int currentVerticalPosition=0; qSort ( sessions.begin(),sessions.end(),SessionButton::lessThen ); qSort ( folders.begin(), folders.end(), FolderButton::lessThen ); @@ -279,18 +279,22 @@ void SessionExplorer::placeButtons() folders[i]->hide(); continue; } - if ( !parent->getMiniMode() ) - folders[i]->move ( ( parent->getUsersArea()->width()-360 ) /2, - currentIndex*220+currentIndex*25+5 ); - else + + if ( parent->getMiniMode() ) + { folders[i]->move ( ( parent->getUsersArea()->width()-260 ) /2, - currentIndex*155+currentIndex*20+5 ); - if (parent->getBrokerMode()) + currentVerticalPosition+5 ); + currentVerticalPosition+=170; + } + else + { folders[i]->move ( ( parent->getUsersArea()->width()-360 ) /2, - currentIndex*150+currentIndex*25+5 ); + currentVerticalPosition+5 ); + currentVerticalPosition+=230; + } + folders[i]->show(); folders[i]->setChildrenList(getFolderChildren(folders[i])); - ++currentIndex; } for ( int i=0; i<sessions.size(); ++i ) @@ -300,32 +304,35 @@ void SessionExplorer::placeButtons() sessions[i]->hide(); continue; } - if ( !parent->getMiniMode() ) - sessions[i]->move ( ( parent->getUsersArea()->width()-360 ) /2, - currentIndex*220+currentIndex*25+5 ); + + int horizontalPosition=(parent->getMiniMode())?(parent->getUsersArea()->width()-260 ) /2:(parent->getUsersArea()->width()-360 ) /2; + + sessions[i]->move ( horizontalPosition, + currentVerticalPosition+5 ); + + if(parent->getBrokerMode()) + { + currentVerticalPosition+=150; + } else - sessions[i]->move ( ( parent->getUsersArea()->width()-260 ) /2, - currentIndex*155+currentIndex*20+5 ); - if (parent->getBrokerMode()) - sessions[i]->move ( ( parent->getUsersArea()->width()-360 ) /2, - currentIndex*150+currentIndex*25+5 ); + { + if ( parent->getMiniMode() ) + { + currentVerticalPosition+=170; + } + else + { + currentVerticalPosition+=230; + } + } sessions[i]->show(); - ++currentIndex; } - if ( currentIndex ) + if ( currentVerticalPosition ) { - if ( !parent->getMiniMode() ) - parent->getUsersFrame()->setFixedHeight ( - currentIndex *220+ ( currentIndex -1 ) *25 ); - else - parent->getUsersFrame()->setFixedHeight ( - currentIndex *155+ ( currentIndex-1 ) *20 ); - if (parent->getBrokerMode()) - parent->getUsersFrame()->setFixedHeight ( - currentIndex *150+ ( currentIndex-1 ) *25 ); + parent->getUsersFrame()->setFixedHeight ( + currentVerticalPosition); } - } QStringList SessionExplorer::getFolderChildren(FolderButton* folder) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git