diff options
Diffstat (limited to 'src/basket.cpp')
-rw-r--r-- | src/basket.cpp | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/src/basket.cpp b/src/basket.cpp index b71f745..79abb4b 100644 --- a/src/basket.cpp +++ b/src/basket.cpp @@ -170,14 +170,14 @@ int NoteSelection::count() return count; } -TQValueList<Note*> NoteSelection::tqparentGroups() +TQValueList<Note*> NoteSelection::parentGroups() { TQValueList<Note*> groups; // For each note: for (NoteSelection *node = firstStacked(); node; node = node->nextStacked()) // For each tqparent groups of the note: - for (Note *note = node->note->tqparentNote(); note; note = note->tqparentNote()) + for (Note *note = node->note->parentNote(); note; note = note->parentNote()) // Add it (if it was not already in the list): if (!note->isColumn() && !groups.tqcontains(note)) groups.append(note); @@ -430,7 +430,7 @@ void Basket::appendNoteAfter(Note *note, Note *after) if (after) { // The normal case: for (Note *n = note; n; n = n->next()) - n->setParentNote(after->tqparentNote()); + n->setParentNote(after->parentNote()); note->setPrev(after); last->setNext(after->next()); after->setNext(note); @@ -470,15 +470,15 @@ void Basket::appendNoteBefore(Note *note, Note *before) if (before) { // The normal case: for (Note *n = note; n; n = n->next()) - n->setParentNote(before->tqparentNote()); + n->setParentNote(before->parentNote()); note->setPrev(before->prev()); last->setNext(before); before->setPrev(last); if (note->prev()) note->prev()->setNext(note); else { - if (note->tqparentNote()) - note->tqparentNote()->setFirstChild(note); + if (note->parentNote()) + note->parentNote()->setFirstChild(note); else m_firstNote = note; } @@ -556,19 +556,19 @@ void Basket::unplugNote(Note *note) if (note->next()) note->next()->setPrev(note->prev()); - if (note->tqparentNote()) { + if (note->parentNote()) { // If it was the first note of a group, change the first note of the group: - if (note->tqparentNote()->firstChild() == note) - note->tqparentNote()->setFirstChild( note->next() ); + if (note->parentNote()->firstChild() == note) + note->parentNote()->setFirstChild( note->next() ); - if (!note->tqparentNote()->isColumn()) { + if (!note->parentNote()->isColumn()) { // Ungroup if still 0 note inside tqparent group: - if ( ! note->tqparentNote()->firstChild() ) - unplugNote(note->tqparentNote()); // TODO delete + if ( ! note->parentNote()->firstChild() ) + unplugNote(note->parentNote()); // TODO delete // Ungroup if still 1 note inside tqparent group: - else if ( ! note->tqparentNote()->firstChild()->next() ) - ungroupNote(note->tqparentNote()); + else if ( ! note->parentNote()->firstChild()->next() ) + ungroupNote(note->parentNote()); } } @@ -593,7 +593,7 @@ void Basket::ungroupNote(Note *group) lastGroupedNote->next()->setPrev(note); note->setNext(lastGroupedNote->next()); lastGroupedNote->setNext(note); - note->setParentNote(group->tqparentNote()); + note->setParentNote(group->parentNote()); note->setPrev(lastGroupedNote); note->setGroupWidth(group->groupWidth() - Note::GROUP_WIDTH); @@ -605,7 +605,7 @@ void Basket::ungroupNote(Note *group) group->setFirstChild(0); unplugNote(group); // TODO: delete - retqlayoutNotes(true); + relayoutNotes(true); } void Basket::groupNoteBefore(Note *note, Note *with) @@ -627,11 +627,11 @@ void Basket::groupNoteBefore(Note *note, Note *with) group->setNext(with->next()); group->setX(with->x()); group->setY(with->y()); - if (with->tqparentNote() && with->tqparentNote()->firstChild() == with) - with->tqparentNote()->setFirstChild(group); + if (with->parentNote() && with->parentNote()->firstChild() == with) + with->parentNote()->setFirstChild(group); else if (m_firstNote == with) m_firstNote = group; - group->setParentNote(with->tqparentNote()); + group->setParentNote(with->parentNote()); group->setFirstChild(note); group->setGroupWidth(with->groupWidth() + Note::GROUP_WIDTH); @@ -671,11 +671,11 @@ void Basket::groupNoteAfter(Note *note, Note *with) group->setNext(with->next()); group->setX(with->x()); group->setY(with->y()); - if (with->tqparentNote() && with->tqparentNote()->firstChild() == with) - with->tqparentNote()->setFirstChild(group); + if (with->parentNote() && with->parentNote()->firstChild() == with) + with->parentNote()->setFirstChild(group); else if (m_firstNote == with) m_firstNote = group; - group->setParentNote(with->tqparentNote()); + group->setParentNote(with->parentNote()); group->setFirstChild(with); group->setGroupWidth(with->groupWidth() + Note::GROUP_WIDTH); @@ -983,11 +983,11 @@ void Basket::setDisposition(int disposition, int columnCount) } if (columnCount != m_columnsCount) { m_columnsCount = (columnCount <= 0 ? 1 : columnCount); - equalizeColumnSizes(); // Will retqlayoutNotes() + equalizeColumnSizes(); // Will relayoutNotes() } } else if (currentDisposition == COLUMNS_LAYOUT && (disposition == FREE_LAYOUT || disposition == MINDMAPS_LAYOUT)) { Note *column = firstNote(); - m_columnsCount = 0; // Now, so retqlayoutNotes() will not retqlayout the free notes as if they were columns! + m_columnsCount = 0; // Now, so relayoutNotes() will not retqlayout the free notes as if they were columns! while (column) { // Move all childs on the first level: Note *nextColumn = column->next(); @@ -996,7 +996,7 @@ void Basket::setDisposition(int disposition, int columnCount) } unselectAll(); m_mindMap = (disposition == MINDMAPS_LAYOUT); - retqlayoutNotes(true); + relayoutNotes(true); } else if ((currentDisposition == FREE_LAYOUT || currentDisposition == MINDMAPS_LAYOUT) && disposition == COLUMNS_LAYOUT) { if (firstNote()) { // TODO: Reorder notes! @@ -1031,7 +1031,7 @@ void Basket::setDisposition(int disposition, int columnCount) } } m_columnsCount = (columnCount <= 0 ? 1 : columnCount); - equalizeColumnSizes(); // Will retqlayoutNotes() + equalizeColumnSizes(); // Will relayoutNotes() } } @@ -1041,7 +1041,7 @@ void Basket::equalizeColumnSizes() return; // Necessary to know the available space; - retqlayoutNotes(true); + relayoutNotes(true); int availableSpace = visibleWidth(); int columnWidth = (visibleWidth() - (columnsCount()-1)*Note::GROUP_WIDTH) / columnsCount(); @@ -1067,7 +1067,7 @@ void Basket::equalizeColumnSizes() column = column->next(); } - retqlayoutNotes(true); + relayoutNotes(true); } void Basket::enableActions() @@ -1117,7 +1117,7 @@ void Basket::aboutToBeActivated() FOR_EACH_NOTE (note) note->finishLazyLoad(); - //retqlayoutNotes(/*animate=*/false); + //relayoutNotes(/*animate=*/false); setFocusedNote(0); // So that during the focusInEvent that will come shortly, the FIRST note is focused. if (Settings::playAnimations() && !decoration()->filterBar()->filterData().isFiltering && Global::bnpView->currentBasket() == this) // No animation when filtering all! @@ -1205,7 +1205,7 @@ void Basket::load() m_columnsCount = columnsCount; } - retqlayoutNotes(false); + relayoutNotes(false); // On application start, the current basket is not focused yet, so the focus rectangle is not shown when calling focusANote(): if (Global::bnpView->currentBasket() == this) @@ -1243,7 +1243,7 @@ void Basket::newFilter(const FilterData &data, bool andEnsureVisible/* = true*/) for (Note *note = firstNote(); note; note = note->next()) m_countFounds += note->newFilter(data); - retqlayoutNotes(true); + relayoutNotes(true); signalCountsChanged(); if (hasFocus()) // if (!hasFocus()), focusANote() will be called at focusInEvent() @@ -1351,7 +1351,7 @@ Basket::Basket(TQWidget *tqparent, const TQString &folderName) m_doNotCloseEditor(false), m_editParagraph(0), m_editIndex(0), m_isDuringDrag(false), m_draggedNotes(), m_focusedNote(0), m_startOfShiftSelectionNote(0), - m_finishLoadOnFirstShow(false), m_retqlayoutOnNextShow(false) + m_finishLoadOnFirstShow(false), m_relayoutOnNextShow(false) { TQString sAction = "local_basket_activate_" + folderName; m_action = new KAction("FAKE TEXT", "FAKE ICON", KShortcut(), TQT_TQOBJECT(this), TQT_SLOT(activatedShortcut()), Global::bnpView->actionCollection(), sAction); @@ -1554,7 +1554,7 @@ void Basket::contentsMousePressEvent(TQMouseEvent *event) // Folding/Unfolding group: if (zone == Note::GroupExpander) { clicked->toggleFolded(Settings::playAnimations()); - retqlayoutNotes(true); + relayoutNotes(true); m_noActionOnMouseRelease = true; return; } @@ -1847,7 +1847,7 @@ void Basket::insertNote(Note *note, Note *clicked, int zone, const TQPoint &pos, appendNoteAfter(note, lastNote()); } - retqlayoutNotes(true); + relayoutNotes(true); } void Basket::clickedToInsert(TQMouseEvent *event, Note *clicked, /*Note::Zone*/int zone) @@ -1938,7 +1938,7 @@ void Basket::contentsDropEvent(TQDropEvent *event) // Do NOT check the bottom&right borders. // Because imagine someone drag&drop a big note from the top to the bottom of a big basket (with big vertical scrollbars), - // the note is first removed, and retqlayoutNotes() compute the new height that is smaller + // the note is first removed, and relayoutNotes() compute the new height that is smaller // Then noteAt() is called for the mouse pointer position, because the basket is now smaller, the cursor is out of boundaries!!! // Should, of course, not return 0: Note *clicked = noteAt(event->pos().x(), event->pos().y()); @@ -2428,7 +2428,7 @@ void Basket::contentsMouseMoveEvent(TQMouseEvent *event) if (m_resizingNote) { int groupWidth = event->pos().x() - m_resizingNote->x() - m_pickedResizer; int minRight = m_resizingNote->minRight(); - int maxRight = 100 * contentsWidth(); // A big enough value (+infinity) for free tqlayouts. + int maxRight = 100 * contentsWidth(); // A big enough value (+infinity) for free layouts. Note *nextColumn = m_resizingNote->next(); if (m_resizingNote->isColumn()) { if (nextColumn) @@ -2452,7 +2452,7 @@ void Basket::contentsMouseMoveEvent(TQMouseEvent *event) column->setGroupWidth(column->groupWidth() - delta); } } - retqlayoutNotes(true); + relayoutNotes(true); } // Moving a Note: @@ -2463,8 +2463,8 @@ void Basket::contentsMouseMoveEvent(TQMouseEvent *event) if (y < 0) y = 0; m_movingNote->setX(x); m_movingNote->setY(y); - m_movingNote->retqlayoutAt(x, y, / *animate=* /false); - retqlayoutNotes(true); + m_movingNote->relayoutAt(x, y, / *animate=* /false); + relayoutNotes(true); } */ @@ -2565,14 +2565,14 @@ void Basket::selectAll() } else { // First select all in the group, then in the tqparent group... Note *child = m_focusedNote; - Note *tqparent = (m_focusedNote ? m_focusedNote->tqparentNote() : 0); + Note *tqparent = (m_focusedNote ? m_focusedNote->parentNote() : 0); while (tqparent) { if (!tqparent->allSelected()) { tqparent->setSelectedRecursivly(true); return; } child = tqparent; - tqparent = tqparent->tqparentNote(); + tqparent = tqparent->parentNote(); } // Then, select all: FOR_EACH_NOTE (note) @@ -2687,7 +2687,7 @@ void Basket::doHoverEffects(const TQPoint &pos) // Don't do hover effects when a popup menu is opened. // Primarily because the basket area will only receive mouseEnterEvent and mouveLeaveEvent. - // It willn't be noticed of mouseMoveEvent, which would result in a aptqparently broken application state: + // It willn't be noticed of mouseMoveEvent, which would result in a apparently broken application state: if (kapp->activePopupWidget()) underMouse = false; @@ -2933,7 +2933,7 @@ Note* Basket::noteAt(int x, int y) //NO: // // Do NOT check the bottom&right borders. // // Because imagine someone drag&drop a big note from the top to the bottom of a big basket (with big vertical scrollbars), -// // the note is first removed, and retqlayoutNotes() compute the new height that is smaller +// // the note is first removed, and relayoutNotes() compute the new height that is smaller // // Then noteAt() is called for the mouse pointer position, because the basket is now smaller, the cursor is out of boundaries!!! // // Should, of course, not return 0: if (x < 0 || x > contentsWidth() || y < 0 || y > contentsHeight()) @@ -2957,7 +2957,7 @@ Note* Basket::noteAt(int x, int y) note = note->next(); } - // If the basket is tqlayouted in columns, return one of the columns to be able to add notes in them: + // If the basket is layouted in columns, return one of the columns to be able to add notes in them: if (isColumnsLayout()) { Note *column = m_firstNote; while (column) { @@ -2984,7 +2984,7 @@ Basket::~Basket() void Basket::viewportResizeEvent(TQResizeEvent *event) { - retqlayoutNotes(true); + relayoutNotes(true); //cornerWidget()->setShown(horizontalScrollBar()->isShown() && verticalScrollBar()->isShown()); if (horizontalScrollBar()->isShown() && verticalScrollBar()->isShown()) { if (!cornerWidget()) @@ -3254,7 +3254,7 @@ void Basket::unsetNotesWidth() } } -void Basket::retqlayoutNotes(bool animate) +void Basket::relayoutNotes(bool animate) { if (Global::bnpView->currentBasket() != this) return; // Optimize load time, and basket will be relaid out when activated, anyway @@ -3273,12 +3273,12 @@ void Basket::retqlayoutNotes(bool animate) Note *note = m_firstNote; while (note) { if (note->matching()) { - note->retqlayoutAt(0, h, animate); + note->relayoutAt(0, h, animate); if (note->hasResizer()) { int minGroupWidth = note->minRight() - note->finalX(); if (note->groupWidth() < minGroupWidth) { note->setGroupWidth(minGroupWidth); - retqlayoutNotes(animate); // Redo the thing, but this time it should not recurse + relayoutNotes(animate); // Redo the thing, but this time it should not recurse return; } } @@ -3343,7 +3343,7 @@ void Basket::animateObjects() if (m_underMouse) doHoverEffects(); recomputeBlankRects(); - //retqlayoutNotes(true); // In case an animated note was to the contents view boundaries, resize the view! + //relayoutNotes(true); // In case an animated note was to the contents view boundaries, resize the view! updateContents(); // If the drawing of the last frame was too long, we skip the drawing of the current and do the next one: } else { @@ -3368,7 +3368,7 @@ void Basket::popupEmblemMenu(Note *note, int emblemNumber) m_tagPopupNote = note; State *state = note->stateForEmblemNumber(emblemNumber); State *nextState = state->nextState(/*cycle=*/false); - Tag *tag = state->tqparentTag(); + Tag *tag = state->parentTag(); m_tagPopup = tag; TQKeySequence sequence = tag->shortcut().operator TQKeySequence(); @@ -3863,7 +3863,7 @@ bool Basket::closeEditor() m_rightEditorBorder = 0; Note *note = m_editor->note(); - note->setWidth(0); // For retqlayoutNotes() to succeed to take care of the change + note->setWidth(0); // For relayoutNotes() to succeed to take care of the change // Delete the editor BEFORE unselecting the note because unselecting the note would trigger closeEditor() recursivly: bool isEmpty = m_editor->isEmpty(); @@ -4005,7 +4005,7 @@ void Basket::showEditedNoteWhileFiltering() Note *note = m_editor->note(); filterAgain(); note->setSelected(true); - retqlayoutNotes(false); + relayoutNotes(false); note->setX(note->finalX()); note->setY(note->finalY()); filterAgainDelayed(); @@ -4136,7 +4136,7 @@ void Basket::focusANonSelectedNoteBelow(bool inSameColumn) while (next && next->isSelected()) next = next->nextShownInStack(); if (next) { - if (inSameColumn && isColumnsLayout() && m_focusedNote->tqparentPrimaryNote() == next->tqparentPrimaryNote()) { + if (inSameColumn && isColumnsLayout() && m_focusedNote->parentPrimaryNote() == next->parentPrimaryNote()) { setFocusedNote(next); m_startOfShiftSelectionNote = next; } @@ -4152,7 +4152,7 @@ void Basket::focusANonSelectedNoteAbove(bool inSameColumn) while (prev && prev->isSelected()) prev = prev->prevShownInStack(); if (prev) { - if (inSameColumn && isColumnsLayout() && m_focusedNote->tqparentPrimaryNote() == prev->tqparentPrimaryNote()) { + if (inSameColumn && isColumnsLayout() && m_focusedNote->parentPrimaryNote() == prev->parentPrimaryNote()) { setFocusedNote(prev); m_startOfShiftSelectionNote = prev; } @@ -4190,7 +4190,7 @@ void Basket::noteDeleteWithoutConfirmation(bool deleteFilesToo) note = next; } - retqlayoutNotes(true); // FIXME: filterAgain()? + relayoutNotes(true); // FIXME: filterAgain()? save(); } @@ -4452,7 +4452,7 @@ void Basket::noteGroup() unselectAll(); group->setSelectedRecursivly(true); // Notes were unselected by unplugging - retqlayoutNotes(true); + relayoutNotes(true); save(); } @@ -4522,7 +4522,7 @@ void Basket::noteMoveOnTop() insertSelection(selection, fakeNote); unplugNote(fakeNote); selectSelection(selection); - retqlayoutNotes(true); + relayoutNotes(true); save(); } @@ -4547,7 +4547,7 @@ void Basket::noteMoveOnBottom() insertSelection(selection, fakeNote); unplugNote(fakeNote); selectSelection(selection); - retqlayoutNotes(true); + relayoutNotes(true); save(); } @@ -4566,7 +4566,7 @@ void Basket::moveSelectionTo(Note *here, bool below/* = true*/) insertSelection(selection, fakeNote); unplugNote(fakeNote); selectSelection(selection); - retqlayoutNotes(true); + relayoutNotes(true); save(); } @@ -4603,7 +4603,7 @@ void Basket::linkLookChanged() note->linkLookChanged(); note = note->next(); } - retqlayoutNotes(true); + relayoutNotes(true); } void Basket::slotCopyingDone2(KIO::Job *job) @@ -4795,7 +4795,7 @@ Note* Basket::noteOn(NoteOn side) int bestDistance = contentsWidth() * contentsHeight() * 10; Note *note = firstNoteShownInStack(); - Note *primary = m_focusedNote->tqparentPrimaryNote(); + Note *primary = m_focusedNote->parentPrimaryNote(); while (note) { switch (side) { case LEFT_SIDE: distance = m_focusedNote->distanceOnLeftRight(note, LEFT_SIDE); break; @@ -4803,7 +4803,7 @@ Note* Basket::noteOn(NoteOn side) case TOP_SIDE: distance = m_focusedNote->distanceOnTopBottom(note, TOP_SIDE); break; case BOTTOM_SIDE: distance = m_focusedNote->distanceOnTopBottom(note, BOTTOM_SIDE); break; } - if ((side == TOP_SIDE || side == BOTTOM_SIDE || primary != note->tqparentPrimaryNote()) && note != m_focusedNote && distance > 0 && distance < bestDistance) { + if ((side == TOP_SIDE || side == BOTTOM_SIDE || primary != note->parentPrimaryNote()) && note != m_focusedNote && distance > 0 && distance < bestDistance) { bestNote = note; bestDistance = distance; } @@ -4816,12 +4816,12 @@ Note* Basket::noteOn(NoteOn side) Note* Basket::firstNoteInGroup() { Note *child = m_focusedNote; - Note *tqparent = (m_focusedNote ? m_focusedNote->tqparentNote() : 0); + Note *tqparent = (m_focusedNote ? m_focusedNote->parentNote() : 0); while (tqparent) { if (tqparent->firstChild() != child && !tqparent->isColumn()) return tqparent->firstRealChild(); child = tqparent; - tqparent = tqparent->tqparentNote(); + tqparent = tqparent->parentNote(); } return 0; } @@ -4830,12 +4830,12 @@ Note* Basket::noteOnHome() { // First try to find the first note of the group containing the focused note: Note *child = m_focusedNote; - Note *tqparent = (m_focusedNote ? m_focusedNote->tqparentNote() : 0); + Note *tqparent = (m_focusedNote ? m_focusedNote->parentNote() : 0); while (tqparent) { if (tqparent->nextShownInStack() != m_focusedNote) return tqparent->nextShownInStack(); child = tqparent; - tqparent = tqparent->tqparentNote(); + tqparent = tqparent->parentNote(); } // If it was not found, then focus the very first note in the basket: @@ -4857,7 +4857,7 @@ Note* Basket::noteOnHome() Note* Basket::noteOnEnd() { Note *child = m_focusedNote; - Note *tqparent = (m_focusedNote ? m_focusedNote->tqparentNote() : 0); + Note *tqparent = (m_focusedNote ? m_focusedNote->parentNote() : 0); Note *lastChild; while (tqparent) { lastChild = tqparent->lastRealChild(); @@ -4869,7 +4869,7 @@ Note* Basket::noteOnEnd() return lastChild; } child = tqparent; - tqparent = tqparent->tqparentNote(); + tqparent = tqparent->parentNote(); } if (isFreeLayout()) { Note *last; @@ -5555,7 +5555,7 @@ void Basket::delNote(Note *note, bool askForMirroredFile) if (note->isSelected()) note->setSelected(false); //removeSelectedNote(); - retqlayoutNotes(); + relayoutNotes(); recolorizeNotes(); resetInsertTo(); // If we delete the first or the last, pointer to it is invalid save(); |