From 9e6e04c6bca34f61c17804b242d79e7113d8b2a6 Mon Sep 17 00:00:00 2001 From: mzn Date: Thu, 20 Mar 2014 05:56:35 +0000 Subject: [PATCH] Variables naming. --- src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx b/src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx index 25572638..f4ac8eae 100644 --- a/src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx +++ b/src/ZLEVEL/HYDROGUI_ZLevelsModel.cxx @@ -205,45 +205,45 @@ bool HYDROGUI_ZLevelsModel::move( const int theItem, const OpType theType, return aRes; } - int aDestinationRow = -1; + int aDestinationIndex = -1; switch ( theType ) { case Up: if ( theItem > 0 ) { - aDestinationRow = theItem - 1; + aDestinationIndex = theItem - 1; if ( theIsVisibleOnly ) { - while ( aDestinationRow >= 0 && !myObjects.at( aDestinationRow ).second ) { - aDestinationRow--; + while ( aDestinationIndex >= 0 && !IsObjectVisible( aDestinationIndex ) ) { + aDestinationIndex--; } } } break; case Down: if ( theItem < myObjects.count() - 1 ) { - aDestinationRow = theItem + 1; + aDestinationIndex = theItem + 1; if ( theIsVisibleOnly ) { - while ( aDestinationRow < myObjects.count() && !myObjects.at( aDestinationRow ).second ) { - aDestinationRow++; + while ( aDestinationIndex < myObjects.count() && !IsObjectVisible( aDestinationIndex ) ) { + aDestinationIndex++; } } } break; case Top: if ( theItem > 0 ) { - aDestinationRow = 0; + aDestinationIndex = 0; } break; case Bottom: if ( theItem < myObjects.count() - 1 ) { - aDestinationRow = myObjects.count() - 1; + aDestinationIndex = myObjects.count() - 1; } break; } - if ( aDestinationRow >= 0 && aDestinationRow < myObjects.count() ) { - int aDestination = (theType == Up || theType == Top) ? aDestinationRow : aDestinationRow + 1; - if ( beginMoveRows( QModelIndex(), theItem, theItem, QModelIndex(), aDestination ) ) { - myObjects.move( theItem, aDestinationRow ); //TODO ??? + if ( aDestinationIndex >= 0 && aDestinationIndex < myObjects.count() ) { + int aDestinationRow = (theType == Up || theType == Top) ? aDestinationIndex : aDestinationIndex + 1; + if ( beginMoveRows( QModelIndex(), theItem, theItem, QModelIndex(), aDestinationRow ) ) { + myObjects.move( theItem, aDestinationIndex ); endMoveRows(); aRes = true; } -- 2.39.2