From 1eb5bc816598318458e3a6459663af103a46094b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 18 Jul 2013 10:22:48 -0500 Subject: Beautify logout process --- tdmlib/dmctl.cpp | 10 ++++++++-- tdmlib/dmctl.h | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'tdmlib') diff --git a/tdmlib/dmctl.cpp b/tdmlib/dmctl.cpp index cd970c5e6..9cf7e9d34 100644 --- a/tdmlib/dmctl.cpp +++ b/tdmlib/dmctl.cpp @@ -37,7 +37,7 @@ #include #include -static enum { Dunno, NoDM, NewTDM, OldTDM, GDM } DMType = Dunno; +static int DMType = DM::Unknown; static const char *ctl, *dpy; DM::DM() : fd( -1 ) @@ -45,7 +45,7 @@ DM::DM() : fd( -1 ) char *ptr; struct sockaddr_un sa; - if (DMType == Dunno) { + if (DMType == Unknown) { if (!(dpy = ::getenv( "DISPLAY" ))) DMType = NoDM; else if ((ctl = ::getenv( "DM_CONTROL" ))) @@ -439,4 +439,10 @@ DM::GDMAuthenticate() fclose (fp); } +int +DM::type() +{ + return DMType; +} + #endif // Q_WS_X11 diff --git a/tdmlib/dmctl.h b/tdmlib/dmctl.h index 4fdb8fb5b..376a9ddd7 100644 --- a/tdmlib/dmctl.h +++ b/tdmlib/dmctl.h @@ -39,6 +39,8 @@ public: DM(); ~DM(); + enum { Unknown, NoDM, NewTDM, OldTDM, GDM }; + bool canShutdown(); void shutdown( TDEApplication::ShutdownType shutdownType, TDEApplication::ShutdownMode shutdownMode, @@ -58,6 +60,8 @@ public: static TQString sess2Str( const SessEnt &se ); static void sess2Str2( const SessEnt &se, TQString &user, TQString &loc ); + int type(); + private: int fd; @@ -86,6 +90,8 @@ public: bool bootOptions( TQStringList &opts, int &dflt, int &curr ); + int type() { return NoDM } + #endif // Q_WS_X11 }; // class DM -- cgit v1.2.3