summaryrefslogtreecommitdiffstats
path: root/kdecore/kstartupinfo.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
commit560378aaca1784ba19806a0414a32b20c744de39 (patch)
treece0dfd7c3febf2a1adc7603d1019a8be2083c415 /kdecore/kstartupinfo.cpp
parentd4d5af1cdbd3cc65d095e0afc5b1f4260091cf5d (diff)
downloadtdelibs-560378aaca1784ba19806a0414a32b20c744de39.tar.gz
tdelibs-560378aaca1784ba19806a0414a32b20c744de39.zip
Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1
NOTE: This will not compile with Qt4 (yet), however it does compile with Qt3 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1211081 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore/kstartupinfo.cpp')
-rw-r--r--kdecore/kstartupinfo.cpp146
1 files changed, 73 insertions, 73 deletions
diff --git a/kdecore/kstartupinfo.cpp b/kdecore/kstartupinfo.cpp
index 673e5e6ab..c8e47db65 100644
--- a/kdecore/kstartupinfo.cpp
+++ b/kdecore/kstartupinfo.cpp
@@ -94,9 +94,9 @@ struct KStartupInfoPrivate
{
public:
TQMap< KStartupInfoId, KStartupInfo::Data > startups;
- // contains silenced ASN's only if !AnnounceSilencedChanges
+ // tqcontains silenced ASN's only if !AnnounceSilencedChanges
TQMap< KStartupInfoId, KStartupInfo::Data > silent_startups;
- // contains ASN's that had change: but no new: yet
+ // tqcontains ASN's that had change: but no new: yet
TQMap< KStartupInfoId, KStartupInfo::Data > uninited_startups;
#ifdef Q_WS_X11
KWinModule* wm_module;
@@ -234,7 +234,7 @@ void KStartupInfo::new_startup_info_internal( const KStartupInfoId& id_P,
return;
if( id_P.none())
return;
- if( d->startups.contains( id_P ))
+ if( d->startups.tqcontains( id_P ))
{ // already reported, update
d->startups[ id_P ].update( data_P );
d->startups[ id_P ].age = 0; // CHECKME
@@ -250,7 +250,7 @@ void KStartupInfo::new_startup_info_internal( const KStartupInfoId& id_P,
emit gotStartupChange( id_P, d->startups[ id_P ] );
return;
}
- if( d->silent_startups.contains( id_P ))
+ if( d->silent_startups.tqcontains( id_P ))
{ // already reported, update
d->silent_startups[ id_P ].update( data_P );
d->silent_startups[ id_P ].age = 0; // CHECKME
@@ -265,7 +265,7 @@ void KStartupInfo::new_startup_info_internal( const KStartupInfoId& id_P,
emit gotStartupChange( id_P, d->silent_startups[ id_P ] );
return;
}
- if( d->uninited_startups.contains( id_P ))
+ if( d->uninited_startups.tqcontains( id_P ))
{
d->uninited_startups[ id_P ].update( data_P );
kdDebug( 172 ) << "updating uninited" << endl;
@@ -317,18 +317,18 @@ void KStartupInfo::remove_startup_info_internal( const KStartupInfoId& id_P )
{
if( d == NULL )
return;
- if( d->startups.contains( id_P ))
+ if( d->startups.tqcontains( id_P ))
{
kdDebug( 172 ) << "removing" << endl;
emit gotRemoveStartup( id_P, d->startups[ id_P ]);
d->startups.remove( id_P );
}
- else if( d->silent_startups.contains( id_P ))
+ else if( d->silent_startups.tqcontains( id_P ))
{
kdDebug( 172 ) << "removing silent" << endl;
d->silent_startups.remove( id_P );
}
- else if( d->uninited_startups.contains( id_P ))
+ else if( d->uninited_startups.tqcontains( id_P ))
{
kdDebug( 172 ) << "removing uninited" << endl;
d->uninited_startups.remove( id_P );
@@ -337,7 +337,7 @@ void KStartupInfo::remove_startup_info_internal( const KStartupInfoId& id_P )
}
void KStartupInfo::remove_startup_pids( const KStartupInfoData& data_P )
- { // first find the matching info
+ { // first tqfind the matching info
if( d == NULL )
return;
for( TQMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
@@ -360,11 +360,11 @@ void KStartupInfo::remove_startup_pids( const KStartupInfoId& id_P,
return;
kdFatal( data_P.pids().count() == 0, 172 );
Data* data = NULL;
- if( d->startups.contains( id_P ))
+ if( d->startups.tqcontains( id_P ))
data = &d->startups[ id_P ];
- else if( d->silent_startups.contains( id_P ))
+ else if( d->silent_startups.tqcontains( id_P ))
data = &d->silent_startups[ id_P ];
- else if( d->uninited_startups.contains( id_P ))
+ else if( d->uninited_startups.tqcontains( id_P ))
data = &d->uninited_startups[ id_P ];
else
return;
@@ -381,7 +381,7 @@ bool KStartupInfo::sendStartup( const KStartupInfoId& id_P, const KStartupInfoDa
if( id_P.none())
return false;
KXMessages msgs;
- TQString msg = TQString::fromLatin1( "new: %1 %2" )
+ TQString msg = TQString::tqfromLatin1( "new: %1 %2" )
.arg( id_P.to_text()).arg( data_P.to_text());
msg = check_required_startup_fields( msg, data_P, qt_xscreen());
kdDebug( 172 ) << "sending " << msg << endl;
@@ -394,7 +394,7 @@ bool KStartupInfo::sendStartupX( Display* disp_P, const KStartupInfoId& id_P,
{
if( id_P.none())
return false;
- TQString msg = TQString::fromLatin1( "new: %1 %2" )
+ TQString msg = TQString::tqfromLatin1( "new: %1 %2" )
.arg( id_P.to_text()).arg( data_P.to_text());
msg = check_required_startup_fields( msg, data_P, DefaultScreen( disp_P ));
#ifdef KSTARTUPINFO_ALL_DEBUG
@@ -425,7 +425,7 @@ bool KStartupInfo::sendChange( const KStartupInfoId& id_P, const KStartupInfoDat
if( id_P.none())
return false;
KXMessages msgs;
- TQString msg = TQString::fromLatin1( "change: %1 %2" )
+ TQString msg = TQString::tqfromLatin1( "change: %1 %2" )
.arg( id_P.to_text()).arg( data_P.to_text());
kdDebug( 172 ) << "sending " << msg << endl;
msgs.broadcastMessage( NET_STARTUP_MSG, msg, -1, false );
@@ -437,7 +437,7 @@ bool KStartupInfo::sendChangeX( Display* disp_P, const KStartupInfoId& id_P,
{
if( id_P.none())
return false;
- TQString msg = TQString::fromLatin1( "change: %1 %2" )
+ TQString msg = TQString::tqfromLatin1( "change: %1 %2" )
.arg( id_P.to_text()).arg( data_P.to_text());
#ifdef KSTARTUPINFO_ALL_DEBUG
kdDebug( 172 ) << "sending " << msg << endl;
@@ -450,7 +450,7 @@ bool KStartupInfo::sendFinish( const KStartupInfoId& id_P )
if( id_P.none())
return false;
KXMessages msgs;
- TQString msg = TQString::fromLatin1( "remove: %1" ).arg( id_P.to_text());
+ TQString msg = TQString::tqfromLatin1( "remove: %1" ).arg( id_P.to_text());
kdDebug( 172 ) << "sending " << msg << endl;
msgs.broadcastMessage( NET_STARTUP_MSG, msg, -1, false );
return true;
@@ -460,7 +460,7 @@ bool KStartupInfo::sendFinishX( Display* disp_P, const KStartupInfoId& id_P )
{
if( id_P.none())
return false;
- TQString msg = TQString::fromLatin1( "remove: %1" ).arg( id_P.to_text());
+ TQString msg = TQString::tqfromLatin1( "remove: %1" ).arg( id_P.to_text());
#ifdef KSTARTUPINFO_ALL_DEBUG
kdDebug( 172 ) << "sending " << msg << endl;
#endif
@@ -472,7 +472,7 @@ bool KStartupInfo::sendFinish( const KStartupInfoId& id_P, const KStartupInfoDat
// if( id_P.none()) // id may be none, the pids and hostname matter then
// return false;
KXMessages msgs;
- TQString msg = TQString::fromLatin1( "remove: %1 %2" )
+ TQString msg = TQString::tqfromLatin1( "remove: %1 %2" )
.arg( id_P.to_text()).arg( data_P.to_text());
kdDebug( 172 ) << "sending " << msg << endl;
msgs.broadcastMessage( NET_STARTUP_MSG, msg, -1, false );
@@ -484,7 +484,7 @@ bool KStartupInfo::sendFinishX( Display* disp_P, const KStartupInfoId& id_P,
{
// if( id_P.none()) // id may be none, the pids and hostname matter then
// return false;
- TQString msg = TQString::fromLatin1( "remove: %1 %2" )
+ TQString msg = TQString::tqfromLatin1( "remove: %1 %2" )
.arg( id_P.to_text()).arg( data_P.to_text());
#ifdef KSTARTUPINFO_ALL_DEBUG
kdDebug( 172 ) << "sending " << msg << endl;
@@ -615,7 +615,7 @@ KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupI
kdDebug( 172 ) << "ignore" << endl;
return NoMatch;
}
- return find_id( id, id_O, data_O ) ? Match : NoMatch;
+ return tqfind_id( id, id_O, data_O ) ? Match : NoMatch;
}
#ifdef Q_WS_X11
NETWinInfo info( qt_xdisplay(), w_P, qt_xrootwin(),
@@ -625,7 +625,7 @@ KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupI
{
TQCString hostname = get_window_hostname( w_P );
if( !hostname.isEmpty()
- && find_pid( pid, hostname, id_O, data_O ))
+ && tqfind_pid( pid, hostname, id_O, data_O ))
return Match;
// try XClass matching , this PID stuff sucks :(
}
@@ -636,7 +636,7 @@ KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupI
TQCString res_class = hint.res_class;
XFree( hint.res_name );
XFree( hint.res_class );
- if( find_wclass( res_name, res_class, id_O, data_O ))
+ if( tqfind_wclass( res_name, res_class, id_O, data_O ))
return Match;
}
// ignore NET::Tool and other special window types, if they can't be matched
@@ -661,15 +661,15 @@ KStartupInfo::startup_t KStartupInfo::check_startup_internal( WId w_P, KStartupI
return CantDetect;
}
-bool KStartupInfo::find_id( const TQCString& id_P, KStartupInfoId* id_O,
+bool KStartupInfo::tqfind_id( const TQCString& id_P, KStartupInfoId* id_O,
KStartupInfoData* data_O )
{
if( d == NULL )
return false;
- kdDebug( 172 ) << "find_id:" << id_P << endl;
+ kdDebug( 172 ) << "tqfind_id:" << id_P << endl;
KStartupInfoId id;
id.initId( id_P );
- if( d->startups.contains( id ))
+ if( d->startups.tqcontains( id ))
{
if( id_O != NULL )
*id_O = id;
@@ -681,12 +681,12 @@ 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,
+bool KStartupInfo::tqfind_pid( pid_t pid_P, const TQCString& hostname_P,
KStartupInfoId* id_O, KStartupInfoData* data_O )
{
if( d == NULL )
return false;
- kdDebug( 172 ) << "find_pid:" << pid_P << endl;
+ kdDebug( 172 ) << "tqfind_pid:" << pid_P << endl;
for( TQMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
it != d->startups.end();
++it )
@@ -706,19 +706,19 @@ bool KStartupInfo::find_pid( pid_t pid_P, const TQCString& hostname_P,
return false;
}
-bool KStartupInfo::find_wclass( TQCString res_name, TQCString res_class,
+bool KStartupInfo::tqfind_wclass( TQCString res_name, TQCString res_class,
KStartupInfoId* id_O, KStartupInfoData* 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;
+ kdDebug( 172 ) << "tqfind_wclass:" << res_name << ":" << res_class << endl;
for( TQMap< KStartupInfoId, Data >::Iterator it = d->startups.begin();
it != d->startups.end();
++it )
{
- const TQCString wmclass = ( *it ).findWMClass();
+ const TQCString wmclass = ( *it ).tqfindWMClass();
if( wmclass.lower() == res_name || wmclass.lower() == res_class )
{ // Found it !
if( id_O != NULL )
@@ -941,7 +941,7 @@ TQCString KStartupInfo::createNewStartupId()
#endif
TQCString id = TQString( "%1;%2;%3;%4_TIME%5" ).arg( hostname ).arg( tm.tv_sec )
.arg( tm.tv_usec ).arg( getpid()).arg( qt_x_user_time ).utf8();
- kdDebug( 172 ) << "creating: " << id << ":" << qAppName() << endl;
+ kdDebug( 172 ) << "creating: " << id << ":" << tqAppName() << endl;
return id;
}
@@ -960,14 +960,14 @@ const TQCString& KStartupInfoId::id() const
TQString KStartupInfoId::to_text() const
{
- return TQString::fromLatin1( " ID=\"%1\" " ).arg( escape_str( id()));
+ return TQString::tqfromLatin1( " ID=\"%1\" " ).arg( escape_str( id()));
}
KStartupInfoId::KStartupInfoId( const TQString& txt_P )
{
d = new KStartupInfoIdPrivate;
TQStringList items = get_fields( txt_P );
- const TQString id_str = TQString::fromLatin1( "ID=" );
+ const TQString id_str = TQString::tqfromLatin1( "ID=" );
for( TQStringList::Iterator it = items.begin();
it != items.end();
++it )
@@ -1074,7 +1074,7 @@ unsigned long KStartupInfoId::timestamp() const
{
if( none())
return 0;
- int pos = d->id.findRev( "_TIME" );
+ int pos = d->id.tqfindRev( "_TIME" );
if( pos >= 0 )
{
bool ok;
@@ -1088,10 +1088,10 @@ unsigned long KStartupInfoId::timestamp() const
// snprintf (s, len, "%s/%s/%lu/%d-%d-%s",
// canonicalized_launcher, canonicalized_launchee, (unsigned long) timestamp,
// (int) getpid (), (int) sequence_number, hostbuf);
- int pos1 = d->id.findRev( '/' );
+ int pos1 = d->id.tqfindRev( '/' );
if( pos1 > 0 )
{
- int pos2 = d->id.findRev( '/', pos1 - 1 );
+ int pos2 = d->id.tqfindRev( '/', pos1 - 1 );
if( pos2 >= 0 )
{
bool ok;
@@ -1129,34 +1129,34 @@ TQString KStartupInfoData::to_text() const
{
TQString ret = "";
if( !d->bin.isEmpty())
- ret += TQString::fromLatin1( " BIN=\"%1\"" ).arg( escape_str( d->bin ));
+ ret += TQString::tqfromLatin1( " BIN=\"%1\"" ).arg( escape_str( d->bin ));
if( !d->name.isEmpty())
- ret += TQString::fromLatin1( " NAME=\"%1\"" ).arg( escape_str( d->name ));
+ ret += TQString::tqfromLatin1( " NAME=\"%1\"" ).arg( escape_str( d->name ));
if( !d->description.isEmpty())
- ret += TQString::fromLatin1( " DESCRIPTION=\"%1\"" ).arg( escape_str( d->description ));
+ ret += TQString::tqfromLatin1( " DESCRIPTION=\"%1\"" ).arg( escape_str( d->description ));
if( !d->icon.isEmpty())
- ret += TQString::fromLatin1( " ICON=%1" ).arg( d->icon );
+ ret += TQString::tqfromLatin1( " ICON=%1" ).arg( d->icon );
if( d->desktop != 0 )
- ret += TQString::fromLatin1( " DESKTOP=%1" )
+ ret += TQString::tqfromLatin1( " DESKTOP=%1" )
.arg( d->desktop == NET::OnAllDesktops ? NET::OnAllDesktops : d->desktop - 1 ); // spec counts from 0
if( !d->wmclass.isEmpty())
- ret += TQString::fromLatin1( " WMCLASS=\"%1\"" ).arg( QString(d->wmclass) );
+ ret += TQString::tqfromLatin1( " WMCLASS=\"%1\"" ).arg( QString(d->wmclass) );
if( !d->hostname.isEmpty())
- ret += TQString::fromLatin1( " HOSTNAME=%1" ).arg( QString(d->hostname) );
+ ret += TQString::tqfromLatin1( " HOSTNAME=%1" ).arg( QString(d->hostname) );
for( TQValueList< pid_t >::ConstIterator it = d->pids.begin();
it != d->pids.end();
++it )
- ret += TQString::fromLatin1( " PID=%1" ).arg( *it );
+ ret += TQString::tqfromLatin1( " PID=%1" ).arg( *it );
if( d->silent != Unknown )
- ret += TQString::fromLatin1( " SILENT=%1" ).arg( d->silent == Yes ? 1 : 0 );
+ ret += TQString::tqfromLatin1( " SILENT=%1" ).arg( d->silent == Yes ? 1 : 0 );
if( d->timestamp != -1U )
- ret += TQString::fromLatin1( " TIMESTAMP=%1" ).arg( d->timestamp );
+ ret += TQString::tqfromLatin1( " TIMESTAMP=%1" ).arg( d->timestamp );
if( d->screen != -1 )
- ret += TQString::fromLatin1( " SCREEN=%1" ).arg( d->screen );
+ ret += TQString::tqfromLatin1( " SCREEN=%1" ).arg( d->screen );
if( d->xinerama != -1 )
- ret += TQString::fromLatin1( " XINERAMA=%1" ).arg( d->xinerama );
+ ret += TQString::tqfromLatin1( " XINERAMA=%1" ).arg( d->xinerama );
if( d->launched_by != 0 )
- ret += TQString::fromLatin1( " LAUNCHED_BY=%1" ).arg( d->launched_by );
+ ret += TQString::tqfromLatin1( " LAUNCHED_BY=%1" ).arg( d->launched_by );
return ret;
}
@@ -1164,19 +1164,19 @@ KStartupInfoData::KStartupInfoData( const TQString& txt_P )
{
d = new KStartupInfoDataPrivate;
TQStringList items = get_fields( txt_P );
- const TQString bin_str = TQString::fromLatin1( "BIN=" );
- const TQString name_str = TQString::fromLatin1( "NAME=" );
- const TQString description_str = TQString::fromLatin1( "DESCRIPTION=" );
- const TQString icon_str = TQString::fromLatin1( "ICON=" );
- const TQString desktop_str = TQString::fromLatin1( "DESKTOP=" );
- const TQString wmclass_str = TQString::fromLatin1( "WMCLASS=" );
- const TQString hostname_str = TQString::fromLatin1( "HOSTNAME=" ); // SELI nonstd
- const TQString pid_str = TQString::fromLatin1( "PID=" ); // SELI nonstd
- const TQString silent_str = TQString::fromLatin1( "SILENT=" );
- const TQString timestamp_str = TQString::fromLatin1( "TIMESTAMP=" );
- const TQString screen_str = TQString::fromLatin1( "SCREEN=" );
- const TQString xinerama_str = TQString::fromLatin1( "XINERAMA=" );
- const TQString launched_by_str = TQString::fromLatin1( "LAUNCHED_BY=" );
+ const TQString bin_str = TQString::tqfromLatin1( "BIN=" );
+ const TQString name_str = TQString::tqfromLatin1( "NAME=" );
+ const TQString description_str = TQString::tqfromLatin1( "DESCRIPTION=" );
+ const TQString icon_str = TQString::tqfromLatin1( "ICON=" );
+ const TQString desktop_str = TQString::tqfromLatin1( "DESKTOP=" );
+ const TQString wmclass_str = TQString::tqfromLatin1( "WMCLASS=" );
+ const TQString hostname_str = TQString::tqfromLatin1( "HOSTNAME=" ); // SELI nonstd
+ const TQString pid_str = TQString::tqfromLatin1( "PID=" ); // SELI nonstd
+ const TQString silent_str = TQString::tqfromLatin1( "SILENT=" );
+ const TQString timestamp_str = TQString::tqfromLatin1( "TIMESTAMP=" );
+ const TQString screen_str = TQString::tqfromLatin1( "SCREEN=" );
+ const TQString xinerama_str = TQString::tqfromLatin1( "XINERAMA=" );
+ const TQString launched_by_str = TQString::tqfromLatin1( "LAUNCHED_BY=" );
for( TQStringList::Iterator it = items.begin();
it != items.end();
++it )
@@ -1290,7 +1290,7 @@ const TQString& KStartupInfoData::name() const
return d->name;
}
-const TQString& KStartupInfoData::findName() const
+const TQString& KStartupInfoData::tqfindName() const
{
if( !name().isEmpty())
return name();
@@ -1307,7 +1307,7 @@ const TQString& KStartupInfoData::description() const
return d->description;
}
-const TQString& KStartupInfoData::findDescription() const
+const TQString& KStartupInfoData::tqfindDescription() const
{
if( !description().isEmpty())
return description();
@@ -1319,7 +1319,7 @@ void KStartupInfoData::setIcon( const TQString& icon_P )
d->icon = icon_P;
}
-const TQString& KStartupInfoData::findIcon() const
+const TQString& KStartupInfoData::tqfindIcon() const
{
if( !icon().isEmpty())
return icon();
@@ -1346,7 +1346,7 @@ void KStartupInfoData::setWMClass( const TQCString& wmclass_P )
d->wmclass = wmclass_P;
}
-const TQCString KStartupInfoData::findWMClass() const
+const TQCString KStartupInfoData::tqfindWMClass() const
{
if( !WMClass().isEmpty() && WMClass() != "0" )
return WMClass();
@@ -1379,7 +1379,7 @@ const TQCString& KStartupInfoData::hostname() const
void KStartupInfoData::addPid( pid_t pid_P )
{
- if( !d->pids.contains( pid_P ))
+ if( !d->pids.tqcontains( pid_P ))
d->pids.append( pid_P );
}
@@ -1395,7 +1395,7 @@ const TQValueList< pid_t >& KStartupInfoData::pids() const
bool KStartupInfoData::is_pid( pid_t pid_P ) const
{
- return d->pids.contains( pid_P );
+ return d->pids.tqcontains( pid_P );
}
void KStartupInfoData::setSilent( TriState state_P )
@@ -1451,24 +1451,24 @@ WId KStartupInfoData::launchedBy() const
static
long get_num( const TQString& item_P )
{
- unsigned int pos = item_P.find( '=' );
+ unsigned int pos = item_P.tqfind( '=' );
return item_P.mid( pos + 1 ).toLong();
}
static
unsigned long get_unum( const TQString& item_P )
{
- unsigned int pos = item_P.find( '=' );
+ unsigned int pos = item_P.tqfind( '=' );
return item_P.mid( pos + 1 ).toULong();
}
static
TQString get_str( const TQString& item_P )
{
- unsigned int pos = item_P.find( '=' );
+ unsigned int pos = item_P.tqfind( '=' );
if( item_P.length() > pos + 2 && item_P[ pos + 1 ] == (QChar)'\"' )
{
- int pos2 = item_P.left( pos + 2 ).find( '\"' );
+ int pos2 = item_P.left( pos + 2 ).tqfind( '\"' );
if( pos2 < 0 )
return TQString::null; // 01234
return item_P.mid( pos + 2, pos2 - 2 - pos ); // A="C"