slides now follow moving a single serviceItem around
This commit is contained in:
parent
08ed111efc
commit
4bf1790708
1 changed files with 14 additions and 2 deletions
|
@ -555,7 +555,8 @@ void SlideModel::moveRowFromService(const int &fromIndex,
|
||||||
const bool isMoveDown = toIndex > fromIndex;
|
const bool isMoveDown = toIndex > fromIndex;
|
||||||
qDebug() << "@@@Move SIs" << fromIndex << "to" << toIndex << "@@@";
|
qDebug() << "@@@Move SIs" << fromIndex << "to" << toIndex << "@@@";
|
||||||
int slideId = findSlideIdFromServItm(fromIndex);
|
int slideId = findSlideIdFromServItm(fromIndex);
|
||||||
int toSlideId = findSlideIdFromServItm(toIndex);
|
int toSlideId = isMoveDown ? findSlideIdFromServItm(toIndex + 1) - 1 : findSlideIdFromServItm(toIndex);
|
||||||
|
// Slide toSlide = m_items[toSlideId];
|
||||||
int count;
|
int count;
|
||||||
if (item.type() == "song")
|
if (item.type() == "song")
|
||||||
count = item.text().length();
|
count = item.text().length();
|
||||||
|
@ -563,10 +564,21 @@ void SlideModel::moveRowFromService(const int &fromIndex,
|
||||||
count = item.slideNumber();
|
count = item.slideNumber();
|
||||||
else
|
else
|
||||||
count = 1;
|
count = 1;
|
||||||
|
// int toCount = toSlide.imageCount();
|
||||||
int toId = count + slideId;
|
int toId = count + slideId;
|
||||||
qDebug() << "@@@Move Row" << slideId << "to" << toSlideId << "@@@";
|
qDebug() << "@@@Move Row" << slideId << "to" << toSlideId << "@@@";
|
||||||
qDebug() << count;
|
qDebug() << count;
|
||||||
|
if (isMoveDown) {
|
||||||
|
if (toSlideId - slideId > 1)
|
||||||
|
moveRows(slideId, toSlideId - 1, count);
|
||||||
|
else
|
||||||
moveRows(slideId, toSlideId, count);
|
moveRows(slideId, toSlideId, count);
|
||||||
|
} else {
|
||||||
|
if (slideId - toSlideId > 1)
|
||||||
|
moveRows(slideId - 1, toSlideId, count);
|
||||||
|
else
|
||||||
|
moveRows(slideId, toSlideId, count);
|
||||||
|
}
|
||||||
m_items[toSlideId]->setServiceItemId(toIndex);
|
m_items[toSlideId]->setServiceItemId(toIndex);
|
||||||
if (isMoveDown) {
|
if (isMoveDown) {
|
||||||
for (int i = slideId; i < toSlideId; i++) {
|
for (int i = slideId; i < toSlideId; i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue