summaryrefslogtreecommitdiffstats
path: root/kdmlib
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-19 01:42:14 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-19 01:42:14 +0000
commit8155225c9be993acc0512956416d195edfef4eb9 (patch)
treede4f3cd17614fc67e47eefabcdbe2fbe170c9be7 /kdmlib
parent364641b8e0279758d236af39abd138d379328a19 (diff)
downloadtdebase-8155225c9be993acc0512956416d195edfef4eb9.tar.gz
tdebase-8155225c9be993acc0512956416d195edfef4eb9.zip
Enable compilation with TQt for Qt4 3.4.0 TP2
This should not break compatibility with TQt for Qt3; if it does please fix it ASAP! git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1215552 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdmlib')
-rw-r--r--kdmlib/dmctl.cpp36
-rw-r--r--kdmlib/kgreet_classic.cpp13
-rw-r--r--kdmlib/kgreet_pam.cpp62
-rw-r--r--kdmlib/kgreet_pam.h4
-rw-r--r--kdmlib/kgreet_winbind.cpp21
5 files changed, 69 insertions, 67 deletions
diff --git a/kdmlib/dmctl.cpp b/kdmlib/dmctl.cpp
index 58d4f8379..63e323fdc 100644
--- a/kdmlib/dmctl.cpp
+++ b/kdmlib/dmctl.cpp
@@ -91,7 +91,7 @@ DM::DM() : fd( -1 )
case OldKDM:
{
TQString tf( ctl );
- tf.truncate( tf.find( ',' ) );
+ tf.truncate( tf.tqfind( ',' ) );
fd = ::open( tf.latin1(), O_WRONLY );
}
break;
@@ -178,9 +178,9 @@ DM::canShutdown()
TQCString re;
if (DMType == GDM)
- return exec( "QUERY_LOGOUT_ACTION\n", re ) && re.find("HALT") >= 0;
+ return exec( "QUERY_LOGOUT_ACTION\n", re ) && re.tqfind("HALT") >= 0;
- return exec( "caps\n", re ) && re.find( "\tshutdown" ) >= 0;
+ return exec( "caps\n", re ) && re.tqfind( "\tshutdown" ) >= 0;
}
void
@@ -194,7 +194,7 @@ DM::shutdown( KApplication::ShutdownType shutdownType,
bool cap_ask;
if (DMType == NewKDM) {
TQCString re;
- cap_ask = exec( "caps\n", re ) && re.find( "\tshutdown ask" ) >= 0;
+ cap_ask = exec( "caps\n", re ) && re.tqfind( "\tshutdown ask" ) >= 0;
} else {
if (!bootOption.isEmpty())
return;
@@ -249,7 +249,7 @@ DM::bootOptions( TQStringList &opts, int &defopt, int &current )
opts = TQStringList::split( ' ', opts[1] );
for (TQStringList::Iterator it = opts.begin(); it != opts.end(); ++it)
- (*it).replace( "\\s", " " );
+ (*it).tqreplace( "\\s", " " );
return true;
}
@@ -272,7 +272,7 @@ DM::isSwitchable()
TQCString re;
- return exec( "caps\n", re ) && re.find( "\tlocal" ) >= 0;
+ return exec( "caps\n", re ) && re.tqfind( "\tlocal" ) >= 0;
}
int
@@ -287,7 +287,7 @@ DM::numReserve()
TQCString re;
int p;
- if (!(exec( "caps\n", re ) && (p = re.find( "\treserve " )) >= 0))
+ if (!(exec( "caps\n", re ) && (p = re.tqfind( "\treserve " )) >= 0))
return -1;
return atoi( re.data() + p + 9 );
}
@@ -338,8 +338,8 @@ DM::localSessions( SessList &list )
se.vt = ts[1].mid( 2 ).toInt();
se.user = ts[2];
se.session = ts[3];
- se.self = (ts[4].find( '*' ) >= 0);
- se.tty = (ts[4].find( 't' ) >= 0);
+ se.self = (ts[4].tqfind( '*' ) >= 0);
+ se.tty = (ts[4].tqfind( 't' ) >= 0);
list.append( se );
}
}
@@ -351,7 +351,7 @@ DM::sess2Str2( const SessEnt &se, TQString &user, TQString &loc )
{
if (se.tty) {
user = i18n("user: ...", "%1: TTY login").arg( se.user );
- loc = se.vt ? TQString("vt%1").arg( se.vt ) : se.display ;
+ loc = se.vt ? TQString(TQString("vt%1").arg( se.vt )) : se.display ;
} else {
user =
se.user.isEmpty() ?
@@ -359,19 +359,19 @@ DM::sess2Str2( const SessEnt &se, TQString &user, TQString &loc )
i18n("Unused") :
se.session == "<remote>" ?
i18n("X login on remote host") :
- i18n("... host", "X login on %1").arg( se.session ) :
+ TQString(i18n("... host", "X login on %1").arg( se.session )) :
se.session == "<unknown>" ?
se.user :
- i18n("user: session type", "%1: %2")
- .arg( se.user ).arg( se.session );
+ TQString(i18n("user: session type", "%1: %2")
+ .arg( se.user ).arg( se.session ));
loc =
se.vt ?
- TQString("%1, vt%2").arg( se.display ).arg( se.vt ) :
+ TQString(TQString("%1, vt%2").arg( se.display ).arg( se.vt )) :
se.display;
}
}
-QString
+TQString
DM::sess2Str( const SessEnt &se )
{
TQString user, loc;
@@ -384,16 +384,16 @@ bool
DM::switchVT( int vt )
{
if (DMType == GDM)
- return exec( TQString("SET_VT %1\n").arg(vt).latin1() );
+ return exec( TQString(TQString("SET_VT %1\n").arg(vt)).latin1() );
- return exec( TQString("activate\tvt%1\n").arg(vt).latin1() );
+ return exec( TQString(TQString("activate\tvt%1\n").arg(vt)).latin1() );
}
void
DM::lockSwitchVT( int vt )
{
if (switchVT( vt ))
- kapp->dcopClient()->send( "kdesktop", "KScreensaverIface", "lock()", "" );
+ kapp->dcopClient()->send( "kdesktop", "KScreensaverIface", "lock()", TQString("") );
}
void
diff --git a/kdmlib/kgreet_classic.cpp b/kdmlib/kgreet_classic.cpp
index fd2e65bd8..def8882c1 100644
--- a/kdmlib/kgreet_classic.cpp
+++ b/kdmlib/kgreet_classic.cpp
@@ -71,7 +71,8 @@ KClassicGreeter::KClassicGreeter( KGreeterPluginHandler *_handler,
themer = 0;
if (!themer)
- layoutItem = grid = new TQGridLayout( 0, 0, 10 );
+ grid = new TQGridLayout( 0, 0, 10 );
+ layoutItem = TQT_TQLAYOUTITEM(grid);
loginLabel = passwdLabel = passwd1Label = passwd2Label = 0;
loginEdit = 0;
@@ -166,7 +167,7 @@ KClassicGreeter::~KClassicGreeter()
delete passwdEdit;
return;
}
- TQLayoutIterator it = static_cast<TQLayout *>(layoutItem)->iterator();
+ TQLayoutIterator it = TQT_TQLAYOUT(static_cast<QLayoutItem*>(layoutItem))->iterator();
for (TQLayoutItem *itm = it.current(); itm; itm = ++it)
delete itm->widget();
delete layoutItem;
@@ -259,7 +260,7 @@ bool // virtual
KClassicGreeter::textMessage( const char *text, bool err )
{
if (!err &&
- TQString( text ).find( TQRegExp( "^Changing password for [^ ]+$" ) ) >= 0)
+ TQString( text ).tqfind( TQRegExp( "^Changing password for [^ ]+$" ) ) >= 0)
return true;
return false;
}
@@ -274,11 +275,11 @@ KClassicGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking )
exp = 1;
else {
TQString pr( prompt );
- if (pr.find( TQRegExp( "\\bpassword\\b", false ) ) >= 0) {
- if (pr.find( TQRegExp( "\\b(re-?(enter|type)|again|confirm|repeat)\\b",
+ if (pr.tqfind( TQRegExp( "\\bpassword\\b", false ) ) >= 0) {
+ if (pr.tqfind( TQRegExp( "\\b(re-?(enter|type)|again|confirm|repeat)\\b",
false ) ) >= 0)
exp = 3;
- else if (pr.find( TQRegExp( "\\bnew\\b", false ) ) >= 0)
+ else if (pr.tqfind( TQRegExp( "\\bnew\\b", false ) ) >= 0)
exp = 2;
else { // TQRegExp( "\\b(old|current)\\b", false ) is too strict
handler->gplugReturnText( "",
diff --git a/kdmlib/kgreet_pam.cpp b/kdmlib/kgreet_pam.cpp
index b43952488..38556cc7a 100644
--- a/kdmlib/kgreet_pam.cpp
+++ b/kdmlib/kgreet_pam.cpp
@@ -56,7 +56,7 @@ protected:
};
static FILE* log;
-static void debug(const char* fmt, ...)
+static void kg_debug(const char* fmt, ...)
{
va_list lst;
va_start(lst, fmt);
@@ -92,9 +92,9 @@ KPamGreeter::KPamGreeter( KGreeterPluginHandler *_handler,
{
ctx = Login;
- debug("KPamGreeter constructed\n");
+ kg_debug("KPamGreeter constructed\n");
- m_parentWidget = parent;
+ m_tqparentWidget = parent;
KdmItem *user_entry = 0, *pw_entry = 0;
int line = 0;
@@ -109,7 +109,7 @@ KPamGreeter::KPamGreeter( KGreeterPluginHandler *_handler,
m_themer = themer;
if (!themer)
- layoutItem = new TQGridLayout( 0, 0, 10 );
+ layoutItem = TQT_TQLAYOUTITEM(new TQGridLayout( 0, 0, 10 ));
loginLabel = 0;
authLabel.clear();
@@ -119,8 +119,8 @@ KPamGreeter::KPamGreeter( KGreeterPluginHandler *_handler,
if (ctx == ExUnlock || ctx == ExChangeTok)
fixedUser = KUser().loginName();
if (func != ChAuthTok) {
- debug("func != ChAuthTok\n");
- debug("fixedUser: *%s*\n", fixedUser.latin1());
+ kg_debug("func != ChAuthTok\n");
+ kg_debug("fixedUser: *%s*\n", fixedUser.latin1());
if (fixedUser.isEmpty()) {
loginEdit = new KLineEdit( parent );
@@ -203,17 +203,17 @@ KPamGreeter::KPamGreeter( KGreeterPluginHandler *_handler,
// virtual
KPamGreeter::~KPamGreeter()
{
- debug("KPamGreeter::~KPamGreeter");
+ kg_debug("KPamGreeter::~KPamGreeter");
abort();
if (!layoutItem) {
delete loginEdit;
return;
}
- TQLayoutIterator it = static_cast<TQLayout *>(layoutItem)->iterator();
+ TQLayoutIterator it = TQT_TQLAYOUT(static_cast<QLayoutItem*>(layoutItem))->iterator();
for (TQLayoutItem *itm = it.current(); itm; itm = ++it)
delete itm->widget();
delete layoutItem;
- debug("destructor finished, good bye");
+ kg_debug("destructor finished, good bye");
}
void // virtual
@@ -229,7 +229,7 @@ KPamGreeter::loadUsers( const TQStringList &users )
void // virtual
KPamGreeter::presetEntity( const TQString &entity, int field )
{
- debug("presetEntity(%s,%d) called!\n", entity.latin1(), field);
+ kg_debug("presetEntity(%s,%d) called!\n", entity.latin1(), field);
loginEdit->setText( entity );
if (field == 1 && authEdit.size() >= 1)
authEdit[0]->setFocus();
@@ -279,7 +279,7 @@ KPamGreeter::setEnabled(bool enable)
void // private
KPamGreeter::returnData()
{
- debug("*************** returnData called with exp %d\n", exp);
+ kg_debug("*************** returnData called with exp %d\n", exp);
switch (exp) {
@@ -308,13 +308,13 @@ KPamGreeter::returnData()
bool // virtual
KPamGreeter::textMessage( const char *text, bool err )
{
- debug(" ************** textMessage(%s, %d)\n", text, err);
+ kg_debug(" ************** textMessage(%s, %d)\n", text, err);
if (!authEdit.size())
return false;
if (getLayoutItem()) {
- TQLabel* label = new TQLabel(TQString::fromUtf8(text), m_parentWidget);
+ TQLabel* label = new TQLabel(TQString::fromUtf8(text), m_tqparentWidget);
getLayoutItem()->addWidget(label, state+1, 0, 0);
}
@@ -324,8 +324,8 @@ KPamGreeter::textMessage( const char *text, bool err )
void // virtual
KPamGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking )
{
- debug("textPrompt called with prompt %s echo %d nonBlocking %d", prompt, echo, nonBlocking);
- debug("state is %d, authEdit.size is %d\n", state, authEdit.size());
+ kg_debug("textPrompt called with prompt %s echo %d nonBlocking %d", prompt, echo, nonBlocking);
+ kg_debug("state is %d, authEdit.size is %d\n", state, authEdit.size());
if (state == 0 && echo) {
if (loginLabel)
@@ -341,12 +341,12 @@ KPamGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking )
}
else if (state >= authEdit.size()) {
if (getLayoutItem()) {
- TQLabel* label = new TQLabel(TQString::fromUtf8(prompt), m_parentWidget);
+ TQLabel* label = new TQLabel(TQString::fromUtf8(prompt), m_tqparentWidget);
getLayoutItem()->addWidget(label, state+1, 0, 0);
- debug("added label widget to layout");
+ kg_debug("added label widget to layout");
}
else if (m_themer) {
- debug("themer found!");
+ kg_debug("themer found!");
KdmItem *pw_label = 0;
KdmLabel *kdmlabel = static_cast<KdmLabel*>(m_themer->findNode("pw-label"));
@@ -361,9 +361,9 @@ KPamGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking )
KDMPasswordEdit* passwdEdit;
if (echoMode == -1)
- passwdEdit = new KDMPasswordEdit( m_parentWidget );
+ passwdEdit = new KDMPasswordEdit( m_tqparentWidget );
else
- passwdEdit = new KDMPasswordEdit( echoMode, m_parentWidget);
+ passwdEdit = new KDMPasswordEdit( echoMode, m_tqparentWidget);
connect( passwdEdit, TQT_SIGNAL(textChanged( const TQString & )),
TQT_SLOT(slotActivity()) );
connect( passwdEdit, TQT_SIGNAL(lostFocus()), TQT_SLOT(slotActivity()) );
@@ -383,7 +383,7 @@ KPamGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking )
getLayoutItem()->addWidget(passwdEdit, state+1, 1, 0);
if (m_themer) {
- debug("themer found!");
+ kg_debug("themer found!");
KdmItem *pw_entry = 0;
pw_entry = m_themer->findNode("pw-entry");
@@ -398,13 +398,13 @@ KPamGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking )
}
}
else
- debug("no themer found!");
+ kg_debug("no themer found!");
}
++state;
pExp = exp;
exp = authEdit.size();
- debug("state %d exp: %d, has %d\n", state, exp, has);
+ kg_debug("state %d exp: %d, has %d\n", state, exp, has);
if (has >= exp || nonBlocking)
returnData();
@@ -420,7 +420,7 @@ KPamGreeter::binaryPrompt( const char *, bool )
void // virtual
KPamGreeter::start()
{
- debug("******* start() called\n");
+ kg_debug("******* start() called\n");
while(authEdit.begin() != authEdit.end()) {
KPasswordEdit* item = *authEdit.remove(authEdit.begin());
@@ -452,10 +452,10 @@ KPamGreeter::resume()
void // virtual
KPamGreeter::next()
{
- debug("********* next() called state %d\n", state);
+ kg_debug("********* next() called state %d\n", state);
if (state == 0 && running && handler) {
- debug(" **** returned text!\n");
+ kg_debug(" **** returned text!\n");
handler->gplugReturnText( (loginEdit ? loginEdit->text() :
fixedUser).local8Bit(),
KGreeterPluginHandler::IsUser );
@@ -479,7 +479,7 @@ KPamGreeter::next()
has = -1;
}
- debug(" has %d and exp %d\n", has, exp);
+ kg_debug(" has %d and exp %d\n", has, exp);
#if 0
// assert( running );
@@ -508,7 +508,7 @@ KPamGreeter::next()
void // virtual
KPamGreeter::abort()
{
- debug("***** abort() called\n");
+ kg_debug("***** abort() called\n");
running = false;
if (exp >= 0) {
@@ -520,7 +520,7 @@ KPamGreeter::abort()
void // virtual
KPamGreeter::succeeded()
{
- debug("**** succeeded() called\n");
+ kg_debug("**** succeeded() called\n");
// assert( running || timed_login );
if (!authTok)
@@ -617,14 +617,14 @@ KPamGreeter::slotLoginLostFocus()
handler->gplugReturnText( 0, 0 );
}
curUser = loginEdit->text();
- debug("curUser is %s", curUser.latin1());
+ kg_debug("curUser is %s", curUser.latin1());
handler->gplugSetUser( curUser );
}
void
KPamGreeter::slotActivity()
{
- debug("slotActivity");
+ kg_debug("slotActivity");
if (running)
handler->gplugActivity();
diff --git a/kdmlib/kgreet_pam.h b/kdmlib/kgreet_pam.h
index f0bea7d02..b531adee7 100644
--- a/kdmlib/kgreet_pam.h
+++ b/kdmlib/kgreet_pam.h
@@ -64,7 +64,7 @@ class KPamGreeter : public TQObject, public KGreeterPlugin {
virtual void revive();
virtual void clear();
- TQGridLayout *getLayoutItem() const { return static_cast<TQGridLayout*>(layoutItem); }
+ TQGridLayout *getLayoutItem() const { return TQT_TQGRIDLAYOUT(static_cast<QLayoutItem*>(layoutItem)); }
public slots:
void slotLoginLostFocus();
@@ -78,7 +78,7 @@ class KPamGreeter : public TQObject, public KGreeterPlugin {
TQLabel *loginLabel;
TQValueList<TQLabel*> authLabel;
KLineEdit *loginEdit;
- TQWidget* m_parentWidget;
+ TQWidget* m_tqparentWidget;
TQValueList<KPasswordEdit*> authEdit;
KSimpleConfig *stsFile;
KdmThemer *m_themer;
diff --git a/kdmlib/kgreet_winbind.cpp b/kdmlib/kgreet_winbind.cpp
index 5f6530707..edb38ad1d 100644
--- a/kdmlib/kgreet_winbind.cpp
+++ b/kdmlib/kgreet_winbind.cpp
@@ -56,7 +56,7 @@ static TQString defaultDomain;
static void
splitEntity( const TQString &ent, TQString &dom, TQString &usr )
{
- int pos = ent.find( separator );
+ int pos = ent.tqfind( separator );
if (pos < 0)
dom = "<local>", usr = ent;
else
@@ -89,7 +89,8 @@ KWinbindGreeter::KWinbindGreeter( KGreeterPluginHandler *_handler,
themer = 0;
if (!themer)
- layoutItem = grid = new TQGridLayout( 0, 0, 10 );
+ grid = new TQGridLayout( 0, 0, 10 );
+ layoutItem = TQT_TQLAYOUTITEM(grid);
domainLabel = loginLabel = passwdLabel = passwd1Label = passwd2Label = 0;
domainCombo = 0;
@@ -212,7 +213,7 @@ KWinbindGreeter::~KWinbindGreeter()
delete domainCombo;
return;
}
- TQLayoutIterator it = static_cast<TQLayout *>(layoutItem)->iterator();
+ TQLayoutIterator it = TQT_TQLAYOUT(static_cast<QLayoutItem *>(layoutItem))->iterator();
for (TQLayoutItem *itm = it.current(); itm; itm = ++it)
delete itm->widget();
delete layoutItem;
@@ -227,7 +228,7 @@ KWinbindGreeter::slotChangedDomain( const TQString &dom )
TQStringList users;
if (dom == "<local>") {
for (TQStringList::ConstIterator it = allUsers.begin(); it != allUsers.end(); ++it)
- if ((*it).find( separator ) < 0)
+ if ((*it).tqfind( separator ) < 0)
users << *it;
} else {
TQString st( dom + separator );
@@ -340,7 +341,7 @@ bool // virtual
KWinbindGreeter::textMessage( const char *text, bool err )
{
if (!err &&
- TQString( text ).find( TQRegExp( "^Changing password for [^ ]+$" ) ) >= 0)
+ TQString( text ).tqfind( TQRegExp( "^Changing password for [^ ]+$" ) ) >= 0)
return true;
return false;
}
@@ -355,15 +356,15 @@ KWinbindGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking )
exp = 1;
else {
TQString pr( prompt );
- if (pr.find( TQRegExp( "\\b(old|current)\\b", false ) ) >= 0) {
+ if (pr.tqfind( TQRegExp( "\\b(old|current)\\b", false ) ) >= 0) {
handler->gplugReturnText( "",
KGreeterPluginHandler::IsOldPassword |
KGreeterPluginHandler::IsSecret );
return;
- } else if (pr.find( TQRegExp( "\\b(re-?(enter|type)|again|confirm|repeat)\\b",
+ } else if (pr.tqfind( TQRegExp( "\\b(re-?(enter|type)|again|confirm|repeat)\\b",
false ) ) >= 0)
exp = 3;
- else if (pr.find( TQRegExp( "\\bnew\\b", false ) ) >= 0)
+ else if (pr.tqfind( TQRegExp( "\\bnew\\b", false ) ) >= 0)
exp = 2;
else {
handler->gplugMsgBox( TQMessageBox::Critical,
@@ -593,7 +594,7 @@ KWinbindGreeter::slotEndDomainList()
for (TQStringList::const_iterator it = mDomainListing.begin();
it != mDomainListing.end(); ++it) {
- if (!domainList.contains(*it))
+ if (!domainList.tqcontains(*it))
domainList.append(*it);
}
@@ -625,7 +626,7 @@ static bool init( const TQString &,
{
echoMode = getConf( ctx, "EchoMode", TQVariant( -1 ) ).toInt();
staticDomains = TQStringList::split( ':', getConf( ctx, "winbind.Domains", TQVariant( "" ) ).toString() );
- if (!staticDomains.contains("<local>"))
+ if (!staticDomains.tqcontains("<local>"))
staticDomains << "<local>";
defaultDomain = getConf( ctx, "winbind.DefaultDomain", TQVariant( staticDomains.first() ) ).toString();