summaryrefslogtreecommitdiffstats
path: root/tdm/kfrontend
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-04-29 10:45:28 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-05-02 12:19:09 +0900
commit8b79083f967ee6de83a04c02a40d6c20d9a980d4 (patch)
tree82ccdc1150984858a5355e42508c760dd25c4d1a /tdm/kfrontend
parentdcce5a276f9d10310f4724d902dd883a933788ac (diff)
downloadtdebase-8b79083f967ee6de83a04c02a40d6c20d9a980d4.tar.gz
tdebase-8b79083f967ee6de83a04c02a40d6c20d9a980d4.zip
Fixed FTBFS when building tdelibs/tdebase without tdehw.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdm/kfrontend')
-rw-r--r--tdm/kfrontend/kgreeter.cpp20
-rw-r--r--tdm/kfrontend/kgverify.cpp14
-rw-r--r--tdm/kfrontend/kgverify.h4
-rw-r--r--tdm/kfrontend/sakdlg.cpp9
4 files changed, 38 insertions, 9 deletions
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 <dmctl.h>
+#ifdef __TDE_HAVE_TDEHWLIB
#include <ksslcertificate.h>
-
#include <tdehardwaredevices.h>
#include <tdecryptographiccarddevice.h>
+#endif
#include <tdeapplication.h>
#include <tdelocale.h>
@@ -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 <ksslcertificate.h>
+#ifdef __TDE_HAVE_TDEHWLIB
+#include <ksslcertificate.h>
#include <tdehardwaredevices.h>
#include <tdecryptographiccarddevice.h>
+#endif
#include <tdeapplication.h>
#include <tdelocale.h>
@@ -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 <dmctl.h>
+#ifdef __TDE_HAVE_TDEHWLIB
#include <ksslcertificate.h>
-
#include <tdehardwaredevices.h>
#include <tdecryptographiccarddevice.h>
+#endif
#include <tdeapplication.h>
#include <tdelocale.h>
@@ -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()