From 8b79083f967ee6de83a04c02a40d6c20d9a980d4 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Thu, 29 Apr 2021 10:45:28 +0900 Subject: Fixed FTBFS when building tdelibs/tdebase without tdehw. Signed-off-by: Michele Calgaro --- tdm/kfrontend/kgreeter.cpp | 20 ++++++++++++++------ tdm/kfrontend/kgverify.cpp | 14 ++++++++++++-- tdm/kfrontend/kgverify.h | 4 ++++ tdm/kfrontend/sakdlg.cpp | 9 ++++++++- 4 files changed, 38 insertions(+), 9 deletions(-) (limited to 'tdm/kfrontend') diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp index cd61aa857..27905e61d 100644 --- a/tdm/kfrontend/kgreeter.cpp +++ b/tdm/kfrontend/kgreeter.cpp @@ -35,10 +35,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include +#ifdef __TDE_HAVE_TDEHWLIB #include - #include #include +#endif #include #include @@ -246,6 +247,7 @@ KGreeter::~KGreeter() void KGreeter::cryptographicCardWatcherSetup() { cardLoginUser = TQString::null; +#ifdef __TDE_HAVE_TDEHWLIB // Initialize SmartCard readers TDEGenericDevice *hwdevice; TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); @@ -256,6 +258,7 @@ void KGreeter::cryptographicCardWatcherSetup() { connect(cdevice, TQT_SIGNAL(cardRemoved(TDECryptographicCardDevice*)), this, TQT_SLOT(cryptographicCardRemoved(TDECryptographicCardDevice*))); cdevice->enableCardMonitoring(true); } +#endif } void KGreeter::done(int r) { @@ -858,7 +861,11 @@ KGreeter::verifySetUser( const TQString &user ) } void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) { -#ifdef HAVE_KRB5 +#ifdef __TDE_HAVE_TDEHWLIB +#ifndef HAVE_KRB5 + // Don't enable card-based logins if Kerberos integration was disabled + return; +#endif // Make sure card logins are enabled before attempting one KSimpleConfig *systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" )); systemconfig->setGroup(NULL); @@ -868,10 +875,6 @@ void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) { { return; } -#else - // Don't enable card-based logins if Kerberos integration was disabled - return; -#endif TQString login_name = TQString::null; X509CertificatePtrList certList = cdevice->cardX509Certificates(); @@ -938,9 +941,11 @@ void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) { verify->accept(); } } +#endif } void KGreeter::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) { +#ifdef __TDE_HAVE_TDEHWLIB cardLoginUser = TQString::null; userView->setEnabled(false); verify->lockUserEntry(false); @@ -952,6 +957,7 @@ void KGreeter::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) { verify->cardLoginInProgress = false; verify->cardLoginDevice = NULL; +#endif } KStdGreeter::KStdGreeter() @@ -1332,9 +1338,11 @@ KThemedGreeter::updateStatus( bool fail, bool caps, int timedleft ) } } +#ifdef __TDE_HAVE_TDEHWLIB if (cardLoginUser != TQString::null) { verify->setPasswordPrompt(i18n("PIN:")); } +#endif } void diff --git a/tdm/kfrontend/kgverify.cpp b/tdm/kfrontend/kgverify.cpp index 93bcce27a..d3b0a71b8 100644 --- a/tdm/kfrontend/kgverify.cpp +++ b/tdm/kfrontend/kgverify.cpp @@ -32,10 +32,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "themer/tdmitem.h" #include "themer/tdmlabel.h" -#include +#ifdef __TDE_HAVE_TDEHWLIB +#include #include #include +#endif #include #include @@ -98,8 +100,10 @@ KGVerify::KGVerify(KGVerifyHandler *_handler, KdmThemer *_themer, , isClear(true) , inGreeterPlugin(false) , abortRequested(false) +#ifdef __TDE_HAVE_TDEHWLIB , cardLoginInProgress(false) , cardLoginDevice(NULL) +#endif { connect( &timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()) ); connect( kapp, TQT_SIGNAL(activity()), TQT_SLOT(slotActivity()) ); @@ -324,7 +328,11 @@ KGVerify::start() _autoLoginDelay = 0, timeable = false; return; } - else if (!cardLoginInProgress) { + else +#ifdef __TDE_HAVE_TDEHWLIB + if (!cardLoginInProgress) +#endif + { applyPreset(); } } @@ -664,6 +672,7 @@ KGVerify::handleVerify() greet->textPrompt(msg, echo, ndelay); inGreeterPlugin = !ndelay; +#ifdef __TDE_HAVE_TDEHWLIB if (cardLoginInProgress) { TQString autoPIN = cardLoginDevice->autoPIN(); if (autoPIN != TQString::null) { @@ -673,6 +682,7 @@ KGVerify::handleVerify() } cardLoginInProgress = false; } +#endif } else { inGreeterPlugin = true; diff --git a/tdm/kfrontend/kgverify.h b/tdm/kfrontend/kgverify.h index 9935459be..b76cf55f1 100644 --- a/tdm/kfrontend/kgverify.h +++ b/tdm/kfrontend/kgverify.h @@ -77,7 +77,9 @@ class TQPopupMenu; class TQTimer; class KPushButton; class KLibrary; +#ifdef __TDE_HAVE_TDEHWLIB class TDECryptographicCardDevice; +#endif struct GreeterPluginHandle { KLibrary *library; @@ -182,8 +184,10 @@ class KGVerify : public TQObject, public KGreeterPluginHandler { static TQVariant getConf( void *ctx, const char *key, const TQVariant &dflt ); +#ifdef __TDE_HAVE_TDEHWLIB bool cardLoginInProgress; TDECryptographicCardDevice* cardLoginDevice; +#endif }; class KGStdVerify : public KGVerify { diff --git a/tdm/kfrontend/sakdlg.cpp b/tdm/kfrontend/sakdlg.cpp index 3758a4719..52bffc47e 100644 --- a/tdm/kfrontend/sakdlg.cpp +++ b/tdm/kfrontend/sakdlg.cpp @@ -10,10 +10,11 @@ #include +#ifdef __TDE_HAVE_TDEHWLIB #include - #include #include +#endif #include #include @@ -135,6 +136,7 @@ SAKDlg::SAKDlg(TQWidget *parent) connect(mSAKProcess, TQT_SIGNAL(processExited(TDEProcess*)), this, TQT_SLOT(slotSAKProcessExited())); mSAKProcess->start(); +#ifdef __TDE_HAVE_TDEHWLIB // Initialize SmartCard readers TDEGenericDevice *hwdevice; TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); @@ -145,6 +147,7 @@ SAKDlg::SAKDlg(TQWidget *parent) connect(cdevice, TQT_SIGNAL(cardRemoved(TDECryptographicCardDevice*)), this, TQT_SLOT(cryptographicCardRemoved(TDECryptographicCardDevice*))); cdevice->enableCardMonitoring(true); } +#endif mControlPipeHandlerThread = new TQEventLoopThread(); mControlPipeHandler = new ControlPipeHandlerObject(); @@ -172,6 +175,7 @@ void SAKDlg::processInputPipeCommand(TQString command) { } void SAKDlg::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) { +#ifdef __TDE_HAVE_TDEHWLIB TQString login_name = TQString::null; X509CertificatePtrList certList = cdevice->cardX509Certificates(); if (certList.count() > 0) { @@ -213,10 +217,13 @@ void SAKDlg::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) { closeDialogForced(); } } +#endif } void SAKDlg::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) { +#ifdef __TDE_HAVE_TDEHWLIB // +#endif } SAKDlg::~SAKDlg() -- cgit v1.2.3