[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [PATCH] Show the clipboard history when pressing the Paste
From:       David Faure <dfaure () klaralvdalens-datakonsult ! se>
Date:       2003-09-24 16:43:20
[Download RAW message or body]

On Wednesday 24 September 2003 18:15, Andras Mantia wrote:
> +      if (klipper.send("setClipboardContents", m_popup->text(id)))
> +        kdDebug(129) << "Clipboard: " << qApp->clipboard()->text(QClipboard::Clipboard) << endl;    
> +    }
> +    QTimer::singleShot(20, this, SLOT(slotActivated())); 

That's a very obvious race condition.
You should use call() instead of send(), in order to be certain that klipper
processed the call before using the clipboard. Then you don't need
the QTimer::singleShot.

Mmm, if we have the text in memory why do we have to ask klipper to 
set the clipboard? Because it can be a shortened version of the text?
But then what happens if two texts have the same shortened version?
(or does klipper prevent against that?)... OK, this paragraph is about
something rather minor, you can ignore this :)

This action looks good to me, otherwise. I just hope it doesn't become
the standard action for KStdAction::paste, because e.g. in a vector
drawing application, seeing text contents to be pasted is totally useless.

-- 
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic