Rename KStartup for enhanced compatibility with KDE4

pull/16/head
Timothy Pearson 12 years ago
parent d3afa6baf9
commit 8bc199f487

@ -318,7 +318,7 @@ const char* get_env_var( const char* var, int envc, const char* envs )
#if defined Q_WS_X11 && ! defined K_WS_QTONLY
//#ifdef Q_WS_X11 // FIXME(E): Implement for Qt/Embedded
static void init_startup_info( KStartupInfoId& id, const char* bin,
static void init_startup_info( TDEStartupInfoId& id, const char* bin,
int envc, const char* envs )
{
const char* dpy = get_env_var( DISPLAY"=", envc, envs );
@ -328,26 +328,26 @@ static void init_startup_info( KStartupInfoId& id, const char* bin,
if( X11_startup_notify_display == NULL )
return;
X11_startup_notify_fd = XConnectionNumber( X11_startup_notify_display );
KStartupInfoData data;
TDEStartupInfoData data;
int desktop = get_current_desktop( X11_startup_notify_display );
data.setDesktop( desktop );
data.setBin( bin );
KStartupInfo::sendChangeX( X11_startup_notify_display, id, data );
TDEStartupInfo::sendChangeX( X11_startup_notify_display, id, data );
XFlush( X11_startup_notify_display );
}
static void complete_startup_info( KStartupInfoId& id, pid_t pid )
static void complete_startup_info( TDEStartupInfoId& id, pid_t pid )
{
if( X11_startup_notify_display == NULL )
return;
if( pid == 0 ) // failure
KStartupInfo::sendFinishX( X11_startup_notify_display, id );
TDEStartupInfo::sendFinishX( X11_startup_notify_display, id );
else
{
KStartupInfoData data;
TDEStartupInfoData data;
data.addPid( pid );
data.setHostname();
KStartupInfo::sendChangeX( X11_startup_notify_display, id, data );
TDEStartupInfo::sendChangeX( X11_startup_notify_display, id, data );
}
XCloseDisplay( X11_startup_notify_display );
X11_startup_notify_display = NULL;
@ -482,7 +482,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
#if defined Q_WS_X11 && ! defined K_WS_QTONLY
//#ifdef Q_WS_X11
KStartupInfoId startup_id;
TDEStartupInfoId startup_id;
startup_id.initId( startup_id_str );
if( !startup_id.none())
init_startup_info( startup_id, name, envc, envs );
@ -551,7 +551,7 @@ static pid_t launch(int argc, const char *_name, const char *args,
#if defined Q_WS_X11 && ! defined K_WS_QTONLY
//#ifdef Q_WS_X11
if( startup_id.none())
KStartupInfo::resetStartupEnv();
TDEStartupInfo::resetStartupEnv();
else
startup_id.setupStartupEnv();
#endif

@ -758,9 +758,9 @@ KLauncher::requestDone(KLaunchRequest *request)
dpy = XOpenDisplay( request->startup_dpy );
if( dpy )
{
KStartupInfoId id;
TDEStartupInfoId id;
id.initId( request->startup_id );
KStartupInfo::sendFinishX( dpy, id );
TDEStartupInfo::sendFinishX( dpy, id );
if( mCached_dpy != dpy && mCached_dpy != NULL )
XCloseDisplay( mCached_dpy );
mCached_dpy = dpy;
@ -1051,7 +1051,7 @@ KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr ser
const TQValueList<TQCString> &envs )
{
#if defined Q_WS_X11 && ! defined K_WS_QTONLY
//#ifdef Q_WS_X11 // KStartup* isn't implemented for Qt/Embedded yet
//#ifdef Q_WS_X11 // TDEStartup* isn't implemented for Qt/Embedded yet
request->startup_id = "0";
if( startup_id == "0" )
return;
@ -1059,7 +1059,7 @@ KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr ser
TQCString wmclass;
if( !KRun::checkStartupNotify( TQString::null, service, &silent, &wmclass ))
return;
KStartupInfoId id;
TDEStartupInfoId id;
id.initId( startup_id );
const char* dpy_str = NULL;
for( TQValueList<TQCString>::ConstIterator it = envs.begin();
@ -1082,16 +1082,16 @@ KLauncher::send_service_startup_info( KLaunchRequest *request, KService::Ptr ser
request->startup_dpy = dpy_str;
KStartupInfoData data;
TDEStartupInfoData data;
data.setName( service->name());
data.setIcon( service->icon());
data.setDescription( i18n( "Launching %1" ).arg( service->name()));
if( !wmclass.isEmpty())
data.setWMClass( wmclass );
if( silent )
data.setSilent( KStartupInfoData::Yes );
data.setSilent( TDEStartupInfoData::Yes );
// the rest will be sent by tdeinit
KStartupInfo::sendStartupX( dpy, id, data );
TDEStartupInfo::sendStartupX( dpy, id, data );
if( mCached_dpy != dpy && mCached_dpy != NULL )
XCloseDisplay( mCached_dpy );
mCached_dpy = dpy;
@ -1106,7 +1106,7 @@ KLauncher::cancel_service_startup_info( KLaunchRequest* request, const TQCString
const TQValueList<TQCString> &envs )
{
#if defined Q_WS_X11 && ! defined K_WS_QTONLY
//#ifdef Q_WS_X11 // KStartup* isn't implemented for Qt/Embedded yet
//#ifdef Q_WS_X11 // TDEStartup* isn't implemented for Qt/Embedded yet
if( request != NULL )
request->startup_id = "0";
if( !startup_id.isEmpty() && startup_id != "0" )
@ -1125,9 +1125,9 @@ KLauncher::cancel_service_startup_info( KLaunchRequest* request, const TQCString
dpy = XOpenDisplay( dpy_str );
if( dpy == NULL )
return;
KStartupInfoId id;
TDEStartupInfoId id;
id.initId( startup_id );
KStartupInfo::sendFinishX( dpy, id );
TDEStartupInfo::sendFinishX( dpy, id );
if( mCached_dpy != dpy && mCached_dpy != NULL )
XCloseDisplay( mCached_dpy );
mCached_dpy = dpy;

@ -152,7 +152,7 @@ void KCMShellMultiDialog::activate( TQCString asn_id )
{
kdDebug(780) << k_funcinfo << endl;
KStartupInfo::setNewStartupId( this, asn_id );
TDEStartupInfo::setNewStartupId( this, asn_id );
}
void KCMShell::setDCOPName(const TQCString &dcopName, bool rootMode )

@ -84,16 +84,16 @@ value, and for apps which need it also X-TDE-WMClass should be set. This
sometimes gives slightly better behavior than when these entries are not set.
The KStartupInfo classes :
The TDEStartupInfo classes :
--------------------------
In some cases, or if you are interested in getting the ASN information, you
have to use the KStartupInfo classes in tdelibs/tdecore.
have to use the TDEStartupInfo classes in tdelibs/tdecore.
Receiving the application startup notification information :
------------------------------------------------------------
Create an instance of class KStartupInfo and connect to its slots, they
Create an instance of class TDEStartupInfo and connect to its slots, they
will be emitted whenever a ASN info is received.
The clean_on_cantdetect argument to the constructor means whether all
ASN info for non-compliant apps should be removed when a window is mapped
@ -125,8 +125,8 @@ about the finished process should be sent. Since the application may
have forked into background, the finish info should include the PID
and hostname, and the notification will be stopped only if there's
no other PID for it. On the other hand, if you simply really need
to stop ASN, send only the identification ( KStartupInfo::sendFinish()
with only KStartupInfoId argument ).
to stop ASN, send only the identification ( TDEStartupInfo::sendFinish()
with only TDEStartupInfoId argument ).
@ -171,11 +171,11 @@ is 'xemacs', but WM_CLASS is 'emacs', 'Emacs', so its X-TDE-WMClass
in its .desktop file should be set to 'emacs' - the case doesn't
matter ).
The ASN identification string must be a unique string for every ASN.
In KStartupInfo class, it's created as 'hostname;tm.sec;tm.usec;pid',
In TDEStartupInfo class, it's created as 'hostname;tm.sec;tm.usec;pid',
tm being the current time. If the identification string is set to "0",
it means no ASN should be done ( e.g. for things like tdeio_uiserver,
which shouldn't get ASN ). Empty identification string means the same
like "0", except for the call to KStartupInfoId::initId(), where it means
like "0", except for the call to TDEStartupInfoId::initId(), where it means
to create a new one.

@ -552,7 +552,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event)
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?
KStartupInfo::setWindowStartupId( w->winId(), startupId());
TDEStartupInfo::setWindowStartupId( w->winId(), startupId());
#endif
if( w->isTopLevel() && !w->testWFlags( WX11BypassWM ) && !w->isPopup() && !event->spontaneous())
{
@ -586,7 +586,7 @@ bool TDEApplication::notify(TQObject *receiver, TQEvent *event)
void TDEApplication::checkAppStartedSlot()
{
#if defined Q_WS_X11
KStartupInfo::handleAutoAppStartedSending();
TDEStartupInfo::handleAutoAppStartedSending();
#endif
}
@ -3024,7 +3024,7 @@ startServiceInternal( const TQCString &function,
stream << envs;
#if defined Q_WS_X11
// make sure there is id, so that user timestamp exists
stream << ( startup_id.isEmpty() ? KStartupInfo::createNewStartupId() : startup_id );
stream << ( startup_id.isEmpty() ? TDEStartupInfo::createNewStartupId() : startup_id );
#endif
if( function.left( 12 ) != "tdeinit_exec" )
stream << noWait;
@ -3266,7 +3266,7 @@ void TDEApplication::setTopWidget( TQWidget *topWidget )
KWin::setIcons(topWidget->winId(), icon(), miniIcon() ); // NET_WM hints for KWin
// set the app startup notification window property
KStartupInfo::setWindowStartupId( topWidget->winId(), startupId());
TDEStartupInfo::setWindowStartupId( topWidget->winId(), startupId());
#endif
}
@ -3280,7 +3280,7 @@ void TDEApplication::setStartupId( const TQCString& startup_id )
if( startup_id == d->startup_id )
return;
#if defined Q_WS_X11
KStartupInfo::handleAutoAppStartedSending(); // finish old startup notification if needed
TDEStartupInfo::handleAutoAppStartedSending(); // finish old startup notification if needed
#endif
if( startup_id.isEmpty())
d->startup_id = "0";
@ -3288,7 +3288,7 @@ void TDEApplication::setStartupId( const TQCString& startup_id )
{
d->startup_id = startup_id;
#if defined Q_WS_X11
KStartupInfoId id;
TDEStartupInfoId id;
id.initId( startup_id );
long timestamp = id.timestamp();
if( timestamp != 0 )
@ -3302,8 +3302,8 @@ void TDEApplication::setStartupId( const TQCString& startup_id )
void TDEApplication::read_app_startup_id()
{
#if defined Q_WS_X11
KStartupInfoId id = KStartupInfo::currentStartupIdEnv();
KStartupInfo::resetStartupEnv();
TDEStartupInfoId id = TDEStartupInfo::currentStartupIdEnv();
TDEStartupInfo::resetStartupEnv();
d->startup_id = id.id();
#endif
}

@ -1071,7 +1071,7 @@ public:
* Sets a new value for the application startup notification window property for newly
* created toplevel windows.
* @param startup_id the startup notification identifier
* @see KStartupInfo::setNewStartupId
* @see TDEStartupInfo::setNewStartupId
*/
void setStartupId( const TQCString& startup_id );

@ -16,7 +16,7 @@
160 tdecore (KNotifyClient)
170 tdecore (KNetwork socket)
171 tdecore (KSocks)
172 tdecore (KStartupInfo)
172 tdecore (TDEStartupInfo)
173 tdecore (KLocale)
174 tdecore (KProcIO)
175 tdecore (TDEProcess)

@ -44,7 +44,7 @@ InfoOutput=4
[129]
InfoOutput=4
# KStartupInfo debug info off
# TDEStartupInfo debug info off
[172]
InfoOutput=4

@ -27,7 +27,7 @@ DEALINGS IN THE SOFTWARE.
// kdDebug() can't be turned off in tdeinit
#if 0
#define KSTARTUPINFO_ALL_DEBUG
#warning Extra KStartupInfo debug messages enabled.
#warning Extra TDEStartupInfo debug messages enabled.
#endif
#include <tqwidget.h>
@ -80,31 +80,31 @@ static TQString escape_str( const TQString& str_P );
static Atom utf8_string_atom = None;
class KStartupInfo::Data
: public KStartupInfoData
class TDEStartupInfo::Data
: public TDEStartupInfoData
{
public:
Data() : KStartupInfoData(), age(0) {} // just because it's in a QMap
Data() : TDEStartupInfoData(), age(0) {} // just because it's in a QMap
Data( const TQString& txt_P )
: KStartupInfoData( txt_P ), age( 0 ) {}
: TDEStartupInfoData( txt_P ), age( 0 ) {}
unsigned int age;
};
struct KStartupInfoPrivate
struct TDEStartupInfoPrivate
{
public:
TQMap< KStartupInfoId, KStartupInfo::Data > startups;
TQMap< TDEStartupInfoId, TDEStartupInfo::Data > startups;
// contains silenced ASN's only if !AnnounceSilencedChanges
TQMap< KStartupInfoId, KStartupInfo::Data > silent_startups;
TQMap< TDEStartupInfoId, TDEStartupInfo::Data > silent_startups;
// contains ASN's that had change: but no new: yet
TQMap< KStartupInfoId, KStartupInfo::Data > uninited_startups;
TQMap< TDEStartupInfoId, TDEStartupInfo::Data > uninited_startups;
#ifdef Q_WS_X11
KWinModule* wm_module;
KXMessages msgs;
#endif
TQTimer* cleanup;
int flags;
KStartupInfoPrivate( int flags_P )
TDEStartupInfoPrivate( int flags_P )
:
#ifdef Q_WS_X11
msgs( NET_STARTUP_MSG, NULL, false ),
@ -112,21 +112,21 @@ struct KStartupInfoPrivate
flags( flags_P ) {}
};
KStartupInfo::KStartupInfo( int flags_P, TQObject* parent_P, const char* name_P )
TDEStartupInfo::TDEStartupInfo( int flags_P, TQObject* parent_P, const char* name_P )
: TQObject( parent_P, name_P ),
timeout( 60 ), d( NULL )
{
init( flags_P );
}
KStartupInfo::KStartupInfo( bool clean_on_cantdetect_P, TQObject* parent_P, const char* name_P )
TDEStartupInfo::TDEStartupInfo( bool clean_on_cantdetect_P, TQObject* parent_P, const char* name_P )
: TQObject( parent_P, name_P ),
timeout( 60 ), d( NULL )
{
init( clean_on_cantdetect_P ? CleanOnCantDetect : 0 );
}
void KStartupInfo::init( int flags_P )
void TDEStartupInfo::init( int flags_P )
{
// d == NULL means "disabled"
if( !TDEApplication::kApplication())
@ -134,7 +134,7 @@ void KStartupInfo::init( int flags_P )
if( !TDEApplication::kApplication()->getDisplay())
return;
d = new KStartupInfoPrivate( flags_P );
d = new TDEStartupInfoPrivate( flags_P );
#ifdef Q_WS_X11
if( !( d->flags & DisableKWinModule ))
{
@ -150,12 +150,12 @@ void KStartupInfo::init( int flags_P )
connect( d->cleanup, TQT_SIGNAL( timeout()), TQT_SLOT( startups_cleanup()));
}
KStartupInfo::~KStartupInfo()
TDEStartupInfo::~TDEStartupInfo()
{
delete d;
}
void KStartupInfo::got_message( const TQString& msg_P )
void TDEStartupInfo::got_message( const TQString& msg_P )
{
// TODO do something with SCREEN= ?
kdDebug( 172 ) << "got:" << msg_P << endl;
@ -186,12 +186,12 @@ class DelayedWindowEvent
};
}
void KStartupInfo::slot_window_added( WId w_P )
void TDEStartupInfo::slot_window_added( WId w_P )
{
kapp->postEvent( this, new DelayedWindowEvent( w_P ));
}
void KStartupInfo::customEvent( TQCustomEvent* e_P )
void TDEStartupInfo::customEvent( TQCustomEvent* e_P )
{
if( e_P->type() == TQEvent::User + 15 )
window_added( static_cast< DelayedWindowEvent* >( e_P )->w );
@ -199,10 +199,10 @@ void KStartupInfo::customEvent( TQCustomEvent* e_P )
TQObject::customEvent( e_P );
}
void KStartupInfo::window_added( WId w_P )
void TDEStartupInfo::window_added( WId w_P )
{
KStartupInfoId id;
KStartupInfoData data;
TDEStartupInfoId id;
TDEStartupInfoData data;
startup_t ret = check_startup_internal( w_P, &id, &data );
switch( ret )
{
@ -218,16 +218,16 @@ void KStartupInfo::window_added( WId w_P )
}
}
void KStartupInfo::got_startup_info( const TQString& msg_P, bool update_P )
void TDEStartupInfo::got_startup_info( const TQString& msg_P, bool update_P )
{
KStartupInfoId id( msg_P );
TDEStartupInfoId id( msg_P );
if( id.none())
return;
KStartupInfo::Data data( msg_P );
TDEStartupInfo::Data data( msg_P );
new_startup_info_internal( id, data, update_P );
}
void KStartupInfo::new_startup_info_internal( const KStartupInfoId& id_P,
void TDEStartupInfo::new_startup_info_internal( const TDEStartupInfoId& id_P,
Data& data_P, bool update_P )
{
if( d == NULL )
@ -298,10 +298,10 @@ void KStartupInfo::new_startup_info_internal( const KStartupInfoId& id_P,
d->cleanup->start( 1000 ); // 1 sec
}
void KStartupInfo::got_remove_startup_info( const TQString& msg_P )
void TDEStartupInfo::got_remove_startup_info( const TQString& msg_P )
{
KStartupInfoId id( msg_P );
KStartupInfoData data( msg_P );
TDEStartupInfoId id( msg_P );
TDEStartupInfoData data( msg_P );
if( data.pids().count() > 0 )
{
if( !id.none())
@ -313,7 +313,7 @@ void KStartupInfo::got_remove_startup_info( const TQString& msg_P )
remove_startup_info_internal( id );
}
void KStartupInfo::remove_startup_info_internal( const KStartupInfoId& id_P )
void TDEStartupInfo::remove_startup_info_internal( const TDEStartupInfoId& id_P )
{
if( d == NULL )
return;
@ -336,11 +336,11 @@ void KStartupInfo::remove_startup_info_internal( const KStartupInfoId& id_P )
return;
}
void KStartupInfo::remove_startup_pids( const KStartupInfoData& data_P )
void TDEStartupInfo::remove_startup_pids( const TDEStartupInfoData& data_P )
{ // first find the matching info
if( d == NULL )
return;
for( TQMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->startups.begin();
it != d->startups.end();
++it )
{
@ -353,8 +353,8 @@ void KStartupInfo::remove_startup_pids( const KStartupInfoData& data_P )
}
}
void KStartupInfo::remove_startup_pids( const KStartupInfoId& id_P,
const KStartupInfoData& data_P )
void TDEStartupInfo::remove_startup_pids( const TDEStartupInfoId& id_P,
const TDEStartupInfoData& data_P )
{
if( d == NULL )
return;
@ -376,7 +376,7 @@ void KStartupInfo::remove_startup_pids( const KStartupInfoId& id_P,
remove_startup_info_internal( id_P );
}
bool KStartupInfo::sendStartup( const KStartupInfoId& id_P, const KStartupInfoData& data_P )
bool TDEStartupInfo::sendStartup( const TDEStartupInfoId& id_P, const TDEStartupInfoData& data_P )
{
if( id_P.none())
return false;
@ -389,8 +389,8 @@ bool KStartupInfo::sendStartup( const KStartupInfoId& id_P, const KStartupInfoDa
return true;
}
bool KStartupInfo::sendStartupX( Display* disp_P, const KStartupInfoId& id_P,
const KStartupInfoData& data_P )
bool TDEStartupInfo::sendStartupX( Display* disp_P, const TDEStartupInfoId& id_P,
const TDEStartupInfoData& data_P )
{
if( id_P.none())
return false;
@ -403,7 +403,7 @@ bool KStartupInfo::sendStartupX( Display* disp_P, const KStartupInfoId& id_P,
return KXMessages::broadcastMessageX( disp_P, NET_STARTUP_MSG, msg, -1, false );
}
TQString KStartupInfo::check_required_startup_fields( const TQString& msg, const KStartupInfoData& data_P,
TQString TDEStartupInfo::check_required_startup_fields( const TQString& msg, const TDEStartupInfoData& data_P,
int screen )
{
TQString ret = msg;
@ -420,7 +420,7 @@ TQString KStartupInfo::check_required_startup_fields( const TQString& msg, const
return ret;
}
bool KStartupInfo::sendChange( const KStartupInfoId& id_P, const KStartupInfoData& data_P )
bool TDEStartupInfo::sendChange( const TDEStartupInfoId& id_P, const TDEStartupInfoData& data_P )
{
if( id_P.none())
return false;
@ -432,8 +432,8 @@ bool KStartupInfo::sendChange( const KStartupInfoId& id_P, const KStartupInfoDat
return true;
}
bool KStartupInfo::sendChangeX( Display* disp_P, const KStartupInfoId& id_P,
const KStartupInfoData& data_P )
bool TDEStartupInfo::sendChangeX( Display* disp_P, const TDEStartupInfoId& id_P,
const TDEStartupInfoData& data_P )
{
if( id_P.none())
return false;
@ -445,7 +445,7 @@ bool KStartupInfo::sendChangeX( Display* disp_P, const KStartupInfoId& id_P,
return KXMessages::broadcastMessageX( disp_P, NET_STARTUP_MSG, msg, -1, false );
}
bool KStartupInfo::sendFinish( const KStartupInfoId& id_P )
bool TDEStartupInfo::sendFinish( const TDEStartupInfoId& id_P )
{
if( id_P.none())
return false;
@ -456,7 +456,7 @@ bool KStartupInfo::sendFinish( const KStartupInfoId& id_P )
return true;
}
bool KStartupInfo::sendFinishX( Display* disp_P, const KStartupInfoId& id_P )
bool TDEStartupInfo::sendFinishX( Display* disp_P, const TDEStartupInfoId& id_P )
{
if( id_P.none())
return false;
@ -467,7 +467,7 @@ bool KStartupInfo::sendFinishX( Display* disp_P, const KStartupInfoId& id_P )
return KXMessages::broadcastMessageX( disp_P, NET_STARTUP_MSG, msg, -1, false );
}
bool KStartupInfo::sendFinish( const KStartupInfoId& id_P, const KStartupInfoData& data_P )
bool TDEStartupInfo::sendFinish( const TDEStartupInfoId& id_P, const TDEStartupInfoData& data_P )
{
// if( id_P.none()) // id may be none, the pids and hostname matter then
// return false;
@ -479,8 +479,8 @@ bool KStartupInfo::sendFinish( const KStartupInfoId& id_P, const KStartupInfoDat
return true;
}
bool KStartupInfo::sendFinishX( Display* disp_P, const KStartupInfoId& id_P,
const KStartupInfoData& data_P )
bool TDEStartupInfo::sendFinishX( Display* disp_P, const TDEStartupInfoId& id_P,
const TDEStartupInfoData& data_P )
{
// if( id_P.none()) // id may be none, the pids and hostname matter then
// return false;
@ -492,58 +492,58 @@ bool KStartupInfo::sendFinishX( Display* disp_P, const KStartupInfoId& id_P,
return KXMessages::broadcastMessageX( disp_P, NET_STARTUP_MSG, msg, -1, false );
}
void KStartupInfo::appStarted()
void TDEStartupInfo::appStarted()
{
if( kapp != NULL ) // TDEApplication constructor unsets the env. variable
appStarted( kapp->startupId());
else
appStarted( KStartupInfo::currentStartupIdEnv().id());
appStarted( TDEStartupInfo::currentStartupIdEnv().id());
}
void KStartupInfo::appStarted( const TQCString& startup_id )
void TDEStartupInfo::appStarted( const TQCString& startup_id )
{
KStartupInfoId id;
TDEStartupInfoId id;
id.initId( startup_id );
if( id.none())
return;
if( kapp != NULL )
KStartupInfo::sendFinish( id );
TDEStartupInfo::sendFinish( id );
else if( getenv( "DISPLAY" ) != NULL ) // don't rely on tqt_xdisplay()
{
#ifdef Q_WS_X11
Display* disp = XOpenDisplay( NULL );
if( disp != NULL )
{
KStartupInfo::sendFinishX( disp, id );
TDEStartupInfo::sendFinishX( disp, id );
XCloseDisplay( disp );
}
#endif
}
}
void KStartupInfo::disableAutoAppStartedSending( bool disable )
void TDEStartupInfo::disableAutoAppStartedSending( bool disable )
{
auto_app_started_sending = !disable;
}
void KStartupInfo::silenceStartup( bool silence )
void TDEStartupInfo::silenceStartup( bool silence )
{
KStartupInfoId id;
TDEStartupInfoId id;
id.initId( kapp->startupId());
if( id.none())
return;
KStartupInfoData data;
data.setSilent( silence ? KStartupInfoData::Yes : KStartupInfoData::No );
TDEStartupInfoData data;
data.setSilent( silence ? TDEStartupInfoData::Yes : TDEStartupInfoData::No );
sendChange( id, data );
}
void KStartupInfo::handleAutoAppStartedSending()
void TDEStartupInfo::handleAutoAppStartedSending()
{
if( auto_app_started_sending )
appStarted();
}
void KStartupInfo::setNewStartupId( TQWidget* window, const TQCString& startup_id )
void TDEStartupInfo::setNewStartupId( TQWidget* window, const TQCString& startup_id )
{
bool activate = true;
kapp->setStartupId( startup_id );
@ -554,7 +554,7 @@ void KStartupInfo::setNewStartupId( TQWidget* window, const TQCString& startup_i
NETRootInfo i( tqt_xdisplay(), NET::Supported );
if( i.isSupported( NET::WM2StartupId ))
{
KStartupInfo::setWindowStartupId( window->winId(), startup_id );
TDEStartupInfo::setWindowStartupId( window->winId(), startup_id );
activate = false; // WM will take care of it
}
}
@ -568,32 +568,32 @@ void KStartupInfo::setNewStartupId( TQWidget* window, const TQCString& startup_i
KWin::forceActiveWindow( window->winId());
}
}
KStartupInfo::handleAutoAppStartedSending();
TDEStartupInfo::handleAutoAppStartedSending();
}
KStartupInfo::startup_t KStartupInfo::checkStartup( WId w_P, KStartupInfoId& id_O,
KStartupInfoData& data_O )
TDEStartupInfo::startup_t TDEStartupInfo::checkStartup( WId w_P, TDEStartupInfoId& id_O,
TDEStartupInfoData& data_O )
{
return check_startup_internal( w_P, &id_O, &data_O );
}
KStartupInfo::startup_t KStartupInfo::checkStartup( WId w_P, KStartupInfoId& id_O )
TDEStartupInfo::startup_t TDEStartupInfo::checkStartup( WId w_P, TDEStartupInfoId& id_O )
{
return check_startup_internal( w_P, &id_O, NULL );
}
KStartupInfo::startup_t KStartupInfo::checkStartup( WId w_P, KStartupInfoData& data_O )
TDEStartupInfo::startup_t TDEStartupInfo::checkStartup( WId w_P, TDEStartupInfoData& data_O )
{
return check_startup_internal( w_P, NULL, &data_O );
}
KStartupInfo::startup_t KStartupInfo::checkStartup( WId w_P )
TDEStartupInfo::startup_t TDEStartupInfo::checkStartup( WId w_P )
{
return check_startup_internal( w_P, NULL, NULL );
}
KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupInfoId* id_O,
KStartupInfoData* data_O )
TDEStartupInfo::startup_t TDEStartupInfo::check_startup_internal( WId w_P, TDEStartupInfoId* id_O,
TDEStartupInfoData* data_O )
{
if( d == NULL )
return NoMatch;
@ -661,13 +661,13 @@ KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupI
return CantDetect;
}
bool KStartupInfo::find_id( const TQCString& id_P, KStartupInfoId* id_O,
KStartupInfoData* data_O )
bool TDEStartupInfo::find_id( const TQCString& id_P, TDEStartupInfoId* id_O,
TDEStartupInfoData* data_O )
{
if( d == NULL )
return false;
kdDebug( 172 ) << "find_id:" << id_P << endl;
KStartupInfoId id;
TDEStartupInfoId id;
id.initId( id_P );
if( d->startups.contains( id ))
{
@ -681,13 +681,13 @@ bool KStartupInfo::find_id( const TQCString& id_P, KStartupInfoId* id_O,
return false;
}
bool KStartupInfo::find_pid( pid_t pid_P, const TQCString& hostname_P,
KStartupInfoId* id_O, KStartupInfoData* data_O )
bool TDEStartupInfo::find_pid( pid_t pid_P, const TQCString& hostname_P,
TDEStartupInfoId* id_O, TDEStartupInfoData* data_O )
{
if( d == NULL )
return false;
kdDebug( 172 ) << "find_pid:" << pid_P << endl;
for( TQMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->startups.begin();
it != d->startups.end();
++it )
{
@ -706,15 +706,15 @@ bool KStartupInfo::find_pid( pid_t pid_P, const TQCString& hostname_P,
return false;
}
bool KStartupInfo::find_wclass( TQCString res_name, TQCString res_class,
KStartupInfoId* id_O, KStartupInfoData* data_O )
bool TDEStartupInfo::find_wclass( TQCString res_name, TQCString res_class,
TDEStartupInfoId* id_O, TDEStartupInfoData* data_O )
{
if( d == NULL )
return false;
res_name = res_name.lower();
res_class = res_class.lower();
kdDebug( 172 ) << "find_wclass:" << res_name << ":" << res_class << endl;
for( TQMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->startups.begin();
it != d->startups.end();
++it )
{
@ -758,7 +758,7 @@ static TQCString read_startup_id_property( WId w_P )
#endif
TQCString KStartupInfo::windowStartupId( WId w_P )
TQCString TDEStartupInfo::windowStartupId( WId w_P )
{
#ifdef Q_WS_X11
if( net_startup_atom == None )
@ -780,7 +780,7 @@ TQCString KStartupInfo::windowStartupId( WId w_P )
#endif
}
void KStartupInfo::setWindowStartupId( WId w_P, const TQCString& id_P )
void TDEStartupInfo::setWindowStartupId( WId w_P, const TQCString& id_P )
{
#ifdef Q_WS_X11
if( id_P.isNull())
@ -794,7 +794,7 @@ void KStartupInfo::setWindowStartupId( WId w_P, const TQCString& id_P )
#endif
}
TQCString KStartupInfo::get_window_hostname( WId w_P )
TQCString TDEStartupInfo::get_window_hostname( WId w_P )
{
#ifdef Q_WS_X11
XTextProperty tp;
@ -816,19 +816,19 @@ TQCString KStartupInfo::get_window_hostname( WId w_P )
return TQCString();
}
void KStartupInfo::setTimeout( unsigned int secs_P )
void TDEStartupInfo::setTimeout( unsigned int secs_P )
{
timeout = secs_P;
// schedule removing entries that are older than the new timeout
TQTimer::singleShot( 0, this, TQT_SLOT( startups_cleanup_no_age()));
}
void KStartupInfo::startups_cleanup_no_age()
void TDEStartupInfo::startups_cleanup_no_age()
{
startups_cleanup_internal( false );
}
void KStartupInfo::startups_cleanup()
void TDEStartupInfo::startups_cleanup()
{
if( d == NULL )
return;
@ -841,11 +841,11 @@ void KStartupInfo::startups_cleanup()
startups_cleanup_internal( true );
}
void KStartupInfo::startups_cleanup_internal( bool age_P )
void TDEStartupInfo::startups_cleanup_internal( bool age_P )
{
if( d == NULL )
return;
for( TQMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->startups.begin();
it != d->startups.end();
)
{
@ -856,7 +856,7 @@ void KStartupInfo::startups_cleanup_internal( bool age_P )
tout *= 20;
if( ( *it ).age >= tout )
{
const KStartupInfoId& key = it.key();
const TDEStartupInfoId& key = it.key();
++it;
kdDebug( 172 ) << "startups entry timeout:" << key.id() << endl;
remove_startup_info_internal( key );
@ -864,7 +864,7 @@ void KStartupInfo::startups_cleanup_internal( bool age_P )
else
++it;
}
for( TQMap< KStartupInfoId, Data >::Iterator it = d->silent_startups.begin();
for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->silent_startups.begin();
it != d->silent_startups.end();
)
{
@ -875,7 +875,7 @@ void KStartupInfo::startups_cleanup_internal( bool age_P )
tout *= 20;
if( ( *it ).age >= tout )
{
const KStartupInfoId& key = it.key();
const TDEStartupInfoId& key = it.key();
++it;
kdDebug( 172 ) << "silent entry timeout:" << key.id() << endl;
remove_startup_info_internal( key );
@ -883,7 +883,7 @@ void KStartupInfo::startups_cleanup_internal( bool age_P )
else
++it;
}
for( TQMap< KStartupInfoId, Data >::Iterator it = d->uninited_startups.begin();
for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->uninited_startups.begin();
it != d->uninited_startups.end();
)
{
@ -894,7 +894,7 @@ void KStartupInfo::startups_cleanup_internal( bool age_P )
tout *= 20;
if( ( *it ).age >= tout )
{
const KStartupInfoId& key = it.key();
const TDEStartupInfoId& key = it.key();
++it;
kdDebug( 172 ) << "uninited entry timeout:" << key.id() << endl;
remove_startup_info_internal( key );
@ -904,11 +904,11 @@ void KStartupInfo::startups_cleanup_internal( bool age_P )
}
}
void KStartupInfo::clean_all_noncompliant()
void TDEStartupInfo::clean_all_noncompliant()
{
if( d == NULL )
return;
for( TQMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
for( TQMap< TDEStartupInfoId, Data >::Iterator it = d->startups.begin();
it != d->startups.end();
)
{
@ -917,14 +917,14 @@ void KStartupInfo::clean_all_noncompliant()
++it;
continue;
}
const KStartupInfoId& key = it.key();
const TDEStartupInfoId& key = it.key();
++it;
kdDebug( 172 ) << "entry cleaning:" << key.id() << endl;
remove_startup_info_internal( key );
}
}
TQCString KStartupInfo::createNewStartupId()
TQCString TDEStartupInfo::createNewStartupId()
{
// Assign a unique id, use hostname+time+pid, that should be 200% unique.
// Also append the user timestamp (for focus stealing prevention).
@ -941,26 +941,26 @@ TQCString KStartupInfo::createNewStartupId()
}
struct KStartupInfoIdPrivate
struct TDEStartupInfoIdPrivate
{
KStartupInfoIdPrivate() : id( "" ) {}
TDEStartupInfoIdPrivate() : id( "" ) {}
TQCString id; // id
};
const TQCString& KStartupInfoId::id() const
const TQCString& TDEStartupInfoId::id() const
{
return d->id;
}
TQString KStartupInfoId::to_text() const
TQString TDEStartupInfoId::to_text() const
{
return TQString::fromLatin1( " ID=\"%1\" " ).arg( escape_str( id()));
}
KStartupInfoId::KStartupInfoId( const TQString& txt_P )
TDEStartupInfoId::TDEStartupInfoId( const TQString& txt_P )
{
d = new KStartupInfoIdPrivate;
d = new TDEStartupInfoIdPrivate;
TQStringList items = get_fields( txt_P );
const TQString id_str = TQString::fromLatin1( "ID=" );
for( TQStringList::Iterator it = items.begin();
@ -972,7 +972,7 @@ KStartupInfoId::KStartupInfoId( const TQString& txt_P )
}
}
void KStartupInfoId::initId( const TQCString& id_P )
void TDEStartupInfoId::initId( const TQCString& id_P )
{
if( !id_P.isEmpty())
{
@ -991,10 +991,10 @@ void KStartupInfoId::initId( const TQCString& id_P )
#endif
return;
}
d->id = KStartupInfo::createNewStartupId();
d->id = TDEStartupInfo::createNewStartupId();
}
bool KStartupInfoId::setupStartupEnv() const
bool TDEStartupInfoId::setupStartupEnv() const
{
if( id().isEmpty())
{
@ -1004,10 +1004,10 @@ bool KStartupInfoId::setupStartupEnv() const
return setenv( NET_STARTUP_ENV, id(), true ) == 0;
}
KStartupInfoId KStartupInfo::currentStartupIdEnv()
TDEStartupInfoId TDEStartupInfo::currentStartupIdEnv()
{
const char* startup_env = getenv( NET_STARTUP_ENV );
KStartupInfoId id;
TDEStartupInfoId id;
if( startup_env != NULL && *startup_env != '\0' )
id.d->id = startup_env;
else
@ -1015,57 +1015,57 @@ KStartupInfoId KStartupInfo::currentStartupIdEnv()
return id;
}
void KStartupInfo::resetStartupEnv()
void TDEStartupInfo::resetStartupEnv()
{
unsetenv( NET_STARTUP_ENV );
}
KStartupInfoId::KStartupInfoId()
TDEStartupInfoId::TDEStartupInfoId()
{
d = new KStartupInfoIdPrivate;
d = new TDEStartupInfoIdPrivate;
}
KStartupInfoId::~KStartupInfoId()
TDEStartupInfoId::~TDEStartupInfoId()
{
delete d;
}
KStartupInfoId::KStartupInfoId( const KStartupInfoId& id_P )
TDEStartupInfoId::TDEStartupInfoId( const TDEStartupInfoId& id_P )
{
d = new KStartupInfoIdPrivate( *id_P.d );
d = new TDEStartupInfoIdPrivate( *id_P.d );
}
KStartupInfoId& KStartupInfoId::operator=( const KStartupInfoId& id_P )
TDEStartupInfoId& TDEStartupInfoId::operator=( const TDEStartupInfoId& id_P )
{
if( &id_P == this )
return *this;
delete d;
d = new KStartupInfoIdPrivate( *id_P.d );
d = new TDEStartupInfoIdPrivate( *id_P.d );
return *this;
}
bool KStartupInfoId::operator==( const KStartupInfoId& id_P ) const
bool TDEStartupInfoId::operator==( const TDEStartupInfoId& id_P ) const
{
return id() == id_P.id();
}
bool KStartupInfoId::operator!=( const KStartupInfoId& id_P ) const
bool TDEStartupInfoId::operator!=( const TDEStartupInfoId& id_P ) const
{
return !(*this == id_P );
}
// needed for QMap
bool KStartupInfoId::operator<( const KStartupInfoId& id_P ) const
bool TDEStartupInfoId::operator<( const TDEStartupInfoId& id_P ) const
{
return id() < id_P.id();
}
bool KStartupInfoId::none() const
bool TDEStartupInfoId::none() const
{
return d->id.isEmpty() || d->id == "0";
}
unsigned long KStartupInfoId::timestamp() const
unsigned long TDEStartupInfoId::timestamp() const
{
if( none())
return 0;
@ -1097,14 +1097,14 @@ unsigned long KStartupInfoId::timestamp() const
return time;
}
}
// bah ... old KStartupInfo or a problem
// bah ... old TDEStartupInfo or a problem
return 0;
}
struct KStartupInfoDataPrivate
struct TDEStartupInfoDataPrivate
{
KStartupInfoDataPrivate() : desktop( 0 ), wmclass( "" ), hostname( "" ),
silent( KStartupInfoData::Unknown ), timestamp( -1U ), screen( -1 ), xinerama( -1 ), launched_by( 0 ) {}
TDEStartupInfoDataPrivate() : desktop( 0 ), wmclass( "" ), hostname( "" ),
silent( TDEStartupInfoData::Unknown ), timestamp( -1U ), screen( -1 ), xinerama( -1 ), launched_by( 0 ) {}
TQString bin;
TQString name;
TQString description;
@ -1113,14 +1113,14 @@ struct KStartupInfoDataPrivate
TQValueList< pid_t > pids;
TQCString wmclass;
TQCString hostname;
KStartupInfoData::TriState silent;
TDEStartupInfoData::TriState silent;
unsigned long timestamp;
int screen;
int xinerama;
WId launched_by;
};
TQString KStartupInfoData::to_text() const
TQString TDEStartupInfoData::to_text() const
{
TQString ret = "";
if( !d->bin.isEmpty())
@ -1155,9 +1155,9 @@ TQString KStartupInfoData::to_text() const
return ret;
}
KStartupInfoData::KStartupInfoData( const TQString& txt_P )
TDEStartupInfoData::TDEStartupInfoData( const TQString& txt_P )
{
d = new KStartupInfoDataPrivate;
d = new TDEStartupInfoDataPrivate;
TQStringList items = get_fields( txt_P );
const TQString bin_str = TQString::fromLatin1( "BIN=" );
const TQString name_str = TQString::fromLatin1( "NAME=" );
@ -1209,21 +1209,21 @@ KStartupInfoData::KStartupInfoData( const TQString& txt_P )
}
}
KStartupInfoData::KStartupInfoData( const KStartupInfoData& data )
TDEStartupInfoData::TDEStartupInfoData( const TDEStartupInfoData& data )
{
d = new KStartupInfoDataPrivate( *data.d );
d = new TDEStartupInfoDataPrivate( *data.d );
}
KStartupInfoData& KStartupInfoData::operator=( const KStartupInfoData& data )
TDEStartupInfoData& TDEStartupInfoData::operator=( const TDEStartupInfoData& data )
{
if( &data == this )
return *this;
delete d;
d = new KStartupInfoDataPrivate( *data.d );
d = new TDEStartupInfoDataPrivate( *data.d );
return *this;
}
void KStartupInfoData::update( const KStartupInfoData& data_P )
void TDEStartupInfoData::update( const TDEStartupInfoData& data_P )
{
if( !data_P.bin().isEmpty())
d->bin = data_P.bin();
@ -1255,105 +1255,105 @@ void KStartupInfoData::update( const KStartupInfoData& data_P )
d->launched_by = data_P.launchedBy();
}
KStartupInfoData::KStartupInfoData()
TDEStartupInfoData::TDEStartupInfoData()
{
d = new KStartupInfoDataPrivate;
d = new TDEStartupInfoDataPrivate;
}
KStartupInfoData::~KStartupInfoData()
TDEStartupInfoData::~TDEStartupInfoData()
{
delete d;
}
void KStartupInfoData::setBin( const TQString& bin_P )
void TDEStartupInfoData::setBin( const TQString& bin_P )
{
d->bin = bin_P;
}
const TQString& KStartupInfoData::bin() const
const TQString& TDEStartupInfoData::bin() const
{
return d->bin;
}
void KStartupInfoData::setName( const TQString& name_P )
void TDEStartupInfoData::setName( const TQString& name_P )
{
d->name = name_P;
}
const TQString& KStartupInfoData::name() const
const TQString& TDEStartupInfoData::name() const
{
return d->name;
}
const TQString& KStartupInfoData::findName() const
const TQString& TDEStartupInfoData::findName() const
{
if( !name().isEmpty())
return name();
return bin();
}
void KStartupInfoData::setDescription( const TQString& desc_P )
void TDEStartupInfoData::setDescription( const TQString& desc_P )
{
d->description = desc_P;
}
const TQString& KStartupInfoData::description() const
const TQString& TDEStartupInfoData::description() const
{
return d->description;
}
const TQString& KStartupInfoData::findDescription() const
const TQString& TDEStartupInfoData::findDescription() const
{
if( !description().isEmpty())
return description();
return name();
}
void KStartupInfoData::setIcon( const TQString& icon_P )
void TDEStartupInfoData::setIcon( const TQString& icon_P )
{
d->icon = icon_P;
}
const TQString& KStartupInfoData::findIcon() const
const TQString& TDEStartupInfoData::findIcon() const
{
if( !icon().isEmpty())
return icon();
return bin();
}
const TQString& KStartupInfoData::icon() const
const TQString& TDEStartupInfoData::icon() const
{
return d->icon;
}
void KStartupInfoData::setDesktop( int desktop_P )
void TDEStartupInfoData::setDesktop( int desktop_P )
{
d->desktop = desktop_P;
}
int KStartupInfoData::desktop() const
int TDEStartupInfoData::desktop() const
{
return d->desktop;
}
void KStartupInfoData::setWMClass( const TQCString& wmclass_P )
void TDEStartupInfoData::setWMClass( const TQCString& wmclass_P )
{
d->wmclass = wmclass_P;
}
const TQCString KStartupInfoData::findWMClass() const
const TQCString TDEStartupInfoData::findWMClass() const
{
if( !WMClass().isEmpty() && WMClass() != "0" )
return WMClass();
return bin().utf8();
}
const TQCString& KStartupInfoData::WMClass() const
const TQCString& TDEStartupInfoData::WMClass() const
{
return d->wmclass;
}
void KStartupInfoData::setHostname( const TQCString& hostname_P )
void TDEStartupInfoData::setHostname( const TQCString& hostname_P )
{
if( !hostname_P.isNull())
d->hostname = hostname_P;
@ -1367,78 +1367,78 @@ void KStartupInfoData::setHostname( const TQCString& hostname_P )
}
}
const TQCString& KStartupInfoData::hostname() const
const TQCString& TDEStartupInfoData::hostname() const
{
return d->hostname;
}
void KStartupInfoData::addPid( pid_t pid_P )
void TDEStartupInfoData::addPid( pid_t pid_P )
{
if( !d->pids.contains( pid_P ))
d->pids.append( pid_P );
}
void KStartupInfoData::remove_pid( pid_t pid_P )
void TDEStartupInfoData::remove_pid( pid_t pid_P )
{
d->pids.remove( pid_P );
}
const TQValueList< pid_t >& KStartupInfoData::pids() const
const TQValueList< pid_t >& TDEStartupInfoData::pids() const
{
return d->pids;
}
bool KStartupInfoData::is_pid( pid_t pid_P ) const
bool TDEStartupInfoData::is_pid( pid_t pid_P ) const
{
return d->pids.contains( pid_P );
}
void KStartupInfoData::setSilent( TriState state_P )
void TDEStartupInfoData::setSilent( TriState state_P )
{
d->silent = state_P;
}
KStartupInfoData::TriState KStartupInfoData::silent() const
TDEStartupInfoData::TriState TDEStartupInfoData::silent() const
{
return d->silent;
}
void KStartupInfoData::setTimestamp( unsigned long time )
void TDEStartupInfoData::setTimestamp( unsigned long time )
{
d->timestamp = time;
}
unsigned long KStartupInfoData::timestamp() const
unsigned long TDEStartupInfoData::timestamp() const
{
return d->timestamp;
}
void KStartupInfoData::setScreen( int screen )
void TDEStartupInfoData::setScreen( int screen )
{
d->screen = screen;
}
int KStartupInfoData::screen() const
int TDEStartupInfoData::screen() const
{
return d->screen;
}
void KStartupInfoData::setXinerama( int xinerama )
void TDEStartupInfoData::setXinerama( int xinerama )
{
d->xinerama = xinerama;
}
int KStartupInfoData::xinerama() const
int TDEStartupInfoData::xinerama() const
{
return d->xinerama;
}
void KStartupInfoData::setLaunchedBy( WId window )
void TDEStartupInfoData::setLaunchedBy( WId window )
{
d->launched_by = window;
}
WId KStartupInfoData::launchedBy() const
WId TDEStartupInfoData::launchedBy() const
{
return d->launched_by;
}

@ -39,10 +39,10 @@ DEALINGS IN THE SOFTWARE.
#include <tqvaluelist.h>
#include "tdelibs_export.h"
class KStartupInfoId;
class KStartupInfoData;
class TDEStartupInfoId;
class TDEStartupInfoData;
class KStartupInfoPrivate;
class TDEStartupInfoPrivate;
/**
* Class for manipulating the application startup notification.
@ -59,12 +59,12 @@ class KStartupInfoPrivate;
* to its slots. It will automatically detect started applications and when
* they are ready.
*
* @see KStartupInfoId
* @see KStartupInfoData
* @see TDEStartupInfoId
* @see TDEStartupInfoData
*
* @author Lubos Lunak <l.lunak@kde.org>
*/
class TDECORE_EXPORT KStartupInfo
class TDECORE_EXPORT TDEStartupInfo
: public TQObject
{
Q_OBJECT
@ -151,7 +151,7 @@ class TDECORE_EXPORT KStartupInfo
* @param name the name of the TQObject (can be 0 for no name)
*
*/
KStartupInfo( int flags, TQObject* parent = NULL, const char* name = NULL );
TDEStartupInfo( int flags, TQObject* parent = NULL, const char* name = NULL );
/**
* Creates an instance that will receive the startup notifications.
*
@ -163,8 +163,8 @@ class TDECORE_EXPORT KStartupInfo
*
* @obsolete
*/
KStartupInfo( bool clean_on_cantdetect, TQObject* parent = 0, const char* name = 0 );
virtual ~KStartupInfo();
TDEStartupInfo( bool clean_on_cantdetect, TQObject* parent = 0, const char* name = 0 );
virtual ~TDEStartupInfo();
/**
* Sends given notification data about started application
* with the given startup identification. If no notification for this identification
@ -174,10 +174,10 @@ class TDECORE_EXPORT KStartupInfo
* @param id the id of the application
* @param data the application's data
* @return true if successful, false otherwise
* @see KStartupInfoId
* @see KStartupInfoData
* @see TDEStartupInfoId
* @see TDEStartupInfoData
*/
static bool sendStartup( const KStartupInfoId& id, const KStartupInfoData& data );
static bool sendStartup( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
/**
* Like sendStartup , uses dpy instead of tqt_xdisplay() for sending the info.
@ -187,8 +187,8 @@ class TDECORE_EXPORT KStartupInfo
* @param data the application's data
* @return true if successful, false otherwise
*/
static bool sendStartupX( Display* dpy, const KStartupInfoId& id,
const KStartupInfoData& data );
static bool sendStartupX( Display* dpy, const TDEStartupInfoId& id,
const TDEStartupInfoData& data );
/**
* Sends given notification data about started application
@ -197,10 +197,10 @@ class TDECORE_EXPORT KStartupInfo
* @param id the id of the application
* @param data the application's data
* @return true if successful, false otherwise
* @see KStartupInfoId
* @see KStartupInfoData
* @see TDEStartupInfoId
* @see TDEStartupInfoData
*/
static bool sendChange( const KStartupInfoId& id, const KStartupInfoData& data );
static bool sendChange( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
/**
* Like sendChange , uses dpy instead of tqt_xdisplay() for sending the info.
@ -209,15 +209,15 @@ class TDECORE_EXPORT KStartupInfo
* @param data the application's data
* @return true if successful, false otherwise
*/
static bool sendChangeX( Display* dpy, const KStartupInfoId& id,
const KStartupInfoData& data );
static bool sendChangeX( Display* dpy, const TDEStartupInfoId& id,
const TDEStartupInfoData& data );
/**
* Ends startup notification with the given identification.
* @param id the id of the application
* @return true if successful, false otherwise
*/
static bool sendFinish( const KStartupInfoId& id );
static bool sendFinish( const TDEStartupInfoId& id );
/**
* Like sendFinish , uses dpy instead of tqt_xdisplay() for sending the info.
@ -225,7 +225,7 @@ class TDECORE_EXPORT KStartupInfo
* @param id the id of the application
* @return true if successful, false otherwise
*/
static bool sendFinishX( Display* dpy, const KStartupInfoId& id );
static bool sendFinishX( Display* dpy, const TDEStartupInfoId& id );
/**
* Ends startup notification with the given identification and the given data ( e.g.
@ -234,7 +234,7 @@ class TDECORE_EXPORT KStartupInfo
* @param data the application's data
* @return true if successful, false otherwise
*/
static bool sendFinish( const KStartupInfoId& id, const KStartupInfoData& data );
static bool sendFinish( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
/**
* Like sendFinish , uses dpy instead of tqt_xdisplay() for sending the info.
@ -243,8 +243,8 @@ class TDECORE_EXPORT KStartupInfo
* @param data the application's data
* @return true if successful, false otherwise
*/
static bool sendFinishX( Display* dpy, const KStartupInfoId& id,
const KStartupInfoData& data );
static bool sendFinishX( Display* dpy, const TDEStartupInfoId& id,
const TDEStartupInfoData& data );
/**
* Returns the current startup notification identification for the current
@ -252,7 +252,7 @@ class TDECORE_EXPORT KStartupInfo
* unsets the variable and you have to use TDEApplication::startupId .
* @return the current startup notification identification
*/
static KStartupInfoId currentStartupIdEnv();
static TDEStartupInfoId currentStartupIdEnv();
/**
* Unsets the startup notification environment variable.
*/
@ -277,7 +277,7 @@ class TDECORE_EXPORT KStartupInfo
* @param id if found, the id of the startup notification will be written here
* @return the result of the operation
*/
startup_t checkStartup( WId w, KStartupInfoId& id );
startup_t checkStartup( WId w, TDEStartupInfoId& id );
/**
* Checks if the given windows matches any existing startup notification, and
* if yes, returns the notification data in data.
@ -285,7 +285,7 @@ class TDECORE_EXPORT KStartupInfo
* @param data if found, the data of the startup notification will be written here
* @return the result of the operation
*/
startup_t checkStartup( WId w, KStartupInfoData& data );
startup_t checkStartup( WId w, TDEStartupInfoData& data );
/**
* Checks if the given windows matches any existing startup notification, and
* if yes, returns the identification in id and notification data in data.
@ -294,7 +294,7 @@ class TDECORE_EXPORT KStartupInfo
* @param data if found, the data of the startup notification will be written here
* @return the result of the operation
*/
startup_t checkStartup( WId w, KStartupInfoId& id, KStartupInfoData& data );
startup_t checkStartup( WId w, TDEStartupInfoId& id, TDEStartupInfoData& data );
/**
* Sets the timeout for notifications, after this timeout a notification is removed.
* @param secs the new timeout in seconds
@ -327,20 +327,20 @@ class TDECORE_EXPORT KStartupInfo
* @param id the notification identification
* @param data the notification data
*/
void gotNewStartup( const KStartupInfoId& id, const KStartupInfoData& data );
void gotNewStartup( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
/**
* Emitted when a startup notification changes.
* @param id the notification identification
* @param data the notification data
*/
void gotStartupChange( const KStartupInfoId& id, const KStartupInfoData& data );
void gotStartupChange( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
/**
* Emitted when a startup notification is removed (either because it was detected
* that the application is ready or because of a timeout).
* @param id the notification identification
* @param data the notification data
*/
void gotRemoveStartup( const KStartupInfoId& id, const KStartupInfoData& data );
void gotRemoveStartup( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
protected:
/**
*
@ -354,32 +354,32 @@ class TDECORE_EXPORT KStartupInfo
void slot_window_added( WId w );
private:
void init( int flags );
friend class KStartupInfoPrivate;
friend class TDEStartupInfoPrivate;
void got_startup_info( const TQString& msg_P, bool update_only_P );
void got_remove_startup_info( const TQString& msg_P );
void new_startup_info_internal( const KStartupInfoId& id_P,
void new_startup_info_internal( const TDEStartupInfoId& id_P,
Data& data_P, bool update_only_P );
void remove_startup_info_internal( const KStartupInfoId& id_P );
void remove_startup_pids( const KStartupInfoId& id, const KStartupInfoData& data );
void remove_startup_pids( const KStartupInfoData& data );
startup_t check_startup_internal( WId w, KStartupInfoId* id, KStartupInfoData* data );
bool find_id( const TQCString& id_P, KStartupInfoId* id_O,
KStartupInfoData* data_O );
bool find_pid( pid_t pid_P, const TQCString& hostname, KStartupInfoId* id_O,
KStartupInfoData* data_O );
void remove_startup_info_internal( const TDEStartupInfoId& id_P );
void remove_startup_pids( const TDEStartupInfoId& id, const TDEStartupInfoData& data );
void remove_startup_pids( const TDEStartupInfoData& data );
startup_t check_startup_internal( WId w, TDEStartupInfoId* id, TDEStartupInfoData* data );
bool find_id( const TQCString& id_P, TDEStartupInfoId* id_O,
TDEStartupInfoData* data_O );
bool find_pid( pid_t pid_P, const TQCString& hostname, TDEStartupInfoId* id_O,
TDEStartupInfoData* data_O );
bool find_wclass( TQCString res_name_P, TQCString res_class_P,
KStartupInfoId* id_O, KStartupInfoData* data_O );
TDEStartupInfoId* id_O, TDEStartupInfoData* data_O );
static TQCString get_window_hostname( WId w_P );
void startups_cleanup_internal( bool age_P );
void clean_all_noncompliant();
static TQString check_required_startup_fields( const TQString& msg,
const KStartupInfoData& data, int screen );
const TDEStartupInfoData& data, int screen );
bool clean_on_cantdetect_; // KDE4 remove unused
unsigned int timeout;
KStartupInfoPrivate* d;
TDEStartupInfoPrivate* d;
};
class KStartupInfoIdPrivate;
class TDEStartupInfoIdPrivate;
/**
* Class representing an identification of application startup notification.
@ -387,24 +387,24 @@ class KStartupInfoIdPrivate;
* Every existing notification about a starting application has its own unique
* identification, that's used to identify and manipulate the notification.
*
* @see KStartupInfo
* @see KStartupInfoData
* @see TDEStartupInfo
* @see TDEStartupInfoData
*
* @author Lubos Lunak <l.lunak@kde.org>
*/
class TDECORE_EXPORT KStartupInfoId
class TDECORE_EXPORT TDEStartupInfoId
{
public:
/**
* Overloaded operator.
* @return true if the notification identifications are the same
*/
bool operator==( const KStartupInfoId& id ) const;
bool operator==( const TDEStartupInfoId& id ) const;
/**
* Overloaded operator.
* @return true if the notification identifications are different
*/
bool operator!=( const KStartupInfoId& id ) const;
bool operator!=( const TDEStartupInfoId& id ) const;
/**
* Checks whether the identifier is valid.
* @return true if this object doesn't represent a valid notification identification
@ -437,22 +437,22 @@ class TDECORE_EXPORT KStartupInfoId
/**
* Creates an empty identification
*/
KStartupInfoId();
TDEStartupInfoId();
/**
* Copy constructor.
*/
KStartupInfoId( const KStartupInfoId& data );
~KStartupInfoId();
KStartupInfoId& operator=( const KStartupInfoId& data );
bool operator<( const KStartupInfoId& id ) const;
TDEStartupInfoId( const TDEStartupInfoId& data );
~TDEStartupInfoId();
TDEStartupInfoId& operator=( const TDEStartupInfoId& data );
bool operator<( const TDEStartupInfoId& id ) const;
private:
KStartupInfoId( const TQString& txt );
TDEStartupInfoId( const TQString& txt );
TQString to_text() const;
friend class KStartupInfo;
KStartupInfoIdPrivate* d;
friend class TDEStartupInfo;
TDEStartupInfoIdPrivate* d;
};
class KStartupInfoDataPrivate;
class TDEStartupInfoDataPrivate;
/**
* Class representing data about an application startup notification.
@ -460,12 +460,12 @@ class KStartupInfoDataPrivate;
* Such data include the icon of the starting application, the desktop on which
* the application should start, the binary name of the application, etc.
*
* @see KStartupInfo
* @see KStartupInfoId
* @see TDEStartupInfo
* @see TDEStartupInfoId
*
* @author Lubos Lunak <l.lunak@kde.org>
*/
class TDECORE_EXPORT KStartupInfoData
class TDECORE_EXPORT TDEStartupInfoData
{
public:
/**
@ -608,13 +608,13 @@ class TDECORE_EXPORT KStartupInfoData
/**
* Return the silence status for the startup notification.
* @return KStartupInfoData::Yes if visual feedback is silenced
* @return TDEStartupInfoData::Yes if visual feedback is silenced
* @since 3.1.1
*/
TriState silent() const;
/**
* @obsolete Timestamp is already assigned in KStartupInfoId::initId().
* @obsolete Timestamp is already assigned in TDEStartupInfoId::initId().
* Sets timestamp for the startup notification. The timestamp is expressed
* as XServer time, and is used to prevent activation of the matching
* window if user interaction took place after this timestamp.
@ -624,7 +624,7 @@ class TDECORE_EXPORT KStartupInfoData
void setTimestamp( unsigned long time );
/**
* @obsolete Use KStartupInfoId::timestamp().
* @obsolete Use TDEStartupInfoId::timestamp().
* Return the timestamp for the startup notification, or -1 if no timestamp
* is set.
*/
@ -670,26 +670,26 @@ class TDECORE_EXPORT KStartupInfoData
* or the name, won't be rewritten if already set.
* @param data the data to update
*/
void update( const KStartupInfoData& data );
void update( const TDEStartupInfoData& data );
/**
* Constructor. Initializes all the data to their default empty values.
*/
KStartupInfoData();
TDEStartupInfoData();
/**
* Copy constructor.
*/
KStartupInfoData( const KStartupInfoData& data );
~KStartupInfoData();
KStartupInfoData& operator=( const KStartupInfoData& data );
TDEStartupInfoData( const TDEStartupInfoData& data );
~TDEStartupInfoData();
TDEStartupInfoData& operator=( const TDEStartupInfoData& data );
private:
KStartupInfoData( const TQString& txt );
TDEStartupInfoData( const TQString& txt );
TQString to_text() const;
void remove_pid( pid_t pid );
friend class KStartupInfo;
friend class KStartupInfo::Data;
KStartupInfoDataPrivate* d;
friend class TDEStartupInfo;
friend class TDEStartupInfo::Data;
TDEStartupInfoDataPrivate* d;
};
#endif //Q_WS_X11

@ -186,17 +186,17 @@ KUniqueApplication::start()
#if 0
#ifdef Q_WS_X11
// say we're up and running ( probably no new window will appear )
KStartupInfoId id;
TDEStartupInfoId id;
if( kapp != NULL ) // TDEApplication constructor unsets the env. variable
id.initId( kapp->startupId());
else
id = KStartupInfo::currentStartupIdEnv();
id = TDEStartupInfo::currentStartupIdEnv();
if( !id.none())
{
Display* disp = XOpenDisplay( NULL );
if( disp != NULL ) // use extra X connection
{
KStartupInfo::sendFinishX( disp, id );
TDEStartupInfo::sendFinishX( disp, id );
XCloseDisplay( disp );
}
}
@ -210,19 +210,19 @@ KUniqueApplication::start()
{
#ifdef Q_WS_X11
KStartupInfoId id;
TDEStartupInfoId id;
if( kapp != NULL ) // TDEApplication constructor unsets the env. variable
id.initId( kapp->startupId());
else
id = KStartupInfo::currentStartupIdEnv();
id = TDEStartupInfo::currentStartupIdEnv();
if( !id.none())
{ // notice about pid change
Display* disp = XOpenDisplay( NULL );
if( disp != NULL ) // use extra X connection
{
KStartupInfoData data;
TDEStartupInfoData data;
data.addPid( getpid());
KStartupInfo::sendChangeX( disp, id, data );
TDEStartupInfo::sendChangeX( disp, id, data );
XCloseDisplay( disp );
}
}
@ -273,11 +273,11 @@ KUniqueApplication::start()
TQCString new_asn_id;
#if defined Q_WS_X11
KStartupInfoId id;
TDEStartupInfoId id;
if( kapp != NULL ) // TDEApplication constructor unsets the env. variable
id.initId( kapp->startupId());
else
id = KStartupInfo::currentStartupIdEnv();
id = TDEStartupInfo::currentStartupIdEnv();
if( !id.none())
new_asn_id = id.id();
#endif
@ -381,11 +381,11 @@ void KUniqueApplication::newInstanceNoFork()
// KDE4 remove
// A hack to make startup notification stop for apps which override newInstance()
// and reuse an already existing window there, but use KWin::activateWindow()
// instead of KStartupInfo::setNewStartupId(). Therefore KWin::activateWindow()
// instead of TDEStartupInfo::setNewStartupId(). Therefore KWin::activateWindow()
// for now sets this flag. Automatically ending startup notification always
// would cause problem if the new window would show up with a small delay.
if( s_handleAutoStarted )
KStartupInfo::handleAutoAppStartedSending();
TDEStartupInfo::handleAutoAppStartedSending();
#endif
// What to do with the return value ?
}
@ -445,7 +445,7 @@ KUniqueApplication::processDelayed()
d->firstInstance = false;
#if defined Q_WS_X11
if( s_handleAutoStarted )
KStartupInfo::handleAutoAppStartedSending(); // KDE4 remove?
TDEStartupInfo::handleAutoAppStartedSending(); // KDE4 remove?
#endif
TQDataStream rs(replyData, IO_WriteOnly);
rs << exitCode;
@ -476,7 +476,7 @@ int KUniqueApplication::newInstance()
// and what's important, it does it properly. If you reimplement newInstance(),
// and don't call the inherited one, use this (but NOT when newInstance()
// is called for the first time, like here).
KStartupInfo::setNewStartupId( mainWidget(), kapp->startupId());
TDEStartupInfo::setNewStartupId( mainWidget(), kapp->startupId());
#endif
}
}

@ -43,12 +43,12 @@ class KXMessagesPrivate;
/**
* Sending string messages to other applications using the X Client Messages.
*
* Used internally by KStartupInfo. You usually don't want to use this, use DCOP
* Used internally by TDEStartupInfo. You usually don't want to use this, use DCOP
* instead.
*
* @author Lubos Lunak <l.lunak@kde.org>
*/
// KDE4 - make this internal for KStartupInfo only?
// KDE4 - make this internal for TDEStartupInfo only?
class TDECORE_EXPORT KXMessages
: public TQWidget
{

@ -731,7 +731,7 @@ void KWin::lowerWindow( WId win )
void KWin::appStarted()
{
#ifdef Q_WS_X11
KStartupInfo::appStarted();
TDEStartupInfo::appStarted();
#endif
}

@ -509,7 +509,7 @@ private:
#endif
/**
* @deprecated
* Use KStartupInfo::appStarted
* Use TDEStartupInfo::appStarted
*/
static void appStarted() KDE_DEPRECATED;
};

@ -563,13 +563,13 @@ static pid_t runCommandInternal( TDEProcess* proc, const KService* service, cons
#ifdef Q_WS_X11 // Startup notification doesn't work with QT/E, service isn't needed without Startup notification
bool silent;
TQCString wmclass;
KStartupInfoId id;
TDEStartupInfoId id;
bool startup_notify = ( asn != "0" && KRun::checkStartupNotify( binName, service, &silent, &wmclass ));
if( startup_notify )
{
id.initId( asn );
id.setupStartupEnv();
KStartupInfoData data;
TDEStartupInfoData data;
data.setHostname();
data.setBin( bin );
if( !execName.isEmpty())
@ -584,19 +584,19 @@ static pid_t runCommandInternal( TDEProcess* proc, const KService* service, cons
if( !wmclass.isEmpty())
data.setWMClass( wmclass );
if( silent )
data.setSilent( KStartupInfoData::Yes );
data.setSilent( TDEStartupInfoData::Yes );
data.setDesktop( KWin::currentDesktop());
if( window )
data.setLaunchedBy( window->winId());
KStartupInfo::sendStartup( id, data );
TDEStartupInfo::sendStartup( id, data );
}
pid_t pid = TDEProcessRunner::run( proc, binName, id );
if( startup_notify && pid )
{
KStartupInfoData data;
TDEStartupInfoData data;
data.addPid( pid );
KStartupInfo::sendChange( id, data );
KStartupInfo::resetStartupEnv();
TDEStartupInfo::sendChange( id, data );
TDEStartupInfo::resetStartupEnv();
}
return pid;
#else
@ -807,14 +807,14 @@ pid_t KRun::run( const KService& _service, const KURL::List& _urls, TQWidget* wi
if( window != NULL )
{
if( myasn.isEmpty())
myasn = KStartupInfo::createNewStartupId();
myasn = TDEStartupInfo::createNewStartupId();
if( myasn != "0" )
{
KStartupInfoId id;
TDEStartupInfoId id;
id.initId( myasn );
KStartupInfoData data;
TDEStartupInfoData data;
data.setLaunchedBy( window->winId());
KStartupInfo::sendChange( id, data );
TDEStartupInfo::sendChange( id, data );
}
}
@ -1484,7 +1484,7 @@ TDEProcessRunner::run(TDEProcess * p, const TQString & binName)
#ifdef Q_WS_X11
pid_t
TDEProcessRunner::run(TDEProcess * p, const TQString & binName, const KStartupInfoId& id )
TDEProcessRunner::run(TDEProcess * p, const TQString & binName, const TDEStartupInfoId& id )
{
return (new TDEProcessRunner(p, binName, id))->pid();
}
@ -1505,7 +1505,7 @@ TDEProcessRunner::TDEProcessRunner(TDEProcess * p, const TQString & _binName )
}
#ifdef Q_WS_X11
TDEProcessRunner::TDEProcessRunner(TDEProcess * p, const TQString & _binName, const KStartupInfoId& id )
TDEProcessRunner::TDEProcessRunner(TDEProcess * p, const TQString & _binName, const TDEStartupInfoId& id )
: TQObject(),
process_(p),
binName( _binName ),
@ -1559,10 +1559,10 @@ TDEProcessRunner::slotProcessExited(TDEProcess * p)
#ifdef Q_WS_X11
if( !id_.none())
{
KStartupInfoData data;
TDEStartupInfoData data;
data.addPid( pid()); // announce this pid for the startup notification has finished
data.setHostname();
KStartupInfo::sendFinish( id_, data );
TDEStartupInfo::sendFinish( id_, data );
}
#endif
deleteLater();

@ -482,8 +482,8 @@ class TDEIO_EXPORT TDEProcessRunner : public TQObject
public:
static pid_t run(TDEProcess *, const TQString & binName);
#ifdef Q_WS_X11 // We don't have KStartupInfo in Qt/Embedded
static pid_t run(TDEProcess *, const TQString & binName, const KStartupInfoId& id );
#ifdef Q_WS_X11 // We don't have TDEStartupInfo in Qt/Embedded
static pid_t run(TDEProcess *, const TQString & binName, const TDEStartupInfoId& id );
#endif
virtual ~TDEProcessRunner();
@ -497,15 +497,15 @@ class TDEIO_EXPORT TDEProcessRunner : public TQObject
private:
TDEProcessRunner(TDEProcess *, const TQString & binName);
#ifdef Q_WS_X11 // We don't have KStartupInfo in Qt/Embedded
TDEProcessRunner(TDEProcess *, const TQString & binName, const KStartupInfoId& id );
#ifdef Q_WS_X11 // We don't have TDEStartupInfo in Qt/Embedded
TDEProcessRunner(TDEProcess *, const TQString & binName, const TDEStartupInfoId& id );
#endif
TDEProcessRunner();
TDEProcess * process_;
TQString binName;
#ifdef Q_WS_X11 // We don't have KStartupInfo in Qt/Embedded
KStartupInfoId id_;
#ifdef Q_WS_X11 // We don't have TDEStartupInfo in Qt/Embedded
TDEStartupInfoId id_;
#endif
};

@ -206,7 +206,7 @@ void KIOExec::slotRunApp()
#ifdef Q_WS_X11
// propagate the startup indentification to the started process
KStartupInfoId id;
TDEStartupInfoId id;
id.initId( kapp->startupId());
id.setupStartupEnv();
#endif
@ -216,7 +216,7 @@ void KIOExec::slotRunApp()
proc.start( TDEProcess::Block );
#ifdef Q_WS_X11
KStartupInfo::resetStartupEnv();
TDEStartupInfo::resetStartupEnv();
#endif
kdDebug() << "EXEC done" << endl;

Loading…
Cancel
Save