From cc0ad49c75d6cf6b4e63eb8c6012afe55c1589f9 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 15 Feb 2011 19:15:16 +0000 Subject: Allow kdebase to (mostly) function correctly with TQt for Qt4 Fix kicker tackbar handling under Classic mode (thanks to Ilya Chernykh for the patch) Fix a newly invalidated section of code under GCC 4.5.2 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47723#c6) git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1220927 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- klipper/clipboardpoll.cpp | 14 +++++++------- klipper/configdialog.cpp | 2 +- klipper/historyitem.cpp | 2 +- klipper/historyitem.h | 2 +- klipper/toplevel.cpp | 18 +++++++++--------- 5 files changed, 19 insertions(+), 19 deletions(-) (limited to 'klipper') diff --git a/klipper/clipboardpoll.cpp b/klipper/clipboardpoll.cpp index d87e59985..d0b5cf01d 100644 --- a/klipper/clipboardpoll.cpp +++ b/klipper/clipboardpoll.cpp @@ -46,7 +46,7 @@ In order to avoid transferring all the data on every time pulse, this file implements two optimizations: The first one is checking whether the selection owner is Qt application (using the _QT_SELECTION/CLIPBOARD_SENTINEL atoms on the root window of screen 0), and if yes, - Klipper can rely on QClipboard's signals. If the owner is not Qt app, and the ownership has changed, + Klipper can rely on TQClipboard's signals. If the owner is not Qt app, and the ownership has changed, it means the selection has changed as well. Otherwise, first only the timestamp of the last selection change is requested using the TIMESTAMP selection target, and if it's the same, it's assumed the contents haven't changed. Note that some applications (like XEmacs) does @@ -111,8 +111,8 @@ ClipboardPoll::ClipboardPoll( TQWidget* parent ) void ClipboardPoll::initPolling() { - connect( kapp->clipboard(), TQT_SIGNAL( selectionChanged() ), TQT_SLOT(qtSelectionChanged())); - connect( kapp->clipboard(), TQT_SIGNAL( dataChanged() ), TQT_SLOT( qtClipboardChanged() )); + connect( kapp->tqclipboard(), TQT_SIGNAL( selectionChanged() ), TQT_SLOT(qtSelectionChanged())); + connect( kapp->tqclipboard(), TQT_SIGNAL( dataChanged() ), TQT_SLOT( qtClipboardChanged() )); connect( &timer, TQT_SIGNAL( timeout()), TQT_SLOT( timeout())); timer.start( 1000, false ); selection.atom = XA_PRIMARY; @@ -149,7 +149,7 @@ bool ClipboardPoll::x11Event( XEvent* e ) if( xfixes_event_base != -1 && e->type == xfixes_event_base + XFixesSelectionNotify ) { XFixesSelectionNotifyEvent* ev = reinterpret_cast< XFixesSelectionNotifyEvent* >( e ); - if( ev->selection == XA_PRIMARY && !kapp->clipboard()->ownsSelection()) + if( ev->selection == XA_PRIMARY && !kapp->tqclipboard()->ownsSelection()) { #ifdef NOISY_KLIPPER_ kdDebug() << "SELECTION CHANGED (XFIXES)" << endl; @@ -157,7 +157,7 @@ bool ClipboardPoll::x11Event( XEvent* e ) qt_x_time = ev->timestamp; emit clipboardChanged( true ); } - else if( ev->selection == xa_clipboard && !kapp->clipboard()->ownsClipboard()) + else if( ev->selection == xa_clipboard && !kapp->tqclipboard()->ownsClipboard()) { #ifdef NOISY_KLIPPER_ kdDebug() << "CLIPBOARD CHANGED (XFIXES)" << endl; @@ -220,13 +220,13 @@ void ClipboardPoll::updateQtOwnership( SelectionData& data ) void ClipboardPoll::timeout() { KlipperWidget::updateTimestamp(); - if( !kapp->clipboard()->ownsSelection() && checkTimestamp( selection ) ) { + if( !kapp->tqclipboard()->ownsSelection() && checkTimestamp( selection ) ) { #ifdef NOISY_KLIPPER_ kdDebug() << "SELECTION CHANGED" << endl; #endif emit clipboardChanged( true ); } - if( !kapp->clipboard()->ownsClipboard() && checkTimestamp( clipboard ) ) { + if( !kapp->tqclipboard()->ownsClipboard() && checkTimestamp( clipboard ) ) { #ifdef NOISY_KLIPPER_ kdDebug() << "CLIPBOARD CHANGED" << endl; #endif diff --git a/klipper/configdialog.cpp b/klipper/configdialog.cpp index 73df8dd26..72473d300 100644 --- a/klipper/configdialog.cpp +++ b/klipper/configdialog.cpp @@ -204,7 +204,7 @@ void ListView::rename( TQListViewItem* item, int c ) if ( gui ) { if ( ! _regExpEditor ) _regExpEditor = KParts::ComponentFactory::createInstanceFromQuery( "KRegExpEditor/KRegExpEditor", TQString(), TQT_TQOBJECT(this) ); - KRegExpEditorInterface *iface = static_cast( _regExpEditor->tqqt_cast( "KRegExpEditorInterface" ) ); + KRegExpEditorInterface *iface = static_cast( _regExpEditor->qt_cast( "KRegExpEditorInterface" ) ); assert( iface ); iface->setRegExp( item->text( 0 ) ); diff --git a/klipper/historyitem.cpp b/klipper/historyitem.cpp index b217bdb31..3dfc37f17 100644 --- a/klipper/historyitem.cpp +++ b/klipper/historyitem.cpp @@ -53,7 +53,7 @@ HistoryItem* HistoryItem::create( const TQMimeSource& aSource ) if( KURLDrag::decode( &aSource, urls, metaData )) { // this is from KonqDrag (libkonq) TQByteArray a = aSource.tqencodedData( "application/x-kde-cutselection" ); - bool cut = !a.isEmpty() && (a.at(0) == '1'); // true if 1 + bool cut = !a.isEmpty() && (a.tqat(0) == '1'); // true if 1 return new HistoryURLItem( urls, metaData, cut ); } } diff --git a/klipper/historyitem.h b/klipper/historyitem.h index 437bc84f0..b0ab0bc53 100644 --- a/klipper/historyitem.h +++ b/klipper/historyitem.h @@ -49,7 +49,7 @@ public: inline virtual const TQPixmap& image() const; /** - * Returns TQMimeSource suitable for QClipboard::setData(). + * Returns TQMimeSource suitable for TQClipboard::setData(). */ virtual TQMimeSource* mimeSource() const = 0; diff --git a/klipper/toplevel.cpp b/klipper/toplevel.cpp index b91b5deb0..ce539f825 100644 --- a/klipper/toplevel.cpp +++ b/klipper/toplevel.cpp @@ -698,8 +698,8 @@ void KlipperWidget::slotClearClipboard() { Ignore lock( locklevel ); - clip->clear(QClipboard::Selection); - clip->clear(QClipboard::Clipboard); + clip->clear(TQClipboard::Selection); + clip->clear(TQClipboard::Clipboard); } @@ -712,11 +712,11 @@ TQString KlipperWidget::clipboardContents( bool * /*isSelection*/ ) #if 0 bool selection = true; - TQMimeSource* data = clip->data(QClipboard::Selection); + TQMimeSource* data = clip->data(TQClipboard::Selection); if ( data->serialNumber() == m_lastSelection ) { - TQString clipContents = clip->text(QClipboard::Clipboard); + TQString clipContents = clip->text(TQClipboard::Clipboard); if ( clipContents != m_lastClipboard ) { contents = clipContents; @@ -845,7 +845,7 @@ void KlipperWidget::checkClipData( bool selectionMode ) kdDebug() << "\nselectionMode=" << selectionMode << "\nserialNo=" << clip->data()->serialNumber() << " (sel,cli)=(" << m_lastSelection << "," << m_lastClipboard << ")" << "\nowning (sel,cli)=(" << clip->ownsSelection() << "," << clip->ownsClipboard() << ")" - << "\ntext=" << clip->text( selectionMode ? QClipboard::Selection : QClipboard::Clipboard) << endl; + << "\ntext=" << clip->text( selectionMode ? TQClipboard::Selection : TQClipboard::Clipboard) << endl; #endif #if 0 @@ -963,14 +963,14 @@ void KlipperWidget::setClipboard( const HistoryItem& item, int mode ) #ifdef NOSIY_KLIPPER kdDebug() << "Setting selection to <" << item.text() << ">" << endl; #endif - clip->setData( item.mimeSource(), QClipboard::Selection ); + clip->setData( item.mimeSource(), TQClipboard::Selection ); m_lastSelection = clip->data()->serialNumber(); } if ( mode & Clipboard ) { #ifdef NOSIY_KLIPPER kdDebug() << "Setting clipboard to <" << item.text() << ">" << endl; #endif - clip->setData( item.mimeSource(), QClipboard::Clipboard ); + clip->setData( item.mimeSource(), TQClipboard::Clipboard ); m_lastClipboard = clip->data()->serialNumber(); } @@ -1028,10 +1028,10 @@ bool KlipperWidget::ignoreClipboardChanges() const return false; } -// QClipboard uses qt_x_time as the timestamp for selection operations. +// TQClipboard uses qt_x_time as the timestamp for selection operations. // It is updated mainly from user actions, but Klipper polls the clipboard // without any user action triggering it, so qt_x_time may be old, -// which could possibly lead to QClipboard reporting empty clipboard. +// which could possibly lead to TQClipboard reporting empty clipboard. // Therefore, qt_x_time needs to be updated to current X server timestamp. // Call KApplication::updateUserTime() only from functions that are -- cgit v1.2.1