diff options
Diffstat (limited to 'tdecore/tdeapplication.cpp')
| -rw-r--r-- | tdecore/tdeapplication.cpp | 430 |
1 files changed, 214 insertions, 216 deletions
diff --git a/tdecore/tdeapplication.cpp b/tdecore/tdeapplication.cpp index 5be36f54e..4b5b427f3 100644 --- a/tdecore/tdeapplication.cpp +++ b/tdecore/tdeapplication.cpp @@ -1,4 +1,4 @@ -/* This file is part of the KDE libraries +/* This file is part of the TDE libraries Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) Copyright (C) 1998, 1999, 2000 KDE Team @@ -69,18 +69,18 @@ #endif #include <tdeglobal.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> #include <kdebug.h> #include <tdelocale.h> #include <tdestyle.h> #include <kiconloader.h> #include <kclipboard.h> #include <tdeconfig.h> -#include <ksimpleconfig.h> +#include <tdesimpleconfig.h> #include <tdecmdlineargs.h> #include <tdeaboutdata.h> #include <tdeglobalsettings.h> -#include <kcrash.h> +#include <tdecrash.h> #include <kdatastream.h> #include <klibloader.h> #include <kmimesourcefactory.h> @@ -93,9 +93,9 @@ #include <kprotocolinfo.h> #include <kkeynative.h> #include <kmdcodec.h> -#include <kglobalaccel.h> +#include <tdeglobalaccel.h> -#if defined Q_WS_X11 +#if defined TQ_WS_X11 #include <tdestartupinfo.h> #endif @@ -110,7 +110,7 @@ #include <grp.h> #include <sys/types.h> -#ifndef Q_WS_WIN +#ifndef TQ_WS_WIN #include "twin.h" #endif @@ -123,18 +123,18 @@ #include <errno.h> #include <string.h> #include <netdb.h> -#if defined Q_WS_X11 -//#ifndef Q_WS_QWS //FIXME(E): NetWM should talk to QWS... +#if defined TQ_WS_X11 +//#ifndef TQ_WS_QWS //FIXME(E): NetWM should talk to QWS... #include <netwm.h> #endif -#include "kprocctrl.h" +#include "tdeprocctrl.h" #ifdef HAVE_PATHS_H #include <paths.h> #endif -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 #include <X11/Xlib.h> #ifdef COMPOSITE #include <X11/extensions/Xrender.h> @@ -149,7 +149,7 @@ #include <pwd.h> -#ifndef Q_WS_WIN +#ifndef TQ_WS_WIN #include <KDE-ICE/ICElib.h> #else typedef void* IceIOErrorHandler; @@ -160,22 +160,22 @@ typedef void* IceIOErrorHandler; #define Button3Mask (1<<10) #endif -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 #define DISPLAY "DISPLAY" -#elif defined(Q_WS_QWS) +#elif defined(TQ_WS_QWS) #define DISPLAY "QWS_DISPLAY" #endif -#if defined Q_WS_X11 +#if defined TQ_WS_X11 #include <kipc.h> #endif -#ifdef Q_WS_MACX +#ifdef TQ_WS_MACX #include <Carbon/Carbon.h> #include <tqimage.h> #endif -#if defined Q_WS_X11 +#if defined TQ_WS_X11 #include <sys/ioctl.h> #ifdef __linux__ #include <linux/vt.h> @@ -185,24 +185,24 @@ extern int getfd(const char *fnam); } #endif -#include "kappdcopiface.h" +#include "tdeappdcopinterface.h" // exported for tdm kfrontend -KDE_EXPORT bool kde_have_kipc = true; // magic hook to disable kipc in tdm +TDE_EXPORT bool kde_have_kipc = true; // magic hook to disable kipc in tdm bool kde_kiosk_exception = false; // flag to disable kiosk restrictions bool kde_kiosk_admin = false; -TDEApplication* TDEApplication::KApp = 0L; +TDEApplication* TDEApplication::TDEApp = nullptr; bool TDEApplication::loadedByKdeinit = false; -DCOPClient *TDEApplication::s_DCOPClient = 0L; +DCOPClient *TDEApplication::s_DCOPClient = nullptr; bool TDEApplication::s_dcopClientNeedsPostInit = false; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 static Atom atom_DesktopWindow; static Atom atom_NetSupported; #endif -#if defined(Q_WS_X11) && defined(COMPOSITE) +#if defined(TQ_WS_X11) && defined(COMPOSITE) static int composite_event, composite_error, composite_opcode; static bool x11_composite_error_generated; static int x11_error(Display *dpy, XErrorEvent *ev) { @@ -221,16 +221,16 @@ TDECORE_EXPORT bool tqt_qclipboard_bailout_hack = false; template class TQPtrList<KSessionManaged>; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 extern "C" { static int kde_xio_errhandler( Display * dpy ) { - return kapp->xioErrhandler( dpy ); + return tdeApp->xioErrhandler( dpy ); } static int kde_x_errhandler( Display *dpy, XErrorEvent *err ) { - return kapp->xErrhandler( dpy, err ); + return tdeApp->xErrhandler( dpy, err ); } } @@ -238,20 +238,20 @@ static int kde_x_errhandler( Display *dpy, XErrorEvent *err ) extern "C" { static void kde_ice_ioerrorhandler( IceConn conn ) { - if(kapp) - kapp->iceIOErrorHandler( conn ); + if(tdeApp) + tdeApp->iceIOErrorHandler( conn ); // else ignore the error for now } } #endif -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN void TDEApplication_init_windows(bool GUIenabled); class QAssistantClient; #endif -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 // -------------------------------------------------------------------------------------- // Get the VT number X is running on // (code taken from GDM, daemon/getvt.c, GPLv2+) @@ -310,7 +310,7 @@ int get_x_vtnum(Display *dpy) return num; } // -------------------------------------------------------------------------------------- -#endif // Q_WS_X11 +#endif // TQ_WS_X11 /* Private data to make keeping binary compatibility easier @@ -326,12 +326,12 @@ public: overrideStyle( TQString::null ), startup_id( "0" ), app_started_timer( NULL ), - m_KAppDCOPInterface( 0L ), + m_TDEAppDCOPInterface( 0L ), session_save( false ) -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 ,oldXErrorHandler( NULL ) ,oldXIOErrorHandler( NULL ) -#elif defined Q_WS_WIN +#elif defined TQ_WS_WIN ,qassistantclient( 0 ) #endif { @@ -339,7 +339,7 @@ public: ~TDEApplicationPrivate() { -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN delete qassistantclient; #endif } @@ -360,12 +360,12 @@ public: TQString geometry_arg; TQCString startup_id; TQTimer* app_started_timer; - KAppDCOPInterface *m_KAppDCOPInterface; + TDEAppDCOPInterface *m_TDEAppDCOPInterface; bool session_save; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 int (*oldXErrorHandler)(Display*,XErrorEvent*); int (*oldXIOErrorHandler)(Display*); -#elif defined Q_WS_WIN +#elif defined TQ_WS_WIN QAssistantClient* qassistantclient; #endif @@ -522,7 +522,7 @@ void TDEApplication::installX11EventFilter( TQWidget* filter ) return; if (!x11Filter) x11Filter = new TQPtrList<TQWidget>; - connect ( filter, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( x11FilterDestroyed() ) ); + connect ( filter, TQ_SIGNAL( destroyed() ), this, TQ_SLOT( x11FilterDestroyed() ) ); x11Filter->append( filter ); } @@ -557,7 +557,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event) // Indicate that the accelerator has been overridden. if (t == TQEvent::AccelOverride) { - TQT_TQKEYEVENT(event)->accept(); + static_cast<TQKeyEvent*>(event)->accept(); return true; } else @@ -567,11 +567,11 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event) if ((t == TQEvent::AccelOverride) || (t == TQEvent::KeyPress)) { static const TDEShortcut& _selectAll = TDEStdAccel::selectAll(); - TQLineEdit *edit = ::tqqt_cast<TQLineEdit *>(receiver); + TQLineEdit *edit = ::tqt_cast<TQLineEdit *>(receiver); if (edit) { // We have a keypress for a lineedit... - TQKeyEvent *kevent = TQT_TQKEYEVENT(event); + TQKeyEvent *kevent = static_cast<TQKeyEvent*>(event); KKey key(kevent); if (_selectAll.contains(key)) { @@ -586,7 +586,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event) } } // Ctrl-U deletes from start of line. - if (key == KKey(Qt::CTRL + Qt::Key_U)) + if (key == KKey(TQt::CTRL + TQt::Key_U)) { if (t == TQEvent::KeyPress) { @@ -605,11 +605,11 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event) } } - TQTextEdit *medit = ::tqqt_cast<TQTextEdit *>(receiver); + TQTextEdit *medit = ::tqt_cast<TQTextEdit *>(receiver); if (medit) { // We have a keypress for a multilineedit... - TQKeyEvent *kevent = TQT_TQKEYEVENT(event); + TQKeyEvent *kevent = static_cast<TQKeyEvent*>(event); if (_selectAll.contains(KKey(kevent))) { if (t == TQEvent::KeyPress) @@ -626,9 +626,9 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event) } if( t == TQEvent::Show && receiver->isWidgetType()) { - TQWidget* w = TQT_TQWIDGET( receiver ); -#if defined Q_WS_X11 - if( w->isTopLevel() && !startupId().isEmpty() && !TQT_TQSHOWEVENT(event)->spontaneous()) // TODO better done using window group leader? + TQWidget* w = static_cast<TQWidget*>( receiver ); +#if defined TQ_WS_X11 + if( w->isTopLevel() && !startupId().isEmpty() && !static_cast<TQShowEvent*>(event)->spontaneous()) // TODO better done using window group leader? TDEStartupInfo::setWindowStartupId( w->winId(), startupId()); #endif if( w->isTopLevel() && !w->testWFlags( WX11BypassWM ) && !w->isPopup() && !event->spontaneous()) @@ -636,7 +636,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event) if( d->app_started_timer == NULL ) { d->app_started_timer = new TQTimer( this, "app_started_timer" ); - connect( d->app_started_timer, TQT_SIGNAL( timeout()), TQT_SLOT( checkAppStartedSlot())); + connect( d->app_started_timer, TQ_SIGNAL( timeout()), TQ_SLOT( checkAppStartedSlot())); } if( !d->app_started_timer->isActive()) d->app_started_timer->start( 0, true ); @@ -651,7 +651,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event) if( !ic->isNull()) { w->setIcon( *ic ); -#if defined Q_WS_X11 +#if defined TQ_WS_X11 KWin::setIcons( w->winId(), *ic, miniIcon()); #endif } @@ -662,7 +662,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event) void TDEApplication::checkAppStartedSlot() { -#if defined Q_WS_X11 +#if defined TQ_WS_X11 TDEStartupInfo::handleAutoAppStartedSending(); #endif } @@ -689,7 +689,7 @@ TQString TDEApplication::sessionConfigName() const return TQString("session/%1_%2_%3").arg(name()).arg(sessionId()).arg(sessKey); } -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 static SmcConn mySmcConnection = 0; static SmcConn tmpSmcConnection = 0; #else @@ -701,7 +701,7 @@ static TQTime* smModificationTime = 0; TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName, bool allowStyles, bool GUIenabled, bool SMenabled ) : TQApplication( argc, argv, GUIenabled, SMenabled ), TDEInstance(rAppName), -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 display(0L), argb_visual(false), #endif @@ -720,7 +720,7 @@ TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppNam TDECmdLineArgs::initIgnore(argc, argv, rAppName.data()); parseCommandLine( ); init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } // FIXME @@ -729,7 +729,7 @@ TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppNam TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName, bool allowStyles, bool GUIenabled ) : TQApplication( argc, argv, GUIenabled ), TDEInstance(rAppName), -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 display(0L), argb_visual(false), #endif @@ -748,14 +748,13 @@ TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppNam TDECmdLineArgs::initIgnore(argc, argv, rAppName.data()); parseCommandLine( ); init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, bool SMenabled ) : -// TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), TRUE ), // Qt4 requires that there always be a GUI TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled, SMenabled ), // We need to be able to run command line apps TDEInstance( TDECmdLineArgs::about), -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 display(0L), argb_visual(false), #endif @@ -772,17 +771,16 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, bool SMenable installSigpipeHandler(); parseCommandLine( ); init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } // FIXME // FOR BINARY COMPATIBILITY ONLY // REMOVE WHEN PRACTICAL! TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) : -// TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), TRUE ), // Qt4 requires that there always be a GUI TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled ), // We need to be able to run command line apps TDEInstance( TDECmdLineArgs::about), -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 display(0L), argb_visual(false), #endif @@ -799,10 +797,10 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) : installSigpipeHandler(); parseCommandLine( ); init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 TDEApplication::TDEApplication( Display *dpy, bool allowStyles ) : TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), getX11RGBAVisual(dpy), getX11RGBAColormap(dpy) ), @@ -816,10 +814,10 @@ TDEApplication::TDEApplication( Display *dpy, bool allowStyles ) : installSigpipeHandler(); parseCommandLine( ); init( true ); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } -TDEApplication::TDEApplication( Display *dpy, bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap, bool allowStyles ) : +TDEApplication::TDEApplication( Display *dpy, bool disable_argb, TQt::HANDLE visual, TQt::HANDLE colormap, bool allowStyles ) : TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), disable_argb?visual:getX11RGBAVisual(dpy), disable_argb?colormap:getX11RGBAColormap(dpy) ), TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate) @@ -833,10 +831,10 @@ TDEApplication::TDEApplication( Display *dpy, bool disable_argb, Qt::HANDLE visu installSigpipeHandler(); parseCommandLine( ); init( true ); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } -TDEApplication::TDEApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, +TDEApplication::TDEApplication( Display *dpy, TQt::HANDLE visual, TQt::HANDLE colormap, bool allowStyles ) : TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ), @@ -852,10 +850,10 @@ TDEApplication::TDEApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colo installSigpipeHandler(); parseCommandLine( ); init( true ); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } -TDEApplication::TDEApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, +TDEApplication::TDEApplication( Display *dpy, TQt::HANDLE visual, TQt::HANDLE colormap, bool allowStyles, TDEInstance * _instance ) : TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ), @@ -871,7 +869,7 @@ TDEApplication::TDEApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colo installSigpipeHandler(); parseCommandLine( ); init( true ); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } #endif @@ -879,7 +877,7 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance* TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled ), TDEInstance( _instance ), -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 display(0L), #endif argb_visual(false), @@ -896,10 +894,10 @@ TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance* installSigpipeHandler(); parseCommandLine( ); init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 TDEApplication::TDEApplication(Display *display, int& argc, char** argv, const TQCString& rAppName, bool allowStyles, bool GUIenabled ) : TQApplication( display ), TDEInstance(rAppName), @@ -921,16 +919,16 @@ TDEApplication::TDEApplication(Display *display, int& argc, char** argv, const T TDECmdLineArgs::initIgnore(argc, argv, rAppName.data()); parseCommandLine( ); init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); + d->m_TDEAppDCOPInterface = new TDEAppDCOPInterface(this); } #endif int TDEApplication::xioErrhandler( Display* dpy ) { - if(kapp) + if(tdeApp) { emit shutDown(); -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 d->oldXIOErrorHandler( dpy ); #else Q_UNUSED(dpy); @@ -942,9 +940,9 @@ int TDEApplication::xioErrhandler( Display* dpy ) int TDEApplication::xErrhandler( Display* dpy, void* err_ ) { // no idea how to make forward decl. for XErrorEvent -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 XErrorEvent* err = static_cast< XErrorEvent* >( err_ ); - if(kapp) + if(tdeApp) { // add KDE specific stuff here d->oldXErrorHandler( dpy, err ); @@ -957,7 +955,7 @@ void TDEApplication::iceIOErrorHandler( _IceConn *conn ) { emit shutDown(); -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 if ( d->oldIceIOErrorHandler != NULL ) (*d->oldIceIOErrorHandler)( conn ); #endif @@ -999,10 +997,10 @@ void TDEApplication::init(bool GUIenabled) TQApplication::setDesktopSettingsAware( false ); - KApp = this; + TDEApp = this; -#ifdef Q_WS_X11 //FIXME(E) +#ifdef TQ_WS_X11 //FIXME(E) // create all required atoms in _one_ roundtrip to the X server if ( GUIenabled ) { const int max = 20; @@ -1033,7 +1031,7 @@ void TDEApplication::init(bool GUIenabled) smw = 0; // Initial KIPC event mask. -#if defined Q_WS_X11 +#if defined TQ_WS_X11 kipcEventMask = (1 << KIPC::StyleChanged) | (1 << KIPC::PaletteChanged) | (1 << KIPC::FontChanged) | (1 << KIPC::BackgroundChanged) | (1 << KIPC::ToolbarStyleChanged) | (1 << KIPC::SettingsChanged) | @@ -1050,7 +1048,7 @@ void TDEApplication::init(bool GUIenabled) // kdialog itself. // * Don't warn if we run with a read-only $HOME TQCString readOnly = getenv("TDE_HOME_READONLY"); - if (readOnly.isEmpty() && (tqstrcmp(name(), "kdialog") != 0)) + if (readOnly.isEmpty() && (qstrcmp(name(), "kdialog") != 0)) { TDEConfigGroupSaver saver(config, "KDE Action Restrictions"); if (config->readBoolEntry("warn_unwritable_config",true)) @@ -1059,7 +1057,7 @@ void TDEApplication::init(bool GUIenabled) if (GUIenabled) { -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 // this is important since we fork() to launch the help (Matthias) fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, FD_CLOEXEC); // set up the fancy (=robust and error ignoring ) KDE xio error handlers (Matthias) @@ -1067,14 +1065,14 @@ void TDEApplication::init(bool GUIenabled) d->oldXIOErrorHandler = XSetIOErrorHandler( kde_xio_errhandler ); #endif - connect( this, TQT_SIGNAL( aboutToQuit() ), this, TQT_SIGNAL( shutDown() ) ); + connect( this, TQ_SIGNAL( aboutToQuit() ), this, TQ_SIGNAL( shutDown() ) ); -#ifdef Q_WS_X11 //FIXME(E) +#ifdef TQ_WS_X11 //FIXME(E) display = desktop()->x11Display(); #endif { - TQStringList plugins = TDEGlobal::dirs()->resourceDirs( "qtplugins" ); + TQStringList plugins = TDEGlobal::dirs()->resourceDirs( "tqtplugins" ); TQStringList::Iterator it = plugins.begin(); while (it != plugins.end()) { addLibraryPath( *it ); @@ -1101,10 +1099,10 @@ void TDEApplication::init(bool GUIenabled) TQMimeSourceFactory::addFactory( oldDefaultFactory ); } - d->checkAccelerators = new KCheckAccelerators( TQT_TQOBJECT(this) ); + d->checkAccelerators = new KCheckAccelerators( this ); } -#ifdef Q_WS_MACX +#ifdef TQ_WS_MACX if (GUIenabled) { TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon( TDECmdLineArgs::appName(), TDEIcon::NoGroup, TDEIcon::SizeLarge, TDEIcon::DefaultState, 0L, false ); @@ -1134,7 +1132,7 @@ void TDEApplication::init(bool GUIenabled) // save and restore the RTL setting, as installTranslator calls qt_detectRTLLanguage, // which makes it impossible to use the -reverse cmdline switch with KDE apps bool rtl = reverseLayout(); - installTranslator(new KDETranslator(TQT_TQOBJECT(this))); + installTranslator(new KDETranslator(this)); setReverseLayout( rtl ); if (i18n( "_: Dear Translator! Translate this string to the string 'LTR' in " "left-to-right languages (as english) or to 'RTL' in right-to-left " @@ -1147,7 +1145,7 @@ void TDEApplication::init(bool GUIenabled) pSessionConfig = 0L; bSessionManagement = true; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 // register a communication window for desktop changes (Matthias) if (GUIenabled && kde_have_kipc ) { @@ -1158,7 +1156,7 @@ void TDEApplication::init(bool GUIenabled) 32, PropModeReplace, (unsigned char *)&data, 1); } d->oldIceIOErrorHandler = IceSetIOErrorHandler( kde_ice_ioerrorhandler ); -#elif defined(Q_WS_WIN) +#elif defined(TQ_WS_WIN) TDEApplication_init_windows(GUIenabled); #else // FIXME(E): Implement for Qt Embedded @@ -1197,11 +1195,11 @@ DCOPClient *TDEApplication::dcopClient() { s_DCOPClient->setServerAddress( args->getOption("dcopserver")); } - if( kapp ) { - connect(s_DCOPClient, TQT_SIGNAL(attachFailed(const TQString &)), - kapp, TQT_SLOT(dcopFailure(const TQString &))); - connect(s_DCOPClient, TQT_SIGNAL(blockUserInput(bool) ), - kapp, TQT_SLOT(dcopBlockUserInput(bool)) ); + if( tdeApp ) { + connect(s_DCOPClient, TQ_SIGNAL(attachFailed(const TQString &)), + tdeApp, TQ_SLOT(dcopFailure(const TQString &))); + connect(s_DCOPClient, TQ_SIGNAL(blockUserInput(bool) ), + tdeApp, TQ_SLOT(dcopBlockUserInput(bool)) ); } else s_dcopClientNeedsPostInit = true; @@ -1215,8 +1213,8 @@ void TDEApplication::dcopClientPostInit() if( s_dcopClientNeedsPostInit ) { s_dcopClientNeedsPostInit = false; - connect(s_DCOPClient, TQT_SIGNAL(blockUserInput(bool) ), - TQT_SLOT(dcopBlockUserInput(bool)) ); + connect(s_DCOPClient, TQ_SIGNAL(blockUserInput(bool) ), + TQ_SLOT(dcopBlockUserInput(bool)) ); s_DCOPClient->bindToApp(); // Make sure we get events from the DCOPClient. } } @@ -1288,7 +1286,7 @@ void TDEApplication::disableSessionManagement() { void TDEApplication::enableSessionManagement() { bSessionManagement = true; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 // Session management support in Qt/TDE is awfully broken. // If konqueror disables session management right after its startup, // and enables it later (preloading stuff), it won't be properly @@ -1313,7 +1311,7 @@ void TDEApplication::enableSessionManagement() { bool TDEApplication::requestShutDown( ShutdownConfirm confirm, ShutdownType sdtype, ShutdownMode sdmode ) { -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 TQApplication::syncX(); /* use ksmserver's dcop interface if necessary */ if ( confirm == ShutdownConfirmYes || @@ -1375,7 +1373,7 @@ bool TDEApplication::requestShutDown( void TDEApplication::propagateSessionManager() { -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 TQCString fName = TQFile::encodeName(locateLocal("socket", "KSMserver")); TQCString display = ::getenv(DISPLAY); // strip the screen number from the display @@ -1389,7 +1387,7 @@ void TDEApplication::propagateSessionManager() bool check = smEnv.isEmpty(); if ( !check && smModificationTime ) { TQFileInfo info( fName ); - TQTime current = TQT_TQTIME_OBJECT(info.lastModified().time()); + TQTime current = info.lastModified().time(); check = current > *smModificationTime; } if ( check ) { @@ -1398,7 +1396,7 @@ void TDEApplication::propagateSessionManager() if ( !f.open( IO_ReadOnly ) ) return; TQFileInfo info ( f ); - smModificationTime = new TQTime( TQT_TQTIME_OBJECT(info.lastModified().time()) ); + smModificationTime = new TQTime( info.lastModified().time() ); TQTextStream t(&f); t.setEncoding( TQTextStream::Latin1 ); TQString s = t.readLine(); @@ -1484,7 +1482,7 @@ static void checkRestartVersion( TQSessionManager& sm ) void TDEApplication::saveState( TQSessionManager& sm ) { d->session_save = true; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 static bool firstTime = true; mySmcConnection = (SmcConn) sm.handle(); @@ -1570,7 +1568,7 @@ bool TDEApplication::sessionSaving() const void TDEApplication::startKdeinit() { -#ifndef Q_WS_WIN //TODO +#ifndef TQ_WS_WIN //TODO TDEInstance inst( "starttdeinitlock" ); TDELockFile lock( locateLocal( "tmp", "starttdeinitlock", &inst )); if( lock.lock( TDELockFile::LockNoBlock ) != TDELockFile::LockOK ) { @@ -1585,10 +1583,10 @@ void TDEApplication::startKdeinit() srv = TDEStandardDirs::findExe(TQString::fromLatin1("tdeinit"), TDEGlobal::dirs()->kfsstnd_defaultbindir()); if (srv.isEmpty()) return; - if (kapp && (Tty != kapp->type())) - setOverrideCursor( tqwaitCursor ); + if (tdeApp && (Tty != tdeApp->type())) + setOverrideCursor( TQt::waitCursor ); my_system(TQFile::encodeName(srv)+" --suicide"+" --new-startup"); - if (kapp && (Tty != kapp->type())) + if (tdeApp && (Tty != tdeApp->type())) restoreOverrideCursor(); #endif } @@ -1604,7 +1602,7 @@ void TDEApplication::dcopFailure(const TQString &msg) } if (failureCount == 2) { -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN TDEGlobal::config()->setGroup("General"); if (TDEGlobal::config()->readBoolEntry("ignoreDCOPFailures", false)) return; @@ -1615,12 +1613,12 @@ void TDEApplication::dcopFailure(const TQString &msg) msgStr += msg; msgStr += i18n("\n\nPlease check that the \"dcopserver\" program is running!"); - if (Tty != kapp->type()) + if (Tty != tdeApp->type()) { TQMessageBox::critical ( - kapp->mainWidget(), - i18n("DCOP communications error (%1)").arg(kapp->caption()), + tdeApp->mainWidget(), + i18n("DCOP communications error (%1)").arg(tdeApp->caption()), msgStr, i18n("&OK") ); @@ -1637,7 +1635,7 @@ void TDEApplication::dcopFailure(const TQString &msg) static const TDECmdLineOptions qt_options[] = { //FIXME: Check if other options are specific to Qt/X11 -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 { "display <displayname>", I18N_NOOP("Use the X-server display 'displayname'"), 0}, #else { "display <displayname>", I18N_NOOP("Use the QWS display 'displayname'"), 0}, @@ -1658,13 +1656,13 @@ static const TDECmdLineOptions qt_options[] = { "button <color>", I18N_NOOP("sets the default button color"), 0}, { "name <name>", I18N_NOOP("sets the application name"), 0}, { "title <title>", I18N_NOOP("sets the application title (caption)"), 0}, -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 { "visual TrueColor", I18N_NOOP("forces the application to use a TrueColor visual on\nan 8-bit display"), 0}, { "inputstyle <inputstyle>", I18N_NOOP("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot"), 0 }, { "im <XIM server>", I18N_NOOP("set XIM server"),0}, { "noxim", I18N_NOOP("disable XIM"), 0 }, #endif -#ifdef Q_WS_QWS +#ifdef TQ_WS_QWS { "qws", I18N_NOOP("forces the application to run as QWS Server"), 0}, #endif { "reverse", I18N_NOOP("mirrors the whole layout of widgets"), 0}, @@ -1710,7 +1708,7 @@ void TDEApplication::parseCommandLine( ) if (args->isSet("style")) { - TQStringList plugins = TDEGlobal::dirs()->resourceDirs( "qtplugins" ); + TQStringList plugins = TDEGlobal::dirs()->resourceDirs( "tqtplugins" ); TQStringList::Iterator itp = plugins.begin(); while (itp != plugins.end()) { addLibraryPath( *itp ); @@ -1781,7 +1779,7 @@ void TDEApplication::parseCommandLine( ) TDECrash::setApplicationName(TQString(args->appName())); } -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 if ( args->isSet( "waitforwm" ) ) { Atom type; (void) desktop(); // trigger desktop creation, we need PropertyNotify events for the root window @@ -1860,7 +1858,7 @@ TDEApplication::~TDEApplication() aIconPixmap.pm.miniIcon = 0L; delete aIconPixmap.pm.icon; aIconPixmap.pm.icon = 0L; - delete d->m_KAppDCOPInterface; + delete d->m_TDEAppDCOPInterface; // First call the static deleters and then call KLibLoader::cleanup() // The static deleters may delete libraries for which they need KLibLoader. @@ -1872,11 +1870,11 @@ TDEApplication::~TDEApplication() // close down IPC delete s_DCOPClient; - s_DCOPClient = 0L; + s_DCOPClient = nullptr; TDEProcessController::deref(); -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 if ( d->oldXErrorHandler != NULL ) XSetErrorHandler( d->oldXErrorHandler ); if ( d->oldXIOErrorHandler != NULL ) @@ -1886,9 +1884,9 @@ TDEApplication::~TDEApplication() #endif delete d; - KApp = 0; + TDEApp = nullptr; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 mySmcConnection = 0; delete smModificationTime; smModificationTime = 0; @@ -1904,7 +1902,7 @@ TDEApplication::~TDEApplication() } -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 class KAppX11HackWidget: public TQWidget { public: @@ -1912,7 +1910,7 @@ public: }; #endif -#if defined(Q_WS_X11) && defined(COMPOSITE) +#if defined(TQ_WS_X11) && defined(COMPOSITE) bool TDEApplication::isCompositionManagerAvailable() { bool have_manager = false; @@ -2034,23 +2032,23 @@ Display* TDEApplication::openX11RGBADisplay() { return dpy; } -Qt::HANDLE TDEApplication::getX11RGBAVisual(Display *dpy) { +TQt::HANDLE TDEApplication::getX11RGBAVisual(Display *dpy) { getX11RGBAInformation(dpy); if (TDEApplication::isCompositionManagerAvailable() == true) { return argb_x11_visual; } else { - return (Qt::HANDLE)NULL; + return (TQt::HANDLE)NULL; } } -Qt::HANDLE TDEApplication::getX11RGBAColormap(Display *dpy) { +TQt::HANDLE TDEApplication::getX11RGBAColormap(Display *dpy) { getX11RGBAInformation(dpy); if (TDEApplication::isCompositionManagerAvailable() == true) { return argb_x11_colormap; } else { - return (Qt::HANDLE)NULL; + return (TQt::HANDLE)NULL; } } @@ -2091,8 +2089,8 @@ void TDEApplication::getX11RGBAInformation(Display *dpy) { } if( argb_visual ) { - argb_x11_visual = Qt::HANDLE( visual ); - argb_x11_colormap = Qt::HANDLE( colormap ); + argb_x11_visual = TQt::HANDLE( visual ); + argb_x11_colormap = TQt::HANDLE( colormap ); argb_visual = true; return; } @@ -2146,11 +2144,11 @@ Display* TDEApplication::openX11RGBADisplay() { return 0; } -Qt::HANDLE TDEApplication::getX11RGBAVisual(Display *dpy) { +TQt::HANDLE TDEApplication::getX11RGBAVisual(Display *dpy) { return 0; } -Qt::HANDLE TDEApplication::getX11RGBAColormap(Display *dpy) { +TQt::HANDLE TDEApplication::getX11RGBAColormap(Display *dpy) { return 0; } @@ -2166,7 +2164,7 @@ void TDEApplication::dcopBlockUserInput( bool b ) kapp_block_user_input = b; } -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 bool TDEApplication::x11EventFilter( XEvent *_event ) { if ( kapp_block_user_input ) { @@ -2263,11 +2261,11 @@ bool TDEApplication::x11EventFilter( XEvent *_event ) } return false; } -#endif // Q_WS_X11 +#endif // TQ_WS_X11 void TDEApplication::updateUserTimestamp( unsigned long time ) { -#if defined Q_WS_X11 +#if defined TQ_WS_X11 Display *display = tqt_xdisplay(); if (!display) { return; @@ -2283,16 +2281,16 @@ void TDEApplication::updateUserTimestamp( unsigned long time ) time = ev.xproperty.time; XDestroyWindow( display, w ); } - if( GET_QT_X_USER_TIME() == 0 - || NET::timestampCompare( time, GET_QT_X_USER_TIME() ) > 0 ) // check time > tqt_x_user_time - SET_QT_X_USER_TIME(time); + if( get_tqt_x_user_time() == 0 + || NET::timestampCompare( time, get_tqt_x_user_time() ) > 0 ) // check time > tqt_x_user_time + set_tqt_x_user_time(time); #endif } unsigned long TDEApplication::userTimestamp() const { -#if defined Q_WS_X11 - return GET_QT_X_USER_TIME(); +#if defined TQ_WS_X11 + return get_tqt_x_user_time(); #else return 0; #endif @@ -2300,16 +2298,16 @@ unsigned long TDEApplication::userTimestamp() const void TDEApplication::updateRemoteUserTimestamp( const TQCString& dcopId, unsigned long time ) { -#if defined Q_WS_X11 +#if defined TQ_WS_X11 if( time == 0 ) - time = GET_QT_X_USER_TIME(); + time = get_tqt_x_user_time(); DCOPRef( dcopId, "MainApplication-Interface" ).call( "updateUserTimestamp", time ); #endif } void TDEApplication::invokeEditSlot( const char *slot ) { - TQObject *object = TQT_TQOBJECT(focusWidget()); + TQObject *object = focusWidget(); if( !object ) return; @@ -2443,13 +2441,13 @@ TQPalette TDEApplication::createApplicationPalette( TDEConfig *config, int contr TQColor trinity4VisitedLink( 82, 24, 139 ); TQColor background = config->readColorEntry( "background", &trinity4Background ); - TQColor foreground = config->readColorEntry( "foreground", tqblackptr ); + TQColor foreground = config->readColorEntry( "foreground", &TQt::black ); TQColor button = config->readColorEntry( "buttonBackground", &trinity4Button ); - TQColor buttonText = config->readColorEntry( "buttonForeground", tqblackptr ); + TQColor buttonText = config->readColorEntry( "buttonForeground", &TQt::black ); TQColor highlight = config->readColorEntry( "selectBackground", &trinity4Blue ); - TQColor highlightedText = config->readColorEntry( "selectForeground", tqwhiteptr ); - TQColor base = config->readColorEntry( "windowBackground", tqwhiteptr ); - TQColor baseText = config->readColorEntry( "windowForeground", tqblackptr ); + TQColor highlightedText = config->readColorEntry( "selectForeground", &TQt::white ); + TQColor base = config->readColorEntry( "windowBackground", &TQt::white ); + TQColor baseText = config->readColorEntry( "windowForeground", &TQt::black ); TQColor link = config->readColorEntry( "linkColor", &trinity4Link ); TQColor visitedLink = config->readColorEntry( "visitedLinkColor", &trinity4VisitedLink ); @@ -2464,12 +2462,12 @@ TQPalette TDEApplication::createApplicationPalette( TDEConfig *config, int contr if (v > 128) // dark bg, light fg - need a darker disabled fg disfg = disfg.dark(lowlightVal); - else if (disfg != Qt::black) + else if (disfg != TQt::black) // light bg, dark fg - need a lighter disabled fg - but only if !black disfg = disfg.light(highlightVal); else // black fg - use darkgray disabled fg - disfg = Qt::darkGray; + disfg = TQt::darkGray; TQColorGroup disabledgrp(disfg, background, @@ -2502,12 +2500,12 @@ TQPalette TDEApplication::createApplicationPalette( TDEConfig *config, int contr if (v > 128) // dark button, light buttonText - need a darker disabled buttonText disbtntext = disbtntext.dark(lowlightVal); - else if (disbtntext != Qt::black) + else if (disbtntext != TQt::black) // light buttonText, dark button - need a lighter disabled buttonText - but only if !black disbtntext = disbtntext.light(highlightVal); else // black button - use darkgray disabled buttonText - disbtntext = Qt::darkGray; + disbtntext = TQt::darkGray; disabledgrp.setColor(TQColorGroup::ButtonText, disbtntext); disabledgrp.setColor(TQColorGroup::Midlight, background.light(110)); @@ -2521,12 +2519,12 @@ TQPalette TDEApplication::createApplicationPalette( TDEConfig *config, int contr void TDEApplication::tdedisplaySetPalette() { -#ifdef Q_WS_MACX +#ifdef TQ_WS_MACX //Can I have this on other platforms, please!? --Sam { TDEConfig *config = TDEGlobal::config(); TDEConfigGroupSaver saver( config, "General" ); - bool do_not_set_palette = FALSE; + bool do_not_set_palette = false; if(config->readBoolEntry("nopaletteChange", &do_not_set_palette)) return; } @@ -2540,8 +2538,8 @@ void TDEApplication::tdedisplaySetPalette() void TDEApplication::tdedisplaySetFont() { TQApplication::setFont(TDEGlobalSettings::generalFont(), true); - TQApplication::setFont(TDEGlobalSettings::menuFont(), true, TQMENUBAR_OBJECT_NAME_STRING); - TQApplication::setFont(TDEGlobalSettings::menuFont(), true, TQPOPUPMENU_OBJECT_NAME_STRING); + TQApplication::setFont(TDEGlobalSettings::menuFont(), true, "TQMenuBar"); + TQApplication::setFont(TDEGlobalSettings::menuFont(), true, "TQPopupMenu"); TQApplication::setFont(TDEGlobalSettings::menuFont(), true, "TDEPopupTitle"); // "patch" standard TQStyleSheet to follow our fonts @@ -2593,15 +2591,15 @@ void TDEApplication::propagateSettings(SettingsCategory arg) TQApplication::setWheelScrollLines(num); bool b = config->readBoolEntry("EffectAnimateMenu", false); - TQApplication::setEffectEnabled( Qt::UI_AnimateMenu, b); + TQApplication::setEffectEnabled( TQt::UI_AnimateMenu, b); b = config->readBoolEntry("EffectFadeMenu", false); - TQApplication::setEffectEnabled( Qt::UI_FadeMenu, b); + TQApplication::setEffectEnabled( TQt::UI_FadeMenu, b); b = config->readBoolEntry("EffectAnimateCombo", false); - TQApplication::setEffectEnabled( Qt::UI_AnimateCombo, b); + TQApplication::setEffectEnabled( TQt::UI_AnimateCombo, b); b = config->readBoolEntry("EffectAnimateTooltip", false); - TQApplication::setEffectEnabled( Qt::UI_AnimateTooltip, b); + TQApplication::setEffectEnabled( TQt::UI_AnimateTooltip, b); b = config->readBoolEntry("EffectFadeTooltip", false); - TQApplication::setEffectEnabled( Qt::UI_FadeTooltip, b); + TQApplication::setEffectEnabled( TQt::UI_FadeTooltip, b); b = !config->readBoolEntry("EffectNoTooltip", false); TQToolTip::setGloballyEnabled( b ); @@ -2644,8 +2642,8 @@ void TDEApplication::installKDEPropertyMap() kdeMap->insert( "KIntSpinBox", "value" ); kdeMap->insert( "KDoubleNumInput", "value" ); // Temp til fixed in QT then enable ifdef with the correct version num - kdeMap->insert( TQGROUPBOX_OBJECT_NAME_STRING, "checked" ); - kdeMap->insert( TQTABWIDGET_OBJECT_NAME_STRING, "currentPage" ); + kdeMap->insert( "TQGroupBox", "checked" ); + kdeMap->insert( "TQTabWidget", "currentPage" ); TQSqlPropertyMap::installDefaultMap( kdeMap ); #endif } @@ -2656,7 +2654,7 @@ void TDEApplication::invokeHelp( const TQString& anchor, return invokeHelp( anchor, _appname, "" ); } -#ifndef Q_WS_WIN +#ifndef TQ_WS_WIN // for win32 we're using simple help tools like Qt Assistant, // see kapplication_win.cpp void TDEApplication::invokeHelp( const TQString& anchor, @@ -2680,8 +2678,8 @@ void TDEApplication::invokeHelp( const TQString& anchor, { if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, startup_id, false)) { - if (Tty != kapp->type()) - TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Help Center"), + if (Tty != tdeApp->type()) + TQMessageBox::critical(tdeApp->mainWidget(), i18n("Could not Launch Help Center"), i18n("Could not launch the TDE Help Center:\n\n%1").arg(error), i18n("&OK")); else kdWarning() << "Could not launch help:\n" << error << endl; @@ -2715,8 +2713,8 @@ void TDEApplication::invokeHTMLHelp( const TQString& _filename, const TQString& { if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, "", false)) { - if (Tty != kapp->type()) - TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Help Center"), + if (Tty != tdeApp->type()) + TQMessageBox::critical(tdeApp->mainWidget(), i18n("Could not Launch Help Center"), i18n("Could not launch the TDE Help Center:\n\n%1").arg(error), i18n("&OK")); else kdWarning() << "Could not launch help:\n" << error << endl; @@ -2789,7 +2787,7 @@ void TDEApplication::invokeMailer(const TQString &to, const TQString &cc, const return invokeMailer(to,cc,bcc,subject,body,messageFile,attachURLs,""); } -#ifndef Q_WS_WIN +#ifndef TQ_WS_WIN // on win32, for invoking browser we're using win32 API // see kapplication_win.cpp @@ -2986,8 +2984,8 @@ void TDEApplication::invokeMailer(const TQString &_to, const TQString &_cc, cons // TODO this should check if cmd has a .desktop file, and use data from it, together // with sending more ASN data if (tdeinitExec(cmd, cmdTokens, &error, NULL, startup_id )) { - if (Tty != kapp->type()) { - TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Mail Client"), + if (Tty != tdeApp->type()) { + TQMessageBox::critical(tdeApp->mainWidget(), i18n("Could not Launch Mail Client"), i18n("Could not launch the mail client:\n\n%1").arg(error), i18n("&OK")); } else { @@ -3002,7 +3000,7 @@ void TDEApplication::invokeBrowser( const TQString &url ) return invokeBrowser( url, "" ); } -#ifndef Q_WS_WIN +#ifndef TQ_WS_WIN // on win32, for invoking browser we're using win32 API // see kapplication_win.cpp void TDEApplication::invokeBrowser( const TQString &url, const TQCString& startup_id ) @@ -3011,8 +3009,8 @@ void TDEApplication::invokeBrowser( const TQString &url, const TQCString& startu if (startServiceByDesktopName("kfmclient", url, &error, 0, 0, startup_id, false)) { - if (Tty != kapp->type()) - TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Browser"), + if (Tty != tdeApp->type()) + TQMessageBox::critical(tdeApp->mainWidget(), i18n("Could not Launch Browser"), i18n("Could not launch the browser:\n\n%1").arg(error), i18n("&OK")); else kdWarning() << "Could not launch browser:\n" << error << endl; @@ -3023,27 +3021,27 @@ void TDEApplication::invokeBrowser( const TQString &url, const TQCString& startu void TDEApplication::cut() { - invokeEditSlot( TQT_SLOT( cut() ) ); + invokeEditSlot( TQ_SLOT( cut() ) ); } void TDEApplication::copy() { - invokeEditSlot( TQT_SLOT( copy() ) ); + invokeEditSlot( TQ_SLOT( copy() ) ); } void TDEApplication::paste() { - invokeEditSlot( TQT_SLOT( paste() ) ); + invokeEditSlot( TQ_SLOT( paste() ) ); } void TDEApplication::clear() { - invokeEditSlot( TQT_SLOT( clear() ) ); + invokeEditSlot( TQ_SLOT( clear() ) ); } void TDEApplication::selectAll() { - invokeEditSlot( TQT_SLOT( selectAll() ) ); + invokeEditSlot( TQ_SLOT( selectAll() ) ); } void TDEApplication::broadcastKeyCode(unsigned int keyCode) @@ -3072,8 +3070,8 @@ startServiceInternal( const TQCString &function, // Register app as able to send DCOP messages DCOPClient *dcopClient; - if (kapp) - dcopClient = kapp->dcopClient(); + if (tdeApp) + dcopClient = tdeApp->dcopClient(); else dcopClient = new DCOPClient; @@ -3083,7 +3081,7 @@ startServiceInternal( const TQCString &function, { if (error) *error = i18n("Could not register with DCOP.\n"); - if (!kapp) + if (!tdeApp) delete dcopClient; return -1; @@ -3096,7 +3094,7 @@ startServiceInternal( const TQCString &function, TQByteArray replyData; TQCString _launcher = TDEApplication::launcher(); TQValueList<TQCString> envs; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 if (tqt_xdisplay()) { TQCString dpystring(XDisplayString(tqt_xdisplay())); envs.append( TQCString("DISPLAY=") + dpystring ); @@ -3106,7 +3104,7 @@ startServiceInternal( const TQCString &function, } #endif stream << envs; -#if defined Q_WS_X11 +#if defined TQ_WS_X11 // make sure there is id, so that user timestamp exists stream << ( startup_id.isEmpty() ? TDEStartupInfo::createNewStartupId() : startup_id ); #endif @@ -3118,11 +3116,11 @@ startServiceInternal( const TQCString &function, { if (error) *error = i18n("TDELauncher could not be reached via DCOP.\n"); - if (!kapp) + if (!tdeApp) delete dcopClient; return -1; } - if (!kapp) + if (!tdeApp) delete dcopClient; if (noWait) @@ -3345,8 +3343,8 @@ void TDEApplication::setTopWidget( TQWidget *topWidget ) // set the specified icons topWidget->setIcon( icon() ); //standard X11 -#if defined Q_WS_X11 -//#ifdef Q_WS_X11 // FIXME(E): Implement for Qt/Embedded +#if defined TQ_WS_X11 +//#ifdef TQ_WS_X11 // FIXME(E): Implement for Qt/Embedded KWin::setIcons(topWidget->winId(), icon(), miniIcon() ); // NET_WM hints for KWin // set the app startup notification window property @@ -3363,7 +3361,7 @@ void TDEApplication::setStartupId( const TQCString& startup_id ) { if( startup_id == d->startup_id ) return; -#if defined Q_WS_X11 +#if defined TQ_WS_X11 TDEStartupInfo::handleAutoAppStartedSending(); // finish old startup notification if needed #endif if( startup_id.isEmpty()) @@ -3371,7 +3369,7 @@ void TDEApplication::setStartupId( const TQCString& startup_id ) else { d->startup_id = startup_id; -#if defined Q_WS_X11 +#if defined TQ_WS_X11 TDEStartupInfoId id; id.initId( startup_id ); long timestamp = id.timestamp(); @@ -3385,7 +3383,7 @@ void TDEApplication::setStartupId( const TQCString& startup_id ) // not to propagate it to processes started from this app void TDEApplication::read_app_startup_id() { -#if defined Q_WS_X11 +#if defined TQ_WS_X11 TDEStartupInfoId id = TDEStartupInfo::currentStartupIdEnv(); TDEStartupInfo::resetStartupEnv(); d->startup_id = id.id(); @@ -3593,7 +3591,7 @@ bool TDEApplication::authorizeURLAction(const TQString &action, const KURL &_bas uint TDEApplication::keyboardModifiers() { -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 Window root; Window child; int root_x, root_y, win_x, win_y; @@ -3612,13 +3610,13 @@ uint TDEApplication::keyboardModifiers() uint TDEApplication::mouseState() { uint mousestate; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 Window root; Window child; int root_x, root_y, win_x, win_y; XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child, &root_x, &root_y, &win_x, &win_y, &mousestate ); -#elif defined(Q_WS_WIN) +#elif defined(TQ_WS_WIN) const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON); if (GetAsyncKeyState(VK_LBUTTON)) mousestate |= (mousebtn_swapped ? Button3Mask : Button1Mask); @@ -3626,7 +3624,7 @@ uint TDEApplication::mouseState() mousestate |= Button2Mask; if (GetAsyncKeyState(VK_RBUTTON)) mousestate |= (mousebtn_swapped ? Button1Mask : Button3Mask); -#elif defined(Q_WS_MACX) +#elif defined(TQ_WS_MACX) mousestate = GetCurrentEventButtonState(); #else //TODO: other platforms @@ -3634,10 +3632,10 @@ uint TDEApplication::mouseState() return mousestate & 0xff00; } -TQ_ButtonState TDEApplication::keyboardMouseState() +TQt::ButtonState TDEApplication::keyboardMouseState() { int ret = 0; -#ifdef Q_WS_X11 +#ifdef TQ_WS_X11 Window root; Window child; int root_x, root_y, win_x, win_y; @@ -3646,52 +3644,52 @@ TQ_ButtonState TDEApplication::keyboardMouseState() &root_x, &root_y, &win_x, &win_y, &state ); // transform the same way like Qt's qt_x11_translateButtonState() if( state & Button1Mask ) - ret |= TQ_LeftButton; + ret |= LeftButton; if( state & Button2Mask ) - ret |= TQ_MidButton; + ret |= MidButton; if( state & Button3Mask ) - ret |= TQ_RightButton; + ret |= RightButton; if( state & ShiftMask ) - ret |= TQ_ShiftButton; + ret |= ShiftButton; if( state & ControlMask ) - ret |= TQ_ControlButton; + ret |= ControlButton; if( state & KKeyNative::modX( KKey::ALT )) - ret |= TQ_AltButton; + ret |= AltButton; if( state & KKeyNative::modX( KKey::WIN )) - ret |= TQ_MetaButton; -#elif defined(Q_WS_WIN) + ret |= MetaButton; +#elif defined(TQ_WS_WIN) const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON); if (GetAsyncKeyState(VK_LBUTTON)) ret |= (mousebtn_swapped ? RightButton : LeftButton); if (GetAsyncKeyState(VK_MBUTTON)) - ret |= TQ_MidButton; + ret |= MidButton; if (GetAsyncKeyState(VK_RBUTTON)) - ret |= (mousebtn_swapped ? TQ_LeftButton : TQ_RightButton); + ret |= (mousebtn_swapped ? LeftButton : RightButton); if (GetAsyncKeyState(VK_SHIFT)) - ret |= TQ_ShiftButton; + ret |= ShiftButton; if (GetAsyncKeyState(VK_CONTROL)) - ret |= TQ_ControlButton; + ret |= ControlButton; if (GetAsyncKeyState(VK_MENU)) - ret |= TQ_AltButton; + ret |= AltButton; if (GetAsyncKeyState(VK_LWIN) || GetAsyncKeyState(VK_RWIN)) - ret |= TQ_MetaButton; + ret |= MetaButton; #else //TODO: other platforms #endif return static_cast< ButtonState >( ret ); } -#if defined Q_WS_X11 +#if defined TQ_WS_X11 int TDEApplication::currentX11VT() { return get_x_vtnum(TQPaintDevice::x11AppDisplay()); } -#else // Q_WS_X11 +#else // TQ_WS_X11 int TDEApplication::currentX11VT() { return -1; } -#endif // Q_WS_X11 +#endif // TQ_WS_X11 void TDEApplication::installSigpipeHandler() { @@ -3722,7 +3720,7 @@ void TDEApplication::sigpipeHandler(int) bool TDEApplication::guiEnabled() { - return kapp && kapp->d->guiEnabled; + return tdeApp && tdeApp->d->guiEnabled; } void TDEApplication::virtual_hook( int id, void* data ) |
