summaryrefslogtreecommitdiff
path: root/core/settings/security
Side-by-side diff
Diffstat (limited to 'core/settings/security') (more/less context) (show whitespace changes)
-rw-r--r--core/settings/security/security.cpp8
-rw-r--r--core/settings/security/security.pro2
2 files changed, 8 insertions, 2 deletions
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp
index 4eddb55..b917aea 100644
--- a/core/settings/security/security.cpp
+++ b/core/settings/security/security.cpp
@@ -1,58 +1,64 @@
/**********************************************************************
** 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 "security.h"
+/* OPIE */
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/password.h>
#include <qpe/qpedialog.h>
#include <qpe/qcopenvelope_qws.h>
+#include <opie2/odebug.h>
+/* QT */
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qcombobox.h>
#include <qmessagebox.h>
#include <qfile.h>
#include <qtextstream.h>
+
+using namespace Opie::Core;
+
Security::Security( QWidget* parent, const char* name, WFlags fl )
: SecurityBase( parent, name, TRUE, WStyle_ContextHelp )
{
valid=FALSE;
Config cfg("Security");
cfg.setGroup("Passcode");
passcode = cfg.readEntry("passcode");
passcode_poweron->setChecked(cfg.readBoolEntry("passcode_poweron",FALSE));
cfg.setGroup("Sync");
int auth_peer = cfg.readNumEntry("auth_peer",0xc0a88100);//new default 192.168.129.0/24
int auth_peer_bits = cfg.readNumEntry("auth_peer_bits",24);
selectNet(auth_peer,auth_peer_bits,TRUE);
connect(syncnet, SIGNAL(textChanged(const QString&)),
this, SLOT(setSyncNet(const QString&)));
/*
cfg.setGroup("Remote");
if ( telnetAvailable() )
telnet->setChecked(cfg.readEntry("allow_telnet"));
else
telnet->hide();
@@ -236,49 +242,49 @@ void Security::selectNet(int auth_peer,int auth_peer_bits, bool update)
netrange = cfg.readEntry(target,"");
if (! netrange.isEmpty()){
//make sure we have no "twin" entries
for (int i=0; i<syncnet->count(); i++) {
if ( syncnet->text(i) == netrange ) {
already_there=TRUE;
}
}
if (! already_there) {
syncnet->insertItem( tr( netrange ) );
} else {
already_there=FALSE;
}
}
}
}
}
for (int i=0; i<syncnet->count(); i++) {
if ( syncnet->text(i).left(sn.length()) == sn ) {
syncnet->setCurrentItem(i);
return;
}
}
- qDebug("No match for \"%s\"",sn.latin1());
+ odebug << "No match for \"" << sn << "\"" << oendl;
}
void Security::parseNet(const QString& sn,int& auth_peer,int& auth_peer_bits)
{
auth_peer=0;
if ( sn == tr("Any") ) {
auth_peer = 0;
auth_peer_bits = 0;
} else if ( sn == tr("None") ) {
auth_peer = 0;
auth_peer_bits = 32;
} else {
int x=0;
for (int i=0; i<4; i++) {
int nx = sn.find(QChar(i==3 ? '/' : '.'),x);
auth_peer = (auth_peer<<8)|sn.mid(x,nx-x).toInt();
x = nx+1;
}
uint n = (uint)sn.find(' ',x)-x;
auth_peer_bits = sn.mid(x,n).toInt();
}
}
void Security::loadUsers ( void )
diff --git a/core/settings/security/security.pro b/core/settings/security/security.pro
index 4a29ee2..4c1e68b 100644
--- a/core/settings/security/security.pro
+++ b/core/settings/security/security.pro
@@ -1,10 +1,10 @@
CONFIG += qt warn_on quick-app
HEADERS = security.h
SOURCES = security.cpp main.cpp
INTERFACES = securitybase.ui
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += ../$(OPIEDIR)/include
-LIBS += -lqpe
+LIBS += -lqpe -lopiecore2
TARGET = security
include ( $(OPIEDIR)/include.pro )