adding space for error handling in moving slides after serviceitem moves
This commit is contained in:
parent
837607c892
commit
056cf91983
1 changed files with 18 additions and 4 deletions
|
@ -615,6 +615,7 @@ void SlideModel::moveRowFromService(const int &fromIndex,
|
||||||
qDebug() << "@@@Move SIs" << fromIndex << "to" << toIndex << "@@@";
|
qDebug() << "@@@Move SIs" << fromIndex << "to" << toIndex << "@@@";
|
||||||
int slideId = findSlideIdFromServItm(fromIndex);
|
int slideId = findSlideIdFromServItm(fromIndex);
|
||||||
int toSlideId = isMoveDown ? findSlideIdFromServItm(toIndex + 1) - 1 : findSlideIdFromServItm(toIndex);
|
int toSlideId = isMoveDown ? findSlideIdFromServItm(toIndex + 1) - 1 : findSlideIdFromServItm(toIndex);
|
||||||
|
qDebug() << slideId << toSlideId;
|
||||||
// Slide toSlide = m_items[toSlideId];
|
// Slide toSlide = m_items[toSlideId];
|
||||||
int count;
|
int count;
|
||||||
if (item.type() == "song")
|
if (item.type() == "song")
|
||||||
|
@ -628,15 +629,28 @@ void SlideModel::moveRowFromService(const int &fromIndex,
|
||||||
qDebug() << "@@@Move Row" << slideId << "to" << toSlideId << "@@@";
|
qDebug() << "@@@Move Row" << slideId << "to" << toSlideId << "@@@";
|
||||||
qDebug() << count;
|
qDebug() << count;
|
||||||
if (isMoveDown) {
|
if (isMoveDown) {
|
||||||
|
qDebug() << "Moving Down in service list" << slideId << "to" << toSlideId;
|
||||||
if (toSlideId - slideId > 1)
|
if (toSlideId - slideId > 1)
|
||||||
moveRows(slideId, toSlideId - 1, count);
|
if (!moveRows(slideId, toSlideId - 1, count)) {
|
||||||
|
// failed code
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
moveRows(slideId, toSlideId, count);
|
if (!moveRows(slideId, toSlideId, count)) {
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (slideId - toSlideId > 1)
|
if (slideId - toSlideId > 1)
|
||||||
moveRows(slideId - 1, toSlideId, count);
|
if (!moveRows(slideId - 1, toSlideId, count)) {
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
moveRows(slideId, toSlideId, count);
|
if (!moveRows(slideId, toSlideId, count)) {
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_items[toSlideId]->setServiceItemId(toIndex);
|
m_items[toSlideId]->setServiceItemId(toIndex);
|
||||||
if (isMoveDown) {
|
if (isMoveDown) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue