Bug 235561

Summary: copy / paste of text file from kate / kwrite into pastebin fails over 200kB
Product: [Applications] kate Reporter: Barry Jackson <zen25000>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Mandriva RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Barry Jackson 2010-04-27 18:42:59 UTC
Version:           3.3.5 (using KDE 4.3.5)
OS:                Linux
Installed from:    Mandriva RPMs

If a text file of 275kB is copied from kate or kwrite and pasted into http://www.pastebin.com then nothing is pasted.
The same text can be click/drag/dropped into the text window without issue.

I have made extensive tests with 5 or 6 operating systems to narrow this down and it only fails with kate or kwrite in either KDE or Gnome desktop environments.

If the file size is under approx 200kB then there is no problem.

A simple test to reproduce this is here:-
http://forum.mandriva.com/viewtopic.php?p=797201#797201
the thread also outlines my tests done so far.

The tests cover several different versions of kate / kwrite and KDE up to the current Mandriva Cooker.
Comment 1 Dominik Haumann 2010-05-29 13:24:47 UTC
The console output says:
  QClipboard: Timed out while sending data

The Qt source code says:
  // 5s timeout on clipboard operations
  qclipboard_x11.cpp:static int clipboard_timeout = 5000; 

So Qt has a hard coded 5s timeout. If the transaction is not finished in that time, it is aborted. QClipboard uses the eventloop to restart this timer.

Kate Parts code looks like this:
void KateView::copy() const
{
  QString text = selectionText();
  // [...]

  QApplication::clipboard()->setText(text);
}

So Kate simply sets the text and can do nothing about it... Reporting upstream:
http://bugreports.qt.nokia.com/browse/QTBUG-11085