diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -84,7 +84,11 @@ KF5::XmlGui ) -set_target_properties(basketcommon PROPERTIES VERSION ${Qt5Core_VERSION} SOVERSION ${Qt5Core_VERSION_MAJOR}) +set_target_properties(basketcommon PROPERTIES + VERSION ${Qt5Core_VERSION} + SOVERSION ${Qt5Core_VERSION_MAJOR} + CXX_STANDARD 17 + CXX_EXTENSIONS OFF) install(TARGETS basketcommon DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/basketscene.h b/src/basketscene.h --- a/src/basketscene.h +++ b/src/basketscene.h @@ -571,8 +571,6 @@ void selectionChangedInEditor(); void contentChangedInEditor(); void inactivityAutoSaveTimeout(); -public slots: - void editorCursorPositionChanged(); private: qreal m_editorX; diff --git a/src/basketscene.cpp b/src/basketscene.cpp --- a/src/basketscene.cpp +++ b/src/basketscene.cpp @@ -2290,7 +2290,8 @@ } break; } // If there is no link, edit note content - case Note::Content: { + [[fallthrough]]; + case Note::Content: if (m_editor && m_editor->note() == clicked && m_editor->graphicsWidget()) { m_editor->setCursorTo(event->scenePos()); } else { @@ -2300,7 +2301,6 @@ QGraphicsScene::mouseReleaseEvent(event); } break; - } case Note::TopInsert: case Note::TopGroup: case Note::BottomInsert: @@ -2510,14 +2510,12 @@ m_editor->lineEdit()->selectAll(); } else { // First select all in the group, then in the parent group... - Note *child = m_focusedNote; Note *parent = (m_focusedNote ? m_focusedNote->parentNote() : nullptr); while (parent) { if (!parent->allSelected()) { parent->setSelectedRecursively(true); return; } - child = parent; parent = parent->parentNote(); } // Then, select all: @@ -3639,21 +3637,6 @@ // ensureNoteVisible(note); } -void BasketScene::editorCursorPositionChanged() -{ - if (!isDuringEdit()) - return; - - FocusedTextEdit *textEdit = dynamic_cast(m_editor->textEdit()); - - if (textEdit) { - QPoint cursorPoint = textEdit->viewport()->mapToGlobal(textEdit->cursorRect().center()); - - // QPointF contentsCursor = m_view->mapToScene( m_view->viewport()->mapFromGlobal(cursorPoint) ); - // m_view->ensureVisible(contentsCursor.x(), contentsCursor.y(),1,1); - } -} - void BasketScene::closeEditorDelayed() { setFocus(); @@ -4636,12 +4619,10 @@ Note *BasketScene::noteOnHome() { // First try to find the first note of the group containing the focused note: - Note *child = m_focusedNote; Note *parent = (m_focusedNote ? m_focusedNote->parentNote() : nullptr); while (parent) { if (parent->nextShownInStack() != m_focusedNote) return parent->nextShownInStack(); - child = parent; parent = parent->parentNote(); } @@ -4663,7 +4644,6 @@ Note *BasketScene::noteOnEnd() { - Note *child = m_focusedNote; Note *parent = (m_focusedNote ? m_focusedNote->parentNote() : nullptr); Note *lastChild; while (parent) { @@ -4675,7 +4655,6 @@ if (lastChild && lastChild->isShown() && lastChild != m_focusedNote) return lastChild; } - child = parent; parent = parent->parentNote(); } if (isFreeLayout()) { diff --git a/src/linklabel.cpp b/src/linklabel.cpp --- a/src/linklabel.cpp +++ b/src/linklabel.cpp @@ -493,7 +493,7 @@ qreal theWidth = qMin(width, maxWidth()); qreal theHeight = qMin(height, heightForWidth(theWidth)); QPixmap pixmap(theWidth, theHeight); - pixmap.fill(palette.color(QPalette::Active, QPalette::Background)); + pixmap.fill(palette.color(QPalette::Active, QPalette::Window)); QPainter painter(&pixmap); paint(&painter, 0, diff --git a/src/noteedit.cpp b/src/noteedit.cpp --- a/src/noteedit.cpp +++ b/src/noteedit.cpp @@ -233,10 +233,6 @@ setInlineEditor(textEdit); connect(textEdit, SIGNAL(escapePressed()), this, SIGNAL(askValidation())); connect(textEdit, SIGNAL(mouseEntered()), this, SIGNAL(mouseEnteredEditorWidget())); - - connect(textEdit, SIGNAL(cursorPositionChanged()), textContent->note()->basket(), SLOT(editorCursorPositionChanged())); - // In case it is a very big note, the top is displayed and Enter is pressed: the cursor is on bottom, we should enure it visible: - QTimer::singleShot(0, textContent->note()->basket(), SLOT(editorCursorPositionChanged())); } TextEditor::~TextEditor() @@ -344,10 +340,6 @@ connect(textEdit, SIGNAL(textChanged()), this, SLOT(editTextChanged())); InlineEditors::instance()->richTextUndo->setEnabled(false); InlineEditors::instance()->richTextRedo->setEnabled(false); - - connect(textEdit, SIGNAL(cursorPositionChanged()), htmlContent->note()->basket(), SLOT(editorCursorPositionChanged())); - // In case it is a very big note, the top is displayed and Enter is pressed: the cursor is on bottom, we should enure it visible: - QTimer::singleShot(0, htmlContent->note()->basket(), SLOT(editorCursorPositionChanged())); } void HtmlEditor::cursorPositionChanged()