summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp162
-rw-r--r--noncore/settings/appearance2/stylelistitem.h8
-rw-r--r--noncore/settings/aqpkg/categoryfilterimpl.cpp20
-rw-r--r--noncore/settings/aqpkg/instoptionsimpl.cpp16
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp38
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp35
-rw-r--r--noncore/settings/backup/backuprestore.cpp17
-rw-r--r--noncore/settings/networksettings/ppp/devices.cpp25
-rw-r--r--noncore/settings/networksettings/ppp/edit.cpp233
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp16
-rw-r--r--noncore/settings/sysinfo/processinfo.cpp14
-rw-r--r--noncore/settings/usermanager/userdialog.cpp149
12 files changed, 462 insertions, 271 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 9e5eede..ba12e55 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -29,2 +29,26 @@
+#include "appearance.h"
+#include "editScheme.h"
+#include "stylelistitem.h"
+#include "decolistitem.h"
+#include "colorlistitem.h"
+#include "exceptlistitem.h"
+#include "sample.h"
+
+/* OPIE */
+#include <opie/ofontselector.h>
+#include <opie/odevice.h>
+#include <opie/ofiledialog.h>
+#include <opie/otabwidget.h>
+
+#include <qpe/config.h>
+#include <qpe/global.h>
+#include <qpe/qpeapplication.h>
+#include <qpe/qpemessagebox.h>
+#include <qpe/qcopenvelope_qws.h>
+#include <qpe/qpestyle.h>
+#include <qpe/lightstyle.h>
+#include <qpe/styleinterface.h>
+
+/* QT */
#include <qbuttongroup.h>
@@ -51,27 +75,2 @@
-#include <qpe/config.h>
-#include <qpe/global.h>
-#include <qpe/resource.h>
-#include <qpe/qpeapplication.h>
-#include <qpe/qpemessagebox.h>
-#include <qpe/qcopenvelope_qws.h>
-#include <qpe/qpestyle.h>
-#include <qpe/lightstyle.h>
-#include <qpe/qlibrary.h>
-#include <qpe/styleinterface.h>
-
-#include <opie/ofontselector.h>
-#include <opie/odevice.h>
-#include <opie/ofiledialog.h>
-#include <opie/otabwidget.h>
-
-#include "appearance.h"
-#include "editScheme.h"
-#include "stylelistitem.h"
-#include "decolistitem.h"
-#include "colorlistitem.h"
-#include "exceptlistitem.h"
-#include "sample.h"
-
-
using namespace Opie;
@@ -83,9 +82,12 @@ public:
DefaultWindowDecoration() : ref(0) {}
- QString name() const {
+ QString name() const
+ {
return "Default";
}
-QPixmap icon() const {
+ QPixmap icon() const
+ {
return QPixmap();
}
- QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
+ QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface )
+ {
*iface = 0;
@@ -136,2 +138,3 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
#endif
+
{
@@ -141,3 +144,4 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
- for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
+ for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
+ {
QString libstr = path;
@@ -148,3 +152,4 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
- if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface ) {
+ if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface )
+ {
StyleListItem *slit = new StyleListItem ( lib, iface );
@@ -186,3 +191,4 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
- for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
+ for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
+ {
QString libstr = path;
@@ -193,3 +199,4 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg )
- if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK ) {
+ if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK )
+ {
DecoListItem *dlit = new DecoListItem ( lib, iface );
@@ -248,3 +255,4 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg )
- for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
+ for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
+ {
QString name = (*it). left ((*it). find ( ".scheme" ));
@@ -350,3 +358,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
QListViewItem *lvit = 0;
- for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
+ for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
+ {
int fl = ( *it ). left ( 1 ). toInt ( 0, 32 );
@@ -434,5 +443,8 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
- if (rotDirection == -1) {
+ if (rotDirection == -1)
+ {
rot = ODevice::inst ( )-> direction ( );
- } else {
+ }
+ else
+ {
rot = (ODirection)rotDirection;
@@ -484,4 +496,3 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags )
Appearance::~Appearance()
-{
-}
+{}
@@ -489,3 +500,4 @@ void Appearance::tabChanged ( QWidget *w )
{
- if ( w == m_advtab ) {
+ if ( w == m_advtab )
+ {
m_sample-> hide ( );
@@ -505,3 +517,4 @@ void Appearance::accept ( )
- if ( m_style_changed ) {
+ if ( m_style_changed )
+ {
StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( ));
@@ -511,3 +524,4 @@ void Appearance::accept ( )
- if ( m_deco_changed ) {
+ if ( m_deco_changed )
+ {
DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( ));
@@ -517,3 +531,4 @@ void Appearance::accept ( )
- if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) {
+ if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos ))
+ {
config. writeEntry ( "TabStyle", newtabstyle + 1 );
@@ -522,3 +537,4 @@ void Appearance::accept ( )
- if ( m_font_changed ) {
+ if ( m_font_changed )
+ {
config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( ));
@@ -538,7 +554,12 @@ void Appearance::accept ( )
ODirection rot;
- if (m_rotdir_ccw-> isChecked ( )) {
+ if (m_rotdir_ccw-> isChecked ( ))
+ {
rot = CCW;
- } else if (m_rotdir_cw-> isChecked ( )) {
+ }
+ else if (m_rotdir_cw-> isChecked ( ))
+ {
rot = CW;
- } else {
+ }
+ else
+ {
rot = Flip;
@@ -551,3 +572,4 @@ void Appearance::accept ( )
QString exceptstr;
- for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) {
+ for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( ))
+ {
int fl = 0;
@@ -581,3 +603,4 @@ void Appearance::styleClicked ( int index )
- if ( m_sample && sli && sli-> style ( )) {
+ if ( m_sample && sli && sli-> style ( ))
+ {
int ci = m_color_list ? m_color_list-> currentItem ( ) : -1;
@@ -594,3 +617,4 @@ void Appearance::styleSettingsClicked ( )
- if ( item && item-> hasSettings ( )) {
+ if ( item && item-> hasSettings ( ))
+ {
QDialog *d = new QDialog ( this, "SETTINGS-DLG", true );
@@ -600,3 +624,4 @@ void Appearance::styleSettingsClicked ( )
- if ( w ) {
+ if ( w )
+ {
vbox-> addWidget ( w );
@@ -605,4 +630,3 @@ void Appearance::styleSettingsClicked ( )
- d-> showMaximized ( );
- bool accepted = ( d-> exec ( ) == QDialog::Accepted );
+ bool accepted = ( QPEApplication::execDialog ( d ) == QDialog::Accepted );
@@ -619,3 +643,4 @@ void Appearance::decoClicked ( int index )
- if ( m_sample ) {
+ if ( m_sample )
+ {
if ( dli && dli-> interface ( ))
@@ -654,6 +679,8 @@ void Appearance::editSchemeClicked ( )
- for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) {
+ for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ )
+ {
QColor col = item-> color ( role );
- if ( col. isValid ( )) {
+ if ( col. isValid ( ))
+ {
labels [cnt] = item-> label ( role );
@@ -666,4 +693,4 @@ void Appearance::editSchemeClicked ( )
EditScheme* editdlg = new EditScheme( cnt, labels, colors, this, "editScheme", true );
- editdlg-> showMaximized ( );
- if ( editdlg-> exec ( ) == QDialog::Accepted ) {
+ if ( QPEApplication::execDialog( editdlg ) == QDialog::Accepted )
+ {
ColorListItem *citem = (ColorListItem *) m_color_list-> item ( 0 );
@@ -671,4 +698,6 @@ void Appearance::editSchemeClicked ( )
- for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) {
- if ( item-> color ( role ). isValid ( )) {
+ for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ )
+ {
+ if ( item-> color ( role ). isValid ( ))
+ {
citem-> setColor ( role, colors [cnt] );
@@ -700,3 +729,4 @@ void Appearance::saveSchemeClicked()
- if ( d-> exec ( ) == QDialog::Accepted ) {
+ if ( d-> exec ( ) == QDialog::Accepted )
+ {
QString schemename = ed-> text ( );
@@ -763,3 +793,4 @@ void Appearance::delExcept ( )
{
- if ( m_except-> selectedItem ( )) {
+ if ( m_except-> selectedItem ( ))
+ {
m_except-> setFocus ( );
@@ -785,3 +816,4 @@ void Appearance::downExcept ( )
-class ExEdit : public QLineEdit {
+class ExEdit : public QLineEdit
+{
public:
@@ -824,3 +856,4 @@ public:
it-> listView ( )-> setFocus ( );
- else if ( e-> key ( ) == Key_Escape ) {
+ else if ( e-> key ( ) == Key_Escape )
+ {
m_out = false;
@@ -850,3 +883,4 @@ void Appearance::clickedExcept ( QListViewItem *item, const QPoint &, int c )
it-> setNoDeco ( !it-> noDeco ( ));
- else if ( c == 3 ) {
+ else if ( c == 3 )
+ {
m_except-> ensureItemVisible ( it );
diff --git a/noncore/settings/appearance2/stylelistitem.h b/noncore/settings/appearance2/stylelistitem.h
index caefad8..b6c72c3 100644
--- a/noncore/settings/appearance2/stylelistitem.h
+++ b/noncore/settings/appearance2/stylelistitem.h
@@ -30,4 +30,10 @@
-#include <qlistbox.h>
+/* OPIE */
#include <qpe/styleinterface.h>
+#include <qpe/qlibrary.h>
+#include <qpe/resource.h>
+
+/* QT */
+#include <qlistbox.h>
+#include <qfileinfo.h>
diff --git a/noncore/settings/aqpkg/categoryfilterimpl.cpp b/noncore/settings/aqpkg/categoryfilterimpl.cpp
index 61e1f93..217d2c9 100644
--- a/noncore/settings/aqpkg/categoryfilterimpl.cpp
+++ b/noncore/settings/aqpkg/categoryfilterimpl.cpp
@@ -29,5 +29,8 @@
-#include <iostream>
-using namespace std;
+#include "categoryfilterimpl.h"
+/* OPIE */
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qgroupbox.h>
@@ -37,3 +40,6 @@ using namespace std;
-#include "categoryfilterimpl.h"
+/* STD */
+#include <iostream>
+using namespace std;
+
@@ -78,3 +84,4 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin
start = end + 1;
- } while ( start < (int)categories.length() );
+ }
+ while ( start < (int)categories.length() );
@@ -82,3 +89,3 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin
- showMaximized();
+ QPEApplication::showDialog( this );
}
@@ -86,4 +93,3 @@ CategoryFilterImpl :: CategoryFilterImpl(const QString &categories, const QStrin
CategoryFilterImpl :: ~CategoryFilterImpl()
-{
-}
+{}
diff --git a/noncore/settings/aqpkg/instoptionsimpl.cpp b/noncore/settings/aqpkg/instoptionsimpl.cpp
index 9d52013..126e3b9 100644
--- a/noncore/settings/aqpkg/instoptionsimpl.cpp
+++ b/noncore/settings/aqpkg/instoptionsimpl.cpp
@@ -29,2 +29,7 @@
+#include "global.h"
+#include "instoptionsimpl.h"
+#include "ipkg.h"
+
+/* OPIE */
#ifdef QWS
@@ -32,3 +37,5 @@
#endif
+#include <qpe/qpeapplication.h>
+/* QT */
#include <qcheckbox.h>
@@ -39,6 +46,2 @@
-#include "global.h"
-#include "instoptionsimpl.h"
-#include "ipkg.h"
-
InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * parent, const char* name, bool modal, WFlags fl )
@@ -97,3 +100,3 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * par
- showMaximized();
+ QPEApplication::showDialog( this );
@@ -102,4 +105,3 @@ InstallOptionsDlgImpl::InstallOptionsDlgImpl( int flags, int verb, QWidget * par
InstallOptionsDlgImpl::~InstallOptionsDlgImpl()
-{
-}
+{}
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index dbe694e..6f5c712 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -29,9 +29,17 @@
-#include <linux/limits.h>
-#include <unistd.h>
+#include "categoryfilterimpl.h"
+#include "datamgr.h"
+#include "global.h"
+#include "inputdlg.h"
+#include "ipkg.h"
+#include "installdlgimpl.h"
+#include "letterpushbutton.h"
+#include "mainwin.h"
+#include "packagewin.h"
+#include "settingsimpl.h"
+#include "utils.h"
+/* OPIE */
#include <qpe/qcopenvelope_qws.h>
-#include <qmenubar.h>
#include <qpe/qpeapplication.h>
-#include <qtoolbar.h>
#include <qpe/config.h>
@@ -39,2 +47,5 @@
+/* QT */
+#include <qmenubar.h>
+#include <qtoolbar.h>
#include <qaction.h>
@@ -54,13 +65,5 @@
-#include "categoryfilterimpl.h"
-#include "datamgr.h"
-#include "global.h"
-#include "inputdlg.h"
-#include "ipkg.h"
-#include "installdlgimpl.h"
-#include "letterpushbutton.h"
-#include "mainwin.h"
-#include "packagewin.h"
-#include "settingsimpl.h"
-#include "utils.h"
+/* STD */
+#include <linux/limits.h>
+#include <unistd.h>
@@ -1183,3 +1186,4 @@ void MainWindow :: letterPushed( QString t )
item = (QCheckListItem *)packagesList->firstChild();
- } while ( item != start);
+ }
+ while ( item != start);
}
@@ -1190,3 +1194,3 @@ void MainWindow :: slotDisplayPackage( QListViewItem *item )
PackageWindow *p = new PackageWindow( mgr->getServer( serversList->currentText() )->getPackage( itemstr ) );
- p->showMaximized();
+ QPEApplication::showWidget( p );
}
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index 4887ceb..9fdf31e 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -29,6 +29,14 @@
-#include <fstream>
-#include <algorithm>
-using namespace std;
+#include "settingsimpl.h"
+#include "global.h"
+
+/* OPIE */
+#include <opie/otabwidget.h>
+#ifdef QWS
+#include <qpe/config.h>
+#include <qpe/resource.h>
+#endif
+#include <qpe/qpeapplication.h>
+/* QT */
#include <qcheckbox.h>
@@ -41,12 +49,6 @@ using namespace std;
-#include <opie/otabwidget.h>
-
-#ifdef QWS
-#include <qpe/config.h>
-#include <qpe/resource.h>
-#endif
-
-#include "settingsimpl.h"
-
-#include "global.h"
+/* STD */
+#include <fstream>
+#include <algorithm>
+using namespace std;
@@ -80,3 +82,2 @@ SettingsImpl :: ~SettingsImpl()
{
-
}
@@ -85,5 +86,3 @@ bool SettingsImpl :: showDlg()
{
- showMaximized();
- exec();
-
+ QPEApplication::execDialog( this );
if ( changed )
@@ -464,2 +463,3 @@ void SettingsImpl :: changeDestinationDetails()
#endif
+
}
@@ -478,2 +478,3 @@ void SettingsImpl :: changeDestinationDetails()
#endif
+
}
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index a00193d..977c283 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -2,8 +2,11 @@
#include "backuprestore.h"
-//#include "output.h"
#include "errordialog.h"
+/* OPIE */
+#include <opie2/ostorageinfo.h>
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qapplication.h>
#include <qmultilineedit.h>
-
#include <qdir.h>
@@ -23,4 +26,4 @@
#include <qtextview.h>
-#include <opie2/ostorageinfo.h>
+/* STD */
#include <errno.h>
@@ -43,3 +46,2 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f
{
- this->showMaximized();
backupList->header()->hide();
@@ -132,2 +134,3 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f
}
+ QPEApplication::showWidget( this );
}
@@ -289,4 +292,3 @@ void BackupAndRestore::backup()
}
- pErrDialog->showMaximized();
- pErrDialog->exec();
+ QPEApplication::execDialog( pErrDialog );
delete pErrDialog;
@@ -454,4 +456,3 @@ void BackupAndRestore::restore()
}
- pErrDialog->showMaximized();
- pErrDialog->exec();
+ QPEApplication::execDialog( pErrDialog );
delete pErrDialog;
diff --git a/noncore/settings/networksettings/ppp/devices.cpp b/noncore/settings/networksettings/ppp/devices.cpp
index e94904b..9da090d 100644
--- a/noncore/settings/networksettings/ppp/devices.cpp
+++ b/noncore/settings/networksettings/ppp/devices.cpp
@@ -26,4 +26,14 @@
+#include "interfaceppp.h"
+#include "devices.h"
+#include "authwidget.h"
+#include "pppdata.h"
+#include "edit.h"
+#include "general.h"
+
+/* OPIE */
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qdir.h>
-#include <stdlib.h>
#include <qlayout.h>
@@ -33,3 +43,2 @@
#include <qmessagebox.h>
-
#include <qapplication.h>
@@ -39,8 +48,5 @@
-#include "interfaceppp.h"
-#include "devices.h"
-#include "authwidget.h"
-#include "pppdata.h"
-#include "edit.h"
-#include "general.h"
+/* STD */
+#include <stdlib.h>
+
@@ -193,4 +199,3 @@ int DevicesWidget::doTab(){
while (!ok){
- dlg->showMaximized();
- result = dlg->exec();
+ result = QPEApplication::execDialog( dlg );
ok = true;
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp
index ceac90c..7d21605 100644
--- a/noncore/settings/networksettings/ppp/edit.cpp
+++ b/noncore/settings/networksettings/ppp/edit.cpp
@@ -25,4 +25,12 @@
-#include <string.h>
-#include <termios.h>
+#include "edit.h"
+#include "pppdata.h"
+#include "iplined.h"
+#include "auth.h"
+
+/* OPIE */
+#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qlayout.h>
@@ -36,8 +44,7 @@
#include <qdialog.h>
-#include <qpe/resource.h>
-#include "edit.h"
-#include "pppdata.h"
-#include "iplined.h"
-#include "auth.h"
+/* STD */
+
+#include <string.h>
+#include <termios.h>
@@ -114,3 +121,4 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
// Set defaults if editing an existing connection
- if(!isnewaccount) {
+ if(!isnewaccount)
+ {
connectname_l->setText(_pppdata->accname());
@@ -121,4 +129,6 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
uint idx = 0;
- while(idx != n.length()) {
- if(n[idx] == ':') {
+ while(idx != n.length())
+ {
+ if(n[idx] == ':')
+ {
if(tmp.length() > 0)
@@ -126,3 +136,4 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
tmp = "";
- } else
+ }
+ else
tmp += n[idx];
@@ -139,8 +150,12 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
-bool DialWidget::save() {
+bool DialWidget::save()
+{
//first check to make sure that the account name is unique!
if(connectname_l->text().isEmpty() ||
- !_pppdata->isUniqueAccname(connectname_l->text())) {
+ !_pppdata->isUniqueAccname(connectname_l->text()))
+ {
return false;
- } else {
+ }
+ else
+ {
_pppdata->setAccname(connectname_l->text());
@@ -148,3 +163,4 @@ bool DialWidget::save() {
QString number = "";
- for(uint i = 0; i < numbers->count(); i++) {
+ for(uint i = 0; i < numbers->count(); i++)
+ {
if(i != 0)
@@ -160,3 +176,4 @@ bool DialWidget::save() {
-void DialWidget::numbersChanged() {
+void DialWidget::numbersChanged()
+{
int sel = numbers->currentItem();
@@ -169,3 +186,4 @@ void DialWidget::numbersChanged() {
-void DialWidget::selectionChanged(int) {
+void DialWidget::selectionChanged(int)
+{
numbersChanged();
@@ -174,5 +192,7 @@ void DialWidget::selectionChanged(int) {
-void DialWidget::addNumber() {
+void DialWidget::addNumber()
+{
PhoneNumberDialog dlg(this);
- if(dlg.exec()) {
+ if(dlg.exec())
+ {
numbers->insertItem(dlg.phoneNumber());
@@ -183,4 +203,6 @@ void DialWidget::addNumber() {
-void DialWidget::delNumber() {
- if(numbers->currentItem() != -1) {
+void DialWidget::delNumber()
+{
+ if(numbers->currentItem() != -1)
+ {
numbers->removeItem(numbers->currentItem());
@@ -191,5 +213,7 @@ void DialWidget::delNumber() {
-void DialWidget::upNumber() {
+void DialWidget::upNumber()
+{
int idx = numbers->currentItem();
- if(idx != -1) {
+ if(idx != -1)
+ {
QString item = numbers->text(idx);
@@ -203,5 +227,7 @@ void DialWidget::upNumber() {
-void DialWidget::downNumber() {
+void DialWidget::downNumber()
+{
int idx = numbers->currentItem();
- if(idx != -1) {
+ if(idx != -1)
+ {
QString item = numbers->text(idx);
@@ -215,6 +241,6 @@ void DialWidget::downNumber() {
-void DialWidget::pppdargsbutton() {
+void DialWidget::pppdargsbutton()
+{
PPPdArguments pa(_pppdata, this);
- pa.showMaximized();
- pa.exec();
+ QPEApplication::execDialog( &pa );
}
@@ -307,3 +333,4 @@ ExecWidget::ExecWidget(PPPData *pd, QWidget *parent, bool isnewaccount, const ch
// Set defaults if editing an existing connection
- if(!isnewaccount) {
+ if(!isnewaccount)
+ {
before_connect->setText(_pppdata->command_before_connect());
@@ -316,3 +343,4 @@ ExecWidget::ExecWidget(PPPData *pd, QWidget *parent, bool isnewaccount, const ch
-bool ExecWidget::save() {
+bool ExecWidget::save()
+{
_pppdata->setCommand_before_connect(before_connect->text());
@@ -416,5 +444,7 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char
//load info from gpppdata
- if(!isnewaccount) {
+ if(!isnewaccount)
+ {
if(_pppdata->ipaddr() == "0.0.0.0" &&
- _pppdata->subnetmask() == "0.0.0.0") {
+ _pppdata->subnetmask() == "0.0.0.0")
+ {
dynamicadd_rb->setChecked(true);
@@ -423,3 +453,4 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char
}
- else {
+ else
+ {
ipaddress_l->setText(_pppdata->ipaddr());
@@ -430,3 +461,4 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char
}
- else {
+ else
+ {
dynamicadd_rb->setChecked(true);
@@ -437,3 +469,4 @@ IPWidget::IPWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const char
-void IPWidget::autoname_t(bool on) {
+void IPWidget::autoname_t(bool on)
+{
static bool was_warned = false;
@@ -441,3 +474,4 @@ void IPWidget::autoname_t(bool on) {
// big-fat warning when selecting the auto configure hostname option
- if(on && !was_warned) {
+ if(on && !was_warned)
+ {
QMessageBox::information(this,
@@ -456,7 +490,11 @@ void IPWidget::autoname_t(bool on) {
-void IPWidget::save() {
- if(dynamicadd_rb->isChecked()) {
+void IPWidget::save()
+{
+ if(dynamicadd_rb->isChecked())
+ {
_pppdata->setIpaddr("0.0.0.0");
_pppdata->setSubnetmask("0.0.0.0");
- } else {
+ }
+ else
+ {
_pppdata->setIpaddr(ipaddress_l->text());
@@ -468,4 +506,6 @@ void IPWidget::save() {
-void IPWidget::hitIPSelect( int i ) {
- if(i == 0) {
+void IPWidget::hitIPSelect( int i )
+{
+ if(i == 0)
+ {
ipaddress_label->setEnabled(false);
@@ -475,3 +515,4 @@ void IPWidget::hitIPSelect( int i ) {
}
- else {
+ else
+ {
ipaddress_label->setEnabled(true);
@@ -599,3 +640,4 @@ DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const cha
// restore data if editing
- if(!isnewaccount) {
+ if(!isnewaccount)
+ {
dnsservers->insertStringList(_pppdata->dns());
@@ -611,3 +653,4 @@ DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const cha
-void DNSWidget::DNS_Edit_Changed(const QString &text) {
+void DNSWidget::DNS_Edit_Changed(const QString &text)
+{
QRegExp r("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+");
@@ -616,3 +659,4 @@ void DNSWidget::DNS_Edit_Changed(const QString &text) {
-void DNSWidget::DNS_Entry_Selected(int) {
+void DNSWidget::DNS_Entry_Selected(int)
+{
remove->setEnabled(true);
@@ -620,3 +664,4 @@ void DNSWidget::DNS_Entry_Selected(int) {
-void DNSWidget::DNS_Mode_Selected(int mode) {
+void DNSWidget::DNS_Mode_Selected(int mode)
+{
bool on = (mode == 1);
@@ -633,3 +678,4 @@ void DNSWidget::DNS_Mode_Selected(int mode) {
-void DNSWidget::save() {
+void DNSWidget::save()
+{
_pppdata->setAutoDNS(bg->id(bg->selected()) == 0);
@@ -651,4 +697,6 @@ void DNSWidget::save() {
-void DNSWidget::adddns() {
- if(dnsservers->count() < MAX_DNS_ENTRIES) {
+void DNSWidget::adddns()
+{
+ if(dnsservers->count() < MAX_DNS_ENTRIES)
+ {
dnsservers->insertItem(dnsipaddr->text());
@@ -659,3 +707,4 @@ void DNSWidget::adddns() {
-void DNSWidget::removedns() {
+void DNSWidget::removedns()
+{
int i;
@@ -723,4 +772,6 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c
//load info from gpppdata
- if(!isnewaccount) {
- if(_pppdata->gateway() == "0.0.0.0") {
+ if(!isnewaccount)
+ {
+ if(_pppdata->gateway() == "0.0.0.0")
+ {
defaultgateway->setChecked(true);
@@ -728,3 +779,4 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c
}
- else {
+ else
+ {
gatewayaddr->setText(_pppdata->gateway());
@@ -734,3 +786,4 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c
}
- else {
+ else
+ {
defaultgateway->setChecked(true);
@@ -741,3 +794,4 @@ GatewayWidget::GatewayWidget( PPPData *pd, QWidget *parent, bool isnewaccount, c
-void GatewayWidget::save() {
+void GatewayWidget::save()
+{
_pppdata->setGateway(gatewayaddr->text());
@@ -747,4 +801,6 @@ void GatewayWidget::save() {
-void GatewayWidget::hitGatewaySelect( int i ) {
- if(i == 0) {
+void GatewayWidget::hitGatewaySelect( int i )
+{
+ if(i == 0)
+ {
gatewayaddr->setText("0.0.0.0");
@@ -753,3 +809,4 @@ void GatewayWidget::hitGatewaySelect( int i ) {
}
- else {
+ else
+ {
gatewayaddr->setEnabled(true);
@@ -805,3 +862,4 @@ ScriptWidget::ScriptWidget( PPPData *pd, QWidget *parent, bool isnewaccount, con
//load data from gpppdata
- if(!isnewaccount) {
+ if(!isnewaccount)
+ {
QStringList &comlist = _pppdata->scriptType();
@@ -826,3 +884,4 @@ ScriptWidget::ScriptWidget( PPPData *pd, QWidget *parent, bool isnewaccount, con
-bool ScriptWidget::check() {
+bool ScriptWidget::check()
+{
uint lstart = 0;
@@ -831,8 +890,12 @@ bool ScriptWidget::check() {
- if(sl->count() > 0) {
- for( uint i=0; i <= sl->count()-1; i++) {
- if(stl->text(i) == "LoopStart") {
+ if(sl->count() > 0)
+ {
+ for( uint i=0; i <= sl->count()-1; i++)
+ {
+ if(stl->text(i) == "LoopStart")
+ {
lstart++;
}
- if (stl->text(i) == "LoopEnd") {
+ if (stl->text(i) == "LoopEnd")
+ {
lend++;
@@ -847,5 +910,7 @@ bool ScriptWidget::check() {
-void ScriptWidget::save() {
+void ScriptWidget::save()
+{
QStringList typelist, arglist;
- for(uint i=0; i < sl->count(); i++) {
+ for(uint i=0; i < sl->count(); i++)
+ {
typelist.append(stl->text(i));
@@ -859,3 +924,4 @@ void ScriptWidget::save() {
-void ScriptWidget::adjustScrollBar() {
+void ScriptWidget::adjustScrollBar()
+{
if((int)sl->count() <= sl->numItemsVisible())
@@ -867,3 +933,4 @@ void ScriptWidget::adjustScrollBar() {
-void ScriptWidget::scrolling(int i) {
+void ScriptWidget::scrolling(int i)
+{
sl->setTopItem(i);
@@ -873,3 +940,4 @@ void ScriptWidget::scrolling(int i) {
-void ScriptWidget::slhighlighted(int i) {
+void ScriptWidget::slhighlighted(int i)
+{
insert->setEnabled(true);
@@ -880,3 +948,4 @@ void ScriptWidget::slhighlighted(int i) {
-void ScriptWidget::stlhighlighted(int i) {
+void ScriptWidget::stlhighlighted(int i)
+{
insert->setEnabled(true);
@@ -887,3 +956,4 @@ void ScriptWidget::stlhighlighted(int i) {
-void ScriptWidget::addButton() {
+void ScriptWidget::addButton()
+{
//don't allow more than the maximum script entries
@@ -892,3 +962,4 @@ void ScriptWidget::addButton() {
- switch(se->type()) {
+ switch(se->type())
+ {
case ScriptEdit::Expect:
@@ -982,3 +1053,4 @@ void ScriptWidget::addButton() {
-void ScriptWidget::insertButton() {
+void ScriptWidget::insertButton()
+{
//exit if there is no highlighted item, or we've reached the
@@ -988,3 +1060,4 @@ void ScriptWidget::insertButton() {
- switch(se->type()) {
+ switch(se->type())
+ {
case ScriptEdit::Expect:
@@ -1072,4 +1145,6 @@ void ScriptWidget::insertButton() {
-void ScriptWidget::removeButton() {
- if(sl->currentItem() >= 0) {
+void ScriptWidget::removeButton()
+{
+ if(sl->currentItem() >= 0)
+ {
int stlc = stl->currentItem();
@@ -1121,3 +1196,4 @@ PhoneNumberDialog::PhoneNumberDialog(QWidget *parent)
-QString PhoneNumberDialog::phoneNumber() {
+QString PhoneNumberDialog::phoneNumber()
+{
QString s = le->text();
@@ -1128,3 +1204,4 @@ QString PhoneNumberDialog::phoneNumber() {
-void PhoneNumberDialog::textChanged(const QString &s) {
+void PhoneNumberDialog::textChanged(const QString &s)
+{
// enableButtonOK(s.length() > 0);
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index 566b179..9cb8ad2 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -21,4 +21,9 @@
+#include "modulesinfo.h"
+#include "detail.h"
+
+/* OPIE */
#include <qpe/qpeapplication.h>
+/* QT */
#include <qfile.h>
@@ -29,5 +34,2 @@
-#include "modulesinfo.h"
-#include "detail.h"
-
ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
@@ -84,4 +86,3 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
ModulesInfo::~ModulesInfo()
-{
-}
+{}
@@ -108,3 +109,4 @@ void ModulesInfo::updateData()
QListViewItem *selecteditem = 0x0;
- while ( true ) {
+ while ( true )
+ {
modname[0] = '\0';
@@ -185,3 +187,3 @@ void ModulesInfo::viewModules( QListViewItem *modules )
- ModulesDtl->showMaximized();
+ QPEApplication::showWidget( ModulesDtl );
}
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index af0fe26..2a90b0f 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -19,4 +19,9 @@
+#include "processinfo.h"
+#include "detail.h"
+
+/* OPIE */
#include <qpe/qpeapplication.h>
+/* QT */
#include <qdir.h>
@@ -27,2 +32,3 @@
+/* STD */
#include <sys/types.h>
@@ -30,5 +36,2 @@
-#include "processinfo.h"
-#include "detail.h"
-
ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
@@ -88,4 +91,3 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
ProcessInfo::~ProcessInfo()
-{
-}
+{}
@@ -198,3 +200,3 @@ void ProcessInfo::viewProcess( QListViewItem *process )
}
- ProcessDtl->showMaximized();
+ QPEApplication::showWidget( ProcessDtl );
}
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index d87a005..08de352 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -10,3 +10,9 @@
#include "userdialog.h"
+#include "passwd.h"
+
+/* OPIE */
+#include <opie/odevice.h>
+#include <qpe/qpeapplication.h>
+/* QT */
#include <qlayout.h>
@@ -16,2 +22,3 @@
+/* STD */
#include <sys/types.h>
@@ -21,5 +28,3 @@
-#include "passwd.h"
-#include <opie/odevice.h>
using namespace Opie;
@@ -31,3 +36,4 @@ using namespace Opie;
*/
-UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) {
+UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl)
+{
vm=viewmode;
@@ -41,5 +47,7 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod
// And also fill the listview & the combobox with all available groups.
- for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it) {
+ for( QStringList::Iterator it = accounts->groupStringList.begin(); it!=accounts->groupStringList.end(); ++it)
+ {
accounts->splitGroupEntry(*it);
- if(accounts->gr_name.find(QRegExp("^#"),0)) { // Skip commented lines.
+ if(accounts->gr_name.find(QRegExp("^#"),0))
+ { // Skip commented lines.
new QCheckListItem(groupsListView,accounts->gr_name,QCheckListItem::CheckBox);
@@ -48,3 +56,3 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod
}
- showMaximized();
+ QPEApplication::showDialog( this );
}
@@ -55,4 +63,4 @@ UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool mod
*/
-UserDialog::~UserDialog() {
-}
+UserDialog::~UserDialog()
+{}
@@ -62,3 +70,4 @@ UserDialog::~UserDialog() {
*/
-void UserDialog::setupTab1() {
+void UserDialog::setupTab1()
+{
QPixmap mypixmap;
@@ -111,3 +120,4 @@ void UserDialog::setupTab1() {
- if(vm==VIEWMODE_NEW) {
+ if(vm==VIEWMODE_NEW)
+ {
// Copy /etc/skel
@@ -138,3 +148,4 @@ void UserDialog::setupTab1() {
vlayout1->addWidget(groupLabel);
- if(vm==VIEWMODE_NEW) {
+ if(vm==VIEWMODE_NEW)
+ {
vlayout1->addSpacing(5);
@@ -154,3 +165,4 @@ void UserDialog::setupTab1() {
vlayout2->addWidget(groupComboBox);
- if(vm==VIEWMODE_NEW) {
+ if(vm==VIEWMODE_NEW)
+ {
vlayout2->addSpacing(5);
@@ -168,3 +180,4 @@ void UserDialog::setupTab1() {
*/
-void UserDialog::setupTab2() {
+void UserDialog::setupTab2()
+{
QWidget *tabpage = new QWidget(myTabWidget,"page2");
@@ -197,3 +210,4 @@ void UserDialog::setupTab2() {
*/
-bool UserDialog::addUser(int uid, int gid) {
+bool UserDialog::addUser(int uid, int gid)
+{
QCheckListItem *temp;
@@ -211,5 +225,7 @@ bool UserDialog::addUser(int uid, int gid) {
// If we're running on OZ, add new users to some default groups.
- if(oz) {
+ if(oz)
+ {
QListViewItemIterator iter( adduserDialog->groupsListView );
- for ( ; iter.current(); ++iter ) {
+ for ( ; iter.current(); ++iter )
+ {
temp=(QCheckListItem*)iter.current();
@@ -226,3 +242,4 @@ bool UserDialog::addUser(int uid, int gid) {
if(!(adduserDialog->exec())) return false;
- if((adduserDialog->groupComboBox->currentItem()!=0)) {
+ if((adduserDialog->groupComboBox->currentItem()!=0))
+ {
accounts->findGroup(adduserDialog->groupComboBox->currentText());
@@ -233,3 +250,4 @@ bool UserDialog::addUser(int uid, int gid) {
adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(),
- QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) {
+ QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText())))
+ {
QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user.");
@@ -240,3 +258,4 @@ bool UserDialog::addUser(int uid, int gid) {
QListViewItemIterator it( adduserDialog->groupsListView );
- for ( ; it.current(); ++it ) {
+ for ( ; it.current(); ++it )
+ {
temp=(QCheckListItem*)it.current();
@@ -246,5 +265,7 @@ bool UserDialog::addUser(int uid, int gid) {
// Copy image to pics/users/
- if(!(adduserDialog->userImage.isNull())) {
+ if(!(adduserDialog->userImage.isNull()))
+ {
QDir d;
- if(!(d.exists("/opt/QtPalmtop/pics/users"))) {
+ if(!(d.exists("/opt/QtPalmtop/pics/users")))
+ {
d.mkdir("/opt/QtPalmtop/pics/users");
@@ -258,3 +279,4 @@ bool UserDialog::addUser(int uid, int gid) {
accounts->findUser(adduserDialog->loginLineEdit->text());
- if(adduserDialog->skelCheckBox->isChecked()) {
+ if(adduserDialog->skelCheckBox->isChecked())
+ {
QString command_cp;
@@ -282,8 +304,13 @@ bool UserDialog::addUser(int uid, int gid) {
*/
-bool UserDialog::delUser(const char *username) {
- if((accounts->findUser(username))) { // Does that user exist?
- if(!(accounts->delUser(username))) { // Delete the user.
+bool UserDialog::delUser(const char *username)
+{
+ if((accounts->findUser(username)))
+ { // Does that user exist?
+ if(!(accounts->delUser(username)))
+ { // Delete the user.
QMessageBox::information(0,"Ooops!","Something went wrong\nUnable to delete user: "+QString(username)+".");
}
- } else {
+ }
+ else
+ {
QMessageBox::information(0,"Invalid Username","That username ("+QString(username)+")does not exist.");
@@ -303,3 +330,4 @@ bool UserDialog::delUser(const char *username) {
*/
-bool UserDialog::editUser(const char *username) {
+bool UserDialog::editUser(const char *username)
+{
int invalid_group=0;
@@ -309,3 +337,4 @@ bool UserDialog::editUser(const char *username) {
accounts->findUser(username); // Locate user in database and fill variables in 'accounts' object.
- if(!(accounts->findGroup(accounts->pw_gid))) { // Locate the user's primary group, and fill group variables in 'accounts' object.
+ if(!(accounts->findGroup(accounts->pw_gid)))
+ { // Locate the user's primary group, and fill group variables in 'accounts' object.
invalid_group=1;
@@ -319,3 +348,4 @@ bool UserDialog::editUser(const char *username) {
// If this user is not using /bin/sh,/bin/ash or /bin/false as shell, add that entry to the shell-combobox.
- if(accounts->pw_shell!="/bin/sh" && accounts->pw_shell!="/bin/ash" && accounts->pw_shell!="/bin/false") {
+ if(accounts->pw_shell!="/bin/sh" && accounts->pw_shell!="/bin/ash" && accounts->pw_shell!="/bin/false")
+ {
edituserDialog->shellComboBox->insertItem(accounts->pw_shell,0);
@@ -324,4 +354,6 @@ bool UserDialog::editUser(const char *username) {
// Select the primary group for this user.
- for(int i=0;i<edituserDialog->groupComboBox->count();++i) {
- if(accounts->gr_name==edituserDialog->groupComboBox->text(i)) {
+ for(int i=0;i<edituserDialog->groupComboBox->count();++i)
+ {
+ if(accounts->gr_name==edituserDialog->groupComboBox->text(i))
+ {
edituserDialog->groupComboBox->setCurrentItem(i);
@@ -330,3 +362,4 @@ bool UserDialog::editUser(const char *username) {
}
- if(invalid_group) {
+ if(invalid_group)
+ {
edituserDialog->groupComboBox->insertItem("<Undefined group>",0);
@@ -340,7 +373,10 @@ bool UserDialog::editUser(const char *username) {
QStringList tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
- for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) { // Iterate over all of them.
+ for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
+ { // Iterate over all of them.
qWarning(*it);
QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
- for ( ; lvit.current(); ++lvit ) {
- if(lvit.current()->text(0)==(*it).left((*it).find(":"))) {
+ for ( ; lvit.current(); ++lvit )
+ {
+ if(lvit.current()->text(0)==(*it).left((*it).find(":")))
+ {
temp=(QCheckListItem*)lvit.current();
@@ -352,7 +388,10 @@ bool UserDialog::editUser(const char *username) {
tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
- for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) { // Iterate over all of them.
+ for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
+ { // Iterate over all of them.
qWarning(*it);
QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
- for ( ; lvit.current(); ++lvit ) {
- if(lvit.current()->text(0)==(*it).left((*it).find(":"))) {
+ for ( ; lvit.current(); ++lvit )
+ {
+ if(lvit.current()->text(0)==(*it).left((*it).find(":")))
+ {
temp=(QCheckListItem*)lvit.current();
@@ -372,3 +411,4 @@ bool UserDialog::editUser(const char *username) {
accounts->pw_uid=edituserDialog->uidLineEdit->text().toInt();
- if(accounts->findGroup(edituserDialog->groupComboBox->currentText())) { // Fill all group variables in 'accounts' object.
+ if(accounts->findGroup(edituserDialog->groupComboBox->currentText()))
+ { // Fill all group variables in 'accounts' object.
accounts->pw_gid=accounts->gr_gid; // Only do this if the group is a valid group (ie. "<Undefined group>"), otherwise keep the old group.
@@ -381,3 +421,4 @@ bool UserDialog::editUser(const char *username) {
// Remove user from all groups he/she is a member of. (could be done in a better way I guess, this was simple though.)
- for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) {
+ for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
+ {
accounts->delGroupMember((*it).left((*it).find(":")),username);
@@ -387,3 +428,4 @@ bool UserDialog::editUser(const char *username) {
QListViewItemIterator it( edituserDialog->groupsListView );
- for ( ; it.current(); ++it ) {
+ for ( ; it.current(); ++it )
+ {
temp=(QCheckListItem*)it.current();
@@ -394,5 +436,7 @@ bool UserDialog::editUser(const char *username) {
// Copy image to pics/users/
- if(!(edituserDialog->userImage.isNull())) {
+ if(!(edituserDialog->userImage.isNull()))
+ {
QDir d;
- if(!(d.exists("/opt/QtPalmtop/pics/users"))) {
+ if(!(d.exists("/opt/QtPalmtop/pics/users")))
+ {
d.mkdir("/opt/QtPalmtop/pics/users");
@@ -410,5 +454,7 @@ bool UserDialog::editUser(const char *username) {
*/
-void UserDialog::accept() {
+void UserDialog::accept()
+{
// Add checking... valid username? username taken?
- if(loginLineEdit->text().isEmpty()) {
+ if(loginLineEdit->text().isEmpty())
+ {
QMessageBox::information(0,"Empty Login","Please enter a login.");
@@ -423,9 +469,14 @@ void UserDialog::accept() {
*/
-void UserDialog::clickedPicture() {
+void UserDialog::clickedPicture()
+{
QString filename=OFileDialog::getOpenFileName(OFileSelector::EXTENDED, QString::null);
- if(!(filename.isEmpty())) {
+ if(!(filename.isEmpty()))
+ {
userImage.reset();
- if(!(userImage.load(filename))) {
+ if(!(userImage.load(filename)))
+ {
QMessageBox::information(0,"Sorry!","That icon could not be loaded.\nLoading failed on: "+filename);
- } else {
+ }
+ else
+ {
// userImage=userImage.smoothScale(48,48);