Changeset View
Changeset View
Standalone View
Standalone View
klipper/klipper.cpp
Context not available. | |||||
606 | Ignore lock( m_locklevel ); | 606 | Ignore lock( m_locklevel ); | ||
---|---|---|---|---|---|
607 | HistoryItemPtr item = HistoryItem::create( clipData ); | 607 | HistoryItemPtr item = HistoryItem::create( clipData ); | ||
608 | 608 | | |||
609 | bool saveHistory = true; | 609 | bool saveInHistory = true; | ||
610 | if (clipData->data(QStringLiteral("x-kde-passwordManagerHint")) == QByteArrayLiteral("secret")) { | 610 | if (clipData->data(QStringLiteral("x-kde-passwordManagerHint")) == QByteArrayLiteral("secret")) { | ||
611 | saveHistory = false; | 611 | saveInHistory = false; | ||
612 | } | 612 | } | ||
613 | if (clipData->hasImage() && m_bIgnoreImages) { | 613 | if (clipData->hasImage() && m_bIgnoreImages) { | ||
614 | saveHistory = false; | 614 | saveInHistory = false; | ||
615 | } | 615 | } | ||
616 | 616 | | |||
617 | m_last = item; | 617 | m_last = item.toWeakRef(); | ||
618 | 618 | | |||
619 | if (saveHistory) { | 619 | if (saveInHistory) { | ||
620 | history()->insert( item ); | 620 | history()->insert( item ); | ||
621 | } | 621 | } | ||
622 | return item; | 622 | return item; | ||
Context not available. | |||||
697 | // This won't quite work, but it's close enough for now. | 697 | // This won't quite work, but it's close enough for now. | ||
698 | // The trouble is that the top selection =! top clipboard | 698 | // The trouble is that the top selection =! top clipboard | ||
699 | // but we don't track that yet. We will.... | 699 | // but we don't track that yet. We will.... | ||
700 | auto top = m_last; | 700 | auto top = m_last.toStrongRef(); | ||
701 | if ( top ) { | 701 | if ( top ) { | ||
702 | setClipboard( *top, selectionMode ? Selection : Clipboard); | 702 | setClipboard( *top, selectionMode ? Selection : Clipboard); | ||
703 | } | 703 | } | ||
Context not available. | |||||
721 | } | 721 | } | ||
722 | 722 | | |||
723 | if ( changed && clipEmpty && m_bNoNullClipboard ) { | 723 | if ( changed && clipEmpty && m_bNoNullClipboard ) { | ||
724 | auto top = m_last; | 724 | auto top = m_last.toStrongRef(); | ||
725 | if ( top ) { | 725 | if ( top ) { | ||
726 | // keep old clipboard after someone set it to null | 726 | // keep old clipboard after someone set it to null | ||
727 | qCDebug(KLIPPER_LOG) << "Resetting clipboard (Prevent empty clipboard)"; | 727 | qCDebug(KLIPPER_LOG) << "Resetting clipboard (Prevent empty clipboard)"; | ||
Context not available. |