summaryrefslogtreecommitdiffstats
path: root/klipper/toplevel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'klipper/toplevel.cpp')
-rw-r--r--klipper/toplevel.cpp103
1 files changed, 50 insertions, 53 deletions
diff --git a/klipper/toplevel.cpp b/klipper/toplevel.cpp
index ecdac5af7..c1c5754d6 100644
--- a/klipper/toplevel.cpp
+++ b/klipper/toplevel.cpp
@@ -40,8 +40,8 @@
#include <tdelocale.h>
#include <tdemessagebox.h>
#include <ksavefile.h>
-#include <kstandarddirs.h>
-#include <ksimpleconfig.h>
+#include <tdestandarddirs.h>
+#include <tdesimpleconfig.h>
#include <kstringhandler.h>
#include <ksystemtray.h>
#include <kurldrag.h>
@@ -118,13 +118,10 @@ 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);
-// config == kapp->config for process, otherwise applet
+// config == tdeApp->config for process, otherwise applet
KlipperWidget::KlipperWidget( TQWidget *parent, TDEConfig* config )
: TQWidget( parent )
, DCOPObject( "klipper" )
@@ -141,12 +138,12 @@ KlipperWidget::KlipperWidget( TQWidget *parent, TDEConfig* config )
updateTimestamp(); // read initial X user time
setBackgroundMode( X11ParentRelative );
- clip = kapp->clipboard();
+ clip = tdeApp->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_setClipboardTimer, TQT_SIGNAL( timeout()), TQT_SLOT( slotDelayedSetClipboard()));
+ 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(tdeApp, 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 );
@@ -238,7 +235,7 @@ KlipperWidget::~KlipperWidget()
delete showTimer;
delete hideTimer;
delete myURLGrabber;
- if( m_config != kapp->config())
+ if( m_config != tdeApp->config())
delete m_config;
tqt_qclipboard_bailout_hack = false;
}
@@ -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,
@@ -619,7 +616,7 @@ void KlipperWidget::slotQuit()
return;
config->sync();
- kapp->quit();
+ tdeApp->quit();
}
@@ -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() ) );
}
}
}
@@ -788,9 +785,9 @@ bool KlipperWidget::blockFetchingNewData()
// while the user is doing a selection using the mouse, OOo stops updating the clipboard
// 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
+ ButtonState buttonstate = tdeApp->keyboardMouseState();
+ if( ( buttonstate & ( ShiftButton | TQt::LeftButton )) == ShiftButton // #85198
+ || ( buttonstate & TQt::LeftButton ) == TQt::LeftButton ) { // #80302
m_pendingContentsCheck = true;
m_pendingCheckTimer.start( 100, true );
return true;
@@ -911,7 +908,7 @@ void KlipperWidget::checkClipData( bool selectionMode )
// changing the clipboard at the same time.
bSavedSelectionMode = selectionMode;
bCheckForEmpty = true;
- m_setClipboardTimer.start(100, TRUE);
+ m_setClipboardTimer.start(100, true);
return;
}
@@ -987,7 +984,7 @@ void KlipperWidget::checkClipData( bool selectionMode )
// changing the clipboard at the same time.
bSavedSelectionMode = !selectionMode; // inverted in order to sync
bCheckForEmpty = false;
- m_setClipboardTimer.start(100, TRUE);
+ m_setClipboardTimer.start(100, true);
}
}
@@ -1056,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;
}
@@ -1117,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;
@@ -1183,19 +1180,19 @@ TDEAboutData* KlipperWidget::aboutData()
}
Klipper::Klipper( TQWidget* parent )
- : KlipperWidget( parent, kapp->config())
+ : KlipperWidget( parent, tdeApp->config())
{
}
-// this sucks ... KUniqueApplication registers itself as 'klipper'
+// this sucks ... TDEUniqueApplication registers itself as 'klipper'
// for the unique-app detection calls (and it shouldn't use that name IMHO)
-// but in Klipper it's not KUniqueApplication class who handles
+// but in Klipper it's not TDEUniqueApplication class who handles
// the DCOP calls, but an instance of class Klipper, registered as 'klipper'
-// this below avoids a warning when KUniqueApplication wouldn't otherwise
+// this below avoids a warning when TDEUniqueApplication wouldn't otherwise
// find newInstance() (which doesn't do anything in Klipper anyway)
int Klipper::newInstance()
{
- kapp->dcopClient()->setPriorityCall(false); // Allow other dcop calls
+ tdeApp->dcopClient()->setPriorityCall(false); // Allow other dcop calls
return 0;
}
@@ -1203,8 +1200,8 @@ int Klipper::newInstance()
// (AKA ugly hack)
void Klipper::quitProcess()
{
- kapp->dcopClient()->detach();
- kapp->quit();
+ tdeApp->dcopClient()->detach();
+ tdeApp->quit();
}
static void ensureGlobalSyncOff(TDEConfig* config) {