summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-08-01 00:42:55 (UTC)
committer harlekin <harlekin>2002-08-01 00:42:55 (UTC)
commit26ff0c72228b9c89b079dfa381d448b6152eb408 (patch) (side-by-side diff)
tree580c72ab759332a1fc3b3ae12fa26447090a682c
parentb2978cf32ae5e6954fb118c89c1f70ee05d53ef4 (diff)
downloadopie-26ff0c72228b9c89b079dfa381d448b6152eb408.zip
opie-26ff0c72228b9c89b079dfa381d448b6152eb408.tar.gz
opie-26ff0c72228b9c89b079dfa381d448b6152eb408.tar.bz2
gcc3.X fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/apps/calibrate/calibrate.cpp2
-rw-r--r--core/opie-login/loginwindowimpl.cpp1
-rw-r--r--core/opie-login/main.cpp1
-rw-r--r--core/opie-login/opie-login.pro4
4 files changed, 6 insertions, 2 deletions
diff --git a/core/apps/calibrate/calibrate.cpp b/core/apps/calibrate/calibrate.cpp
index 1f4fb1b..b9ad73d 100644
--- a/core/apps/calibrate/calibrate.cpp
+++ b/core/apps/calibrate/calibrate.cpp
@@ -1,68 +1,70 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
+#include <math.h>
+
#include "calibrate.h"
#include <qpe/resource.h>
#include <qapplication.h>
#if defined(Q_WS_QWS) || defined(_WS_QWS_)
#include <qpainter.h>
#include <qtimer.h>
#include <qwindowsystem_qws.h>
#include <qgfx_qws.h>
Calibrate::Calibrate( QWidget* parent, const char * name, WFlags wf ) :
QDialog( parent, name, TRUE, wf | WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop )
{
showCross = TRUE;
const int offset = 30;
QRect desk = qApp->desktop() ->geometry();
setGeometry( 0, 0, desk.width(), desk.height() );
if ( desk.height() < 250 ) {
int w = desk.height() / 3;
logo.convertFromImage( Resource::loadImage( "launcher/opielogo" ).smoothScale( w, w ) );
}
else {
logo = Resource::loadPixmap( "launcher/opielogo" );
}
cd.screenPoints[ QWSPointerCalibrationData::TopLeft ] = QPoint( offset, offset );
cd.screenPoints[ QWSPointerCalibrationData::BottomLeft ] = QPoint( offset, qt_screen->deviceHeight() - offset );
cd.screenPoints[ QWSPointerCalibrationData::BottomRight ] = QPoint( qt_screen->deviceWidth() - offset, qt_screen->deviceHeight() - offset );
cd.screenPoints[ QWSPointerCalibrationData::TopRight ] = QPoint( qt_screen->deviceWidth() - offset, offset );
cd.screenPoints[ QWSPointerCalibrationData::Center ] = QPoint( qt_screen->deviceWidth() / 2, qt_screen->deviceHeight() / 2 );
goodcd = cd;
reset();
timer = new QTimer( this );
connect( timer, SIGNAL( timeout() ), this, SLOT( timeout() ) );
}
Calibrate::~Calibrate()
{
store();
}
void Calibrate::show()
{
grabMouse();
diff --git a/core/opie-login/loginwindowimpl.cpp b/core/opie-login/loginwindowimpl.cpp
index 3265b46..26d9225 100644
--- a/core/opie-login/loginwindowimpl.cpp
+++ b/core/opie-login/loginwindowimpl.cpp
@@ -1,71 +1,72 @@
#include <qapplication.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qframe.h>
#include <qlineedit.h>
#include <qtimer.h>
#include <qcombobox.h>
#include <qpixmap.h>
#include <qlabel.h>
#include <qpopupmenu.h>
#include <qmessagebox.h>
#include <qpe/qcopenvelope_qws.h>
#include <opie/odevice.h>
#include <stdio.h>
#include <pwd.h>
#include <grp.h>
#include <unistd.h>
#include <stdlib.h>
+#undef USEPAM // FOR my toolchain
#ifdef USEPAM
extern "C" {
#include <security/pam_appl.h>
}
#else
#include <crypt.h>
#include <shadow.h>
#endif
#include "loginwindowimpl.h"
#include "inputmethods.h"
LoginWindowImpl::LoginWindowImpl ( ) : LoginWindow ( 0, "LOGIN-WINDOW", WStyle_Customize | WStyle_NoBorder | WDestructiveClose )
{
QPopupMenu *pop = new QPopupMenu ( this );
pop-> insertItem ( tr( "Restart" ), this, SLOT( restart ( )));
m_menu-> setPopup ( pop );
QHBoxLayout *lay = new QHBoxLayout ( m_taskbar, 4, 4 );
m_input = new InputMethods ( m_taskbar );
lay-> addWidget ( m_input );
lay-> addStretch ( 10 );
setActiveWindow ( );
m_password-> setFocus ( );
m_user-> insertStringList ( getAllUsers ( ));
QTimer::singleShot ( 0, this, SLOT( showIM ( )));
QString opiedir = ::getenv ( "OPIEDIR" );
QPixmap bgpix ( opiedir + "/pics/launcher/opie-background.jpg" );
if ( !bgpix. isNull ( ))
setBackgroundPixmap ( bgpix );
m_caption-> setText ( m_caption-> text ( ) + tr( "<center><h1><u>%1 %2</u></h1></center>" ). arg ( ODevice::inst ( )-> systemString ( )). arg ( ODevice::inst ( )-> systemVersionString ( )));
}
LoginWindowImpl::~LoginWindowImpl ( )
{
}
void LoginWindowImpl::keyPressEvent ( QKeyEvent *e )
{
switch ( e-> key ( )) {
case Key_F34: suspend ( );
break;
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index 9d52b75..44d6f8d 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -1,55 +1,56 @@
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include <syslog.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
+#include <stdlib.h>
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <opie/odevice.h>
#include <qwindowsystem_qws.h>
#include <qfile.h>
#include "loginwindowimpl.h"
#include "calibrate.h"
int login_main ( int argc, char **argv );
int main ( int argc, char **argv )
{
if ( geteuid ( ) != 0 ) {
fprintf ( stderr, "%s can only be executed by root. (or chmod +s)", argv [0] );
return 1;
}
// struct rlimit rl;
// getrlimit ( RLIMIT_NOFILE, &rl );
// for ( unsigned int i = 0; i < rl. rlim_cur; i++ )
// close ( i );
setpgid ( 0, 0 );
setsid ( );
openlog ( "opie-login", LOG_CONS, LOG_AUTHPRIV );
while ( true ) {
pid_t child = fork ( );
if ( child < 0 ) {
syslog ( LOG_ERR, "Could not fork process" );
break;
}
else if ( child > 0 ) {
int status = 0;
while ( waitpid ( child, &status, 0 ) < 0 ) { }
}
else {
exit ( login_main ( argc, argv ));
diff --git a/core/opie-login/opie-login.pro b/core/opie-login/opie-login.pro
index 35c1ed0..ef449ab 100644
--- a/core/opie-login/opie-login.pro
+++ b/core/opie-login/opie-login.pro
@@ -1,25 +1,25 @@
TEMPLATE = app
CONFIG = qt warn_on debug usepam
HEADERS = loginwindowimpl.h \
../launcher/inputmethods.h \
../apps/calibrate/calibrate.h
SOURCES = loginwindowimpl.cpp \
../launcher/inputmethods.cpp \
../apps/calibrate/calibrate.cpp \
main.cpp
INTERFACES = loginwindow.ui
INCLUDEPATH += $(OPIEDIR)/include ../launcher ../apps/calibrate
DEPENDPATH += $(OPIEDIR)/include ../launcher ../apps/calibrate
LIBS += -lqpe -lopie
-usepam:LIBS += -lpam
-usepam:DEFINES += USEPAM
+#usepam:LIBS += -lpam
+#usepam:DEFINES += USEPAM
DESTDIR = $(OPIEDIR)/bin
TARGET = opie-login