Commit 6a178a5b authored by Karlo Dautović's avatar Karlo Dautović Committed by Nate Graham

Change default Klipper behavior to accept images

Summary:
Change the default Klipper behavior in order for https://phabricator.kde.org/D19715 to work.

Klipper will save images to clipboard, but unless Ignore Images is unchecked in the options, it won't save them to clipboard history.

CCBUG: 393708

Reviewers: #plasma_workspaces, davidedmundson

Reviewed By: #plasma_workspaces, davidedmundson

Subscribers: ngraham, davidedmundson, plasma-devel, #plasma_workspaces

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D19852
parent c06ab481
......@@ -603,7 +603,16 @@ HistoryItemPtr Klipper::applyClipChanges( const QMimeData* clipData )
}
Ignore lock( m_locklevel );
HistoryItemPtr item = HistoryItem::create( clipData );
if (clipData->data(QStringLiteral("x-kde-passwordManagerHint")) != QByteArrayLiteral("secret")) {
bool saveHistory = true;
if (clipData->data(QStringLiteral("x-kde-passwordManagerHint")) == QByteArrayLiteral("secret")) {
saveHistory = false;
}
if (clipdata->hasImage() && m_bIgnoreImages) {
saveHistory = false;
}
if (saveHistory) {
history()->insert( item );
}
return item;
......@@ -732,7 +741,7 @@ void Klipper::checkClipData( bool selectionMode )
; // ok
else if( data->hasImage() )
{
if( m_bIgnoreImages )
if (m_bIgnoreImages && !data->hasFormat(QStringLiteral("x-kde-force-image-copy")))
return;
}
else // unknown, ignore
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment