summaryrefslogtreecommitdiff
authorkergoth <kergoth>2002-04-24 22:29:40 (UTC)
committer kergoth <kergoth>2002-04-24 22:29:40 (UTC)
commita12408cb8191addfaf613ec7caeb270d74428bad (patch) (unidiff)
tree41d88d6da4835cbe8751f12dc61d22fe5839d19d
parent203caeed5513f98d5f412acb5ca7bf51a4ab6df0 (diff)
downloadopie-a12408cb8191addfaf613ec7caeb270d74428bad.zip
opie-a12408cb8191addfaf613ec7caeb270d74428bad.tar.gz
opie-a12408cb8191addfaf613ec7caeb270d74428bad.tar.bz2
Set proper include paths for qpeapplication.h and global.h.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/opie-login/qdmdialogimpl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/opie-login/qdmdialogimpl.cpp b/core/opie-login/qdmdialogimpl.cpp
index 56f0fc0..5d4cd49 100644
--- a/core/opie-login/qdmdialogimpl.cpp
+++ b/core/opie-login/qdmdialogimpl.cpp
@@ -1,185 +1,185 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2001 LISA Systems 2** Copyright (C) 2001 LISA Systems
3** 3**
4** This file is an additional part of Qtopia Environment. 4** This file is an additional part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** For further information contact info@lisa.de 14** For further information contact info@lisa.de
15** 15**
16**********************************************************************/ 16**********************************************************************/
17 17
18/* 18/*
19 * AUTHOR: Christian Rahn 19 * AUTHOR: Christian Rahn
20 * EMAIL: cdr@lisa.de 20 * EMAIL: cdr@lisa.de
21 * 21 *
22 * $Id$ 22 * $Id$
23 */ 23 */
24 24
25#include "qdm_config.h" 25#include "qdm_config.h"
26 26
27#ifdef QT_QWS_LOGIN 27#ifdef QT_QWS_LOGIN
28 28
29#include <pwd.h> 29#include <pwd.h>
30#include <unistd.h> 30#include <unistd.h>
31#include <stdlib.h> 31#include <stdlib.h>
32#include <iostream.h> 32#include <iostream.h>
33#include <assert.h> 33#include <assert.h>
34 34
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qdatetime.h> 37#include <qdatetime.h>
38#include <qmessagebox.h> 38#include <qmessagebox.h>
39#include <qcombobox.h> 39#include <qcombobox.h>
40#include <qlineedit.h> 40#include <qlineedit.h>
41#include <qtranslator.h> 41#include <qtranslator.h>
42#include <qpeapplication.h> 42#include <qpe/qpeapplication.h>
43 43
44#include <qwsdisplay_qws.h> 44#include <qwsdisplay_qws.h>
45 45
46#include <string.h> 46#include <string.h>
47#include <stdio.h> 47#include <stdio.h>
48#include <errno.h> 48#include <errno.h>
49#include <unistd.h> 49#include <unistd.h>
50 50
51#include <sys/types.h> 51#include <sys/types.h>
52#include <sys/stat.h> 52#include <sys/stat.h>
53#include <sys/sem.h> 53#include <sys/sem.h>
54#include <sys/shm.h> 54#include <sys/shm.h>
55#include <sys/ipc.h> 55#include <sys/ipc.h>
56 56
57#include <global.h> 57#include <qpe/global.h>
58 58
59#if defined(QT_QWS_LOGIN_USEPAM) 59#if defined(QT_QWS_LOGIN_USEPAM)
60extern "C" { 60extern "C" {
61#include <security/pam_appl.h> 61#include <security/pam_appl.h>
62} 62}
63#else 63#else
64#define _XOPEN_SOURCE 64#define _XOPEN_SOURCE
65#include <unistd.h> 65#include <unistd.h>
66#include <crypt.h> 66#include <crypt.h>
67#endif 67#endif
68 68
69 69
70#include "qdmdialogimpl.h" 70#include "qdmdialogimpl.h"
71#include "../launcher/inputmethods.h" 71#include "../launcher/inputmethods.h"
72 72
73 73
74//---------------------------------------------------------------------------- 74//----------------------------------------------------------------------------
75 75
76//-- taken from semctl man page 76//-- taken from semctl man page
77#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) 77#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
78//-- union semun is defined by including <sys/sem.h> 78//-- union semun is defined by including <sys/sem.h>
79#else 79#else
80//-- according to X/OPEN we have to define it ourselves 80//-- according to X/OPEN we have to define it ourselves
81union semun { 81union semun {
82 int val; // value for SETVAL 82 int val; // value for SETVAL
83 struct semid_ds *buf; // buffer for IPC_STAT, IPC_SET 83 struct semid_ds *buf; // buffer for IPC_STAT, IPC_SET
84 unsigned short int *array; // array for GETALL, SETALL 84 unsigned short int *array; // array for GETALL, SETALL
85 struct seminfo *__buf; // buffer for IPC_INFO 85 struct seminfo *__buf; // buffer for IPC_INFO
86}; 86};
87#endif 87#endif
88 88
89//---------------------------------------------------------------------------- 89//----------------------------------------------------------------------------
90 90
91static const int ShowClockFreq = 1; 91static const int ShowClockFreq = 1;
92 92
93QDM_SHOWNUSERS; 93QDM_SHOWNUSERS;
94 94
95#ifdef QT_QWS_LOGIN_USEPAM 95#ifdef QT_QWS_LOGIN_USEPAM
96 96
97static const char *_PAM_SERVICE = "xdm"; 97static const char *_PAM_SERVICE = "xdm";
98static const char *PAM_password; 98static const char *PAM_password;
99 99
100typedef const struct pam_message pam_message_type; 100typedef const struct pam_message pam_message_type;
101 101
102static int PAM_conv( int, pam_message_type **, struct pam_response **, void * ); 102static int PAM_conv( int, pam_message_type **, struct pam_response **, void * );
103 103
104static struct pam_conv PAM_conversation = { 104static struct pam_conv PAM_conversation = {
105 &PAM_conv, 105 &PAM_conv,
106 NULL 106 NULL
107}; 107};
108 108
109//---------------------------------------------------------------------------- 109//----------------------------------------------------------------------------
110 110
111static char *COPY_STRING( const char * s ) { 111static char *COPY_STRING( const char * s ) {
112 return (s) ? strdup(s) : (char *)NULL; 112 return (s) ? strdup(s) : (char *)NULL;
113} 113}
114 114
115#define GET_MEM if (reply) realloc(reply, size);\ 115#define GET_MEM if (reply) realloc(reply, size);\
116 else reply = (struct pam_response *)malloc(size); \ 116 else reply = (struct pam_response *)malloc(size); \
117 if (!reply) return PAM_CONV_ERR; \ 117 if (!reply) return PAM_CONV_ERR; \
118 size += sizeof(struct pam_response) 118 size += sizeof(struct pam_response)
119 119
120 120
121static int PAM_conv( int num_msg, pam_message_type **msg, 121static int PAM_conv( int num_msg, pam_message_type **msg,
122 struct pam_response **resp, void *) 122 struct pam_response **resp, void *)
123{ 123{
124 int count = 0, replies = 0; 124 int count = 0, replies = 0;
125 struct pam_response *reply = NULL; 125 struct pam_response *reply = NULL;
126 int size = sizeof(struct pam_response); 126 int size = sizeof(struct pam_response);
127 127
128 for( count = 0; count < num_msg; count++ ) { 128 for( count = 0; count < num_msg; count++ ) {
129 switch (msg[count]->msg_style) { 129 switch (msg[count]->msg_style) {
130 case PAM_PROMPT_ECHO_ON: 130 case PAM_PROMPT_ECHO_ON:
131 /* user name given to PAM already */ 131 /* user name given to PAM already */
132 return PAM_CONV_ERR; 132 return PAM_CONV_ERR;
133 133
134 case PAM_PROMPT_ECHO_OFF: 134 case PAM_PROMPT_ECHO_OFF:
135 /* wants password */ 135 /* wants password */
136 GET_MEM; 136 GET_MEM;
137 reply[replies].resp_retcode = PAM_SUCCESS; 137 reply[replies].resp_retcode = PAM_SUCCESS;
138 reply[replies].resp = COPY_STRING(PAM_password); 138 reply[replies].resp = COPY_STRING(PAM_password);
139 replies++; 139 replies++;
140 /* PAM frees resp */ 140 /* PAM frees resp */
141 break; 141 break;
142 case PAM_TEXT_INFO: 142 case PAM_TEXT_INFO:
143 break; 143 break;
144 default: 144 default:
145 /* unknown or PAM_ERROR_MSG */ 145 /* unknown or PAM_ERROR_MSG */
146 if (reply) free (reply); 146 if (reply) free (reply);
147 return PAM_CONV_ERR; 147 return PAM_CONV_ERR;
148 } 148 }
149 } 149 }
150 if (reply) *resp = reply; 150 if (reply) *resp = reply;
151 return PAM_SUCCESS; 151 return PAM_SUCCESS;
152} 152}
153 153
154#endif 154#endif
155 155
156 156
157//---------------------------------------------------------------------------- 157//----------------------------------------------------------------------------
158 158
159QDMDialogImpl::QDMDialogImpl( QWidget* parent, const char* name, bool modal, WFlags f ) 159QDMDialogImpl::QDMDialogImpl( QWidget* parent, const char* name, bool modal, WFlags f )
160 : QDMDialog( parent, name, modal, f ) 160 : QDMDialog( parent, name, modal, f )
161{ 161{
162 showTime(); 162 showTime();
163 clockTimer = startTimer( ShowClockFreq * 1000 );//-- call timer evry min. 163 clockTimer = startTimer( ShowClockFreq * 1000 );//-- call timer evry min.
164 setActiveWindow(); 164 setActiveWindow();
165 setFocus(); 165 setFocus();
166 166
167 input = new InputMethods( this ); 167 input = new InputMethods( this );
168 input->resize( input->sizeHint() ); 168 input->resize( input->sizeHint() );
169 input->move( 0, height() - input->height() ); 169 input->move( 0, height() - input->height() );
170 170
171 for( int i=0; Shown_Users[i]; ++i ) { 171 for( int i=0; Shown_Users[i]; ++i ) {
172 input_user->insertItem( Shown_Users[i] ); 172 input_user->insertItem( Shown_Users[i] );
173 } 173 }
174 input_user->clearEdit(); 174 input_user->clearEdit();
175 175
176 label_welcome->setText( QDM_WELCOME_STRING ); 176 label_welcome->setText( QDM_WELCOME_STRING );
177 177
178}; 178};
179 179
180 180
181 181
182QDMDialogImpl::~QDMDialogImpl() 182QDMDialogImpl::~QDMDialogImpl()
183{ 183{
184 input->lower(); 184 input->lower();
185 input->close( false ); 185 input->close( false );