summaryrefslogtreecommitdiffstats
path: root/tdm/kfrontend/kgreeter.h
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-06 16:57:38 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-06 16:57:38 -0500
commitaa0b92c035cc0b060af4bfa9e512792884ac2dc1 (patch)
tree96e80cd34541655b82c0a616506334c5b2fab51c /tdm/kfrontend/kgreeter.h
parent091b1eface0a6172927a481c8d7e4030f3d2d0b9 (diff)
downloadtdebase-aa0b92c035cc0b060af4bfa9e512792884ac2dc1.tar.gz
tdebase-aa0b92c035cc0b060af4bfa9e512792884ac2dc1.zip
Use threading and select instead of busywaiting on TDM control socket
This partially resolves Bug 690 Clean up TDM logfile
Diffstat (limited to 'tdm/kfrontend/kgreeter.h')
-rw-r--r--tdm/kfrontend/kgreeter.h41
1 files changed, 38 insertions, 3 deletions
diff --git a/tdm/kfrontend/kgreeter.h b/tdm/kfrontend/kgreeter.h
index 951ea7d3a..7d1c1bc6f 100644
--- a/tdm/kfrontend/kgreeter.h
+++ b/tdm/kfrontend/kgreeter.h
@@ -26,6 +26,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef KGREETER_H
#define KGREETER_H
+#include <tqthread.h>
+
#include "kgverify.h"
#include "kgdialog.h"
@@ -41,6 +43,8 @@ class TQLabel;
class TQPushButton;
class TQPopupMenu;
class TQListViewItem;
+class KGreeter;
+class SAKDlg;
struct SessType {
TQString name, type;
@@ -57,6 +61,35 @@ struct SessType {
}
};
+//===========================================================================
+//
+// TDM control pipe handler
+//
+class ControlPipeHandlerObject : public TQObject
+{
+ Q_OBJECT
+
+ public:
+ ControlPipeHandlerObject();
+ ~ControlPipeHandlerObject();
+
+ public slots:
+ void run();
+
+ signals:
+ void processCommand(TQString);
+
+ public:
+ KGreeter* mKGreeterParent;
+ SAKDlg* mSAKDlgParent;
+ TQString mPipeFilename;
+ int mPipe_fd;
+};
+
+//===========================================================================
+//
+// TDM greeter
+//
class KGreeter : public KGDialog, public KGVerifyHandler {
Q_OBJECT
typedef KGDialog inherited;
@@ -72,7 +105,7 @@ class KGreeter : public KGDialog, public KGVerifyHandler {
void slotUserClicked( TQListViewItem * );
void slotSessionSelected( int );
void slotUserEntered();
- void handleInputPipe();
+ void processInputPipeCommand(TQString command);
public:
TQString curUser, curWMSession, dName;
@@ -107,8 +140,8 @@ class KGreeter : public KGDialog, public KGVerifyHandler {
void slotLoadPrevWM();
private:
- int mPipe_fd;
- TQString mPipeFilename;
+ ControlPipeHandlerObject* mControlPipeHandler;
+ TQEventLoopThread* mControlPipeHandlerThread;
protected:
bool closingDown;
@@ -120,6 +153,8 @@ class KGreeter : public KGDialog, public KGVerifyHandler {
virtual void verifyFailed();
// virtual void verifyRetry();
virtual void verifySetUser( const TQString &user );
+
+ friend class ControlPipeHandlerObject;
};
class KStdGreeter : public KGreeter {