From kde-commits Wed Dec 11 21:01:13 2002 From: Kevin Puetz Date: Wed, 11 Dec 2002 21:01:13 +0000 To: kde-commits Subject: kdelibs/khtml X-MARC-Message: https://marc.info/?l=kde-commits&m=103964053811825 CVS commit by puetzk: Use the qt3.1 clipboard API, instead of the deprecated setSelectionMode() This almost has the same bug as the konq_dirpart stuff fixed a few days ago, except we do it again later in the function and end up fixing it. Still ugly, new was is nicer :-) M +2 -7 khtml_part.cpp 1.782 --- kdelibs/khtml/khtml_part.cpp #1.781:1.782 @@ -4657,8 +4657,6 @@ void KHTMLPart::khtmlMouseReleaseEvent( if ((d->m_guiProfile == BrowserViewGUI) && (_mouse->button() == MidButton) && (event->url().isNull())) { - QClipboard *cb = QApplication::clipboard(); - cb->setSelectionMode( true ); QCString plain("plain"); - QString url = cb->text(plain).stripWhiteSpace(); + QString url = QApplication::clipboard()->text(plain,QClipboard::Selection).stripWhiteSpace(); // Check if it's a URL @@ -4726,10 +4724,7 @@ void KHTMLPart::khtmlMouseReleaseEvent( QString text = selectedText(); text.replace(QRegExp(QChar(0xa0)), " "); - QClipboard *cb = QApplication::clipboard(); - cb->setSelectionMode( true ); disconnect( kapp->clipboard(), SIGNAL( selectionChanged()), this, SLOT( slotClearSelection())); - cb->setText(text); + kapp->clipboard()->setText(text,QClipboard::Selection); connect( kapp->clipboard(), SIGNAL( selectionChanged()), SLOT( slotClearSelection())); - cb->setSelectionMode( false ); #endif //kdDebug( 6000 ) << "selectedText = " << text << endl;