Changeset View
Changeset View
Standalone View
Standalone View
klipper/klipper.cpp
Show First 20 Lines • Show All 597 Lines • ▼ Show 20 Line(s) | |||||
598 | 598 | | |||
599 | HistoryItemPtr Klipper::applyClipChanges( const QMimeData* clipData ) | 599 | HistoryItemPtr Klipper::applyClipChanges( const QMimeData* clipData ) | ||
600 | { | 600 | { | ||
601 | if ( m_locklevel ) { | 601 | if ( m_locklevel ) { | ||
602 | return HistoryItemPtr(); | 602 | return HistoryItemPtr(); | ||
603 | } | 603 | } | ||
604 | Ignore lock( m_locklevel ); | 604 | Ignore lock( m_locklevel ); | ||
605 | HistoryItemPtr item = HistoryItem::create( clipData ); | 605 | HistoryItemPtr item = HistoryItem::create( clipData ); | ||
606 | if (clipData->data(QStringLiteral("x-kde-passwordManagerHint")) != QByteArrayLiteral("secret")) { | 606 | | ||
607 | bool saveHistory = true; | ||||
608 | if (clipData->data(QStringLiteral("x-kde-passwordManagerHint")) == QByteArrayLiteral("secret")) { | ||||
609 | saveHistory = false; | ||||
610 | } | ||||
611 | if (clipdata->hasImage() && m_bIgnoreImages) { | ||||
612 | saveHistory = false; | ||||
613 | } | ||||
614 | | ||||
615 | if (saveHistory) { | ||||
607 | history()->insert( item ); | 616 | history()->insert( item ); | ||
608 | } | 617 | } | ||
609 | return item; | 618 | return item; | ||
610 | 619 | | |||
611 | } | 620 | } | ||
612 | 621 | | |||
613 | void Klipper::newClipData( QClipboard::Mode mode ) | 622 | void Klipper::newClipData( QClipboard::Mode mode ) | ||
614 | { | 623 | { | ||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Line(s) | 735 | if( selectionMode && m_bSelectionTextOnly && !data->hasText()) | |||
727 | return; | 736 | return; | ||
728 | 737 | | |||
729 | if( data->hasUrls() ) | 738 | if( data->hasUrls() ) | ||
730 | ; // ok | 739 | ; // ok | ||
731 | else if( data->hasText() ) | 740 | else if( data->hasText() ) | ||
732 | ; // ok | 741 | ; // ok | ||
733 | else if( data->hasImage() ) | 742 | else if( data->hasImage() ) | ||
734 | { | 743 | { | ||
735 | if( m_bIgnoreImages ) | 744 | if (!data->hasFormat(QStringLiteral("x-kde-force-image-copy"))) | ||
davidedmundsonUnsubmitted Not Done davidedmundson: bIgnoreImages || !data-> ... | |||||
But bIgnoreImages is used later in the code, when determining whether to save images to history or not. Is it really necessary here? If it's added here then we're back to square one because copying screenshots to clipboard won't work with the default behavior of Klipper. kdautovic: But bIgnoreImages is used later in the code, when determining whether to save images to history… | |||||
We want:
I think this patch is going to break case 2 as we now return early. But you're right that my comment was wrong, I meant. if (m_ignoreImage && !data-> return; davidedmundson: We want:
1) if ignore images is false and it's from spectacle - we load the image in the… | |||||
736 | return; | 745 | return; | ||
737 | } | 746 | } | ||
738 | else // unknown, ignore | 747 | else // unknown, ignore | ||
739 | return; | 748 | return; | ||
740 | 749 | | |||
741 | HistoryItemPtr item = applyClipChanges( data ); | 750 | HistoryItemPtr item = applyClipChanges( data ); | ||
742 | if (changed) { | 751 | if (changed) { | ||
743 | qCDebug(KLIPPER_LOG) << "Synchronize?" << m_bSynchronize; | 752 | qCDebug(KLIPPER_LOG) << "Synchronize?" << m_bSynchronize; | ||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |