diff options
Diffstat (limited to 'klipper')
-rw-r--r-- | klipper/applet.cpp | 1 | ||||
-rw-r--r-- | klipper/applet.h | 5 | ||||
-rw-r--r-- | klipper/clipboardpoll.cpp | 17 | ||||
-rw-r--r-- | klipper/clipboardpoll.h | 3 | ||||
-rw-r--r-- | klipper/configdialog.cpp | 29 | ||||
-rw-r--r-- | klipper/configdialog.h | 11 | ||||
-rw-r--r-- | klipper/history.cpp | 3 | ||||
-rw-r--r-- | klipper/history.h | 3 | ||||
-rw-r--r-- | klipper/historyimageitem.cpp | 1 | ||||
-rw-r--r-- | klipper/historyimageitem.h | 1 | ||||
-rw-r--r-- | klipper/historyitem.cpp | 1 | ||||
-rw-r--r-- | klipper/historyitem.h | 1 | ||||
-rw-r--r-- | klipper/historystringitem.cpp | 1 | ||||
-rw-r--r-- | klipper/historystringitem.h | 1 | ||||
-rw-r--r-- | klipper/historyurlitem.cpp | 1 | ||||
-rw-r--r-- | klipper/historyurlitem.h | 1 | ||||
-rw-r--r-- | klipper/klipperbindings.cpp | 9 | ||||
-rw-r--r-- | klipper/klipperpopup.cpp | 31 | ||||
-rw-r--r-- | klipper/klipperpopup.h | 3 | ||||
-rw-r--r-- | klipper/main.cpp | 5 | ||||
-rw-r--r-- | klipper/popupproxy.cpp | 11 | ||||
-rw-r--r-- | klipper/popupproxy.h | 3 | ||||
-rw-r--r-- | klipper/toplevel.cpp | 136 | ||||
-rw-r--r-- | klipper/toplevel.h | 9 | ||||
-rw-r--r-- | klipper/urlgrabber.cpp | 11 | ||||
-rw-r--r-- | klipper/urlgrabber.h | 3 | ||||
-rw-r--r-- | klipper/version.h | 1 |
27 files changed, 157 insertions, 145 deletions
diff --git a/klipper/applet.cpp b/klipper/applet.cpp index aaaf95232..ac47f4d9b 100644 --- a/klipper/applet.cpp +++ b/klipper/applet.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) by Andrew Stanley-Jones Copyright (C) 2000 by Carsten Pfeiffer <pfeiffer@kde.org> diff --git a/klipper/applet.h b/klipper/applet.h index 3f1ee3361..acf4e1083 100644 --- a/klipper/applet.h +++ b/klipper/applet.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) Andrew Stanley-Jones @@ -29,7 +28,7 @@ class KlipperAppletWidget; class KlipperApplet : public KPanelApplet { - Q_OBJECT + TQ_OBJECT public: KlipperApplet(const TQString& configFile, Type t = Normal, int actions = 0, TQWidget *parent = 0, const char *name = 0); @@ -50,7 +49,7 @@ private: class KlipperAppletWidget : public KlipperWidget { - Q_OBJECT + TQ_OBJECT K_DCOP k_dcop: int newInstance(); diff --git a/klipper/clipboardpoll.cpp b/klipper/clipboardpoll.cpp index cc2f3877f..a2f5368a8 100644 --- a/klipper/clipboardpoll.cpp +++ b/klipper/clipboardpoll.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2003 by Lubos Lunak <l.lunak@kde.org> @@ -109,13 +108,13 @@ 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( &timer, TQT_SIGNAL( timeout()), TQT_SLOT( timeout())); + connect( kapp->clipboard(), TQ_SIGNAL( selectionChanged() ), TQ_SLOT(qtSelectionChanged())); + connect( kapp->clipboard(), TQ_SIGNAL( dataChanged() ), TQ_SLOT( qtClipboardChanged() )); + connect( &timer, TQ_SIGNAL( timeout()), TQ_SLOT( timeout())); timer.start( 1000, false ); selection.atom = XA_PRIMARY; clipboard.atom = xa_clipboard; - selection.last_change = clipboard.last_change = GET_QT_X_TIME(); // don't trigger right after startup + selection.last_change = clipboard.last_change = get_tqt_x_time(); // don't trigger right after startup selection.last_owner = XGetSelectionOwner( tqt_xdisplay(), XA_PRIMARY ); #ifdef NOISY_KLIPPER_ kdDebug() << "(1) Setting last_owner for =" << "selection" << ":" << selection.last_owner << endl; @@ -152,7 +151,7 @@ bool ClipboardPoll::x11Event( XEvent* e ) #ifdef NOISY_KLIPPER_ kdDebug() << "SELECTION CHANGED (XFIXES)" << endl; #endif - SET_QT_X_TIME(ev->timestamp); + set_tqt_x_time(ev->timestamp); emit clipboardChanged( true ); } else if( ev->selection == xa_clipboard && !kapp->clipboard()->ownsClipboard()) @@ -160,7 +159,7 @@ bool ClipboardPoll::x11Event( XEvent* e ) #ifdef NOISY_KLIPPER_ kdDebug() << "CLIPBOARD CHANGED (XFIXES)" << endl; #endif - SET_QT_X_TIME(ev->timestamp); + set_tqt_x_time(ev->timestamp); emit clipboardChanged( false ); } } @@ -270,9 +269,9 @@ bool ClipboardPoll::checkTimestamp( SelectionData& data ) return false; } XDeleteProperty( tqt_xdisplay(), winId(), data.timestamp_atom ); - XConvertSelection( tqt_xdisplay(), data.atom, xa_timestamp, data.timestamp_atom, winId(), GET_QT_X_TIME() ); + XConvertSelection( tqt_xdisplay(), data.atom, xa_timestamp, data.timestamp_atom, winId(), get_tqt_x_time() ); data.waiting_for_timestamp = true; - data.waiting_x_time = GET_QT_X_TIME(); + data.waiting_x_time = get_tqt_x_time(); #ifdef REALLY_NOISY_KLIPPER_ kdDebug() << "WAITING TIMESTAMP:" << ( data.atom == XA_PRIMARY ) << endl; #endif diff --git a/klipper/clipboardpoll.h b/klipper/clipboardpoll.h index f0579a4cb..a8d078e35 100644 --- a/klipper/clipboardpoll.h +++ b/klipper/clipboardpoll.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2003 by Lubos Lunak <l.lunak@kde.org> @@ -28,7 +27,7 @@ class ClipboardPoll : public TQWidget { - Q_OBJECT + TQ_OBJECT public: ClipboardPoll( TQWidget* parent ); signals: diff --git a/klipper/configdialog.cpp b/klipper/configdialog.cpp index ad1ad93f0..0dfc7ede1 100644 --- a/klipper/configdialog.cpp +++ b/klipper/configdialog.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2000 by Carsten Pfeiffer <pfeiffer@kde.org> @@ -159,11 +158,11 @@ GeneralWidget::GeneralWidget( TQWidget *parent, const char *name ) maxItems = new KIntNumInput( this ); maxItems->setLabel( i18n( "C&lipboard history size:" ) ); maxItems->setRange( 2, 2048, 1, true ); - connect( maxItems, TQT_SIGNAL( valueChanged( int )), - TQT_SLOT( historySizeChanged( int ) )); + connect( maxItems, TQ_SIGNAL( valueChanged( int )), + TQ_SLOT( historySizeChanged( int ) )); - connect( group, TQT_SIGNAL( clicked( int )), - TQT_SLOT( slotClipConfigChanged() )); + connect( group, TQ_SIGNAL( clicked( int )), + TQ_SLOT( slotClipConfigChanged() )); slotClipConfigChanged(); // Add some spacing at the end @@ -202,7 +201,7 @@ void ListView::rename( TQListViewItem* item, int c ) if ( gui ) { if ( ! _regExpEditor ) - _regExpEditor = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor", TQString(), TQT_TQOBJECT(this) ); + _regExpEditor = KParts::ComponentFactory::createInstanceFromQuery<TQDialog>( "KRegExpEditor/KRegExpEditor", TQString(), this ); KRegExpEditorInterface *iface = static_cast<KRegExpEditorInterface *>( _regExpEditor->tqt_cast( "KRegExpEditorInterface" ) ); assert( iface ); iface->setRegExp( item->text( 0 ) ); @@ -244,13 +243,13 @@ ActionWidget::ActionWidget( const ActionList *list, ConfigDialog* configWidget, listView->setMultiSelection( false ); listView->setAllColumnsShowFocus( true ); listView->setSelectionMode( TQListView::Single ); - connect( listView, TQT_SIGNAL(executed( TQListViewItem*, const TQPoint&, int )), - TQT_SLOT( slotItemChanged( TQListViewItem*, const TQPoint& , int ) )); - connect( listView, TQT_SIGNAL( selectionChanged ( TQListViewItem * )), - TQT_SLOT(selectionChanged ( TQListViewItem * ))); + connect( listView, TQ_SIGNAL(executed( TQListViewItem*, const TQPoint&, int )), + TQ_SLOT( slotItemChanged( TQListViewItem*, const TQPoint& , int ) )); + connect( listView, TQ_SIGNAL( selectionChanged ( TQListViewItem * )), + TQ_SLOT(selectionChanged ( TQListViewItem * ))); connect(listView, - TQT_SIGNAL(contextMenu(TDEListView *, TQListViewItem *, const TQPoint&)), - TQT_SLOT( slotContextMenu(TDEListView*, TQListViewItem*, const TQPoint&))); + TQ_SIGNAL(contextMenu(TDEListView *, TQListViewItem *, const TQPoint&)), + TQ_SLOT( slotContextMenu(TDEListView*, TQListViewItem*, const TQPoint&))); ClipAction *action = 0L; ClipCommand *command = 0L; @@ -292,10 +291,10 @@ ActionWidget::ActionWidget( const ActionList *list, ConfigDialog* configWidget, TQHBox *box = new TQHBox( this ); box->setSpacing( KDialog::spacingHint() ); TQPushButton *button = new TQPushButton( i18n("&Add Action"), box ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( slotAddAction() )); + connect( button, TQ_SIGNAL( clicked() ), TQ_SLOT( slotAddAction() )); delActionButton = new TQPushButton( i18n("&Delete Action"), box ); - connect( delActionButton, TQT_SIGNAL( clicked() ), TQT_SLOT( slotDeleteAction() )); + connect( delActionButton, TQ_SIGNAL( clicked() ), TQ_SLOT( slotDeleteAction() )); TQLabel *label = new TQLabel(i18n("Click on a highlighted item's column to change it. \"%s\" in a command will be replaced with the clipboard contents."), box); label->setAlignment( WordBreak | AlignLeft | AlignVCenter ); @@ -305,7 +304,7 @@ ActionWidget::ActionWidget( const ActionList *list, ConfigDialog* configWidget, box = new TQHBox( this ); TQPushButton *advanced = new TQPushButton( i18n("Advanced..."), box ); advanced->setFixedSize( advanced->sizeHint() ); - connect( advanced, TQT_SIGNAL( clicked() ), TQT_SLOT( slotAdvanced() )); + connect( advanced, TQ_SIGNAL( clicked() ), TQ_SLOT( slotAdvanced() )); (void) new TQWidget( box ); // spacer delActionButton->setEnabled(listView->currentItem () !=0); diff --git a/klipper/configdialog.h b/klipper/configdialog.h index 345a9f052..fec1f7eaa 100644 --- a/klipper/configdialog.h +++ b/klipper/configdialog.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2000 by Carsten Pfeiffer <pfeiffer@kde.org> @@ -44,7 +43,7 @@ class ConfigDialog; class GeneralWidget : public TQVBox { - Q_OBJECT + TQ_OBJECT friend class ConfigDialog; @@ -68,7 +67,7 @@ private: // only for use inside ActionWidget class AdvancedWidget : public TQVBox { - Q_OBJECT + TQ_OBJECT public: AdvancedWidget( TQWidget *parent = 0L, const char *name = 0L ); @@ -83,7 +82,7 @@ private: class ActionWidget : public TQVBox { - Q_OBJECT + TQ_OBJECT friend class ConfigDialog; @@ -119,7 +118,7 @@ private: /*class KeysWidget : public QVBox { - Q_OBJECT + TQ_OBJECT friend class ConfigDialog; @@ -134,7 +133,7 @@ private: class ConfigDialog : public KDialogBase { - Q_OBJECT + TQ_OBJECT public: ConfigDialog( const ActionList *list, TDEGlobalAccel *accel, bool isApplet ); diff --git a/klipper/history.cpp b/klipper/history.cpp index a02b37156..99db4eaba 100644 --- a/klipper/history.cpp +++ b/klipper/history.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> Copyright (C) by Andrew Stanley-Jones @@ -30,7 +29,7 @@ History::History( TQWidget* parent, const char* name ) m_popup( new KlipperPopup( this, parent, "main_widget" ) ), m_topIsUserSelected( false ) { - connect( this, TQT_SIGNAL( changed() ), m_popup, TQT_SLOT( slotHistoryChanged() ) ); + connect( this, TQ_SIGNAL( changed() ), m_popup, TQ_SLOT( slotHistoryChanged() ) ); itemList.setAutoDelete( true ); } diff --git a/klipper/history.h b/klipper/history.h index 405041e0e..eaa7e58f3 100644 --- a/klipper/history.h +++ b/klipper/history.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> Copyright (C) Andrew Stanley-Jones @@ -32,7 +31,7 @@ class QptrListIterator; class History : public TQObject { - Q_OBJECT + TQ_OBJECT public: History( TQWidget* parent, const char* name ); ~History(); diff --git a/klipper/historyimageitem.cpp b/klipper/historyimageitem.cpp index 38767b42c..7c1cd858a 100644 --- a/klipper/historyimageitem.cpp +++ b/klipper/historyimageitem.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> diff --git a/klipper/historyimageitem.h b/klipper/historyimageitem.h index f9a79d89c..fee81d1eb 100644 --- a/klipper/historyimageitem.h +++ b/klipper/historyimageitem.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> diff --git a/klipper/historyitem.cpp b/klipper/historyitem.cpp index e035856d7..9b592fb0c 100644 --- a/klipper/historyitem.cpp +++ b/klipper/historyitem.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> diff --git a/klipper/historyitem.h b/klipper/historyitem.h index b0ab0bc53..2dba8a4e1 100644 --- a/klipper/historyitem.h +++ b/klipper/historyitem.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> diff --git a/klipper/historystringitem.cpp b/klipper/historystringitem.cpp index 85a4ede4d..154b8d539 100644 --- a/klipper/historystringitem.cpp +++ b/klipper/historystringitem.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> diff --git a/klipper/historystringitem.h b/klipper/historystringitem.h index a142fbe2e..e4d80b033 100644 --- a/klipper/historystringitem.h +++ b/klipper/historystringitem.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> diff --git a/klipper/historyurlitem.cpp b/klipper/historyurlitem.cpp index ea8fb7ffd..648084893 100644 --- a/klipper/historyurlitem.cpp +++ b/klipper/historyurlitem.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> diff --git a/klipper/historyurlitem.h b/klipper/historyurlitem.h index 7908721c8..54a40c069 100644 --- a/klipper/historyurlitem.h +++ b/klipper/historyurlitem.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> diff --git a/klipper/klipperbindings.cpp b/klipper/klipperbindings.cpp index 7029d4411..8db1f5fe8 100644 --- a/klipper/klipperbindings.cpp +++ b/klipper/klipperbindings.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) by Andrew Stanley-Jones @@ -19,7 +18,7 @@ */ #ifndef NOSLOTS # define DEF( name, key3, key4, fnSlot ) \ - keys->insert( name, i18n(name), TQString(), key3, key4, TQT_TQOBJECT(this), TQT_SLOT(fnSlot) ) + keys->insert( name, i18n(name), TQString(), key3, key4, this, TQ_SLOT(fnSlot) ) #else # define DEF( name, key3, key4, fnSlot ) \ keys->insert( name, i18n(name), TQString(), key3, key4 ) @@ -28,9 +27,9 @@ keys->insert( "Program:klipper", i18n("Clipboard") ); - DEF( I18N_NOOP("Show Klipper Popup-Menu"), ALT+CTRL+Qt::Key_V, WIN+CTRL+Qt::Key_V, slotPopupMenu() ); - DEF( I18N_NOOP("Manually Invoke Action on Current Clipboard"), ALT+CTRL+Qt::Key_R, WIN+CTRL+Qt::Key_R, slotRepeatAction() ); - DEF( I18N_NOOP("Enable/Disable Clipboard Actions"), ALT+CTRL+Qt::Key_X, WIN+CTRL+Qt::Key_X, toggleURLGrabber() ); + DEF( I18N_NOOP("Show Klipper Popup-Menu"), ALT+CTRL+TQt::Key_V, WIN+CTRL+TQt::Key_V, slotPopupMenu() ); + DEF( I18N_NOOP("Manually Invoke Action on Current Clipboard"), ALT+CTRL+TQt::Key_R, WIN+CTRL+TQt::Key_R, slotRepeatAction() ); + DEF( I18N_NOOP("Enable/Disable Clipboard Actions"), ALT+CTRL+TQt::Key_X, WIN+CTRL+TQt::Key_X, toggleURLGrabber() ); #undef DEF #undef WIN diff --git a/klipper/klipperpopup.cpp b/klipper/klipperpopup.cpp index 5ca29ef4f..38cd51aa5 100644 --- a/klipper/klipperpopup.cpp +++ b/klipper/klipperpopup.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> Copyright (C) by Andrew Stanley-Jones @@ -46,16 +45,16 @@ namespace { #ifdef DEBUG_EVENTS__ kdbgstream& operator<<( kdbgstream& stream, const TQKeyEvent& e ) { stream << "(TQKeyEvent(text=" << e.text() << ",key=" << e.key() << ( e.isAccepted()?",accepted":",ignored)" ) << ",count=" << e.count(); - if ( e.state() & Qt::AltButton ) { + if ( e.state() & TQt::AltButton ) { stream << ",ALT"; } - if ( e.state() & Qt::ControlButton ) { + if ( e.state() & TQt::ControlButton ) { stream << ",CTRL"; } - if ( e.state() & Qt::MetaButton ) { + if ( e.state() & TQt::MetaButton ) { stream << ",META"; } - if ( e.state() & Qt::ShiftButton ) { + if ( e.state() & TQt::ShiftButton ) { stream << ",SHIFT"; } if ( e.isAutoRepeat() ) { @@ -113,7 +112,7 @@ KlipperPopup::KlipperPopup( History* history, TQWidget* parent, const char* name m_popupProxy = new PopupProxy( this, "popup_proxy", menu_height, menu_width ); - connect( this, TQT_SIGNAL( aboutToShow() ), TQT_SLOT( slotAboutToShow() ) ); + connect( this, TQ_SIGNAL( aboutToShow() ), TQ_SLOT( slotAboutToShow() ) ); } KlipperPopup::~KlipperPopup() { @@ -146,7 +145,7 @@ void KlipperPopup::buildFromScratch() { m_filterWidget = new KLineEditBlackKey( this, "Klipper filter widget" ); insertTitle( SmallIcon( "klipper" ), i18n("Klipper - Clipboard Tool")); m_filterWidgetId = insertItem( m_filterWidget, m_filterWidgetId, 1 ); - m_filterWidget->setFocusPolicy( TQ_NoFocus ); + m_filterWidget->setFocusPolicy( TQWidget::NoFocus ); setItemVisible( m_filterWidgetId, false ); m_filterWidget->hide(); TQString lastGroup; @@ -250,15 +249,15 @@ void KlipperPopup::keyPressEvent( TQKeyEvent* e ) { // widget, except a few used for navigation: // These go to the superobject. switch( e->key() ) { - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_Right: - case Qt::Key_Left: - case Qt::Key_Tab: - case Qt::Key_Backtab: - case Qt::Key_Escape: - case Qt::Key_Return: - case Qt::Key_Enter: + case TQt::Key_Up: + case TQt::Key_Down: + case TQt::Key_Right: + case TQt::Key_Left: + case TQt::Key_Tab: + case TQt::Key_Backtab: + case TQt::Key_Escape: + case TQt::Key_Return: + case TQt::Key_Enter: { #ifdef DEBUG_EVENTS__ kdDebug() << "Passing this event to ancestor (TDEPopupMenu): " << e << endl; diff --git a/klipper/klipperpopup.h b/klipper/klipperpopup.h index ea800c675..f374a9978 100644 --- a/klipper/klipperpopup.h +++ b/klipper/klipperpopup.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> Copytight (C) by Andrew Stanley-Jones @@ -37,7 +36,7 @@ class KLineEdit; */ class KlipperPopup : public TDEPopupMenu { - Q_OBJECT + TQ_OBJECT public: KlipperPopup( History* history, TQWidget* parent=0, const char* name=0 ); diff --git a/klipper/main.cpp b/klipper/main.cpp index 0cdc73af3..4fc686f67 100644 --- a/klipper/main.cpp +++ b/klipper/main.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) Andrew Stanley-Jones @@ -30,7 +29,7 @@ #include "toplevel.h" #include "version.h" -#if defined Q_WS_X11 +#if defined TQ_WS_X11 #include <qxembed.h> // schroder #endif @@ -52,7 +51,7 @@ extern "C" int KDE_EXPORT kdemain(int argc, char *argv[]) // Make Klipper conform to freedesktop system tray standard, see // http://bugs.kde.org/show_bug.cgi?id=69119 -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_QTONLY QXEmbed::initialize(); #endif diff --git a/klipper/popupproxy.cpp b/klipper/popupproxy.cpp index 1c427834a..20f8139a1 100644 --- a/klipper/popupproxy.cpp +++ b/klipper/popupproxy.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> @@ -40,7 +39,7 @@ PopupProxy::PopupProxy( KlipperPopup* parent, const char* name, int menu_height, m_menu_width( menu_width ), nextItemNumber( 0 ) { - connect( parent->history(), TQT_SIGNAL( changed() ), TQT_SLOT( slotHistoryChanged() ) ); + connect( parent->history(), TQ_SIGNAL( changed() ), TQ_SLOT( slotHistoryChanged() ) ); } void PopupProxy::slotHistoryChanged() { @@ -99,7 +98,7 @@ void PopupProxy::tryInsertItem( HistoryItem const * const item, } else { const TQSize max_size( m_menu_width,m_menu_height/4 ); if ( image.height() > max_size.height() || image.width() > max_size.width() ) { - image.convertFromImage( TQImage(image.convertToImage()).smoothScale( max_size, TQ_ScaleMin ) ); + image.convertFromImage( TQImage(image.convertToImage()).smoothScale( max_size, TQImage::ScaleMin ) ); } id = proxy_for_menu->insertItem( image, -1, index ); } @@ -109,7 +108,7 @@ void PopupProxy::tryInsertItem( HistoryItem const * const item, Q_ASSERT( id != -1 ); // Be sure that the item was inserted. TQMenuItem* mi = proxy_for_menu->findItem( id ); int fontheight = TQFontMetrics( proxy_for_menu->fontMetrics() ).height(); - int itemheight = proxy_for_menu->style().tqsizeFromContents(TQStyle::CT_PopupMenuItem, + int itemheight = proxy_for_menu->style().sizeFromContents(TQStyle::CT_PopupMenuItem, proxy_for_menu, TQSize( 0, fontheight ), TQStyleOption(mi,10,0) ).height(); @@ -118,7 +117,7 @@ void PopupProxy::tryInsertItem( HistoryItem const * const item, History* history = parent()->history(); proxy_for_menu->connectItem( id, history, - TQT_SLOT( slotMoveToTop( int ) ) ); + TQ_SLOT( slotMoveToTop( int ) ) ); proxy_for_menu->setItemParameter( id, nextItemNumber ); } @@ -152,7 +151,7 @@ int PopupProxy::insertFromSpill( int index ) { if ( spillPointer.current() ) { TDEPopupMenu* moreMenu = new TDEPopupMenu( proxy_for_menu, "a more menu" ); proxy_for_menu->insertItem( i18n( "&More" ), moreMenu, -1, index ); - connect( moreMenu, TQT_SIGNAL( aboutToShow() ), TQT_SLOT( slotAboutToShow() ) ); + connect( moreMenu, TQ_SIGNAL( aboutToShow() ), TQ_SLOT( slotAboutToShow() ) ); proxy_for_menu = moreMenu; } diff --git a/klipper/popupproxy.h b/klipper/popupproxy.h index bc99daea2..6ca010f8c 100644 --- a/klipper/popupproxy.h +++ b/klipper/popupproxy.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> @@ -37,7 +36,7 @@ class KlipperPopup; */ class PopupProxy : public TQObject { - Q_OBJECT + TQ_OBJECT public: /** diff --git a/klipper/toplevel.cpp b/klipper/toplevel.cpp index 278e74bbb..b76c7472b 100644 --- a/klipper/toplevel.cpp +++ b/klipper/toplevel.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) by Andrew Stanley-Jones @@ -119,9 +118,6 @@ private: }; extern bool tqt_qclipboard_bailout_hack; -#if KDE_IS_VERSION( 15, 0, 0 ) -#error Check status of #80072 with Qt4. -#endif static void ensureGlobalSyncOff(TDEConfig* config); @@ -144,9 +140,10 @@ KlipperWidget::KlipperWidget( TQWidget *parent, TDEConfig* config ) setBackgroundMode( X11ParentRelative ); clip = kapp->clipboard(); - connect( &m_overflowClearTimer, TQT_SIGNAL( timeout()), TQT_SLOT( slotClearOverflow())); + connect( &m_overflowClearTimer, TQ_SIGNAL( timeout()), TQ_SLOT( slotClearOverflow())); m_overflowClearTimer.start( 1000 ); - connect( &m_pendingCheckTimer, TQT_SIGNAL( timeout()), TQT_SLOT( slotCheckPending())); + connect( &m_pendingCheckTimer, TQ_SIGNAL( timeout()), TQ_SLOT( slotCheckPending())); + connect( &m_setClipboardTimer, TQ_SIGNAL( timeout()), TQ_SLOT( slotDelayedSetClipboard())); m_history = new History( this, "main_history" ); @@ -159,25 +156,25 @@ KlipperWidget::KlipperWidget( TQWidget *parent, TDEConfig* config ) clearHistoryAction = new TDEAction( i18n("C&lear Clipboard History"), "history_clear", 0, - TQT_TQOBJECT(history()), - TQT_SLOT( slotClear() ), + history(), + TQ_SLOT( slotClear() ), collection, "clearHistoryAction" ); - connect( clearHistoryAction, TQT_SIGNAL( activated() ), TQT_SLOT( slotClearClipboard() ) ); + connect( clearHistoryAction, TQ_SIGNAL( activated() ), TQ_SLOT( slotClearClipboard() ) ); clearHistoryAction->setGroup( defaultGroup ); configureAction = new TDEAction( i18n("&Configure Klipper..."), "configure", 0, - TQT_TQOBJECT(this), - TQT_SLOT( slotConfigure() ), + this, + TQ_SLOT( slotConfigure() ), collection, "configureAction" ); configureAction->setGroup( defaultGroup ); quitAction = new TDEAction( i18n("&Quit"), "system-log-out", 0, - TQT_TQOBJECT(this), - TQT_SLOT( slotQuit() ), + this, + TQ_SLOT( slotQuit() ), collection, "quitAction" ); quitAction->setGroup( "exit" ); @@ -190,11 +187,11 @@ KlipperWidget::KlipperWidget( TQWidget *parent, TDEConfig* config ) showTimer = new TQTime(); readProperties(m_config); - connect(kapp, TQT_SIGNAL(settingsChanged(int)), TQT_SLOT(slotSettingsChanged(int))); + connect(kapp, TQ_SIGNAL(settingsChanged(int)), TQ_SLOT(slotSettingsChanged(int))); poll = new ClipboardPoll( this ); - connect( poll, TQT_SIGNAL( clipboardChanged( bool ) ), - this, TQT_SLOT( newClipData( bool ) ) ); + connect( poll, TQ_SIGNAL( clipboardChanged( bool ) ), + this, TQ_SLOT( newClipData( bool ) ) ); if ( isApplet() || !isShown() ) { m_pixmap = KSystemTray::loadIcon( "klipper" ); @@ -206,7 +203,7 @@ KlipperWidget::KlipperWidget( TQWidget *parent, TDEConfig* config ) m_iconOrigHeight = m_pixmap.height(); adjustSize(); - globalKeys = new TDEGlobalAccel(TQT_TQOBJECT(this)); + globalKeys = new TDEGlobalAccel(this); TDEGlobalAccel* keys = globalKeys; #include "klipperbindings.cpp" // the keys need to be read from kdeglobals, not kickerrc --ellis, 22/9/02 @@ -214,13 +211,13 @@ KlipperWidget::KlipperWidget( TQWidget *parent, TDEConfig* config ) globalKeys->updateConnections(); toggleURLGrabAction->setShortcut(globalKeys->shortcut("Enable/Disable Clipboard Actions")); - connect( toggleURLGrabAction, TQT_SIGNAL( toggled( bool )), - this, TQT_SLOT( setURLGrabberEnabled( bool ))); + connect( toggleURLGrabAction, TQ_SIGNAL( toggled( bool )), + this, TQ_SLOT( setURLGrabberEnabled( bool ))); KlipperPopup* popup = history()->popup(); - connect ( history(), TQT_SIGNAL( topChanged() ), TQT_SLOT( slotHistoryTopChanged() ) ); - connect( popup, TQT_SIGNAL( aboutToHide() ), TQT_SLOT( slotStartHideTimer() ) ); - connect( popup, TQT_SIGNAL( aboutToShow() ), TQT_SLOT( slotStartShowTimer() ) ); + connect ( history(), TQ_SIGNAL( topChanged() ), TQ_SLOT( slotHistoryTopChanged() ) ); + connect( popup, TQ_SIGNAL( aboutToHide() ), TQ_SLOT( slotStartHideTimer() ) ); + connect( popup, TQ_SIGNAL( aboutToShow() ), TQ_SLOT( slotStartShowTimer() ) ); popup->plugAction( toggleURLGrabAction ); popup->plugAction( clearHistoryAction ); @@ -283,7 +280,7 @@ void KlipperWidget::clearClipboardHistory() void KlipperWidget::mousePressEvent(TQMouseEvent *e) { - if ( e->button() != Qt::LeftButton && e->button() != Qt::RightButton ) + if ( e->button() != TQt::LeftButton && e->button() != TQt::RightButton ) return; // if we only hid the menu less than a third of a second ago, @@ -634,10 +631,10 @@ void KlipperWidget::slotRepeatAction() { if ( !myURLGrabber ) { myURLGrabber = new URLGrabber( m_config ); - connect( myURLGrabber, TQT_SIGNAL( sigPopup( TQPopupMenu * )), - TQT_SLOT( showPopupMenu( TQPopupMenu * )) ); - connect( myURLGrabber, TQT_SIGNAL( sigDisablePopup() ), - this, TQT_SLOT( disableURLGrabber() ) ); + connect( myURLGrabber, TQ_SIGNAL( sigPopup( TQPopupMenu * )), + TQ_SLOT( showPopupMenu( TQPopupMenu * )) ); + connect( myURLGrabber, TQ_SIGNAL( sigDisablePopup() ), + this, TQ_SLOT( disableURLGrabber() ) ); } const HistoryStringItem* top = dynamic_cast<const HistoryStringItem*>( history()->first() ); @@ -669,10 +666,10 @@ void KlipperWidget::setURLGrabberEnabled( bool enable ) toggleURLGrabAction->setText(i18n("&Actions Enabled")); if ( !myURLGrabber ) { myURLGrabber = new URLGrabber( m_config ); - connect( myURLGrabber, TQT_SIGNAL( sigPopup( TQPopupMenu * )), - TQT_SLOT( showPopupMenu( TQPopupMenu * )) ); - connect( myURLGrabber, TQT_SIGNAL( sigDisablePopup() ), - this, TQT_SLOT( disableURLGrabber() ) ); + connect( myURLGrabber, TQ_SIGNAL( sigPopup( TQPopupMenu * )), + TQ_SLOT( showPopupMenu( TQPopupMenu * )) ); + connect( myURLGrabber, TQ_SIGNAL( sigDisablePopup() ), + this, TQ_SLOT( disableURLGrabber() ) ); } } } @@ -789,8 +786,8 @@ bool KlipperWidget::blockFetchingNewData() // contents, so in practice it's like the user has selected only the part which was // selected when Klipper asked first. ButtonState buttonstate = kapp->keyboardMouseState(); - if( ( buttonstate & ( ShiftButton | Qt::LeftButton )) == ShiftButton // #85198 - || ( buttonstate & Qt::LeftButton ) == Qt::LeftButton ) { // #80302 + if( ( buttonstate & ( ShiftButton | TQt::LeftButton )) == ShiftButton // #85198 + || ( buttonstate & TQt::LeftButton ) == TQt::LeftButton ) { // #80302 m_pendingContentsCheck = true; m_pendingCheckTimer.start( 100, true ); return true; @@ -810,6 +807,41 @@ void KlipperWidget::slotCheckPending() newClipData( true ); // always selection } +void KlipperWidget::slotDelayedSetClipboard() +{ + const HistoryItem *top = history()->first(); + if (top) + { + if (bCheckForEmpty) + { + TQMimeSource *data = clip->data( bSavedSelectionMode ? TQClipboard::Selection : TQClipboard::Clipboard ); + if ( !data ) + { + kdWarning("No data in clipboard. This is not supposed to happen." ); + return; + } + + bool clipEmpty = ( data->format() == 0L ); + if ( clipEmpty && bNoNullClipboard ) + { + // keep old clipboard after someone set it to null +#ifdef NOISY_KLIPPER + kdDebug() << "Resetting clipboard (Prevent empty clipboard)" << endl; +#endif + setClipboard( *top, bSavedSelectionMode ? Selection : Clipboard ); + return; + } + } + else + { +#ifdef NOISY_KLIPPER + kdDebug() << "Syncing selection and clipboard" << endl; +#endif + setClipboard( *top, bSavedSelectionMode ? Selection : Clipboard ); + } + } +} + void KlipperWidget::checkClipData( bool selectionMode ) { if ( ignoreClipboardChanges() ) // internal to klipper, ignoring TQSpinBox selections @@ -869,15 +901,14 @@ void KlipperWidget::checkClipData( bool selectionMode ) bool changed = data->serialNumber() != lastSerialNo; bool clipEmpty = ( data->format() == 0L ); - if ( changed && clipEmpty && bNoNullClipboard ) { - const HistoryItem* top = history()->first(); - if ( top ) { - // keep old clipboard after someone set it to null -#ifdef NOISY_KLIPPER - kdDebug() << "Resetting clipboard (Prevent empty clipboard)" << endl; -#endif - setClipboard( *top, selectionMode ? Selection : Clipboard ); - } + if ( changed && clipEmpty && bNoNullClipboard ) + { + // Make sure to call setClipboard() through the event loop. + // Using a direct call may crash another application that was + // changing the clipboard at the same time. + bSavedSelectionMode = selectionMode; + bCheckForEmpty = true; + m_setClipboardTimer.start(100, TRUE); return; } @@ -946,11 +977,14 @@ void KlipperWidget::checkClipData( bool selectionMode ) #ifdef NOISY_KLIPPER kdDebug() << "Synchronize?" << ( bSynchronize ? "yes" : "no" ) << endl; #endif - if ( bSynchronize ) { - const HistoryItem* topItem = history()->first(); - if ( topItem ) { - setClipboard( *topItem, selectionMode ? Clipboard : Selection ); - } + if ( bSynchronize ) + { + // Make sure to call setClipboard() through the event loop. + // Using a direct call may crash another application that was + // changing the clipboard at the same time. + bSavedSelectionMode = !selectionMode; // inverted in order to sync + bCheckForEmpty = false; + m_setClipboardTimer.start(100, TRUE); } } @@ -1019,10 +1053,10 @@ bool KlipperWidget::ignoreClipboardChanges() const TQWidget *focusWidget = tqApp->focusWidget(); if ( focusWidget ) { - if ( focusWidget->inherits( TQSPINBOX_OBJECT_NAME_STRING ) || + if ( focusWidget->inherits( "TQSpinBox" ) || (focusWidget->parentWidget() && - focusWidget->inherits(TQLINEEDIT_OBJECT_NAME_STRING) && - focusWidget->parentWidget()->inherits(TQSPINWIDGET_OBJECT_NAME_STRING)) ) + focusWidget->inherits("TQLineEdit") && + focusWidget->parentWidget()->inherits("TQSpinWidget")) ) { return true; } @@ -1080,7 +1114,7 @@ void KlipperWidget::updateTimestamp() { // Qt3.3.0 and 3.3.1 use tqt_x_user_time for clipboard operations Time time = ( strcmp( tqVersion(), "3.3.1" ) == 0 || strcmp( tqVersion(), "3.3.0" ) == 0 ) - ? GET_QT_X_USER_TIME() : GET_QT_X_TIME(); + ? get_tqt_x_user_time() : get_tqt_x_time(); static TQWidget* w = 0; if ( !w ) w = new TQWidget; diff --git a/klipper/toplevel.h b/klipper/toplevel.h index b8526e59f..8a924a46f 100644 --- a/klipper/toplevel.h +++ b/klipper/toplevel.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) by Andrew Stanley-Jones Copyright (C) 2004 Esben Mose Hansen <kde@mosehansen.dk> @@ -43,7 +42,7 @@ class KlipperSessionManaged; class KlipperWidget : public TQWidget, public DCOPObject { - Q_OBJECT + TQ_OBJECT K_DCOP k_dcop: @@ -155,6 +154,7 @@ private slots: void slotClearOverflow(); void slotCheckPending(); + void slotDelayedSetClipboard(); private: @@ -187,6 +187,8 @@ private: bool bSynchronize :1; bool bSelectionTextOnly :1; bool bIgnoreImages :1; + bool bSavedSelectionMode :1; + bool bCheckForEmpty :1; /** * Avoid reacting to our own changes, using this @@ -202,6 +204,7 @@ private: TDEConfig* m_config; TQTimer m_overflowClearTimer; TQTimer m_pendingCheckTimer; + TQTimer m_setClipboardTimer; bool m_pendingContentsCheck; ClipboardPoll* poll; static TDEAboutData* about_data; @@ -212,7 +215,7 @@ private: class Klipper : public KlipperWidget { - Q_OBJECT + TQ_OBJECT K_DCOP k_dcop: int newInstance(); diff --git a/klipper/urlgrabber.cpp b/klipper/urlgrabber.cpp index 684e08c26..078e38097 100644 --- a/klipper/urlgrabber.cpp +++ b/klipper/urlgrabber.cpp @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) (C) 2000,2001,2002 by Carsten Pfeiffer <pfeiffer@kde.org> @@ -62,8 +61,8 @@ URLGrabber::URLGrabber( TDEConfig* config ) readConfiguration( m_config ); myPopupKillTimer = new TQTimer( this ); - connect( myPopupKillTimer, TQT_SIGNAL( timeout() ), - TQT_SLOT( slotKillPopupMenu() )); + connect( myPopupKillTimer, TQ_SIGNAL( timeout() ), + TQ_SLOT( slotKillPopupMenu() )); // testing /* @@ -164,8 +163,8 @@ void URLGrabber::actionMenu( bool wm_class_check ) myPopupKillTimer->stop(); delete myMenu; myMenu = new TDEPopupMenu; - connect( myMenu, TQT_SIGNAL( activated( int )), - TQT_SLOT( slotItemSelected( int ))); + connect( myMenu, TQ_SIGNAL( activated( int )), + TQ_SLOT( slotItemSelected( int ))); for ( action = it.current(); action; action = ++it ) { TQPtrListIterator<ClipCommand> it2( action->commands() ); @@ -280,7 +279,7 @@ void URLGrabber::editData() if ( dlg->exec() == TQDialog::Accepted ) { myClipData = edit->text(); delete dlg; - TQTimer::singleShot( 0, this, TQT_SLOT( slotActionMenu() ) ); + TQTimer::singleShot( 0, this, TQ_SLOT( slotActionMenu() ) ); } else { diff --git a/klipper/urlgrabber.h b/klipper/urlgrabber.h index fd97067dc..cf1c9c784 100644 --- a/klipper/urlgrabber.h +++ b/klipper/urlgrabber.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) 2000 by Carsten Pfeiffer <pfeiffer@kde.org> @@ -41,7 +40,7 @@ typedef TQPtrListIterator<ClipAction> ActionListIterator; class URLGrabber : public TQObject { - Q_OBJECT + TQ_OBJECT public: URLGrabber( TDEConfig* config ); diff --git a/klipper/version.h b/klipper/version.h index 758d59a6d..ce44571f5 100644 --- a/klipper/version.h +++ b/klipper/version.h @@ -1,4 +1,3 @@ -// -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- /* This file is part of the KDE project Copyright (C) Andrew Stanley-Jones |