summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
committer mickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
commit16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff)
tree0701eae15aa606a0211a2fccfde0eafdac69357c
parent8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff)
downloadopie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2
convert to Opie Debugging Framework
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/autorotateapplet/autorotate.cpp10
-rw-r--r--noncore/applets/memoryapplet/swapfile.cpp21
-rw-r--r--noncore/applets/networkapplet/networkapplet.cpp16
-rw-r--r--noncore/applets/notesapplet/config.in2
-rw-r--r--noncore/applets/notesapplet/notes.cpp54
-rw-r--r--noncore/applets/notesapplet/notesapplet.pro18
-rw-r--r--noncore/applets/wirelessapplet/wireless.cpp44
-rw-r--r--noncore/applets/zkbapplet/zkbwidget.cpp2
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp44
-rw-r--r--noncore/apps/advancedfm/advancedfm.pro24
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp12
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp1681
-rw-r--r--noncore/apps/advancedfm/filePermissions.cpp2
-rw-r--r--noncore/apps/advancedfm/output.cpp23
-rw-r--r--noncore/apps/checkbook/checkbook.pro2
-rw-r--r--noncore/apps/checkbook/listedit.cpp11
-rw-r--r--noncore/apps/checkbook/tabledef.cpp6
-rw-r--r--noncore/apps/checkbook/transaction.cpp6
-rw-r--r--noncore/apps/confedit/confedit.pro24
-rw-r--r--noncore/apps/confedit/config.in2
-rw-r--r--noncore/apps/confedit/listviewconfdir.cpp12
-rw-r--r--noncore/apps/confedit/listviewitemconffile.cpp24
-rw-r--r--noncore/apps/confedit/mainwindow.cpp19
-rw-r--r--noncore/apps/keyz-cfg/cfgfile.cpp12
-rw-r--r--noncore/apps/keyz-cfg/config.in2
-rw-r--r--noncore/apps/keyz-cfg/keyz-cfg.pro16
-rw-r--r--noncore/apps/keyz-cfg/zkb.cpp4
-rw-r--r--noncore/apps/keyz-cfg/zkbcfg.cpp15
-rw-r--r--noncore/apps/opie-bartender/bartender.cpp35
-rw-r--r--noncore/apps/opie-bartender/bartender.pro7
-rw-r--r--noncore/apps/opie-bartender/config.in3
-rw-r--r--noncore/apps/opie-console/MyPty.cpp14
-rw-r--r--noncore/apps/opie-console/TEWidget.cpp6
-rw-r--r--noncore/apps/opie-console/TEmulation.cpp8
-rw-r--r--noncore/apps/opie-console/atconfigdialog.cpp13
-rw-r--r--noncore/apps/opie-console/dialer.cpp27
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp14
-rw-r--r--noncore/apps/opie-console/emulation_widget.cpp10
-rw-r--r--noncore/apps/opie-console/function_keyboard.cpp9
-rw-r--r--noncore/apps/opie-console/io_bt.cpp7
-rw-r--r--noncore/apps/opie-console/io_irda.cpp8
-rw-r--r--noncore/apps/opie-console/io_modem.cpp8
-rw-r--r--noncore/apps/opie-console/main.cpp2
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp39
-rw-r--r--noncore/apps/opie-console/modemconfigwidget.cpp11
-rw-r--r--noncore/apps/opie-console/opie-console.pro4
-rw-r--r--noncore/apps/opie-console/sz_transfer.cpp6
-rw-r--r--noncore/apps/opie-console/tabwidget.cpp7
-rw-r--r--noncore/apps/opie-console/terminalwidget.cpp11
-rw-r--r--noncore/apps/opie-console/test/senderui.cpp14
-rw-r--r--noncore/apps/opie-console/widget.cpp6
-rw-r--r--noncore/apps/opie-console/widget_layer.cpp4
-rw-r--r--noncore/apps/opie-write/mainwindow.cpp12
-rw-r--r--noncore/apps/opie-write/opie-write.pro3
-rw-r--r--noncore/apps/opie-write/qcomplextext.cpp4
-rw-r--r--noncore/apps/opie-write/qrichtext.cpp28
-rw-r--r--noncore/apps/opie-write/qrichtext_p.cpp15
-rwxr-xr-xnoncore/apps/qashmoney/accountdisplay.cpp13
-rw-r--r--noncore/apps/qashmoney/config.in2
-rwxr-xr-xnoncore/apps/qashmoney/qashmoney.pro2
-rw-r--r--noncore/apps/tableviewer/db/common.cpp28
-rw-r--r--noncore/apps/tableviewer/db/datacache.cpp12
-rw-r--r--noncore/apps/tableviewer/db/xmlsource.cpp30
-rw-r--r--noncore/apps/tableviewer/tableviewer.cpp14
-rw-r--r--noncore/apps/tableviewer/tableviewer.pro8
-rw-r--r--noncore/apps/tableviewer/ui/tvlistview.cpp9
-rw-r--r--noncore/apps/tinykate/libkate/libkate.pro147
-rw-r--r--noncore/apps/tinykate/tinykate.pro26
-rw-r--r--noncore/apps/zsafe/config.in2
-rw-r--r--noncore/apps/zsafe/scqtfiledlg.cpp29
-rw-r--r--noncore/apps/zsafe/zsafe.cpp15
-rw-r--r--noncore/apps/zsafe/zsafe.pro14
-rw-r--r--noncore/comm/keypebble/config.in2
-rw-r--r--noncore/comm/keypebble/keypebble.pro9
-rw-r--r--noncore/comm/keypebble/krfbbuffer.cpp24
-rw-r--r--noncore/comm/keypebble/krfbcanvas.cpp8
-rw-r--r--noncore/comm/keypebble/krfbconnection.cpp31
-rw-r--r--noncore/comm/keypebble/krfbdecoder.cpp63
-rw-r--r--noncore/comm/keypebble/krfblogin.cpp41
-rw-r--r--noncore/comm/keypebble/kvncbookmarkdlg.cpp12
-rw-r--r--noncore/games/backgammon/backgammon.cpp16
-rw-r--r--noncore/games/backgammon/moveengine.cpp2
-rw-r--r--noncore/games/bounce/bounce.pro5
-rw-r--r--noncore/games/bounce/game.cpp15
-rw-r--r--noncore/games/go/go.pro15
-rw-r--r--noncore/games/go/gowidget.cpp9
-rw-r--r--noncore/games/kpacman/kpacman.pro4
-rw-r--r--noncore/games/kpacman/kpacmanwidget.cpp5
-rw-r--r--noncore/games/kpacman/status.cpp5
-rw-r--r--noncore/games/mindbreaker/mindbreaker.cpp2
-rw-r--r--noncore/games/oyatzee/oyatzee.cpp50
-rw-r--r--noncore/games/oyatzee/oyatzee.pro2
-rw-r--r--noncore/games/wordgame/wordgame.cpp2
-rw-r--r--noncore/graphics/opie-eye/config.in4
-rw-r--r--noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp14
-rw-r--r--noncore/graphics/opie-eye/impl/dir/dir_lister.cpp8
-rw-r--r--noncore/graphics/opie-eye/lib/slavemaster.cpp12
-rw-r--r--noncore/graphics/opie-eye/phunk_view.pro2
-rw-r--r--noncore/graphics/opie-eye/slave/jpeg_slave.cpp18
-rw-r--r--noncore/graphics/opie-eye/slave/main.cpp16
-rw-r--r--noncore/graphics/opie-eye/slave/slave.pro6
-rw-r--r--noncore/graphics/opie-eye/slave/slavereciever.cpp22
-rw-r--r--noncore/graphics/opie-eye/slave/thumbnailtool.cpp11
-rw-r--r--noncore/multimedia/opieplayer2/audiowidget.cpp8
-rw-r--r--noncore/multimedia/opieplayer2/lib.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp12
-rw-r--r--noncore/multimedia/opieplayer2/om3u.cpp14
-rw-r--r--noncore/multimedia/opieplayer2/playlistselection.cpp10
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp38
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidgetgui.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/skin.cpp24
-rw-r--r--noncore/multimedia/opieplayer2/threadutil.cpp6
-rw-r--r--noncore/multimedia/opieplayer2/xinecontrol.cpp8
-rw-r--r--noncore/multimedia/opierec/device.cpp46
-rw-r--r--noncore/multimedia/opierec/helpwindow.cpp11
-rw-r--r--noncore/multimedia/opierec/opierec.pro6
-rw-r--r--noncore/multimedia/opierec/qtrec.cpp129
-rw-r--r--noncore/multimedia/opierec/wavFile.cpp67
-rw-r--r--noncore/multimedia/opierec/waveform.cpp12
-rw-r--r--noncore/multimedia/powerchord/config.in6
-rw-r--r--noncore/multimedia/powerchord/powerchord.pro3
-rw-r--r--noncore/multimedia/powerchord/powerchordbase.cpp12
-rw-r--r--noncore/multimedia/showimg/ImageFileSelector.cpp20
-rw-r--r--noncore/multimedia/showimg/showimg.cpp20
-rw-r--r--noncore/multimedia/showimg/showimg.pro2
-rw-r--r--noncore/multimedia/tonleiter/config.in2
-rw-r--r--noncore/multimedia/tonleiter/editinst.cpp11
-rw-r--r--noncore/multimedia/tonleiter/fretboard.cpp13
-rw-r--r--noncore/multimedia/tonleiter/tonleiter.pro6
-rw-r--r--noncore/multimedia/tonleiter/tonleiterdata.cpp11
-rw-r--r--noncore/multimedia/tonleiter/tonleiterdatahelper.cpp6
-rw-r--r--noncore/net/mail/accountitem.cpp18
-rw-r--r--noncore/net/mail/accountview.cpp12
-rw-r--r--noncore/net/mail/composemail.cpp6
-rw-r--r--noncore/net/mail/editaccounts.cpp22
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.cpp8
-rw-r--r--noncore/net/mail/libmailwrapper/generatemail.cpp30
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp14
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp66
-rw-r--r--noncore/net/mail/libmailwrapper/logindialog.cpp2
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.cpp10
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.cpp2
-rw-r--r--noncore/net/mail/libmailwrapper/mboxwrapper.cpp22
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp60
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp8
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp10
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp18
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp30
-rw-r--r--noncore/net/mail/libmailwrapper/statusmail.cpp6
-rw-r--r--noncore/net/mail/libmailwrapper/storemail.cpp4
-rw-r--r--noncore/net/mail/mainwindow.cpp14
-rw-r--r--noncore/net/mail/nntpgroups.cpp2
-rw-r--r--noncore/net/mail/opiemail.cpp16
-rw-r--r--noncore/net/mail/taskbarapplet/mailapplet.cpp2
-rw-r--r--noncore/net/mail/viewmail.cpp2
-rw-r--r--noncore/net/opieftp/config.in2
-rw-r--r--noncore/net/opieftp/filePermissions.cpp2
-rw-r--r--noncore/net/opieftp/opieftp.cpp77
-rw-r--r--noncore/net/opieftp/opieftp.pro11
-rw-r--r--noncore/net/opieirc/config.in2
-rw-r--r--noncore/net/opieirc/ircmisc.cpp9
-rw-r--r--noncore/net/opieirc/opieirc.pro13
-rw-r--r--noncore/net/opietooth/applet/bluezapplet.cpp2
-rw-r--r--noncore/net/opietooth/lib/startdunconnection.cpp2
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.cpp8
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp16
-rw-r--r--noncore/net/opietooth/manager/devicehandler.cpp10
-rw-r--r--noncore/net/opietooth/manager/dunpopup.cpp2
-rw-r--r--noncore/net/opietooth/manager/hciconfwrapper.cpp16
-rw-r--r--noncore/net/opietooth/manager/obexdialog.cpp2
-rw-r--r--noncore/net/opietooth/manager/obexpopup.cpp4
-rw-r--r--noncore/net/opietooth/manager/panpopup.cpp2
-rw-r--r--noncore/net/opietooth/manager/popuphelper.cpp4
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp2
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp4
-rw-r--r--noncore/net/opietooth/manager/rfcommconfhandler.cpp10
-rw-r--r--noncore/net/opietooth/manager/rfcpopup.cpp8
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp30
-rw-r--r--noncore/net/wellenreiter/gui/gps.cpp12
-rw-r--r--noncore/net/wellenreiter/gui/logwindow.cpp8
-rw-r--r--noncore/net/wellenreiter/gui/main.cpp15
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp57
-rw-r--r--noncore/net/wellenreiter/gui/packetview.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/resource.cpp4
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp77
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp74
-rw-r--r--noncore/settings/backup/backuprestore.cpp28
-rw-r--r--noncore/settings/netsystemtime/settingstabwidget.cpp2
-rw-r--r--noncore/settings/networksettings/interfaces/interface.cpp20
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.cpp42
-rw-r--r--noncore/settings/networksettings/interfaces/interfacesetupimp.cpp14
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp38
-rw-r--r--noncore/settings/networksettings/ppp/accounts.cpp2
-rw-r--r--noncore/settings/networksettings/ppp/authwidget.cpp4
-rw-r--r--noncore/settings/networksettings/ppp/connect.cpp10
-rw-r--r--noncore/settings/networksettings/ppp/devices.cpp4
-rw-r--r--noncore/settings/networksettings/ppp/general.cpp2
-rw-r--r--noncore/settings/networksettings/ppp/interfaceinformationppp.cpp2
-rw-r--r--noncore/settings/networksettings/ppp/interfaceppp.cpp14
-rw-r--r--noncore/settings/networksettings/ppp/kpppwidget.cpp20
-rw-r--r--noncore/settings/networksettings/ppp/modem.cpp48
-rw-r--r--noncore/settings/networksettings/ppp/pppconfig.cpp12
-rw-r--r--noncore/settings/networksettings/ppp/pppdata.cpp92
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp20
-rw-r--r--noncore/settings/networksettings/wlan/infoimp.cpp4
-rw-r--r--noncore/settings/networksettings/wlan/wextensions.cpp12
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp6
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.cpp24
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp54
-rw-r--r--noncore/settings/sound/sound.pro11
-rw-r--r--noncore/settings/sound/soundsettings.cpp16
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.cpp10
-rw-r--r--noncore/settings/tabmanager/tabmanager.cpp20
-rw-r--r--noncore/settings/usermanager/userdialog.cpp14
-rw-r--r--noncore/settings/usermanager/usermanager.cpp11
-rw-r--r--noncore/settings/usermanager/usermanager.pro9
-rw-r--r--noncore/styles/liquid/config.in2
-rw-r--r--noncore/styles/liquid/liquid.cpp27
-rw-r--r--noncore/styles/liquid/liquid.pro6
-rw-r--r--noncore/styles/theme/othemebase.cpp27
-rw-r--r--noncore/todayplugins/fortune/fortune.pro1
-rw-r--r--noncore/todayplugins/fortune/fortunepluginwidget.cpp9
-rw-r--r--noncore/todayplugins/stockticker/stockticker/inputDialog.cpp18
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/config.in2
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro5
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp10
-rw-r--r--noncore/tools/calc2/engine.cpp10
-rw-r--r--noncore/tools/calculator/calculator.pro4
-rw-r--r--noncore/tools/calculator/calculatorimpl.cpp11
-rw-r--r--noncore/tools/formatter/formatter.cpp36
-rw-r--r--noncore/tools/formatter/formatter.pro10
232 files changed, 2793 insertions, 2569 deletions
diff --git a/noncore/applets/autorotateapplet/autorotate.cpp b/noncore/applets/autorotateapplet/autorotate.cpp
index ae7fbd0..34802fb 100644
--- a/noncore/applets/autorotateapplet/autorotate.cpp
+++ b/noncore/applets/autorotateapplet/autorotate.cpp
@@ -10,22 +10,22 @@
10 * * 10 * *
11 *************************************************************************/ 11 *************************************************************************/
12 12
13#include "autorotate.h" 13#include "autorotate.h"
14 14
15/* OPIE */ 15/* OPIE */
16#include <opie2/odevice.h> 16#include <opie2/odebug.h>
17#include <opie2/otaskbarapplet.h> 17#include <opie2/otaskbarapplet.h>
18#include <qpe/applnk.h> 18#include <qpe/applnk.h>
19#include <qpe/config.h> 19#include <qpe/config.h>
20#include <qpe/resource.h> 20#include <qpe/resource.h>
21using namespace Opie::Core;
21 22
22/* QT */ 23/* QT */
23#include <qpainter.h> 24#include <qpainter.h>
24 25
25using namespace Opie::Ui;
26AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) 26AutoRotate::AutoRotate(QWidget * parent):QWidget(parent)
27{ 27{
28 setFixedWidth( AppLnk::smallIconSize() ); 28 setFixedWidth( AppLnk::smallIconSize() );
29 setFixedHeight( AppLnk::smallIconSize() ); 29 setFixedHeight( AppLnk::smallIconSize() );
30 30
31 enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) ); 31 enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) );
@@ -84,14 +84,14 @@ bool AutoRotate::isRotateEnabled()
84 Config cfg( "qpe" ); 84 Config cfg( "qpe" );
85 cfg.setGroup( "Appearance" ); 85 cfg.setGroup( "Appearance" );
86 86
87 bool res = cfg.readBoolEntry( "rotateEnabled" ); 87 bool res = cfg.readBoolEntry( "rotateEnabled" );
88 88
89 if (res ) 89 if (res )
90 qDebug("Enabled"); 90 odebug << "Enabled" << oendl;
91 else 91 else
92 qDebug("Disabled"); 92 odebug << "Disabled" << oendl;
93 return res; 93 return res;
94} 94}
95 95
96EXPORT_OPIE_APPLET_v1( AutoRotate ) 96EXPORT_OPIE_APPLET_v1( AutoRotate )
97 97
diff --git a/noncore/applets/memoryapplet/swapfile.cpp b/noncore/applets/memoryapplet/swapfile.cpp
index 9416db3..a71078f 100644
--- a/noncore/applets/memoryapplet/swapfile.cpp
+++ b/noncore/applets/memoryapplet/swapfile.cpp
@@ -17,12 +17,18 @@
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "swapfile.h" 21#include "swapfile.h"
22 22
23/* OPIE */
24#include <opie2/odebug.h>
25#include <qpe/resource.h>
26using namespace Opie::Core;
27
28/* QT */
23#include <qfile.h> 29#include <qfile.h>
24#include <qtextstream.h> 30#include <qtextstream.h>
25#include <qlabel.h> 31#include <qlabel.h>
26#include <qtimer.h> 32#include <qtimer.h>
27#include <qlayout.h> 33#include <qlayout.h>
28#include <qpushbutton.h> 34#include <qpushbutton.h>
@@ -31,19 +37,18 @@
31#include <qlineedit.h> 37#include <qlineedit.h>
32#include <qprogressbar.h> 38#include <qprogressbar.h>
33#include <qcombobox.h> 39#include <qcombobox.h>
34#include <qvgroupbox.h> 40#include <qvgroupbox.h>
35#include <qhbox.h> 41#include <qhbox.h>
36#include <qmessagebox.h> 42#include <qmessagebox.h>
43#include <qcopchannel_qws.h>
44
45/* STD */
37#include <stdio.h> 46#include <stdio.h>
38#include <stdlib.h> 47#include <stdlib.h>
39#include <string.h> 48#include <string.h>
40
41#include <qcopchannel_qws.h>
42#include <qpe/resource.h>
43
44#include <unistd.h> 49#include <unistd.h>
45#include <fcntl.h> 50#include <fcntl.h>
46#include <sys/vfs.h> 51#include <sys/vfs.h>
47#include <mntent.h> 52#include <mntent.h>
48#include <unistd.h> 53#include <unistd.h>
49#include <sys/types.h> 54#include <sys/types.h>
@@ -51,17 +56,17 @@
51Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) 56Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
52 : QWidget( parent, name, f ) 57 : QWidget( parent, name, f )
53{ 58{
54 // are we running as root? 59 // are we running as root?
55 isRoot = geteuid() == 0; 60 isRoot = geteuid() == 0;
56 61
57 QVBoxLayout* vb = new QVBoxLayout(this, 5); 62 QVBoxLayout* vb = new QVBoxLayout(this, 5);
58 63
59 QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this); 64 QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this);
60 cfsdRBG->setRadioButtonExclusive(true); 65 cfsdRBG->setRadioButtonExclusive(true);
61 vb->addWidget(cfsdRBG); 66 vb->addWidget(cfsdRBG);
62 67
63 ramRB = new QRadioButton(tr("RAM"), cfsdRBG); 68 ramRB = new QRadioButton(tr("RAM"), cfsdRBG);
64 cfRB = new QRadioButton(tr("CF Card"), cfsdRBG); 69 cfRB = new QRadioButton(tr("CF Card"), cfsdRBG);
65 sdRB = new QRadioButton(tr("SD Card"), cfsdRBG); 70 sdRB = new QRadioButton(tr("SD Card"), cfsdRBG);
66 71
67 QHBox *hb1 = new QHBox(this); 72 QHBox *hb1 = new QHBox(this);
@@ -72,13 +77,13 @@ Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f )
72 77
73 QPushButton* swapOn = new QPushButton(tr(" On "), hb1); 78 QPushButton* swapOn = new QPushButton(tr(" On "), hb1);
74 QPushButton* swapOff = new QPushButton(tr(" Off "), hb1); 79 QPushButton* swapOff = new QPushButton(tr(" Off "), hb1);
75 vb->addWidget(hb1); 80 vb->addWidget(hb1);
76 81
77 QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this); 82 QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this);
78 vb->addWidget(box1); 83 vb->addWidget(box1);
79 84
80 QHBox *hb2 = new QHBox(box1); 85 QHBox *hb2 = new QHBox(box1);
81 hb2->setSpacing(5); 86 hb2->setSpacing(5);
82 QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2); 87 QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2);
83 QPushButton* rmSwap = new QPushButton(tr("Remove"), hb2); 88 QPushButton* rmSwap = new QPushButton(tr("Remove"), hb2);
84 89
@@ -210,13 +215,13 @@ void Swapfile::getStatusPcmcia()
210 cfRB->setEnabled(FALSE); 215 cfRB->setEnabled(FALSE);
211 } 216 }
212 } 217 }
213 } 218 }
214 } else { 219 } else {
215 // no file found 220 // no file found
216 qDebug("no file found"); 221 odebug << "no file found" << oendl;
217 cardInPcmcia0 = FALSE; 222 cardInPcmcia0 = FALSE;
218 cardInPcmcia1 = FALSE; 223 cardInPcmcia1 = FALSE;
219 } 224 }
220 Swapfile::cfsdchecked(); 225 Swapfile::cfsdchecked();
221} 226}
222 227
diff --git a/noncore/applets/networkapplet/networkapplet.cpp b/noncore/applets/networkapplet/networkapplet.cpp
index 5eb5ad2..534a8d0 100644
--- a/noncore/applets/networkapplet/networkapplet.cpp
+++ b/noncore/applets/networkapplet/networkapplet.cpp
@@ -33,23 +33,25 @@
33/* OPIE */ 33/* OPIE */
34#include <opie2/odebug.h> 34#include <opie2/odebug.h>
35#include <opie2/onetwork.h> 35#include <opie2/onetwork.h>
36#include <opie2/otaskbarapplet.h> 36#include <opie2/otaskbarapplet.h>
37#include <qpe/applnk.h> 37#include <qpe/applnk.h>
38#include <qpe/resource.h> 38#include <qpe/resource.h>
39#include <qpainter.h> 39using namespace Opie::Core;
40using namespace Opie::Ui;
41using namespace Opie::Net;
40 42
41/* QT */ 43/* QT */
44#include <qpainter.h>
42#include <qlabel.h> 45#include <qlabel.h>
43#include <qlayout.h> 46#include <qlayout.h>
44#include <qobjectlist.h> 47#include <qobjectlist.h>
45 48
49/* STD */
46#include <assert.h> 50#include <assert.h>
47 51
48using namespace Opie::Ui;
49using namespace Opie::Net;
50IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name ) 52IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name )
51 :QToolButton( parent, name ) 53 :QToolButton( parent, name )
52{ 54{
53 _iface = ONetwork::instance()->interface( name ); 55 _iface = ONetwork::instance()->interface( name );
54 assert( _iface ); 56 assert( _iface );
55 setToggleButton( true ); 57 setToggleButton( true );
@@ -164,21 +166,21 @@ QString NetworkAppletControl::guessDevice( ONetworkInterface* iface )
164 166
165} 167}
166 168
167 169
168void NetworkAppletControl::showEvent( QShowEvent* e ) 170void NetworkAppletControl::showEvent( QShowEvent* e )
169{ 171{
170 qDebug( "showEvent" ); 172 odebug << "showEvent" << oendl;
171 build(); 173 build();
172 QWidget::showEvent( e ); 174 QWidget::showEvent( e );
173} 175}
174 176
175 177
176void NetworkAppletControl::hideEvent( QHideEvent* e ) 178void NetworkAppletControl::hideEvent( QHideEvent* e )
177{ 179{
178 qDebug( "hideEvent" ); 180 odebug << "hideEvent" << oendl;
179 QWidget::hideEvent( e ); 181 QWidget::hideEvent( e );
180 182
181 delete l; 183 delete l;
182 184
183 // delete all child widgets from this frame 185 // delete all child widgets from this frame
184 QObjectList* list = const_cast<QObjectList*>( children() ); 186 QObjectList* list = const_cast<QObjectList*>( children() );
@@ -189,24 +191,24 @@ void NetworkAppletControl::hideEvent( QHideEvent* e )
189 ++it; 191 ++it;
190 delete obj; 192 delete obj;
191 } 193 }
192 194
193 list = const_cast<QObjectList*>( children() ); 195 list = const_cast<QObjectList*>( children() );
194 if ( list ) 196 if ( list )
195 qWarning( "D'oh! We still have %d children...", list->count() ); 197 owarn << "D'oh! We still have " << list->count() << " children..." << oendl;
196 198
197 // renew layout 199 // renew layout
198 l = new QVBoxLayout( this, 4, 2 ); 200 l = new QVBoxLayout( this, 4, 2 );
199 resize( 0, 0 ); 201 resize( 0, 0 );
200} 202}
201 203
202 204
203QSize NetworkAppletControl::sizeHint() const 205QSize NetworkAppletControl::sizeHint() const
204{ 206{
205 ONetwork::instance()->synchronize(); // rebuild interface database 207 ONetwork::instance()->synchronize(); // rebuild interface database
206 qDebug( "sizeHint (#ifaces=%d)", ONetwork::instance()->count() ); 208 odebug << "sizeHint (#ifaces=" << ONetwork::instance()->count() << ")" << oendl;
207 return QSize( 14+35+105+14 + 8, ONetwork::instance()->count() * 26 ); 209 return QSize( 14+35+105+14 + 8, ONetwork::instance()->count() * 26 );
208} 210}
209 211
210 212
211NetworkApplet::NetworkApplet( QWidget *parent, const char *name ) 213NetworkApplet::NetworkApplet( QWidget *parent, const char *name )
212 :OTaskbarApplet( parent, name ) 214 :OTaskbarApplet( parent, name )
diff --git a/noncore/applets/notesapplet/config.in b/noncore/applets/notesapplet/config.in
index 27a8187..c92c1d5 100644
--- a/noncore/applets/notesapplet/config.in
+++ b/noncore/applets/notesapplet/config.in
@@ -1,4 +1,4 @@
1 config NOTESAPPLET 1 config NOTESAPPLET
2 boolean "opie-notesapplet (quick note taking applet)" 2 boolean "opie-notesapplet (quick note taking applet)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index 13f7cf3..b3e72a7 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -12,44 +12,46 @@
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**********************************************************************/ 14**********************************************************************/
15 15
16#include "notes.h" 16#include "notes.h"
17 17
18#include <qapplication.h> 18/* OPIE */
19#include <stdlib.h> 19#include <opie2/odebug.h>
20#include <qstringlist.h>
21
22#include <opie2/otaskbarapplet.h> 20#include <opie2/otaskbarapplet.h>
23#include <qpe/filemanager.h> 21#include <qpe/filemanager.h>
24#include <qpe/qpeapplication.h> 22#include <qpe/qpeapplication.h>
25#include <qpe/timestring.h> 23#include <qpe/timestring.h>
26#include <qpe/applnk.h> 24#include <qpe/applnk.h>
27#include <qpe/ir.h> 25#include <qpe/ir.h>
28#include <qpe/config.h> 26#include <qpe/config.h>
27using namespace Opie::Core;
28using namespace Opie::Ui;
29 29
30// #include <qsocket.h> 30/* QT */
31// #include <qclipboard.h>
32#include <qmultilineedit.h> 31#include <qmultilineedit.h>
33#include <qlistbox.h> 32#include <qlistbox.h>
34#include <qpopupmenu.h> 33#include <qpopupmenu.h>
35#include <qmessagebox.h> 34#include <qmessagebox.h>
36 35#include <qapplication.h>
37#include <qdir.h> 36#include <qdir.h>
38#include <qfile.h> 37#include <qfile.h>
39#include <qpoint.h> 38#include <qpoint.h>
40#include <qpushbutton.h> 39#include <qpushbutton.h>
41#include <qpainter.h> 40#include <qpainter.h>
42#include <qlayout.h> 41#include <qlayout.h>
43#include <qframe.h> 42#include <qframe.h>
44#include <qpixmap.h> 43#include <qpixmap.h>
45#include <qstring.h> 44#include <qstring.h>
45#include <qstringlist.h>
46#include <qtimer.h> 46#include <qtimer.h>
47 47
48/* STD */
49#include <stdlib.h>
50
48/* XPM */ 51/* XPM */
49using namespace Opie::Ui;
50static char * notes_xpm[] = { 52static char * notes_xpm[] = {
51"16 16 11 1", 53"16 16 11 1",
52" c None", 54" c None",
53". c #000000", 55". c #000000",
54"+ c #7F7F7F", 56"+ c #7F7F7F",
55"@ c #BFBFBF", 57"@ c #BFBFBF",
@@ -81,15 +83,15 @@ static char * notes_xpm[] = {
81NotesControl::NotesControl( QWidget *, const char * ) 83NotesControl::NotesControl( QWidget *, const char * )
82 : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop ) 84 : QVBox( 0, "NotesControl",/* WDestructiveClose | */WStyle_StaysOnTop )
83// : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) 85// : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup )
84{ 86{
85 QDir d( QDir::homeDirPath()+"/notes"); 87 QDir d( QDir::homeDirPath()+"/notes");
86 if( !d.exists()) { 88 if( !d.exists()) {
87 qDebug("make dir"); 89 odebug << "make dir" << oendl;
88 if(!d.mkdir( QDir::homeDirPath()+"/notes", true)) 90 if(!d.mkdir( QDir::homeDirPath()+"/notes", true))
89 qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed"); 91 odebug << "<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed" << oendl;
90 } 92 }
91 Config cfg("Notes"); 93 Config cfg("Notes");
92 cfg.setGroup("Options"); 94 cfg.setGroup("Options");
93 showMax = cfg.readBoolEntry("ShowMax", false); 95 showMax = cfg.readBoolEntry("ShowMax", false);
94 96
95 setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); 97 setFrameStyle( QFrame::PopupPanel | QFrame::Raised );
@@ -162,43 +164,43 @@ void NotesControl::slotDeleteButtonClicked() {
162 }; 164 };
163} 165}
164 166
165void NotesControl::slotDeleteButton() { 167void NotesControl::slotDeleteButton() {
166 168
167 QString selectedText = box->currentText(); 169 QString selectedText = box->currentText();
168 qDebug("deleting "+selectedText); 170 odebug << "deleting "+selectedText << oendl;
169 171
170 if( !selectedText.isEmpty()) { 172 if( !selectedText.isEmpty()) {
171 173
172 Config cfg("Notes"); 174 Config cfg("Notes");
173 cfg.setGroup("Docs"); 175 cfg.setGroup("Docs");
174 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 176 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
175 QString entryName, entryName2;; 177 QString entryName, entryName2;;
176 for ( int i = 0; i < noOfFiles; i++ ) { 178 for ( int i = 0; i < noOfFiles; i++ ) {
177 entryName.sprintf( "File%i", i + 1 ); 179 entryName.sprintf( "File%i", i + 1 );
178 if(selectedText == cfg.readEntry( entryName )) { 180 if(selectedText == cfg.readEntry( entryName )) {
179 qDebug("removing %s, %d", selectedText.latin1(), i); 181 odebug << "removing " << selectedText.latin1() << ", " << i << "" << oendl;
180 for ( int j = i; j < noOfFiles; j++ ) { 182 for ( int j = i; j < noOfFiles; j++ ) {
181 entryName.sprintf( "File%i", i + 1 ); 183 entryName.sprintf( "File%i", i + 1 );
182 entryName2.sprintf( "File%i", i + 2 ); 184 entryName2.sprintf( "File%i", i + 2 );
183 QString temp = cfg.readEntry(entryName2); 185 QString temp = cfg.readEntry(entryName2);
184 qDebug("move "+temp); 186 odebug << "move "+temp << oendl;
185 cfg.writeEntry(entryName, temp); 187 cfg.writeEntry(entryName, temp);
186 i++; 188 i++;
187 } 189 }
188 cfg.writeEntry("NumberOfFiles", noOfFiles-1 ); 190 cfg.writeEntry("NumberOfFiles", noOfFiles-1 );
189 entryName.sprintf( "File%i", noOfFiles ); 191 entryName.sprintf( "File%i", noOfFiles );
190 cfg.removeEntry(entryName); 192 cfg.removeEntry(entryName);
191 cfg.write(); 193 cfg.write();
192 DocLnk nf(selectedText); 194 DocLnk nf(selectedText);
193 nf.removeFiles(); 195 nf.removeFiles();
194 QString fi=QPEApplication::documentDir()+"/text/plain/"+selectedText+".desktop"; 196 QString fi=QPEApplication::documentDir()+"/text/plain/"+selectedText+".desktop";
195 qDebug(fi); 197 odebug << fi << oendl;
196 198
197 QFile f( fi); 199 QFile f( fi);
198 if( !f.remove()) qDebug(".desktop file not removed"); 200 if( !f.remove()) odebug << ".desktop file not removed" << oendl;
199 201
200 } 202 }
201 } 203 }
202 view->clear(); 204 view->clear();
203 205
204 populateBox(); 206 populateBox();
@@ -280,13 +282,13 @@ void NotesControl::focusOutEvent ( QFocusEvent * e) {
280} 282}
281 283
282void NotesControl::save() { 284void NotesControl::save() {
283 Config cfg("Notes"); 285 Config cfg("Notes");
284 cfg.setGroup("Docs"); 286 cfg.setGroup("Docs");
285 if( edited) { 287 if( edited) {
286// qDebug("is edited"); 288// odebug << "is edited" << oendl;
287 QString rt = view->text(); 289 QString rt = view->text();
288 if( rt.length()>1) { 290 if( rt.length()>1) {
289 QString pt = rt.simplifyWhiteSpace(); 291 QString pt = rt.simplifyWhiteSpace();
290 int i = pt.find( ' ', pt.find( ' ' )+2 ); 292 int i = pt.find( ' ', pt.find( ' ' )+2 );
291 QString docname = pt; 293 QString docname = pt;
292 if ( i > 0 ) 294 if ( i > 0 )
@@ -298,51 +300,51 @@ void NotesControl::save() {
298 // cut the length. filenames longer than that don't make sense 300 // cut the length. filenames longer than that don't make sense
299 // and something goes wrong when they get too long. 301 // and something goes wrong when they get too long.
300 if ( docname.length() > 40 ) 302 if ( docname.length() > 40 )
301 docname = docname.left(40); 303 docname = docname.left(40);
302 if ( docname.isEmpty() ) 304 if ( docname.isEmpty() )
303 docname = "Empty Text"; 305 docname = "Empty Text";
304// qDebug(docname); 306// odebug << docname << oendl;
305 307
306 if( oldDocName != docname) { 308 if( oldDocName != docname) {
307 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 309 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
308 QString entryName; 310 QString entryName;
309 entryName.sprintf( "File%i", noOfFiles + 1 ); 311 entryName.sprintf( "File%i", noOfFiles + 1 );
310 cfg.writeEntry( entryName,docname ); 312 cfg.writeEntry( entryName,docname );
311 cfg.writeEntry("NumberOfFiles", noOfFiles+1 ); 313 cfg.writeEntry("NumberOfFiles", noOfFiles+1 );
312 cfg.write(); 314 cfg.write();
313 } 315 }
314// else 316// else
315// qDebug("oldname equals docname"); 317// odebug << "oldname equals docname" << oendl;
316 318
317 doc = new DocLnk(docname); 319 doc = new DocLnk(docname);
318 if(QFile(doc->linkFile()).exists()) 320 if(QFile(doc->linkFile()).exists())
319 qDebug("puppie"); 321 odebug << "puppie" << oendl;
320 doc->setType("text/plain"); 322 doc->setType("text/plain");
321 doc->setName(docname); 323 doc->setName(docname);
322 QString temp = docname.replace( QRegExp(" "), "_" ); 324 QString temp = docname.replace( QRegExp(" "), "_" );
323 doc->setFile( QDir::homeDirPath()+"/notes/"+temp); 325 doc->setFile( QDir::homeDirPath()+"/notes/"+temp);
324 FileManager fm; 326 FileManager fm;
325 if ( !fm.saveFile( *doc, rt ) ) { 327 if ( !fm.saveFile( *doc, rt ) ) {
326 } 328 }
327 329
328 oldDocName=docname; 330 oldDocName=docname;
329 edited=false; 331 edited=false;
330// qDebug("save"); 332// odebug << "save" << oendl;
331 if (doPopulate) 333 if (doPopulate)
332 populateBox(); 334 populateBox();
333 } 335 }
334 cfg.writeEntry( "LastDoc",oldDocName ); 336 cfg.writeEntry( "LastDoc",oldDocName );
335 cfg.write(); 337 cfg.write();
336 338
337 } 339 }
338} 340}
339 341
340void NotesControl::populateBox() { 342void NotesControl::populateBox() {
341 box->clear(); 343 box->clear();
342// qDebug("populate"); 344// odebug << "populate" << oendl;
343 Config cfg("Notes"); 345 Config cfg("Notes");
344 cfg.setGroup("Docs"); 346 cfg.setGroup("Docs");
345 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 347 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
346 QStringList list; 348 QStringList list;
347 QString entryName; 349 QString entryName;
348 for ( int i = 0; i < noOfFiles; i++ ) { 350 for ( int i = 0; i < noOfFiles; i++ ) {
@@ -371,13 +373,13 @@ void NotesControl::load() {
371 cfg.writeEntry( "LastDoc",oldDocName ); 373 cfg.writeEntry( "LastDoc",oldDocName );
372 cfg.write(); 374 cfg.write();
373 } 375 }
374} 376}
375 377
376void NotesControl::load(const QString & file) { 378void NotesControl::load(const QString & file) {
377 qDebug("loading "+file); 379 odebug << "loading "+file << oendl;
378 QString name = file; 380 QString name = file;
379 QString temp; 381 QString temp;
380 if( !QFile( QDir::homeDirPath()+"/"+file).exists() ) 382 if( !QFile( QDir::homeDirPath()+"/"+file).exists() )
381 temp = QDir::homeDirPath()+"/notes/"+ name.replace( QRegExp(" "), "_" ); 383 temp = QDir::homeDirPath()+"/notes/"+ name.replace( QRegExp(" "), "_" );
382 else 384 else
383 temp = name; 385 temp = name;
@@ -398,13 +400,13 @@ void NotesControl::load(const QString & file) {
398} 400}
399 401
400void NotesControl::loadDoc( const DocLnk &f) { 402void NotesControl::loadDoc( const DocLnk &f) {
401 FileManager fm; 403 FileManager fm;
402 QString txt; 404 QString txt;
403 if ( !fm.loadFile( f, txt ) ) { 405 if ( !fm.loadFile( f, txt ) ) {
404 qDebug("could not load file "+f.file()); 406 odebug << "could not load file "+f.file() << oendl;
405 return; 407 return;
406 } 408 }
407 view->setText(txt); 409 view->setText(txt);
408} 410}
409 411
410void NotesControl::slotViewEdited() { 412void NotesControl::slotViewEdited() {
@@ -432,13 +434,13 @@ void NotesControl::slotSearch() {
432 434
433// void NotesControl::keyReleaseEvent( QKeyEvent *e) { 435// void NotesControl::keyReleaseEvent( QKeyEvent *e) {
434 436
435// switch ( e->state() ) { 437// switch ( e->state() ) {
436// case ControlButton: 438// case ControlButton:
437// if(e->key() == Key_C) { //copy 439// if(e->key() == Key_C) { //copy
438// qDebug("copy"); 440// odebug << "copy" << oendl;
439// QClipboard *cb = QApplication::clipboard(); 441// QClipboard *cb = QApplication::clipboard();
440// QString text; 442// QString text;
441 443
442// // Copy text from the clipboard (paste) 444// // Copy text from the clipboard (paste)
443// text = cb->text(); 445// text = cb->text();
444// } 446// }
@@ -479,16 +481,16 @@ void NotesApplet::mousePressEvent( QMouseEvent *) {
479 vc->save(); 481 vc->save();
480 vc->close(); 482 vc->close();
481 } else { 483 } else {
482// vc = new NotesControl; 484// vc = new NotesControl;
483// QPoint curPos = mapToGlobal( rect().topLeft() ); 485// QPoint curPos = mapToGlobal( rect().topLeft() );
484 if(vc->showMax) { 486 if(vc->showMax) {
485 qDebug("show max"); 487 odebug << "show max" << oendl;
486 vc->showMaximized(); 488 vc->showMaximized();
487 } else { 489 } else {
488 qDebug("no show max"); 490 odebug << "no show max" << oendl;
489 QWidget *wid = QPEApplication::desktop(); 491 QWidget *wid = QPEApplication::desktop();
490 QRect rect = QApplication::desktop()->geometry(); 492 QRect rect = QApplication::desktop()->geometry();
491 vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180); 493 vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180);
492 vc->move ( (rect.center()/2) - (vc->rect().center()/2)); 494 vc->move ( (rect.center()/2) - (vc->rect().center()/2));
493// vc->move( (( wid->width() / 2) - ( vc->width() / 2 ))-4, 28); 495// vc->move( (( wid->width() / 2) - ( vc->width() / 2 ))-4, 28);
494 } 496 }
diff --git a/noncore/applets/notesapplet/notesapplet.pro b/noncore/applets/notesapplet/notesapplet.pro
index 44e5b34..c3f9b1c 100644
--- a/noncore/applets/notesapplet/notesapplet.pro
+++ b/noncore/applets/notesapplet/notesapplet.pro
@@ -1,12 +1,12 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt plugin warn_on 2CONFIG += qt plugin warn_on
3HEADERS = notes.h 3HEADERS = notes.h
4SOURCES = notes.cpp 4SOURCES = notes.cpp
5TARGET = notesapplet 5TARGET = notesapplet
6DESTDIR = $(OPIEDIR)/plugins/applets 6DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe -lopiecore2
10VERSION = 1.0.0 10VERSION = 1.0.1
11 11
12include ( $(OPIEDIR)/include.pro ) 12include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp
index 0491a86..364f3ad 100644
--- a/noncore/applets/wirelessapplet/wireless.cpp
+++ b/noncore/applets/wirelessapplet/wireless.cpp
@@ -13,16 +13,20 @@
13 13
14#include "wireless.h" 14#include "wireless.h"
15#include "mgraph.h" 15#include "mgraph.h"
16#include "advancedconfig.h" 16#include "advancedconfig.h"
17 17
18/* OPIE */ 18/* OPIE */
19#include <opie2/odebug.h>
19#include <opie2/onetwork.h> 20#include <opie2/onetwork.h>
20#include <opie2/otaskbarapplet.h> 21#include <opie2/otaskbarapplet.h>
21#include <qpe/config.h> 22#include <qpe/config.h>
22#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24using namespace Opie::Core;
25using namespace Opie::Ui;
26using namespace Opie::Net;
23 27
24/* QT */ 28/* QT */
25#include <qradiobutton.h> 29#include <qradiobutton.h>
26#include <qpushbutton.h> 30#include <qpushbutton.h>
27#include <qpainter.h> 31#include <qpainter.h>
28#include <qlabel.h> 32#include <qlabel.h>
@@ -40,14 +44,12 @@
40#define round qRound 44#define round qRound
41#endif 45#endif
42 46
43//#define MDEBUG 47//#define MDEBUG
44#undef MDEBUG 48#undef MDEBUG
45 49
46using namespace Opie::Ui;
47using namespace Opie::Net;
48WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) 50WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name )
49 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) 51 : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet )
50{ 52{
51 53
52 readConfig(); 54 readConfig();
53 writeConfigEntry( "UpdateFrequency", updateFrequency ); 55 writeConfigEntry( "UpdateFrequency", updateFrequency );
@@ -204,72 +206,72 @@ void WirelessApplet::checkInterface()
204 if ( it.current() && it.current()->isWireless() ) 206 if ( it.current() && it.current()->isWireless() )
205 interface = static_cast<OWirelessNetworkInterface*>( it.current() ); 207 interface = static_cast<OWirelessNetworkInterface*>( it.current() );
206 208
207 if ( interface ) 209 if ( interface )
208 { 210 {
209#ifdef MDEBUG 211#ifdef MDEBUG
210 qDebug( "WIFIAPPLET: using interface '%s'", ( const char* ) interface->name() ); 212 odebug << "WIFIAPPLET: using interface '" << ( const char* ) interface->name() << "'" << oendl;
211#endif 213#endif
212 214
213 } 215 }
214 else 216 else
215 { 217 {
216#ifdef MDEBUG 218#ifdef MDEBUG
217 qDebug( "WIFIAPPLET: D'oh! No Wireless interface present... :(" ); 219 odebug << "WIFIAPPLET: D'oh! No Wireless interface present... :(" << oendl;
218#endif 220#endif
219 hide(); 221 hide();
220 } 222 }
221} 223}
222 224
223void WirelessApplet::renewDHCP() 225void WirelessApplet::renewDHCP()
224{ 226{
225#ifdef MDEBUG 227#ifdef MDEBUG
226 qDebug( "WIFIAPPLET: Going to request a DHCP configuration renew." ); 228 odebug << "WIFIAPPLET: Going to request a DHCP configuration renew." << oendl;
227#endif 229#endif
228 230
229 QString pidfile; 231 QString pidfile;
230 if ( !interface ) 232 if ( !interface )
231 return ; 233 return ;
232 QString ifacename( interface->name() ); 234 QString ifacename( interface->name() );
233 235
234 // At first we are trying dhcpcd 236 // At first we are trying dhcpcd
235 237
236 pidfile.sprintf( "/var/run/dhcpcd-%s.pid", ( const char* ) ifacename ); 238 pidfile.sprintf( "/var/run/dhcpcd-%s.pid", ( const char* ) ifacename );
237#ifdef MDEBUG 239#ifdef MDEBUG
238 qDebug( "WIFIAPPLET: dhcpcd pidfile is '%s'", ( const char* ) pidfile ); 240 odebug << "WIFIAPPLET: dhcpcd pidfile is '" << ( const char* ) pidfile << "'" << oendl;
239#endif 241#endif
240 int pid; 242 int pid;
241 QFile pfile( pidfile ); 243 QFile pfile( pidfile );
242 bool hasFile = pfile.open( IO_ReadOnly ); 244 bool hasFile = pfile.open( IO_ReadOnly );
243 QTextStream s( &pfile ); 245 QTextStream s( &pfile );
244 if ( hasFile ) 246 if ( hasFile )
245 { 247 {
246 s >> pid; 248 s >> pid;
247#ifdef MDEBUG 249#ifdef MDEBUG
248 qDebug( "WIFIAPPLET: sent SIGALARM to pid %d", pid ); 250 odebug << "WIFIAPPLET: sent SIGALARM to pid " << pid << "" << oendl;
249#endif 251#endif
250 kill( pid, SIGALRM ); 252 kill( pid, SIGALRM );
251 return ; 253 return ;
252 } 254 }
253 255
254 // No dhcpcd, so we are trying udhcpc 256 // No dhcpcd, so we are trying udhcpc
255#ifdef MDEBUG 257#ifdef MDEBUG
256 qDebug( "WIFIAPPLET: dhcpcd not available." ); 258 odebug << "WIFIAPPLET: dhcpcd not available." << oendl;
257#endif 259#endif
258 pidfile.sprintf( "/var/run/udhcpc.%s.pid", ( const char* ) ifacename ); 260 pidfile.sprintf( "/var/run/udhcpc.%s.pid", ( const char* ) ifacename );
259#ifdef MDEBUG 261#ifdef MDEBUG
260 qDebug( "WIFIAPPLET: udhcpc pidfile is '%s'", ( const char* ) pidfile ); 262 odebug << "WIFIAPPLET: udhcpc pidfile is '" << ( const char* ) pidfile << "'" << oendl;
261#endif 263#endif
262 QFile pfile2( pidfile ); 264 QFile pfile2( pidfile );
263 hasFile = pfile2.open( IO_ReadOnly ); 265 hasFile = pfile2.open( IO_ReadOnly );
264 QTextStream s2( &pfile2 ); 266 QTextStream s2( &pfile2 );
265 if ( hasFile ) 267 if ( hasFile )
266 { 268 {
267 s2 >> pid; 269 s2 >> pid;
268#ifdef MDEBUG 270#ifdef MDEBUG
269 qDebug( "WIFIAPPLET: sent SIGUSR1 to pid %d", pid ); 271 odebug << "WIFIAPPLET: sent SIGUSR1 to pid " << pid << "" << oendl;
270#endif 272#endif
271 kill( pid, SIGUSR1 ); 273 kill( pid, SIGUSR1 );
272 return ; 274 return ;
273 } 275 }
274} 276}
275 277
@@ -300,30 +302,30 @@ void WirelessApplet::displayStyleChange( int style )
300WirelessApplet::~WirelessApplet() 302WirelessApplet::~WirelessApplet()
301{} 303{}
302 304
303void WirelessApplet::timerEvent( QTimerEvent* ) 305void WirelessApplet::timerEvent( QTimerEvent* )
304{ 306{
305#ifdef MDEBUG 307#ifdef MDEBUG
306 qDebug( "WirelessApplet::timerEvent" ); 308 odebug << "WirelessApplet::timerEvent" << oendl;
307#endif 309#endif
308 if ( interface ) 310 if ( interface )
309 { 311 {
310 if ( !ONetwork::instance()->isPresent( (const char*) interface->name() ) ) 312 if ( !ONetwork::instance()->isPresent( (const char*) interface->name() ) )
311 { 313 {
312#ifdef MDEBUG 314#ifdef MDEBUG
313 qDebug( "WIFIAPPLET: Interface no longer present." ); 315 odebug << "WIFIAPPLET: Interface no longer present." << oendl;
314#endif 316#endif
315 interface = 0L; 317 interface = 0L;
316 mustRepaint(); 318 mustRepaint();
317 return; 319 return;
318 } 320 }
319 321
320 if ( mustRepaint() ) 322 if ( mustRepaint() )
321 { 323 {
322#ifdef MDEBUG 324#ifdef MDEBUG
323 qDebug( "WIFIAPPLET: A value has changed -> repainting." ); 325 odebug << "WIFIAPPLET: A value has changed -> repainting." << oendl;
324#endif 326#endif
325 repaint(); 327 repaint();
326 } 328 }
327 329
328 if ( status->isVisible() ) 330 if ( status->isVisible() )
329 { 331 {
@@ -353,20 +355,20 @@ bool WirelessApplet::mustRepaint()
353 if ( interface != oldiface ) 355 if ( interface != oldiface )
354 { 356 {
355 oldiface = interface; 357 oldiface = interface;
356 if ( interface ) 358 if ( interface )
357 { 359 {
358#ifdef MDEBUG 360#ifdef MDEBUG
359 qDebug( "WIFIAPPLET: We had no interface but now we have one! :-)" ); 361 odebug << "WIFIAPPLET: We had no interface but now we have one! :-)" << oendl;
360#endif 362#endif
361 show(); 363 show();
362 } 364 }
363 else 365 else
364 { 366 {
365#ifdef MDEBUG 367#ifdef MDEBUG
366 qDebug( "WIFIAPPLET: We had a interface but now we don't have one! ;-(" ); 368 odebug << "WIFIAPPLET: We had a interface but now we don't have one! ;-(" << oendl;
367#endif 369#endif
368 hide(); 370 hide();
369 return true; 371 return true;
370 } 372 }
371 } 373 }
372 374
@@ -392,34 +394,34 @@ bool WirelessApplet::mustRepaint()
392 return true; 394 return true;
393 } 395 }
394 396
395 if ( rocESSID && ( oldESSID != interface->SSID() ) ) 397 if ( rocESSID && ( oldESSID != interface->SSID() ) )
396 { 398 {
397#ifdef MDEBUG 399#ifdef MDEBUG
398 qDebug( "WIFIAPPLET: ESSID has changed." ); 400 odebug << "WIFIAPPLET: ESSID has changed." << oendl;
399#endif 401#endif
400 renewDHCP(); 402 renewDHCP();
401 } 403 }
402 else if ( rocFREQ && ( oldFREQ != interface->frequency() ) ) 404 else if ( rocFREQ && ( oldFREQ != interface->frequency() ) )
403 { 405 {
404#ifdef MDEBUG 406#ifdef MDEBUG
405 qDebug( "WIFIAPPLET: FREQ has changed." ); 407 odebug << "WIFIAPPLET: FREQ has changed." << oendl;
406#endif 408#endif
407 renewDHCP(); 409 renewDHCP();
408 } 410 }
409 else if ( rocAP && ( oldAP != interface->associatedAP().toString() ) ) 411 else if ( rocAP && ( oldAP != interface->associatedAP().toString() ) )
410 { 412 {
411#ifdef MDEBUG 413#ifdef MDEBUG
412 qDebug( "WIFIAPPLET: AP has changed." ); 414 odebug << "WIFIAPPLET: AP has changed." << oendl;
413#endif 415#endif
414 renewDHCP(); 416 renewDHCP();
415 } 417 }
416 else if ( rocMODE && ( oldMODE != interface->mode() ) ) 418 else if ( rocMODE && ( oldMODE != interface->mode() ) )
417 { 419 {
418#ifdef MDEBUG 420#ifdef MDEBUG
419 qDebug( "WIFIAPPLET: MODE has changed." ); 421 odebug << "WIFIAPPLET: MODE has changed." << oendl;
420#endif 422#endif
421 renewDHCP(); 423 renewDHCP();
422 } 424 }
423 425
424 oldESSID = interface->SSID(); 426 oldESSID = interface->SSID();
425 oldMODE = interface->mode(); 427 oldMODE = interface->mode();
@@ -447,13 +449,13 @@ void WirelessApplet::updatePopupWindow()
447} 449}
448 450
449int WirelessApplet::numberOfRings() 451int WirelessApplet::numberOfRings()
450{ 452{
451 if ( !interface ) return -1; 453 if ( !interface ) return -1;
452 int qualityH = interface->signalStrength(); 454 int qualityH = interface->signalStrength();
453 qDebug( "quality = %d", qualityH ); 455 odebug << "quality = " << qualityH << "" << oendl;
454 if ( qualityH < 1 ) return -1; 456 if ( qualityH < 1 ) return -1;
455 if ( qualityH < 20 ) return 0; 457 if ( qualityH < 20 ) return 0;
456 if ( qualityH < 40 ) return 1; 458 if ( qualityH < 40 ) return 1;
457 if ( qualityH < 60 ) return 2; 459 if ( qualityH < 60 ) return 2;
458 if ( qualityH < 65 ) return 3; 460 if ( qualityH < 65 ) return 3;
459 return 4; 461 return 4;
@@ -478,13 +480,13 @@ void WirelessApplet::paintEvent( QPaintEvent* )
478 p.setPen( QPen( QColor( 200, 20, 20 ), 2 ) ); 480 p.setPen( QPen( QColor( 200, 20, 20 ), 2 ) );
479 p.drawLine( w/2-m-m, h/2-m-m, w/2+m+m, h/2+m+m ); 481 p.drawLine( w/2-m-m, h/2-m-m, w/2+m+m, h/2+m+m );
480 p.drawLine( w/2+m+m, h/2-m-m, w/2-m-m, h/2+m+m ); 482 p.drawLine( w/2+m+m, h/2-m-m, w/2-m-m, h/2+m+m );
481 return; 483 return;
482 } 484 }
483 485
484 qDebug( "WirelessApplet: painting %d rings", rings ); 486 odebug << "WirelessApplet: painting " << rings << " rings" << oendl;
485 int radius = 2; 487 int radius = 2;
486 int rstep = 4; 488 int rstep = 4;
487 int maxrings = w/rstep; 489 int maxrings = w/rstep;
488 490
489 p.setPen( QColor( 200, 20, 20 ) ); 491 p.setPen( QColor( 200, 20, 20 ) );
490 for ( int i = 0; i < rings; ++i ) 492 for ( int i = 0; i < rings; ++i )
diff --git a/noncore/applets/zkbapplet/zkbwidget.cpp b/noncore/applets/zkbapplet/zkbwidget.cpp
index 3acff1e..13d554c 100644
--- a/noncore/applets/zkbapplet/zkbwidget.cpp
+++ b/noncore/applets/zkbapplet/zkbwidget.cpp
@@ -91,13 +91,13 @@ bool ZkbWidget::loadKeymap() {
91 91
92QSize ZkbWidget::sizeHint() const { 92QSize ZkbWidget::sizeHint() const {
93 return QSize(AppLnk::smallIconSize(),AppLnk::smallIconSize()); 93 return QSize(AppLnk::smallIconSize(),AppLnk::smallIconSize());
94} 94}
95 95
96void ZkbWidget::stateChanged(const QString& s) { 96void ZkbWidget::stateChanged(const QString& s) {
97 //qDebug("stateChanged: %s\n", (const char*) s.utf8()); 97 //odebug << "stateChanged: " << (const char*) s.utf8() << "\n" << oendl;
98 setText(s); 98 setText(s);
99} 99}
100 100
101void ZkbWidget::labelChanged(int id) { 101void ZkbWidget::labelChanged(int id) {
102 if (id == 0) { 102 if (id == 0) {
103 keymap->disable(); 103 keymap->disable();
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index a60d6ce..a47edd8 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -68,13 +68,13 @@ void AdvancedFm::cleanUp() {
68 QFile file( sfile); 68 QFile file( sfile);
69 if(file.exists()) 69 if(file.exists())
70 file.remove(); 70 file.remove();
71} 71}
72 72
73void AdvancedFm::tabChanged(QWidget *) { 73void AdvancedFm::tabChanged(QWidget *) {
74// qWarning("tab changed"); 74// owarn << "tab changed" << oendl;
75 QString path = CurrentDir()->canonicalPath(); 75 QString path = CurrentDir()->canonicalPath();
76 currentPathCombo->lineEdit()->setText( path ); 76 currentPathCombo->lineEdit()->setText( path );
77 77
78 if(whichTab == 1) { 78 if(whichTab == 1) {
79 viewMenu->setItemChecked(viewMenu->idAt(0), true); 79 viewMenu->setItemChecked(viewMenu->idAt(0), true);
80 viewMenu->setItemChecked(viewMenu->idAt(1), false); 80 viewMenu->setItemChecked(viewMenu->idAt(1), false);
@@ -90,19 +90,19 @@ void AdvancedFm::tabChanged(QWidget *) {
90 chdir( path.latin1()); 90 chdir( path.latin1());
91} 91}
92 92
93 93
94void AdvancedFm::populateView() { 94void AdvancedFm::populateView() {
95 95
96// qWarning("PopulateView"); 96// owarn << "PopulateView" << oendl;
97 QPixmap pm; 97 QPixmap pm;
98 QListView *thisView = CurrentView(); 98 QListView *thisView = CurrentView();
99 QDir *thisDir = CurrentDir(); 99 QDir *thisDir = CurrentDir();
100 QString path = thisDir->canonicalPath(); 100 QString path = thisDir->canonicalPath();
101 101
102//qWarning("path is "+path); 102//owarn << "path is "+path << oendl;
103 thisView->clear(); 103 thisView->clear();
104 thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 104 thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
105 thisDir->setMatchAllDirs(TRUE); 105 thisDir->setMatchAllDirs(TRUE);
106 thisDir->setNameFilter(filterStr); 106 thisDir->setNameFilter(filterStr);
107 QString fileL, fileS, fileDate; 107 QString fileL, fileS, fileDate;
108 QString fs= getFileSystemType((const QString &) path); 108 QString fs= getFileSystemType((const QString &) path);
@@ -157,13 +157,13 @@ void AdvancedFm::populateView() {
157 pm=mt.pixmap(); //sets the correct pixmap for mimetype 157 pm=mt.pixmap(); //sets the correct pixmap for mimetype
158 if(pm.isNull()) { 158 if(pm.isNull()) {
159 pm = unknownXpm; 159 pm = unknownXpm;
160 } 160 }
161 } 161 }
162 if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) { 162 if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) {
163 // qDebug(" overlay link image"); 163 // odebug << " overlay link image" << oendl;
164 pm= Resource::loadPixmap( "advancedfm/symlink" ); 164 pm= Resource::loadPixmap( "advancedfm/symlink" );
165 // pm= Resource::loadPixmap( "folder" ); 165 // pm= Resource::loadPixmap( "folder" );
166// QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); 166// QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
167// QPainter painter( &pm ); 167// QPainter painter( &pm );
168// painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); 168// painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
169// pm.setMask( pm.createHeuristicMask( FALSE ) ); 169// pm.setMask( pm.createHeuristicMask( FALSE ) );
@@ -181,13 +181,13 @@ void AdvancedFm::populateView() {
181 DIR *dir; 181 DIR *dir;
182 struct dirent *mydirent; 182 struct dirent *mydirent;
183 183
184 if((dir = opendir( path.latin1())) != NULL) 184 if((dir = opendir( path.latin1())) != NULL)
185 while ((mydirent = readdir(dir)) != NULL) { 185 while ((mydirent = readdir(dir)) != NULL) {
186 lstat( mydirent->d_name, &buf); 186 lstat( mydirent->d_name, &buf);
187// qDebug(mydirent->d_name); 187// odebug << mydirent->d_name << oendl;
188 fileL.sprintf("%s", mydirent->d_name); 188 fileL.sprintf("%s", mydirent->d_name);
189 devT = buf.st_dev; 189 devT = buf.st_dev;
190 fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); 190 fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF);
191 fileDate.sprintf("%s", ctime( &buf.st_mtime)); 191 fileDate.sprintf("%s", ctime( &buf.st_mtime));
192 if( fileL.find(".") == -1 ) { 192 if( fileL.find(".") == -1 ) {
193 item= new QListViewItem( thisView, fileL, fileS, fileDate); 193 item= new QListViewItem( thisView, fileL, fileS, fileDate);
@@ -206,26 +206,26 @@ void AdvancedFm::populateView() {
206void AdvancedFm::rePopulate() { 206void AdvancedFm::rePopulate() {
207 populateView(); 207 populateView();
208 setOtherTabCurrent(); 208 setOtherTabCurrent();
209 populateView(); 209 populateView();
210 210
211// int tmpTab = whichTab; 211// int tmpTab = whichTab;
212// // qDebug("%d", tmpTab); 212// // odebug << "" << tmpTab << "" << oendl;
213 213
214// for(int i =1; i < 3; i++) { 214// for(int i =1; i < 3; i++) {
215// TabWidget->setCurrentWidget(i - 1); 215// TabWidget->setCurrentWidget(i - 1);
216// populateView(); 216// populateView();
217// } 217// }
218// TabWidget->setCurrentWidget( tmpTab - 1); 218// TabWidget->setCurrentWidget( tmpTab - 1);
219} 219}
220 220
221void AdvancedFm::ListClicked(QListViewItem *selectedItem) { 221void AdvancedFm::ListClicked(QListViewItem *selectedItem) {
222//qWarning("listclicked"); 222//owarn << "listclicked" << oendl;
223 if(selectedItem) { 223 if(selectedItem) {
224 QString strItem=selectedItem->text(0); 224 QString strItem=selectedItem->text(0);
225// qWarning(strItem); 225// owarn << strItem << oendl;
226 QString strSize=selectedItem->text(1); 226 QString strSize=selectedItem->text(1);
227 strSize=strSize.stripWhiteSpace(); 227 strSize=strSize.stripWhiteSpace();
228 bool isDirectory = false; 228 bool isDirectory = false;
229 QString strItem2; 229 QString strItem2;
230 230
231 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink 231 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink
@@ -264,19 +264,19 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in
264 break; 264 break;
265 }; 265 };
266} 266}
267 267
268 268
269void AdvancedFm::switchToLocalTab() { 269void AdvancedFm::switchToLocalTab() {
270//qWarning("switch to local view"); 270//owarn << "switch to local view" << oendl;
271 TabWidget->setCurrentWidget(0); 271 TabWidget->setCurrentWidget(0);
272 Local_View->setFocus(); 272 Local_View->setFocus();
273} 273}
274 274
275void AdvancedFm::switchToRemoteTab() { 275void AdvancedFm::switchToRemoteTab() {
276//qWarning("switch to local view"); 276//owarn << "switch to local view" << oendl;
277 TabWidget->setCurrentWidget(1); 277 TabWidget->setCurrentWidget(1);
278 Remote_View->setFocus(); 278 Remote_View->setFocus();
279} 279}
280 280
281void AdvancedFm::readConfig() { 281void AdvancedFm::readConfig() {
282 Config cfg("AdvancedFm"); 282 Config cfg("AdvancedFm");
@@ -326,13 +326,13 @@ QStringList AdvancedFm::getPath() {
326 QListView *thisView=CurrentView(); 326 QListView *thisView=CurrentView();
327 QList<QListViewItem> * getSelectedItems( QListView * thisView ); 327 QList<QListViewItem> * getSelectedItems( QListView * thisView );
328 QListViewItemIterator it( thisView ); 328 QListViewItemIterator it( thisView );
329 for ( ; it.current(); ++it ) { 329 for ( ; it.current(); ++it ) {
330 if ( it.current()->isSelected() ) { 330 if ( it.current()->isSelected() ) {
331 strList << it.current()->text(0); 331 strList << it.current()->text(0);
332// qDebug(it.current()->text(0)); 332// odebug << it.current()->text(0) << oendl;
333 } 333 }
334 } 334 }
335 return strList; 335 return strList;
336} 336}
337 337
338void AdvancedFm::homeButtonPushed() { 338void AdvancedFm::homeButtonPushed() {
@@ -377,13 +377,13 @@ void AdvancedFm::doAbout() {
377 "is copyright 2002-2003 by\n" 377 "is copyright 2002-2003 by\n"
378 "L.J.Potter<llornkcor@handhelds.org>\n" 378 "L.J.Potter<llornkcor@handhelds.org>\n"
379 "and is licensed by the GPL")); 379 "and is licensed by the GPL"));
380} 380}
381 381
382void AdvancedFm::keyPressEvent( QKeyEvent *e) { 382void AdvancedFm::keyPressEvent( QKeyEvent *e) {
383// qWarning("key %d", e->key()); 383// owarn << "key " << e->key() << "" << oendl;
384// if( CurrentView()->hasFocus() ) 384// if( CurrentView()->hasFocus() )
385 { 385 {
386 switch ( e->key() ) { 386 switch ( e->key() ) {
387 case Key_Left: 387 case Key_Left:
388 upDir(); 388 upDir();
389 break; 389 break;
@@ -635,13 +635,13 @@ void AdvancedFm::addToDocs() {
635 QDir *thisDir = CurrentDir(); 635 QDir *thisDir = CurrentDir();
636 636
637 if( strListPaths.count() > 0) { 637 if( strListPaths.count() > 0) {
638 QString curFile; 638 QString curFile;
639 for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { 639 for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) {
640 curFile = thisDir->canonicalPath()+"/"+(*it); 640 curFile = thisDir->canonicalPath()+"/"+(*it);
641// qDebug(curFile); 641// odebug << curFile << oendl;
642 QFileInfo fi(curFile); 642 QFileInfo fi(curFile);
643 DocLnk f; 643 DocLnk f;
644// curFile.replace(QRegExp("\\..*"),""); 644// curFile.replace(QRegExp("\\..*"),"");
645 f.setName(fi.baseName() ); 645 f.setName(fi.baseName() );
646 f.setFile( curFile); 646 f.setFile( curFile);
647 f.writeLink(); 647 f.writeLink();
@@ -708,13 +708,13 @@ void AdvancedFm::addCustomDir() {
708 708
709 cfg.writeEntry("CustomDir", list, ','); 709 cfg.writeEntry("CustomDir", list, ',');
710 cfg.write(); 710 cfg.write();
711} 711}
712 712
713void AdvancedFm::removeCustomDir() { 713void AdvancedFm::removeCustomDir() {
714// qDebug("remove custom dir"); 714// odebug << "remove custom dir" << oendl;
715 Config cfg("AdvancedFm"); 715 Config cfg("AdvancedFm");
716 cfg.setGroup("Menu"); 716 cfg.setGroup("Menu");
717 QString dir; 717 QString dir;
718 QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); 718 QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)',');
719 QStringList list2; 719 QStringList list2;
720 dir = CurrentDir()->canonicalPath(); 720 dir = CurrentDir()->canonicalPath();
@@ -743,13 +743,13 @@ void AdvancedFm::removeCustomDir() {
743 } 743 }
744// customDirsToMenu(); 744// customDirsToMenu();
745 745
746} 746}
747 747
748void AdvancedFm::gotoCustomDir(const QString &dir) { 748void AdvancedFm::gotoCustomDir(const QString &dir) {
749// qDebug("gotoCustomDir(const QString &dir) " +dir ); 749// odebug << "gotoCustomDir(const QString &dir) " +dir << oendl;
750// QString curDir = dir; 750// QString curDir = dir;
751// QDir *thisDir = CurrentDir(); 751// QDir *thisDir = CurrentDir();
752// if( curDir.isEmpty()) { 752// if( curDir.isEmpty()) {
753// } 753// }
754 if( dir == s_addBookmark) { 754 if( dir == s_addBookmark) {
755 addCustomDir(); 755 addCustomDir();
@@ -784,56 +784,56 @@ QDir *AdvancedFm::OtherDir() {
784 return &currentDir; 784 return &currentDir;
785 } 785 }
786} 786}
787 787
788QListView * AdvancedFm::CurrentView() { 788QListView * AdvancedFm::CurrentView() {
789 if ( whichTab == 1) { 789 if ( whichTab == 1) {
790// qWarning("CurrentView Tab 1"); 790// owarn << "CurrentView Tab 1" << oendl;
791 return Local_View; 791 return Local_View;
792 } else { 792 } else {
793// qWarning("CurrentView Tab 2"); 793// owarn << "CurrentView Tab 2" << oendl;
794 return Remote_View; 794 return Remote_View;
795 } 795 }
796} 796}
797 797
798QListView * AdvancedFm::OtherView() { 798QListView * AdvancedFm::OtherView() {
799 if ( whichTab == 1) 799 if ( whichTab == 1)
800 return Remote_View; 800 return Remote_View;
801 else 801 else
802 return Local_View; 802 return Local_View;
803} 803}
804 804
805void AdvancedFm::setOtherTabCurrent() { 805void AdvancedFm::setOtherTabCurrent() {
806// qWarning("setOtherTabCurrent() %d", whichTab); 806// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl;
807 if ( whichTab == 1) { 807 if ( whichTab == 1) {
808 TabWidget->setCurrentWidget(1); 808 TabWidget->setCurrentWidget(1);
809 } else { 809 } else {
810 TabWidget->setCurrentWidget(0); 810 TabWidget->setCurrentWidget(0);
811 } 811 }
812 OtherView()->setFocus(); 812 OtherView()->setFocus();
813 OtherView()->setSelected( CurrentView()->firstChild(), true); 813 OtherView()->setSelected( CurrentView()->firstChild(), true);
814} 814}
815 815
816void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { 816void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) {
817// qDebug("qcop message "+msg ); 817// odebug << "qcop message "+msg << oendl;
818 QDataStream stream ( data, IO_ReadOnly ); 818 QDataStream stream ( data, IO_ReadOnly );
819 if ( msg == "openDirectory(QString)" ) { 819 if ( msg == "openDirectory(QString)" ) {
820// qDebug("received"); 820// odebug << "received" << oendl;
821 QString file; 821 QString file;
822 stream >> file; 822 stream >> file;
823 gotoDirectory( (const QString &) file); 823 gotoDirectory( (const QString &) file);
824 } 824 }
825} 825}
826 826
827void AdvancedFm::setDocument(const QString &file) { 827void AdvancedFm::setDocument(const QString &file) {
828 gotoDirectory( file); 828 gotoDirectory( file);
829 829
830} 830}
831 831
832void AdvancedFm::gotoDirectory(const QString &file) { 832void AdvancedFm::gotoDirectory(const QString &file) {
833// qWarning("goto dir "+file); 833// owarn << "goto dir "+file << oendl;
834 QString curDir = file; 834 QString curDir = file;
835 QDir *thisDir = CurrentDir(); 835 QDir *thisDir = CurrentDir();
836 if(QDir( curDir).exists() ) { 836 if(QDir( curDir).exists() ) {
837 thisDir->setPath( curDir ); 837 thisDir->setPath( curDir );
838 chdir( curDir.latin1() ); 838 chdir( curDir.latin1() );
839 thisDir->cd( curDir, TRUE); 839 thisDir->cd( curDir, TRUE);
@@ -863,13 +863,13 @@ void AdvancedFm::findFile(const QString &fileName) {
863 thisView->ensureItemVisible(it.current()); 863 thisView->ensureItemVisible(it.current());
864 } 864 }
865 } 865 }
866} 866}
867 867
868void AdvancedFm::slotSwitchMenu(int ) { 868void AdvancedFm::slotSwitchMenu(int ) {
869// qDebug("Switch %d", item); 869// odebug << "Switch " << item << "" << oendl;
870 // viewMenu->setItemChecked(item, true); 870 // viewMenu->setItemChecked(item, true);
871} 871}
872 872
873void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) { 873void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) {
874 tabChanged( w); 874 tabChanged( w);
875 if( w == Local_View) { 875 if( w == Local_View) {
diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro
index 716343d..f1c518e 100644
--- a/noncore/apps/advancedfm/advancedfm.pro
+++ b/noncore/apps/advancedfm/advancedfm.pro
@@ -1,34 +1,14 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG += qt warn_on quick-app 2CONFIG += qt warn_on quick-app
3# CONFIG += qt warn_on
4HEADERS = advancedfm.h filePermissions.h output.h 3HEADERS = advancedfm.h filePermissions.h output.h
5SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp 4SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp
6TARGET = advancedfm 5TARGET = advancedfm
7INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 7DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe -lopiecore2 -lopieui2 8LIBS += -lqpe -lopiecore2 -lopieui2
10
11TRANSLATIONS = ../../../i18n/de/advancedfm.ts \
12 ../../../i18n/nl/advancedfm.ts \
13 ../../../i18n/da/advancedfm.ts \
14 ../../../i18n/xx/advancedfm.ts \
15 ../../../i18n/en/advancedfm.ts \
16 ../../../i18n/es/advancedfm.ts \
17 ../../../i18n/fr/advancedfm.ts \
18 ../../../i18n/hu/advancedfm.ts \
19 ../../../i18n/ja/advancedfm.ts \
20 ../../../i18n/ko/advancedfm.ts \
21 ../../../i18n/no/advancedfm.ts \
22 ../../../i18n/pl/advancedfm.ts \
23 ../../../i18n/pt/advancedfm.ts \
24 ../../../i18n/pt_BR/advancedfm.ts \
25 ../../../i18n/sl/advancedfm.ts \
26 ../../../i18n/zh_CN/advancedfm.ts \
27 ../../../i18n/zh_TW/advancedfm.ts
28
29 9
30!contains(CONFIG,quick-app) { 10!contains(CONFIG,quick-app) {
31 DESTDIR = $(OPIEDIR)/bin 11 DESTDIR = $(OPIEDIR)/bin
32 DEFINES += NOQUICKLAUNCH 12 DEFINES += NOQUICKLAUNCH
33} 13}
34 14
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index 2997c55..29335f8 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -8,29 +8,33 @@
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#include "advancedfm.h" 12#include "advancedfm.h"
13 13
14/* OPIE */
15#include <opie2/odebug.h>
14#include <qpe/storage.h> 16#include <qpe/storage.h>
15#include <qpe/qpeapplication.h> 17#include <qpe/qpeapplication.h>
16#include <qpe/resource.h> 18#include <qpe/resource.h>
17#include <qpe/menubutton.h> 19#include <qpe/menubutton.h>
20using namespace Opie::Core;
21using namespace Opie::Ui;
18 22
23/* QT */
19#include <qlayout.h> 24#include <qlayout.h>
20#include <qhbox.h> 25#include <qhbox.h>
21#include <qmenubar.h> 26#include <qmenubar.h>
22#include <qcombobox.h> 27#include <qcombobox.h>
23#include <qtoolbutton.h> 28#include <qtoolbutton.h>
24#include <qlineedit.h> 29#include <qlineedit.h>
25#include <qlistview.h> 30#include <qlistview.h>
26 31
32/* STD */
27#include <sys/utsname.h> 33#include <sys/utsname.h>
28 34
29
30using namespace Opie::Ui;
31void AdvancedFm::init() { 35void AdvancedFm::init() {
32 b = false; 36 b = false;
33 setCaption( tr( "AdvancedFm" ) ); 37 setCaption( tr( "AdvancedFm" ) );
34 38
35 QVBoxLayout *layout = new QVBoxLayout( this ); 39 QVBoxLayout *layout = new QVBoxLayout( this );
36 layout->setSpacing( 2); 40 layout->setSpacing( 2);
@@ -216,17 +220,17 @@ void AdvancedFm::init() {
216 zaurusDevice=TRUE; 220 zaurusDevice=TRUE;
217 else 221 else
218 zaurusDevice=FALSE; 222 zaurusDevice=FALSE;
219 223
220 224
221 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { 225 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) {
222 qDebug("not have sd"); 226 odebug << "not have sd" << oendl;
223 sdButton->hide(); 227 sdButton->hide();
224 } 228 }
225 if( !StorageInfo::hasCf() ) { 229 if( !StorageInfo::hasCf() ) {
226 qDebug("not have cf"); 230 odebug << "not have cf" << oendl;
227 cfButton->hide(); 231 cfButton->hide();
228 } 232 }
229 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 233 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
230 currentDir.setPath( QDir::currentDirPath()); 234 currentDir.setPath( QDir::currentDirPath());
231 235
232 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 236 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 81a4318..d34f330 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -1,839 +1,842 @@
1/*************************************************************************** 1/***************************************************************************
2 AdvancedFm.cpp 2 AdvancedFm.cpp
3 ------------------- 3 -------------------
4 ** Created: Sat Mar 9 23:33:09 2002 4 ** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#include "advancedfm.h" 12
13#include "output.h" 13#include "advancedfm.h"
14#include "filePermissions.h" 14#include "output.h"
15 15#include "filePermissions.h"
16#include <qpe/lnkproperties.h> 16
17#include <qpe/qpeapplication.h> 17/* OPIE */
18#include <qpe/applnk.h> 18#include <opie2/odebug.h>
19 19#include <qpe/lnkproperties.h>
20#include <qmessagebox.h> 20#include <qpe/qpeapplication.h>
21 21#include <qpe/applnk.h>
22 22using namespace Opie::Core;
23#include <qpopupmenu.h> 23
24#include <qlistview.h> 24/* QT*/
25 25
26#include <errno.h> 26#include <qmessagebox.h>
27#include <stdlib.h> 27#include <qpopupmenu.h>
28#include <unistd.h> 28#include <qlistview.h>
29#include <sys/stat.h> 29
30#include <dirent.h> 30/* STD */
31#include <sys/sendfile.h> 31
32#include <fcntl.h> 32#include <errno.h>
33 33#include <stdlib.h>
34 34#include <unistd.h>
35using namespace Opie::Core; 35#include <sys/stat.h>
36using namespace Opie::Core; 36#include <dirent.h>
37void AdvancedFm::doDirChange() { 37#include <sys/sendfile.h>
38 QString pathItem = CurrentView()->currentItem()->text(0); 38#include <fcntl.h>
39 if( pathItem == "../") { 39
40 ListClicked( CurrentView()->currentItem()); 40void AdvancedFm::doDirChange() {
41 } else { 41 QString pathItem = CurrentView()->currentItem()->text(0);
42 if( pathItem.find(" -> ",0,TRUE) != -1) 42 if( pathItem == "../") {
43 pathItem = dealWithSymName((const QString&)pathItem)+"/"; 43 ListClicked( CurrentView()->currentItem());
44// qWarning(pathItem); 44 } else {
45 gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); 45 if( pathItem.find(" -> ",0,TRUE) != -1)
46 } 46 pathItem = dealWithSymName((const QString&)pathItem)+"/";
47} 47// owarn << pathItem << oendl;
48 48 gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) );
49void AdvancedFm::showMenuHidden() { 49 }
50 if (b) { 50}
51 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 51
52 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 52void AdvancedFm::showMenuHidden() {
53 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 53 if (b) {
54 } else { 54 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
55 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 55 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
56 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 56 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
57 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); 57 } else {
58 } 58 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
59 b = !b; 59 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
60 populateView(); 60 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
61} 61 }
62 62 b = !b;
63void AdvancedFm::showHidden() { 63 populateView();
64 if (b) { 64}
65 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 65
66 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 66void AdvancedFm::showHidden() {
67 } else { 67 if (b) {
68 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 68 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
69 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 69 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
70 } 70 } else {
71 populateView(); 71 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
72} 72 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
73 73 }
74QString AdvancedFm::dealWithSymName(const QString &fileName) { 74 populateView();
75 QString strItem = fileName; 75}
76 return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 76
77} 77QString AdvancedFm::dealWithSymName(const QString &fileName) {
78 78 QString strItem = fileName;
79void AdvancedFm::runThis() { 79 return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
80 if( !CurrentView()->currentItem()) return; 80}
81 QString fs; 81
82 QDir *thisDir = CurrentDir(); 82void AdvancedFm::runThis() {
83 83 if( !CurrentView()->currentItem()) return;
84 QString curFile = CurrentView()->currentItem()->text(0); 84 QString fs;
85 QString path = thisDir->canonicalPath(); 85 QDir *thisDir = CurrentDir();
86 86
87 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink 87 QString curFile = CurrentView()->currentItem()->text(0);
88 88 QString path = thisDir->canonicalPath();
89 curFile = dealWithSymName((const QString&)curFile); 89
90 90 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
91 if(curFile != "../") { 91
92 92 curFile = dealWithSymName((const QString&)curFile);
93 fs = getFileSystemType((const QString &) path); 93
94 QFileInfo fileInfo( path + "/" + curFile); 94 if(curFile != "../") {
95// qDebug( fileInfo.owner()); 95
96 96 fs = getFileSystemType((const QString &) path);
97 if( (fileInfo.permission( QFileInfo::ExeUser) 97 QFileInfo fileInfo( path + "/" + curFile);
98 | fileInfo.permission( QFileInfo::ExeGroup) 98// odebug << fileInfo.owner() << oendl;
99 | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { 99
100 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { 100 if( (fileInfo.permission( QFileInfo::ExeUser)
101 QCopEnvelope e("QPE/System", "execute(QString)" ); 101 | fileInfo.permission( QFileInfo::ExeGroup)
102 e << curFile; 102 | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) {
103 } else { 103 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
104 curFile = path + "/" + curFile; 104 QCopEnvelope e("QPE/System", "execute(QString)" );
105 DocLnk nf(curFile); 105 e << curFile;
106 QString execStr = nf.exec(); 106 } else {
107// qDebug( execStr); 107 curFile = path + "/" + curFile;
108 if( execStr.isEmpty() ) { 108 DocLnk nf(curFile);
109 } else { 109 QString execStr = nf.exec();
110 nf.execute(); 110// odebug << execStr << oendl;
111 } 111 if( execStr.isEmpty() ) {
112 } 112 } else {
113 } 113 nf.execute();
114} 114 }
115 115 }
116void AdvancedFm::runText() { 116 }
117 if( !CurrentView()->currentItem()) return; 117}
118 QString curFile = CurrentView()->currentItem()->text(0); 118
119 if(curFile != "../") { 119void AdvancedFm::runText() {
120 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink 120 if( !CurrentView()->currentItem()) return;
121 curFile = dealWithSymName((const QString&)curFile); 121 QString curFile = CurrentView()->currentItem()->text(0);
122 curFile = CurrentDir()->canonicalPath()+"/"+curFile; 122 if(curFile != "../") {
123 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); 123 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
124 e << curFile; 124 curFile = dealWithSymName((const QString&)curFile);
125 } 125 curFile = CurrentDir()->canonicalPath()+"/"+curFile;
126} 126 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" );
127 127 e << curFile;
128void AdvancedFm::makeDir() { 128 }
129 InputDialog *fileDlg; 129}
130 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); 130
131 fileDlg->exec(); 131void AdvancedFm::makeDir() {
132 if( fileDlg->result() == 1 ) { 132 InputDialog *fileDlg;
133 QDir *thisDir = CurrentDir(); 133 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0);
134 QString filename = fileDlg->LineEdit1->text(); 134 fileDlg->exec();
135 thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); 135 if( fileDlg->result() == 1 ) {
136 } 136 QDir *thisDir = CurrentDir();
137 populateView(); 137 QString filename = fileDlg->LineEdit1->text();
138} 138 thisDir->mkdir( thisDir->canonicalPath()+"/"+filename);
139 139 }
140void AdvancedFm::doDelete() { 140 populateView();
141 QStringList curFileList = getPath(); 141}
142 bool doMsg=true; 142
143 int count = curFileList.count(); 143void AdvancedFm::doDelete() {
144 if( count > 0) { 144 QStringList curFileList = getPath();
145 if(count > 1 ) { 145 bool doMsg=true;
146 QString msg; 146 int count = curFileList.count();
147 msg=tr("Really delete\n%1 files?").arg(count); 147 if( count > 0) {
148 switch ( QMessageBox::warning(this,tr("Delete"),msg 148 if(count > 1 ) {
149 ,tr("Yes"),tr("No"),0,0,1) ) 149 QString msg;
150 { 150 msg=tr("Really delete\n%1 files?").arg(count);
151 case 0: 151 switch ( QMessageBox::warning(this,tr("Delete"),msg
152 doMsg=false; 152 ,tr("Yes"),tr("No"),0,0,1) )
153 break; 153 {
154 case 1: 154 case 0:
155 return; 155 doMsg=false;
156 break; 156 break;
157 }; 157 case 1:
158 } 158 return;
159 159 break;
160 QString myFile; 160 };
161 161 }
162 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 162
163 myFile = (*it); 163 QString myFile;
164 if( myFile.find(" -> ",0,TRUE) != -1) 164
165 myFile = myFile.left( myFile.find(" -> ",0,TRUE)); 165 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
166 166 myFile = (*it);
167 QString f = CurrentDir()->canonicalPath(); 167 if( myFile.find(" -> ",0,TRUE) != -1)
168 if(f.right(1).find("/",0,TRUE) == -1) 168 myFile = myFile.left( myFile.find(" -> ",0,TRUE));
169 f += "/"; 169
170 f += myFile; 170 QString f = CurrentDir()->canonicalPath();
171 if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { 171 if(f.right(1).find("/",0,TRUE) == -1)
172 //if file is a directory 172 f += "/";
173 173 f += myFile;
174 switch ( QMessageBox::warning( this, tr("Delete Directory?"), 174 if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) {
175 tr("Really delete %1\nand all it's contents ?" ).arg( f ) , 175 //if file is a directory
176 tr("Yes"), tr("No"), 0, 0, 1) ) { 176
177 case 0: 177 switch ( QMessageBox::warning( this, tr("Delete Directory?"),
178 { 178 tr("Really delete %1\nand all it's contents ?" ).arg( f ) ,
179 f=f.left(f.length()-1); 179 tr("Yes"), tr("No"), 0, 0, 1) ) {
180 QString cmd="rm -rf "+f; 180 case 0:
181 startProcess( (const QString)cmd.latin1() ); 181 {
182 populateView(); 182 f=f.left(f.length()-1);
183 } 183 QString cmd="rm -rf "+f;
184 break; 184 startProcess( (const QString)cmd.latin1() );
185 case 1: 185 populateView();
186 // exit 186 }
187 break; 187 break;
188 }; 188 case 1:
189 189 // exit
190 } else { 190 break;
191 if(doMsg) { 191 };
192 switch ( QMessageBox::warning(this,tr("Delete"), 192
193 tr("Really delete\n%1?").arg( myFile ), 193 } else {
194 tr("Yes"), tr("No"), 0, 0, 1) ) { 194 if(doMsg) {
195 case 1: 195 switch ( QMessageBox::warning(this,tr("Delete"),
196 return; 196 tr("Really delete\n%1?").arg( myFile ),
197 break; 197 tr("Yes"), tr("No"), 0, 0, 1) ) {
198 }; 198 case 1:
199 } 199 return;
200 200 break;
201 QString cmd="rm "+f; 201 };
202 QFile file(f); 202 }
203 QFileInfo fi(myFile); 203
204 if( fi.fileName().find("../",0,TRUE)==-1) { 204 QString cmd="rm "+f;
205// qDebug("remove link files "+myFile); 205 QFile file(f);
206 206 QFileInfo fi(myFile);
207// DocLnk lnk(f); 207 if( fi.fileName().find("../",0,TRUE)==-1) {
208 DocLnk *lnk; 208// odebug << "remove link files "+myFile << oendl;
209 lnk = new DocLnk(f); 209
210// qDebug("Deleting doclnk " + lnk->linkFile()); 210// DocLnk lnk(f);
211 if(lnk->isValid()) 211 DocLnk *lnk;
212 lnk->removeLinkFile(); 212 lnk = new DocLnk(f);
213 // delete lnk; 213// odebug << "Deleting doclnk " + lnk->linkFile() << oendl;
214 file.remove(); 214 if(lnk->isValid())
215 } 215 lnk->removeLinkFile();
216 } 216 // delete lnk;
217 } 217 file.remove();
218 } 218 }
219 populateView(); 219 }
220} 220 }
221 221 }
222void AdvancedFm::filePerms() { 222 populateView();
223 QStringList curFileList = getPath(); 223}
224 QString filePath; 224
225 225void AdvancedFm::filePerms() {
226 filePath = CurrentDir()->canonicalPath()+"/"; 226 QStringList curFileList = getPath();
227 227 QString filePath;
228 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 228
229 filePermissions *filePerm; 229 filePath = CurrentDir()->canonicalPath()+"/";
230 filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); 230
231 QPEApplication::execDialog( filePerm ); 231 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
232 if( filePerm ) 232 filePermissions *filePerm;
233 delete filePerm; 233 filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it));
234 } 234 QPEApplication::execDialog( filePerm );
235 populateView(); 235 if( filePerm )
236} 236 delete filePerm;
237 237 }
238void AdvancedFm::doProperties() { 238 populateView();
239#if defined(QT_QWS_OPIE) 239}
240 240
241 QStringList curFileList = getPath(); 241void AdvancedFm::doProperties() {
242 242#if defined(QT_QWS_OPIE)
243 QString filePath; 243
244 filePath = CurrentDir()->canonicalPath()+"/"; 244 QStringList curFileList = getPath();
245 245
246// qDebug("%d",curFileList.count()); 246 QString filePath;
247 247 filePath = CurrentDir()->canonicalPath()+"/";
248 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 248
249// qDebug((filePath+*it)); 249// odebug << "" << curFileList.count() << "" << oendl;
250 DocLnk lnk( (filePath+*it)); 250
251 LnkProperties prop( &lnk ); 251 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
252 QPEApplication::execDialog( &prop ); 252// odebug << (filePath+*it) << oendl;
253 } 253 DocLnk lnk( (filePath+*it));
254#endif 254 LnkProperties prop( &lnk );
255 255 QPEApplication::execDialog( &prop );
256} 256 }
257 257#endif
258void AdvancedFm::upDir() { 258
259 QDir *thisDir = CurrentDir(); 259}
260 QString current = thisDir->canonicalPath(); 260
261 QDir dir(current); 261void AdvancedFm::upDir() {
262 dir.cdUp(); 262 QDir *thisDir = CurrentDir();
263 current = dir.canonicalPath(); 263 QString current = thisDir->canonicalPath();
264 chdir( current.latin1() ); 264 QDir dir(current);
265 thisDir->cd( current, TRUE); 265 dir.cdUp();
266 266 current = dir.canonicalPath();
267 populateView(); 267 chdir( current.latin1() );
268 update(); 268 thisDir->cd( current, TRUE);
269} 269
270 270 populateView();
271void AdvancedFm::copy() { 271 update();
272 qApp->processEvents(); 272}
273 QStringList curFileList = getPath(); 273
274 274void AdvancedFm::copy() {
275 QDir *thisDir = CurrentDir(); 275 qApp->processEvents();
276 QDir *thatDir = OtherDir(); 276 QStringList curFileList = getPath();
277 277
278 bool doMsg=true; 278 QDir *thisDir = CurrentDir();
279 int count=curFileList.count(); 279 QDir *thatDir = OtherDir();
280 if( count > 0) { 280
281 if(count > 1 ){ 281 bool doMsg=true;
282 QString msg; 282 int count=curFileList.count();
283 msg=tr("Really copy\n%1 files?").arg(count); 283 if( count > 0) {
284 switch ( QMessageBox::warning(this,tr("Copy"),msg 284 if(count > 1 ){
285 ,tr("Yes"),tr("No"),0,0,1) ) 285 QString msg;
286 { 286 msg=tr("Really copy\n%1 files?").arg(count);
287 case 0: 287 switch ( QMessageBox::warning(this,tr("Copy"),msg
288 doMsg=false; 288 ,tr("Yes"),tr("No"),0,0,1) )
289 break; 289 {
290 case 1: 290 case 0:
291 return; 291 doMsg=false;
292 break; 292 break;
293 }; 293 case 1:
294 } 294 return;
295 295 break;
296 QString curFile, item, destFile; 296 };
297 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 297 }
298 item=(*it); 298
299 if(item.find("->",0,TRUE)) //symlink 299 QString curFile, item, destFile;
300 item = item.left(item.find("->",0,TRUE)); 300 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
301 301 item=(*it);
302 curFile = thisDir->canonicalPath()+"/"+ item; 302 if(item.find("->",0,TRUE)) //symlink
303 destFile = thatDir->canonicalPath()+"/"+ item; 303 item = item.left(item.find("->",0,TRUE));
304 304
305// qDebug("Destination file is "+destFile); 305 curFile = thisDir->canonicalPath()+"/"+ item;
306// qDebug("CurrentFile file is " + curFile); 306 destFile = thatDir->canonicalPath()+"/"+ item;
307 307
308 QFile f(destFile); 308// odebug << "Destination file is "+destFile << oendl;
309 if( f.exists()) { 309// odebug << "CurrentFile file is " + curFile << oendl;
310 if(doMsg) { 310
311 switch ( QMessageBox::warning(this,tr("File Exists!"), 311 QFile f(destFile);
312 tr("%1 exists. Ok to overwrite?").arg( item ), 312 if( f.exists()) {
313 tr("Yes"),tr("No"),0,0,1) ) { 313 if(doMsg) {
314 case 1: 314 switch ( QMessageBox::warning(this,tr("File Exists!"),
315 return; 315 tr("%1 exists. Ok to overwrite?").arg( item ),
316 break; 316 tr("Yes"),tr("No"),0,0,1) ) {
317 }; 317 case 1:
318 } 318 return;
319 f.remove(); 319 break;
320 } 320 };
321 321 }
322 if( !copyFile( curFile, destFile) ) { 322 f.remove();
323 QMessageBox::message("AdvancedFm", 323 }
324 tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); 324
325 return; 325 if( !copyFile( curFile, destFile) ) {
326 } 326 QMessageBox::message("AdvancedFm",
327 } 327 tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) );
328 setOtherTabCurrent(); 328 return;
329 rePopulate(); 329 }
330 } 330 }
331} 331 setOtherTabCurrent();
332 332 rePopulate();
333void AdvancedFm::copyAs() { 333 }
334 qApp->processEvents(); 334}
335 335
336 QStringList curFileList = getPath(); 336void AdvancedFm::copyAs() {
337 QString curFile, item; 337 qApp->processEvents();
338 InputDialog *fileDlg; 338
339 339 QStringList curFileList = getPath();
340 QDir *thisDir = CurrentDir(); 340 QString curFile, item;
341 QDir *thatDir = OtherDir(); 341 InputDialog *fileDlg;
342 342
343 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 343 QDir *thisDir = CurrentDir();
344 QString destFile; 344 QDir *thatDir = OtherDir();
345 item=(*it); 345
346 curFile = thisDir->canonicalPath()+"/"+(*it); 346 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
347 fileDlg = new InputDialog( this, tr("Copy "+curFile+" As"), TRUE, 0); 347 QString destFile;
348 348 item=(*it);
349 fileDlg->setInputText((const QString &) destFile ); 349 curFile = thisDir->canonicalPath()+"/"+(*it);
350 fileDlg->exec(); 350 fileDlg = new InputDialog( this, tr("Copy "+curFile+" As"), TRUE, 0);
351 351
352 if( fileDlg->result() == 1 ) { 352 fileDlg->setInputText((const QString &) destFile );
353 QString filename = fileDlg->LineEdit1->text(); 353 fileDlg->exec();
354 destFile = thatDir->canonicalPath()+"/"+filename; 354
355 355 if( fileDlg->result() == 1 ) {
356 QFile f( destFile); 356 QString filename = fileDlg->LineEdit1->text();
357 if( f.exists()) { 357 destFile = thatDir->canonicalPath()+"/"+filename;
358 switch (QMessageBox::warning(this,tr("File Exists!"), 358
359 item+tr("\nexists. Ok to overwrite?"), 359 QFile f( destFile);
360 tr("Yes"),tr("No"),0,0,1) ) { 360 if( f.exists()) {
361 case 0: 361 switch (QMessageBox::warning(this,tr("File Exists!"),
362 f.remove(); 362 item+tr("\nexists. Ok to overwrite?"),
363 break; 363 tr("Yes"),tr("No"),0,0,1) ) {
364 case 1: 364 case 0:
365 return; 365 f.remove();
366 break; 366 break;
367 }; 367 case 1:
368 } 368 return;
369 if( !copyFile( curFile, destFile) ) { 369 break;
370 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 370 };
371 +curFile +tr("to\n")+destFile); 371 }
372 return; 372 if( !copyFile( curFile, destFile) ) {
373 } 373 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
374 } 374 +curFile +tr("to\n")+destFile);
375 delete fileDlg; 375 return;
376 376 }
377 } 377 }
378 rePopulate(); 378 delete fileDlg;
379 setOtherTabCurrent(); 379
380} 380 }
381 381 rePopulate();
382void AdvancedFm::copySameDir() { 382 setOtherTabCurrent();
383 qApp->processEvents(); 383}
384 QStringList curFileList = getPath(); 384
385 QString curFile, item, destFile; 385void AdvancedFm::copySameDir() {
386 InputDialog *fileDlg; 386 qApp->processEvents();
387 387 QStringList curFileList = getPath();
388 QDir *thisDir = CurrentDir(); 388 QString curFile, item, destFile;
389 389 InputDialog *fileDlg;
390 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 390
391 item=(*it); 391 QDir *thisDir = CurrentDir();
392 curFile = thisDir->canonicalPath()+"/"+ item; 392
393 393 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
394 fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); 394 item=(*it);
395 fileDlg->setInputText((const QString &) destFile ); 395 curFile = thisDir->canonicalPath()+"/"+ item;
396 fileDlg->exec(); 396
397 397 fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0);
398 if( fileDlg->result() == 1 ) { 398 fileDlg->setInputText((const QString &) destFile );
399 399 fileDlg->exec();
400 QString filename = fileDlg->LineEdit1->text(); 400
401 destFile = thisDir->canonicalPath()+"/"+filename; 401 if( fileDlg->result() == 1 ) {
402 402
403 QFile f(destFile); 403 QString filename = fileDlg->LineEdit1->text();
404 if( f.exists()) { 404 destFile = thisDir->canonicalPath()+"/"+filename;
405 switch (QMessageBox::warning(this,tr("Delete"), 405
406 destFile+tr(" already exists.\nDo you really want to delete it?"), 406 QFile f(destFile);
407 tr("Yes"),tr("No"),0,0,1) ) { 407 if( f.exists()) {
408 case 0: 408 switch (QMessageBox::warning(this,tr("Delete"),
409 409 destFile+tr(" already exists.\nDo you really want to delete it?"),
410 f.remove(); 410 tr("Yes"),tr("No"),0,0,1) ) {
411 break; 411 case 0:
412 case 1: 412
413 return; 413 f.remove();
414 break; 414 break;
415 }; 415 case 1:
416 } 416 return;
417 if(!copyFile( curFile,destFile) ) { 417 break;
418 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 418 };
419 +curFile +tr("to\n")+destFile); 419 }
420 return; 420 if(!copyFile( curFile,destFile) ) {
421 } 421 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
422 422 +curFile +tr("to\n")+destFile);
423// qDebug("copy "+curFile+" as "+destFile); 423 return;
424 } 424 }
425 delete fileDlg; 425
426 } 426// odebug << "copy "+curFile+" as "+destFile << oendl;
427 rePopulate(); 427 }
428} 428 delete fileDlg;
429 429 }
430void AdvancedFm::move() { 430 rePopulate();
431 qApp->processEvents(); 431}
432 432
433 QStringList curFileList = getPath(); 433void AdvancedFm::move() {
434 if( curFileList.count() > 0) { 434 qApp->processEvents();
435 QString curFile, destFile, item; 435
436 436 QStringList curFileList = getPath();
437 QDir *thisDir = CurrentDir(); 437 if( curFileList.count() > 0) {
438 QDir *thatDir = OtherDir(); 438 QString curFile, destFile, item;
439 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 439
440 item=(*it); 440 QDir *thisDir = CurrentDir();
441 QString destFile = thatDir->canonicalPath(); 441 QDir *thatDir = OtherDir();
442 442 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
443 if(destFile.right(1).find("/",0,TRUE) == -1) 443 item=(*it);
444 destFile+="/"; 444 QString destFile = thatDir->canonicalPath();
445 destFile += item; 445
446// qDebug("Destination file is "+destFile); 446 if(destFile.right(1).find("/",0,TRUE) == -1)
447 447 destFile+="/";
448 curFile = thisDir->canonicalPath(); 448 destFile += item;
449 if(curFile.right(1).find("/",0,TRUE) == -1) 449// odebug << "Destination file is "+destFile << oendl;
450 curFile +="/"; 450
451 curFile+= item; 451 curFile = thisDir->canonicalPath();
452// qDebug("CurrentFile file is " + curFile); 452 if(curFile.right(1).find("/",0,TRUE) == -1)
453 453 curFile +="/";
454 if(QFileInfo(curFile).isDir()) { 454 curFile+= item;
455 moveDirectory( curFile, destFile ); 455// odebug << "CurrentFile file is " + curFile << oendl;
456 rePopulate(); 456
457 return; 457 if(QFileInfo(curFile).isDir()) {
458 } 458 moveDirectory( curFile, destFile );
459 459 rePopulate();
460 QFile f( curFile); 460 return;
461 if( f.exists()) { 461 }
462 if( !copyFile( curFile, destFile) ) { 462
463 QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); 463 QFile f( curFile);
464 return; 464 if( f.exists()) {
465 } else 465 if( !copyFile( curFile, destFile) ) {
466 QFile::remove(curFile); 466 QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile);
467 } 467 return;
468 } 468 } else
469 469 QFile::remove(curFile);
470 } 470 }
471 rePopulate(); 471 }
472 setOtherTabCurrent(); 472
473} 473 }
474 474 rePopulate();
475bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) { 475 setOtherTabCurrent();
476 int err = 0; 476}
477 if( copyDirectory( src, dest ) ) { QString cmd = "rm -rf " + src; 477
478 err = system((const char*)cmd); 478bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) {
479 } else 479 int err = 0;
480 err = -1; 480 if( copyDirectory( src, dest ) ) { QString cmd = "rm -rf " + src;
481 481 err = system((const char*)cmd);
482 if(err!=0) { 482 } else
483 QMessageBox::message(tr("Note"),tr("Could not move\n") + src); 483 err = -1;
484 return false; 484
485 } 485 if(err!=0) {
486 return true; 486 QMessageBox::message(tr("Note"),tr("Could not move\n") + src);
487} 487 return false;
488 488 }
489bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { 489 return true;
490 490}
491 QString cmd = "/bin/cp -fpR " + src + " " + dest; 491
492 qWarning(cmd); 492bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) {
493 int err = system( (const char *) cmd ); 493
494 if ( err != 0 ) { 494 QString cmd = "/bin/cp -fpR " + src + " " + dest;
495 QMessageBox::message("AdvancedFm", 495 owarn << cmd << oendl;
496 tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) ); 496 int err = system( (const char *) cmd );
497 return false; 497 if ( err != 0 ) {
498 } 498 QMessageBox::message("AdvancedFm",
499 499 tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) );
500 return true; 500 return false;
501} 501 }
502 502
503 503 return true;
504bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { 504}
505 505
506 506
507 if(QFileInfo(src).isDir()) { 507bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
508 if( copyDirectory( src, dest )) { 508
509 setOtherTabCurrent(); 509
510 populateView(); 510 if(QFileInfo(src).isDir()) {
511 return true; 511 if( copyDirectory( src, dest )) {
512 } 512 setOtherTabCurrent();
513 else 513 populateView();
514 return false; 514 return true;
515 } 515 }
516 516 else
517 517 return false;
518 bool success = true; 518 }
519 struct stat status; 519
520 QFile srcFile(src); 520
521 QFile destFile(dest); 521 bool success = true;
522 int err=0; 522 struct stat status;
523 int read_fd=0; 523 QFile srcFile(src);
524 int write_fd=0; 524 QFile destFile(dest);
525 struct stat stat_buf; 525 int err=0;
526 off_t offset = 0; 526 int read_fd=0;
527 if(!srcFile.open( IO_ReadOnly|IO_Raw)) { 527 int write_fd=0;
528// qWarning("open failed"); 528 struct stat stat_buf;
529 return success = false; 529 off_t offset = 0;
530 } 530 if(!srcFile.open( IO_ReadOnly|IO_Raw)) {
531 read_fd = srcFile.handle(); 531// owarn << "open failed" << oendl;
532 if(read_fd != -1) { 532 return success = false;
533 fstat (read_fd, &stat_buf); 533 }
534 if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { 534 read_fd = srcFile.handle();
535// qWarning("destfile open failed"); 535 if(read_fd != -1) {
536 return success = false; 536 fstat (read_fd, &stat_buf);
537 } 537 if( !destFile.open( IO_WriteOnly|IO_Raw ) ) {
538 write_fd = destFile.handle(); 538// owarn << "destfile open failed" << oendl;
539 if(write_fd != -1) { 539 return success = false;
540 err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); 540 }
541 if( err == -1) { 541 write_fd = destFile.handle();
542 QString msg; 542 if(write_fd != -1) {
543 switch(err) { 543 err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size);
544 case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; 544 if( err == -1) {
545 case EINVAL: msg = "Descriptor is not valid or locked. "; 545 QString msg;
546 case ENOMEM: msg = "Insufficient memory to read from in_fd."; 546 switch(err) {
547 case EIO: msg = "Unspecified error while reading from in_fd."; 547 case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. ";
548 }; 548 case EINVAL: msg = "Descriptor is not valid or locked. ";
549 success = false; 549 case ENOMEM: msg = "Insufficient memory to read from in_fd.";
550// qWarning(msg); 550 case EIO: msg = "Unspecified error while reading from in_fd.";
551 } 551 };
552 } else { 552 success = false;
553 success = false; 553// owarn << msg << oendl;
554 } 554 }
555 } else { 555 } else {
556 success = false; 556 success = false;
557 } 557 }
558 srcFile.close(); 558 } else {
559 destFile.close(); 559 success = false;
560 // Set file permissions 560 }
561 if( stat( (const char *) src, &status ) == 0 ) { 561 srcFile.close();
562 chmod( (const char *) dest, status.st_mode ); 562 destFile.close();
563 } 563 // Set file permissions
564 564 if( stat( (const char *) src, &status ) == 0 ) {
565 return success; 565 chmod( (const char *) dest, status.st_mode );
566} 566 }
567 567
568void AdvancedFm::runCommand() { 568 return success;
569 if( !CurrentView()->currentItem()) return; 569}
570 QDir *thisDir = CurrentDir(); 570
571 571void AdvancedFm::runCommand() {
572 QString curFile; 572 if( !CurrentView()->currentItem()) return;
573 curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); 573 QDir *thisDir = CurrentDir();
574 574
575 InputDialog *fileDlg; 575 QString curFile;
576 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 576 curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0);
577 fileDlg->setInputText(curFile); 577
578 fileDlg->exec(); 578 InputDialog *fileDlg;
579 //QString command; 579 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
580 580 fileDlg->setInputText(curFile);
581 if( fileDlg->result() == 1 ) { 581 fileDlg->exec();
582// qDebug(fileDlg->LineEdit1->text()); 582 //QString command;
583 QStringList command; 583
584 584 if( fileDlg->result() == 1 ) {
585 command << "/bin/sh"; 585// odebug << fileDlg->LineEdit1->text() << oendl;
586 command << "-c"; 586 QStringList command;
587 command << fileDlg->LineEdit1->text(); 587
588 Output *outDlg; 588 command << "/bin/sh";
589 outDlg = new Output( command, this, tr("AdvancedFm Output"), true); 589 command << "-c";
590 QPEApplication::execDialog( outDlg ); 590 command << fileDlg->LineEdit1->text();
591 qApp->processEvents(); 591 Output *outDlg;
592 592 outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
593 } 593 QPEApplication::execDialog( outDlg );
594} 594 qApp->processEvents();
595 595
596void AdvancedFm::runCommandStd() { 596 }
597 if( !CurrentView()->currentItem()) return; 597}
598 QString curFile; 598
599 QDir *thisDir = CurrentDir(); 599void AdvancedFm::runCommandStd() {
600 QListView *thisView = CurrentView(); 600 if( !CurrentView()->currentItem()) return;
601 if( thisView->currentItem()) 601 QString curFile;
602 curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); 602 QDir *thisDir = CurrentDir();
603 603 QListView *thisView = CurrentView();
604 InputDialog *fileDlg; 604 if( thisView->currentItem())
605 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 605 curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0);
606 fileDlg->setInputText(curFile); 606
607 fileDlg->exec(); 607 InputDialog *fileDlg;
608 608 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
609 if( fileDlg->result() == 1 ) { 609 fileDlg->setInputText(curFile);
610 qApp->processEvents(); 610 fileDlg->exec();
611 startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); 611
612 } 612 if( fileDlg->result() == 1 ) {
613} 613 qApp->processEvents();
614 614 startProcess( (const QString)fileDlg->LineEdit1->text().latin1());
615void AdvancedFm::fileStatus() { 615 }
616 if( !CurrentView()->currentItem()) return; 616}
617 QString curFile; 617
618 curFile = CurrentView()->currentItem()->text(0); 618void AdvancedFm::fileStatus() {
619 619 if( !CurrentView()->currentItem()) return;
620 QStringList command; 620 QString curFile;
621 command << "/bin/sh"; 621 curFile = CurrentView()->currentItem()->text(0);
622 command << "-c"; 622
623 command << "stat -l "+ curFile; 623 QStringList command;
624 624 command << "/bin/sh";
625 Output *outDlg; 625 command << "-c";
626 outDlg = new Output( command, this, tr("AdvancedFm Output"), true); 626 command << "stat -l "+ curFile;
627 QPEApplication::execDialog( outDlg ); 627
628 qApp->processEvents(); 628 Output *outDlg;
629} 629 outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
630 630 QPEApplication::execDialog( outDlg );
631 631 qApp->processEvents();
632void AdvancedFm::mkDir() { 632}
633 makeDir(); 633
634} 634
635 635void AdvancedFm::mkDir() {
636void AdvancedFm::rn() { 636 makeDir();
637 renameIt(); 637}
638} 638
639 639void AdvancedFm::rn() {
640void AdvancedFm::del() { 640 renameIt();
641 doDelete(); 641}
642} 642
643 643void AdvancedFm::del() {
644void AdvancedFm::mkSym() { 644 doDelete();
645 QString cmd; 645}
646 QStringList curFileList = getPath(); 646
647 if( curFileList.count() > 0) { 647void AdvancedFm::mkSym() {
648 QDir *thisDir = CurrentDir(); 648 QString cmd;
649 QDir * thatDir = OtherDir(); 649 QStringList curFileList = getPath();
650 650 if( curFileList.count() > 0) {
651 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 651 QDir *thisDir = CurrentDir();
652 652 QDir * thatDir = OtherDir();
653 QString destName = thatDir->canonicalPath()+"/"+(*it); 653
654 if(destName.right(1) == "/") { 654 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
655 destName = destName.left( destName.length() -1); 655
656 } 656 QString destName = thatDir->canonicalPath()+"/"+(*it);
657 657 if(destName.right(1) == "/") {
658 QString curFile = thisDir->canonicalPath()+"/"+(*it); 658 destName = destName.left( destName.length() -1);
659 659 }
660 if( curFile.right(1) == "/") { 660
661 curFile = curFile.left( curFile.length() -1); 661 QString curFile = thisDir->canonicalPath()+"/"+(*it);
662 } 662
663 663 if( curFile.right(1) == "/") {
664 cmd = "ln -s "+curFile+" "+destName; 664 curFile = curFile.left( curFile.length() -1);
665// qDebug(cmd); 665 }
666 startProcess( (const QString)cmd ); 666
667 } 667 cmd = "ln -s "+curFile+" "+destName;
668 rePopulate(); 668// odebug << cmd << oendl;
669 setOtherTabCurrent(); 669 startProcess( (const QString)cmd );
670 } 670 }
671} 671 rePopulate();
672 672 setOtherTabCurrent();
673void AdvancedFm::doBeam() { 673 }
674 Ir ir; 674}
675 if(!ir.supported()) { 675
676 } else { 676void AdvancedFm::doBeam() {
677 QStringList curFileList = getPath(); 677 Ir ir;
678 if( curFileList.count() > 0) { 678 if(!ir.supported()) {
679 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 679 } else {
680 QString curFile = (*it); 680 QStringList curFileList = getPath();
681 QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; 681 if( curFileList.count() > 0) {
682 if( curFilePath.right(1) == "/") { 682 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
683 curFilePath = curFilePath.left( curFilePath.length() -1); 683 QString curFile = (*it);
684 } 684 QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile;
685 Ir *file = new Ir(this, "IR"); 685 if( curFilePath.right(1) == "/") {
686 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*))); 686 curFilePath = curFilePath.left( curFilePath.length() -1);
687 file->send( curFilePath, curFile ); 687 }
688 } 688 Ir *file = new Ir(this, "IR");
689 } 689 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*)));
690 } 690 file->send( curFilePath, curFile );
691} 691 }
692 692 }
693void AdvancedFm::fileBeamFinished( Ir *) { 693 }
694 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); 694}
695} 695
696 696void AdvancedFm::fileBeamFinished( Ir *) {
697void AdvancedFm::selectAll() { 697 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") );
698 QListView *thisView = CurrentView(); 698}
699 thisView->selectAll(true); 699
700 thisView->setSelected( thisView->firstChild(),false); 700void AdvancedFm::selectAll() {
701} 701 QListView *thisView = CurrentView();
702 702 thisView->selectAll(true);
703void AdvancedFm::startProcess(const QString & cmd) { 703 thisView->setSelected( thisView->firstChild(),false);
704 QStringList command; 704}
705 OProcess *process; 705
706 process = new OProcess(); 706void AdvancedFm::startProcess(const QString & cmd) {
707 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), 707 QStringList command;
708 this, SLOT( processEnded(Opie::Core::OProcess*))); 708 OProcess *process;
709 709 process = new OProcess();
710 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), 710 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
711 this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); 711 this, SLOT( processEnded(Opie::Core::OProcess*)));
712 712
713 command << "/bin/sh"; 713 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
714 command << "-c"; 714 this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
715 command << cmd.latin1(); 715
716 *process << command; 716 command << "/bin/sh";
717 if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) 717 command << "-c";
718 qDebug("could not start process"); 718 command << cmd.latin1();
719} 719 *process << command;
720 720 if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
721void AdvancedFm::processEnded(OProcess *) { 721 odebug << "could not start process" << oendl;
722 rePopulate(); 722}
723} 723
724 724void AdvancedFm::processEnded(OProcess *) {
725void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { 725 rePopulate();
726// qWarning("received stderrt %d bytes", buflen); 726}
727 727
728 QString lineStr = buffer; 728void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) {
729 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); 729// owarn << "received stderrt " << buflen << " bytes" << oendl;
730} 730
731 731 QString lineStr = buffer;
732bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { 732 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
733 if ( o->inherits( "QLineEdit" ) ) { 733}
734 if ( e->type() == QEvent::KeyPress ) { 734
735 QKeyEvent *ke = (QKeyEvent*)e; 735bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
736 if ( ke->key() == Key_Return || 736 if ( o->inherits( "QLineEdit" ) ) {
737 ke->key() == Key_Enter ) { 737 if ( e->type() == QEvent::KeyPress ) {
738 okRename(); 738 QKeyEvent *ke = (QKeyEvent*)e;
739 return true; 739 if ( ke->key() == Key_Return ||
740 } 740 ke->key() == Key_Enter ) {
741 else if ( ke->key() == Key_Escape ) { 741 okRename();
742 cancelRename(); 742 return true;
743 return true; 743 }
744 } 744 else if ( ke->key() == Key_Escape ) {
745 } 745 cancelRename();
746 else if ( e->type() == QEvent::FocusOut ) { 746 return true;
747 cancelRename(); 747 }
748 return true; 748 }
749 } 749 else if ( e->type() == QEvent::FocusOut ) {
750 } 750 cancelRename();
751 if ( o->inherits( "QListView" ) ) { 751 return true;
752 if ( e->type() == QEvent::FocusIn ) { 752 }
753 if( o == Local_View) { //keep track of which view 753 }
754 whichTab=1; 754 if ( o->inherits( "QListView" ) ) {
755 } 755 if ( e->type() == QEvent::FocusIn ) {
756 else { 756 if( o == Local_View) { //keep track of which view
757 whichTab=2; 757 whichTab=1;
758 } 758 }
759 } 759 else {
760 OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection 760 whichTab=2;
761 } 761 }
762 762 }
763 return QWidget::eventFilter( o, e ); 763 OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection
764} 764 }
765 765
766 766 return QWidget::eventFilter( o, e );
767void AdvancedFm::cancelRename() { 767}
768// qDebug("cancel rename"); 768
769 QListView * view; 769
770 view = CurrentView(); 770void AdvancedFm::cancelRename() {
771 771// odebug << "cancel rename" << oendl;
772 bool resetFocus = view->viewport()->focusProxy() == renameBox; 772 QListView * view;
773 delete renameBox; 773 view = CurrentView();
774 renameBox = 0; 774
775 if ( resetFocus ) { 775 bool resetFocus = view->viewport()->focusProxy() == renameBox;
776 view->viewport()->setFocusProxy( view); 776 delete renameBox;
777 view->setFocus(); 777 renameBox = 0;
778 } 778 if ( resetFocus ) {
779} 779 view->viewport()->setFocusProxy( view);
780 780 view->setFocus();
781void AdvancedFm::doRename(QListView * view) { 781 }
782 if( !CurrentView()->currentItem()) return; 782}
783 783
784 QRect r = view->itemRect( view->currentItem( )); 784void AdvancedFm::doRename(QListView * view) {
785 r = QRect( view->viewportToContents( r.topLeft() ), r.size() ); 785 if( !CurrentView()->currentItem()) return;
786 r.setX( view->contentsX() ); 786
787 787 QRect r = view->itemRect( view->currentItem( ));
788 if ( r.width() > view->visibleWidth() ) 788 r = QRect( view->viewportToContents( r.topLeft() ), r.size() );
789 r.setWidth( view->visibleWidth() ); 789 r.setX( view->contentsX() );
790 790
791 renameBox = new QLineEdit( view->viewport(), "qt_renamebox" ); 791 if ( r.width() > view->visibleWidth() )
792 renameBox->setFrame(true); 792 r.setWidth( view->visibleWidth() );
793 793
794 renameBox->setText( view->currentItem()->text(0) ); 794 renameBox = new QLineEdit( view->viewport(), "qt_renamebox" );
795 795 renameBox->setFrame(true);
796 renameBox->selectAll(); 796
797 renameBox->installEventFilter( this ); 797 renameBox->setText( view->currentItem()->text(0) );
798 798
799 view->addChild( renameBox, r.x(), r.y() ); 799 renameBox->selectAll();
800 800 renameBox->installEventFilter( this );
801 renameBox->resize( r.size() ); 801
802 802 view->addChild( renameBox, r.x(), r.y() );
803 view->viewport()->setFocusProxy( renameBox ); 803
804 804 renameBox->resize( r.size() );
805 renameBox->setFocus(); 805
806 renameBox->show(); 806 view->viewport()->setFocusProxy( renameBox );
807} 807
808 808 renameBox->setFocus();
809 809 renameBox->show();
810void AdvancedFm::renameIt() { 810}
811 if( !CurrentView()->currentItem()) return; 811
812 812
813 QListView *thisView = CurrentView(); 813void AdvancedFm::renameIt() {
814 oldName = thisView->currentItem()->text(0); 814 if( !CurrentView()->currentItem()) return;
815 doRename( thisView ); 815
816} 816 QListView *thisView = CurrentView();
817 817 oldName = thisView->currentItem()->text(0);
818void AdvancedFm::okRename() { 818 doRename( thisView );
819 if( !renameBox) return; 819}
820 820
821 QString newName = renameBox->text(); 821void AdvancedFm::okRename() {
822 cancelRename(); 822 if( !renameBox) return;
823 QListView * view = CurrentView(); 823
824 QString path = CurrentDir()->canonicalPath() + "/"; 824 QString newName = renameBox->text();
825 oldName = path + oldName; 825 cancelRename();
826 newName = path + newName; 826 QListView * view = CurrentView();
827 if( rename( oldName.latin1(), newName.latin1())== -1) 827 QString path = CurrentDir()->canonicalPath() + "/";
828 QMessageBox::message(tr("Note"),tr("Could not rename")); 828 oldName = path + oldName;
829 else 829 newName = path + newName;
830 oldName = ""; 830 if( rename( oldName.latin1(), newName.latin1())== -1)
831 QListViewItem *item = view->currentItem(); 831 QMessageBox::message(tr("Note"),tr("Could not rename"));
832 view->takeItem( item ); 832 else
833 delete item; 833 oldName = "";
834 rePopulate(); 834 QListViewItem *item = view->currentItem();
835} 835 view->takeItem( item );
836 836 delete item;
837void AdvancedFm::openSearch() { 837 rePopulate();
838 QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); 838}
839} 839
840void AdvancedFm::openSearch() {
841 QMessageBox::message(tr("Note"),tr("Not Yet Implemented"));
842}
diff --git a/noncore/apps/advancedfm/filePermissions.cpp b/noncore/apps/advancedfm/filePermissions.cpp
index 9698de7..b7d48e8 100644
--- a/noncore/apps/advancedfm/filePermissions.cpp
+++ b/noncore/apps/advancedfm/filePermissions.cpp
@@ -29,13 +29,13 @@
29 29
30filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName ) 30filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName )
31 : QDialog( parent, name, modal, fl ) 31 : QDialog( parent, name, modal, fl )
32{ 32{
33 if ( !name ) 33 if ( !name )
34 setName( tr("filePermissions") ); 34 setName( tr("filePermissions") );
35// qDebug("FilePermissions "+fileName); 35// odebug << "FilePermissions "+fileName << oendl;
36/* resize( 236, 210 ); 36/* resize( 236, 210 );
37 setMaximumSize( QSize( 236, 210 ) ); 37 setMaximumSize( QSize( 236, 210 ) );
38*/ setCaption( tr( "Set File Permissions" ) ); 38*/ setCaption( tr( "Set File Permissions" ) );
39 39
40 TextLabel1 = new QLabel( this, "TextLabel1" ); 40 TextLabel1 = new QLabel( this, "TextLabel1" );
41 TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) ); 41 TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) );
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp
index 6906298..8c585f4 100644
--- a/noncore/apps/advancedfm/output.cpp
+++ b/noncore/apps/advancedfm/output.cpp
@@ -2,25 +2,28 @@
2** outputEdit.cpp 2** outputEdit.cpp
3** 3**
4** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com> 4** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com>
5****************************************************************************/ 5****************************************************************************/
6#include "output.h" 6#include "output.h"
7 7
8/* OPIE */
9#include <opie2/odebug.h>
8#include <qpe/qpeapplication.h> 10#include <qpe/qpeapplication.h>
9#include <qpe/applnk.h> 11#include <qpe/applnk.h>
12using namespace Opie::Core;
10 13
14/* QT */
11#include <qfile.h> 15#include <qfile.h>
12#include <qmultilineedit.h> 16#include <qmultilineedit.h>
13#include <qpushbutton.h> 17#include <qpushbutton.h>
14#include <qlayout.h> 18#include <qlayout.h>
15 19
20/* STD */
16#include <errno.h> 21#include <errno.h>
17 22
18/* XPM */ 23/* XPM */
19using namespace Opie::Core;
20using namespace Opie::Core;
21static char * filesave_xpm[] = { 24static char * filesave_xpm[] = {
22"16 16 78 1", 25"16 16 78 1",
23" c None", 26" c None",
24". c #343434", 27". c #343434",
25"+ c #A0A0A0", 28"+ c #A0A0A0",
26"@ c #565656", 29"@ c #565656",
@@ -118,13 +121,13 @@ static char * filesave_xpm[] = {
118Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl) 121Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl)
119 : QDialog( parent, name, modal, fl ) 122 : QDialog( parent, name, modal, fl )
120{ 123{
121 QStringList cmmds; 124 QStringList cmmds;
122// cmmds=QStringList::split( " ", commands, false); 125// cmmds=QStringList::split( " ", commands, false);
123 cmmds=commands; 126 cmmds=commands;
124// qDebug("count %d", cmmds.count()); 127// odebug << "count " << cmmds.count() << "" << oendl;
125 if ( !name ) 128 if ( !name )
126 setName( tr("Output")); 129 setName( tr("Output"));
127 resize( 196, 269 ); 130 resize( 196, 269 );
128 setCaption( name ); 131 setCaption( name );
129 132
130 OutputLayout = new QGridLayout( this ); 133 OutputLayout = new QGridLayout( this );
@@ -154,13 +157,13 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name,
154 157
155// connect( , SIGNAL(received(const QByteArray&)), 158// connect( , SIGNAL(received(const QByteArray&)),
156// this, SLOT(commandStdin(const QByteArray&))); 159// this, SLOT(commandStdin(const QByteArray&)));
157 160
158// * proc << commands.latin1(); 161// * proc << commands.latin1();
159 for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { 162 for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) {
160 qDebug( "%s", (*it).latin1() ); 163 odebug << "" << (*it).latin1() << "" << oendl;
161 * proc << (*it).latin1(); 164 * proc << (*it).latin1();
162 } 165 }
163 166
164 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { 167 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) {
165 168
166 OutputEdit->append(tr("Process could not start") ); 169 OutputEdit->append(tr("Process could not start") );
@@ -183,32 +186,32 @@ void Output::saveOutput() {
183 if( fileDlg->result() == 1 ) { 186 if( fileDlg->result() == 1 ) {
184 QString filename = QPEApplication::documentDir(); 187 QString filename = QPEApplication::documentDir();
185 if(filename.right(1).find('/') == -1) 188 if(filename.right(1).find('/') == -1)
186 filename+="/"; 189 filename+="/";
187 QString name = fileDlg->LineEdit1->text(); 190 QString name = fileDlg->LineEdit1->text();
188 filename+="text/plain/"+name; 191 filename+="text/plain/"+name;
189 qDebug(filename); 192 odebug << filename << oendl;
190 193
191 QFile f(filename); 194 QFile f(filename);
192 f.open( IO_WriteOnly); 195 f.open( IO_WriteOnly);
193 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { 196 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) {
194 DocLnk lnk; 197 DocLnk lnk;
195 lnk.setName(name); //sets file name 198 lnk.setName(name); //sets file name
196 lnk.setFile(filename); //sets File property 199 lnk.setFile(filename); //sets File property
197 lnk.setType("text/plain"); 200 lnk.setType("text/plain");
198 if(!lnk.writeLink()) { 201 if(!lnk.writeLink()) {
199 qDebug("Writing doclink did not work"); 202 odebug << "Writing doclink did not work" << oendl;
200 } 203 }
201 } else 204 } else
202 qWarning("Could not write file"); 205 owarn << "Could not write file" << oendl;
203 f.close(); 206 f.close();
204 } 207 }
205} 208}
206 209
207void Output::commandStdout(OProcess*, char *buffer, int buflen) { 210void Output::commandStdout(OProcess*, char *buffer, int buflen) {
208 qWarning("received stdout %d bytes", buflen); 211 owarn << "received stdout " << buflen << " bytes" << oendl;
209 212
210// QByteArray data(buflen); 213// QByteArray data(buflen);
211// data.fill(*buffer, buflen); 214// data.fill(*buffer, buflen);
212// for (uint i = 0; i < data.count(); i++ ) { 215// for (uint i = 0; i < data.count(); i++ ) {
213// printf("%c", buffer[i] ); 216// printf("%c", buffer[i] );
214// } 217// }
@@ -219,19 +222,19 @@ void Output::commandStdout(OProcess*, char *buffer, int buflen) {
219 OutputEdit->append(lineStr); 222 OutputEdit->append(lineStr);
220 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 223 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
221} 224}
222 225
223 226
224void Output::commandStdin( const QByteArray &data) { 227void Output::commandStdin( const QByteArray &data) {
225 qWarning("received stdin %d bytes", data.size()); 228 owarn << "received stdin " << data.size() << " bytes" << oendl;
226 // recieved data from the io layer goes to sz 229 // recieved data from the io layer goes to sz
227 proc->writeStdin(data.data(), data.size()); 230 proc->writeStdin(data.data(), data.size());
228} 231}
229 232
230void Output::commandStderr(OProcess*, char *buffer, int buflen) { 233void Output::commandStderr(OProcess*, char *buffer, int buflen) {
231 qWarning("received stderrt %d bytes", buflen); 234 owarn << "received stderrt " << buflen << " bytes" << oendl;
232 235
233 QString lineStr = buffer; 236 QString lineStr = buffer;
234// lineStr=lineStr.left(lineStr.length()-1); 237// lineStr=lineStr.left(lineStr.length()-1);
235 OutputEdit->append(lineStr); 238 OutputEdit->append(lineStr);
236 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 239 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
237} 240}
diff --git a/noncore/apps/checkbook/checkbook.pro b/noncore/apps/checkbook/checkbook.pro
index 34641f4..1472df6 100644
--- a/noncore/apps/checkbook/checkbook.pro
+++ b/noncore/apps/checkbook/checkbook.pro
@@ -1,7 +1,7 @@
1CONFIG = qt warn_on quick-app 1CONFIG = qt warn_on quick-app
2HEADERS = mainwindow.h \ 2HEADERS = mainwindow.h \
3 cbinfo.h \ 3 cbinfo.h \
4 traninfo.h \ 4 traninfo.h \
5 graphinfo.h \ 5 graphinfo.h \
6 configuration.h \ 6 configuration.h \
7 password.h \ 7 password.h \
diff --git a/noncore/apps/checkbook/listedit.cpp b/noncore/apps/checkbook/listedit.cpp
index d00e305..5026c9d 100644
--- a/noncore/apps/checkbook/listedit.cpp
+++ b/noncore/apps/checkbook/listedit.cpp
@@ -24,20 +24,25 @@
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "listedit.h" 29#include "listedit.h"
30
31/* OPIE */
32#include <opie2/odebug.h>
33#include <qpe/resource.h>
34using namespace Opie::Core;
35
36/* QT */
30#include <qlayout.h> 37#include <qlayout.h>
31#include <qlineedit.h> 38#include <qlineedit.h>
32#include <qlistview.h> 39#include <qlistview.h>
33#include <qwidgetstack.h> 40#include <qwidgetstack.h>
34#include <qcombobox.h> 41#include <qcombobox.h>
35#include <qpushbutton.h> 42#include <qpushbutton.h>
36#include <qpe/resource.h>
37
38 43
39// --- ListEdit --------------------------------------------------------------- 44// --- ListEdit ---------------------------------------------------------------
40ListEdit::ListEdit( QWidget *parent, const char *sName ) 45ListEdit::ListEdit( QWidget *parent, const char *sName )
41 : QWidget(parent, sName), TableDef(sName) 46 : QWidget(parent, sName), TableDef(sName)
42{ 47{
43 // get font height 48 // get font height
@@ -299,13 +304,13 @@ void ListEdit::slotClick(QListViewItem *itm, const QPoint &pnt, int col)
299 if( i>=0 ) { 304 if( i>=0 ) {
300 _box->insertItem( _currentItem->text(_currentColumn) ); 305 _box->insertItem( _currentItem->text(_currentColumn) );
301 _box->setCurrentItem(i); 306 _box->setCurrentItem(i);
302 } 307 }
303 _stack->raiseWidget(_box); 308 _stack->raiseWidget(_box);
304 } else { 309 } else {
305 qDebug( "Unsupported column type for column %s", (const char *)pDef->getName() ); 310 odebug << "Unsupported column type for column " << (const char *)pDef->getName() << "" << oendl;
306 _typeEdit->setText(""); 311 _typeEdit->setText("");
307 _stack->raiseWidget(_typeEdit); 312 _stack->raiseWidget(_typeEdit);
308 } 313 }
309} 314}
310 315
311 316
diff --git a/noncore/apps/checkbook/tabledef.cpp b/noncore/apps/checkbook/tabledef.cpp
index 9a42308..745cd80 100644
--- a/noncore/apps/checkbook/tabledef.cpp
+++ b/noncore/apps/checkbook/tabledef.cpp
@@ -25,12 +25,14 @@
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "tabledef.h" 29#include "tabledef.h"
30 30
31#include <opie2/odebug.h>
32using namespace Opie::Core;
31 33
32// --- ColumnDef -------------------------------------------------------------- 34// --- ColumnDef --------------------------------------------------------------
33ColumnDef::ColumnDef(const char *sName, ColumnType type, const char *sNewValue) 35ColumnDef::ColumnDef(const char *sName, ColumnType type, const char *sNewValue)
34{ 36{
35 _sName=sName; 37 _sName=sName;
36 _type=type; 38 _type=type;
@@ -39,20 +41,20 @@ ColumnDef::ColumnDef(const char *sName, ColumnType type, const char *sNewValue)
39 41
40 42
41// --- addColumnValue --------------------------------------------------------- 43// --- addColumnValue ---------------------------------------------------------
42void ColumnDef::addColumnValue(const QString &sValue) 44void ColumnDef::addColumnValue(const QString &sValue)
43{ 45{
44 if( (_type & 0x00ffffff) !=typeList ) 46 if( (_type & 0x00ffffff) !=typeList )
45 qDebug("Column %s is not a list", (const char *)_sName); 47 odebug << "Column " << (const char *)_sName << " is not a list" << oendl;
46 else 48 else
47 _valueList.append(sValue); 49 _valueList.append(sValue);
48} 50}
49void ColumnDef::addColumnValue(const char *sValue) 51void ColumnDef::addColumnValue(const char *sValue)
50{ 52{
51 if( (_type & 0x00ffffff)!=typeList ) 53 if( (_type & 0x00ffffff)!=typeList )
52 qDebug("Column %s is not a list", (const char *)_sName); 54 odebug << "Column " << (const char *)_sName << " is not a list" << oendl;
53 else 55 else
54 _valueList.append(sValue); 56 _valueList.append(sValue);
55} 57}
56 58
57// --- TableDef --------------------------------------------------------------- 59// --- TableDef ---------------------------------------------------------------
58TableDef::TableDef(const char *sName) 60TableDef::TableDef(const char *sName)
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp
index 1b08b24..aafb588 100644
--- a/noncore/apps/checkbook/transaction.cpp
+++ b/noncore/apps/checkbook/transaction.cpp
@@ -28,14 +28,18 @@
28 28
29#include "transaction.h" 29#include "transaction.h"
30#include "traninfo.h" 30#include "traninfo.h"
31#include "cfg.h" 31#include "cfg.h"
32#include "checkbook.h" 32#include "checkbook.h"
33 33
34/* OPIE */
35#include <opie2/odebug.h>
34#include <qpe/datebookmonth.h> 36#include <qpe/datebookmonth.h>
37using namespace Opie::Core;
35 38
39/* QT */
36#include <qbuttongroup.h> 40#include <qbuttongroup.h>
37#include <qcombobox.h> 41#include <qcombobox.h>
38#include <qlabel.h> 42#include <qlabel.h>
39#include <qlayout.h> 43#include <qlayout.h>
40#include <qlineedit.h> 44#include <qlineedit.h>
41#include <qmultilineedit.h> 45#include <qmultilineedit.h>
@@ -329,9 +333,9 @@ void Transaction::slotActivated(const QString &arg )
329 } 333 }
330} 334}
331 335
332// slotNotNew ----------------------------------------------------------------- 336// slotNotNew -----------------------------------------------------------------
333void Transaction::slotNotNew() 337void Transaction::slotNotNew()
334{ 338{
335 qDebug("Not new"); 339 odebug << "Not new" << oendl;
336 _bNew=false; 340 _bNew=false;
337} 341}
diff --git a/noncore/apps/confedit/confedit.pro b/noncore/apps/confedit/confedit.pro
index 5a71680..785c588 100644
--- a/noncore/apps/confedit/confedit.pro
+++ b/noncore/apps/confedit/confedit.pro
@@ -1,21 +1,9 @@
1CONFIG = qt warn_on quick-app 1CONFIG = qt warn_on quick-app
2HEADERS = mainwindow.h listviewconfdir.h listviewitemconffile.h listviewitemconfigentry.h editwidget.h listviewitemconf.h 2HEADERS = mainwindow.h listviewconfdir.h listviewitemconffile.h listviewitemconfigentry.h editwidget.h listviewitemconf.h
3SOURCES = main.cpp mainwindow.cpp listviewconfdir.cpp listviewitemconffile.cpp listviewitemconfigentry.cpp editwidget.cpp listviewitemconf.cpp 3SOURCES = main.cpp mainwindow.cpp listviewconfdir.cpp listviewitemconffile.cpp listviewitemconfigentry.cpp editwidget.cpp listviewitemconf.cpp
4INCLUDEPATH += $(OPIEDIR)/include 4INCLUDEPATH += $(OPIEDIR)/include
5DEPENDPATH += $(OPIEDIR)/include 5DEPENDPATH += $(OPIEDIR)/include
6INTERFACES = 6LIBS += -lqpe -lopiecore2
7LIBS += -lopiecore2
8TARGET = confedit 7TARGET = confedit
9 8
10!contains( platform, x11 ) { 9include ( $(OPIEDIR)/include.pro )
11
12 include ( $(OPIEDIR)/include.pro )
13 LIBS += -lqpe
14}
15
16contains( platform, x11 ) {
17 LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib
18}
19
20
21
diff --git a/noncore/apps/confedit/config.in b/noncore/apps/confedit/config.in
index e377307..d7682dc 100644
--- a/noncore/apps/confedit/config.in
+++ b/noncore/apps/confedit/config.in
@@ -1,4 +1,4 @@
1 config CONFEDIT 1 config CONFEDIT
2 boolean "opie-confeditor (generic editor for all Opie settings)" 2 boolean "opie-confedit (generic editor for all Opie settings)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/noncore/apps/confedit/listviewconfdir.cpp b/noncore/apps/confedit/listviewconfdir.cpp
index 0c2feeb..33bffe1 100644
--- a/noncore/apps/confedit/listviewconfdir.cpp
+++ b/noncore/apps/confedit/listviewconfdir.cpp
@@ -6,16 +6,20 @@
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> 9 // (c) 2002 Patrick S. Vogtp <tille@handhelds.org>
10 10
11#include "listviewconfdir.h" 11#include "listviewconfdir.h"
12#include "listviewitemconffile.h"
12 13
13#include <qmessagebox.h> 14/* OPIE */
15#include <opie2/odebug.h>
16using namespace Opie::Core;
14 17
15#include "listviewitemconffile.h" 18/* QT */
19#include <qmessagebox.h>
16 20
17ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) 21ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name )
18 : QListView(parent,name), confDir(settingsPath) 22 : QListView(parent,name), confDir(settingsPath)
19{ 23{
20 24
21 setRootIsDecorated( true ); 25 setRootIsDecorated( true );
@@ -33,24 +37,24 @@ ListViewConfDir::~ListViewConfDir()
33{ 37{
34} 38}
35 39
36void ListViewConfDir::readConfFiles() 40void ListViewConfDir::readConfFiles()
37{ 41{
38 42
39 confDir.setFilter( QDir::Files | QDir::NoSymLinks ); 43 confDir.setFilter( QDir::Files | QDir::NoSymLinks );
40 confDir.setSorting( QDir::Name ); 44 confDir.setSorting( QDir::Name );
41 confDir.setNameFilter("*.conf"); 45 confDir.setNameFilter("*.conf");
42 const QFileInfoList *list = confDir.entryInfoList(); 46 const QFileInfoList *list = confDir.entryInfoList();
43 QFileInfoListIterator it( *list ); 47 QFileInfoListIterator it( *list );
44 QFileInfo *fi; 48 QFileInfo *fi;
45 49
46 ListViewItemConfFile *fileEntry; 50 ListViewItemConfFile *fileEntry;
47 51
48 while ( (fi=it.current()) ) 52 while ( (fi=it.current()) )
49 { 53 {
50 qDebug( "opening: >%s<", fi->fileName().data() ); 54 odebug << "opening: >" << fi->fileName().data() << "<" << oendl;
51 fileEntry = new ListViewItemConfFile( fi, this ); 55 fileEntry = new ListViewItemConfFile( fi, this );
52 QListViewItem *dummy = new QListViewItem(fileEntry, "dummy"); 56 QListViewItem *dummy = new QListViewItem(fileEntry, "dummy");
53 ++it; 57 ++it;
54 } 58 }
55} 59}
56 60
diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp
index 1ff2c44..2958cf5 100644
--- a/noncore/apps/confedit/listviewitemconffile.cpp
+++ b/noncore/apps/confedit/listviewitemconffile.cpp
@@ -6,23 +6,29 @@
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 9// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
10 10
11#include "listviewitemconffile.h" 11#include "listviewitemconffile.h"
12#include "listviewitemconfigentry.h"
13
14/* OPIE */
15#include <opie2/odebug.h>
16using namespace Opie::Core;
17
18/* QT */
12#include <qmessagebox.h> 19#include <qmessagebox.h>
13#include <qtextstream.h> 20#include <qtextstream.h>
14#include "listviewitemconfigentry.h"
15 21
16#define tr QObject::tr 22#define tr QObject::tr
17 23
18ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent) 24ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent)
19 : ListViewItemConf(parent), _valid(false) 25 : ListViewItemConf(parent), _valid(false)
20{ 26{
21 confFileInfo = file; 27 confFileInfo = file;
22// parseFile(); 28 // parseFile();
23 displayText(); 29 displayText();
24} 30}
25 31
26ListViewItemConfFile::~ListViewItemConfFile() 32ListViewItemConfFile::~ListViewItemConfFile()
27{ 33{
28} 34}
@@ -37,49 +43,49 @@ QString ListViewItemConfFile::fileName()
37{ 43{
38 return confFileInfo->fileName(); 44 return confFileInfo->fileName();
39} 45}
40 46
41void ListViewItemConfFile::parseFile() 47void ListViewItemConfFile::parseFile()
42{ 48{
43 //qDebug("ListViewItemConfFile::parseFile BEGIN"); 49 //odebug << "ListViewItemConfFile::parseFile BEGIN" << oendl;
44 QFile confFile(confFileInfo->absFilePath()); 50 QFile confFile(confFileInfo->absFilePath());
45 if(! confFile.open(IO_ReadOnly)) 51 if(! confFile.open(IO_ReadOnly))
46 QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); 52 QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0);
47 QTextStream t( &confFile ); 53 QTextStream t( &confFile );
48 QString s; 54 QString s;
49 QString group; 55 QString group;
50 ListViewItemConfigEntry *groupItem; 56 ListViewItemConfigEntry *groupItem;
51 ListViewItemConfigEntry *item; 57 ListViewItemConfigEntry *item;
52 while ( !t.atEnd() ) 58 while ( !t.atEnd() )
53 { 59 {
54 s = t.readLine().stripWhiteSpace(); 60 s = t.readLine().stripWhiteSpace();
55 //qDebug( "line: >%s<\n", s.latin1() ); 61 //odebug << "line: >" << s.latin1() << "<\n" << oendl;
56 if (s.contains("<?xml")) 62 if (s.contains("<?xml"))
57 { 63 {
58 _valid = false; 64 _valid = false;
59 break; 65 break;
60 }else 66 }else
61 if ( s[0] == '[' && s[s.length()-1] == ']' ) 67 if ( s[0] == '[' && s[s.length()-1] == ']' )
62 { 68 {
63 // qDebug("got group"+s); 69 // odebug << "got group"+s << oendl;
64 group = s.mid(1,s.length()-2); 70 group = s.mid(1,s.length()-2);
65 if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); 71 if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") );
66 groupItem = new ListViewItemConfigEntry(this, group ); 72 groupItem = new ListViewItemConfigEntry(this, group );
67 insertItem( groupItem ); 73 insertItem( groupItem );
68 } else 74 } else
69 if ( int pos = s.find('=') ) 75 if ( int pos = s.find('=') )
70 { 76 {
71// qDebug("got key"+s); 77// odebug << "got key"+s << oendl;
72 if (!groupItem) qDebug("PANIK NO GROUP! >%s<",group.latin1()); 78 if (!groupItem) odebug << "PANIK NO GROUP! >" << group.latin1() << "<" << oendl;
73 item = new ListViewItemConfigEntry(this, group, s ); 79 item = new ListViewItemConfigEntry(this, group, s );
74 groupItem->insertItem( item ); 80 groupItem->insertItem( item );
75 } 81 }
76 } 82 }
77 confFile.close(); 83 confFile.close();
78 setExpandable( _valid ); 84 setExpandable( _valid );
79 //qDebug("ListViewItemConfFile::parseFile END"); 85 //odebug << "ListViewItemConfFile::parseFile END" << oendl;
80} 86}
81 87
82 88
83void ListViewItemConfFile::remove() 89void ListViewItemConfFile::remove()
84{ 90{
85 QFile::remove(confFileInfo->absFilePath()); 91 QFile::remove(confFileInfo->absFilePath());
diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp
index 6ef1043..4b04c97 100644
--- a/noncore/apps/confedit/mainwindow.cpp
+++ b/noncore/apps/confedit/mainwindow.cpp
@@ -8,21 +8,24 @@
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 10// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
11 11
12 12
13#include "mainwindow.h" 13#include "mainwindow.h"
14#include "listviewconfdir.h"
15#include "listviewitemconfigentry.h"
14 16
17/* OPIE */
18#include <opie2/odebug.h>
19using namespace Opie::Core;
20
21/* QT */
15#include <qlabel.h> 22#include <qlabel.h>
16#include <qlayout.h> 23#include <qlayout.h>
17#include <qlineedit.h> 24#include <qlineedit.h>
18 25
19#include "listviewconfdir.h"
20#include "listviewitemconfigentry.h"
21
22
23MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : 26MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
24 QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0) 27 QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0)
25{ 28{
26 setCaption( tr("Conf File Editor") ); 29 setCaption( tr("Conf File Editor") );
27 30
28 //setBaseSize( qApp->globalStrut() ); 31 //setBaseSize( qApp->globalStrut() );
@@ -30,18 +33,18 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
30 33
31 mainLayout = new QVBoxLayout( this ); 34 mainLayout = new QVBoxLayout( this );
32 mainLayout->setSpacing( 0 ); 35 mainLayout->setSpacing( 0 );
33 mainLayout->setMargin( 0 ); 36 mainLayout->setMargin( 0 );
34 37
35 38
36 qDebug("creating settingList"); 39 odebug << "creating settingList" << oendl;
37 settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist"); 40 settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist");
38 settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); 41 settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) );
39 mainLayout->addWidget( settingList, 0); 42 mainLayout->addWidget( settingList, 0);
40 43
41 qDebug("creating editor"); 44 odebug << "creating editor" << oendl;
42 editor = new EditWidget(this); 45 editor = new EditWidget(this);
43 editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); 46 editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) );
44 mainLayout->addWidget( editor, 1 ); 47 mainLayout->addWidget( editor, 1 );
45 editor->layoutType( ListViewItemConf::File ); 48 editor->layoutType( ListViewItemConf::File );
46 49
47 makeMenu(); 50 makeMenu();
@@ -95,13 +98,13 @@ MainWindow::~MainWindow()
95} 98}
96 99
97 100
98 101
99void MainWindow::setCurrent(QListViewItem *item) 102void MainWindow::setCurrent(QListViewItem *item)
100{ 103{
101 //qDebug("MainWindow::setCurrent"); 104 //odebug << "MainWindow::setCurrent" << oendl;
102 if (!item) return; 105 if (!item) return;
103 _item = (ListViewItemConf*) item; 106 _item = (ListViewItemConf*) item;
104 if (!_item) return; 107 if (!_item) return;
105 popupTimer->start( 750, true ); 108 popupTimer->start( 750, true );
106 if (_item->getType() == ListViewItemConf::File) 109 if (_item->getType() == ListViewItemConf::File)
107 { 110 {
@@ -171,13 +174,13 @@ void MainWindow::removeConfFile()
171 if (!_item) return; 174 if (!_item) return;
172 _item->remove(); 175 _item->remove();
173} 176}
174 177
175void MainWindow::showPopup() 178void MainWindow::showPopup()
176{ 179{
177qDebug("showPopup"); 180odebug << "showPopup" << oendl;
178 if (!_item) return; 181 if (!_item) return;
179 popupActionRevert->setEnabled(_item->revertable()); 182 popupActionRevert->setEnabled(_item->revertable());
180 popupActionSave->setEnabled(_item->isChanged()); 183 popupActionSave->setEnabled(_item->isChanged());
181 if (_fileItem) 184 if (_fileItem)
182 { 185 {
183 popupActionSave->setEnabled(_fileItem->isChanged()); 186 popupActionSave->setEnabled(_fileItem->isChanged());
diff --git a/noncore/apps/keyz-cfg/cfgfile.cpp b/noncore/apps/keyz-cfg/cfgfile.cpp
index b0dc968..81d1ee1 100644
--- a/noncore/apps/keyz-cfg/cfgfile.cpp
+++ b/noncore/apps/keyz-cfg/cfgfile.cpp
@@ -1,9 +1,15 @@
1#include <qmessagebox.h>
2#include "cfgfile.h" 1#include "cfgfile.h"
3 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */
8#include <qmessagebox.h>
9
4// CfgEntry implementation 10// CfgEntry implementation
5CfgEntry::CfgEntry() { 11CfgEntry::CfgEntry() {
6} 12}
7 13
8CfgEntry::CfgEntry(const QString& f, const QString& l): 14CfgEntry::CfgEntry(const QString& f, const QString& l):
9 file(f), label(l) { 15 file(f), label(l) {
@@ -92,24 +98,24 @@ bool CfgParser::load(QString file, CfgFile& cfg) {
92 err = ""; 98 err = "";
93 ardelay = -1; 99 ardelay = -1;
94 arperiod = -1; 100 arperiod = -1;
95 reader.parse(is); 101 reader.parse(is);
96 102
97 if (!err.isEmpty()) { 103 if (!err.isEmpty()) {
98 qDebug(err); 104 odebug << err << oendl;
99 return false; 105 return false;
100 } 106 }
101 107
102 QMap<QString, QString>::Iterator fit, lit; 108 QMap<QString, QString>::Iterator fit, lit;
103 for(uint i = 0; i < includeList.count(); i++) { 109 for(uint i = 0; i < includeList.count(); i++) {
104 QString file = *includeList.at(i); 110 QString file = *includeList.at(i);
105 fit = includes.find(file); 111 fit = includes.find(file);
106 QString prefix = fit.data(); 112 QString prefix = fit.data();
107 QString label = ""; 113 QString label = "";
108 114
109 qDebug("include: file=" + fit.key() + ", prefix=" + fit.data()); 115 odebug << "include: file=" + fit.key() + ", prefix=" + fit.data() << oendl;
110 lit = labels.find(prefix+":*"); 116 lit = labels.find(prefix+":*");
111 if (lit != labels.end()) { 117 if (lit != labels.end()) {
112 label = lit.data(); 118 label = lit.data();
113 } 119 }
114 120
115 cfg.replaceEntry(file, label); 121 cfg.replaceEntry(file, label);
diff --git a/noncore/apps/keyz-cfg/config.in b/noncore/apps/keyz-cfg/config.in
index 29a10f5..8e1be2d 100644
--- a/noncore/apps/keyz-cfg/config.in
+++ b/noncore/apps/keyz-cfg/config.in
@@ -1,4 +1,4 @@
1 config KEYZCFG 1 config KEYZCFG
2 boolean "keyz-cfg (configuration tool for keyz applet)" 2 boolean "keyz-cfg (configuration tool for keyz applet)"
3 default "n" 3 default "n"
4 depends ( LIBQPE || LIBQPE-X11 ) 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/noncore/apps/keyz-cfg/keyz-cfg.pro b/noncore/apps/keyz-cfg/keyz-cfg.pro
index 44bbb5f..7ac604b 100644
--- a/noncore/apps/keyz-cfg/keyz-cfg.pro
+++ b/noncore/apps/keyz-cfg/keyz-cfg.pro
@@ -1,24 +1,24 @@
1TEMPLATE = app 1TEMPLATE = app
2DESTDIR = $(OPIEDIR)/bin 2DESTDIR = $(OPIEDIR)/bin
3 CONFIG = qt warn_on 3 CONFIG = qt warn_on
4 HEADERS = zkb.h \ 4 HEADERS = zkb.h \
5 zkbcfg.h \ 5 zkbcfg.h \
6 zkbnames.h \ 6 zkbnames.h \
7 zkbxml.h \ 7 zkbxml.h \
8 cfgdlg.h \ 8 cfgdlg.h \
9 cfgfile.h 9 cfgfile.h
10 10
11 SOURCES = main.cpp \ 11 SOURCES = main.cpp \
12 cfgdlg.cpp \ 12 cfgdlg.cpp \
13 cfgfile.cpp \ 13 cfgfile.cpp \
14 zkb.cpp \ 14 zkb.cpp \
15 zkbcfg.cpp \ 15 zkbcfg.cpp \
16 zkbnames.cpp \ 16 zkbnames.cpp \
17 zkbxml.cpp 17 zkbxml.cpp
18 18
19INCLUDEPATH += $(OPIEDIR)/include 19INCLUDEPATH += $(OPIEDIR)/include
20DEPENDPATH += $(OPIEDIR)/include 20DEPENDPATH += $(OPIEDIR)/include
21 LIBS += -lqpe 21 LIBS += -lqpe -lopiecore2
22 TARGET = keyz-cfg 22 TARGET = keyz-cfg
23 23
24include ( $(OPIEDIR)/include.pro ) 24include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/keyz-cfg/zkb.cpp b/noncore/apps/keyz-cfg/zkb.cpp
index f315d4b..8382615 100644
--- a/noncore/apps/keyz-cfg/zkb.cpp
+++ b/noncore/apps/keyz-cfg/zkb.cpp
@@ -361,13 +361,13 @@ State* Keymap::getStateByLabel(const QString& label) {
361 n = currentStateName.findRev(":"); 361 n = currentStateName.findRev(":");
362 if (n >= 0) { 362 if (n >= 0) {
363 name += currentStateName.mid(n+1); 363 name += currentStateName.mid(n+1);
364 } 364 }
365 } 365 }
366 366
367 //qDebug("look for: %s\n", (const char*) name.utf8()); 367 //odebug << "look for: " << (const char*) name.utf8() << "\n" << oendl;
368 QMap<QString, State*>::Iterator sit = states.find(name); 368 QMap<QString, State*>::Iterator sit = states.find(name);
369 if (sit != states.end()) { 369 if (sit != states.end()) {
370 state = sit.data(); 370 state = sit.data();
371 } 371 }
372 372
373 return state; 373 return state;
@@ -413,13 +413,13 @@ bool Keymap::setCurrentState(State* state) {
413 413
414 QMap<State*, QString>::Iterator tit; 414 QMap<State*, QString>::Iterator tit;
415 tit = stateLabelMap.find(state); 415 tit = stateLabelMap.find(state);
416 if (tit != stateLabelMap.end()) { 416 if (tit != stateLabelMap.end()) {
417 currentLabel = tit.data(); 417 currentLabel = tit.data();
418 } else { 418 } else {
419 // qDebug("no label for: " + currentStateName + "\n"); 419 // odebug << "no label for: " + currentStateName + "\n" << oendl;
420 currentLabel = ""; 420 currentLabel = "";
421 } 421 }
422 422
423 return true; 423 return true;
424 } 424 }
425 } 425 }
diff --git a/noncore/apps/keyz-cfg/zkbcfg.cpp b/noncore/apps/keyz-cfg/zkbcfg.cpp
index 0992b9a..f1d53ba 100644
--- a/noncore/apps/keyz-cfg/zkbcfg.cpp
+++ b/noncore/apps/keyz-cfg/zkbcfg.cpp
@@ -1,10 +1,14 @@
1#include <qfileinfo.h>
2
3#include "zkbcfg.h" 1#include "zkbcfg.h"
4 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */
8#include <qfileinfo.h>
5 9
6// Implementation of XkbConfig class 10// Implementation of XkbConfig class
7ZkbConfig::ZkbConfig(const QString& dir):path(dir) { 11ZkbConfig::ZkbConfig(const QString& dir):path(dir) {
8} 12}
9 13
10ZkbConfig::~ZkbConfig() { 14ZkbConfig::~ZkbConfig() {
@@ -12,13 +16,13 @@ ZkbConfig::~ZkbConfig() {
12 16
13bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) { 17bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) {
14 bool ret; 18 bool ret;
15 QFile f(path+"/"+file); 19 QFile f(path+"/"+file);
16 QFileInfo fi(f); 20 QFileInfo fi(f);
17 21
18 qDebug("start loading file=%s\n", (const char*) file.utf8()); 22 odebug << "start loading file=" << (const char*) file.utf8() << "\n" << oendl;
19 if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) { 23 if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) {
20 return false; 24 return false;
21 } 25 }
22 26
23 includedFiles.insert(fi.absFilePath(), 1); 27 includedFiles.insert(fi.absFilePath(), 1);
24 QXmlInputSource is(f); 28 QXmlInputSource is(f);
@@ -27,14 +31,13 @@ bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix)
27 31
28 reader.setContentHandler(&h); 32 reader.setContentHandler(&h);
29 reader.setErrorHandler(this); 33 reader.setErrorHandler(this);
30 ret = reader.parse(is); 34 ret = reader.parse(is);
31 includedFiles.remove(fi.absFilePath()); 35 includedFiles.remove(fi.absFilePath());
32 36
33 qDebug("end loading file=%s : status=%s\n", (const char*) file.utf8(), 37 odebug << "end loading file=" << file.utf8() << ": status=" << err.utf8() << oendl;
34 (const char*) err.utf8());
35 return ret; 38 return ret;
36} 39}
37 40
38bool ZkbConfig::warning(const QXmlParseException& e) { 41bool ZkbConfig::warning(const QXmlParseException& e) {
39 QString tmp; 42 QString tmp;
40 43
@@ -119,13 +122,13 @@ bool ZkbHandler::startLabelElement(const QString& label,
119bool ZkbHandler::startStateElement(const QString& name, 122bool ZkbHandler::startStateElement(const QString& name,
120 const QString& parentName, bool dflt) { 123 const QString& parentName, bool dflt) {
121 124
122 currentStateName = prefix + name; 125 currentStateName = prefix + name;
123 currentState = keymap.getStateByName(currentStateName); 126 currentState = keymap.getStateByName(currentStateName);
124 127
125 //qDebug("state name=%s\n", (const char*) currentStateName.utf8()); 128 //odebug << "state name=" << (const char*) currentStateName.utf8() << "\n" << oendl;
126 129
127 State* parent = 0; 130 State* parent = 0;
128 if (!parentName.isEmpty()) { 131 if (!parentName.isEmpty()) {
129 QString pn = prefix + parentName; 132 QString pn = prefix + parentName;
130 parent = keymap.getStateByName(pn); 133 parent = keymap.getStateByName(pn);
131 if (parent == 0) { 134 if (parent == 0) {
diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp
index e6cb515..59fc242 100644
--- a/noncore/apps/opie-bartender/bartender.cpp
+++ b/noncore/apps/opie-bartender/bartender.cpp
@@ -13,37 +13,40 @@
13#include "bartender.h" 13#include "bartender.h"
14#include "showdrinks.h" 14#include "showdrinks.h"
15#include "inputDialog.h" 15#include "inputDialog.h"
16#include "searchresults.h" 16#include "searchresults.h"
17#include "bac.h" 17#include "bac.h"
18 18
19#include <qtoolbar.h> 19/* OPIE */
20#include <qmenubar.h> 20#include <opie2/odebug.h>
21//#include <opie2/colorpopupmenu.h>
22#include <qpe/qpeapplication.h> 21#include <qpe/qpeapplication.h>
23#include <qpe/resource.h> 22#include <qpe/resource.h>
23using namespace Opie::Core;
24 24
25/* QT */
25#include <qlineedit.h> 26#include <qlineedit.h>
26#include <qdir.h> 27#include <qdir.h>
27#include <qpushbutton.h> 28#include <qpushbutton.h>
28#include <qlistbox.h> 29#include <qlistbox.h>
29#include <qmultilineedit.h> 30#include <qmultilineedit.h>
30#include <qmessagebox.h> 31#include <qmessagebox.h>
31#include <qtextstream.h> 32#include <qtextstream.h>
32#include <qaction.h> 33#include <qaction.h>
33#include <qheader.h> 34#include <qheader.h>
34#include <qlistview.h> 35#include <qlistview.h>
35#include <qlayout.h> 36#include <qlayout.h>
37#include <qtoolbar.h>
38#include <qmenubar.h>
36 39
40/* STD */
37#include <fcntl.h> 41#include <fcntl.h>
38#include <unistd.h> 42#include <unistd.h>
39#include <stdlib.h> 43#include <stdlib.h>
40#include <stdio.h> 44#include <stdio.h>
41#include <errno.h> 45#include <errno.h>
42 46
43
44Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) 47Bartender::Bartender( QWidget* parent, const char* name, WFlags fl )
45 : QMainWindow( parent, name, fl ) { 48 : QMainWindow( parent, name, fl ) {
46 if ( !name ) 49 if ( !name )
47 setName( "Bartender" ); 50 setName( "Bartender" );
48 QGridLayout *layout = new QGridLayout( this ); 51 QGridLayout *layout = new QGridLayout( this );
49 layout->setSpacing( 2); 52 layout->setSpacing( 2);
@@ -141,19 +144,19 @@ void Bartender::fillList() {
141 QListViewItem * item ; 144 QListViewItem * item ;
142 QTextStream t( &dbFile); 145 QTextStream t( &dbFile);
143 QString s; 146 QString s;
144 while ( !t.eof()) { 147 while ( !t.eof()) {
145 s = t.readLine(); 148 s = t.readLine();
146 if(s.find("#",0,TRUE) != -1) { 149 if(s.find("#",0,TRUE) != -1) {
147// qDebug(s.right(s.length()-2)); 150// odebug << s.right(s.length()-2) << oendl;
148 item= new QListViewItem( DrinkView, 0 ); 151 item= new QListViewItem( DrinkView, 0 );
149 item->setText( 0, s.right(s.length()-2)); 152 item->setText( 0, s.right(s.length()-2));
150 i++; 153 i++;
151 } 154 }
152 } 155 }
153 qDebug("there are currently %d of drinks", i); 156 odebug << "there are currently " << i << " of drinks" << oendl;
154} 157}
155 158
156void Bartender::fileNew() { 159void Bartender::fileNew() {
157 160
158 New_Drink *newDrinks; 161 New_Drink *newDrinks;
159 newDrinks = new New_Drink(this,"New Drink....", TRUE); 162 newDrinks = new New_Drink(this,"New Drink....", TRUE);
@@ -168,13 +171,13 @@ void Bartender::fileNew() {
168 QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) ); 171 QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) );
169 return; 172 return;
170 } 173 }
171 if(newDrinks ->result() == 1 ) { 174 if(newDrinks ->result() == 1 ) {
172 QString newDrink="\n# "+newName+"\n"; 175 QString newDrink="\n# "+newName+"\n";
173 newDrink.append(newIng+"\n"); 176 newDrink.append(newIng+"\n");
174 qDebug("writing "+newDrink); 177 odebug << "writing "+newDrink << oendl;
175 dbFile.writeBlock( newDrink.latin1(), newDrink.length()); 178 dbFile.writeBlock( newDrink.latin1(), newDrink.length());
176 clearList(); 179 clearList();
177 dbFile.close(); 180 dbFile.close();
178 181
179 initDrinkDb(); 182 initDrinkDb();
180 } 183 }
@@ -204,13 +207,13 @@ void Bartender::showDrink( QListViewItem *item) {
204 while ( !t.eof()) { 207 while ( !t.eof()) {
205 s = t.readLine(); 208 s = t.readLine();
206 if(s.find( myDrink, 0, TRUE) != -1) { 209 if(s.find( myDrink, 0, TRUE) != -1) {
207 for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { 210 for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) {
208 s2 = t.readLine(); 211 s2 = t.readLine();
209 if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { 212 if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) {
210// qDebug(s2); 213// odebug << s2 << oendl;
211 showDrinks->MultiLineEdit1->append(s2); 214 showDrinks->MultiLineEdit1->append(s2);
212 } 215 }
213 if( dbFile.atEnd() ) break; 216 if( dbFile.atEnd() ) break;
214 } 217 }
215 } 218 }
216 } 219 }
@@ -245,13 +248,13 @@ void Bartender::doSearchByName() {
245 fileDlg->exec(); 248 fileDlg->exec();
246 if( fileDlg->result() == 1 ) { 249 if( fileDlg->result() == 1 ) {
247 searchForDrinkName = fileDlg->LineEdit1->text(); 250 searchForDrinkName = fileDlg->LineEdit1->text();
248 QListViewItemIterator it( DrinkView ); 251 QListViewItemIterator it( DrinkView );
249 for ( ; it.current(); ++it ) { 252 for ( ; it.current(); ++it ) {
250 if ( it.current()->text(0).find( searchForDrinkName, 0, TRUE) != -1 ) { 253 if ( it.current()->text(0).find( searchForDrinkName, 0, TRUE) != -1 ) {
251// qDebug( it.current()->text(0)); 254// odebug << it.current()->text(0) << oendl;
252 searchList.append(it.current()->text(0)); 255 searchList.append(it.current()->text(0));
253 } 256 }
254 } 257 }
255 if(searchList.count() >0) 258 if(searchList.count() >0)
256 showSearchResult(searchList); 259 showSearchResult(searchList);
257 else 260 else
@@ -276,16 +279,16 @@ void Bartender::doSearchByDrink() {
276 279
277 QString s, s2; 280 QString s, s2;
278 while ( !t.eof()) { 281 while ( !t.eof()) {
279 s = t.readLine(); 282 s = t.readLine();
280 if(s.find("#",0,TRUE) != -1) { 283 if(s.find("#",0,TRUE) != -1) {
281 lastDrinkName=s.right(s.length()-2); 284 lastDrinkName=s.right(s.length()-2);
282// qDebug("last drink name "+lastDrinkName); 285// odebug << "last drink name "+lastDrinkName << oendl;
283 } 286 }
284 else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { 287 else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) {
285// qDebug("appending "+lastDrinkName); 288// odebug << "appending "+lastDrinkName << oendl;
286 searchList.append( lastDrinkName); 289 searchList.append( lastDrinkName);
287 tempName=lastDrinkName; 290 tempName=lastDrinkName;
288 } 291 }
289// if( dbFile.atEnd() ) break; 292// if( dbFile.atEnd() ) break;
290 293
291 } //oef 294 } //oef
@@ -310,13 +313,13 @@ void Bartender::showSearchResult(QStringList &searchList) {
310 if( searchDlg->result() == 1 ) { 313 if( searchDlg->result() == 1 ) {
311 result= searchDlg->ListBox1->currentText(); 314 result= searchDlg->ListBox1->currentText();
312 } 315 }
313 QListViewItemIterator it2( DrinkView ); 316 QListViewItemIterator it2( DrinkView );
314 for ( ; it2.current(); ++it2 ) { 317 for ( ; it2.current(); ++it2 ) {
315 if ( it2.current()->text(0)== result ) { 318 if ( it2.current()->text(0)== result ) {
316// qDebug( it2.current()->text(0)); 319// odebug << it2.current()->text(0) << oendl;
317 showDrink(it2.current()); 320 showDrink(it2.current());
318 } 321 }
319 } 322 }
320delete searchDlg; 323delete searchDlg;
321} 324}
322 325
@@ -340,13 +343,13 @@ void Bartender::doEdit() {
340 s = t.readLine(); 343 s = t.readLine();
341 if(s.find( myDrink, 0, TRUE) != -1) { 344 if(s.find( myDrink, 0, TRUE) != -1) {
342 foundAt = dbFile.at() - (s.length()+1); 345 foundAt = dbFile.at() - (s.length()+1);
343 for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { 346 for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) {
344 s2 = t.readLine(); 347 s2 = t.readLine();
345 if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { 348 if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) {
346// qDebug(s2); 349// odebug << s2 << oendl;
347 newDrinks->MultiLineEdit1->append(s2); 350 newDrinks->MultiLineEdit1->append(s2);
348 newDrinks->LineEdit1->setText(myDrink); 351 newDrinks->LineEdit1->setText(myDrink);
349 } 352 }
350 if( dbFile.atEnd() ) break; 353 if( dbFile.atEnd() ) break;
351 } 354 }
352 } 355 }
@@ -367,13 +370,13 @@ void Bartender::doEdit() {
367 370
368// dbFile.at( foundAt); 371// dbFile.at( foundAt);
369#warning FIXME problems with editing drinks db 372#warning FIXME problems with editing drinks db
370 ////////// FIXME write to user file 373 ////////// FIXME write to user file
371 QString newDrink="# "+newName+"\n"; 374 QString newDrink="# "+newName+"\n";
372 newDrink.append(newIng+"\n"); 375 newDrink.append(newIng+"\n");
373 qDebug("writing "+newDrink); 376 odebug << "writing "+newDrink << oendl;
374 dbFile.writeBlock( newDrink.latin1(), newDrink.length()); 377 dbFile.writeBlock( newDrink.latin1(), newDrink.length());
375 clearList(); 378 clearList();
376 379
377 dbFile.flush(); 380 dbFile.flush();
378 381
379 initDrinkDb(); 382 initDrinkDb();
@@ -394,13 +397,13 @@ void Bartender::doBac() {
394void Bartender::openCurrentDrink() { 397void Bartender::openCurrentDrink() {
395 if(DrinkView->currentItem() == NULL) return; 398 if(DrinkView->currentItem() == NULL) return;
396 showDrink(DrinkView->currentItem()); 399 showDrink(DrinkView->currentItem());
397} 400}
398 401
399void Bartender::fileMenuActivated( int item) { 402void Bartender::fileMenuActivated( int item) {
400 qDebug("Item %d", item); 403 odebug << "Item " << item << "" << oendl;
401 switch(item) { 404 switch(item) {
402 case -3: // new -3 405 case -3: // new -3
403 fileNew(); 406 fileNew();
404 break; 407 break;
405 case -4:// open -4 408 case -4:// open -4
406 openCurrentDrink(); 409 openCurrentDrink();
@@ -415,13 +418,13 @@ void Bartender::fileMenuActivated( int item) {
415 break; 418 break;
416 419
417 } 420 }
418} 421}
419 422
420void Bartender::editMenuActivated(int item) { 423void Bartender::editMenuActivated(int item) {
421 qDebug("Item %d", item); 424 odebug << "Item " << item << "" << oendl;
422 /* 425 /*
423 edit -8 426 edit -8
424 */ 427 */
425 switch(item) { 428 switch(item) {
426 case -8: 429 case -8:
427 doEdit() ; 430 doEdit() ;
diff --git a/noncore/apps/opie-bartender/bartender.pro b/noncore/apps/opie-bartender/bartender.pro
index 4ad3c31..41fc0e5 100644
--- a/noncore/apps/opie-bartender/bartender.pro
+++ b/noncore/apps/opie-bartender/bartender.pro
@@ -1,12 +1,11 @@
1TEMPLATE = app 1TEMPLATE = app
2#CONFIG = qt warn_on
3CONFIG = qt warn_on 2CONFIG = qt warn_on
4HEADERS = bartender.h newdrinks.h showdrinks.h inputDialog.h searchresults.h bac.h 3HEADERS = bartender.h newdrinks.h showdrinks.h inputDialog.h searchresults.h bac.h
5SOURCES = main.cpp bartender.cpp newdrinks.cpp showdrinks.cpp inputDialog.cpp searchresults.cpp bac.cpp 4SOURCES = main.cpp bartender.cpp newdrinks.cpp showdrinks.cpp inputDialog.cpp searchresults.cpp bac.cpp
6INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
7DEPENDPATH += $(OPIEDIR)/include 6DEPENDPATH += $(OPIEDIR)/include
8LIBS += -lqpe 7LIBS += -lqpe -lopiecore2
9DESTDIR = $(OPIEDIR)/bin 8DESTDIR = $(OPIEDIR)/bin
10TARGET = bartender 9TARGET = bartender
11 10
12include ( $(OPIEDIR)/include.pro ) 11include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/opie-bartender/config.in b/noncore/apps/opie-bartender/config.in
index c6ca2e6..c39a7d6 100644
--- a/noncore/apps/opie-bartender/config.in
+++ b/noncore/apps/opie-bartender/config.in
@@ -1,4 +1,5 @@
1 config BARTENDER 1 config BARTENDER
2 boolean "bartender - bar receipe and blood alcohol estimator" 2 boolean "bartender - bar receipe and blood alcohol estimator"
3 default "n" 3 default "n"
4 depends ( LIBQPE || LIBQPE-X11 ) 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
5
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index a37f980..6d57703 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -60,16 +60,24 @@
60 over the (obsolete) predecessor. 60 over the (obsolete) predecessor.
61 61
62 There's a sinister ioctl(2), signal(2) and job control stuff 62 There's a sinister ioctl(2), signal(2) and job control stuff
63 nessesary to make everything work as it should. 63 nessesary to make everything work as it should.
64*/ 64*/
65 65
66#include "procctl.h"
67#include "MyPty.h"
66 68
69/* OPIE */
70#include <opie2/odebug.h>
71using namespace Opie::Core;
72
73/* QT */
67#include <qsocketnotifier.h> 74#include <qsocketnotifier.h>
68#include <qfile.h> 75#include <qfile.h>
69 76
77/* STD */
70#include <stdlib.h> 78#include <stdlib.h>
71#include <stdio.h> 79#include <stdio.h>
72#include <signal.h> 80#include <signal.h>
73#include <fcntl.h> 81#include <fcntl.h>
74#include <unistd.h> 82#include <unistd.h>
75#include <termios.h> 83#include <termios.h>
@@ -78,29 +86,25 @@
78#include <sys/wait.h> 86#include <sys/wait.h>
79 87
80#ifdef HAVE_OPENPTY 88#ifdef HAVE_OPENPTY
81#include <pty.h> 89#include <pty.h>
82#endif 90#endif
83 91
84#include "procctl.h"
85#include "MyPty.h"
86
87
88#undef VERBOSE_DEBUG 92#undef VERBOSE_DEBUG
89 93
90 94
91/* -------------------------------------------------------------------------- */ 95/* -------------------------------------------------------------------------- */
92 96
93/*! 97/*!
94 Informs the client program about the 98 Informs the client program about the
95 actual size of the window. 99 actual size of the window.
96*/ 100*/
97 101
98void MyPty::setSize(int lines, int columns) 102void MyPty::setSize(int lines, int columns)
99{ 103{
100 qWarning("setting size"); 104 owarn << "setting size" << oendl;
101 struct winsize wsize; 105 struct winsize wsize;
102 wsize.ws_row = (unsigned short)lines; 106 wsize.ws_row = (unsigned short)lines;
103 wsize.ws_col = (unsigned short)columns; 107 wsize.ws_col = (unsigned short)columns;
104 if(m_fd < 0) return; 108 if(m_fd < 0) return;
105 ioctl(m_fd,TIOCSWINSZ,(char *)&wsize); 109 ioctl(m_fd,TIOCSWINSZ,(char *)&wsize);
106} 110}
diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp
index e535296..d168a5e 100644
--- a/noncore/apps/opie-console/TEWidget.cpp
+++ b/noncore/apps/opie-console/TEWidget.cpp
@@ -1026,13 +1026,13 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e )
1026 QApplication::sendEvent(scrollbar, e); 1026 QApplication::sendEvent(scrollbar, e);
1027 } 1027 }
1028 1028
1029#ifdef FAKE_CTRL_AND_ALT 1029#ifdef FAKE_CTRL_AND_ALT
1030 static bool control = FALSE; 1030 static bool control = FALSE;
1031 static bool alt = FALSE; 1031 static bool alt = FALSE;
1032// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); 1032// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl;
1033 bool dele=FALSE; 1033 bool dele=FALSE;
1034 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { 1034 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
1035 QKeyEvent* ke = (QKeyEvent*)e; 1035 QKeyEvent* ke = (QKeyEvent*)e;
1036 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); 1036 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat();
1037 switch (ke->key()) { 1037 switch (ke->key()) {
1038 case Key_F9: // let this be "Control" 1038 case Key_F9: // let this be "Control"
@@ -1065,17 +1065,17 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e )
1065 1065
1066 if ( e->type() == QEvent::KeyPress ) { 1066 if ( e->type() == QEvent::KeyPress ) {
1067 QKeyEvent* ke = (QKeyEvent*)e; 1067 QKeyEvent* ke = (QKeyEvent*)e;
1068 actSel=0; // Key stroke implies a screen update, so TEWidget won't 1068 actSel=0; // Key stroke implies a screen update, so TEWidget won't
1069 // know where the current selection is. 1069 // know where the current selection is.
1070 1070
1071// qDebug("key pressed is 0x%x",ke->key()); 1071// odebug << "key pressed is 0x" << ke->key() << "" << oendl;
1072 1072
1073 if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker 1073 if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker
1074 1074
1075// qDebug("key pressed 2 is 0x%x",ke->key()); 1075// odebug << "key pressed 2 is 0x" << ke->key() << "" << oendl;
1076 emitText("\\"); // expose 1076 emitText("\\"); // expose
1077 } else 1077 } else
1078 emit keyPressedSignal(ke); // expose 1078 emit keyPressedSignal(ke); // expose
1079 ke->accept(); 1079 ke->accept();
1080#ifdef FAKE_CTRL_AND_ALT 1080#ifdef FAKE_CTRL_AND_ALT
1081 if ( dele ) delete e; 1081 if ( dele ) delete e;
diff --git a/noncore/apps/opie-console/TEmulation.cpp b/noncore/apps/opie-console/TEmulation.cpp
index d0169d7..6ff73af 100644
--- a/noncore/apps/opie-console/TEmulation.cpp
+++ b/noncore/apps/opie-console/TEmulation.cpp
@@ -67,12 +67,18 @@
67 67
68/* FIXME 68/* FIXME
69 - evtl. the bulk operations could be made more transparent. 69 - evtl. the bulk operations could be made more transparent.
70*/ 70*/
71 71
72#include "TEmulation.h" 72#include "TEmulation.h"
73
74/* OPIE */
75#include <opie2/odebug.h>
76using namespace Opie::Core;
77
78/* STD */
73#include <stdio.h> 79#include <stdio.h>
74#include <stdlib.h> 80#include <stdlib.h>
75#include <unistd.h> 81#include <unistd.h>
76 82
77 83
78/* ------------------------------------------------------------------------- */ 84/* ------------------------------------------------------------------------- */
@@ -201,13 +207,13 @@ void TEmulation::onRcvChar(int c)
201 207
202/*! 208/*!
203*/ 209*/
204 210
205void TEmulation::onKeyPress( QKeyEvent* ev ) 211void TEmulation::onKeyPress( QKeyEvent* ev )
206{ 212{
207 qWarning("onKeyPress,...."); 213 owarn << "onKeyPress,...." << oendl;
208 if (!connected) return; // someone else gets the keys 214 if (!connected) return; // someone else gets the keys
209 if (scr->getHistCursor() != scr->getHistLines()); 215 if (scr->getHistCursor() != scr->getHistLines());
210 scr->setHistCursor(scr->getHistLines()); 216 scr->setHistCursor(scr->getHistLines());
211 if (!ev->text().isEmpty()) 217 if (!ev->text().isEmpty())
212 { // A block of text 218 { // A block of text
213 // Note that the text is proper unicode. 219 // Note that the text is proper unicode.
diff --git a/noncore/apps/opie-console/atconfigdialog.cpp b/noncore/apps/opie-console/atconfigdialog.cpp
index 8e91b9e..c998f96 100644
--- a/noncore/apps/opie-console/atconfigdialog.cpp
+++ b/noncore/apps/opie-console/atconfigdialog.cpp
@@ -1,19 +1,22 @@
1#include "atconfigdialog.h"
2#include "io_modem.h"
1 3
4/* OPIE */
5#include <opie2/odebug.h>
6using namespace Opie::Core;
7
8/* QT */
2#include <qlineedit.h> 9#include <qlineedit.h>
3#include <qspinbox.h> 10#include <qspinbox.h>
4#include <qlayout.h> 11#include <qlayout.h>
5#include <qcombobox.h> 12#include <qcombobox.h>
6#include <qtabwidget.h> 13#include <qtabwidget.h>
7#include <qlabel.h> 14#include <qlabel.h>
8#include <qscrollview.h> 15#include <qscrollview.h>
9 16
10#include "atconfigdialog.h"
11#include "io_modem.h"
12
13
14ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 17ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
15 : QDialog( parent, name, modal, fl ) { 18 : QDialog( parent, name, modal, fl ) {
16 19
17 20
18 setCaption( tr( "Dialing parameter setup" ) ); 21 setCaption( tr( "Dialing parameter setup" ) );
19 22
@@ -149,13 +152,13 @@ QWidget* ATConfigDialog::tab1( QWidget* parent ) {
149 return returnWidget; 152 return returnWidget;
150 153
151} 154}
152 155
153 156
154void ATConfigDialog::readConfig( const Profile& config ) { 157void ATConfigDialog::readConfig( const Profile& config ) {
155 qWarning("config in atconfigdialog"); 158 owarn << "config in atconfigdialog" << oendl;
156 159
157 initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); 160 initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) );
158 resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) ); 161 resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) );
159 dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) ); 162 dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) );
160 dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); 163 dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) );
161 dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) ); 164 dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) );
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp
index 67ad10e..7010594 100644
--- a/noncore/apps/opie-console/dialer.cpp
+++ b/noncore/apps/opie-console/dialer.cpp
@@ -1,23 +1,28 @@
1#include "dialer.h" 1#include "dialer.h"
2#include "io_modem.h"
3
4/* OPIE */
5#include <opie2/odebug.h>
6using namespace Opie::Core;
2 7
8/* QT */
3#include <qlayout.h> 9#include <qlayout.h>
4#include <qprogressbar.h> 10#include <qprogressbar.h>
5#include <qlabel.h> 11#include <qlabel.h>
6#include <qpushbutton.h> 12#include <qpushbutton.h>
7#include <qapp.h> 13#include <qapp.h>
8#include <qtimer.h> 14#include <qtimer.h>
9#include <qmessagebox.h> 15#include <qmessagebox.h>
10 16
17/* STD */
11#include <unistd.h> 18#include <unistd.h>
12#include <string.h> 19#include <string.h>
13#include <fcntl.h> 20#include <fcntl.h>
14#include <errno.h> 21#include <errno.h>
15 22
16#include "io_modem.h"
17
18// State machine: | When an error occurs, we don't have to 23// State machine: | When an error occurs, we don't have to
19// | reset everything. 24// | reset everything.
20// (init) <------+ | But if the user wants to reset, 25// (init) <------+ | But if the user wants to reset,
21// | | | we stop dialing immediately. 26// | | | we stop dialing immediately.
22// v | | 27// v | |
23// (options) ----+ | Following the state machine is necessary 28// (options) ----+ | Following the state machine is necessary
@@ -101,13 +106,13 @@ void Dialer::slotCancel()
101 accept(); 106 accept();
102 } 107 }
103} 108}
104 109
105void Dialer::reset() 110void Dialer::reset()
106{ 111{
107 qWarning("reset"); 112 owarn << "reset" << oendl;
108 switchState(state_cancel); 113 switchState(state_cancel);
109} 114}
110 115
111void Dialer::slotAutostart() 116void Dialer::slotAutostart()
112{ 117{
113 //state = state_preinit; 118 //state = state_preinit;
@@ -133,35 +138,35 @@ void Dialer::dial(const QString& number)
133 reject(); 138 reject();
134 } 139 }
135} 140}
136 141
137void Dialer::trydial(const QString& number) 142void Dialer::trydial(const QString& number)
138{ 143{
139 qWarning("TryDial:%s", number.latin1() ); 144 owarn << "TryDial:" << number.latin1() << "" << oendl;
140 if(state != state_cancel) switchState(state_preinit); 145 if(state != state_cancel) switchState(state_preinit);
141 if(cleanshutdown) 146 if(cleanshutdown)
142 { 147 {
143 qWarning("HangupString " + m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING)); 148 owarn << "HangupString " << m_profile.readEntry("HangupString") << oendl;
144 send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r"); 149 send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r");
145 } 150 }
146 151
147 if(state != state_cancel) 152 if(state != state_cancel)
148 { 153 {
149 switchState(state_init); 154 switchState(state_init);
150// qWarning("Init String " + m_profile.readEntry("InitString") ); 155// owarn << "Init String " + m_profile.readEntry("InitString") << oendl;
151 send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r"); 156 send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r");
152 QString response2 = receive(); 157 QString response2 = receive();
153 if(!response2.contains("\nOK\r")) 158 if(!response2.contains("\nOK\r"))
154 reset(); 159 reset();
155 } 160 }
156 161
157 /*if(state != state_cancel) 162 /*if(state != state_cancel)
158 { 163 {
159 switchState(state_options); 164 switchState(state_options);
160 165
161 qWarning("ATM3l3"); 166 owarn << "ATM3l3" << oendl;
162 send("ATM3L3\r"); 167 send("ATM3L3\r");
163 QString response3 = receive(); 168 QString response3 = receive();
164 if(!response3.contains("\nOK\r")) 169 if(!response3.contains("\nOK\r"))
165 reset(); 170 reset();
166 } 171 }
167*/ 172*/
@@ -175,13 +180,13 @@ void Dialer::trydial(const QString& number)
175 if(!response4.contains("\nOK\r")) 180 if(!response4.contains("\nOK\r"))
176 reset(); 181 reset();
177 } 182 }
178 183
179 if(state != state_cancel) 184 if(state != state_cancel)
180 { 185 {
181 qWarning("progress"); 186 owarn << "progress" << oendl;
182 switchState(state_dialing); 187 switchState(state_dialing);
183 188
184 // send(QString("ATDT %1\r").arg(number)); 189 // send(QString("ATDT %1\r").arg(number));
185 send(QString("%1 %2\r").arg(m_profile.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 )) 190 send(QString("%1 %2\r").arg(m_profile.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ))
186 .arg(number)); 191 .arg(number));
187 192
@@ -211,13 +216,13 @@ void Dialer::trydial(const QString& number)
211void Dialer::send(const QString& msg) 216void Dialer::send(const QString& msg)
212{ 217{
213 QString m = msg; 218 QString m = msg;
214 int bytes; 219 int bytes;
215 QString termination; 220 QString termination;
216 221
217 qWarning("Sending: %s", m.latin1()); 222 owarn << "Sending: " << m.latin1() << "" << oendl;
218 223
219 /*termination = "\r"; 224 /*termination = "\r";
220 //termination = m_profile.readEntry("Termination"); 225 //termination = m_profile.readEntry("Termination");
221 if(termination == "\n") m = m + "\n"; 226 if(termination == "\n") m = m + "\n";
222 else if(termination == "\r") m = m + "\r"; 227 else if(termination == "\r") m = m + "\r";
223 else m = m + "\r\n"; 228 else m = m + "\r\n";
@@ -244,17 +249,17 @@ QString Dialer::receive()
244 249
245 if(ret > 0) 250 if(ret > 0)
246 { 251 {
247 for(int i = 0; i < ret; i++) 252 for(int i = 0; i < ret; i++)
248 buffer[i] = buffer[i] & 0x7F; 253 buffer[i] = buffer[i] & 0x7F;
249 buffer[ret] = 0; 254 buffer[ret] = 0;
250 qWarning("Got: %s", buffer); 255 owarn << "Got: " << buffer << "" << oendl;
251 buf.append(QString(buffer)); 256 buf.append(QString(buffer));
252 if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) 257 if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY")))
253 { 258 {
254 //qWarning("Receiving: '%s'", buf.latin1()); 259 //owarn << "Receiving: '" << buf.latin1() << "'" << oendl;
255 cleanshutdown = 1; 260 cleanshutdown = 1;
256 return buf; 261 return buf;
257 }else if (buf.contains("NO CARRIER") || buf.contains("NO DIALTONE") ) { 262 }else if (buf.contains("NO CARRIER") || buf.contains("NO DIALTONE") ) {
258 cleanshutdown = 1; 263 cleanshutdown = 1;
259 return QString::null; 264 return QString::null;
260 } 265 }
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index 99d069f..89b70c6 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -1,13 +1,15 @@
1
2#include "TEmuVt102.h" 1#include "TEmuVt102.h"
3
4#include "profile.h" 2#include "profile.h"
5#include "emulation_handler.h" 3#include "emulation_handler.h"
6#include "script.h" 4#include "script.h"
7 5
6/* OPIE */
7#include <opie2/odebug.h>
8using namespace Opie::Core;
9
8EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) 10EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name )
9 : QObject(0, name ) 11 : QObject(0, name )
10{ 12{
11 m_teWid = new TEWidget( parent, "TerminalMain"); 13 m_teWid = new TEWidget( parent, "TerminalMain");
12 // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) 14 // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar)
13 // use setWrapAt(80) for normal console with scrollbar 15 // use setWrapAt(80) for normal console with scrollbar
@@ -125,17 +127,17 @@ QColor EmulationHandler::foreColor(int col) {
125 co = Qt::white; 127 co = Qt::white;
126 break; 128 break;
127 case Profile::Black: 129 case Profile::Black:
128 co = Qt::black; 130 co = Qt::black;
129 break; 131 break;
130 case Profile::Green: 132 case Profile::Green:
131 qWarning("Foreground green"); 133 owarn << "Foreground green" << oendl;
132 co = Qt::green; 134 co = Qt::green;
133 break; 135 break;
134 case Profile::Orange: 136 case Profile::Orange:
135 qWarning("Foreground orange"); 137 owarn << "Foreground orange" << oendl;
136 co.setRgb( 231, 184, 98 ); 138 co.setRgb( 231, 184, 98 );
137 break; 139 break;
138 } 140 }
139 141
140 return co; 142 return co;
141} 143}
@@ -149,17 +151,17 @@ QColor EmulationHandler::backColor(int col ) {
149 co = Qt::black; 151 co = Qt::black;
150 break; 152 break;
151 case Profile::Black: 153 case Profile::Black:
152 co = Qt::white; 154 co = Qt::white;
153 break; 155 break;
154 case Profile::Green: 156 case Profile::Green:
155 qWarning("Background black"); 157 owarn << "Background black" << oendl;
156 co = Qt::black; 158 co = Qt::black;
157 break; 159 break;
158 case Profile::Orange: 160 case Profile::Orange:
159 qWarning("Background black"); 161 owarn << "Background black" << oendl;
160 co = Qt::black; 162 co = Qt::black;
161 break; 163 break;
162 } 164 }
163 165
164 return co; 166 return co;
165} 167}
diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp
index ad8ecba..4688551 100644
--- a/noncore/apps/opie-console/emulation_widget.cpp
+++ b/noncore/apps/opie-console/emulation_widget.cpp
@@ -221,15 +221,15 @@ void EmulationWidget::paintEvent( QPaintEvent* pe )
221} 221}
222 222
223void EmulationWidget::calcGeometry() 223void EmulationWidget::calcGeometry()
224{ 224{
225 m_scrollbar->resize(QApplication::style().scrollBarExtent().width(), contentsRect().height() ); 225 m_scrollbar->resize(QApplication::style().scrollBarExtent().width(), contentsRect().height() );
226 226
227 qDebug( QString(" TEST").arg( contentsRect().width() ) ); 227 odebug << QString(" TEST").arg( contentsRect().width() ) << oendl;
228 qDebug( QString(" TEST").arg( contentsRect().height() ) ); 228 odebug << QString(" TEST").arg( contentsRect().height() ) << oendl;
229 qDebug("NEUER TESTT!!!!!!!!"); 229 odebug << "NEUER TESTT!!!!!!!!" << oendl;
230 230
231 switch( scrollLoc ) 231 switch( scrollLoc )
232 { 232 {
233 case SCRNONE : 233 case SCRNONE :
234 m_columns = ( contentsRect().width() -2 * rimX ) / f_width; 234 m_columns = ( contentsRect().width() -2 * rimX ) / f_width;
235 m_blX = ( contentsRect().width() - ( m_columns*f_width ) ) / 2; 235 m_blX = ( contentsRect().width() - ( m_columns*f_width ) ) / 2;
@@ -255,13 +255,13 @@ void EmulationWidget::calcGeometry()
255 m_lines = ( contentsRect().height() - 2 * rimY ) / f_height; 255 m_lines = ( contentsRect().height() - 2 * rimY ) / f_height;
256 m_bY = ( contentsRect().height() - (m_lines * f_height ) ) / 2; 256 m_bY = ( contentsRect().height() - (m_lines * f_height ) ) / 2;
257} 257}
258 258
259void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect rect, Character attr, bool usePixmap, bool clear ) 259void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect rect, Character attr, bool usePixmap, bool clear )
260{ 260{
261 qWarning("Color1 %s", color_table[attr.b].color.name().latin1() ); 261 owarn << "Color1 " << color_table[attr.b].color.name().latin1() << "" << oendl;
262 if ( usePixmap && color_table[attr.b].transparent ) 262 if ( usePixmap && color_table[attr.b].transparent )
263 { 263 {
264 painter.setBackgroundMode( TransparentMode ); 264 painter.setBackgroundMode( TransparentMode );
265 if ( clear ) 265 if ( clear )
266 erase( rect ); 266 erase( rect );
267 } 267 }
@@ -269,13 +269,13 @@ void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect
269 { 269 {
270 if ( blinking ) 270 if ( blinking )
271 painter.fillRect( rect, color_table[attr.b].color ); 271 painter.fillRect( rect, color_table[attr.b].color );
272 else 272 else
273 { 273 {
274 painter.setBackgroundMode( OpaqueMode ); 274 painter.setBackgroundMode( OpaqueMode );
275 qWarning("Color %s", color_table[attr.b].color.name().latin1() ); 275 owarn << "Color " << color_table[attr.b].color.name().latin1() << "" << oendl;
276 painter.setBackgroundColor( color_table[attr.b].color ); 276 painter.setBackgroundColor( color_table[attr.b].color );
277 } 277 }
278 } 278 }
279 if ( color_table[attr.f].bold ) 279 if ( color_table[attr.f].bold )
280 painter.setPen( QColor( 0x8F, 0x00, 0x00 ) ); 280 painter.setPen( QColor( 0x8F, 0x00, 0x00 ) );
281 else 281 else
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp
index eb32551..6613183 100644
--- a/noncore/apps/opie-console/function_keyboard.cpp
+++ b/noncore/apps/opie-console/function_keyboard.cpp
@@ -1,8 +1,13 @@
1#include "function_keyboard.h" 1#include "function_keyboard.h"
2 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */
3#include <qlayout.h> 8#include <qlayout.h>
4#include <qlistbox.h> 9#include <qlistbox.h>
5#include <qlabel.h> 10#include <qlabel.h>
6#include <qdir.h> 11#include <qdir.h>
7 12
8#define DEFAULT_ROWS 2 13#define DEFAULT_ROWS 2
@@ -34,13 +39,13 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) :
34 keys.insert( 39 keys.insert(
35 40
36 handle, 41 handle,
37 FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort()) 42 FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort())
38 ); 43 );
39 } 44 }
40 //qWarning("loaded %d keys", keys.count()); 45 //owarn << "loaded " << keys.count() << " keys" << oendl;
41 */ 46 */
42 if (keys.isEmpty()) loadDefaults(); 47 if (keys.isEmpty()) loadDefaults();
43 48
44 49
45 50
46} 51}
@@ -253,13 +258,13 @@ void FunctionKeyboard::loadDefaults() {
253/* FunctionKeyboardConfig {{{1 */ 258/* FunctionKeyboardConfig {{{1 */
254 259
255FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) 260FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na )
256 : ProfileDialogKeyWidget(name, parent, na), 261 : ProfileDialogKeyWidget(name, parent, na),
257 selectedRow(0), selectedCol(0) 262 selectedRow(0), selectedCol(0)
258{ 263{
259 qWarning("FunctionKeyboardConfig"); 264 owarn << "FunctionKeyboardConfig" << oendl;
260 265
261 266
262 kb = new FunctionKeyboard(this); 267 kb = new FunctionKeyboard(this);
263 connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), 268 connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)),
264 this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool))); 269 this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool)));
265 270
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index a29fa8e..c102427 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -1,10 +1,13 @@
1 1
2#include "io_bt.h" 2#include "io_bt.h"
3 3
4/* OPIE */
5#include <opie2/odebug.h>
4using namespace Opie::Core; 6using namespace Opie::Core;
7
5IOBt::IOBt( const Profile &config ) : IOSerial( config ) { 8IOBt::IOBt( const Profile &config ) : IOSerial( config ) {
6 m_attach = 0; 9 m_attach = 0;
7} 10}
8 11
9 12
10IOBt::~IOBt() { 13IOBt::~IOBt() {
@@ -40,13 +43,13 @@ bool IOBt::open() {
40 connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), 43 connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ),
41 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 44 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
42 45
43 if ( m_attach->start() ) { 46 if ( m_attach->start() ) {
44 ret = IOSerial::open(); 47 ret = IOSerial::open();
45 } else { 48 } else {
46 qWarning("could not attach to device"); 49 owarn << "could not attach to device" << oendl;
47 delete m_attach; 50 delete m_attach;
48 m_attach = 0; 51 m_attach = 0;
49 } 52 }
50 } else { 53 } else {
51 // directly to the normal serial 54 // directly to the normal serial
52 // TODO: look first if the connection really exists. ( is set up ) 55 // TODO: look first if the connection really exists. ( is set up )
@@ -86,8 +89,8 @@ QBitArray IOBt::supports() const {
86 89
87bool IOBt::isConnected() { 90bool IOBt::isConnected() {
88 return false; 91 return false;
89} 92}
90 93
91void IOBt::send(const QByteArray &data) { 94void IOBt::send(const QByteArray &data) {
92 qDebug( "Please overload me..." ); 95 odebug << "Please overload me..." << oendl;
93} 96}
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp
index 07c2b62..38542f5 100644
--- a/noncore/apps/opie-console/io_irda.cpp
+++ b/noncore/apps/opie-console/io_irda.cpp
@@ -1,10 +1,12 @@
1
2#include "io_irda.h" 1#include "io_irda.h"
3 2
3/* OPIE */
4#include <opie2/odebug.h>
4using namespace Opie::Core; 5using namespace Opie::Core;
6
5IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { 7IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) {
6 m_attach = 0; 8 m_attach = 0;
7} 9}
8 10
9 11
10IOIrda::~IOIrda() { 12IOIrda::~IOIrda() {
@@ -32,13 +34,13 @@ bool IOIrda::open() {
32 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 34 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
33 35
34 if ( m_attach->start() ) { 36 if ( m_attach->start() ) {
35 ret= IOSerial::open(); 37 ret= IOSerial::open();
36 } else { 38 } else {
37 // emit error!!! 39 // emit error!!!
38 qWarning("could not attach to device"); 40 owarn << "could not attach to device" << oendl;
39 delete m_attach; 41 delete m_attach;
40 m_attach = 0l; 42 m_attach = 0l;
41 } 43 }
42 return ret; 44 return ret;
43} 45}
44 46
@@ -71,8 +73,8 @@ QBitArray IOIrda::supports()const {
71 73
72bool IOIrda::isConnected() { 74bool IOIrda::isConnected() {
73 return false; 75 return false;
74} 76}
75 77
76void IOIrda::send(const QByteArray &data) { 78void IOIrda::send(const QByteArray &data) {
77 qDebug( "Please overload me..." ); 79 odebug << "Please overload me..." << oendl;
78} 80}
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp
index b74d076..c499dfe 100644
--- a/noncore/apps/opie-console/io_modem.cpp
+++ b/noncore/apps/opie-console/io_modem.cpp
@@ -1,21 +1,21 @@
1 1
2#include "io_modem.h" 2#include "io_modem.h"
3
4#include "dialer.h" 3#include "dialer.h"
5 4
5/* OPIE */
6#include <opie2/odebug.h>
6using namespace Opie::Core; 7using namespace Opie::Core;
7using namespace Opie::Core; 8
8IOModem::IOModem( const Profile &profile ) 9IOModem::IOModem( const Profile &profile )
9 : IOSerial( profile ) { 10 : IOSerial( profile ) {
10 m_profile = profile; 11 m_profile = profile;
11} 12}
12 13
13 14
14IOModem::~IOModem() { 15IOModem::~IOModem() {
15
16} 16}
17 17
18 18
19void IOModem::close() { 19void IOModem::close() {
20 // Hangup, discarding result 20 // Hangup, discarding result
21 //int fd = rawIO(); 21 //int fd = rawIO();
@@ -101,8 +101,8 @@ QBitArray IOModem::supports()const {
101 101
102bool IOModem::isConnected() { 102bool IOModem::isConnected() {
103 return false; 103 return false;
104} 104}
105 105
106void IOModem::send(const QByteArray &data) { 106void IOModem::send(const QByteArray &data) {
107 qDebug( "Please overload me..." ); 107 odebug << "Please overload me..." << oendl;
108} 108}
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp
index dfb2f83..1bd4338 100644
--- a/noncore/apps/opie-console/main.cpp
+++ b/noncore/apps/opie-console/main.cpp
@@ -88,13 +88,13 @@ void FixIt::fixIt() {
88 88
89int main(int argc, char **argv) { 89int main(int argc, char **argv) {
90// too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole"; 90// too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole";
91 QPEApplication app( argc, argv ); 91 QPEApplication app( argc, argv );
92 92
93#ifdef FSCKED_DISTRIBUTION 93#ifdef FSCKED_DISTRIBUTION
94 qWarning("fscked"); 94 owarn << "fscked" << oendl;
95 FixIt it; 95 FixIt it;
96 it.fixIt(); 96 it.fixIt();
97#endif 97#endif
98 98
99 MainWindow mw; 99 MainWindow mw;
100 mw.setCaption(QObject::tr("Opie Console") ); 100 mw.setCaption(QObject::tr("Opie Console") );
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 06a8f7d..b403b4d 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -1,33 +1,36 @@
1#include <assert.h>
2
3#include <qaction.h>
4#include <qmenubar.h>
5#include <qtoolbar.h>
6#include <qmessagebox.h>
7#include <qwhatsthis.h>
8#include <qfileinfo.h>
9
10#include <qpe/filemanager.h>
11
12#include <opie2/ofiledialog.h>
13
14#include "TEmulation.h" 1#include "TEmulation.h"
15#include "profileeditordialog.h" 2#include "profileeditordialog.h"
16#include "configdialog.h" 3#include "configdialog.h"
17#include "default.h" 4#include "default.h"
18#include "profilemanager.h" 5#include "profilemanager.h"
19#include "mainwindow.h" 6#include "mainwindow.h"
20#include "tabwidget.h" 7#include "tabwidget.h"
21#include "transferdialog.h" 8#include "transferdialog.h"
22#include "function_keyboard.h" 9#include "function_keyboard.h"
23#include "emulation_handler.h" 10#include "emulation_handler.h"
24#include "script.h" 11#include "script.h"
25 12
26 13/* OPIE */
14#include <opie2/odebug.h>
15#include <opie2/ofiledialog.h>
16#include <qpe/filemanager.h>
17using namespace Opie::Core;
27using namespace Opie::Ui; 18using namespace Opie::Ui;
19
20/* QT */
21#include <qaction.h>
22#include <qmenubar.h>
23#include <qtoolbar.h>
24#include <qmessagebox.h>
25#include <qwhatsthis.h>
26#include <qfileinfo.h>
27
28/* STD */
29#include <assert.h>
30
28MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { 31MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) {
29 KeyTrans::loadAll(); 32 KeyTrans::loadAll();
30 for (int i = 0; i < KeyTrans::count(); i++ ) { 33 for (int i = 0; i < KeyTrans::count(); i++ ) {
31 KeyTrans* s = KeyTrans::find(i ); 34 KeyTrans* s = KeyTrans::find(i );
32 assert( s ); 35 assert( s );
33 } 36 }
@@ -443,19 +446,19 @@ void MainWindow::slotConfigure() {
443 */ 446 */
444void MainWindow::slotClose() { 447void MainWindow::slotClose() {
445 if (!currentSession() ) 448 if (!currentSession() )
446 return; 449 return;
447 450
448 Session* ses = currentSession(); 451 Session* ses = currentSession();
449 qWarning("removing! currentSession %s", currentSession()->name().latin1() ); 452 owarn << "removing! currentSession " << currentSession()->name().latin1() << "" << oendl;
450 /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ 453 /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */
451 m_curSession = NULL; 454 m_curSession = NULL;
452 tabWidget()->remove( /*currentSession()*/ses ); 455 tabWidget()->remove( /*currentSession()*/ses );
453 /*it's autodelete */ 456 /*it's autodelete */
454 m_sessions.remove( ses ); 457 m_sessions.remove( ses );
455 qWarning("after remove!!"); 458 owarn << "after remove!!" << oendl;
456 459
457 if (!currentSession() ) { 460 if (!currentSession() ) {
458 m_connect->setEnabled( false ); 461 m_connect->setEnabled( false );
459 m_disconnect->setEnabled( false ); 462 m_disconnect->setEnabled( false );
460 m_terminate->setEnabled( false ); 463 m_terminate->setEnabled( false );
461 m_transfer->setEnabled( false ); 464 m_transfer->setEnabled( false );
@@ -567,22 +570,22 @@ void MainWindow::slotOpenButtons( bool state ) {
567 } 570 }
568} 571}
569 572
570 573
571 574
572void MainWindow::slotSessionChanged( Session* ses ) { 575void MainWindow::slotSessionChanged( Session* ses ) {
573 qWarning("changed!"); 576 owarn << "changed!" << oendl;
574 577
575 if(m_curSession) 578 if(m_curSession)
576 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); 579 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide();
577 if(ses) 580 if(ses)
578 if(ses->transferDialog()) ses->transferDialog()->show(); 581 if(ses->transferDialog()) ses->transferDialog()->show();
579 582
580 if ( ses ) { 583 if ( ses ) {
581 m_curSession = ses; 584 m_curSession = ses;
582 qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); 585 odebug << QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) << oendl;
583 if ( m_curSession->layer()->isConnected() ) { 586 if ( m_curSession->layer()->isConnected() ) {
584 m_connect->setEnabled( false ); 587 m_connect->setEnabled( false );
585 m_disconnect->setEnabled( true ); 588 m_disconnect->setEnabled( true );
586 m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); 589 m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording());
587 m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); 590 m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording());
588 m_scripts->setItemEnabled(m_runScript_id, true); 591 m_scripts->setItemEnabled(m_runScript_id, true);
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp
index 3466e3a..9fdaf73 100644
--- a/noncore/apps/opie-console/modemconfigwidget.cpp
+++ b/noncore/apps/opie-console/modemconfigwidget.cpp
@@ -1,18 +1,21 @@
1#include "modemconfigwidget.h"
2#include "dialdialog.h"
1 3
4/* OPIE */
5#include <opie2/odebug.h>
2#include <qpe/qpeapplication.h> 6#include <qpe/qpeapplication.h>
7using namespace Opie::Core;
3 8
9/* QT */
4#include <qlabel.h> 10#include <qlabel.h>
5#include <qlayout.h> 11#include <qlayout.h>
6#include <qcombobox.h> 12#include <qcombobox.h>
7#include <qpushbutton.h> 13#include <qpushbutton.h>
8#include <qhbox.h> 14#include <qhbox.h>
9 15
10#include "modemconfigwidget.h"
11#include "dialdialog.h"
12
13namespace { 16namespace {
14 void setCurrent( const QString& str, QComboBox* bo ) { 17 void setCurrent( const QString& str, QComboBox* bo ) {
15 uint b = bo->count(); 18 uint b = bo->count();
16 for (int i = 0; i < bo->count(); i++ ) { 19 for (int i = 0; i < bo->count(); i++ ) {
17 if ( bo->text(i) == str ) { 20 if ( bo->text(i) == str ) {
18 bo->setCurrentItem( i ); 21 bo->setCurrentItem( i );
@@ -132,13 +135,13 @@ void ModemConfigWidget::load( const Profile& prof ) {
132 m_base->setStop( IOLayerBase::Stop_One ); 135 m_base->setStop( IOLayerBase::Stop_One );
133 } 136 }
134 137
135 138
136 atConf->readConfig( prof ); 139 atConf->readConfig( prof );
137 if ( prof.readEntry( "Device" ).isEmpty() ) { 140 if ( prof.readEntry( "Device" ).isEmpty() ) {
138 qWarning("device empty!"); 141 owarn << "device empty!" << oendl;
139 return; 142 return;
140 } 143 }
141 setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); 144 setCurrent( prof.readEntry( "Device" ), m_deviceCmb );
142 145
143 146
144} 147}
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro
index 7a15828..f7e33e9 100644
--- a/noncore/apps/opie-console/opie-console.pro
+++ b/noncore/apps/opie-console/opie-console.pro
@@ -1,10 +1,8 @@
1TEMPLATE = app 1TEMPLATE = app
2TMAKE_CXXFLAGS += -DHAVE_OPENPTY
3CONFIG += qt warn_on 2CONFIG += qt warn_on
4#CONFIG = qt
5DESTDIR = $(OPIEDIR)/bin 3DESTDIR = $(OPIEDIR)/bin
6HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ 4HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \
7 file_layer.h filetransfer.h \ 5 file_layer.h filetransfer.h \
8 metafactory.h \ 6 metafactory.h \
9 session.h \ 7 session.h \
10 mainwindow.h \ 8 mainwindow.h \
@@ -67,10 +65,10 @@ SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \
67INTERFACES = configurebase.ui editbase.ui 65INTERFACES = configurebase.ui editbase.ui
68INCLUDEPATH += $(OPIEDIR)/include 66INCLUDEPATH += $(OPIEDIR)/include
69DEPENDPATH += $(OPIEDIR)/include 67DEPENDPATH += $(OPIEDIR)/include
70LIBS += -lqpe -lopiecore2 -lopieui2 -lutil 68LIBS += -lqpe -lopiecore2 -lopieui2 -lutil
71TARGET = opie-console 69TARGET = opie-console
72 70
73 71DEFINES += HAVE_OPENPTY
74 72
75 73
76include ( $(OPIEDIR)/include.pro ) 74include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp
index fbc5306..f505998 100644
--- a/noncore/apps/opie-console/sz_transfer.cpp
+++ b/noncore/apps/opie-console/sz_transfer.cpp
@@ -38,13 +38,13 @@ void SzTransfer::sendFile(const QString& file) {
38 proc->start(OProcess::NotifyOnExit, OProcess::All); 38 proc->start(OProcess::NotifyOnExit, OProcess::All);
39 39
40} 40}
41 41
42void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { 42void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) {
43 43
44 qWarning("recieved from sz on stdout %d bytes", buflen); 44 owarn << "recieved from sz on stdout " << buflen << " bytes" << oendl;
45 45
46 QByteArray data(buflen); 46 QByteArray data(buflen);
47 data.fill(*buffer, buflen); 47 data.fill(*buffer, buflen);
48 for (uint i = 0; i < data.count(); i++ ) { 48 for (uint i = 0; i < data.count(); i++ ) {
49 printf("%c", buffer[i] ); 49 printf("%c", buffer[i] );
50 } 50 }
@@ -62,22 +62,22 @@ void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) {
62 // printf("%c", buffer[i]); 62 // printf("%c", buffer[i]);
63 //printf("\n"); 63 //printf("\n");
64} 64}
65 65
66void SzTransfer::receivedStdin(const QByteArray &data) { 66void SzTransfer::receivedStdin(const QByteArray &data) {
67 67
68 qWarning("recieved from io_serial %d bytes", data.size()); 68 owarn << "recieved from io_serial " << data.size() << " bytes" << oendl;
69 69
70 // recieved data from the io layer goes to sz 70 // recieved data from the io layer goes to sz
71 proc->writeStdin(data.data(), data.size()); 71 proc->writeStdin(data.data(), data.size());
72 72
73} 73}
74 74
75void SzTransfer::sent() { 75void SzTransfer::sent() {
76 76
77 qWarning("sent file"); 77 owarn << "sent file" << oendl;
78 78
79 //setcbreak(0); /* default */ 79 //setcbreak(0); /* default */
80 80
81 81
82 delete proc; 82 delete proc;
83 disconnect(layer(), SIGNAL(received(const QByteArray&)), 83 disconnect(layer(), SIGNAL(received(const QByteArray&)),
diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp
index 6429e3c..41a91ed 100644
--- a/noncore/apps/opie-console/tabwidget.cpp
+++ b/noncore/apps/opie-console/tabwidget.cpp
@@ -1,21 +1,24 @@
1
2#include "tabwidget.h" 1#include "tabwidget.h"
3 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
4using namespace Opie::Ui; 6using namespace Opie::Ui;
7
5TabWidget::TabWidget( QWidget* parent, const char* name ) 8TabWidget::TabWidget( QWidget* parent, const char* name )
6 : OTabWidget( parent, name ) { 9 : OTabWidget( parent, name ) {
7 connect(this, SIGNAL( currentChanged(QWidget*) ), 10 connect(this, SIGNAL( currentChanged(QWidget*) ),
8 this, SLOT( slotCurChanged(QWidget*) ) ); 11 this, SLOT( slotCurChanged(QWidget*) ) );
9} 12}
10 13
11TabWidget::~TabWidget() { 14TabWidget::~TabWidget() {
12} 15}
13 16
14void TabWidget::add( Session* ses ) { 17void TabWidget::add( Session* ses ) {
15 qWarning("session ses " + ses->name() ); 18 owarn << "session ses " + ses->name() << oendl;
16 if ( !ses->widgetStack() ) return; 19 if ( !ses->widgetStack() ) return;
17 //reparent( ses->widgetStack(), QPoint() ); 20 //reparent( ses->widgetStack(), QPoint() );
18 addTab( ses->widgetStack(), "console/konsole", ses->name() ); 21 addTab( ses->widgetStack(), "console/konsole", ses->name() );
19 //addTab( ses->widgetStack(), ses->name() ); 22 //addTab( ses->widgetStack(), ses->name() );
20 m_map.insert( ses->widgetStack(), ses ); 23 m_map.insert( ses->widgetStack(), ses );
21} 24}
diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp
index 6870487..087476b 100644
--- a/noncore/apps/opie-console/terminalwidget.cpp
+++ b/noncore/apps/opie-console/terminalwidget.cpp
@@ -1,16 +1,21 @@
1#include "terminalwidget.h"
2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */
1#include <qlabel.h> 8#include <qlabel.h>
2#include <qcheckbox.h> 9#include <qcheckbox.h>
3#include <qcombobox.h> 10#include <qcombobox.h>
4#include <qradiobutton.h> 11#include <qradiobutton.h>
5#include <qhgroupbox.h> 12#include <qhgroupbox.h>
6#include <qhbuttongroup.h> 13#include <qhbuttongroup.h>
7#include <qlayout.h> 14#include <qlayout.h>
8 15
9#include "terminalwidget.h"
10
11namespace { 16namespace {
12 enum TermIds { 17 enum TermIds {
13 id_term_vt100 = 0, 18 id_term_vt100 = 0,
14 id_term_vt102, 19 id_term_vt102,
15 id_term_linux, 20 id_term_linux,
16 id_term_xterm 21 id_term_xterm
@@ -66,13 +71,13 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent,
66 71
67 m_lroot->add( m_groupConv ); 72 m_lroot->add( m_groupConv );
68 m_lroot->add( m_groupOptions ); 73 m_lroot->add( m_groupOptions );
69 m_lroot->addStretch( 0 ); 74 m_lroot->addStretch( 0 );
70 75
71 // Fill in some options 76 // Fill in some options
72 qWarning("Options for terminal box"); 77 owarn << "Options for terminal box" << oendl;
73 m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); 78 m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ );
74 m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); 79 m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */);
75 m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); 80 m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux );
76 m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); 81 m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm );
77 //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); 82 //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi );
78 83
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp
index df27055..45fd11d 100644
--- a/noncore/apps/opie-console/test/senderui.cpp
+++ b/noncore/apps/opie-console/test/senderui.cpp
@@ -23,21 +23,21 @@ SenderUI::SenderUI()
23 /* we do that manually */ 23 /* we do that manually */
24 Profile prof; 24 Profile prof;
25 QString str = "/dev/bty0"; 25 QString str = "/dev/bty0";
26 prof.writeEntry("Device",str ); 26 prof.writeEntry("Device",str );
27 prof.writeEntry("Baud", 19200 ); 27 prof.writeEntry("Baud", 19200 );
28 28
29 qWarning("prof " + prof.readEntry("Device") + " " + str); 29 owarn << "prof " + prof.readEntry("Device") + " " + str << oendl;
30 ser = new IOSerial(prof); 30 ser = new IOSerial(prof);
31 connect(ser, SIGNAL(received(const QByteArray&) ), 31 connect(ser, SIGNAL(received(const QByteArray&) ),
32 this, SLOT(got(const QByteArray&) ) ); 32 this, SLOT(got(const QByteArray&) ) );
33 33
34 if ( ser->open() ) 34 if ( ser->open() )
35 qWarning("opened!!!"); 35 owarn << "opened!!!" << oendl;
36 else 36 else
37 qWarning("could not open"); 37 owarn << "could not open" << oendl;
38 38
39 39
40} 40}
41SenderUI::~SenderUI() { 41SenderUI::~SenderUI() {
42 42
43} 43}
@@ -49,31 +49,31 @@ void SenderUI::slotSendFile() {
49 connect (sz, SIGNAL(sent()), 49 connect (sz, SIGNAL(sent()),
50 this, SLOT(fileTransComplete())); 50 this, SLOT(fileTransComplete()));
51} 51}
52 52
53void SenderUI::slotSend() { 53void SenderUI::slotSend() {
54 QCString str = MultiLineEdit1->text().utf8(); 54 QCString str = MultiLineEdit1->text().utf8();
55 qWarning("sending: %s", str.data() ); 55 owarn << "sending: " << str.data() << "" << oendl;
56 str = str.replace( QRegExp("\n"), "\r"); 56 str = str.replace( QRegExp("\n"), "\r");
57 ser->send( str ); 57 ser->send( str );
58} 58}
59void SenderUI::got(const QByteArray& ar) { 59void SenderUI::got(const QByteArray& ar) {
60 qWarning("got:"); 60 owarn << "got:" << oendl;
61 for ( uint i = 0; i < ar.count(); i++ ) { 61 for ( uint i = 0; i < ar.count(); i++ ) {
62 printf("%c", ar[i] ); 62 printf("%c", ar[i] );
63 } 63 }
64 printf("\n"); 64 printf("\n");
65} 65}
66 66
67void SenderUI::fileTransComplete() { 67void SenderUI::fileTransComplete() {
68 68
69 qWarning("file transfer complete"); 69 owarn << "file transfer complete" << oendl;
70} 70}
71void SenderUI::send() { 71void SenderUI::send() {
72 72
73} 73}
74void SenderUI::slotRev(){ 74void SenderUI::slotRev(){
75qWarning("Going to receive!"); 75owarn << "Going to receive!" << oendl;
76FileReceive *rev = new FileReceive( FileReceive::SZ, ser ); 76FileReceive *rev = new FileReceive( FileReceive::SZ, ser );
77rev->receive(); 77rev->receive();
78 78
79} 79}
diff --git a/noncore/apps/opie-console/widget.cpp b/noncore/apps/opie-console/widget.cpp
index e17dfd4..c51983f 100644
--- a/noncore/apps/opie-console/widget.cpp
+++ b/noncore/apps/opie-console/widget.cpp
@@ -992,13 +992,13 @@ bool Widget::eventFilter( QObject *obj, QEvent *e )
992 QApplication::sendEvent(scrollbar, e); 992 QApplication::sendEvent(scrollbar, e);
993 } 993 }
994 994
995#ifdef FAKE_CTRL_AND_ALT 995#ifdef FAKE_CTRL_AND_ALT
996 static bool control = FALSE; 996 static bool control = FALSE;
997 static bool alt = FALSE; 997 static bool alt = FALSE;
998// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); 998// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl;
999 bool dele=FALSE; 999 bool dele=FALSE;
1000 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { 1000 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
1001 QKeyEvent* ke = (QKeyEvent*)e; 1001 QKeyEvent* ke = (QKeyEvent*)e;
1002 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); 1002 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat();
1003 switch (ke->key()) { 1003 switch (ke->key()) {
1004 case Key_F9: // let this be "Control" 1004 case Key_F9: // let this be "Control"
@@ -1031,17 +1031,17 @@ bool Widget::eventFilter( QObject *obj, QEvent *e )
1031 1031
1032 if ( e->type() == QEvent::KeyPress ) { 1032 if ( e->type() == QEvent::KeyPress ) {
1033 QKeyEvent* ke = (QKeyEvent*)e; 1033 QKeyEvent* ke = (QKeyEvent*)e;
1034 actSel=0; // Key stroke implies a screen update, so Widget won't 1034 actSel=0; // Key stroke implies a screen update, so Widget won't
1035 // know where the current selection is. 1035 // know where the current selection is.
1036 1036
1037// qDebug("key pressed is 0x%x",ke->key()); 1037// odebug << "key pressed is 0x" << ke->key() << "" << oendl;
1038 1038
1039 if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker 1039 if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker
1040 1040
1041// qDebug("key pressed 2 is 0x%x",ke->key()); 1041// odebug << "key pressed 2 is 0x" << ke->key() << "" << oendl;
1042 emitText("\\"); // expose 1042 emitText("\\"); // expose
1043 } else 1043 } else
1044 emit keyPressedSignal(ke); // expose 1044 emit keyPressedSignal(ke); // expose
1045 ke->accept(); 1045 ke->accept();
1046#ifdef FAKE_CTRL_AND_ALT 1046#ifdef FAKE_CTRL_AND_ALT
1047 if ( dele ) delete e; 1047 if ( dele ) delete e;
diff --git a/noncore/apps/opie-console/widget_layer.cpp b/noncore/apps/opie-console/widget_layer.cpp
index 96dda1c..ab25919 100644
--- a/noncore/apps/opie-console/widget_layer.cpp
+++ b/noncore/apps/opie-console/widget_layer.cpp
@@ -72,13 +72,13 @@ bool WidgetLayer::eventFilter( QObject *obj, QEvent *e )
72 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) 72 if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ )
73 return false; // not us 73 return false; // not us
74 74
75#ifdef FAKE_CTRL_AND_ALT 75#ifdef FAKE_CTRL_AND_ALT
76 static bool control = false; 76 static bool control = false;
77 static bool alt = false; 77 static bool alt = false;
78// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); 78// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl;
79 bool dele = false; 79 bool dele = false;
80 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { 80 if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) {
81 QKeyEvent* ke = (QKeyEvent*)e; 81 QKeyEvent* ke = (QKeyEvent*)e;
82 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); 82 bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat();
83 switch (ke->key()) { 83 switch (ke->key()) {
84 case Key_F9: // let this be "Control" 84 case Key_F9: // let this be "Control"
@@ -112,13 +112,13 @@ QChar(a,0));
112 112
113 if ( e->type() == QEvent::KeyPress ) { 113 if ( e->type() == QEvent::KeyPress ) {
114 QKeyEvent* ke = (QKeyEvent*)e; 114 QKeyEvent* ke = (QKeyEvent*)e;
115 //actSel=0; // Key stroke implies a screen update, so Widget won't 115 //actSel=0; // Key stroke implies a screen update, so Widget won't
116 // know where the current selection is. 116 // know where the current selection is.
117 117
118// qDebug("key pressed is 0x%x",ke->key()); 118// odebug << "key pressed is 0x" << ke->key() << "" << oendl;
119 119
120 if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker 120 if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker
121 insertText("\\"); // expose 121 insertText("\\"); // expose
122 } else 122 } else
123 emit keyPressed( ke ); // expose 123 emit keyPressed( ke ); // expose
124 ke->accept(); 124 ke->accept();
diff --git a/noncore/apps/opie-write/mainwindow.cpp b/noncore/apps/opie-write/mainwindow.cpp
index 90e1a70..aa03060 100644
--- a/noncore/apps/opie-write/mainwindow.cpp
+++ b/noncore/apps/opie-write/mainwindow.cpp
@@ -17,18 +17,22 @@
17** Contact info@trolltech.com if any conditions of this licensing are 17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you. 18** not clear to you.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#include "mainwindow.h" 22#include "mainwindow.h"
23
24/* OPIE */
25#include <opie2/odebug.h>
23#include <qpe/fileselector.h> 26#include <qpe/fileselector.h>
24#include <qpe/applnk.h> 27#include <qpe/applnk.h>
25#include <qpe/resource.h> 28#include <qpe/resource.h>
26#include <qpe/fontdatabase.h> 29#include <qpe/fontdatabase.h>
30using namespace Opie::Core;
27 31
28//#include "qspellchecker.h" 32/* QT */
29#include "qtextedit.h" 33#include "qtextedit.h"
30#include <qaction.h> 34#include <qaction.h>
31#include <qtoolbar.h> 35#include <qtoolbar.h>
32#include <qtoolbutton.h> 36#include <qtoolbutton.h>
33#include <qtabwidget.h> 37#include <qtabwidget.h>
34#include <qapplication.h> 38#include <qapplication.h>
@@ -441,25 +445,25 @@ void MainWindow::fileOpen()
441 clear(); 445 clear();
442 updateCaption(); 446 updateCaption();
443} 447}
444 448
445void MainWindow::fileRevert() 449void MainWindow::fileRevert()
446{ 450{
447 qDebug( "QMainWindow::fileRevert needs to be done" ); 451 odebug << "QMainWindow::fileRevert needs to be done" << oendl;
448} 452}
449 453
450void MainWindow::fileNew() 454void MainWindow::fileNew()
451{ 455{
452 editor->setTextFormat( Qt::RichText ); 456 editor->setTextFormat( Qt::RichText );
453 save(); 457 save();
454 newFile(DocLnk()); 458 newFile(DocLnk());
455} 459}
456 460
457void MainWindow::insertTable() 461void MainWindow::insertTable()
458{ 462{
459 qDebug( "MainWindow::insertTable() needs to be done" ); 463 odebug << "MainWindow::insertTable() needs to be done" << oendl;
460} 464}
461 465
462void MainWindow::newFile( const DocLnk &dl ) 466void MainWindow::newFile( const DocLnk &dl )
463{ 467{
464 DocLnk nf = dl; 468 DocLnk nf = dl;
465 nf.setType( "text/html" ); 469 nf.setType( "text/html" );
@@ -472,13 +476,13 @@ void MainWindow::newFile( const DocLnk &dl )
472 476
473void MainWindow::openFile( const DocLnk &dl ) 477void MainWindow::openFile( const DocLnk &dl )
474{ 478{
475 FileManager fm; 479 FileManager fm;
476 QString txt; 480 QString txt;
477 if ( !fm.loadFile( dl, txt ) ) 481 if ( !fm.loadFile( dl, txt ) )
478 qDebug( "couldn't open file" ); 482 odebug << "couldn't open file" << oendl;
479 clear(); 483 clear();
480 editorStack->raiseWidget( editor ); 484 editorStack->raiseWidget( editor );
481 editor->viewport()->setFocus(); 485 editor->viewport()->setFocus();
482 doc = new DocLnk( dl ); 486 doc = new DocLnk( dl );
483 editor->setText( txt ); 487 editor->setText( txt );
484 editor->setModified( FALSE ); 488 editor->setModified( FALSE );
diff --git a/noncore/apps/opie-write/opie-write.pro b/noncore/apps/opie-write/opie-write.pro
index 044ce7e..8e514d4 100644
--- a/noncore/apps/opie-write/opie-write.pro
+++ b/noncore/apps/opie-write/opie-write.pro
@@ -1,9 +1,8 @@
1 1
2CONFIG += qt warn on quick-app 2CONFIG += qt warn on quick-app
3
4 3
5HEADERS = qcleanuphandler.h \ 4HEADERS = qcleanuphandler.h \
6 qcomplextext_p.h \ 5 qcomplextext_p.h \
7 qrichtext_p.h \ 6 qrichtext_p.h \
8 qstylesheet.h \ 7 qstylesheet.h \
9 qtextedit.h \ 8 qtextedit.h \
diff --git a/noncore/apps/opie-write/qcomplextext.cpp b/noncore/apps/opie-write/qcomplextext.cpp
index 473f184..00a91c5 100644
--- a/noncore/apps/opie-write/qcomplextext.cpp
+++ b/noncore/apps/opie-write/qcomplextext.cpp
@@ -103,13 +103,13 @@ QBidiContext::~QBidiContext()
103 103
104 leftChar() returns true if the char to the left is a left join-causing char 104 leftChar() returns true if the char to the left is a left join-causing char
105 rightChar() returns true if the char to the right is a right join-causing char 105 rightChar() returns true if the char to the right is a right join-causing char
106*/ 106*/
107static inline const QChar *prevChar( const QString &str, int pos ) 107static inline const QChar *prevChar( const QString &str, int pos )
108{ 108{
109 //qDebug("leftChar: pos=%d", pos); 109 //odebug << "leftChar: pos=" << pos << "" << oendl;
110 pos--; 110 pos--;
111 const QChar *ch = str.unicode() + pos; 111 const QChar *ch = str.unicode() + pos;
112 while( pos > -1 ) { 112 while( pos > -1 ) {
113 if( !ch->isMark() ) 113 if( !ch->isMark() )
114 return ch; 114 return ch;
115 pos--; 115 pos--;
@@ -121,13 +121,13 @@ static inline const QChar *prevChar( const QString &str, int pos )
121static inline const QChar *nextChar( const QString &str, int pos) 121static inline const QChar *nextChar( const QString &str, int pos)
122{ 122{
123 pos++; 123 pos++;
124 int len = str.length(); 124 int len = str.length();
125 const QChar *ch = str.unicode() + pos; 125 const QChar *ch = str.unicode() + pos;
126 while( pos < len ) { 126 while( pos < len ) {
127 //qDebug("rightChar: %d isLetter=%d, joining=%d", pos, ch.isLetter(), ch.joining()); 127 //odebug << "rightChar: " << pos << " isLetter=" << ch.isLetter() << ", joining=" << ch.joining() << "" << oendl;
128 if( !ch->isMark() ) 128 if( !ch->isMark() )
129 return ch; 129 return ch;
130 // assume it's a transparent char, this might not be 100% correct 130 // assume it's a transparent char, this might not be 100% correct
131 pos++; 131 pos++;
132 ch++; 132 ch++;
133 } 133 }
diff --git a/noncore/apps/opie-write/qrichtext.cpp b/noncore/apps/opie-write/qrichtext.cpp
index b77a0fc..c27eb1e 100644
--- a/noncore/apps/opie-write/qrichtext.cpp
+++ b/noncore/apps/opie-write/qrichtext.cpp
@@ -34,17 +34,23 @@
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#include "qrichtext_p.h" 38#include "qrichtext_p.h"
39 39
40/* OPIE */
41#include <opie2/odebug.h>
42using namespace Opie::Core;
43
44/* QT */
40#include "qdragobject.h" 45#include "qdragobject.h"
41#include "qpaintdevicemetrics.h" 46#include "qpaintdevicemetrics.h"
42#include "qdrawutil.h" 47#include "qdrawutil.h"
43#include "qcleanuphandler.h" 48#include "qcleanuphandler.h"
44 49
50/* STD */
45#include <stdlib.h> 51#include <stdlib.h>
46 52
47using namespace Qt3; 53using namespace Qt3;
48 54
49static QTextCursor* richTextExportStart = 0; 55static QTextCursor* richTextExportStart = 0;
50static QTextCursor* richTextExportEnd = 0; 56static QTextCursor* richTextExportEnd = 0;
@@ -181,13 +187,13 @@ QTextDeleteCommand::~QTextDeleteCommand()
181} 187}
182 188
183QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) 189QTextCursor *QTextDeleteCommand::execute( QTextCursor *c )
184{ 190{
185 QTextParagraph *s = doc ? doc->paragAt( id ) : parag; 191 QTextParagraph *s = doc ? doc->paragAt( id ) : parag;
186 if ( !s ) { 192 if ( !s ) {
187 qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); 193 owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl;
188 return 0; 194 return 0;
189 } 195 }
190 196
191 cursor.setParagraph( s ); 197 cursor.setParagraph( s );
192 cursor.setIndex( index ); 198 cursor.setIndex( index );
193 int len = text.size(); 199 int len = text.size();
@@ -209,13 +215,13 @@ QTextCursor *QTextDeleteCommand::execute( QTextCursor *c )
209} 215}
210 216
211QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c ) 217QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c )
212{ 218{
213 QTextParagraph *s = doc ? doc->paragAt( id ) : parag; 219 QTextParagraph *s = doc ? doc->paragAt( id ) : parag;
214 if ( !s ) { 220 if ( !s ) {
215 qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); 221 owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl;
216 return 0; 222 return 0;
217 } 223 }
218 224
219 cursor.setParagraph( s ); 225 cursor.setParagraph( s );
220 cursor.setIndex( index ); 226 cursor.setIndex( index );
221 QString str = QTextString::toString( text ); 227 QString str = QTextString::toString( text );
@@ -1541,16 +1547,16 @@ void QTextDocument::setRichTextInternal( const QString &text, QTextCursor* curso
1541 } 1547 }
1542 if ( attr.contains( "background" ) ) { 1548 if ( attr.contains( "background" ) ) {
1543 QImage img; 1549 QImage img;
1544 QString bg = attr["background"]; 1550 QString bg = attr["background"];
1545 const QMimeSource* m = factory_->data( bg, contxt ); 1551 const QMimeSource* m = factory_->data( bg, contxt );
1546 if ( !m ) { 1552 if ( !m ) {
1547 qWarning("QRichText: no mimesource for %s", bg.latin1() ); 1553 owarn << "QRichText: no mimesource for " << bg.latin1() << "" << oendl;
1548 } else { 1554 } else {
1549 if ( !QImageDrag::decode( m, img ) ) { 1555 if ( !QImageDrag::decode( m, img ) ) {
1550 qWarning("QTextImage: cannot decode %s", bg.latin1() ); 1556 owarn << "QTextImage: cannot decode " << bg.latin1() << "" << oendl;
1551 } 1557 }
1552 } 1558 }
1553 if ( !img.isNull() ) { 1559 if ( !img.isNull() ) {
1554 QPixmap pm; 1560 QPixmap pm;
1555 pm.convertFromImage( img ); 1561 pm.convertFromImage( img );
1556 QBrush *b = new QBrush( QColor(), pm ); 1562 QBrush *b = new QBrush( QColor(), pm );
@@ -2149,13 +2155,13 @@ QString QTextDocument::richText() const
2149 2155
2150 QStyleSheetItem* item_p = styleSheet()->item("p"); 2156 QStyleSheetItem* item_p = styleSheet()->item("p");
2151 QStyleSheetItem* item_ul = styleSheet()->item("ul"); 2157 QStyleSheetItem* item_ul = styleSheet()->item("ul");
2152 QStyleSheetItem* item_ol = styleSheet()->item("ol"); 2158 QStyleSheetItem* item_ol = styleSheet()->item("ol");
2153 QStyleSheetItem* item_li = styleSheet()->item("li"); 2159 QStyleSheetItem* item_li = styleSheet()->item("li");
2154 if ( !item_p || !item_ul || !item_ol || !item_li ) { 2160 if ( !item_p || !item_ul || !item_ol || !item_li ) {
2155 qWarning( "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" ); 2161 owarn << "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" << oendl;
2156 return QString::null; 2162 return QString::null;
2157 } 2163 }
2158 int pastListDepth = 0; 2164 int pastListDepth = 0;
2159 int listDepth = 0; 2165 int listDepth = 0;
2160 int futureListDepth = 0; 2166 int futureListDepth = 0;
2161 QMemArray<int> listStyles(10); 2167 QMemArray<int> listStyles(10);
@@ -4093,13 +4099,13 @@ int QTextParagraph::lineHeightOfChar( int i, int *bl, int *y ) const
4093 } 4099 }
4094 if ( it == lineStarts.begin() ) 4100 if ( it == lineStarts.begin() )
4095 break; 4101 break;
4096 --it; 4102 --it;
4097 } 4103 }
4098 4104
4099 qWarning( "QTextParagraph::lineHeightOfChar: couldn't find lh for %d", i ); 4105 owarn << "QTextParagraph::lineHeightOfChar: couldn't find lh for " << i << "" << oendl;
4100 return 15; 4106 return 15;
4101} 4107}
4102 4108
4103QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line ) const 4109QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line ) const
4104{ 4110{
4105 if ( !isValid() ) 4111 if ( !isValid() )
@@ -4119,13 +4125,13 @@ QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line )
4119 if ( it == lineStarts.begin() ) 4125 if ( it == lineStarts.begin() )
4120 break; 4126 break;
4121 --it; 4127 --it;
4122 --l; 4128 --l;
4123 } 4129 }
4124 4130
4125 qWarning( "QTextParagraph::lineStartOfChar: couldn't find %d", i ); 4131 owarn << "QTextParagraph::lineStartOfChar: couldn't find " << i << "" << oendl;
4126 return 0; 4132 return 0;
4127} 4133}
4128 4134
4129int QTextParagraph::lines() const 4135int QTextParagraph::lines() const
4130{ 4136{
4131 if ( !isValid() ) 4137 if ( !isValid() )
@@ -4146,13 +4152,13 @@ QTextStringChar *QTextParagraph::lineStartOfLine( int line, int *index ) const
4146 int i = it.key(); 4152 int i = it.key();
4147 if ( index ) 4153 if ( index )
4148 *index = i; 4154 *index = i;
4149 return &str->at( i ); 4155 return &str->at( i );
4150 } 4156 }
4151 4157
4152 qWarning( "QTextParagraph::lineStartOfLine: couldn't find %d", line ); 4158 owarn << "QTextParagraph::lineStartOfLine: couldn't find " << line << "" << oendl;
4153 return 0; 4159 return 0;
4154} 4160}
4155 4161
4156int QTextParagraph::leftGap() const 4162int QTextParagraph::leftGap() const
4157{ 4163{
4158 if ( !isValid() ) 4164 if ( !isValid() )
@@ -5694,13 +5700,13 @@ QTextFormat *QTextFormatCollection::format( const QFont &f, const QColor &c )
5694 return defFormat; 5700 return defFormat;
5695 5701
5696 cachedFormat = createFormat( f, c ); 5702 cachedFormat = createFormat( f, c );
5697 cachedFormat->collection = this; 5703 cachedFormat->collection = this;
5698 cKey.insert( cachedFormat->key(), cachedFormat ); 5704 cKey.insert( cachedFormat->key(), cachedFormat );
5699 if ( cachedFormat->key() != key ) 5705 if ( cachedFormat->key() != key )
5700 qWarning("ASSERT: keys for format not identical: '%s '%s'", cachedFormat->key().latin1(), key.latin1() ); 5706 owarn << "ASSERT: keys for format not identical: '" << cachedFormat->key().latin1() << " '" << key.latin1() << "'" << oendl;
5701 return cachedFormat; 5707 return cachedFormat;
5702} 5708}
5703 5709
5704void QTextFormatCollection::remove( QTextFormat *f ) 5710void QTextFormatCollection::remove( QTextFormat *f )
5705{ 5711{
5706 if ( lastFormat == f ) 5712 if ( lastFormat == f )
@@ -6080,17 +6086,17 @@ QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, co
6080 height = pm.height(); 6086 height = pm.height();
6081 } else { 6087 } else {
6082 QImage img; 6088 QImage img;
6083 const QMimeSource* m = 6089 const QMimeSource* m =
6084 factory.data( imageName, context ); 6090 factory.data( imageName, context );
6085 if ( !m ) { 6091 if ( !m ) {
6086 qWarning("QTextImage: no mimesource for %s", imageName.latin1() ); 6092 owarn << "QTextImage: no mimesource for " << imageName.latin1() << "" << oendl;
6087 } 6093 }
6088 else { 6094 else {
6089 if ( !QImageDrag::decode( m, img ) ) { 6095 if ( !QImageDrag::decode( m, img ) ) {
6090 qWarning("QTextImage: cannot decode %s", imageName.latin1() ); 6096 owarn << "QTextImage: cannot decode " << imageName.latin1() << "" << oendl;
6091 } 6097 }
6092 } 6098 }
6093 6099
6094 if ( !img.isNull() ) { 6100 if ( !img.isNull() ) {
6095 if ( width == 0 ) { 6101 if ( width == 0 ) {
6096 width = img.width(); 6102 width = img.width();
diff --git a/noncore/apps/opie-write/qrichtext_p.cpp b/noncore/apps/opie-write/qrichtext_p.cpp
index 6783e0b..2e8b09c 100644
--- a/noncore/apps/opie-write/qrichtext_p.cpp
+++ b/noncore/apps/opie-write/qrichtext_p.cpp
@@ -32,12 +32,15 @@
32** 32**
33** Contact info@trolltech.com if any conditions of this licensing are 33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you. 34** not clear to you.
35** 35**
36**********************************************************************/ 36**********************************************************************/
37 37
38#include <opie2/odebug.h>
39using namespace Opie::Core;
40
38#include "qrichtext_p.h" 41#include "qrichtext_p.h"
39 42
40using namespace Qt3; 43using namespace Qt3;
41 44
42QTextCommand::~QTextCommand() {} 45QTextCommand::~QTextCommand() {}
43QTextCommand::Commands QTextCommand::type() const { return Invalid; } 46QTextCommand::Commands QTextCommand::type() const { return Invalid; }
@@ -134,13 +137,13 @@ void QTextCursor::gotoPosition( QTextParagraph* p, int index )
134 pop(); 137 pop();
135 Q_ASSERT( indices.isEmpty() || para->document() == p->document() ); 138 Q_ASSERT( indices.isEmpty() || para->document() == p->document() );
136 } 139 }
137 para = p; 140 para = p;
138 if ( index < 0 || index >= para->length() ) { 141 if ( index < 0 || index >= para->length() ) {
139#if defined(QT_CHECK_RANGE) 142#if defined(QT_CHECK_RANGE)
140 qWarning( "QTextCursor::gotoParagraph Index: %d out of range", index ); 143 owarn << "QTextCursor::gotoParagraph Index: " << index << " out of range" << oendl;
141#endif 144#endif
142 index = index < 0 ? 0 : para->length() - 1; 145 index = index < 0 ? 0 : para->length() - 1;
143 } 146 }
144 147
145 tmpIndex = -1; 148 tmpIndex = -1;
146 idx = index; 149 idx = index;
@@ -474,13 +477,13 @@ bool QTextParagraph::fullSelected( int id ) const
474 return ( *it ).start == 0 && ( *it ).end == str->length() - 1; 477 return ( *it ).start == 0 && ( *it ).end == str->length() - 1;
475} 478}
476 479
477int QTextParagraph::lineY( int l ) const 480int QTextParagraph::lineY( int l ) const
478{ 481{
479 if ( l > (int)lineStarts.count() - 1 ) { 482 if ( l > (int)lineStarts.count() - 1 ) {
480 qWarning( "QTextParagraph::lineY: line %d out of range!", l ); 483 owarn << "QTextParagraph::lineY: line " << l << " out of range!" << oendl;
481 return 0; 484 return 0;
482 } 485 }
483 486
484 if ( !isValid() ) 487 if ( !isValid() )
485 ( (QTextParagraph*)this )->format(); 488 ( (QTextParagraph*)this )->format();
486 489
@@ -490,13 +493,13 @@ int QTextParagraph::lineY( int l ) const
490 return ( *it )->y; 493 return ( *it )->y;
491} 494}
492 495
493int QTextParagraph::lineBaseLine( int l ) const 496int QTextParagraph::lineBaseLine( int l ) const
494{ 497{
495 if ( l > (int)lineStarts.count() - 1 ) { 498 if ( l > (int)lineStarts.count() - 1 ) {
496 qWarning( "QTextParagraph::lineBaseLine: line %d out of range!", l ); 499 owarn << "QTextParagraph::lineBaseLine: line " << l << " out of range!" << oendl;
497 return 10; 500 return 10;
498 } 501 }
499 502
500 if ( !isValid() ) 503 if ( !isValid() )
501 ( (QTextParagraph*)this )->format(); 504 ( (QTextParagraph*)this )->format();
502 505
@@ -506,13 +509,13 @@ int QTextParagraph::lineBaseLine( int l ) const
506 return ( *it )->baseLine; 509 return ( *it )->baseLine;
507} 510}
508 511
509int QTextParagraph::lineHeight( int l ) const 512int QTextParagraph::lineHeight( int l ) const
510{ 513{
511 if ( l > (int)lineStarts.count() - 1 ) { 514 if ( l > (int)lineStarts.count() - 1 ) {
512 qWarning( "QTextParagraph::lineHeight: line %d out of range!", l ); 515 owarn << "QTextParagraph::lineHeight: line " << l << " out of range!" << oendl;
513 return 15; 516 return 15;
514 } 517 }
515 518
516 if ( !isValid() ) 519 if ( !isValid() )
517 ( (QTextParagraph*)this )->format(); 520 ( (QTextParagraph*)this )->format();
518 521
@@ -522,14 +525,14 @@ int QTextParagraph::lineHeight( int l ) const
522 return ( *it )->h; 525 return ( *it )->h;
523} 526}
524 527
525void QTextParagraph::lineInfo( int l, int &y, int &h, int &bl ) const 528void QTextParagraph::lineInfo( int l, int &y, int &h, int &bl ) const
526{ 529{
527 if ( l > (int)lineStarts.count() - 1 ) { 530 if ( l > (int)lineStarts.count() - 1 ) {
528 qWarning( "QTextParagraph::lineInfo: line %d out of range!", l ); 531 owarn << "QTextParagraph::lineInfo: line " << l << " out of range!" << oendl;
529 qDebug( "%d %d", (int)lineStarts.count() - 1, l ); 532 odebug << "" << (int)lineStarts.count() - 1 << " " << l << "" << oendl;
530 y = 0; 533 y = 0;
531 h = 15; 534 h = 15;
532 bl = 10; 535 bl = 10;
533 return; 536 return;
534 } 537 }
535 538
diff --git a/noncore/apps/qashmoney/accountdisplay.cpp b/noncore/apps/qashmoney/accountdisplay.cpp
index 0fe5b09..046d997 100755
--- a/noncore/apps/qashmoney/accountdisplay.cpp
+++ b/noncore/apps/qashmoney/accountdisplay.cpp
@@ -1,15 +1,20 @@
1#include <qmessagebox.h>
2#include <qheader.h>
3
4#include "accountdisplay.h" 1#include "accountdisplay.h"
5#include "newaccount.h" 2#include "newaccount.h"
6#include "transaction.h" 3#include "transaction.h"
7#include "transferdialog.h" 4#include "transferdialog.h"
8#include "transfer.h" 5#include "transfer.h"
9 6
7/* OPIE */
8#include <opie2/odebug.h>
9using namespace Opie::Core;
10
11/* QT */
12#include <qmessagebox.h>
13#include <qheader.h>
14
10extern Account *account; 15extern Account *account;
11extern Transaction *transaction; 16extern Transaction *transaction;
12extern Transfer *transfer; 17extern Transfer *transfer;
13extern Preferences *preferences; 18extern Preferences *preferences;
14 19
15AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) 20AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent )
@@ -264,13 +269,13 @@ void AccountDisplay::getTransferAccounts ( QListViewItem * item )
264 269
265 if ( td->exec() == QDialog::Accepted ) 270 if ( td->exec() == QDialog::Accepted )
266 { 271 {
267 // set the cleared integer if the checkbox is checked 272 // set the cleared integer if the checkbox is checked
268 if ( td->clearedcheckbox->isChecked() == TRUE ) 273 if ( td->clearedcheckbox->isChecked() == TRUE )
269 cleared = 1; 274 cleared = 1;
270 qDebug("Year from transferdialog = %i",td->getYear()); 275 odebug << "Year from transferdialog = " << td->getYear() << "" << oendl;
271 // add the transfer with a new date if its been edited or use the default date 276 // add the transfer with a new date if its been edited or use the default date
272 if ( td->getDateEdited () == TRUE ) 277 if ( td->getDateEdited () == TRUE )
273 transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared ); 278 transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared );
274 else 279 else
275 transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); 280 transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared );
276 281
diff --git a/noncore/apps/qashmoney/config.in b/noncore/apps/qashmoney/config.in
index 91739fe..aeed298 100644
--- a/noncore/apps/qashmoney/config.in
+++ b/noncore/apps/qashmoney/config.in
@@ -1,4 +1,4 @@
1 config QASHMONEY 1 config QASHMONEY
2 boolean "opie-qashmoney (money manager)" 2 boolean "opie-qashmoney (money manager)"
3 default "n" 3 default "n"
4 depends ( LIBQPE || LIBQPE-X11 ) 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/noncore/apps/qashmoney/qashmoney.pro b/noncore/apps/qashmoney/qashmoney.pro
index 6ad3db3..8a4302f 100755
--- a/noncore/apps/qashmoney/qashmoney.pro
+++ b/noncore/apps/qashmoney/qashmoney.pro
@@ -40,10 +40,10 @@ SOURCES = qashmoney.cpp \
40INCLUDEPATH = $(OPIEDIR)/include 40INCLUDEPATH = $(OPIEDIR)/include
41DEPENDPATH = $(OPIEDIR)/include 41DEPENDPATH = $(OPIEDIR)/include
42 42
43DESTDIR = $(OPIEDIR)/bin 43DESTDIR = $(OPIEDIR)/bin
44 44
45unix:LIBS += -lm 45unix:LIBS += -lm
46LIBS += -lqpe -lqte -lsqlite 46LIBS += -lqpe -lopiecore2 -lsqlite
47 47
48include ( $(OPIEDIR)/include.pro ) 48include ( $(OPIEDIR)/include.pro )
49 49
diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp
index dbf9370..6e544ba 100644
--- a/noncore/apps/tableviewer/db/common.cpp
+++ b/noncore/apps/tableviewer/db/common.cpp
@@ -14,21 +14,29 @@
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include <stdlib.h> 20#include "common.h"
21#include "datacache.h"
22
23/* OPIE */
24#include <opie2/odebug.h>
25#include <qpe/timestring.h>
26using namespace Opie::Core;
27
28/* QT */
21#include <qstring.h> 29#include <qstring.h>
22#include <qheader.h> 30#include <qheader.h>
23#include <qvector.h> 31#include <qvector.h>
24#include <qdatetime.h> 32#include <qdatetime.h>
25#include <qpe/timestring.h> 33
26#include "common.h" 34/* STD */
27#include "datacache.h"
28#include <assert.h> 35#include <assert.h>
36#include <stdlib.h>
29 37
30static const int del_flag = 0x1; 38static const int del_flag = 0x1;
31static const int new_flag = 0x2; 39static const int new_flag = 0x2;
32 40
33/* Helper function */ 41/* Helper function */
34 42
@@ -309,13 +317,13 @@ void TVVariant::load(QDataStream &s )
309 int x; 317 int x;
310 s >> x; 318 s >> x;
311 d->value.i = x; 319 d->value.i = x;
312 } 320 }
313 break; 321 break;
314 default: 322 default:
315 qFatal("Unrecognized data type"); 323 ofatal << "Unrecognized data type" << oendl;
316 } 324 }
317} 325}
318 326
319void TVVariant::save( QDataStream &s ) const 327void TVVariant::save( QDataStream &s ) const
320{ 328{
321 s << type(); 329 s << type();
@@ -1075,13 +1083,13 @@ QDataStream &operator>>( QDataStream &s, DataElem &d)
1075 int size; 1083 int size;
1076 TVVariant t; 1084 TVVariant t;
1077 int index = 0; 1085 int index = 0;
1078 1086
1079 s >> size; /* redundent data but makes streaming easier */ 1087 s >> size; /* redundent data but makes streaming easier */
1080 if (size != d.getNumFields()) { 1088 if (size != d.getNumFields()) {
1081 qWarning("DataSize mis-match"); 1089 owarn << "DataSize mis-match" << oendl;
1082 return s; /* sanity check failed.. don't load */ 1090 return s; /* sanity check failed.. don't load */
1083 } 1091 }
1084 1092
1085 for(i = 0; i < size; i++) { 1093 for(i = 0; i < size; i++) {
1086 s >> (Q_UINT16)index; 1094 s >> (Q_UINT16)index;
1087 s >> t; 1095 s >> t;
@@ -1374,13 +1382,13 @@ bool DataElem::contains(int i, TVVariant v) const
1374 /* meaningless for dates */ 1382 /* meaningless for dates */
1375 case TVVariant::Int: 1383 case TVVariant::Int:
1376 case TVVariant::Time: 1384 case TVVariant::Time:
1377 case TVVariant::Date: 1385 case TVVariant::Date:
1378 break; 1386 break;
1379 default: 1387 default:
1380 qWarning("Tried to compare unknown data type"); 1388 owarn << "Tried to compare unknown data type" << oendl;
1381 } 1389 }
1382 return FALSE; 1390 return FALSE;
1383} 1391}
1384 1392
1385bool DataElem::startsWith(int i, TVVariant v) const 1393bool DataElem::startsWith(int i, TVVariant v) const
1386{ 1394{
@@ -1400,13 +1408,13 @@ bool DataElem::startsWith(int i, TVVariant v) const
1400 /* meaningless for dates */ 1408 /* meaningless for dates */
1401 case TVVariant::Int: 1409 case TVVariant::Int:
1402 case TVVariant::Time: 1410 case TVVariant::Time:
1403 case TVVariant::Date: 1411 case TVVariant::Date:
1404 return FALSE; 1412 return FALSE;
1405 default: 1413 default:
1406 qWarning("Tried to compare unknown data type"); 1414 owarn << "Tried to compare unknown data type" << oendl;
1407 } 1415 }
1408 return FALSE; 1416 return FALSE;
1409} 1417}
1410 1418
1411bool DataElem::endsWith(int i, TVVariant v) const 1419bool DataElem::endsWith(int i, TVVariant v) const
1412{ 1420{
@@ -1426,13 +1434,13 @@ bool DataElem::endsWith(int i, TVVariant v) const
1426 /* meaningless for dates */ 1434 /* meaningless for dates */
1427 case TVVariant::Int: 1435 case TVVariant::Int:
1428 case TVVariant::Time: 1436 case TVVariant::Time:
1429 case TVVariant::Date: 1437 case TVVariant::Date:
1430 return FALSE; 1438 return FALSE;
1431 default: 1439 default:
1432 qWarning("Tried to compare unknown data type"); 1440 owarn << "Tried to compare unknown data type" << oendl;
1433 } 1441 }
1434 return FALSE; 1442 return FALSE;
1435} 1443}
1436 1444
1437/*! 1445/*!
1438 Determins which of the first to parameters are closer to the third, target 1446 Determins which of the first to parameters are closer to the third, target
@@ -1458,13 +1466,13 @@ bool DataElem::closer(DataElem*d1, DataElem *d2, TVVariant target, int column)
1458 1466
1459 type = d1->getField(column).type(); 1467 type = d1->getField(column).type();
1460 1468
1461 if(d2) { 1469 if(d2) {
1462 if (type != d2->getField(column).type()) { 1470 if (type != d2->getField(column).type()) {
1463 /* can't do compare */ 1471 /* can't do compare */
1464 qWarning("Tried to compare two incompatable types"); 1472 owarn << "Tried to compare two incompatable types" << oendl;
1465 return FALSE; 1473 return FALSE;
1466 } 1474 }
1467 return target.closer(d1->getField(column), d2->getField(column)); 1475 return target.closer(d1->getField(column), d2->getField(column));
1468 } 1476 }
1469 return target.close(d1->getField(column)); 1477 return target.close(d1->getField(column));
1470} 1478}
diff --git a/noncore/apps/tableviewer/db/datacache.cpp b/noncore/apps/tableviewer/db/datacache.cpp
index 7c14eef..6380e1b 100644
--- a/noncore/apps/tableviewer/db/datacache.cpp
+++ b/noncore/apps/tableviewer/db/datacache.cpp
@@ -23,15 +23,23 @@
23 * otherwise any other data headings are allowed. 23 * otherwise any other data headings are allowed.
24 */ 24 */
25 25
26#include "datacache.h" 26#include "datacache.h"
27#include "xmlsource.h" 27#include "xmlsource.h"
28#include "csvsource.h" 28#include "csvsource.h"
29#include <stdlib.h> 29
30/* OPIE */
31#include <opie2/odebug.h>
32using namespace Opie::Core;
33
34/* QT */
30#include <qheader.h> 35#include <qheader.h>
31 36
37/* STD */
38#include <stdlib.h>
39
32#define INIT_TABLE_SIZE 128 40#define INIT_TABLE_SIZE 128
33 41
34/*! 42/*!
35 \class DBStore datastore.h 43 \class DBStore datastore.h
36 44
37 \brief The DBStore class is the class responsible for storing, sorting and 45 \brief The DBStore class is the class responsible for storing, sorting and
@@ -147,13 +155,13 @@ void DBStore::addItem(DataElem *delem)
147} 155}
148 156
149void DBStore::addItemInternal(DataElem *delem) 157void DBStore::addItemInternal(DataElem *delem)
150{ 158{
151 /* if already full, don't over fill, do a qWarning though */ 159 /* if already full, don't over fill, do a qWarning though */
152 if (full) { 160 if (full) {
153 qWarning("Attempted to add items to already full table"); 161 owarn << "Attempted to add items to already full table" << oendl;
154 return; 162 return;
155 } 163 }
156 164
157 master_table.insert(number_elems, delem); 165 master_table.insert(number_elems, delem);
158 166
159 current_elem = number_elems; 167 current_elem = number_elems;
diff --git a/noncore/apps/tableviewer/db/xmlsource.cpp b/noncore/apps/tableviewer/db/xmlsource.cpp
index 94fec36..4ca6aee 100644
--- a/noncore/apps/tableviewer/db/xmlsource.cpp
+++ b/noncore/apps/tableviewer/db/xmlsource.cpp
@@ -15,18 +15,24 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "xmlsource.h" 20#include "xmlsource.h"
21#include <qdict.h>
22#include <stdlib.h>
23#include <qtextstream.h>
24#include "../xmlencodeattr.h" 21#include "../xmlencodeattr.h"
25 22
23/* OPIE */
24#include <opie2/odebug.h>
25using namespace Opie::Core;
26 26
27/* QT */
28#include <qdict.h>
29#include <qtextstream.h>
30
31/* STD */
32#include <stdlib.h>
27 33
28DBXml::DBXml(DBStore *d) 34DBXml::DBXml(DBStore *d)
29{ 35{
30 dstore = d; 36 dstore = d;
31} 37}
32 38
@@ -137,13 +143,13 @@ DBXmlHandler::DBXmlHandler(DBStore *ds)
137DBXmlHandler::~DBXmlHandler() 143DBXmlHandler::~DBXmlHandler()
138{ 144{
139} 145}
140 146
141QString DBXmlHandler::errorProtocol() 147QString DBXmlHandler::errorProtocol()
142{ 148{
143 qWarning("Error reading file"); 149 owarn << "Error reading file" << oendl;
144 return errorProt; 150 return errorProt;
145} 151}
146 152
147bool DBXmlHandler::startDocument() 153bool DBXmlHandler::startDocument()
148{ 154{
149 errorProt = ""; 155 errorProt = "";
@@ -169,13 +175,13 @@ bool DBXmlHandler::startElement(const QString&, const QString&,
169 if (state == StateHeader && qName == "key") { 175 if (state == StateHeader && qName == "key") {
170 /* Ok, adding a new key to our KeyList TODO */ 176 /* Ok, adding a new key to our KeyList TODO */
171 state = StateKey; 177 state = StateKey;
172 last_key_type = TVVariant::String; 178 last_key_type = TVVariant::String;
173 key = atts.value("name"); 179 key = atts.value("name");
174 if (key.isEmpty()) { 180 if (key.isEmpty()) {
175 qWarning("empty key name"); 181 owarn << "empty key name" << oendl;
176 return FALSE; 182 return FALSE;
177 } 183 }
178 if(!atts.value("type").isEmpty()) 184 if(!atts.value("type").isEmpty())
179 last_key_type = TVVariant::nameToType(atts.value("type")); 185 last_key_type = TVVariant::nameToType(atts.value("type"));
180 return TRUE; 186 return TRUE;
181 } 187 }
@@ -187,19 +193,19 @@ bool DBXmlHandler::startElement(const QString&, const QString&,
187 } 193 }
188 if (state == StateRecord) { 194 if (state == StateRecord) {
189 state = StateField; 195 state = StateField;
190 /* the qName is the name of a key */ 196 /* the qName is the name of a key */
191 if (!keyIndexList[qName]) { 197 if (!keyIndexList[qName]) {
192 /* invalid key, we failed */ 198 /* invalid key, we failed */
193 qWarning("Invalid key in record"); 199 owarn << "Invalid key in record" << oendl;
194 return FALSE; 200 return FALSE;
195 } 201 }
196 keyIndex = *keyIndexList[qName]; 202 keyIndex = *keyIndexList[qName];
197 return TRUE; 203 return TRUE;
198 } 204 }
199 qWarning("Unable to determine tag type"); 205 owarn << "Unable to determine tag type" << oendl;
200 return FALSE; 206 return FALSE;
201} 207}
202 208
203bool DBXmlHandler::endElement(const QString&, const QString&, 209bool DBXmlHandler::endElement(const QString&, const QString&,
204 const QString& qName) 210 const QString& qName)
205{ 211{
@@ -222,13 +228,13 @@ bool DBXmlHandler::endElement(const QString&, const QString&,
222 break; 228 break;
223 case StateDocument: 229 case StateDocument:
224 // we are done... 230 // we are done...
225 break; 231 break;
226 default: 232 default:
227 // should only get a 'endElement' from one of the above states. 233 // should only get a 'endElement' from one of the above states.
228 qWarning("Invalid end tag"); 234 owarn << "Invalid end tag" << oendl;
229 return FALSE; 235 return FALSE;
230 break; 236 break;
231 } 237 }
232 return TRUE; 238 return TRUE;
233} 239}
234 240
@@ -251,13 +257,13 @@ bool DBXmlHandler::characters(const QString& ch)
251 if (state == StateField) { 257 if (state == StateField) {
252 /* Ok, need to add data here */ 258 /* Ok, need to add data here */
253 current_data->setField(keyIndex, ch_simplified); 259 current_data->setField(keyIndex, ch_simplified);
254 return TRUE; 260 return TRUE;
255 } 261 }
256 262
257 qWarning("Junk characters found... ignored"); 263 owarn << "Junk characters found... ignored" << oendl;
258 return TRUE; 264 return TRUE;
259} 265}
260 266
261QString DBXmlHandler::errorString() 267QString DBXmlHandler::errorString()
262{ 268{
263 return "the document is not in the expected file format"; 269 return "the document is not in the expected file format";
@@ -267,31 +273,31 @@ bool DBXmlHandler::warning(const QXmlParseException& exception)
267{ 273{
268 errorProt += QString("warning parsing error: %1 in line %2, column %3\n" ) 274 errorProt += QString("warning parsing error: %1 in line %2, column %3\n" )
269 .arg(exception.message()) 275 .arg(exception.message())
270 .arg(exception.lineNumber()) 276 .arg(exception.lineNumber())
271 .arg(exception.columnNumber()); 277 .arg(exception.columnNumber());
272 278
273 qWarning(errorProt); 279 owarn << errorProt << oendl;
274 return QXmlDefaultHandler::fatalError(exception); 280 return QXmlDefaultHandler::fatalError(exception);
275} 281}
276 282
277bool DBXmlHandler::error(const QXmlParseException& exception) 283bool DBXmlHandler::error(const QXmlParseException& exception)
278{ 284{
279 errorProt += QString("error parsing error: %1 in line %2, column %3\n" ) 285 errorProt += QString("error parsing error: %1 in line %2, column %3\n" )
280 .arg(exception.message()) 286 .arg(exception.message())
281 .arg(exception.lineNumber()) 287 .arg(exception.lineNumber())
282 .arg(exception.columnNumber()); 288 .arg(exception.columnNumber());
283 289
284 qWarning(errorProt); 290 owarn << errorProt << oendl;
285 return QXmlDefaultHandler::fatalError(exception); 291 return QXmlDefaultHandler::fatalError(exception);
286} 292}
287 293
288bool DBXmlHandler::fatalError(const QXmlParseException& exception) 294bool DBXmlHandler::fatalError(const QXmlParseException& exception)
289{ 295{
290 errorProt += QString("fatal parsing error: %1 in line %2, column %3\n" ) 296 errorProt += QString("fatal parsing error: %1 in line %2, column %3\n" )
291 .arg(exception.message()) 297 .arg(exception.message())
292 .arg(exception.lineNumber()) 298 .arg(exception.lineNumber())
293 .arg(exception.columnNumber()); 299 .arg(exception.columnNumber());
294 300
295 qWarning(errorProt); 301 owarn << errorProt << oendl;
296 return QXmlDefaultHandler::fatalError(exception); 302 return QXmlDefaultHandler::fatalError(exception);
297} 303}
diff --git a/noncore/apps/tableviewer/tableviewer.cpp b/noncore/apps/tableviewer/tableviewer.cpp
index 102b94c..9538cb3 100644
--- a/noncore/apps/tableviewer/tableviewer.cpp
+++ b/noncore/apps/tableviewer/tableviewer.cpp
@@ -15,33 +15,35 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21/* local includes */
22#include "tableviewer.h" 21#include "tableviewer.h"
23#include "ui/tvbrowseview.h" 22#include "ui/tvbrowseview.h"
24#include "ui/tvfilterview.h" 23#include "ui/tvfilterview.h"
25#include "ui/tvlistview.h" 24#include "ui/tvlistview.h"
26#include "ui/tveditview.h" 25#include "ui/tveditview.h"
27#include "ui/tvkeyedit.h" 26#include "ui/tvkeyedit.h"
28#include "db/datacache.h" 27#include "db/datacache.h"
29 28
30/* QPE includes */ 29/* OPIE */
30#include <opie2/odebug.h>
31#include <qpe/fileselector.h> 31#include <qpe/fileselector.h>
32#include <qpe/resource.h> 32#include <qpe/resource.h>
33#include <qtoolbar.h> 33using namespace Opie::Core;
34 34
35/* QTE includes */ 35/* QT */
36#include <qmenubar.h> 36#include <qmenubar.h>
37#include <qtoolbar.h>
37#include <qpopupmenu.h> 38#include <qpopupmenu.h>
38#include <qapplication.h> 39#include <qapplication.h>
39#include <qwidgetstack.h> 40#include <qwidgetstack.h>
40#include <qlayout.h> 41#include <qlayout.h>
41#include <qbuffer.h> 42#include <qbuffer.h>
43
42/*! 44/*!
43 \class TableViewerWindow 45 \class TableViewerWindow
44 \brief The main window widget of the application 46 \brief The main window widget of the application
45 47
46 This is the main widget of the table viewer application. 48 This is the main widget of the table viewer application.
47 It is the co-ordination point. 49 It is the co-ordination point.
@@ -198,13 +200,13 @@ void TableViewerWindow::saveDocument()
198 return; 200 return;
199 201
200 FileManager fm; 202 FileManager fm;
201 QIODevice *dev = fm.saveFile(doc); 203 QIODevice *dev = fm.saveFile(doc);
202 204
203 if(!ds->saveSource(dev, doc.type())){ 205 if(!ds->saveSource(dev, doc.type())){
204 qWarning("Save unsuccessful"); 206 owarn << "Save unsuccessful" << oendl;
205 return; 207 return;
206 } 208 }
207 dev->close(); 209 dev->close();
208 dirty = FALSE; 210 dirty = FALSE;
209} 211}
210 212
@@ -285,13 +287,13 @@ void TableViewerWindow::openDocument(const DocLnk &f)
285 scratch += " - "; 287 scratch += " - ";
286 scratch += ds->getName(); 288 scratch += ds->getName();
287 setCaption(tr(scratch)); 289 setCaption(tr(scratch));
288 290
289 dirty = FALSE; 291 dirty = FALSE;
290 } else { 292 } else {
291 qWarning(tr("could not load Document")); 293 owarn << tr("could not load Document") << oendl;
292 } 294 }
293 dev->close(); 295 dev->close();
294} 296}
295 297
296/*! 298/*!
297 Moves to the first item of the current table 299 Moves to the first item of the current table
diff --git a/noncore/apps/tableviewer/tableviewer.pro b/noncore/apps/tableviewer/tableviewer.pro
index 1de23bb..564f50f 100644
--- a/noncore/apps/tableviewer/tableviewer.pro
+++ b/noncore/apps/tableviewer/tableviewer.pro
@@ -1,7 +1,7 @@
1 CONFIG = qt warn_on quick-app 1 CONFIG = qt warn_on quick-app
2 SUBDIRS = db ui 2 SUBDIRS = db ui
3 HEADERS = tableviewer.h \ 3 HEADERS = tableviewer.h \
4 xmlencodeattr.h \ 4 xmlencodeattr.h \
5 ui/commonwidgets.h \ 5 ui/commonwidgets.h \
6 ui/tvbrowseview.h \ 6 ui/tvbrowseview.h \
7 ui/tvlistview.h \ 7 ui/tvlistview.h \
@@ -28,11 +28,11 @@ SOURCES = main.cpp \
28 db/datacache.cpp \ 28 db/datacache.cpp \
29 db/xmlsource.cpp \ 29 db/xmlsource.cpp \
30 db/csvsource.cpp \ 30 db/csvsource.cpp \
31 db/common.cpp 31 db/common.cpp
32 INTERFACES= ui/tvkeyedit_gen.ui 32 INTERFACES= ui/tvkeyedit_gen.ui
33 TARGET = tableviewer 33 TARGET = tableviewer
34INCLUDEPATH += $(OPIEDIR)/include 34 INCLUDEPATH+= $(OPIEDIR)/include
35DEPENDPATH += $(OPIEDIR)/include 35 DEPENDPATH+= $(OPIEDIR)/include
36 LIBS += -lqpe -lopiecore2 36 LIBS += -lqpe -lopiecore2
37 37
38include ( $(OPIEDIR)/include.pro ) 38include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/tableviewer/ui/tvlistview.cpp b/noncore/apps/tableviewer/ui/tvlistview.cpp
index b10ff1d..c3e6432 100644
--- a/noncore/apps/tableviewer/ui/tvlistview.cpp
+++ b/noncore/apps/tableviewer/ui/tvlistview.cpp
@@ -14,14 +14,21 @@
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20
20#include "tvlistview.h" 21#include "tvlistview.h"
21#include "../db/common.h" 22#include "../db/common.h"
23
24/* OPIE */
25#include <opie2/odebug.h>
26using namespace Opie::Core;
27
28/* QT */
22#include <qtoolbutton.h> 29#include <qtoolbutton.h>
23#include <qlistview.h> 30#include <qlistview.h>
24#include <qlayout.h> 31#include <qlayout.h>
25 32
26void TVListViewPrivate::setColumnWidth(int column, int width) 33void TVListViewPrivate::setColumnWidth(int column, int width)
27{ 34{
@@ -160,13 +167,13 @@ void TVListView::first()
160 delete it; 167 delete it;
161 it = new QListViewItemIterator(listViewDisplay); 168 it = new QListViewItemIterator(listViewDisplay);
162} 169}
163 170
164void TVListView::last() 171void TVListView::last()
165{ 172{
166 qWarning("TVListView::last not yet implemented"); 173 owarn << "TVListView::last not yet implemented" << oendl;
167} 174}
168 175
169void TVListView::next() 176void TVListView::next()
170{ 177{
171 QListViewItemIterator tmp = *it; 178 QListViewItemIterator tmp = *it;
172 (*it)++; 179 (*it)++;
diff --git a/noncore/apps/tinykate/libkate/libkate.pro b/noncore/apps/tinykate/libkate/libkate.pro
index 11ee275..1552dff 100644
--- a/noncore/apps/tinykate/libkate/libkate.pro
+++ b/noncore/apps/tinykate/libkate/libkate.pro
@@ -1,90 +1,87 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG = qt warn_on 2CONFIG = qt warn_on
3HEADERS = microkde/kapplication.h \ 3HEADERS = microkde/kapplication.h \
4 kateconfig.h \ 4 kateconfig.h \
5 microkde/kdebug.h \ 5 microkde/kdebug.h \
6 microkde/kdialog.h \ 6 microkde/kdialog.h \
7 microkde/kdialogbase.h \ 7 microkde/kdialogbase.h \
8 microkde/kfiledialog.h \ 8 microkde/kfiledialog.h \
9 microkde/kglobal.h \ 9 microkde/kglobal.h \
10 microkde/kiconloader.h \ 10 microkde/kiconloader.h \
11 microkde/klineedit.h \ 11 microkde/klineedit.h \
12 microkde/klocale.h \ 12 microkde/klocale.h \
13 microkde/kmessagebox.h \ 13 microkde/kmessagebox.h \
14 microkde/kprinter.h \ 14 microkde/kprinter.h \
15 microkde/krestrictedline.h \ 15 microkde/krestrictedline.h \
16 microkde/kseparator.h \ 16 microkde/kseparator.h \
17 microkde/kstandarddirs.h \ 17 microkde/kstandarddirs.h \
18 microkde/ktempfile.h \ 18 microkde/ktempfile.h \
19 microkde/kunload.h \ 19 microkde/kunload.h \
20 microkde/kurlrequester.h \ 20 microkde/kurlrequester.h \
21 microkde/kfontdialog.h \ 21 microkde/kfontdialog.h \
22 microkde/krun.h \ 22 microkde/krun.h \
23 microkde/knumvalidator.h \ 23 microkde/knumvalidator.h \
24 microkde/kstaticdeleter.h \ 24 microkde/kstaticdeleter.h \
25 microkde/klistview.h \ 25 microkde/klistview.h \
26 microkde/kglobalsettings.h \ 26 microkde/kglobalsettings.h \
27 microkde/kcolorbtn.h \ 27 microkde/kcolorbtn.h \
28 \
29 \ 28 \
30 qt3back/qregexp3.h \ 29 qt3back/qregexp3.h \
31 microkde/ksharedptr.h \ 30 microkde/ksharedptr.h \
32 document/katebuffer.h document/katedialogs.h \ 31 document/katebuffer.h document/katedialogs.h \
33 document/katetextline.h \ 32 document/katetextline.h \
34 document/katecmd.h \ 33 document/katecmd.h \
35 document/katehighlight.h \ 34 document/katehighlight.h \
36 document/katecmds.h document/katedocument.h \ 35 document/katecmds.h document/katedocument.h \
37 document/katesyntaxdocument.h \ 36 document/katesyntaxdocument.h \
38 view/kateundohistory.h \ 37 view/kateundohistory.h \
39 view/kateview.h \ 38 view/kateview.h \
40 view/kateviewdialog.h \ 39 view/kateviewdialog.h \
41 interfaces/view.h \ 40 interfaces/view.h \
42 interfaces/document.h \ 41 interfaces/document.h \
43 ktexteditor/ktexteditor.h 42 ktexteditor/ktexteditor.h
44 43
45SOURCES = microkde/kapplication.cpp \ 44SOURCES = microkde/kapplication.cpp \
46 microkde/kdialogbase.cpp \ 45 microkde/kdialogbase.cpp \
47 kateconfig.cpp \ 46 kateconfig.cpp \
48 microkde/klocale.cpp \ 47 microkde/klocale.cpp \
49 microkde/kmessagebox.cpp \ 48 microkde/kmessagebox.cpp \
50 microkde/kprocess.cpp \ 49 microkde/kprocess.cpp \
51 microkde/kstandarddirs.cpp \ 50 microkde/kstandarddirs.cpp \
52 microkde/ktempfile.cpp \ 51 microkde/ktempfile.cpp \
53 microkde/kurlrequester.cpp \ 52 microkde/kurlrequester.cpp \
54 microkde/kfontdialog.cpp \ 53 microkde/kfontdialog.cpp \
55 microkde/krun.cpp \ 54 microkde/krun.cpp \
56 microkde/knumvalidator.cpp \ 55 microkde/knumvalidator.cpp \
57 microkde/kglobal.cpp \ 56 microkde/kglobal.cpp \
58 microkde/kglobalsettings.cpp \ 57 microkde/kglobalsettings.cpp \
59 microkde/kcolorbtn.cpp \ 58 microkde/kcolorbtn.cpp \
60 \ 59 \
61 \ 60 qt3back/qregexp3.cpp \
62 qt3back/qregexp3.cpp \ 61 ktexteditor/ktexteditor.cpp \
63 ktexteditor/ktexteditor.cpp \ 62 document/katebuffer.cpp document/katedialogs.cpp \
64 document/katebuffer.cpp document/katedialogs.cpp \ 63 document/katehighlight.cpp \
65 document/katehighlight.cpp \ 64 document/katecmd.cpp \
66 document/katecmd.cpp \ 65 document/katesyntaxdocument.cpp document/katecmds.cpp \
67 document/katesyntaxdocument.cpp document/katecmds.cpp \ 66 document/katedocument.cpp document/katetextline.cpp \
68 document/katedocument.cpp document/katetextline.cpp \ 67 view/kateundohistory.cpp \
69 view/kateundohistory.cpp \ 68 view/kateview.cpp \
70 view/kateview.cpp \ 69 view/kateviewdialog.cpp \
71 view/kateviewdialog.cpp \ 70 interfaces/interfaces.cpp
72 interfaces/interfaces.cpp 71INTERFACES =
73 72INCLUDEPATH += $(OPIEDIR)/include \
74INTERFACES =
75INCLUDEPATH += $(OPIEDIR)/include \
76 $(OPIEDIR)/noncore/apps/tinykate/libkate \ 73 $(OPIEDIR)/noncore/apps/tinykate/libkate \
77 $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ 74 $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \
78 $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ 75 $(OPIEDIR)/noncore/apps/tinykate/libkate/document \
79 $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ 76 $(OPIEDIR)/noncore/apps/tinykate/libkate/view \
80 $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ 77 $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \
81 $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ 78 $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \
82 $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back 79 $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back
83DEPENDPATH += $(OPIEDIR)/include 80DEPENDPATH += $(OPIEDIR)/include
84LIBS += -lqpe -lqtaux2 -lopiecore2 -lopieui2 81LIBS += -lqpe -lqtaux2 -lopiecore2 -lopieui2
85TARGET = tinykate 82TARGET = tinykate
86 83
87INCLUDEPATH += $(OPIEDIR)/include 84INCLUDEPATH += $(OPIEDIR)/include
88DESTDIR = $(OPIEDIR)/lib$(PROJMAK) 85DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
89 86
90include ( $(OPIEDIR)/include.pro ) 87include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/tinykate/tinykate.pro b/noncore/apps/tinykate/tinykate.pro
index 6f4baa8..d34e519 100644
--- a/noncore/apps/tinykate/tinykate.pro
+++ b/noncore/apps/tinykate/tinykate.pro
@@ -1,22 +1,20 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG = qt warn_on quick-app 2CONFIG = qt warn_on quick-app
3DESTDIR = $(OPIEDIR)/bin 3DESTDIR = $(OPIEDIR)/bin
4HEADERS = tinykate.h 4HEADERS = tinykate.h
5SOURCES = tinykate.cpp main.cpp 5SOURCES = tinykate.cpp main.cpp
6INTERFACES =
7INCLUDEPATH += $(OPIEDIR)/include \ 6INCLUDEPATH += $(OPIEDIR)/include \
8 $(OPIEDIR)/noncore/apps/tinykate/libkate \ 7 $(OPIEDIR)/noncore/apps/tinykate/libkate \
9 $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ 8 $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \
10 $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ 9 $(OPIEDIR)/noncore/apps/tinykate/libkate/document \
11 $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ 10 $(OPIEDIR)/noncore/apps/tinykate/libkate/view \
12 $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ 11 $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \
13 $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ 12 $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \
14 $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back 13 $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back
15 14DEPENDPATH += $(OPIEDIR)/include
16DEPENDPATH += $(OPIEDIR)/include 15LIBS += -lqpe -ltinykate -lopiecore2 -lopieui2
17LIBS += -lqpe -ltinykate -lopiecore2 -lopieui2 16TARGET = kate
18TARGET = kate
19 17
20 18
21 19
22include ( $(OPIEDIR)/include.pro ) 20include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/apps/zsafe/config.in b/noncore/apps/zsafe/config.in
index 6e321f3..b6d3ffe 100644
--- a/noncore/apps/zsafe/config.in
+++ b/noncore/apps/zsafe/config.in
@@ -1,5 +1,5 @@
1config ZSAFE 1config ZSAFE
2 boolean "zsafe (Zaurus Password Manager)" 2 boolean "zsafe (Zaurus Password Manager)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI
5 5
diff --git a/noncore/apps/zsafe/scqtfiledlg.cpp b/noncore/apps/zsafe/scqtfiledlg.cpp
index 52b8d0d..c67bbd5 100644
--- a/noncore/apps/zsafe/scqtfiledlg.cpp
+++ b/noncore/apps/zsafe/scqtfiledlg.cpp
@@ -1,16 +1,13 @@
1/****************************************************************************
2** Form implementation generated from reading ui file 'scqtfiledlg.ui'
3**
4** Created: Sun Jun 8 15:51:12 2003
5** by: The User Interface Compiler (uic)
6**
7** WARNING! All changes made in this file will be lost!
8****************************************************************************/
9#include "scqtfiledlg.h" 1#include "scqtfiledlg.h"
10 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */
11#include <qcombobox.h> 8#include <qcombobox.h>
12#include <qlineedit.h> 9#include <qlineedit.h>
13#include <qlistview.h> 10#include <qlistview.h>
14#include <qtoolbutton.h> 11#include <qtoolbutton.h>
15#include <qlayout.h> 12#include <qlayout.h>
16#include <qtooltip.h> 13#include <qtooltip.h>
@@ -213,44 +210,44 @@ ScQtFileDlg::~ScQtFileDlg()
213{ 210{
214 // no need to delete child widgets, Qt does it all for us 211 // no need to delete child widgets, Qt does it all for us
215} 212}
216 213
217void ScQtFileDlg::slotCancel() 214void ScQtFileDlg::slotCancel()
218{ 215{
219 qWarning( "ScQtFileDlg::slotCancel(): Not implemented yet!" ); 216 owarn << "ScQtFileDlg::slotCancel(): Not implemented yet!" << oendl;
220} 217}
221 218
222void ScQtFileDlg::slotDirComboBoxChanged( int ) 219void ScQtFileDlg::slotDirComboBoxChanged( int )
223{ 220{
224 qWarning( "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" ); 221 owarn << "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" << oendl;
225} 222}
226 223
227void ScQtFileDlg::slotDoubleClicked(QListViewItem *) 224void ScQtFileDlg::slotDoubleClicked(QListViewItem *)
228{ 225{
229 qWarning( "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" ); 226 owarn << "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" << oendl;
230} 227}
231 228
232void ScQtFileDlg::slotFileTextChanged( const QString & ) 229void ScQtFileDlg::slotFileTextChanged( const QString & )
233{ 230{
234 qWarning( "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" ); 231 owarn << "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" << oendl;
235} 232}
236 233
237void ScQtFileDlg::slotMkDir() 234void ScQtFileDlg::slotMkDir()
238{ 235{
239 qWarning( "ScQtFileDlg::slotMkDir(): Not implemented yet!" ); 236 owarn << "ScQtFileDlg::slotMkDir(): Not implemented yet!" << oendl;
240} 237}
241 238
242void ScQtFileDlg::slotOK() 239void ScQtFileDlg::slotOK()
243{ 240{
244 qWarning( "ScQtFileDlg::slotOK(): Not implemented yet!" ); 241 owarn << "ScQtFileDlg::slotOK(): Not implemented yet!" << oendl;
245} 242}
246 243
247void ScQtFileDlg::slotSelectionChanged(QListViewItem *) 244void ScQtFileDlg::slotSelectionChanged(QListViewItem *)
248{ 245{
249 qWarning( "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" ); 246 owarn << "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" << oendl;
250} 247}
251 248
252void ScQtFileDlg::slotTypeComboBoxChanged( int ) 249void ScQtFileDlg::slotTypeComboBoxChanged( int )
253{ 250{
254 qWarning( "ScQtFileDlg::slotTypeComboBoxChanged( int ): Not implemented yet!" ); 251 owarn << "ScQtFileDlg::slotTypeComboBoxChanged( int ): Not implemented yet!" << oendl;
255} 252}
256 253
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp
index 3df55eb..bf8f7f4 100644
--- a/noncore/apps/zsafe/zsafe.cpp
+++ b/noncore/apps/zsafe/zsafe.cpp
@@ -26,23 +26,22 @@
26#include "zlistview.h" 26#include "zlistview.h"
27#include "shadedlistitem.h" 27#include "shadedlistitem.h"
28 28
29#ifndef DESKTOP 29#ifndef DESKTOP
30#ifndef NO_OPIE 30#ifndef NO_OPIE
31#include <opie2/ofiledialog.h> 31#include <opie2/ofiledialog.h>
32 32#include <opie2/odebug.h>
33using namespace Opie::Core;
33using namespace Opie::Ui; 34using namespace Opie::Ui;
34#else 35#else
35#include "scqtfileedit.h" 36#include "scqtfileedit.h"
36#endif 37#endif
37#endif 38#endif
38 39
39#include <qclipboard.h> 40#include <qclipboard.h>
40 41
41#include <stdio.h>
42
43#include <sys/types.h> 42#include <sys/types.h>
44#include <sys/stat.h> 43#include <sys/stat.h>
45#include <fcntl.h> 44#include <fcntl.h>
46#include <stdlib.h> 45#include <stdlib.h>
47#ifndef WIN32 46#ifndef WIN32
48#include <unistd.h> 47#include <unistd.h>
@@ -2066,13 +2065,12 @@ int ZSafe::loadInit(const char* _filename, const char *password)
2066 keylength = j; 2065 keylength = j;
2067 krc2->rc2_expandkey (key, keylength, 128); 2066 krc2->rc2_expandkey (key, keylength, 128);
2068 2067
2069#ifndef WIN32 2068#ifndef WIN32
2070 size = read(fileno (fd), (unsigned char *) (charbuf + count), 8); 2069 size = read(fileno (fd), (unsigned char *) (charbuf + count), 8);
2071#else 2070#else
2072 printf ("LoadInit() read1");
2073 size = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd); 2071 size = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd);
2074#endif 2072#endif
2075 2073
2076 if (size < 8) 2074 if (size < 8)
2077 return PWERR_DATA; 2075 return PWERR_DATA;
2078 2076
@@ -2086,13 +2084,12 @@ int ZSafe::loadInit(const char* _filename, const char *password)
2086 bufferIndex = 0; 2084 bufferIndex = 0;
2087#ifndef WIN32 2085#ifndef WIN32
2088 while ((count = read (fileno (fd), (unsigned char *) charbuf, 8)) > 0) { 2086 while ((count = read (fileno (fd), (unsigned char *) charbuf, 8)) > 0) {
2089 while (count < 8) { 2087 while (count < 8) {
2090 count2 = read (fileno (fd), (unsigned char *) (charbuf + count), 8); 2088 count2 = read (fileno (fd), (unsigned char *) (charbuf + count), 8);
2091#else 2089#else
2092 printf ("LoadInit() read2");
2093 while ((count = fread ((unsigned char *) (charbuf), sizeof(unsigned char), 8, fd)) > 0) { 2090 while ((count = fread ((unsigned char *) (charbuf), sizeof(unsigned char), 8, fd)) > 0) {
2094 while (count < 8) { 2091 while (count < 8) {
2095 count2 = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd); 2092 count2 = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd);
2096#endif 2093#endif
2097 if (count2 == 0) { 2094 if (count2 == 0) {
2098 return PWERR_DATA; 2095 return PWERR_DATA;
@@ -2256,13 +2253,13 @@ bool ZSafe::saveDocument(const char* _filename,
2256 entry[i] = (char*)malloc(strlen("field6")+1); 2253 entry[i] = (char*)malloc(strlen("field6")+1);
2257 strcpy(entry[i++], "field6"); 2254 strcpy(entry[i++], "field6");
2258 2255
2259 retval = saveEntry(entry); 2256 retval = saveEntry(entry);
2260 for (int z=0; z<i; z++) free(entry[z]); 2257 for (int z=0; z<i; z++) free(entry[z]);
2261 if (retval == PWERR_DATA) { 2258 if (retval == PWERR_DATA) {
2262 qWarning("1: Error writing file, contents not saved"); 2259 owarn << "1: Error writing file, contents not saved" << oendl;
2263 saveFinalize(); 2260 saveFinalize();
2264 return false; 2261 return false;
2265 } 2262 }
2266// #ifndef WIN32 2263// #ifndef WIN32
2267 conf->writeEntry(APP_KEY+"valzsafe", 1); 2264 conf->writeEntry(APP_KEY+"valzsafe", 1);
2268// #endif 2265// #endif
@@ -2300,22 +2297,22 @@ bool ZSafe::saveDocument(const char* _filename,
2300 retval = saveEntry(entry); 2297 retval = saveEntry(entry);
2301 for (int z=0; z<j; z++) 2298 for (int z=0; z<j; z++)
2302 { 2299 {
2303 free(entry[z]); 2300 free(entry[z]);
2304 } 2301 }
2305 if (retval == PWERR_DATA) { 2302 if (retval == PWERR_DATA) {
2306 qWarning("1: Error writing file, contents not saved"); 2303 owarn << "1: Error writing file, contents not saved" << oendl;
2307 saveFinalize(); 2304 saveFinalize();
2308 return false; 2305 return false;
2309 } 2306 }
2310 2307
2311 } 2308 }
2312 } 2309 }
2313 2310
2314 if (saveFinalize() == PWERR_DATA) { 2311 if (saveFinalize() == PWERR_DATA) {
2315 qWarning("2: Error writing file, contents not saved"); 2312 owarn << "2: Error writing file, contents not saved" << oendl;
2316 return false; 2313 return false;
2317 } else { 2314 } else {
2318#ifndef DESKTOP 2315#ifndef DESKTOP
2319 Global::statusMessage (tr("Password file saved.")); 2316 Global::statusMessage (tr("Password file saved."));
2320#endif 2317#endif
2321 modified = false; 2318 modified = false;
@@ -3187,13 +3184,13 @@ void ZSafe::editCategory()
3187 3184
3188 category = dialog->CategoryField->currentText(); 3185 category = dialog->CategoryField->currentText();
3189 icon = dialog->IconField->currentText()+".png"; 3186 icon = dialog->IconField->currentText()+".png";
3190 3187
3191 if (cat) 3188 if (cat)
3192 { 3189 {
3193 qWarning("Category found"); 3190 owarn << "Category found" << oendl;
3194 3191
3195 // if (!icon.isEmpty() && !icon.isNull()) 3192 // if (!icon.isEmpty() && !icon.isNull())
3196 if (icon != "predefined.png") 3193 if (icon != "predefined.png")
3197 { 3194 {
3198 // build the full path 3195 // build the full path
3199 fullIconPath = iconPath + icon; 3196 fullIconPath = iconPath + icon;
diff --git a/noncore/apps/zsafe/zsafe.pro b/noncore/apps/zsafe/zsafe.pro
index 72c8fe9..3cae706 100644
--- a/noncore/apps/zsafe/zsafe.pro
+++ b/noncore/apps/zsafe/zsafe.pro
@@ -1,17 +1,17 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG = qt warn_on 2CONFIG = qt warn_on
3DESTDIR = $(OPIEDIR)/bin 3DESTDIR = $(OPIEDIR)/bin
4HEADERS = zsafe.h krc2.h category.h categorylist.h zlistview.h \ 4HEADERS = zsafe.h krc2.h category.h categorylist.h zlistview.h \
5 scqtfiledlg.h 5 scqtfiledlg.h
6SOURCES = main.cpp zsafe.cpp krc2.cpp category.cpp \ 6SOURCES = main.cpp zsafe.cpp krc2.cpp category.cpp \
7 categorylist.cpp zlistview.cpp shadedlistitem.cpp\ 7 categorylist.cpp zlistview.cpp shadedlistitem.cpp\
8 scqtfileedit.cpp scqtfileedit.moc.cpp \ 8 scqtfileedit.cpp scqtfileedit.moc.cpp \
9 scqtfiledlg.cpp 9 scqtfiledlg.cpp
10INTERFACES = newdialog.ui searchdialog.ui passworddialog.ui categorydialog.ui infoform.ui wait.ui 10INTERFACES = newdialog.ui searchdialog.ui passworddialog.ui categorydialog.ui infoform.ui wait.ui
11INCLUDEPATH += $(OPIEDIR)/include 11INCLUDEPATH += $(OPIEDIR)/include
12DEPENDPATH += $(OPIEDIR)/include 12DEPENDPATH += $(OPIEDIR)/include
13LIBS += -Wl,-rpath,$(OPIEDIR)/lib -L$(OPIEDIR)/lib -lqpe -lopiecore2 -lopieui2 13LIBS += -lqpe -lopiecore2 -lopieui2
14TARGET = zsafe 14TARGET = zsafe
15 15
16include ( $(OPIEDIR)/include.pro ) 16include ( $(OPIEDIR)/include.pro )
17 17
diff --git a/noncore/comm/keypebble/config.in b/noncore/comm/keypebble/config.in
index 20384aa..8a800b9 100644
--- a/noncore/comm/keypebble/config.in
+++ b/noncore/comm/keypebble/config.in
@@ -1,4 +1,4 @@
1 config KEYPEBBLE 1 config KEYPEBBLE
2 boolean "opie-keypebble (Virtual Network Computing VNC viewer)" 2 boolean "opie-keypebble (Virtual Network Computing VNC viewer)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/noncore/comm/keypebble/keypebble.pro b/noncore/comm/keypebble/keypebble.pro
index 3515016..7631e4e 100644
--- a/noncore/comm/keypebble/keypebble.pro
+++ b/noncore/comm/keypebble/keypebble.pro
@@ -1,7 +1,7 @@
1CONFIG += qt warn_on quick-app 1CONFIG += qt warn_on quick-app
2 HEADERS = d3des.h \ 2 HEADERS = d3des.h \
3 krfbbuffer.h \ 3 krfbbuffer.h \
4 krfbcanvas.h \ 4 krfbcanvas.h \
5 krfbconnection.h \ 5 krfbconnection.h \
6 krfbdecoder.h \ 6 krfbdecoder.h \
7 krfblogin.h \ 7 krfblogin.h \
@@ -20,16 +20,15 @@ SOURCES = d3des.c \
20 krfblogin.cpp \ 20 krfblogin.cpp \
21 krfbserver.cpp \ 21 krfbserver.cpp \
22 kvnc.cpp \ 22 kvnc.cpp \
23 kvncconndlg.cpp \ 23 kvncconndlg.cpp \
24 kvncbookmarkdlg.cpp \ 24 kvncbookmarkdlg.cpp \
25 main.cpp 25 main.cpp
26 INTERFACES= kvncconndlgbase.ui \ 26 INTERFACES= kvncconndlgbase.ui kvncbookmarkdlgbase.ui
27 kvncbookmarkdlgbase.ui
28 27
29INCLUDEPATH += $(OPIEDIR)/include 28INCLUDEPATH += $(OPIEDIR)/include
30DEPENDPATH += $(OPIEDIR)/include 29DEPENDPATH += $(OPIEDIR)/include
31LIBS += -lqpe 30LIBS += -lqpe -lopiecore2
32 31
33 TARGET = keypebble 32 TARGET = keypebble
34 33
35include ( $(OPIEDIR)/include.pro ) 34include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/comm/keypebble/krfbbuffer.cpp b/noncore/comm/keypebble/krfbbuffer.cpp
index 4cec0c2..4b29612 100644
--- a/noncore/comm/keypebble/krfbbuffer.cpp
+++ b/noncore/comm/keypebble/krfbbuffer.cpp
@@ -1,19 +1,27 @@
1#include <assert.h>
2#include <qimage.h>
3#include <qpainter.h>
4#include <qapplication.h>
5#include "krfbdecoder.h" 1#include "krfbdecoder.h"
6#include "krfbbuffer.h" 2#include "krfbbuffer.h"
7#include "krfbconnection.h" 3#include "krfbconnection.h"
8#include "krfbserverinfo.h" 4#include "krfbserverinfo.h"
9 5
6/* OPIE */
7#include <opie2/odebug.h>
8using namespace Opie::Core;
9
10/* QT */
11#include <qimage.h>
12#include <qpainter.h>
13#include <qapplication.h>
14
15/* STD */
16#include <assert.h>
17
10// 18//
11// Endian stuff 19// Endian stuff
12// 20//
13#ifndef KDE_USE_FINAL 21#ifndef OPIE_NO_DEBUG
14const int endianTest = 1; 22const int endianTest = 1;
15#endif 23#endif
16 24
17#define Swap16IfLE(s) \ 25#define Swap16IfLE(s) \
18 (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) 26 (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
19 27
@@ -36,13 +44,13 @@ KRFBBuffer::~KRFBBuffer()
36{ 44{
37 delete pix; 45 delete pix;
38} 46}
39 47
40void KRFBBuffer::resize( int w, int h ) 48void KRFBBuffer::resize( int w, int h )
41{ 49{
42 qWarning( "Resizing buffer" ); 50 owarn << "Resizing buffer" << oendl;
43 51
44 pix->resize( w, h ); 52 pix->resize( w, h );
45 53
46 QPalette pal = qApp->palette(); 54 QPalette pal = qApp->palette();
47 pix->fill( pal.active().base() ); 55 pix->fill( pal.active().base() );
48 56
@@ -58,26 +66,26 @@ void KRFBBuffer::mouseEvent( QMouseEvent *e )
58{ 66{
59 decoder->sendMouseEvent( e ); 67 decoder->sendMouseEvent( e );
60} 68}
61 69
62void KRFBBuffer::keyPressEvent( QKeyEvent *e ) 70void KRFBBuffer::keyPressEvent( QKeyEvent *e )
63{ 71{
64 qWarning( "Buffer got a key" ); 72 owarn << "Buffer got a key" << oendl;
65 73
66 decoder->sendKeyPressEvent( e ); 74 decoder->sendKeyPressEvent( e );
67} 75}
68 76
69void KRFBBuffer::keyReleaseEvent( QKeyEvent *e ) 77void KRFBBuffer::keyReleaseEvent( QKeyEvent *e )
70{ 78{
71 decoder->sendKeyReleaseEvent( e ); 79 decoder->sendKeyReleaseEvent( e );
72} 80}
73 81
74void KRFBBuffer::copyRect( int srcX, int srcY, 82void KRFBBuffer::copyRect( int srcX, int srcY,
75 int destX, int destY, int w, int h ) 83 int destX, int destY, int w, int h )
76{ 84{
77// qWarning( "Got copy rect" ); 85// owarn << "Got copy rect" << oendl;
78 bitBlt( pix, destX, destY, pix, srcX, srcY, w, h, CopyROP ); 86 bitBlt( pix, destX, destY, pix, srcX, srcY, w, h, CopyROP );
79 87
80 emit updated( destX, destY, w, h ); 88 emit updated( destX, destY, w, h );
81} 89}
82 90
83void KRFBBuffer::drawRawRectChunk( void *data, 91void KRFBBuffer::drawRawRectChunk( void *data,
diff --git a/noncore/comm/keypebble/krfbcanvas.cpp b/noncore/comm/keypebble/krfbcanvas.cpp
index cd1fda0..b3525df 100644
--- a/noncore/comm/keypebble/krfbcanvas.cpp
+++ b/noncore/comm/keypebble/krfbcanvas.cpp
@@ -1,12 +1,16 @@
1#include "krfbconnection.h" 1#include "krfbconnection.h"
2#include "krfbcanvas.h" 2#include "krfbcanvas.h"
3#include "krfbbuffer.h" 3#include "krfbbuffer.h"
4 4
5/* OPIE */
6#include <opie2/odebug.h>
5#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8using namespace Opie::Core;
6 9
10/* QT */
7#include <qclipboard.h> 11#include <qclipboard.h>
8 12
9KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name ) 13KRFBCanvas::KRFBCanvas( QWidget *parent, const char *name )
10 : QScrollView( parent, name ) 14 : QScrollView( parent, name )
11{ 15{
12 connection_ = new KRFBConnection(); 16 connection_ = new KRFBConnection();
@@ -39,13 +43,13 @@ void KRFBCanvas::openConnection(KRFBServer server)
39} 43}
40 44
41 45
42void KRFBCanvas::openURL( const QUrl &url ) 46void KRFBCanvas::openURL( const QUrl &url )
43{ 47{
44 if ( loggedIn_ ) { 48 if ( loggedIn_ ) {
45 qWarning( "openURL invoked when logged in\n" ); 49 owarn << "openURL invoked when logged in\n" << oendl;
46 return; 50 return;
47 } 51 }
48 52
49 QCString host = url.host().latin1(); 53 QCString host = url.host().latin1();
50 int display = url.port(); 54 int display = url.port();
51 55
@@ -71,13 +75,13 @@ void KRFBCanvas::bell()
71 topLevelWidget()->show(); 75 topLevelWidget()->show();
72 } 76 }
73} 77}
74 78
75void KRFBCanvas::loggedIn() 79void KRFBCanvas::loggedIn()
76{ 80{
77 qWarning( "Ok, we're logged in" ); 81 owarn << "Ok, we're logged in" << oendl;
78 82
79 // 83 //
80 // Get ready for action 84 // Get ready for action
81 // 85 //
82 loggedIn_ = true; 86 loggedIn_ = true;
83 viewport()->setMouseTracking( true ); 87 viewport()->setMouseTracking( true );
diff --git a/noncore/comm/keypebble/krfbconnection.cpp b/noncore/comm/keypebble/krfbconnection.cpp
index b447046..33e0563 100644
--- a/noncore/comm/keypebble/krfbconnection.cpp
+++ b/noncore/comm/keypebble/krfbconnection.cpp
@@ -1,16 +1,23 @@
1#include <assert.h>
2#include <qsocket.h>
3#include <qtimer.h>
4#include <string.h>
5
6#include "krfbconnection.h" 1#include "krfbconnection.h"
7#include "krfblogin.h" 2#include "krfblogin.h"
8#include "krfbdecoder.h" 3#include "krfbdecoder.h"
9#include "krfbbuffer.h" 4#include "krfbbuffer.h"
10 5
6/* OPIE */
7#include <opie2/odebug.h>
8using namespace Opie::Core;
9
10/* QT */
11#include <qsocket.h>
12#include <qtimer.h>
13
14/* STD */
15#include <assert.h>
16#include <string.h>
17
11KRFBConnection::KRFBConnection( QObject *parent ) 18KRFBConnection::KRFBConnection( QObject *parent )
12 : QObject( parent, "KRFBConnection" ) 19 : QObject( parent, "KRFBConnection" )
13{ 20{
14 portBase_ = 5900; 21 portBase_ = 5900;
15 currentState_ = Disconnected; 22 currentState_ = Disconnected;
16 sock = 0; 23 sock = 0;
@@ -40,21 +47,21 @@ void KRFBConnection::connectTo( KRFBServer server)
40 CHECK_PTR( sock ); 47 CHECK_PTR( sock );
41 48
42 // Connect to something to notice connection or error 49 // Connect to something to notice connection or error
43 connect( sock, SIGNAL( error(int) ), SLOT( gotSocketError(int) ) ); 50 connect( sock, SIGNAL( error(int) ), SLOT( gotSocketError(int) ) );
44 connect( sock, SIGNAL( connected() ), SLOT( gotSocketConnection() ) ); 51 connect( sock, SIGNAL( connected() ), SLOT( gotSocketConnection() ) );
45 52
46 qWarning( "Connecting..." ); 53 owarn << "Connecting..." << oendl;
47 54
48 currentState_ = Connecting; 55 currentState_ = Connecting;
49 sock->connectToHost( options_->hostname.latin1(), portBase_ + options_->display ); 56 sock->connectToHost( options_->hostname.latin1(), portBase_ + options_->display );
50} 57}
51 58
52void KRFBConnection::disconnect() 59void KRFBConnection::disconnect()
53{ 60{
54 qWarning( "Disconnecting from server" ); 61 owarn << "Disconnecting from server" << oendl;
55 62
56 if ( ( currentState_ != Disconnected ) 63 if ( ( currentState_ != Disconnected )
57 && ( currentState_ != Disconnecting ) 64 && ( currentState_ != Disconnecting )
58 && sock ) { 65 && sock ) {
59 currentState_ = Disconnecting; 66 currentState_ = Disconnecting;
60 67
@@ -79,24 +86,24 @@ void KRFBConnection::disconnectDone()
79} 86}
80 87
81void KRFBConnection::gotSocketConnection() 88void KRFBConnection::gotSocketConnection()
82{ 89{
83 currentState_ = LoggingIn; 90 currentState_ = LoggingIn;
84 91
85 qWarning( "Connected, logging in..." ); 92 owarn << "Connected, logging in..." << oendl;
86 93
87 static QString statusMsg = tr( "Connected" ); 94 static QString statusMsg = tr( "Connected" );
88 emit statusChanged( statusMsg ); 95 emit statusChanged( statusMsg );
89 96
90 // Do some login stuff 97 // Do some login stuff
91 login = new KRFBLogin( this ); 98 login = new KRFBLogin( this );
92} 99}
93 100
94void KRFBConnection::gotRFBConnection() 101void KRFBConnection::gotRFBConnection()
95{ 102{
96 qWarning( "Logged into server" ); 103 owarn << "Logged into server" << oendl;
97 104
98 currentState_ = Connected; 105 currentState_ = Connected;
99 emit connected(); 106 emit connected();
100 107
101 // Create the decoder and start doing stuff 108 // Create the decoder and start doing stuff
102 decoder_ = new KRFBDecoder( this ); 109 decoder_ = new KRFBDecoder( this );
@@ -119,13 +126,13 @@ void KRFBConnection::gotRFBConnection()
119 126
120void KRFBConnection::gotSocketError( int err ) 127void KRFBConnection::gotSocketError( int err )
121{ 128{
122 currentState_ = Error; 129 currentState_ = Error;
123 130
124 // Do some error handling stuff 131 // Do some error handling stuff
125 qWarning( "KRFBConnection: Socket error %d", err ); 132 owarn << "KRFBConnection: Socket error " << err << "" << oendl;
126 133
127 static QString refused = tr( "Connection Refused" ); 134 static QString refused = tr( "Connection Refused" );
128 static QString host = tr( "Host not found" ); 135 static QString host = tr( "Host not found" );
129 static QString read = tr( "Read Error: QSocket reported an error reading\n" 136 static QString read = tr( "Read Error: QSocket reported an error reading\n"
130 "data, the remote host has probably dropped the\n" 137 "data, the remote host has probably dropped the\n"
131 "connection." ); 138 "connection." );
@@ -169,17 +176,17 @@ void KRFBConnection::waitForData( unsigned int sz )
169{ 176{
170 assert( minData_ == 0 ); 177 assert( minData_ == 0 );
171 assert( sz > 0 ); 178 assert( sz > 0 );
172 assert( currentState_ != Error ); 179 assert( currentState_ != Error );
173 180
174 if ( sock->size() >= sz ) { 181 if ( sock->size() >= sz ) {
175 // qWarning( "No need to wait for data" ); 182 // owarn << "No need to wait for data" << oendl;
176 emit gotEnoughData(); 183 emit gotEnoughData();
177 } 184 }
178 else { 185 else {
179 // qWarning( "Waiting for %u bytes", sz ); 186 // owarn << "Waiting for " << sz << " bytes" << oendl;
180 minData_ = sz; 187 minData_ = sz;
181 connect( sock, SIGNAL( readyRead() ), SLOT( gotMoreData() ) ); 188 connect( sock, SIGNAL( readyRead() ), SLOT( gotMoreData() ) );
182 } 189 }
183} 190}
184 191
185int KRFBConnection::read( void *buf, int sz ) 192int KRFBConnection::read( void *buf, int sz )
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp
index db95154..69457e2 100644
--- a/noncore/comm/keypebble/krfbdecoder.cpp
+++ b/noncore/comm/keypebble/krfbdecoder.cpp
@@ -1,20 +1,25 @@
1#include "krfbconnection.h" 1#include "krfbconnection.h"
2#include "krfbserverinfo.h" 2#include "krfbserverinfo.h"
3#include "krfbdecoder.h" 3#include "krfbdecoder.h"
4#include "krfbbuffer.h" 4#include "krfbbuffer.h"
5 5
6/* OPIE */
7#include <opie2/odebug.h>
8using namespace Opie::Core;
6 9
10/* QT */
7#include <qpixmap.h> 11#include <qpixmap.h>
8 12
13/* STD */
9#include <assert.h> 14#include <assert.h>
10 15
11// 16//
12// Endian stuff 17// Endian stuff
13// 18//
14#ifndef KDE_USE_FINAL 19#ifndef OPIE_NO_DEBUG
15const int endianTest = 1; 20const int endianTest = 1;
16#endif 21#endif
17 22
18#define Swap16IfLE(s) \ 23#define Swap16IfLE(s) \
19 (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s)) 24 (*(char *)&endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
20 25
@@ -132,25 +137,25 @@ void KRFBDecoder::start()
132 137
133void KRFBDecoder::sendClientInit() 138void KRFBDecoder::sendClientInit()
134{ 139{
135 con->write( &( con->options()->shared ), 1 ); 140 con->write( &( con->options()->shared ), 1 );
136 141
137 // Wait for server init 142 // Wait for server init
138 qWarning( "Waiting for server init" ); 143 owarn << "Waiting for server init" << oendl;
139 144
140 static QString statusMsg = tr( "Waiting for server initialization..." ); 145 static QString statusMsg = tr( "Waiting for server initialization..." );
141 emit status( statusMsg ); 146 emit status( statusMsg );
142 147
143 currentState = AwaitingServerInit; 148 currentState = AwaitingServerInit;
144 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerInit() ) ); 149 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerInit() ) );
145 con->waitForData( ServerInitLength ); 150 con->waitForData( ServerInitLength );
146} 151}
147 152
148void KRFBDecoder::gotServerInit() 153void KRFBDecoder::gotServerInit()
149{ 154{
150 qWarning( "Got server init" ); 155 owarn << "Got server init" << oendl;
151 disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) ); 156 disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) );
152 157
153 if ( info ) 158 if ( info )
154 delete info; 159 delete info;
155 info = new KRFBServerInfo; 160 info = new KRFBServerInfo;
156 CHECK_PTR( info ); 161 CHECK_PTR( info );
@@ -178,24 +183,24 @@ void KRFBDecoder::gotServerInit()
178 183
179 con->read( info->padding, 3 ); 184 con->read( info->padding, 3 );
180 185
181 con->read( &(info->nameLength), 4 ); 186 con->read( &(info->nameLength), 4 );
182 info->nameLength = Swap32IfLE( info->nameLength ); 187 info->nameLength = Swap32IfLE( info->nameLength );
183 188
184 qWarning( "Width = %d, Height = %d", info->width, info->height ); 189 owarn << "Width = " << info->width << ", Height = " << info->height << "" << oendl;
185 qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", 190 qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d",
186 info->bpp, info->depth, info->bigEndian, info->trueColor ); 191 info->bpp, info->depth, info->bigEndian, info->trueColor );
187 qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d", 192 qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d",
188 info->redMax, info->greenMax, info->blueMax ); 193 info->redMax, info->greenMax, info->blueMax );
189 qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d", 194 qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d",
190 info->redShift, info->greenShift,info-> blueShift ); 195 info->redShift, info->greenShift,info-> blueShift );
191 196
192 buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor); 197 buf->resize( info->width/con->options()->scaleFactor, info->height /con->options()->scaleFactor);
193 198
194 // Wait for desktop name 199 // Wait for desktop name
195 qWarning( "Waiting for desktop name" ); 200 owarn << "Waiting for desktop name" << oendl;
196 201
197 static QString statusMsg = tr( "Waiting for desktop name..." ); 202 static QString statusMsg = tr( "Waiting for desktop name..." );
198 emit status( statusMsg ); 203 emit status( statusMsg );
199 204
200 currentState = AwaitingDesktopName; 205 currentState = AwaitingDesktopName;
201 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) ); 206 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotDesktopName() ) );
@@ -204,25 +209,25 @@ void KRFBDecoder::gotServerInit()
204 209
205void KRFBDecoder::gotDesktopName() 210void KRFBDecoder::gotDesktopName()
206{ 211{
207 assert( info ); 212 assert( info );
208 assert( currentState == AwaitingDesktopName ); 213 assert( currentState == AwaitingDesktopName );
209 214
210 qWarning( "Got desktop name" ); 215 owarn << "Got desktop name" << oendl;
211 216
212 disconnect( con, SIGNAL( gotEnoughData() ), 217 disconnect( con, SIGNAL( gotEnoughData() ),
213 this, SLOT( gotDesktopName() ) ); 218 this, SLOT( gotDesktopName() ) );
214 219
215 char *buf = new char[ info->nameLength + 1 ]; 220 char *buf = new char[ info->nameLength + 1 ];
216 CHECK_PTR( buf ); 221 CHECK_PTR( buf );
217 222
218 con->read( buf, info->nameLength ); 223 con->read( buf, info->nameLength );
219 buf[ info->nameLength ] = '\0'; 224 buf[ info->nameLength ] = '\0';
220 info->name = buf; 225 info->name = buf;
221 226
222 qWarning( "Desktop: %s", info->name.latin1() ); 227 owarn << "Desktop: " << info->name.latin1() << "" << oendl;
223 228
224 delete buf; 229 delete buf;
225 230
226 // Get the format we'll really use and tell the server 231 // Get the format we'll really use and tell the server
227 decidePixelFormat(); 232 decidePixelFormat();
228 sendPixelFormat(); 233 sendPixelFormat();
@@ -368,13 +373,13 @@ void KRFBDecoder::sendUpdateRequest( bool incremental )
368} 373}
369 374
370void KRFBDecoder::gotUpdateHeader() 375void KRFBDecoder::gotUpdateHeader()
371{ 376{
372 assert( currentState == AwaitingUpdate ); 377 assert( currentState == AwaitingUpdate );
373 378
374 // qWarning( "Got update header" ); 379 // owarn << "Got update header" << oendl;
375 380
376 disconnect( con, SIGNAL( gotEnoughData() ), 381 disconnect( con, SIGNAL( gotEnoughData() ),
377 this, SLOT( gotUpdateHeader() ) ); 382 this, SLOT( gotUpdateHeader() ) );
378 383
379 CARD8 msgType; 384 CARD8 msgType;
380 con->read( &msgType, 1 ); 385 con->read( &msgType, 1 );
@@ -403,25 +408,25 @@ void KRFBDecoder::gotUpdateHeader()
403 CARD8 padding; 408 CARD8 padding;
404 con->read( &padding, 1 ); 409 con->read( &padding, 1 );
405 410
406 con->read( &noRects, 2 ); 411 con->read( &noRects, 2 );
407 noRects = Swap16IfLE( noRects ); 412 noRects = Swap16IfLE( noRects );
408 413
409 // qWarning( "Expecting %d rects", noRects ); 414 // owarn << "Expecting " << noRects << " rects" << oendl;
410 415
411 // Now wait for the data 416 // Now wait for the data
412 currentState = AwaitingRectHeader; 417 currentState = AwaitingRectHeader;
413 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) ); 418 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) );
414 con->waitForData( RectHeaderLength ); 419 con->waitForData( RectHeaderLength );
415} 420}
416 421
417void KRFBDecoder::gotRectHeader() 422void KRFBDecoder::gotRectHeader()
418{ 423{
419 assert( currentState == AwaitingRectHeader ); 424 assert( currentState == AwaitingRectHeader );
420 425
421 // qWarning( "Got rect header" ); 426 // owarn << "Got rect header" << oendl;
422 427
423 disconnect( con, SIGNAL( gotEnoughData() ), 428 disconnect( con, SIGNAL( gotEnoughData() ),
424 this, SLOT( gotRectHeader() ) ); 429 this, SLOT( gotRectHeader() ) );
425 430
426 con->read( &x, 2 ); 431 con->read( &x, 2 );
427 x = Swap16IfLE( x ); 432 x = Swap16IfLE( x );
@@ -443,37 +448,37 @@ void KRFBDecoder::gotRectHeader()
443 // Each encoding needs to be handled differently. Some require 448 // Each encoding needs to be handled differently. Some require
444 // waiting for more data, but others like a copyrect do not. 449 // waiting for more data, but others like a copyrect do not.
445 // Our constants have already been byte swapped, so we use 450 // Our constants have already been byte swapped, so we use
446 // the remote value as is. 451 // the remote value as is.
447 // 452 //
448 if ( encoding == RawEncoding ) { 453 if ( encoding == RawEncoding ) {
449 // qWarning( "Raw encoding" ); 454 // owarn << "Raw encoding" << oendl;
450 handleRawRect(); 455 handleRawRect();
451 } 456 }
452 else if ( encoding == CopyRectEncoding ) { 457 else if ( encoding == CopyRectEncoding ) {
453// qWarning( "CopyRect encoding" ); 458// owarn << "CopyRect encoding" << oendl;
454 handleCopyRect(); 459 handleCopyRect();
455 } 460 }
456 else if ( encoding == RreEncoding ) { 461 else if ( encoding == RreEncoding ) {
457 qWarning( "RRE encoding" ); 462 owarn << "RRE encoding" << oendl;
458 handleRRERect(); 463 handleRRERect();
459 } 464 }
460 else if ( encoding == CorreEncoding ) { 465 else if ( encoding == CorreEncoding ) {
461 qWarning( "CoRRE encoding" ); 466 owarn << "CoRRE encoding" << oendl;
462 handleCoRRERect(); 467 handleCoRRERect();
463 } 468 }
464 else if ( encoding == HexTileEncoding ) { 469 else if ( encoding == HexTileEncoding ) {
465 qWarning( "HexTile encoding" ); 470 owarn << "HexTile encoding" << oendl;
466 handleHexTileRect(); 471 handleHexTileRect();
467 } 472 }
468 else { 473 else {
469 int msg = Swap32IfLE( encoding ); 474 int msg = Swap32IfLE( encoding );
470 QString protocolError = tr( "Protocol Error: An unknown encoding was " 475 QString protocolError = tr( "Protocol Error: An unknown encoding was "
471 "used by the server %1" ).arg( msg ); 476 "used by the server %1" ).arg( msg );
472 currentState = Error; 477 currentState = Error;
473 qWarning( "Unknown encoding, %d", msg ); 478 owarn << "Unknown encoding, " << msg << "" << oendl;
474 emit error( protocolError ); 479 emit error( protocolError );
475 return; 480 return;
476 } 481 }
477} 482}
478 483
479// 484//
@@ -483,13 +488,13 @@ void KRFBDecoder::gotRectHeader()
483void KRFBDecoder::handleRawRect() 488void KRFBDecoder::handleRawRect()
484{ 489{
485 // We need something a bit cleverer here to handle large 490 // We need something a bit cleverer here to handle large
486 // rectanges nicely. The chunking should be based on the 491 // rectanges nicely. The chunking should be based on the
487 // overall size (but has to be in complete lines). 492 // overall size (but has to be in complete lines).
488 493
489 // qWarning( "Handling a raw rect chunk" ); 494 // owarn << "Handling a raw rect chunk" << oendl;
490 495
491 // CARD32 lineCount = w * format->bpp / 8; 496 // CARD32 lineCount = w * format->bpp / 8;
492 497
493 if ( h > RectChunkSize ) { 498 if ( h > RectChunkSize ) {
494 // if ( con->sock->size() / lineCount ) { 499 // if ( con->sock->size() / lineCount ) {
495 // getRawRectChunk( con->sock->size() / lineCount ); 500 // getRawRectChunk( con->sock->size() / lineCount );
@@ -506,13 +511,13 @@ void KRFBDecoder::handleRawRect()
506void KRFBDecoder::getRawRectChunk( int lines ) 511void KRFBDecoder::getRawRectChunk( int lines )
507{ 512{
508 this->lines = lines; 513 this->lines = lines;
509 CARD32 count = lines * w * format->bpp / 8; 514 CARD32 count = lines * w * format->bpp / 8;
510 515
511 // Wait for server init 516 // Wait for server init
512 // qWarning( "Waiting for raw rect chunk, %ld", count ); 517 // owarn << "Waiting for raw rect chunk, " << count << "" << oendl;
513 518
514 currentState = AwaitingRawRectChunk; 519 currentState = AwaitingRawRectChunk;
515 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRawRectChunk() ) ); 520 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRawRectChunk() ) );
516 con->waitForData( count ); 521 con->waitForData( count );
517} 522}
518 523
@@ -520,13 +525,13 @@ void KRFBDecoder::gotRawRectChunk()
520{ 525{
521 assert( currentState == AwaitingRawRectChunk ); 526 assert( currentState == AwaitingRawRectChunk );
522 527
523 disconnect( con, SIGNAL( gotEnoughData() ), 528 disconnect( con, SIGNAL( gotEnoughData() ),
524 this, SLOT( gotRawRectChunk() ) ); 529 this, SLOT( gotRawRectChunk() ) );
525 530
526 // qWarning( "Got raw rect chunk" ); 531 // owarn << "Got raw rect chunk" << oendl;
527 532
528 // 533 //
529 // Read the rect data and copy it to the buffer. 534 // Read the rect data and copy it to the buffer.
530 // 535 //
531 536
532 // TODO: Replace this! 537 // TODO: Replace this!
@@ -543,13 +548,13 @@ void KRFBDecoder::gotRawRectChunk()
543 if ( h > 0 ) { 548 if ( h > 0 ) {
544 handleRawRect(); 549 handleRawRect();
545 } 550 }
546 else { 551 else {
547 noRects--; 552 noRects--;
548 553
549 // qWarning( "There are %d rects left", noRects ); 554 // owarn << "There are " << noRects << " rects left" << oendl;
550 555
551 if ( noRects ) { 556 if ( noRects ) {
552 currentState = AwaitingRectHeader; 557 currentState = AwaitingRectHeader;
553 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) ); 558 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) );
554 con->waitForData( RectHeaderLength ); 559 con->waitForData( RectHeaderLength );
555 } 560 }
@@ -587,36 +592,36 @@ void KRFBDecoder::gotCopyRectPos()
587 srcY = Swap16IfLE( srcY ); 592 srcY = Swap16IfLE( srcY );
588 593
589 buf->copyRect( srcX, srcY, x, y, w, h ); 594 buf->copyRect( srcX, srcY, x, y, w, h );
590 595
591 noRects--; 596 noRects--;
592 597
593 // qWarning( "There are %d rects left", noRects ); 598 // owarn << "There are " << noRects << " rects left" << oendl;
594 599
595 if ( noRects ) { 600 if ( noRects ) {
596 currentState = AwaitingRectHeader; 601 currentState = AwaitingRectHeader;
597 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) ); 602 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotRectHeader() ) );
598 con->waitForData( RectHeaderLength ); 603 con->waitForData( RectHeaderLength );
599 } 604 }
600 else 605 else
601 currentState = Idle; 606 currentState = Idle;
602} 607}
603 608
604void KRFBDecoder::handleRRERect() 609void KRFBDecoder::handleRRERect()
605{ 610{
606 qWarning( "RRE not implemented" ); 611 owarn << "RRE not implemented" << oendl;
607} 612}
608 613
609void KRFBDecoder::handleCoRRERect() 614void KRFBDecoder::handleCoRRERect()
610{ 615{
611 qWarning( "CoRRE not implemented" ); 616 owarn << "CoRRE not implemented" << oendl;
612} 617}
613 618
614void KRFBDecoder::handleHexTileRect() 619void KRFBDecoder::handleHexTileRect()
615{ 620{
616 qWarning( "HexTile not implemented" ); 621 owarn << "HexTile not implemented" << oendl;
617} 622}
618 623
619void KRFBDecoder::sendMouseEvent( QMouseEvent *e ) 624void KRFBDecoder::sendMouseEvent( QMouseEvent *e )
620{ 625{
621 // Deal with the buttons 626 // Deal with the buttons
622 if ( e->type() != QEvent::MouseMove ) { 627 if ( e->type() != QEvent::MouseMove ) {
@@ -670,13 +675,13 @@ void KRFBDecoder::sendCutEvent( const QString &unicode )
670 con->write( &length, 4 ); 675 con->write( &length, 4 );
671 con->write( text.data(), length ); 676 con->write( text.data(), length );
672} 677}
673 678
674void KRFBDecoder::gotServerCut() 679void KRFBDecoder::gotServerCut()
675{ 680{
676 qWarning( "Got server cut" ); 681 owarn << "Got server cut" << oendl;
677 682
678 currentState = AwaitingServerCutLength; 683 currentState = AwaitingServerCutLength;
679 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerCutLength() ) ); 684 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerCutLength() ) );
680 con->waitForData( ServerCutLenLength ); 685 con->waitForData( ServerCutLenLength );
681} 686}
682 687
@@ -718,13 +723,13 @@ void KRFBDecoder::gotServerCutText()
718 723
719 con->read( cutbuf, serverCutTextLen ); 724 con->read( cutbuf, serverCutTextLen );
720 cutbuf[ serverCutTextLen ] = '\0'; 725 cutbuf[ serverCutTextLen ] = '\0';
721 726
722 /* For some reason QApplication::clipboard()->setText() segfaults when called 727 /* For some reason QApplication::clipboard()->setText() segfaults when called
723 * from within keypebble's mass of signals and slots 728 * from within keypebble's mass of signals and slots
724 qWarning( "Server cut: %s", cutbuf ); 729 owarn << "Server cut: " << cutbuf << "" << oendl;
725 730
726 QString cutText( cutbuf ); // DANGER!! 731 QString cutText( cutbuf ); // DANGER!!
727 qApp->clipboard()->setText( cutText ); 732 qApp->clipboard()->setText( cutText );
728 */ 733 */
729 734
730 delete cutbuf; 735 delete cutbuf;
@@ -735,33 +740,33 @@ void KRFBDecoder::gotServerCutText()
735 con->waitForData( UpdateHeaderLength ); 740 con->waitForData( UpdateHeaderLength );
736 } 741 }
737 else if ( oldState == Idle ) { 742 else if ( oldState == Idle ) {
738 currentState = Idle; 743 currentState = Idle;
739 } 744 }
740 else { 745 else {
741 qWarning( "Async handled in weird state" ); 746 owarn << "Async handled in weird state" << oendl;
742 currentState = oldState; 747 currentState = oldState;
743 }; 748 };
744} 749}
745 750
746void KRFBDecoder::gotBell() 751void KRFBDecoder::gotBell()
747{ 752{
748 qWarning( "Got server bell" ); 753 owarn << "Got server bell" << oendl;
749 buf->soundBell(); 754 buf->soundBell();
750 755
751 // Now wait for the update (again) 756 // Now wait for the update (again)
752 if ( oldState == AwaitingUpdate ) { 757 if ( oldState == AwaitingUpdate ) {
753 currentState = AwaitingUpdate; 758 currentState = AwaitingUpdate;
754 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) ); 759 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) );
755 con->waitForData( UpdateHeaderLength ); 760 con->waitForData( UpdateHeaderLength );
756 } 761 }
757 else if ( oldState == Idle ) { 762 else if ( oldState == Idle ) {
758 currentState = Idle; 763 currentState = Idle;
759 } 764 }
760 else { 765 else {
761 qWarning( "Async handled in weird state" ); 766 owarn << "Async handled in weird state" << oendl;
762 currentState = oldState; 767 currentState = oldState;
763 }; 768 };
764} 769}
765 770
766void KRFBDecoder::sendKeyPressEvent( QKeyEvent *event ) 771void KRFBDecoder::sendKeyPressEvent( QKeyEvent *event )
767{ 772{
diff --git a/noncore/comm/keypebble/krfblogin.cpp b/noncore/comm/keypebble/krfblogin.cpp
index 2bbd110..92005d2 100644
--- a/noncore/comm/keypebble/krfblogin.cpp
+++ b/noncore/comm/keypebble/krfblogin.cpp
@@ -1,17 +1,22 @@
1#include <assert.h> 1#include "krfblogin.h"
2#include "krfbconnection.h"
2 3
4/* OPIE */
5#include <opie2/odebug.h>
6using namespace Opie::Core;
7
8/* QT */
9#include <qtimer.h>
3 10
11/* STD */
12#include <assert.h>
4extern "C" { 13extern "C" {
5#include "vncauth.h" 14#include "vncauth.h"
6} 15}
7 16
8#include "krfblogin.h"
9#include "krfbconnection.h"
10#include <qtimer.h>
11
12// The length of the various messages (used to decide how many bytes to 17// The length of the various messages (used to decide how many bytes to
13// wait for). 18// wait for).
14const int ServerVersionLength = 12; 19const int ServerVersionLength = 12;
15const int ClientVersionLength = 12; 20const int ClientVersionLength = 12;
16const int AuthSchemeLength = 4; 21const int AuthSchemeLength = 4;
17const int FailureReasonSizeLength = 4; 22const int FailureReasonSizeLength = 4;
@@ -49,13 +54,13 @@ KRFBLogin::KRFBLogin( KRFBConnection *con )
49 currentState = AwaitingServerVersion; 54 currentState = AwaitingServerVersion;
50 55
51 connect( this, SIGNAL( error(const QString&) ), 56 connect( this, SIGNAL( error(const QString&) ),
52 con, SIGNAL( error(const QString&) ) ); 57 con, SIGNAL( error(const QString&) ) );
53 58
54 59
55 qWarning( "Waiting for server version..." ); 60 owarn << "Waiting for server version..." << oendl;
56 61
57 static QString statusMsg = tr( "Waiting for server version..." ); 62 static QString statusMsg = tr( "Waiting for server version..." );
58 emit status( statusMsg ); 63 emit status( statusMsg );
59 64
60 // Kick off the state machine 65 // Kick off the state machine
61 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerVersion() ) ); 66 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerVersion() ) );
@@ -71,13 +76,13 @@ KRFBLogin::State KRFBLogin::state() const
71{ 76{
72 return currentState; 77 return currentState;
73} 78}
74 79
75void KRFBLogin::gotServerVersion() 80void KRFBLogin::gotServerVersion()
76{ 81{
77 qWarning( "Got server version" ); 82 owarn << "Got server version" << oendl;
78 83
79 disconnect( con, SIGNAL( gotEnoughData() ), 84 disconnect( con, SIGNAL( gotEnoughData() ),
80 this, SLOT( gotServerVersion() ) ); 85 this, SLOT( gotServerVersion() ) );
81 86
82 // Read the server's version message 87 // Read the server's version message
83 char serverVersion[ ServerVersionLength + 1 ]; 88 char serverVersion[ ServerVersionLength + 1 ];
@@ -89,13 +94,13 @@ void KRFBLogin::gotServerVersion()
89 94
90 QRegExp regexp( "RFB [0-9][0-9][0-9]\\.[0-9][0-9][0-9]\n" ); 95 QRegExp regexp( "RFB [0-9][0-9][0-9]\\.[0-9][0-9][0-9]\n" );
91 96
92 if ( rfbString.find( regexp ) == -1 ) { 97 if ( rfbString.find( regexp ) == -1 ) {
93 static QString msg = tr( "Error: Invalid server version, %1" ).arg( rfbString ); 98 static QString msg = tr( "Error: Invalid server version, %1" ).arg( rfbString );
94 99
95 qWarning( msg ); 100 owarn << msg << oendl;
96 emit error( msg ); 101 emit error( msg );
97 currentState = Error; 102 currentState = Error;
98 return; 103 return;
99 } 104 }
100 105
101 // Calculate the actual version number 106 // Calculate the actual version number
@@ -103,26 +108,26 @@ void KRFBLogin::gotServerVersion()
103 + (serverVersion[5] - '0') * 10 108 + (serverVersion[5] - '0') * 10
104 + (serverVersion[6] - '0'); 109 + (serverVersion[6] - '0');
105 serverMinor = (serverVersion[8] - '0') * 100 110 serverMinor = (serverVersion[8] - '0') * 100
106 + (serverVersion[9] - '0') * 10 111 + (serverVersion[9] - '0') * 10
107 + (serverVersion[10] - '0'); 112 + (serverVersion[10] - '0');
108 113
109 qWarning("Server Version: %03d.%03d", serverMajor, serverMinor ); 114 owarn << "Server Version: " << serverMajor << "." << serverMinor << "" << oendl;
110 115
111 if ( serverMajor != 3 ) { 116 if ( serverMajor != 3 ) {
112 QString msg = tr( "Error: Unsupported server version, %1" ) 117 QString msg = tr( "Error: Unsupported server version, %1" )
113 .arg( rfbString ); 118 .arg( rfbString );
114 119
115 qWarning( msg ); 120 owarn << msg << oendl;
116 emit error( msg ); 121 emit error( msg );
117 currentState = Error; 122 currentState = Error;
118 return; 123 return;
119 } 124 }
120 125
121 if ( serverMinor != 3 ) { 126 if ( serverMinor != 3 ) {
122 qWarning( "Minor version mismatch: %d", serverMinor ); 127 owarn << "Minor version mismatch: " << serverMinor << "" << oendl;
123 } 128 }
124 129
125 // Setup for the next state 130 // Setup for the next state
126 sendClientVersion(); 131 sendClientVersion();
127 132
128 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotAuthScheme() ) ); 133 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotAuthScheme() ) );
@@ -140,13 +145,13 @@ void KRFBLogin::gotAuthScheme()
140 scheme = Swap32IfLE( scheme ); 145 scheme = Swap32IfLE( scheme );
141 146
142 static QString statusMsgOk = tr( "Logged in" ); 147 static QString statusMsgOk = tr( "Logged in" );
143 148
144 switch ( scheme ) { 149 switch ( scheme ) {
145 case 0: 150 case 0:
146 qWarning( "Failed" ); 151 owarn << "Failed" << oendl;
147 // Handle failure 152 // Handle failure
148 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotFailureReasonSize() ) ); 153 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotFailureReasonSize() ) );
149 con->waitForData( FailureReasonSizeLength ); 154 con->waitForData( FailureReasonSizeLength );
150 break; 155 break;
151 case 1: 156 case 1:
152 // Handle no auth 157 // Handle no auth
@@ -156,13 +161,13 @@ void KRFBLogin::gotAuthScheme()
156 case 2: 161 case 2:
157 // Handle VNC auth 162 // Handle VNC auth
158 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotChallenge() ) ); 163 connect( con, SIGNAL( gotEnoughData() ), SLOT( gotChallenge() ) );
159 con->waitForData( ChallengeLength ); 164 con->waitForData( ChallengeLength );
160 break; 165 break;
161 default: 166 default:
162 qWarning( "Unknown authentication scheme, 0x%08lx", scheme ); 167 owarn << "Unknown authentication scheme, 0x" << scheme << "" << oendl;
163 currentState = Error; 168 currentState = Error;
164 break; 169 break;
165 }; 170 };
166} 171}
167 172
168void KRFBLogin::gotChallenge() 173void KRFBLogin::gotChallenge()
@@ -178,13 +183,13 @@ void KRFBLogin::getPassword()
178 // Got data 183 // Got data
179 CARD8 challenge[ ChallengeLength ]; 184 CARD8 challenge[ ChallengeLength ];
180 con->read( challenge, ChallengeLength ); 185 con->read( challenge, ChallengeLength );
181 186
182 // Last chance to enter a password 187 // Last chance to enter a password
183 if ( con->options_->password.isNull() ) { 188 if ( con->options_->password.isNull() ) {
184 qWarning( "krfblogin needs a password" ); 189 owarn << "krfblogin needs a password" << oendl;
185 emit passwordRequired( con ); 190 emit passwordRequired( con );
186 } 191 }
187 192
188 if ( con->options_->password.isNull() ) { 193 if ( con->options_->password.isNull() ) {
189 QString msg = tr( "Error: This server requires a password, but none " 194 QString msg = tr( "Error: This server requires a password, but none "
190 "has been specified.\n" ); 195 "has been specified.\n" );
@@ -213,13 +218,13 @@ void KRFBLogin::gotAuthResult()
213 SLOT( gotAuthResult() ) ); 218 SLOT( gotAuthResult() ) );
214 219
215 long result; 220 long result;
216 con->read( &result, AuthResultLength ); 221 con->read( &result, AuthResultLength );
217 result = Swap32IfLE( result ); 222 result = Swap32IfLE( result );
218 223
219 qWarning( "Authentication Result is 0x%08lx", result ); 224 owarn << "Authentication Result is 0x" << result << "" << oendl;
220 225
221 static QString failed = tr( "Error: The password you specified was incorrect." ); 226 static QString failed = tr( "Error: The password you specified was incorrect." );
222 static QString tooMany = tr( "Error: Too many invalid login attempts have been made\n" 227 static QString tooMany = tr( "Error: Too many invalid login attempts have been made\n"
223 "to this account, please try later." ); 228 "to this account, please try later." );
224 229
225 static QString statusMsgOk = tr( "Logged in" ); 230 static QString statusMsgOk = tr( "Logged in" );
@@ -229,25 +234,25 @@ void KRFBLogin::gotAuthResult()
229 switch( result ) { 234 switch( result ) {
230 case AuthOk: 235 case AuthOk:
231 emit status( statusMsgOk ); 236 emit status( statusMsgOk );
232 con->gotRFBConnection(); 237 con->gotRFBConnection();
233 break; 238 break;
234 case AuthFailed: 239 case AuthFailed:
235 qWarning( "Dammit" ); 240 owarn << "Dammit" << oendl;
236 emit status( statusMsgFailed ); 241 emit status( statusMsgFailed );
237 emit error( failed ); 242 emit error( failed );
238 break; 243 break;
239 case AuthTooMany: 244 case AuthTooMany:
240 emit status( statusMsgTooMany ); 245 emit status( statusMsgTooMany );
241 emit error( tooMany ); 246 emit error( tooMany );
242 break; 247 break;
243 default: 248 default:
244 qWarning( "Invalid authentication result, %lx", result ); 249 owarn << "Invalid authentication result, " << result << "" << oendl;
245 break; 250 break;
246 } 251 }
247} 252}
248 253
249void KRFBLogin::sendClientVersion() 254void KRFBLogin::sendClientVersion()
250{ 255{
251 qWarning( "Sending client version" ); 256 owarn << "Sending client version" << oendl;
252 con->write( (void*)"RFB 003.003\n", ClientVersionLength ); 257 con->write( (void*)"RFB 003.003\n", ClientVersionLength );
253} 258}
diff --git a/noncore/comm/keypebble/kvncbookmarkdlg.cpp b/noncore/comm/keypebble/kvncbookmarkdlg.cpp
index ef2fa12..149c398 100644
--- a/noncore/comm/keypebble/kvncbookmarkdlg.cpp
+++ b/noncore/comm/keypebble/kvncbookmarkdlg.cpp
@@ -1,11 +1,17 @@
1#include "kvncbookmarkdlg.h"
2
3/* OPIE */
4#include <opie2/odebug.h>
5#include <qpe/global.h>
6using namespace Opie::Core;
7
8/* QT */
1#include <qdir.h> 9#include <qdir.h>
2#include <qtextstream.h> 10#include <qtextstream.h>
3#include <qlistbox.h> 11#include <qlistbox.h>
4#include <qpe/global.h>
5#include "kvncbookmarkdlg.h"
6 12
7KVNCBookmarkDlg::KVNCBookmarkDlg( QWidget * parent, const char * name, WFlags f ) 13KVNCBookmarkDlg::KVNCBookmarkDlg( QWidget * parent, const char * name, WFlags f )
8 14
9: KVNCBookmarkDlgBase( parent, name,f) 15: KVNCBookmarkDlgBase( parent, name,f)
10{ 16{
11 readBookmarks(); 17 readBookmarks();
@@ -172,13 +178,13 @@ void KVNCBookmarkDlg::writeBookmarks(void)
172 QTextStream t( &f ); 178 QTextStream t( &f );
173 QString s; 179 QString s;
174 int n = 1; 180 int n = 1;
175 KRFBServer *server; 181 KRFBServer *server;
176 182
177 for ( server=servers.first(); server != 0; server=servers.next() ) { 183 for ( server=servers.first(); server != 0; server=servers.next() ) {
178 qDebug(server->name); 184 odebug << server->name << oendl;
179 t << "server=" << server->name << '\n'; 185 t << "server=" << server->name << '\n';
180 t << "\thostname=" << server->hostname << '\n'; 186 t << "\thostname=" << server->hostname << '\n';
181 t << "\tpassword=" << encipher(server->password )<< '\n'; 187 t << "\tpassword=" << encipher(server->password )<< '\n';
182 t << "\tdisplay=" << server->display << '\n'; 188 t << "\tdisplay=" << server->display << '\n';
183 t << "\thextile=" << server->hexTile << '\n'; 189 t << "\thextile=" << server->hexTile << '\n';
184 t << "\tcorre=" << server->corre << '\n'; 190 t << "\tcorre=" << server->corre << '\n';
diff --git a/noncore/games/backgammon/backgammon.cpp b/noncore/games/backgammon/backgammon.cpp
index 51020a0..bdb1c78 100644
--- a/noncore/games/backgammon/backgammon.cpp
+++ b/noncore/games/backgammon/backgammon.cpp
@@ -1,22 +1,26 @@
1#include "backgammon.h" 1#include "backgammon.h"
2
3#include "aidialog.h" 2#include "aidialog.h"
4#include "filedialog.h" 3#include "filedialog.h"
5#include "playerdialog.h" 4#include "playerdialog.h"
6#include "rulesdialog.h" 5#include "rulesdialog.h"
7#include "themedialog.h" 6#include "themedialog.h"
8 7
8/* OPIE */
9#include <opie2/odebug.h>
10#include <qpe/qpeapplication.h>
11#include <qpe/config.h>
12#include <qpe/resource.h>
13using namespace Opie::Core;
14
15/* QT */
9#include <qfile.h> 16#include <qfile.h>
10#include <qlayout.h> 17#include <qlayout.h>
11#include <qmessagebox.h> 18#include <qmessagebox.h>
12#include <qtimer.h> 19#include <qtimer.h>
13#include <qpe/qpeapplication.h>
14#include <qpe/config.h>
15#include <qmenubar.h> 20#include <qmenubar.h>
16#include <qpe/resource.h>
17 21
18#include <stdlib.h> 22#include <stdlib.h>
19 23
20 24
21BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl) 25BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
22 : QMainWindow(parent, name, fl) 26 : QMainWindow(parent, name, fl)
@@ -30,13 +34,13 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
30 move=new MoveEngine(); 34 move=new MoveEngine();
31 35
32 //load the default theme 36 //load the default theme
33 Config conf("backgammon"); 37 Config conf("backgammon");
34 if(!conf.isValid()) 38 if(!conf.isValid())
35 { 39 {
36 qDebug("config file does not exist"); 40 odebug << "config file does not exist" << oendl;
37 conf.setGroup("general"); 41 conf.setGroup("general");
38 conf.writeEntry("theme","default"); 42 conf.writeEntry("theme","default");
39 conf.setGroup("rules"); 43 conf.setGroup("rules");
40 conf.writeEntry("move_with_pieces_out",false); 44 conf.writeEntry("move_with_pieces_out",false);
41 conf.writeEntry("nice_dice",false); 45 conf.writeEntry("nice_dice",false);
42 conf.setGroup("display"); 46 conf.setGroup("display");
@@ -75,13 +79,13 @@ BackGammon::BackGammon(QWidget* parent, const char* name, WFlags fl)
75 79
76 80
77 //get the theme component names 81 //get the theme component names
78 Config theme(theme_file,Config::File); 82 Config theme(theme_file,Config::File);
79 if(!theme.isValid()) 83 if(!theme.isValid())
80 { 84 {
81 qDebug("theme file does not exist"); 85 odebug << "theme file does not exist" << oendl;
82 theme.setGroup("theme"); 86 theme.setGroup("theme");
83 theme.writeEntry("board","casino_board_1"); 87 theme.writeEntry("board","casino_board_1");
84 theme.writeEntry("pieces1","casino_pieces_blue"); 88 theme.writeEntry("pieces1","casino_pieces_blue");
85 theme.writeEntry("pieces2","casino_pieces_white"); 89 theme.writeEntry("pieces2","casino_pieces_white");
86 theme.writeEntry("dice1","casino_dice"); 90 theme.writeEntry("dice1","casino_dice");
87 theme.writeEntry("dice2","casino_dice"); 91 theme.writeEntry("dice2","casino_dice");
diff --git a/noncore/games/backgammon/moveengine.cpp b/noncore/games/backgammon/moveengine.cpp
index 7de7147..a4145cc 100644
--- a/noncore/games/backgammon/moveengine.cpp
+++ b/noncore/games/backgammon/moveengine.cpp
@@ -454,13 +454,13 @@ int MoveEngine::getPossibleMoves()
454 } 454 }
455 return total; 455 return total;
456} 456}
457 457
458void MoveEngine::move(const int& from, int to, const int& dice) 458void MoveEngine::move(const int& from, int to, const int& dice)
459{ 459{
460 //qDebug("%d moves from %d to %d (%d) with dice %d",player,from,to,to-from,dice); 460 //odebug << "" << player << " moves from " << from << " to " << to << " (" << to-from << ") with dice " << dice << "" << oendl;
461 461
462 if(player==1 && to==25) 462 if(player==1 && to==25)
463 to=26; 463 to=26;
464 if(player==2 && to==0) 464 if(player==2 && to==0)
465 to=27; 465 to=27;
466 466
diff --git a/noncore/games/bounce/bounce.pro b/noncore/games/bounce/bounce.pro
index ba745c8..56a325c 100644
--- a/noncore/games/bounce/bounce.pro
+++ b/noncore/games/bounce/bounce.pro
@@ -1,10 +1,9 @@
1 #CONFIG = qt warn_on 1 CONFIG = qt warn_on quick-app
2 CONFIG = qt warn_on quick-app
3 HEADERS = game.h kbounce.h 2 HEADERS = game.h kbounce.h
4 SOURCES = game.cpp kbounce.cpp main.cpp 3 SOURCES = game.cpp kbounce.cpp main.cpp
5 INCLUDEPATH+= $(OPIEDIR)/include 4 INCLUDEPATH+= $(OPIEDIR)/include
6 DEPENDPATH+= $(OPIEDIR)/include 5 DEPENDPATH+= $(OPIEDIR)/include
7LIBS += -lqpe -lopiecore2 6LIBS += -lqpe -lopiecore2
8 TARGET = bounce 7 TARGET = bounce
9 8
10include ( $(OPIEDIR)/include.pro ) 9include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/bounce/game.cpp b/noncore/games/bounce/game.cpp
index 1f1f8cd..bbd3d0b 100644
--- a/noncore/games/bounce/game.cpp
+++ b/noncore/games/bounce/game.cpp
@@ -14,17 +14,24 @@
14 * You should have received a copy of the GNU Library General Public 14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the Free 15 * License along with this program; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */ 17 */
18 18
19 19
20#include <stdlib.h> 20#include "game.h"
21#include <qtimer.h> 21
22/* OPIE */
23#include <opie2/odebug.h>
22#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25using namespace Opie::Core;
23 26
24#include "game.h" 27/* QT */
28#include <qtimer.h>
29
30/* STD */
31#include <stdlib.h>
25 32
26#define TILE_SIZE 9 33#define TILE_SIZE 9
27 34
28#define TILE_FIRST ((FIELD_WIDTH-2)*(FIELD_HEIGHT-2)) 35#define TILE_FIRST ((FIELD_WIDTH-2)*(FIELD_HEIGHT-2))
29#define TILE_FREE (TILE_FIRST + 0) 36#define TILE_FREE (TILE_FIRST + 0)
30#define TILE_BORDER (TILE_FIRST + 1) 37#define TILE_BORDER (TILE_FIRST + 1)
@@ -364,13 +371,13 @@ JezzGame::~JezzGame()
364 delete m_field; 371 delete m_field;
365 delete m_ballPixmaps; 372 delete m_ballPixmaps;
366} 373}
367 374
368void JezzGame::display( QString text, int size ) 375void JezzGame::display( QString text, int size )
369{ 376{
370 qDebug("This function \"display\" shouldn't be called!!!"); 377 odebug << "This function \"display\" shouldn't be called!!!" << oendl;
371 if ( !text.isEmpty() ) 378 if ( !text.isEmpty() )
372 { 379 {
373 QFont font( "Helvetica", size, QFont::Bold ); 380 QFont font( "Helvetica", size, QFont::Bold );
374 font.setStyleHint( QFont::Helvetica ); 381 font.setStyleHint( QFont::Helvetica );
375 m_text->setFont( font ); 382 m_text->setFont( font );
376 m_text->setText( text ); 383 m_text->setText( text );
diff --git a/noncore/games/go/go.pro b/noncore/games/go/go.pro
index b73bbb0..72425a5 100644
--- a/noncore/games/go/go.pro
+++ b/noncore/games/go/go.pro
@@ -1,19 +1,18 @@
1 CONFIG = qt warn_on quick-app 1 CONFIG = qt warn_on quick-app
2 HEADERS = amigo.h \ 2 HEADERS = amigo.h \
3 go.h \ 3 go.h \
4 goplayutils.h \ 4 goplayutils.h \
5 gowidget.h 5 gowidget.h
6 SOURCES = amigo.c \ 6 SOURCES = amigo.c \
7 goplayer.c \ 7 goplayer.c \
8 goplayutils.c \ 8 goplayutils.c \
9 killable.c \ 9 killable.c \
10 gowidget.cpp \ 10 gowidget.cpp \
11 main.cpp 11 main.cpp
12INCLUDEPATH += $(OPIEDIR)/include 12INCLUDEPATH += $(OPIEDIR)/include
13 DEPENDPATH+= $(OPIEDIR)/include 13 DEPENDPATH+= $(OPIEDIR)/include
14LIBS += -lqpe -lopiecore2 14LIBS += -lqpe -lopiecore2
15 TARGET = go 15 TARGET = go
16 16
17 17
18
19include ( $(OPIEDIR)/include.pro ) 18include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/go/gowidget.cpp b/noncore/games/go/gowidget.cpp
index d134540..ec03c1d 100644
--- a/noncore/games/go/gowidget.cpp
+++ b/noncore/games/go/gowidget.cpp
@@ -17,25 +17,26 @@
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "gowidget.h" 21#include "gowidget.h"
22 22
23/* OPIE */
24#include <opie2/odebug.h>
23#include <qpe/config.h> 25#include <qpe/config.h>
24#include <qpe/resource.h> 26#include <qpe/resource.h>
27using namespace Opie::Core;
25 28
29/* QT */
26#include <qpainter.h> 30#include <qpainter.h>
27#include <qtoolbar.h> 31#include <qtoolbar.h>
28#include <qmenubar.h> 32#include <qmenubar.h>
29#include <qaction.h> 33#include <qaction.h>
30#include <qapplication.h> //processEvents() 34#include <qapplication.h> //processEvents()
31#include <qlabel.h> 35#include <qlabel.h>
32 36
33//#include <stdio.h>
34
35
36static const enum bVal computer_color = BLACK; 37static const enum bVal computer_color = BLACK;
37 38
38static int current_handicap = 1; 39static int current_handicap = 1;
39 40
40static QBrush *goBrush; 41static QBrush *goBrush;
41//static QImage *newBlackStone; 42//static QImage *newBlackStone;
@@ -445,13 +446,13 @@ void placestone (enum bVal c, short x, short y )
445{ 446{
446 GoWidget::self->placeStone(c,x,y); 447 GoWidget::self->placeStone(c,x,y);
447} 448}
448 449
449 voidintrMoveReport(enum bVal c ,char *coord ,char *reason ) 450 voidintrMoveReport(enum bVal c ,char *coord ,char *reason )
450{ 451{
451 qDebug( "intrMoveReport colour %d, %s %s", c, coord, reason ); 452 odebug << "intrMoveReport colour " << c << ", " << coord << " " << reason << "" << oendl;
452} 453}
453 454
454 voidintrPrisonerReport( short blackcnt, short whitecnt ) 455 voidintrPrisonerReport( short blackcnt, short whitecnt )
455{ 456{
456 GoWidget::self->reportPrisoners(blackcnt,whitecnt); 457 GoWidget::self->reportPrisoners(blackcnt,whitecnt);
457} 458}
diff --git a/noncore/games/kpacman/kpacman.pro b/noncore/games/kpacman/kpacman.pro
index 8453f78..45314f9 100644
--- a/noncore/games/kpacman/kpacman.pro
+++ b/noncore/games/kpacman/kpacman.pro
@@ -1,10 +1,8 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 #CONFIG = qt warn_on
3 CONFIG = qt warn_on 2 CONFIG = qt warn_on
4 #TMAKE_CXXFLAGS+=
5 HEADERS = kpacmanwidget.h \ 3 HEADERS = kpacmanwidget.h \
6 referee.h \ 4 referee.h \
7 status.h \ 5 status.h \
8 painter.h \ 6 painter.h \
9 score.h \ 7 score.h \
10 pacman.h \ 8 pacman.h \
@@ -31,11 +29,11 @@ SOURCES = kpacmanwidget.cpp \
31 board.cpp \ 29 board.cpp \
32 bitfont.cpp \ 30 bitfont.cpp \
33 kpacman.cpp \ 31 kpacman.cpp \
34 main.cpp 32 main.cpp
35 INCLUDEPATH+= $(OPIEDIR)/include 33 INCLUDEPATH+= $(OPIEDIR)/include
36 DEPENDPATH+= $(OPIEDIR)/include 34 DEPENDPATH+= $(OPIEDIR)/include
37LIBS += -lqpe 35LIBS += -lqpe -lopiecore2
38DESTDIR = $(OPIEDIR)/bin 36DESTDIR = $(OPIEDIR)/bin
39 TARGET = kpacman 37 TARGET = kpacman
40 38
41include ( $(OPIEDIR)/include.pro ) 39include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/kpacman/kpacmanwidget.cpp b/noncore/games/kpacman/kpacmanwidget.cpp
index 9631495..b59dd02 100644
--- a/noncore/games/kpacman/kpacmanwidget.cpp
+++ b/noncore/games/kpacman/kpacmanwidget.cpp
@@ -10,13 +10,14 @@
10#elif defined( QPE_PORT ) 10#elif defined( QPE_PORT )
11#include <qpe/qpeapplication.h> 11#include <qpe/qpeapplication.h>
12#include <qpe/config.h> 12#include <qpe/config.h>
13#include "kpacmanwidget.h" 13#include "kpacmanwidget.h"
14#endif 14#endif
15 15
16 16#include <opie2/odebug.h>
17using namespace Opie::Core;
17 18
18KpacmanWidget::KpacmanWidget( QWidget *parent, const char *name) 19KpacmanWidget::KpacmanWidget( QWidget *parent, const char *name)
19 : QWidget( parent, name ) 20 : QWidget( parent, name )
20{ 21{
21 score = 0l; 22 score = 0l;
22 referee = 0l; 23 referee = 0l;
@@ -136,13 +137,13 @@ void KpacmanWidget::setScheme(int Scheme, int Mode)
136 referee->repaint(FALSE); 137 referee->repaint(FALSE);
137 status->repaint(FALSE); 138 status->repaint(FALSE);
138} 139}
139 140
140void KpacmanWidget::resizeEvent( QResizeEvent * ) 141void KpacmanWidget::resizeEvent( QResizeEvent * )
141{ 142{
142 qWarning("Resize"); 143 owarn << "Resize" << oendl;
143 referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height()); 144 referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height());
144 referee->setBackgroundColor(BLACK); 145 referee->setBackgroundColor(BLACK);
145 146
146 if(!status ) return; 147 if(!status ) return;
147 status->setGeometry(0, bitfont->height()*3+referee->height(), referee->width(), 148 status->setGeometry(0, bitfont->height()*3+referee->height(), referee->width(),
148 status->height()); 149 status->height());
diff --git a/noncore/games/kpacman/status.cpp b/noncore/games/kpacman/status.cpp
index 02ff63d..db6938e 100644
--- a/noncore/games/kpacman/status.cpp
+++ b/noncore/games/kpacman/status.cpp
@@ -10,20 +10,23 @@
10#elif defined( QPE_PORT ) 10#elif defined( QPE_PORT )
11#include <qpe/qpeapplication.h> 11#include <qpe/qpeapplication.h>
12#include <qpe/config.h> 12#include <qpe/config.h>
13#include "status.h" 13#include "status.h"
14#endif 14#endif
15 15
16#include <opie2/odebug.h>
17using namespace Opie::Core;
18
16#include <qbitmap.h> 19#include <qbitmap.h>
17#include <qmsgbox.h> 20#include <qmsgbox.h>
18#include <qfileinfo.h> 21#include <qfileinfo.h>
19 22
20Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) : 23Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) :
21 QWidget( parent, name ) 24 QWidget( parent, name )
22{ 25{
23 qWarning("Status::Status"); 26 owarn << "Status::Status" << oendl;
24 actualLifes = 0; 27 actualLifes = 0;
25 actualLevel = 0; 28 actualLevel = 0;
26 29
27 lifesPix = NULL; 30 lifesPix = NULL;
28 levelPix = NULL; 31 levelPix = NULL;
29 32
diff --git a/noncore/games/mindbreaker/mindbreaker.cpp b/noncore/games/mindbreaker/mindbreaker.cpp
index 2b924c6..1f554d2 100644
--- a/noncore/games/mindbreaker/mindbreaker.cpp
+++ b/noncore/games/mindbreaker/mindbreaker.cpp
@@ -87,13 +87,13 @@ static void setupBoardSize(int w, int h)
87 adjusted_answerpeg_xdiff = adjusted_panel_width * 10/180; 87 adjusted_answerpeg_xdiff = adjusted_panel_width * 10/180;
88 adjusted_answerpeg_ydiff = adjusted_panel_height * 9/25; 88 adjusted_answerpeg_ydiff = adjusted_panel_height * 9/25;
89 89
90 adjusted_board_height = adjusted_title_height + (adjusted_panel_height * 9); 90 adjusted_board_height = adjusted_title_height + (adjusted_panel_height * 9);
91 adjusted_board_width = adjusted_panel_width + (adjusted_bin_margin * 2) + adjusted_peg_size; 91 adjusted_board_width = adjusted_panel_width + (adjusted_bin_margin * 2) + adjusted_peg_size;
92 92
93// qDebug("Adjusted width %d height %d", adjusted_board_width, adjusted_board_height); 93// odebug << "Adjusted width " << adjusted_board_width << " height " << adjusted_board_height << "" << oendl;
94} 94}
95 95
96 96
97/* helper class, */ 97/* helper class, */
98class Peg : public QCanvasRectangle 98class Peg : public QCanvasRectangle
99{ 99{
diff --git a/noncore/games/oyatzee/oyatzee.cpp b/noncore/games/oyatzee/oyatzee.cpp
index a55aa73..27c0a9f 100644
--- a/noncore/games/oyatzee/oyatzee.cpp
+++ b/noncore/games/oyatzee/oyatzee.cpp
@@ -1,13 +1,19 @@
1#include "oyatzee.h" 1#include "oyatzee.h"
2 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */
3#include <qmessagebox.h> 8#include <qmessagebox.h>
4#include <qpushbutton.h> 9#include <qpushbutton.h>
5#include <qpainter.h> 10#include <qpainter.h>
6#include <qlayout.h> 11#include <qlayout.h>
7 12
13/* STD */
8#include <stdlib.h> 14#include <stdlib.h>
9 15
10OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow( parent , name , fl ) 16OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow( parent , name , fl )
11{ 17{
12 QWidget *thing = new QWidget( this ); 18 QWidget *thing = new QWidget( this );
13 setCentralWidget( thing ); 19 setCentralWidget( thing );
@@ -38,13 +44,13 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow(
38 vbox->addWidget( sb ); 44 vbox->addWidget( sb );
39 vbox->addWidget( dw ); 45 vbox->addWidget( dw );
40} 46}
41 47
42void OYatzee::slotEndRound( int item ) 48void OYatzee::slotEndRound( int item )
43{ 49{
44 qDebug( "Der User hat Nummer %d ausgewählt" , item ); 50 odebug << "Der User hat Nummer " << item << " ausgewählt" << oendl;
45 51
46 /* 52 /*
47 * if the user clicked on Total, Bonus or Score and thus not on a 53 * if the user clicked on Total, Bonus or Score and thus not on a
48 * selectable item return and do nothing 54 * selectable item return and do nothing
49 */ 55 */
50 if ( item == 7 || item == 8 || item == 16 ) return; 56 if ( item == 7 || item == 8 || item == 16 ) return;
@@ -106,13 +112,13 @@ void OYatzee::slotEndRound( int item )
106 points = getPoints ( Chance , numbers ); 112 points = getPoints ( Chance , numbers );
107 } 113 }
108 114
109 sb->nextRB(currentPlayer-1)->updateMap( item , points ); 115 sb->nextRB(currentPlayer-1)->updateMap( item , points );
110 nextPlayer(); 116 nextPlayer();
111 117
112 qDebug( "Punkte: %d" , points ); 118 odebug << "Punkte: " << points << "" << oendl;
113} 119}
114 120
115void OYatzee::nextPlayer() 121void OYatzee::nextPlayer()
116{ 122{
117 currentPlayer++; 123 currentPlayer++;
118 124
@@ -153,13 +159,13 @@ OYatzee::~OYatzee()
153{ 159{
154} 160}
155 161
156void OYatzee::detectPosibilities() 162void OYatzee::detectPosibilities()
157{ 163{
158 posibilities.clear(); 164 posibilities.clear();
159 qDebug( "running detectPosibilities()" ); 165 odebug << "running detectPosibilities()" << oendl;
160 166
161 Dice *d = dw->diceList.first(); 167 Dice *d = dw->diceList.first();
162 168
163 QValueListInt numbers; 169 QValueListInt numbers;
164 170
165 for ( ; d != 0 ; d = dw->diceList.next() ) 171 for ( ; d != 0 ; d = dw->diceList.next() )
@@ -258,53 +264,53 @@ void OYatzee::detectPosibilities()
258} 264}
259 265
260void OYatzee::displayPossibilites() 266void OYatzee::displayPossibilites()
261{ 267{
262 //X for ( QValueListInt::Iterator it = posibilities.begin() ; it != posibilities.end(); ++it ) 268 //X for ( QValueListInt::Iterator it = posibilities.begin() ; it != posibilities.end(); ++it )
263 //X { 269 //X {
264 //X qDebug( QString::number( *it ) ); 270 //X odebug << QString::number( *it ) << oendl;
265 //X switch ( *it ) 271 //X switch ( *it )
266 //X { 272 //X {
267 //X case Ones: 273 //X case Ones:
268 //X qDebug( "1er" ); 274 //X odebug << "1er" << oendl;
269 //X break; 275 //X break;
270 //X case Twos: 276 //X case Twos:
271 //X qDebug( "2er" ); 277 //X odebug << "2er" << oendl;
272 //X break; 278 //X break;
273 //X case Threes: 279 //X case Threes:
274 //X qDebug( "3er" ); 280 //X odebug << "3er" << oendl;
275 //X break; 281 //X break;
276 //X case Fours: 282 //X case Fours:
277 //X qDebug( "4er" ); 283 //X odebug << "4er" << oendl;
278 //X break; 284 //X break;
279 //X case Fives: 285 //X case Fives:
280 //X qDebug( "5er" ); 286 //X odebug << "5er" << oendl;
281 //X break; 287 //X break;
282 //X case Sixes: 288 //X case Sixes:
283 //X qDebug( "6er" ); 289 //X odebug << "6er" << oendl;
284 //X break; 290 //X break;
285 //X case ThreeOfAKind: 291 //X case ThreeOfAKind:
286 //X qDebug( "3oaK" ); 292 //X odebug << "3oaK" << oendl;
287 //X break; 293 //X break;
288 //X case FourOfAKind: 294 //X case FourOfAKind:
289 //X qDebug( "4oaK" ); 295 //X odebug << "4oaK" << oendl;
290 //X break; 296 //X break;
291 //X case FullHouse: 297 //X case FullHouse:
292 //X qDebug( "Full House" ); 298 //X odebug << "Full House" << oendl;
293 //X break; 299 //X break;
294 //X case SStraight: 300 //X case SStraight:
295 //X qDebug( "Short S" ); 301 //X odebug << "Short S" << oendl;
296 //X break; 302 //X break;
297 //X case LStraight: 303 //X case LStraight:
298 //X qDebug( "Long S" ); 304 //X odebug << "Long S" << oendl;
299 //X break; 305 //X break;
300 //X case Yatzee: 306 //X case Yatzee:
301 //X qDebug( "Yatzee!" ); 307 //X odebug << "Yatzee!" << oendl;
302 //X break; 308 //X break;
303 //X case Chance: 309 //X case Chance:
304 //X qDebug( "Chance" ); 310 //X odebug << "Chance" << oendl;
305 //X break; 311 //X break;
306 //X } 312 //X }
307 //X } 313 //X }
308 314
309 sb->pb->setIntlist( posibilities ); 315 sb->pb->setIntlist( posibilities );
310 sb->pb->update(); 316 sb->pb->update();
@@ -332,13 +338,13 @@ void OYatzee::setRoundsNumber( const int num )
332void OYatzee::slotStartGame() 338void OYatzee::slotStartGame()
333{ 339{
334} 340}
335 341
336void OYatzee::slotRollDices() 342void OYatzee::slotRollDices()
337{ 343{
338 qDebug( "Roll nummer: %d" , ps.at( currentPlayer-1 )->turn ); 344 odebug << "Roll nummer: " << ps.at( currentPlayer-1 )->turn << "" << oendl;
339 345
340 if ( ps.at( currentPlayer-1 )->turn == 3 ) 346 if ( ps.at( currentPlayer-1 )->turn == 3 )
341 { 347 {
342 QMessageBox::information( this, 348 QMessageBox::information( this,
343 "OYatzee", 349 "OYatzee",
344 tr( "Only three rolls per turn allowed." ) ); 350 tr( "Only three rolls per turn allowed." ) );
@@ -350,15 +356,15 @@ void OYatzee::slotRollDices()
350 for ( ; d != 0 ; d = dw->diceList.next() ) 356 for ( ; d != 0 ; d = dw->diceList.next() )
351 { 357 {
352 if ( !d->isSelected ) 358 if ( !d->isSelected )
353 d->roll(); 359 d->roll();
354 } 360 }
355 361
356 //qDebug( "Roll nummer (vorher): %d" , ps.at( currentPlayer-1 )->turn ); 362 //odebug << "Roll nummer (vorher): " << ps.at( currentPlayer-1 )->turn << "" << oendl;
357 ps.at(currentPlayer-1)->turn++; 363 ps.at(currentPlayer-1)->turn++;
358 //qDebug( "Roll nummer (nachher): %d" , ps.at( currentPlayer-1 )->turn ); 364 //odebug << "Roll nummer (nachher): " << ps.at( currentPlayer-1 )->turn << "" << oendl;
359 365
360 detectPosibilities(); 366 detectPosibilities();
361} 367}
362 368
363/* 369/*
364 * Scoreboard 370 * Scoreboard
@@ -388,13 +394,13 @@ Scoreboard::Scoreboard( playerList ps, QWidget *parent, const char *name ) : QWi
388Resultboard* Scoreboard::nextRB( int currentPlayer ) 394Resultboard* Scoreboard::nextRB( int currentPlayer )
389{ 395{
390 Resultboard *b; 396 Resultboard *b;
391 397
392 b = rbList.at( currentPlayer ); 398 b = rbList.at( currentPlayer );
393 399
394 qDebug( "Anzahl: %d" ,rbList.count() ); 400 odebug << "Anzahl: " << rbList.count() << "" << oendl;
395 401
396 return b; 402 return b;
397 } 403 }
398 404
399void Scoreboard::createResultboards(const int num) 405void Scoreboard::createResultboards(const int num)
400{ 406{
@@ -605,13 +611,13 @@ void Resultboard::paintEvent( QPaintEvent* )
605 const int cell_height = this->height()/17; 611 const int cell_height = this->height()/17;
606 612
607 pointMap::Iterator it = pMap.begin(); 613 pointMap::Iterator it = pMap.begin();
608 for ( ; it != pMap.end() ; ++it ) 614 for ( ; it != pMap.end() ; ++it )
609 { 615 {
610 int i = it.key(); 616 int i = it.key();
611 qDebug( "ok: %d , %d" , i , it.data() ); 617 odebug << "ok: " << i << " , " << it.data() << "" << oendl;
612 p.drawText( 0, i*cell_height , cell_width , cell_height , Qt::AlignCenter , QString::number( it.data() ) ); 618 p.drawText( 0, i*cell_height , cell_width , cell_height , Qt::AlignCenter , QString::number( it.data() ) );
613 } 619 }
614 620
615 p.drawText( 0,0,cell_width,cell_height, Qt::AlignCenter , pName ); //Playername 621 p.drawText( 0,0,cell_width,cell_height, Qt::AlignCenter , pName ); //Playername
616} 622}
617 623
diff --git a/noncore/games/oyatzee/oyatzee.pro b/noncore/games/oyatzee/oyatzee.pro
index 754abd2..f505c66 100644
--- a/noncore/games/oyatzee/oyatzee.pro
+++ b/noncore/games/oyatzee/oyatzee.pro
@@ -3,9 +3,9 @@ CONFIG = qt warn_on
3 DESTDIR = $(OPIEDIR)/bin 3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = oyatzee.h 4 HEADERS = oyatzee.h
5 SOURCES = main.cpp oyatzee.cpp 5 SOURCES = main.cpp oyatzee.cpp
6 TARGET = oyatzee 6 TARGET = oyatzee
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8 DEPENDPATH+= $(OPIEDIR)/include 8 DEPENDPATH+= $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe -lopiecore2
10 10
11include ( $(OPIEDIR)/include.pro ) 11include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/games/wordgame/wordgame.cpp b/noncore/games/wordgame/wordgame.cpp
index a80bd35..47d6725 100644
--- a/noncore/games/wordgame/wordgame.cpp
+++ b/noncore/games/wordgame/wordgame.cpp
@@ -672,13 +672,13 @@ void ComputerPlayer::noteChoice(const Tile** tiles, int n, const QPoint& d, cons
672 int s = board->score(current, tiles, n, blankvalues, d, TRUE, 0); 672 int s = board->score(current, tiles, n, blankvalues, d, TRUE, 0);
673/* 673/*
674if (s>0 || current==QPoint(5,1)){ 674if (s>0 || current==QPoint(5,1)){
675QString st; 675QString st;
676for ( int i=0; i<n; i++ ) 676for ( int i=0; i<n; i++ )
677 st += tiles[i]->text(); 677 st += tiles[i]->text();
678qDebug("%d,%d: %s (%d) for %d",current.x(),current.y(),st.latin1(),n,s); 678odebug << "" << current.x() << "," << current.y() << ": " << st.latin1() << " (" << n << ") for " << s << "" << oendl;
679} 679}
680*/ 680*/
681 if ( s > best_score ) { 681 if ( s > best_score ) {
682 int i; 682 int i;
683 for ( i=0; i<n; i++ ) 683 for ( i=0; i<n; i++ )
684 best[i] = tiles[i]; 684 best[i] = tiles[i];
diff --git a/noncore/graphics/opie-eye/config.in b/noncore/graphics/opie-eye/config.in
index 996dcf3..d7f9963 100644
--- a/noncore/graphics/opie-eye/config.in
+++ b/noncore/graphics/opie-eye/config.in
@@ -1,9 +1,9 @@
1 config OPIE_EYE 1 config OPIE_EYE
2 boolean "opie-eye The Image Viewer and Browser" 2 boolean "opie-eye The Image Viewer and Browser"
3 default "y" 3 default "y"
4 depends on ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI 4 depends on ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI
5 5
6 config OPIE_EYE_SLAVE 6 config OPIE_EYE_SLAVE
7 boolean 7 boolean
8 default "y" if OPIE_EYE 8 default "y" if OPIE_EYE
9 depends on ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI 9 depends on ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI
diff --git a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
index 79f4510..5599ad1 100644
--- a/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
+++ b/noncore/graphics/opie-eye/impl/dir/dir_ifaceinfo.cpp
@@ -1,20 +1,24 @@
1/* 1/*
2 * GPLv2 2 * GPLv2
3 * zecke@handhelds.org 3 * zecke@handhelds.org
4 */ 4 */
5 5
6#include "dir_ifaceinfo.h"
7
8/* OPIE */
9#include <opie2/odebug.h>
10#include <qpe/config.h>
11using namespace Opie::Core;
12
13/* QT */
6#include <qwidget.h> 14#include <qwidget.h>
7#include <qcheckbox.h> 15#include <qcheckbox.h>
8#include <qhbox.h> 16#include <qhbox.h>
9#include <qlabel.h> 17#include <qlabel.h>
10 18
11#include <qpe/config.h>
12
13#include "dir_ifaceinfo.h"
14
15namespace { 19namespace {
16 class DirImageWidget : public QHBox { 20 class DirImageWidget : public QHBox {
17 public: 21 public:
18 DirImageWidget() { 22 DirImageWidget() {
19 chkbox = new QCheckBox( QObject::tr("Show all files"), this ); 23 chkbox = new QCheckBox( QObject::tr("Show all files"), this );
20 } 24 }
@@ -38,10 +42,10 @@ QWidget* DirInterfaceInfo::configWidget(const Config& cfg) {
38 wid->chkbox->setChecked( cfg.readBoolEntry("Dir_Check_All_Files", true) ); 42 wid->chkbox->setChecked( cfg.readBoolEntry("Dir_Check_All_Files", true) );
39 43
40 return wid; 44 return wid;
41} 45}
42 46
43void DirInterfaceInfo::writeConfig( QWidget* _wid, Config& cfg) { 47void DirInterfaceInfo::writeConfig( QWidget* _wid, Config& cfg) {
44 qWarning( "Write Config" ); 48 owarn << "Write Config" << oendl;
45 DirImageWidget* wid = static_cast<DirImageWidget*>(_wid); 49 DirImageWidget* wid = static_cast<DirImageWidget*>(_wid);
46 cfg.writeEntry("Dir_Check_All_Files", wid->chkbox->isChecked() ); 50 cfg.writeEntry("Dir_Check_All_Files", wid->chkbox->isChecked() );
47} 51}
diff --git a/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp b/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp
index ffea29e..0a5cff4 100644
--- a/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp
+++ b/noncore/graphics/opie-eye/impl/dir/dir_lister.cpp
@@ -3,25 +3,27 @@
3 */ 3 */
4 4
5#include "dir_lister.h" 5#include "dir_lister.h"
6 6
7#include <lib/slavemaster.h> 7#include <lib/slavemaster.h>
8 8
9 9/* OPIE */
10#include <opie2/odebug.h>
10#include <qpe/config.h> 11#include <qpe/config.h>
11#include <qpe/qpeapplication.h> 12#include <qpe/qpeapplication.h>
13using namespace Opie::Core;
12 14
15/* QT */
13#include <qdir.h> 16#include <qdir.h>
14#include <qfileinfo.h> 17#include <qfileinfo.h>
15 18
16
17Dir_DirLister::Dir_DirLister( bool list ) 19Dir_DirLister::Dir_DirLister( bool list )
18 : PDirLister( "dir_dir_lister" ) 20 : PDirLister( "dir_dir_lister" )
19{ 21{
20 m_allFiles = list; 22 m_allFiles = list;
21 qWarning("All Files %d", m_allFiles ); 23 owarn << "All Files " << m_allFiles << "" << oendl;
22 24
23 SlaveMaster* master = SlaveMaster::self(); 25 SlaveMaster* master = SlaveMaster::self();
24 connect( master, SIGNAL(sig_start()), this, SIGNAL(sig_start()) ); 26 connect( master, SIGNAL(sig_start()), this, SIGNAL(sig_start()) );
25 connect( master, SIGNAL(sig_end()), this, SIGNAL(sig_end()) ); 27 connect( master, SIGNAL(sig_end()), this, SIGNAL(sig_end()) );
26 connect( master, SIGNAL(sig_thumbInfo(const QString&, const QString&)), 28 connect( master, SIGNAL(sig_thumbInfo(const QString&, const QString&)),
27 this, SIGNAL(sig_thumbInfo(const QString&, const QString&)) ); 29 this, SIGNAL(sig_thumbInfo(const QString&, const QString&)) );
diff --git a/noncore/graphics/opie-eye/lib/slavemaster.cpp b/noncore/graphics/opie-eye/lib/slavemaster.cpp
index 4e28535..5bb7ab8 100644
--- a/noncore/graphics/opie-eye/lib/slavemaster.cpp
+++ b/noncore/graphics/opie-eye/lib/slavemaster.cpp
@@ -1,11 +1,15 @@
1#include "slavemaster.h" 1#include "slavemaster.h"
2 2
3/* OPIE */
4#include <opie2/odebug.h>
3#include <qpe/qpeapplication.h> 5#include <qpe/qpeapplication.h>
4#include <qpe/qcopenvelope_qws.h> 6#include <qpe/qcopenvelope_qws.h>
7using namespace Opie::Core;
5 8
9/* QT */
6#include <qcopchannel_qws.h> 10#include <qcopchannel_qws.h>
7#include <qtimer.h> 11#include <qtimer.h>
8 12
9QDataStream & operator << (QDataStream & str, bool b) 13QDataStream & operator << (QDataStream & str, bool b)
10{ 14{
11 str << Q_INT8(b); 15 str << Q_INT8(b);
@@ -20,13 +24,13 @@ QDataStream & operator >> (QDataStream & str, bool & b)
20} 24}
21 25
22/* 26/*
23 * ! We don't put a Pixmap in!!!! 27 * ! We don't put a Pixmap in!!!!
24 */ 28 */
25QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) { 29QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) {
26 qWarning( "Image request is %s %d %d", inf.file.latin1(), inf.width, inf.height ); 30 owarn << "Image request is " << inf.file.latin1() << " " << inf.width << " " << inf.height << "" << oendl;
27 return s << inf.file << inf.width << inf.height; 31 return s << inf.file << inf.width << inf.height;
28} 32}
29QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { 33QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) {
30 s >> inf.file >> inf.pixmap >> inf.width >> inf.height; 34 s >> inf.file >> inf.pixmap >> inf.width >> inf.height;
31 return s; 35 return s;
32} 36}
@@ -75,16 +79,16 @@ void SlaveMaster::imageInfo( const QString& str ) {
75 m_started = true; 79 m_started = true;
76 } 80 }
77} 81}
78 82
79void SlaveMaster::thumbNail( const QString& str, int w, int h ) { 83void SlaveMaster::thumbNail( const QString& str, int w, int h ) {
80 if ( str.isEmpty() ) { 84 if ( str.isEmpty() ) {
81 qWarning( "Asking for empty nail" ); 85 owarn << "Asking for empty nail" << oendl;
82 return; 86 return;
83 } 87 }
84 qWarning( "Asking for thumbNail in size %d %d" + str, w,h ); 88 owarn << "Asking for thumbNail in size " << w << " " << h << "" + str << oendl;
85 PixmapInfo item; 89 PixmapInfo item;
86 item.file = str; item.width = w; item.height = h; 90 item.file = str; item.width = w; item.height = h;
87 item.pixmap = QPixmap(); 91 item.pixmap = QPixmap();
88 m_inThumbNail.append( item ); 92 m_inThumbNail.append( item );
89 93
90 if ( !m_started ) { 94 if ( !m_started ) {
@@ -102,13 +106,13 @@ void SlaveMaster::recieve( const QCString& str, const QByteArray& at) {
102 QDataStream stream( at, IO_ReadOnly ); 106 QDataStream stream( at, IO_ReadOnly );
103 if ( str == "pixmapsHandled(PixmapList)" ) 107 if ( str == "pixmapsHandled(PixmapList)" )
104 stream >> pixinfos; 108 stream >> pixinfos;
105 else if ( str == "pixmapsHandled(StringList)" ) 109 else if ( str == "pixmapsHandled(StringList)" )
106 stream >> infos; 110 stream >> infos;
107 111
108 qWarning( "PixInfos %d", pixinfos.count() ); 112 owarn << "PixInfos " << pixinfos.count() << "" << oendl;
109 113
110 bool got_data = ( !infos.isEmpty() || !pixinfos.isEmpty() ); 114 bool got_data = ( !infos.isEmpty() || !pixinfos.isEmpty() );
111 if ( got_data ) { 115 if ( got_data ) {
112 emit sig_start(); 116 emit sig_start();
113 for ( ImageInfos::Iterator _it = infos.begin(); _it != infos.end(); ++_it ) { 117 for ( ImageInfos::Iterator _it = infos.begin(); _it != infos.end(); ++_it ) {
114 if ( (*_it).kind ) 118 if ( (*_it).kind )
diff --git a/noncore/graphics/opie-eye/phunk_view.pro b/noncore/graphics/opie-eye/phunk_view.pro
index 17fa22c..0e2202a 100644
--- a/noncore/graphics/opie-eye/phunk_view.pro
+++ b/noncore/graphics/opie-eye/phunk_view.pro
@@ -28,9 +28,9 @@ INTERFACES =
28 28
29INCLUDEPATH += . $(OPIEDIR)/include 29INCLUDEPATH += . $(OPIEDIR)/include
30DEPENDPATH += $(OPIEDIR)/include 30DEPENDPATH += $(OPIEDIR)/include
31 31
32 32
33 33
34LIBS += -lqpe -lopieui2 34LIBS += -lqpe -lopiecore2 -lopieui2
35 35
36include ( $(OPIEDIR)/include.pro ) 36include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/graphics/opie-eye/slave/jpeg_slave.cpp b/noncore/graphics/opie-eye/slave/jpeg_slave.cpp
index 086b47f..fb7d5de 100644
--- a/noncore/graphics/opie-eye/slave/jpeg_slave.cpp
+++ b/noncore/graphics/opie-eye/slave/jpeg_slave.cpp
@@ -1,13 +1,17 @@
1#include "jpeg_slave.h" 1#include "jpeg_slave.h"
2
3#include "thumbnailtool.h" 2#include "thumbnailtool.h"
4 3
5PHUNK_VIEW_INTERFACE( "JPEG", JpegSlave ) 4PHUNK_VIEW_INTERFACE( "JPEG", JpegSlave )
6 5
7#include <qtopia/timestring.h> 6/* OPIE */
7#include <opie2/odebug.h>
8#include <qpe/timestring.h>
9using namespace Opie::Core;
10
11/* QT */
8#include <qobject.h> 12#include <qobject.h>
9#include <qimage.h> 13#include <qimage.h>
10 14
11/** 15/**
12 exif.h 16 exif.h
13*/ 17*/
@@ -116,13 +120,13 @@ public:
116}; 120};
117 121
118class FatalError { 122class FatalError {
119 const char* ex; 123 const char* ex;
120public: 124public:
121 FatalError(const char* s) { ex = s; } 125 FatalError(const char* s) { ex = s; }
122 void debug_print() const { qWarning("exception: %s", ex ); } 126 void debug_print() const { owarn << "exception: " << ex << "" << oendl; }
123}; 127};
124 128
125 129
126 130
127static unsigned char * LastExifRefd; 131static unsigned char * LastExifRefd;
128static int ExifSettingsLength; 132static int ExifSettingsLength;
@@ -259,13 +263,13 @@ int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode)
259 for (a=0;a<7;a++){ 263 for (a=0;a<7;a++){
260 marker = infile.getch(); 264 marker = infile.getch();
261 if (marker != 0xff) break; 265 if (marker != 0xff) break;
262 266
263 if (a >= 6){ 267 if (a >= 6){
264 268
265 qWarning( "too many padding bytes" ); 269 owarn << "too many padding bytes" << oendl;
266 return false; 270 return false;
267 271
268 } 272 }
269 } 273 }
270 274
271 if (marker == 0xff){ 275 if (marker == 0xff){
@@ -324,13 +328,13 @@ int ExifData::ReadJpegSections (QFile & infile, ReadMode_t ReadMode)
324 SectionsRead ++; 328 SectionsRead ++;
325 //HaveAll = 1; 329 //HaveAll = 1;
326 } 330 }
327 return true; 331 return true;
328 332
329 case M_EOI: // in case it's a tables-only JPEG stream 333 case M_EOI: // in case it's a tables-only JPEG stream
330 qWarning( "No image in jpeg!" ); 334 owarn << "No image in jpeg!" << oendl;
331 return false; 335 return false;
332 336
333 case M_COM: // Comment section 337 case M_COM: // Comment section
334 // pieczy 2002-02-12 338 // pieczy 2002-02-12
335 // now the User comment goes to UserComment 339 // now the User comment goes to UserComment
336 // so we can store a Comment section also in READ_EXIF mode 340 // so we can store a Comment section also in READ_EXIF mode
@@ -723,13 +727,13 @@ void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBa
723 SubdirStart = OffsetBase + Offset; 727 SubdirStart = OffsetBase + Offset;
724 if (SubdirStart > OffsetBase+ExifLength){ 728 if (SubdirStart > OffsetBase+ExifLength){
725 if (SubdirStart < OffsetBase+ExifLength+20){ 729 if (SubdirStart < OffsetBase+ExifLength+20){
726 // Jhead 1.3 or earlier would crop the whole directory! 730 // Jhead 1.3 or earlier would crop the whole directory!
727 // As Jhead produces this form of format incorrectness, 731 // As Jhead produces this form of format incorrectness,
728 // I'll just let it pass silently 732 // I'll just let it pass silently
729 qWarning( "Thumbnail removed with Jhead 1.3 or earlier" ); 733 owarn << "Thumbnail removed with Jhead 1.3 or earlier" << oendl;
730 }else{ 734 }else{
731 return; 735 return;
732 } 736 }
733 }else{ 737 }else{
734 if (SubdirStart <= OffsetBase+ExifLength){ 738 if (SubdirStart <= OffsetBase+ExifLength){
735 ProcessExifDir(SubdirStart, OffsetBase, ExifLength); 739 ProcessExifDir(SubdirStart, OffsetBase, ExifLength);
@@ -910,13 +914,13 @@ bool ExifData::scan(const QString & path)
910 f.open(IO_ReadOnly); 914 f.open(IO_ReadOnly);
911 915
912 // Scan the JPEG headers. 916 // Scan the JPEG headers.
913 ret = ReadJpegSections(f, READ_EXIF); 917 ret = ReadJpegSections(f, READ_EXIF);
914 918
915 if (ret == false){ 919 if (ret == false){
916 qWarning( "Not JPEG file!" ); 920 owarn << "Not JPEG file!" << oendl;
917 DiscardData(); 921 DiscardData();
918 f.close(); 922 f.close();
919 return false; 923 return false;
920 } 924 }
921 f.close(); 925 f.close();
922 DiscardData(); 926 DiscardData();
diff --git a/noncore/graphics/opie-eye/slave/main.cpp b/noncore/graphics/opie-eye/slave/main.cpp
index 37020e6..5b90483 100644
--- a/noncore/graphics/opie-eye/slave/main.cpp
+++ b/noncore/graphics/opie-eye/slave/main.cpp
@@ -28,32 +28,32 @@ int main( int argc, char* argv[] ) {
28 28
29#ifdef DEBUG_IT 29#ifdef DEBUG_IT
30int main( int argc, char* argv[] ) { 30int main( int argc, char* argv[] ) {
31 QString str = QString::fromLatin1(argv[2] ); 31 QString str = QString::fromLatin1(argv[2] );
32 QApplication app( argc, argv ); 32 QApplication app( argc, argv );
33 GifSlave slave; 33 GifSlave slave;
34 qWarning( str +" "+slave.iconViewName(str ) ); 34 owarn << str +" "+slave.iconViewName(str ) << oendl;
35 qWarning( str+" "+slave.fullImageInfo( str ) ); 35 owarn << str+" "+slave.fullImageInfo( str ) << oendl;
36 36
37 PNGSlave pngslave; 37 PNGSlave pngslave;
38 qWarning( str + " " + pngslave.iconViewName(str) ); 38 owarn << str + " " + pngslave.iconViewName(str) << oendl;
39 qWarning( str + " " + pngslave.fullImageInfo(str)); 39 owarn << str + " " + pngslave.fullImageInfo(str) << oendl;
40 40
41 41
42 JpegSlave jpgslave; 42 JpegSlave jpgslave;
43 qWarning( str + " " + jpgslave.iconViewName(str ) ); 43 owarn << str + " " + jpgslave.iconViewName(str ) << oendl;
44 qWarning( str + " " + jpgslave.fullImageInfo( str ) ); 44 owarn << str + " " + jpgslave.fullImageInfo( str ) << oendl;
45//return app.exec(); 45//return app.exec();
46 QPixmap pix = ThumbNailTool::getThumb( str, 24, 24 ); 46 QPixmap pix = ThumbNailTool::getThumb( str, 24, 24 );
47 if ( pix.isNull() ) { 47 if ( pix.isNull() ) {
48 qWarning( "No Thumbnail" ); 48 owarn << "No Thumbnail" << oendl;
49 pix = slave.pixmap(str, 24, 24); 49 pix = slave.pixmap(str, 24, 24);
50 } 50 }
51 51
52 if (!pix.isNull() ) { 52 if (!pix.isNull() ) {
53 qWarning( "Saving Thumbnail" ); 53 owarn << "Saving Thumbnail" << oendl;
54 ThumbNailTool::putThumb( str, pix, 24, 24 ); 54 ThumbNailTool::putThumb( str, pix, 24, 24 );
55 } 55 }
56 56
57} 57}
58 58
59#endif 59#endif
diff --git a/noncore/graphics/opie-eye/slave/slave.pro b/noncore/graphics/opie-eye/slave/slave.pro
index 3f42495..903d667 100644
--- a/noncore/graphics/opie-eye/slave/slave.pro
+++ b/noncore/graphics/opie-eye/slave/slave.pro
@@ -1,7 +1,7 @@
1CONFIG += qte 1CONFIG = qt
2TEMPLATE = app 2TEMPLATE = app
3TARGET = opie-eye_slave 3TARGET = opie-eye_slave
4DESTDIR = $(OPIEDIR)/bin 4DESTDIR = $(OPIEDIR)/bin
5 5
6HEADERS = gif_slave.h slaveiface.h slavereciever.h \ 6HEADERS = gif_slave.h slaveiface.h slavereciever.h \
7 thumbnailtool.h png_slave.h jpeg_slave.h \ 7 thumbnailtool.h png_slave.h jpeg_slave.h \
@@ -10,9 +10,9 @@ SOURCES = main.cpp gif_slave.cpp slavereciever.cpp \
10 slaveiface.cpp thumbnailtool.cpp png_slave.cpp \ 10 slaveiface.cpp thumbnailtool.cpp png_slave.cpp \
11 jpeg_slave.cpp 11 jpeg_slave.cpp
12 12
13INCLUDEPATH += $(OPIEDIR)/include ../ 13INCLUDEPATH += $(OPIEDIR)/include ../
14DEPENDSPATH += $(OPIEDIR)/include 14DEPENDSPATH += $(OPIEDIR)/include
15 15
16LIBS += -lqpe 16LIBS += -lqpe -lopiecore2
17 17
18include ( $(OPIEDIR)/include.pro ) \ No newline at end of file 18include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/graphics/opie-eye/slave/slavereciever.cpp b/noncore/graphics/opie-eye/slave/slavereciever.cpp
index bbbbb30..82b3d23 100644
--- a/noncore/graphics/opie-eye/slave/slavereciever.cpp
+++ b/noncore/graphics/opie-eye/slave/slavereciever.cpp
@@ -2,15 +2,19 @@
2 * GPLv2 zecke@handhelds.org 2 * GPLv2 zecke@handhelds.org
3 */ 3 */
4 4
5#include "slavereciever.h" 5#include "slavereciever.h"
6#include "slaveiface.h" 6#include "slaveiface.h"
7 7
8/* OPIE */
9#include <opie2/odebug.h>
8#include <qpe/qcopenvelope_qws.h> 10#include <qpe/qcopenvelope_qws.h>
9#include <qpe/qpeapplication.h> 11#include <qpe/qpeapplication.h>
12using namespace Opie::Core;
10 13
14/* QT */
11#include <qtimer.h> 15#include <qtimer.h>
12 16
13static SlaveObjects* _slaveObj = 0; 17static SlaveObjects* _slaveObj = 0;
14 18
15QDataStream & operator << (QDataStream & str, bool b) 19QDataStream & operator << (QDataStream & str, bool b)
16{ 20{
@@ -34,13 +38,13 @@ QDataStream &operator<<( QDataStream& s, const PixmapInfo& inf) {
34 38
35/* 39/*
36 * GUI sends no QPIxmap!!! 40 * GUI sends no QPIxmap!!!
37 */ 41 */
38QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) { 42QDataStream &operator>>( QDataStream& s, PixmapInfo& inf ) {
39 s >> inf.file >> inf.width >> inf.height; 43 s >> inf.file >> inf.width >> inf.height;
40 qWarning( "Recieved %s %d %d", inf.file.latin1(), inf.width, inf.height ); 44 owarn << "Recieved " << inf.file.latin1() << " " << inf.width << " " << inf.height << "" << oendl;
41 return s; 45 return s;
42} 46}
43QDataStream &operator<<( QDataStream& s, const ImageInfo& i) { 47QDataStream &operator<<( QDataStream& s, const ImageInfo& i) {
44 return s << i.kind << i.file << i.info; 48 return s << i.kind << i.file << i.info;
45} 49}
46QDataStream &operator>>( QDataStream& s, ImageInfo& i ) { 50QDataStream &operator>>( QDataStream& s, ImageInfo& i ) {
@@ -79,48 +83,48 @@ SlaveReciever::SlaveReciever( QObject* par)
79} 83}
80 84
81SlaveReciever::~SlaveReciever() { 85SlaveReciever::~SlaveReciever() {
82} 86}
83 87
84void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar) { 88void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar) {
85 qWarning( "String is %s", string.data() ); 89 owarn << "String is " << string.data() << "" << oendl;
86 QDataStream stream(ar, IO_ReadOnly ); 90 QDataStream stream(ar, IO_ReadOnly );
87 QStringList lst; 91 QStringList lst;
88 static ImageInfo inf; 92 static ImageInfo inf;
89 static PixmapInfo pix; 93 static PixmapInfo pix;
90 94
91 if ( string == "thumbInfo(QString)" ) { 95 if ( string == "thumbInfo(QString)" ) {
92 stream >> inf.file; 96 stream >> inf.file;
93 m_inList.append(inf); 97 m_inList.append(inf);
94 }else if ( string == "thumbInfos(QStringList)" ) { 98 }else if ( string == "thumbInfos(QStringList)" ) {
95 stream >> lst; 99 stream >> lst;
96 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { 100 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
97 qWarning( "Adding thumbinfo for file "+ *it ); 101 owarn << "Adding thumbinfo for file "+ *it << oendl;
98 inf.file = (*it); 102 inf.file = (*it);
99 m_inList.append(inf); 103 m_inList.append(inf);
100 } 104 }
101 }else if ( string == "fullInfo(QString)" ) { 105 }else if ( string == "fullInfo(QString)" ) {
102 inf.kind = true; 106 inf.kind = true;
103 stream >> inf.file; 107 stream >> inf.file;
104 m_inList.append(inf); 108 m_inList.append(inf);
105 }else if ( string == "fullInfos(QStringList)" ) { 109 }else if ( string == "fullInfos(QStringList)" ) {
106 stream >> lst; 110 stream >> lst;
107 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { 111 for(QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
108 qWarning( "Adding fullInfo for"+ *it ); 112 owarn << "Adding fullInfo for"+ *it << oendl;
109 inf.file = (*it); 113 inf.file = (*it);
110 inf.kind = true; 114 inf.kind = true;
111 m_inList.append(inf); 115 m_inList.append(inf);
112 } 116 }
113 }else if ( string == "pixmapInfo(QString,int,int)" ) { 117 }else if ( string == "pixmapInfo(QString,int,int)" ) {
114 stream >> pix.file >> pix.width >> pix.height; 118 stream >> pix.file >> pix.width >> pix.height;
115 m_inPix.append(pix); 119 m_inPix.append(pix);
116 }else if ( string == "pixmapInfos(PixmapInfos)" ) { 120 }else if ( string == "pixmapInfos(PixmapInfos)" ) {
117 PixmapList list; 121 PixmapList list;
118 stream >> list; 122 stream >> list;
119 for(PixmapList::Iterator it = list.begin(); it != list.end(); ++it ) { 123 for(PixmapList::Iterator it = list.begin(); it != list.end(); ++it ) {
120 qWarning( "Got %d %d " + (*it).file, (*it).width , (*it).height ); 124 owarn << "Got " << (*it).width << " " << (*it).height << " " + (*it).file << oendl;
121 m_inPix.append(*it); 125 m_inPix.append(*it);
122 } 126 }
123 }else if ( string == "refUp()" ) { 127 }else if ( string == "refUp()" ) {
124 m_refs++; 128 m_refs++;
125 }else if ( string == "refDown()" ) { 129 }else if ( string == "refDown()" ) {
126 m_refs--; 130 m_refs--;
@@ -178,13 +182,13 @@ void SlaveReciever::slotThumbNail() {
178 static SlaveObjects::Iterator it; 182 static SlaveObjects::Iterator it;
179 static SlaveObjects* map = slaveObjects(); // SlaveMap won't be changed during execution!!! 183 static SlaveObjects* map = slaveObjects(); // SlaveMap won't be changed during execution!!!
180 for(it = map->begin(); it != map->end(); ++it ) { 184 for(it = map->begin(); it != map->end(); ++it ) {
181 SlaveInterface* iface = it.data(); 185 SlaveInterface* iface = it.data();
182 if( iface->supports(inf.file ) ) { 186 if( iface->supports(inf.file ) ) {
183 /* pixmap */ 187 /* pixmap */
184 qWarning( "Asking for thumbNail in size %d %d for "+inf.file, inf.width, inf.height ); 188 owarn << "Asking for thumbNail in size " << inf.width << " " << inf.height << " for "+inf.file << oendl;
185 inf.pixmap = iface->pixmap(inf.file, 64, 64); 189 inf.pixmap = iface->pixmap(inf.file, 64, 64);
186 m_outPix.append( inf ); 190 m_outPix.append( inf );
187 break; 191 break;
188 } 192 }
189 } 193 }
190 194
@@ -197,29 +201,29 @@ void SlaveReciever::slotThumbNail() {
197} 201}
198 202
199void SlaveReciever::slotSend() { 203void SlaveReciever::slotSend() {
200 204
201 m_out->stop(); 205 m_out->stop();
202 206
203 qWarning( "Sending %d %d", outPix().count(), outInf().count() ); 207 owarn << "Sending " << outPix().count() << " " << outInf().count() << "" << oendl;
204 /* queue it and send */ 208 /* queue it and send */
205 /* if this ever gets a service introduce request queues 209 /* if this ever gets a service introduce request queues
206 * so we can differinatate between different clients 210 * so we can differinatate between different clients
207 */ 211 */
208 if (! m_outPix.isEmpty() ) { 212 if (! m_outPix.isEmpty() ) {
209 QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(PixmapList)" ); 213 QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(PixmapList)" );
210 answer << outPix(); 214 answer << outPix();
211 for ( PixmapList::Iterator it = m_outPix.begin();it!=m_outPix.end();++it ) { 215 for ( PixmapList::Iterator it = m_outPix.begin();it!=m_outPix.end();++it ) {
212 qWarning( "Sending out %s %d %d", (*it).file.latin1(), (*it).width, (*it).height ); 216 owarn << "Sending out " << (*it).file.latin1() << " " << (*it).width << " " << (*it).height << "" << oendl;
213 } 217 }
214 } 218 }
215 if ( !m_outList.isEmpty() ) { 219 if ( !m_outList.isEmpty() ) {
216 QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(StringList)" ); 220 QCopEnvelope answer("QPE/opie-eye", "pixmapsHandled(StringList)" );
217 answer << outInf(); 221 answer << outInf();
218 for ( StringList::Iterator it = m_outList.begin();it!=m_outList.end();++it ) { 222 for ( StringList::Iterator it = m_outList.begin();it!=m_outList.end();++it ) {
219 qWarning( "Sending out2 " + (*it).file ); 223 owarn << "Sending out2 " + (*it).file << oendl;
220 } 224 }
221 } 225 }
222 226
223 m_outList.clear(); 227 m_outList.clear();
224 m_outPix.clear(); 228 m_outPix.clear();
225} 229}
diff --git a/noncore/graphics/opie-eye/slave/thumbnailtool.cpp b/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
index a202457..d2e169c 100644
--- a/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
+++ b/noncore/graphics/opie-eye/slave/thumbnailtool.cpp
@@ -1,8 +1,13 @@
1#include "thumbnailtool.h" 1#include "thumbnailtool.h"
2 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */
3#include <qfileinfo.h> 8#include <qfileinfo.h>
4#include <qdir.h> 9#include <qdir.h>
5#include <qimage.h> 10#include <qimage.h>
6#include <qpixmap.h> 11#include <qpixmap.h>
7#include <qstring.h> 12#include <qstring.h>
8 13
@@ -23,28 +28,28 @@ static bool makeThumbDir( const QFileInfo& inf, bool make = false) {
23 * load the thumbnail 28 * load the thumbnail
24 * /foo/bar/imagefoo.gif 29 * /foo/bar/imagefoo.gif
25 * check for a png in /foo/bar/.opie-eye/%dx%d-imagefoo.gif 30 * check for a png in /foo/bar/.opie-eye/%dx%d-imagefoo.gif
26 */ 31 */
27QPixmap ThumbNailTool::getThumb( const QString& path, int width, int height ) { 32QPixmap ThumbNailTool::getThumb( const QString& path, int width, int height ) {
28 QFileInfo inf( path ); 33 QFileInfo inf( path );
29 qWarning( "Get Thumb" ); 34 owarn << "Get Thumb" << oendl;
30 if ( !makeThumbDir( inf ) ) { 35 if ( !makeThumbDir( inf ) ) {
31 QPixmap pix; 36 QPixmap pix;
32 return pix; 37 return pix;
33 } 38 }
34 QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() ); 39 QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() );
35 qWarning( inf.dirPath()+str ); 40 owarn << inf.dirPath()+str << oendl;
36 return QPixmap( inf.dirPath()+str,"PNG" ); 41 return QPixmap( inf.dirPath()+str,"PNG" );
37 42
38} 43}
39 44
40void ThumbNailTool::putThumb( const QString& path, const QPixmap& pix, int width, int height ) { 45void ThumbNailTool::putThumb( const QString& path, const QPixmap& pix, int width, int height ) {
41 QFileInfo inf( path ); 46 QFileInfo inf( path );
42 makeThumbDir( inf, true ); 47 makeThumbDir( inf, true );
43 QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() ); 48 QString str = QString( "/.opie-eye/%1x%2-%3" ).arg( width ).arg( height ).arg( inf.fileName() );
44 qWarning( inf.dirPath()+str ); 49 owarn << inf.dirPath()+str << oendl;
45 pix.save( inf.dirPath()+str, "PNG" ); 50 pix.save( inf.dirPath()+str, "PNG" );
46} 51}
47 52
48 53
49QPixmap ThumbNailTool::scaleImage( QImage& img, int w, int h ) { 54QPixmap ThumbNailTool::scaleImage( QImage& img, int w, int h ) {
50 double hs = (double)h / (double)img.height() ; 55 double hs = (double)h / (double)img.height() ;
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp
index 28a42eb..36def67 100644
--- a/noncore/multimedia/opieplayer2/audiowidget.cpp
+++ b/noncore/multimedia/opieplayer2/audiowidget.cpp
@@ -130,13 +130,13 @@ void AudioWidget::sliderReleased() {
130 return; 130 return;
131 long val = long((double)slider.value() * mediaPlayerState.length() / slider.width()); 131 long val = long((double)slider.value() * mediaPlayerState.length() / slider.width());
132 mediaPlayerState.setPosition( val ); 132 mediaPlayerState.setPosition( val );
133} 133}
134 134
135void AudioWidget::setPosition( long i ) { 135void AudioWidget::setPosition( long i ) {
136 // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<set position %d",i); 136 // odebug << "<<<<<<<<<<<<<<<<<<<<<<<<set position " << i << "" << oendl;
137 updateSlider( i, mediaPlayerState.length() ); 137 updateSlider( i, mediaPlayerState.length() );
138} 138}
139 139
140 140
141void AudioWidget::setLength( long max ) { 141void AudioWidget::setLength( long max ) {
142 updateSlider( mediaPlayerState.position(), max ); 142 updateSlider( mediaPlayerState.position(), max );
@@ -184,25 +184,25 @@ void AudioWidget::loadSkin()
184 resizeEvent( 0 ); 184 resizeEvent( 0 );
185} 185}
186 186
187void AudioWidget::setSeekable( bool isSeekable ) { 187void AudioWidget::setSeekable( bool isSeekable ) {
188 188
189 if ( !isSeekable ) { 189 if ( !isSeekable ) {
190 qDebug("<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>"); 190 odebug << "<<<<<<<<<<<<<<file is STREAMING>>>>>>>>>>>>>>>>>>>" << oendl;
191 if( !slider.isHidden()) { 191 if( !slider.isHidden()) {
192 slider.hide(); 192 slider.hide();
193 } 193 }
194 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 194 disconnect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
195 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 195 disconnect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
196 disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 196 disconnect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
197 disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 197 disconnect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
198 } else { 198 } else {
199 // this stops the slider from being moved, thus 199 // this stops the slider from being moved, thus
200 // does not stop stream when it reaches the end 200 // does not stop stream when it reaches the end
201 slider.show(); 201 slider.show();
202 qDebug( " CONNECT SET POSTION " ); 202 odebug << " CONNECT SET POSTION " << oendl;
203 connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) ); 203 connect( &mediaPlayerState, SIGNAL( positionChanged(long) ),this, SLOT( setPosition(long) ) );
204 connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) ); 204 connect( &mediaPlayerState, SIGNAL( positionUpdated(long) ),this, SLOT( setPosition(long) ) );
205 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) ); 205 connect( &slider, SIGNAL( sliderPressed() ), this, SLOT( sliderPressed() ) );
206 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) ); 206 connect( &slider, SIGNAL( sliderReleased() ), this, SLOT( sliderReleased() ) );
207 } 207 }
208} 208}
@@ -268,13 +268,13 @@ void AudioWidget::keyReleaseEvent( QKeyEvent *e) {
268 switch ( e->key() ) { 268 switch ( e->key() ) {
269 ////////////////////////////// Zaurus keys 269 ////////////////////////////// Zaurus keys
270 case Key_Home: 270 case Key_Home:
271 break; 271 break;
272 case Key_F9: //activity 272 case Key_F9: //activity
273 hide(); 273 hide();
274 // qDebug("Audio F9"); 274 // odebug << "Audio F9" << oendl;
275 e->accept(); 275 e->accept();
276 break; 276 break;
277 case Key_F10: //contacts 277 case Key_F10: //contacts
278 break; 278 break;
279 case Key_F11: //menu 279 case Key_F11: //menu
280 mediaPlayerState.toggleBlank(); 280 mediaPlayerState.toggleBlank();
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp
index a42b8e5..5c24dbe 100644
--- a/noncore/multimedia/opieplayer2/lib.cpp
+++ b/noncore/multimedia/opieplayer2/lib.cpp
@@ -103,16 +103,16 @@ Lib::Lib( InitializationMode initMode, XineVideoWidget* widget )
103 else 103 else
104 start(); 104 start();
105} 105}
106 106
107void Lib::run() 107void Lib::run()
108{ 108{
109 qDebug( "Lib::run() started" ); 109 odebug << "Lib::run() started" << oendl;
110 initialize(); 110 initialize();
111 m_initialized = true; 111 m_initialized = true;
112 qDebug( "Lib::run() finished" ); 112 odebug << "Lib::run() finished" << oendl;
113} 113}
114 114
115void Lib::initialize() 115void Lib::initialize()
116{ 116{
117 m_duringInitialization = true; 117 m_duringInitialization = true;
118 m_xine = xine_new( ); 118 m_xine = xine_new( );
@@ -212,13 +212,13 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) {
212 return xine_play( m_stream, startPos, start_time); 212 return xine_play( m_stream, startPos, start_time);
213} 213}
214 214
215void Lib::stop() { 215void Lib::stop() {
216 assert( m_initialized ); 216 assert( m_initialized );
217 217
218 qDebug("<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>"); 218 odebug << "<<<<<<<< STOP IN LIB TRIGGERED >>>>>>>" << oendl;
219 xine_stop( m_stream ); 219 xine_stop( m_stream );
220} 220}
221 221
222void Lib::pause( bool toggle ) { 222void Lib::pause( bool toggle ) {
223 assert( m_initialized ); 223 assert( m_initialized );
224 224
@@ -324,15 +324,15 @@ int Lib::error() const {
324 324
325void Lib::ensureInitialized() 325void Lib::ensureInitialized()
326{ 326{
327 if ( m_initialized ) 327 if ( m_initialized )
328 return; 328 return;
329 329
330 qDebug( "waiting for initialization thread to finish" ); 330 odebug << "waiting for initialization thread to finish" << oendl;
331 wait(); 331 wait();
332 qDebug( "initialization thread finished!" ); 332 odebug << "initialization thread finished!" << oendl;
333} 333}
334 334
335void Lib::setWidget( XineVideoWidget *widget ) 335void Lib::setWidget( XineVideoWidget *widget )
336{ 336{
337 m_wid = widget; 337 m_wid = widget;
338 resize ( m_wid-> size ( ) ); 338 resize ( m_wid-> size ( ) );
@@ -419,13 +419,13 @@ void Lib::xine_display_frame( void* user_data, uint8_t *frame,
419} 419}
420 420
421void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) { 421void Lib::drawFrame( uint8_t* frame, int width, int height, int bytes ) {
422 assert( m_initialized ); 422 assert( m_initialized );
423 423
424 if ( !m_video ) { 424 if ( !m_video ) {
425 qWarning("not showing video now"); 425 owarn << "not showing video now" << oendl;
426 return; 426 return;
427 } 427 }
428 428
429 assert( m_wid ); 429 assert( m_wid );
430 430
431 m_wid-> setVideoFrame ( frame, width, height, bytes ); 431 m_wid-> setVideoFrame ( frame, width, height, bytes );
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index a236775..7e38fc7 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -149,13 +149,13 @@ void MediaPlayer::next() {
149 play(); 149 play();
150 } 150 }
151 } else { 151 } else {
152 mediaPlayerState.setList(); 152 mediaPlayerState.setList();
153 } 153 }
154 } else { //if playing from file list, let's just stop 154 } else { //if playing from file list, let's just stop
155 qDebug("<<<<<<<<<<<<<<<<<stop for filelists"); 155 odebug << "<<<<<<<<<<<<<<<<<stop for filelists" << oendl;
156 mediaPlayerState.setPlaying(false); 156 mediaPlayerState.setPlaying(false);
157 mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection ); 157 mediaPlayerState.setDisplayType( MediaPlayerState::MediaSelection );
158 if(l) mediaPlayerState.setLooping(l); 158 if(l) mediaPlayerState.setLooping(l);
159 if(r) mediaPlayerState.setShuffled(r); 159 if(r) mediaPlayerState.setShuffled(r);
160 } 160 }
161 qApp->processEvents(); 161 qApp->processEvents();
@@ -282,37 +282,37 @@ void MediaPlayer::blank( bool b ) {
282 fd=open("/dev/fb0",O_RDWR); 282 fd=open("/dev/fb0",O_RDWR);
283#ifdef QT_QWS_SL5XXX 283#ifdef QT_QWS_SL5XXX
284 fl= open( "/dev/fl", O_RDWR ); 284 fl= open( "/dev/fl", O_RDWR );
285#endif 285#endif
286 if (fd != -1) { 286 if (fd != -1) {
287 if ( b ) { 287 if ( b ) {
288 qDebug("do blanking"); 288 odebug << "do blanking" << oendl;
289#ifdef QT_QWS_SL5XXX 289#ifdef QT_QWS_SL5XXX
290 ioctl( fd, FBIOBLANK, 1 ); 290 ioctl( fd, FBIOBLANK, 1 );
291 if(fl !=-1) { 291 if(fl !=-1) {
292 ioctl( fl, 2 ); 292 ioctl( fl, 2 );
293 ::close(fl); 293 ::close(fl);
294 } 294 }
295#else 295#else
296 ioctl( fd, FBIOBLANK, 3 ); 296 ioctl( fd, FBIOBLANK, 3 );
297#endif 297#endif
298 isBlanked = TRUE; 298 isBlanked = TRUE;
299 } else { 299 } else {
300 qDebug("do unblanking"); 300 odebug << "do unblanking" << oendl;
301 ioctl( fd, FBIOBLANK, 0); 301 ioctl( fd, FBIOBLANK, 0);
302#ifdef QT_QWS_SL5XXX 302#ifdef QT_QWS_SL5XXX
303 if(fl != -1) { 303 if(fl != -1) {
304 ioctl( fl, 1); 304 ioctl( fl, 1);
305 ::close(fl); 305 ::close(fl);
306 } 306 }
307#endif 307#endif
308 isBlanked = FALSE; 308 isBlanked = FALSE;
309 } 309 }
310 close( fd ); 310 close( fd );
311 } else { 311 } else {
312 qDebug("<< /dev/fb0 could not be opened >>"); 312 odebug << "<< /dev/fb0 could not be opened >>" << oendl;
313 } 313 }
314} 314}
315 315
316void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { 316void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
317 switch ( e->key() ) { 317 switch ( e->key() ) {
318////////////////////////////// Zaurus keys 318////////////////////////////// Zaurus keys
@@ -322,17 +322,17 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
322 break; 322 break;
323 case Key_F10: //contacts 323 case Key_F10: //contacts
324 break; 324 break;
325 case Key_F11: //menu 325 case Key_F11: //menu
326 break; 326 break;
327 case Key_F12: //home 327 case Key_F12: //home
328 qDebug("Blank here"); 328 odebug << "Blank here" << oendl;
329// mediaPlayerState->toggleBlank(); 329// mediaPlayerState->toggleBlank();
330 break; 330 break;
331 case Key_F13: //mail 331 case Key_F13: //mail
332 qDebug("Blank here"); 332 odebug << "Blank here" << oendl;
333 // mediaPlayerState->toggleBlank(); 333 // mediaPlayerState->toggleBlank();
334 break; 334 break;
335 } 335 }
336} 336}
337 337
338void MediaPlayer::cleanUp() {// this happens on closing 338void MediaPlayer::cleanUp() {// this happens on closing
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp
index 26d5e15..95dbab5 100644
--- a/noncore/multimedia/opieplayer2/om3u.cpp
+++ b/noncore/multimedia/opieplayer2/om3u.cpp
@@ -34,36 +34,36 @@
34 34
35 35
36//extern PlayListWidget *playList; 36//extern PlayListWidget *playList;
37 37
38Om3u::Om3u( const QString &filePath, int mode) 38Om3u::Om3u( const QString &filePath, int mode)
39 : QStringList (){ 39 : QStringList (){
40qDebug("<<<<<<<new m3u "+filePath); 40odebug << "<<<<<<<new m3u "+filePath << oendl;
41 f.setName(filePath); 41 f.setName(filePath);
42 f.open(mode); 42 f.open(mode);
43} 43}
44 44
45Om3u::~Om3u(){} 45Om3u::~Om3u(){}
46 46
47void Om3u::readM3u() { 47void Om3u::readM3u() {
48// qDebug("<<<<<<reading m3u "+f.name()); 48// odebug << "<<<<<<reading m3u "+f.name() << oendl;
49 QTextStream t(&f); 49 QTextStream t(&f);
50 t.setEncoding(QTextStream::UnicodeUTF8); 50 t.setEncoding(QTextStream::UnicodeUTF8);
51 QString s; 51 QString s;
52 while ( !t.atEnd() ) { 52 while ( !t.atEnd() ) {
53 s=t.readLine(); 53 s=t.readLine();
54// qDebug(s); 54// odebug << s << oendl;
55 if( s.find( "#", 0, TRUE) == -1 ) { 55 if( s.find( "#", 0, TRUE) == -1 ) {
56 if( s.left(2) == "E:" || s.left(2) == "P:" ) { 56 if( s.left(2) == "E:" || s.left(2) == "P:" ) {
57 s = s.right( s.length() -2 ); 57 s = s.right( s.length() -2 );
58 QFileInfo f( s ); 58 QFileInfo f( s );
59 QString name = f.baseName(); 59 QString name = f.baseName();
60 name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); 60 name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 );
61 s=s.replace( QRegExp( "\\" ), "/" ); 61 s=s.replace( QRegExp( "\\" ), "/" );
62 append(s); 62 append(s);
63// qDebug(s); 63// odebug << s << oendl;
64 } else { // is url 64 } else { // is url
65 QString name; 65 QString name;
66 name = s; 66 name = s;
67 append(name); 67 append(name);
68 } 68 }
69 } 69 }
@@ -77,13 +77,13 @@ void Om3u::readPls() { //it's a pls file
77 while ( !t.atEnd() ) { 77 while ( !t.atEnd() ) {
78 s = t.readLine(); 78 s = t.readLine();
79 if( s.left(4) == "File" ) { 79 if( s.left(4) == "File" ) {
80 s = s.right( s.length() - s.find("=",0,true)-1 ); 80 s = s.right( s.length() - s.find("=",0,true)-1 );
81 s = s.stripWhiteSpace(); 81 s = s.stripWhiteSpace();
82 s.replace( QRegExp( "%20" )," "); 82 s.replace( QRegExp( "%20" )," ");
83// qDebug( "adding " + s + " to playlist" ); 83// odebug << "adding " + s + " to playlist" << oendl;
84 // numberofentries=2 84 // numberofentries=2
85 // File1=http 85 // File1=http
86 // Title 86 // Title
87 // Length 87 // Length
88 // Version 88 // Version
89 // File2=http 89 // File2=http
@@ -111,13 +111,13 @@ void Om3u::readPls() { //it's a pls file
111void Om3u::write() { //writes list to m3u file 111void Om3u::write() { //writes list to m3u file
112 QString list; 112 QString list;
113 QTextStream t(&f); 113 QTextStream t(&f);
114 t.setEncoding(QTextStream::UnicodeUTF8); 114 t.setEncoding(QTextStream::UnicodeUTF8);
115 if(count()>0) { 115 if(count()>0) {
116 for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { 116 for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
117// qDebug(*it); 117// odebug << *it << oendl;
118 t << *it << "\n"; 118 t << *it << "\n";
119 } 119 }
120 } 120 }
121// f.close(); 121// f.close();
122} 122}
123 123
@@ -127,13 +127,13 @@ void Om3u::add(const QString &filePath) { //adds to m3u file
127 127
128void Om3u::remove(const QString &filePath) { //removes from m3u list 128void Om3u::remove(const QString &filePath) { //removes from m3u list
129 QString list, currentFile; 129 QString list, currentFile;
130 if(count()>0) { 130 if(count()>0) {
131 for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { 131 for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
132 currentFile=*it; 132 currentFile=*it;
133 // qDebug(*it); 133 // odebug << *it << oendl;
134 134
135 if( filePath != currentFile) 135 if( filePath != currentFile)
136 list += currentFile+"\n"; 136 list += currentFile+"\n";
137 } 137 }
138 f.writeBlock( list, list.length() ); 138 f.writeBlock( list, list.length() );
139 } 139 }
diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp
index 015896f..3499837 100644
--- a/noncore/multimedia/opieplayer2/playlistselection.cpp
+++ b/noncore/multimedia/opieplayer2/playlistselection.cpp
@@ -41,13 +41,13 @@ private:
41}; 41};
42 42
43 43
44PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) 44PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
45 : QListView( parent, name ) 45 : QListView( parent, name )
46{ 46{
47// qDebug("starting playlistselector"); 47// odebug << "starting playlistselector" << oendl;
48// #ifdef USE_PLAYLIST_BACKGROUND 48// #ifdef USE_PLAYLIST_BACKGROUND
49// setStaticBackground( TRUE ); 49// setStaticBackground( TRUE );
50// setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); 50// setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) );
51 51
52// setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); 52// setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) );
53// #endif 53// #endif
@@ -62,13 +62,13 @@ PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
62PlayListSelection::~PlayListSelection() { 62PlayListSelection::~PlayListSelection() {
63} 63}
64 64
65 65
66// #ifdef USE_PLAYLIST_BACKGROUND 66// #ifdef USE_PLAYLIST_BACKGROUND
67void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { 67void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) {
68// qDebug("drawBackground"); 68// odebug << "drawBackground" << oendl;
69 p->fillRect( r, QBrush( white ) ); 69 p->fillRect( r, QBrush( white ) );
70// QImage logo = Resource::loadImage( "launcher/opielogo" ); 70// QImage logo = Resource::loadImage( "launcher/opielogo" );
71// if ( !logo.isNull() ) 71// if ( !logo.isNull() )
72// p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); 72// p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo );
73} 73}
74// #endif 74// #endif
@@ -181,24 +181,24 @@ void PlayListSelection::unSelect()
181 181
182void PlayListSelection::writeCurrent( Config& cfg ) { 182void PlayListSelection::writeCurrent( Config& cfg ) {
183 cfg.setGroup("PlayList"); 183 cfg.setGroup("PlayList");
184 QListViewItem *item = selectedItem(); 184 QListViewItem *item = selectedItem();
185 if ( item ) 185 if ( item )
186 cfg.writeEntry("current", item->text(0) ); 186 cfg.writeEntry("current", item->text(0) );
187 qDebug(item->text(0)); 187 odebug << item->text(0) << oendl;
188 188
189} 189}
190 190
191void PlayListSelection::setSelectedItem(const QString &strk ) { 191void PlayListSelection::setSelectedItem(const QString &strk ) {
192 192
193 unSelect(); 193 unSelect();
194 QListViewItemIterator it( this ); 194 QListViewItemIterator it( this );
195 for ( ; it.current(); ++it ) { 195 for ( ; it.current(); ++it ) {
196// qDebug( it.current()->text(0)); 196// odebug << it.current()->text(0) << oendl;
197 if( strk == it.current()->text(0)) { 197 if( strk == it.current()->text(0)) {
198// qDebug( "We have a match "+strk); 198// odebug << "We have a match "+strk << oendl;
199 setSelected( it.current(), TRUE); 199 setSelected( it.current(), TRUE);
200 ensureItemVisible( it.current() ); 200 ensureItemVisible( it.current() );
201 return; 201 return;
202 } 202 }
203 } 203 }
204// setSelected( item, TRUE ); 204// setSelected( item, TRUE );
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 4460833..956d206 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -179,17 +179,17 @@ void PlayListWidget::writeDefaultPlaylist() {
179 Config config( "OpiePlayer" ); 179 Config config( "OpiePlayer" );
180 config.setGroup( "PlayList" ); 180 config.setGroup( "PlayList" );
181 QString filename=QPEApplication::documentDir() + "/default.m3u"; 181 QString filename=QPEApplication::documentDir() + "/default.m3u";
182 QString currentString = config.readEntry( "CurrentPlaylist", filename); 182 QString currentString = config.readEntry( "CurrentPlaylist", filename);
183 if( currentString == filename) { 183 if( currentString == filename) {
184 Om3u *m3uList; 184 Om3u *m3uList;
185 // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); 185 // odebug << "<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>" << oendl;
186 if( d->selectedFiles->first() ) { 186 if( d->selectedFiles->first() ) {
187 m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); 187 m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate);
188 do { 188 do {
189 // qDebug(d->selectedFiles->current()->file()); 189 // odebug << d->selectedFiles->current()->file() << oendl;
190 m3uList->add( d->selectedFiles->current()->file() ); 190 m3uList->add( d->selectedFiles->current()->file() );
191 } 191 }
192 while ( d->selectedFiles->next() ); 192 while ( d->selectedFiles->next() );
193 193
194 m3uList->write(); 194 m3uList->write();
195 m3uList->close(); 195 m3uList->close();
@@ -322,13 +322,13 @@ void PlayListWidget::addAllVideoToList() {
322 writeCurrentM3u(); 322 writeCurrentM3u();
323 d->selectedFiles->first(); 323 d->selectedFiles->first();
324} 324}
325 325
326 326
327void PlayListWidget::setDocument( const QString& fileref ) { 327void PlayListWidget::setDocument( const QString& fileref ) {
328 // qDebug( "<<<<<<<<set document>>>>>>>>>> "+fileref ); 328 // odebug << "<<<<<<<<set document>>>>>>>>>> "+fileref << oendl;
329 fromSetDocument = TRUE; 329 fromSetDocument = TRUE;
330 QFileInfo fileInfo(fileref); 330 QFileInfo fileInfo(fileref);
331 331
332 if ( !fileInfo.exists() ) { 332 if ( !fileInfo.exists() ) {
333 QMessageBox::warning( this, tr( "Invalid File" ), 333 QMessageBox::warning( this, tr( "Invalid File" ),
334 tr( "There was a problem in getting the file." ) ); 334 tr( "There was a problem in getting the file." ) );
@@ -398,13 +398,13 @@ bool PlayListWidget::prev() {
398 return TRUE; 398 return TRUE;
399 } 399 }
400} 400}
401 401
402 402
403bool PlayListWidget::next() { 403bool PlayListWidget::next() {
404//qDebug("<<<<<<<<<<<<next()"); 404//odebug << "<<<<<<<<<<<<next()" << oendl;
405 if ( mediaPlayerState->isShuffled() ) { 405 if ( mediaPlayerState->isShuffled() ) {
406 return prev(); 406 return prev();
407 } else { 407 } else {
408 if ( !d->selectedFiles->next() ) { 408 if ( !d->selectedFiles->next() ) {
409 if ( mediaPlayerState->isLooping() ) { 409 if ( mediaPlayerState->isLooping() ) {
410 return d->selectedFiles->first(); 410 return d->selectedFiles->first();
@@ -609,13 +609,13 @@ void PlayListWidget::openURL() {
609 QString filename, name; 609 QString filename, name;
610 InputDialog *fileDlg; 610 InputDialog *fileDlg;
611 fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0); 611 fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0);
612 fileDlg->exec(); 612 fileDlg->exec();
613 if( fileDlg->result() == 1 ) { 613 if( fileDlg->result() == 1 ) {
614 filename = fileDlg->text(); 614 filename = fileDlg->text();
615 qDebug( "Selected filename is " + filename ); 615 odebug << "Selected filename is " + filename << oendl;
616 // Om3u *m3uList; 616 // Om3u *m3uList;
617 DocLnk lnk; 617 DocLnk lnk;
618 Config cfg( "OpiePlayer" ); 618 Config cfg( "OpiePlayer" );
619 cfg.setGroup("PlayList"); 619 cfg.setGroup("PlayList");
620 620
621 if(filename.left(4) == "http") { 621 if(filename.left(4) == "http") {
@@ -685,13 +685,13 @@ void PlayListWidget::openFile() {
685 str=str.right(str.length()-1); 685 str=str.right(str.length()-1);
686 } 686 }
687 cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() ); 687 cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() );
688 688
689 if( !str.isEmpty() ) { 689 if( !str.isEmpty() ) {
690 690
691 qDebug( "Selected filename is " + str ); 691 odebug << "Selected filename is " + str << oendl;
692 filename = str; 692 filename = str;
693 DocLnk lnk; 693 DocLnk lnk;
694 694
695 if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { 695 if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) {
696 readListFromFile( filename ); 696 readListFromFile( filename );
697 } else { 697 } else {
@@ -703,26 +703,26 @@ void PlayListWidget::openFile() {
703 } 703 }
704 } 704 }
705} 705}
706 706
707 707
708void PlayListWidget::readListFromFile( const QString &filename ) { 708void PlayListWidget::readListFromFile( const QString &filename ) {
709 qDebug( "read list filename " + filename ); 709 odebug << "read list filename " + filename << oendl;
710 QFileInfo fi(filename); 710 QFileInfo fi(filename);
711 Om3u *m3uList; 711 Om3u *m3uList;
712 QString s, name; 712 QString s, name;
713 m3uList = new Om3u( filename, IO_ReadOnly ); 713 m3uList = new Om3u( filename, IO_ReadOnly );
714 if(fi.extension(false).find("m3u",0,false) != -1 ) 714 if(fi.extension(false).find("m3u",0,false) != -1 )
715 m3uList->readM3u(); 715 m3uList->readM3u();
716 else if(fi.extension(false).find("pls",0,false) != -1 ) 716 else if(fi.extension(false).find("pls",0,false) != -1 )
717 m3uList->readPls(); 717 m3uList->readPls();
718 718
719 DocLnk lnk; 719 DocLnk lnk;
720 for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { 720 for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) {
721 s = *it; 721 s = *it;
722 // qDebug(s); 722 // odebug << s << oendl;
723 if(s.left(4)=="http") { 723 if(s.left(4)=="http") {
724 lnk.setName( s ); //sets file name 724 lnk.setName( s ); //sets file name
725 lnk.setIcon("opieplayer2/musicfile"); 725 lnk.setIcon("opieplayer2/musicfile");
726 lnk.setFile( s ); //sets file name 726 lnk.setFile( s ); //sets file name
727 727
728 } else { //is file 728 } else { //is file
@@ -750,27 +750,27 @@ void PlayListWidget::readListFromFile( const QString &filename ) {
750 setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); 750 setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName());
751 751
752} 752}
753 753
754// writes current playlist to current m3u file */ 754// writes current playlist to current m3u file */
755 void PlayListWidget::writeCurrentM3u() { 755 void PlayListWidget::writeCurrentM3u() {
756 qDebug("writing to current m3u"); 756 odebug << "writing to current m3u" << oendl;
757 Config cfg( "OpiePlayer" ); 757 Config cfg( "OpiePlayer" );
758 cfg.setGroup("PlayList"); 758 cfg.setGroup("PlayList");
759 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); 759 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default");
760 760
761 Om3u *m3uList; 761 Om3u *m3uList;
762 m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); 762 m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate );
763 if( d->selectedFiles->first()) { 763 if( d->selectedFiles->first()) {
764 764
765 do { 765 do {
766 // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file()); 766 // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl;
767 m3uList->add( d->selectedFiles->current()->file() ); 767 m3uList->add( d->selectedFiles->current()->file() );
768 } 768 }
769 while ( d->selectedFiles->next() ); 769 while ( d->selectedFiles->next() );
770 // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); 770 // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl;
771 m3uList->write(); 771 m3uList->write();
772 m3uList->close(); 772 m3uList->close();
773 } 773 }
774 delete m3uList; 774 delete m3uList;
775 775
776 } 776 }
@@ -809,13 +809,13 @@ void PlayListWidget::writem3u() {
809 QString name, filename, list; 809 QString name, filename, list;
810 Om3u *m3uList; 810 Om3u *m3uList;
811 811
812 if( !str.isEmpty() ) { 812 if( !str.isEmpty() ) {
813 name = str; 813 name = str;
814 // name = fileDlg->text(); 814 // name = fileDlg->text();
815// qDebug( filename ); 815// odebug << filename << oendl;
816 if( name.find("/",0,true) != -1) {// assume they specify a file path 816 if( name.find("/",0,true) != -1) {// assume they specify a file path
817 filename = name; 817 filename = name;
818 name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); 818 name = name.right(name.length()- name.findRev("/",-1,true) - 1 );
819 } 819 }
820 else //otherwise dump it somewhere noticable 820 else //otherwise dump it somewhere noticable
821 filename = QPEApplication::documentDir() + "/" + name; 821 filename = QPEApplication::documentDir() + "/" + name;
@@ -827,33 +827,33 @@ void PlayListWidget::writem3u() {
827 m3uList = new Om3u( filename, IO_ReadWrite | IO_Truncate); 827 m3uList = new Om3u( filename, IO_ReadWrite | IO_Truncate);
828 828
829 do { 829 do {
830 m3uList->add( d->selectedFiles->current()->file()); 830 m3uList->add( d->selectedFiles->current()->file());
831 } 831 }
832 while ( d->selectedFiles->next() ); 832 while ( d->selectedFiles->next() );
833 // qDebug( list ); 833 // odebug << list << oendl;
834 m3uList->write(); 834 m3uList->write();
835 m3uList->close(); 835 m3uList->close();
836 delete m3uList; 836 delete m3uList;
837 837
838 //delete fileDlg; 838 //delete fileDlg;
839 839
840 DocLnk lnk; 840 DocLnk lnk;
841 lnk.setFile( filename); 841 lnk.setFile( filename);
842 lnk.setIcon("opieplayer2/playlist2"); 842 lnk.setIcon("opieplayer2/playlist2");
843 lnk.setName( name); //sets file name 843 lnk.setName( name); //sets file name
844 844
845 // qDebug(filename); 845 // odebug << filename << oendl;
846 Config config( "OpiePlayer" ); 846 Config config( "OpiePlayer" );
847 config.setGroup( "PlayList" ); 847 config.setGroup( "PlayList" );
848 848
849 config.writeEntry("CurrentPlaylist",filename); 849 config.writeEntry("CurrentPlaylist",filename);
850 currentPlayList=filename; 850 currentPlayList=filename;
851 851
852 if(!lnk.writeLink()) { 852 if(!lnk.writeLink()) {
853 qDebug("Writing doclink did not work"); 853 odebug << "Writing doclink did not work" << oendl;
854 } 854 }
855 855
856 setCaption(tr("OpiePlayer: ") + name); 856 setCaption(tr("OpiePlayer: ") + name);
857 } 857 }
858 } 858 }
859} 859}
@@ -881,13 +881,13 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) {
881 addSelected(); 881 addSelected();
882 break; 882 break;
883 case Key_R: //remove from playlist 883 case Key_R: //remove from playlist
884 removeSelected(); 884 removeSelected();
885 break; 885 break;
886 // case Key_P: //play 886 // case Key_P: //play
887 // qDebug("Play"); 887 // odebug << "Play" << oendl;
888 // playSelected(); 888 // playSelected();
889 // break; 889 // break;
890 case Key_Space: 890 case Key_Space:
891 // playSelected(); puh 891 // playSelected(); puh
892 break; 892 break;
893 case Key_1: 893 case Key_1:
@@ -911,13 +911,13 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) {
911 // d->selectedFiles->last(); 911 // d->selectedFiles->last();
912 break; 912 break;
913 } 913 }
914} 914}
915 915
916void PlayListWidget::pmViewActivated(int index) { 916void PlayListWidget::pmViewActivated(int index) {
917// qDebug("%d", index); 917// odebug << "" << index << "" << oendl;
918 switch(index) { 918 switch(index) {
919 case -16: 919 case -16:
920 { 920 {
921 mediaPlayerState->toggleFullscreen(); 921 mediaPlayerState->toggleFullscreen();
922 bool b=mediaPlayerState->isFullscreen(); 922 bool b=mediaPlayerState->isFullscreen();
923 pmView->setItemChecked( index, b); 923 pmView->setItemChecked( index, b);
@@ -941,13 +941,13 @@ void PlayListWidget::populateSkinsMenu() {
941 skinsDir.setSorting(QDir::Name ); 941 skinsDir.setSorting(QDir::Name );
942 const QFileInfoList *skinslist = skinsDir.entryInfoList(); 942 const QFileInfoList *skinslist = skinsDir.entryInfoList();
943 QFileInfoListIterator it( *skinslist ); 943 QFileInfoListIterator it( *skinslist );
944 QFileInfo *fi; 944 QFileInfo *fi;
945 while ( ( fi = it.current() ) ) { 945 while ( ( fi = it.current() ) ) {
946 skinName = fi->fileName(); 946 skinName = fi->fileName();
947// qDebug( fi->fileName() ); 947// odebug << fi->fileName() << oendl;
948 if( skinName != "." && skinName != ".." && skinName !="CVS" ) { 948 if( skinName != "." && skinName != ".." && skinName !="CVS" ) {
949 item = skinsMenu->insertItem( fi->fileName() ) ; 949 item = skinsMenu->insertItem( fi->fileName() ) ;
950 } 950 }
951 if( skinName == "default" ) { 951 if( skinName == "default" ) {
952 defaultSkinIndex = item; 952 defaultSkinIndex = item;
953 } 953 }
@@ -997,13 +997,13 @@ PlayListWidget::Entry PlayListWidget::currentEntry() const
997QString PlayListWidget::currentFileListPathName() const { 997QString PlayListWidget::currentFileListPathName() const {
998 return currentFileListView->currentItem()->text( 3 ); 998 return currentFileListView->currentItem()->text( 3 );
999} 999}
1000 1000
1001 1001
1002void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { 1002void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
1003 qDebug("qcop message "+msg ); 1003 odebug << "qcop message "+msg << oendl;
1004 QDataStream stream ( data, IO_ReadOnly ); 1004 QDataStream stream ( data, IO_ReadOnly );
1005 if ( msg == "play()" ) { //plays current selection 1005 if ( msg == "play()" ) { //plays current selection
1006 btnPlay( true); 1006 btnPlay( true);
1007 } else if ( msg == "stop()" ) { 1007 } else if ( msg == "stop()" ) {
1008 mediaPlayerState->setPlaying( false); 1008 mediaPlayerState->setPlaying( false);
1009 } else if ( msg == "togglePause()" ) { 1009 } else if ( msg == "togglePause()" ) {
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
index 2ff190d..922f9d7 100644
--- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp
@@ -180,13 +180,13 @@ void PlayListWidgetGui::setView( char view ) {
180 else 180 else
181 hide(); 181 hide();
182} 182}
183 183
184 184
185void PlayListWidgetGui::setActiveWindow() { 185void PlayListWidgetGui::setActiveWindow() {
186 // qDebug("SETTING active window"); 186 // odebug << "SETTING active window" << oendl;
187 // When we get raised we need to ensure that it switches views 187 // When we get raised we need to ensure that it switches views
188 MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType(); 188 MediaPlayerState::DisplayType origDisplayType = mediaPlayerState->displayType();
189 mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate 189 mediaPlayerState->setDisplayType( MediaPlayerState::MediaSelection ); // invalidate
190 mediaPlayerState->setDisplayType( origDisplayType ); // now switch back 190 mediaPlayerState->setDisplayType( origDisplayType ); // now switch back
191} 191}
192 192
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp
index 7c38983..84f5f87 100644
--- a/noncore/multimedia/opieplayer2/skin.cpp
+++ b/noncore/multimedia/opieplayer2/skin.cpp
@@ -175,17 +175,17 @@ SkinData *SkinCache::lookupAndTake( const QString &skinPath, const QString &file
175 QString key = skinPath + fileNameInfix; 175 QString key = skinPath + fileNameInfix;
176 176
177 SkinData *data = m_cache.take( key ); 177 SkinData *data = m_cache.take( key );
178 if ( !data ) 178 if ( !data )
179 data = new SkinData; 179 data = new SkinData;
180 else 180 else
181 qDebug( "SkinCache: hit" ); 181 odebug << "SkinCache: hit" << oendl;
182 182
183 QPixmap *bgPixmap = m_backgroundPixmapCache.find( skinPath ); 183 QPixmap *bgPixmap = m_backgroundPixmapCache.find( skinPath );
184 if ( bgPixmap ) { 184 if ( bgPixmap ) {
185 qDebug( "SkinCache: hit on bgpixmap" ); 185 odebug << "SkinCache: hit on bgpixmap" << oendl;
186 data->backgroundPixmap = *bgPixmap; 186 data->backgroundPixmap = *bgPixmap;
187 } 187 }
188 else 188 else
189 data->backgroundPixmap = QPixmap(); 189 data->backgroundPixmap = QPixmap();
190 190
191 return data; 191 return data;
@@ -215,38 +215,38 @@ SkinLoader::IncrementalLoader::IncrementalLoader( const Info &info )
215} 215}
216 216
217SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadStep() 217SkinLoader::IncrementalLoader::LoaderResult SkinLoader::IncrementalLoader::loadStep()
218{ 218{
219 switch ( m_currentState ) { 219 switch ( m_currentState ) {
220 case LoadBackgroundPixmap: 220 case LoadBackgroundPixmap:
221 qDebug( "load bgpixmap" ); 221 odebug << "load bgpixmap" << oendl;
222 m_skin.backgroundPixmap(); 222 m_skin.backgroundPixmap();
223 m_currentState = LoadButtonUpImage; 223 m_currentState = LoadButtonUpImage;
224 break; 224 break;
225 case LoadButtonUpImage: 225 case LoadButtonUpImage:
226 qDebug( "load upimage" ); 226 odebug << "load upimage" << oendl;
227 m_skin.buttonUpImage(); 227 m_skin.buttonUpImage();
228 m_currentState = LoadButtonDownImage; 228 m_currentState = LoadButtonDownImage;
229 break; 229 break;
230 case LoadButtonDownImage: 230 case LoadButtonDownImage:
231 qDebug( "load downimage" ); 231 odebug << "load downimage" << oendl;
232 m_skin.buttonDownImage(); 232 m_skin.buttonDownImage();
233 m_currentState = LoadButtonMasks; 233 m_currentState = LoadButtonMasks;
234 m_currentButton = 0; 234 m_currentButton = 0;
235 break; 235 break;
236 case LoadButtonMasks: 236 case LoadButtonMasks:
237 qDebug( "load button masks %i", m_currentButton ); 237 odebug << "load button masks " << m_currentButton << "" << oendl;
238 m_skin.buttonMaskImage( m_info.buttonInfo[ m_currentButton ].fileName ); 238 m_skin.buttonMaskImage( m_info.buttonInfo[ m_currentButton ].fileName );
239 239
240 m_currentButton++; 240 m_currentButton++;
241 if ( m_currentButton >= m_info.buttonCount ) 241 if ( m_currentButton >= m_info.buttonCount )
242 m_currentState = LoadButtonMask; 242 m_currentState = LoadButtonMask;
243 243
244 break; 244 break;
245 case LoadButtonMask: 245 case LoadButtonMask:
246 qDebug( "load whole mask" ); 246 odebug << "load whole mask" << oendl;
247 m_skin.buttonMask( m_info.buttonInfo, m_info.buttonCount ); 247 m_skin.buttonMask( m_info.buttonInfo, m_info.buttonCount );
248 return LoadingCompleted; 248 return LoadingCompleted;
249 } 249 }
250 250
251 return MoreToCome; 251 return MoreToCome;
252} 252}
@@ -255,13 +255,13 @@ SkinLoader::SkinLoader()
255 : m_currentLoader( 0 ), m_timerId( -1 ) 255 : m_currentLoader( 0 ), m_timerId( -1 )
256{ 256{
257} 257}
258 258
259SkinLoader::~SkinLoader() 259SkinLoader::~SkinLoader()
260{ 260{
261 qDebug( "SkinLoader::~SkinLoader()" ); 261 odebug << "SkinLoader::~SkinLoader()" << oendl;
262 killTimers(); 262 killTimers();
263 delete m_currentLoader; 263 delete m_currentLoader;
264} 264}
265 265
266void SkinLoader::schedule( const MediaWidget::GUIInfo &guiInfo ) 266void SkinLoader::schedule( const MediaWidget::GUIInfo &guiInfo )
267{ 267{
@@ -274,46 +274,46 @@ void SkinLoader::schedule( const QString &skinName, const MediaWidget::GUIInfo &
274} 274}
275 275
276void SkinLoader::start() 276void SkinLoader::start()
277{ 277{
278 assert( m_timerId == -1 ); 278 assert( m_timerId == -1 );
279 m_timerId = startTimer( 100 /* ms */ ); 279 m_timerId = startTimer( 100 /* ms */ );
280 qDebug( "SkinLoader::start() %d jobs", pendingSkins.count() ); 280 odebug << "SkinLoader::start() " << pendingSkins.count() << " jobs" << oendl;
281} 281}
282 282
283void SkinLoader::timerEvent( QTimerEvent *ev ) 283void SkinLoader::timerEvent( QTimerEvent *ev )
284{ 284{
285 if ( ev->timerId() != m_timerId ) { 285 if ( ev->timerId() != m_timerId ) {
286 QObject::timerEvent( ev ); 286 QObject::timerEvent( ev );
287 return; 287 return;
288 } 288 }
289 289
290 if ( !m_currentLoader ) { 290 if ( !m_currentLoader ) {
291 291
292 if ( pendingSkins.isEmpty() ) { 292 if ( pendingSkins.isEmpty() ) {
293 qDebug( "all jobs done" ); 293 odebug << "all jobs done" << oendl;
294 killTimer( m_timerId ); 294 killTimer( m_timerId );
295 m_timerId = -1; 295 m_timerId = -1;
296 // ### qt3: use deleteLater(); 296 // ### qt3: use deleteLater();
297 QTimer::singleShot( 0, this, SLOT( deleteMe() ) ); 297 QTimer::singleShot( 0, this, SLOT( deleteMe() ) );
298 return; 298 return;
299 } 299 }
300 300
301 Info nfo = *pendingSkins.begin(); 301 Info nfo = *pendingSkins.begin();
302 pendingSkins.remove( pendingSkins.begin() ); 302 pendingSkins.remove( pendingSkins.begin() );
303 303
304 m_currentLoader = new IncrementalLoader( nfo ); 304 m_currentLoader = new IncrementalLoader( nfo );
305 qDebug( "new loader %i jobs left", pendingSkins.count() ); 305 odebug << "new loader " << pendingSkins.count() << " jobs left" << oendl;
306 } 306 }
307 307
308 if ( m_currentLoader->loadStep() == IncrementalLoader::LoadingCompleted ) { 308 if ( m_currentLoader->loadStep() == IncrementalLoader::LoadingCompleted ) {
309 delete m_currentLoader; 309 delete m_currentLoader;
310 m_currentLoader = 0; 310 m_currentLoader = 0;
311 } 311 }
312 312
313 qDebug( "finished step" ); 313 odebug << "finished step" << oendl;
314} 314}
315 315
316void SkinLoader::deleteMe() 316void SkinLoader::deleteMe()
317{ 317{
318 delete this; 318 delete this;
319} 319}
diff --git a/noncore/multimedia/opieplayer2/threadutil.cpp b/noncore/multimedia/opieplayer2/threadutil.cpp
index fb951b4..d8b8abe 100644
--- a/noncore/multimedia/opieplayer2/threadutil.cpp
+++ b/noncore/multimedia/opieplayer2/threadutil.cpp
@@ -184,22 +184,22 @@ Thread::~Thread()
184 184
185void Thread::start() 185void Thread::start()
186{ 186{
187 AutoLock lock( d->guard ); 187 AutoLock lock( d->guard );
188 188
189 if ( d->isRunning ) { 189 if ( d->isRunning ) {
190 qDebug( "ThreadUtil::Thread::start() called for running thread." ); 190 odebug << "ThreadUtil::Thread::start() called for running thread." << oendl;
191 return; 191 return;
192 } 192 }
193 193
194 pthread_attr_t attributes; 194 pthread_attr_t attributes;
195 pthread_attr_init( &attributes ); 195 pthread_attr_init( &attributes );
196 pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM ); 196 pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM );
197 int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d ); 197 int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d );
198 if ( err != 0 ) { 198 if ( err != 0 ) {
199 qDebug( "ThreadUtil::Thread::start() : can't create thread: %s", strerror( err ) ); 199 odebug << "ThreadUtil::Thread::start() : can't create thread: " << strerror( err ) << "" << oendl;
200 pthread_attr_destroy( &attributes ); 200 pthread_attr_destroy( &attributes );
201 return; 201 return;
202 } 202 }
203 pthread_attr_destroy( &attributes ); 203 pthread_attr_destroy( &attributes );
204} 204}
205 205
@@ -281,13 +281,13 @@ ChannelMessage::~ChannelMessage()
281} 281}
282 282
283void ChannelMessage::reply() 283void ChannelMessage::reply()
284{ 284{
285 if ( !m_isCall ) 285 if ( !m_isCall )
286 { 286 {
287 qDebug( "ChannelMessage::reply() - can't reply oneway message!" ); 287 odebug << "ChannelMessage::reply() - can't reply oneway message!" << oendl;
288 return; 288 return;
289 } 289 }
290 290
291 if ( m_inEventHandler ) 291 if ( m_inEventHandler )
292 { 292 {
293 m_replied = true; 293 m_replied = true;
diff --git a/noncore/multimedia/opieplayer2/xinecontrol.cpp b/noncore/multimedia/opieplayer2/xinecontrol.cpp
index 8f11b2e..94f99f8 100644
--- a/noncore/multimedia/opieplayer2/xinecontrol.cpp
+++ b/noncore/multimedia/opieplayer2/xinecontrol.cpp
@@ -90,31 +90,31 @@ XineControl::~XineControl() {
90void XineControl::play( const QString& fileName ) { 90void XineControl::play( const QString& fileName ) {
91 91
92 hasVideoChannel = FALSE; 92 hasVideoChannel = FALSE;
93 hasAudioChannel = FALSE; 93 hasAudioChannel = FALSE;
94 m_fileName = fileName; 94 m_fileName = fileName;
95 95
96 qDebug("<<FILENAME: " + fileName + ">>>>"); 96 odebug << "<<FILENAME: " + fileName + ">>>>" << oendl;
97 97
98 if ( !libXine->play( fileName, 0, 0 ) ) { 98 if ( !libXine->play( fileName, 0, 0 ) ) {
99 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() ); 99 QMessageBox::warning( 0l , tr( "Failure" ), getErrorCode() );
100 // toggle stop so the the play button is reset 100 // toggle stop so the the play button is reset
101 mediaPlayerState.setPlaying( false ); 101 mediaPlayerState.setPlaying( false );
102 return; 102 return;
103 } 103 }
104 mediaPlayerState.setPlaying( true ); 104 mediaPlayerState.setPlaying( true );
105 105
106 MediaPlayerState::DisplayType displayType; 106 MediaPlayerState::DisplayType displayType;
107 if ( !libXine->hasVideo() ) { 107 if ( !libXine->hasVideo() ) {
108 displayType = MediaPlayerState::Audio; 108 displayType = MediaPlayerState::Audio;
109 qDebug("HAS AUDIO"); 109 odebug << "HAS AUDIO" << oendl;
110 libXine->setShowVideo( false ); 110 libXine->setShowVideo( false );
111 hasAudioChannel = TRUE; 111 hasAudioChannel = TRUE;
112 } else { 112 } else {
113 displayType = MediaPlayerState::Video; 113 displayType = MediaPlayerState::Video;
114 qDebug("HAS VIDEO"); 114 odebug << "HAS VIDEO" << oendl;
115 libXine->setShowVideo( true ); 115 libXine->setShowVideo( true );
116 hasVideoChannel = TRUE; 116 hasVideoChannel = TRUE;
117 } 117 }
118 // determine if slider is shown 118 // determine if slider is shown
119 mediaPlayerState.setIsSeekable( libXine->isSeekable() ); 119 mediaPlayerState.setIsSeekable( libXine->isSeekable() );
120 120
@@ -240,13 +240,13 @@ QString XineControl::getMetaInfo() {
240} 240}
241 241
242QString XineControl::getErrorCode() { 242QString XineControl::getErrorCode() {
243 243
244 int errorCode = libXine->error(); 244 int errorCode = libXine->error();
245 245
246 qDebug( QString("ERRORCODE: %1 ").arg(errorCode) ); 246 odebug << QString("ERRORCODE: %1 ").arg(errorCode) << oendl;
247 247
248 if ( errorCode == 1 ) { 248 if ( errorCode == 1 ) {
249 return tr( "No input plugin found for this media type" ); 249 return tr( "No input plugin found for this media type" );
250 } else if ( errorCode == 2 ) { 250 } else if ( errorCode == 2 ) {
251 return tr( "No demux plugin found for this media type" ); 251 return tr( "No demux plugin found for this media type" );
252 } else if ( errorCode == 3 ) { 252 } else if ( errorCode == 3 ) {
diff --git a/noncore/multimedia/opierec/device.cpp b/noncore/multimedia/opierec/device.cpp
index ce49e96..5319d97 100644
--- a/noncore/multimedia/opierec/device.cpp
+++ b/noncore/multimedia/opierec/device.cpp
@@ -1,24 +1,24 @@
1// device.cpp 1// device.cpp
2 2
3#include "device.h" 3#include "device.h"
4 4
5/* OPIE */
6#include <opie2/odebug.h>
5#include <qpe/config.h> 7#include <qpe/config.h>
6#include <qpe/qcopenvelope_qws.h> 8#include <qpe/qcopenvelope_qws.h>
9using namespace Opie::Core;
7 10
8 11/* STD */
9#include <fcntl.h> 12#include <fcntl.h>
10#include <stdio.h> 13#include <stdio.h>
11#include <stdlib.h> 14#include <stdlib.h>
12#include <sys/ioctl.h> 15#include <sys/ioctl.h>
13#include <sys/soundcard.h> 16#include <sys/soundcard.h>
14#include <unistd.h> 17#include <unistd.h>
15#include<sys/wait.h> 18#include <sys/wait.h>
16// #include <sys/stat.h>
17// #include <sys/time.h>
18// #include <sys/types.h>
19#include <unistd.h> 19#include <unistd.h>
20#include <errno.h> 20#include <errno.h>
21 21
22//extern QtRec *qperec; 22//extern QtRec *qperec;
23 23
24Device::Device( QObject * parent, const char * dsp, const char * mixr, bool record ) 24Device::Device( QObject * parent, const char * dsp, const char * mixr, bool record )
@@ -29,16 +29,16 @@ Device::Device( QObject * parent, const char * dsp, const char * mixr, bool reco
29 29
30 devForm=-1; 30 devForm=-1;
31 devCh=-1; 31 devCh=-1;
32 devRate=-1; 32 devRate=-1;
33 33
34 if( !record){ //playing 34 if( !record){ //playing
35 qDebug("setting up DSP for playing"); 35 odebug << "setting up DSP for playing" << oendl;
36 flags = O_WRONLY; 36 flags = O_WRONLY;
37 } else { //recording 37 } else { //recording
38 qDebug("setting up DSP for recording"); 38 odebug << "setting up DSP for recording" << oendl;
39 flags = O_RDWR; 39 flags = O_RDWR;
40// flags = O_RDONLY; 40// flags = O_RDONLY;
41 41
42// selectMicInput(); 42// selectMicInput();
43 43
44 } 44 }
@@ -93,13 +93,13 @@ void Device::changedOutVolume(int vol) {
93 perror("ioctl(\"MIXER_IN_WRITE\")"); 93 perror("ioctl(\"MIXER_IN_WRITE\")");
94 94
95 Config cfg("qpe"); 95 Config cfg("qpe");
96 cfg.setGroup("Volume"); 96 cfg.setGroup("Volume");
97 cfg.writeEntry("VolumePercent", QString::number( vol )); 97 cfg.writeEntry("VolumePercent", QString::number( vol ));
98 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false; 98 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << false;
99 qWarning("changing output vol %d", vol); 99 owarn << "changing output vol " << vol << "" << oendl;
100 } 100 }
101 ::close(fd); 101 ::close(fd);
102} 102}
103 103
104void Device::changedInVolume(int vol ) { 104void Device::changedInVolume(int vol ) {
105 int level = (vol << 8) + vol; 105 int level = (vol << 8) + vol;
@@ -108,13 +108,13 @@ void Device::changedInVolume(int vol ) {
108 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &level) == -1) 108 if(ioctl(fd, MIXER_WRITE(SOUND_MIXER_MIC), &level) == -1)
109 perror("ioctl(\"MIXER_IN_WRITE\")"); 109 perror("ioctl(\"MIXER_IN_WRITE\")");
110 Config cfg("qpe"); 110 Config cfg("qpe");
111 cfg.setGroup("Volume"); 111 cfg.setGroup("Volume");
112 cfg.writeEntry("Mic", QString::number(vol )); 112 cfg.writeEntry("Mic", QString::number(vol ));
113 QCopEnvelope( "QPE/System", "micChange(bool)" ) << false; 113 QCopEnvelope( "QPE/System", "micChange(bool)" ) << false;
114 qWarning("changing input volume %d", vol); 114 owarn << "changing input volume " << vol << "" << oendl;
115 } 115 }
116 ::close(fd); 116 ::close(fd);
117} 117}
118 118
119bool Device::selectMicInput() { 119bool Device::selectMicInput() {
120 120
@@ -146,28 +146,28 @@ exit(1);
146 switch (pid = fork()) { 146 switch (pid = fork()) {
147 case -1: 147 case -1:
148 perror("The fork failed!"); 148 perror("The fork failed!");
149 break; 149 break;
150 case 0: { 150 case 0: {
151 */ 151 */
152qDebug("Opening %s",dspstr); 152odebug << "Opening " << dspstr << "" << oendl;
153 if (( sd = ::open( dspstr, flags)) == -1) { 153 if (( sd = ::open( dspstr, flags)) == -1) {
154 perror("open(\"/dev/dsp\")"); 154 perror("open(\"/dev/dsp\")");
155 QString errorMsg="Could not open audio device\n /dev/dsp\n" 155 QString errorMsg="Could not open audio device\n /dev/dsp\n"
156 +(QString)strerror(errno); 156 +(QString)strerror(errno);
157 qDebug("XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg); 157 odebug << "XXXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl;
158 return -1; 158 return -1;
159 } 159 }
160 160
161qDebug("Opening mixer"); 161odebug << "Opening mixer" << oendl;
162 int mixerHandle=0; 162 int mixerHandle=0;
163 if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) { 163 if (( mixerHandle = open("/dev/mixer",O_RDWR))<0) {
164 perror("open(\"/dev/mixer\")"); 164 perror("open(\"/dev/mixer\")");
165 QString errorMsg="Could not open audio device\n /dev/dsp\n" 165 QString errorMsg="Could not open audio device\n /dev/dsp\n"
166 +(QString)strerror(errno); 166 +(QString)strerror(errno);
167 qDebug("XXXXXXXXXXXXXXXXXXXXXX "+errorMsg); 167 odebug << "XXXXXXXXXXXXXXXXXXXXXX "+errorMsg << oendl;
168 } 168 }
169 169
170 if(ioctl(sd,SNDCTL_DSP_RESET,0)<0){ 170 if(ioctl(sd,SNDCTL_DSP_RESET,0)<0){
171 perror("ioctl RESET"); 171 perror("ioctl RESET");
172 } 172 }
173// sprintf(message, "%d", sd); 173// sprintf(message, "%d", sd);
@@ -177,13 +177,13 @@ qDebug("Opening mixer");
177 f1.writeBlock(message, strlen(message)); 177 f1.writeBlock(message, strlen(message));
178 f1.close(); 178 f1.close();
179 */ 179 */
180 /* close(pipefd[0]); 180 /* close(pipefd[0]);
181 write(pipefd[1], message, sizeof(message)); 181 write(pipefd[1], message, sizeof(message));
182 close(pipefd[1]); 182 close(pipefd[1]);
183 // qDebug("%d",soundDevice->sd ); 183 // odebug << "" << soundDevice->sd << "" << oendl;
184 _exit(0); 184 _exit(0);
185 } 185 }
186 default: 186 default:
187 // pid greater than zero is parent getting the child's pid 187 // pid greater than zero is parent getting the child's pid
188 printf("Child's pid is %d\n",pid); 188 printf("Child's pid is %d\n",pid);
189 QString s; 189 QString s;
@@ -203,19 +203,19 @@ qDebug("Opening mixer");
203 // for(int f=0; f < t.atEnd() ;f++) { 203 // for(int f=0; f < t.atEnd() ;f++) {
204 s = t.readLine(); 204 s = t.readLine();
205 // } 205 // }
206 */ 206 */
207// bool ok; 207// bool ok;
208// sd = s.toInt(&ok, 10); 208// sd = s.toInt(&ok, 10);
209// qDebug("<<<<<<<<<<<<<>>>>>>>>>>>>"+s); 209// odebug << "<<<<<<<<<<<<<>>>>>>>>>>>>"+s << oendl;
210 210
211// f2.close(); 211// f2.close();
212// } 212// }
213::close(mixerHandle ); 213::close(mixerHandle );
214// qDebug("open device %s", dspstr); 214// odebug << "open device " << dspstr << "" << oendl;
215// qDebug("success! %d",sd); 215// odebug << "success! " << sd << "" << oendl;
216 return sd; 216 return sd;
217} 217}
218 218
219bool Device::closeDevice( bool) { 219bool Device::closeDevice( bool) {
220// if(b) {//close now 220// if(b) {//close now
221// if (ioctl( sd, SNDCTL_DSP_RESET, 0) == -1) { 221// if (ioctl( sd, SNDCTL_DSP_RESET, 0) == -1) {
@@ -227,38 +227,38 @@ bool Device::closeDevice( bool) {
227// } 227// }
228// } 228// }
229 229
230 ::close( sd); //close sound device 230 ::close( sd); //close sound device
231// sdfd=0; 231// sdfd=0;
232 // sd=0; 232 // sd=0;
233// qDebug("closed dsp"); 233// odebug << "closed dsp" << oendl;
234 return true; 234 return true;
235} 235}
236 236
237bool Device::setDeviceFormat( int form) { 237bool Device::setDeviceFormat( int form) {
238 qDebug("set device res %d %d", form, sd); 238 odebug << "set device res " << form << " " << sd << "" << oendl;
239 if (ioctl( sd, SNDCTL_DSP_SETFMT, &form)==-1) { //set format 239 if (ioctl( sd, SNDCTL_DSP_SETFMT, &form)==-1) { //set format
240 perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); 240 perror("ioctl(\"SNDCTL_DSP_SETFMT\")");
241 return false; 241 return false;
242 } 242 }
243 devRes=form; 243 devRes=form;
244 return true; 244 return true;
245} 245}
246 246
247bool Device::setDeviceChannels( int ch) { 247bool Device::setDeviceChannels( int ch) {
248 qDebug("set channels %d %d", ch, sd); 248 odebug << "set channels " << ch << " " << sd << "" << oendl;
249 if (ioctl( sd, SNDCTL_DSP_CHANNELS, &ch)==-1) { 249 if (ioctl( sd, SNDCTL_DSP_CHANNELS, &ch)==-1) {
250 perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); 250 perror("ioctl(\"SNDCTL_DSP_CHANNELS\")");
251 return false; 251 return false;
252 } 252 }
253 devCh=ch; 253 devCh=ch;
254 return true; 254 return true;
255} 255}
256 256
257bool Device::setDeviceRate( int rate) { 257bool Device::setDeviceRate( int rate) {
258 qDebug("set rate %d %d", rate, sd); 258 odebug << "set rate " << rate << " " << sd << "" << oendl;
259 if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) { 259 if (ioctl( sd, SNDCTL_DSP_SPEED, &rate) == -1) {
260 perror("ioctl(\"SNDCTL_DSP_SPEED\")"); 260 perror("ioctl(\"SNDCTL_DSP_SPEED\")");
261 return false; 261 return false;
262 } 262 }
263 263
264 devRate=rate; 264 devRate=rate;
@@ -315,15 +315,15 @@ int Device::getDeviceChannels() {
315} 315}
316 316
317int Device::getDeviceFragSize() { 317int Device::getDeviceFragSize() {
318 int frag_size; 318 int frag_size;
319 319
320 if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) { 320 if (ioctl( sd, SNDCTL_DSP_GETBLKSIZE, &frag_size) == -1) {
321 qDebug("no fragsize"); 321 odebug << "no fragsize" << oendl;
322 } else { 322 } else {
323 qDebug("driver says frag size is %d", frag_size); 323 odebug << "driver says frag size is " << frag_size << "" << oendl;
324 } 324 }
325 return frag_size; 325 return frag_size;
326} 326}
327 327
328bool Device::setFragSize(int frag) { 328bool Device::setFragSize(int frag) {
329 if (ioctl(sd, SNDCTL_DSP_SETFRAGMENT, &frag)) { 329 if (ioctl(sd, SNDCTL_DSP_SETFRAGMENT, &frag)) {
diff --git a/noncore/multimedia/opierec/helpwindow.cpp b/noncore/multimedia/opierec/helpwindow.cpp
index 6aebaa1..7f984c3 100644
--- a/noncore/multimedia/opierec/helpwindow.cpp
+++ b/noncore/multimedia/opierec/helpwindow.cpp
@@ -6,29 +6,34 @@
6** This file is part of an example program for Qt. This example 6** This file is part of an example program for Qt. This example
7** program may be used, distributed and modified without limitation. 7** program may be used, distributed and modified without limitation.
8** 8**
9*****************************************************************************/ 9*****************************************************************************/
10 10
11#include "helpwindow.h" 11#include "helpwindow.h"
12#include <qlayout.h>
13 12
14#include <qtoolbar.h> 13/* OPIE */
14#include <opie2/odebug.h>
15#include <qpe/resource.h> 15#include <qpe/resource.h>
16using namespace Opie::Core;
16 17
18/* QT */
19#include <qlayout.h>
20#include <qtoolbar.h>
17#include <qaction.h> 21#include <qaction.h>
18#include <qmenubar.h> 22#include <qmenubar.h>
19 23
24/* STD */
20#include <ctype.h> 25#include <ctype.h>
21 26
22HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name ) 27HelpWindow::HelpWindow( const QString& home_, const QString& _path, QWidget* parent, const char *name )
23 : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL() 28 : QMainWindow( parent, name, WDestructiveClose ), pathCombo( 0 ), selectedURL()
24{ 29{
25 QGridLayout *layout = new QGridLayout( this ); 30 QGridLayout *layout = new QGridLayout( this );
26 layout->setSpacing( 2); 31 layout->setSpacing( 2);
27 layout->setMargin( 2); 32 layout->setMargin( 2);
28 qDebug(_path); 33 odebug << _path << oendl;
29 browser = new QTextBrowser( this ); 34 browser = new QTextBrowser( this );
30 QStringList Strlist; 35 QStringList Strlist;
31 Strlist.append( home_); 36 Strlist.append( home_);
32 browser->mimeSourceFactory()->setFilePath( Strlist ); 37 browser->mimeSourceFactory()->setFilePath( Strlist );
33 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 38 browser->setFrameStyle( QFrame::Panel | QFrame::Sunken );
34 39
diff --git a/noncore/multimedia/opierec/opierec.pro b/noncore/multimedia/opierec/opierec.pro
index 7b08f0e..ea1bae3 100644
--- a/noncore/multimedia/opierec/opierec.pro
+++ b/noncore/multimedia/opierec/opierec.pro
@@ -1,9 +1,7 @@
1#CONFIG = qt warn_on pdaudio 1CONFIG = qt warn_on
2CONFIG = qt warn_on opie
3#CONFIG = qt warn_on quick-app
4HEADERS = adpcm.h \ 2HEADERS = adpcm.h \
5 pixmaps.h \ 3 pixmaps.h \
6 helpwindow.h \ 4 helpwindow.h \
7 qtrec.h \ 5 qtrec.h \
8 device.h \ 6 device.h \
9 wavFile.h \ 7 wavFile.h \
@@ -26,13 +24,13 @@ contains(CONFIG, pdaudio) {
26 DEFINES += THREADED 24 DEFINES += THREADED
27 TARGET = qperec 25 TARGET = qperec
28 26
29# DESTDIR=$(QPEDIR)/bin 27# DESTDIR=$(QPEDIR)/bin
30} 28}
31 29
32contains(CONFIG, opie) { 30!contains(CONFIG, pdaudio) {
33 INCLUDEPATH += $(OPIEDIR)/include 31 INCLUDEPATH += $(OPIEDIR)/include
34 DEPENDPATH += $(OPIEDIR)/include 32 DEPENDPATH += $(OPIEDIR)/include
35 DESTDIR=$(OPIEDIR)/bin 33 DESTDIR=$(OPIEDIR)/bin
36 LIBS += -lqpe -lopiecore2 -lpthread 34 LIBS += -lqpe -lopiecore2 -lpthread
37 TARGET = opierec 35 TARGET = opierec
38 include ( $(OPIEDIR)/include.pro ) 36 include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/multimedia/opierec/qtrec.cpp b/noncore/multimedia/opierec/qtrec.cpp
index 1c64ab1..2187d5a 100644
--- a/noncore/multimedia/opierec/qtrec.cpp
+++ b/noncore/multimedia/opierec/qtrec.cpp
@@ -5,42 +5,41 @@
5****************************************************************************/ 5****************************************************************************/
6#define DEV_VERSION 6#define DEV_VERSION
7 7
8#include "pixmaps.h" 8#include "pixmaps.h"
9#include "qtrec.h" 9#include "qtrec.h"
10#include "waveform.h" 10#include "waveform.h"
11
12#include <pthread.h>
13
14extern "C" { 11extern "C" {
15#include "adpcm.h" 12#include "adpcm.h"
16} 13}
17 14
18#include <sys/soundcard.h> 15/* OPIE */
19 16#include <opie2/odebug.h>
20#include <qpe/config.h> 17#include <qpe/config.h>
21#include <qpe/qcopenvelope_qws.h> 18#include <qpe/qcopenvelope_qws.h>
22#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
23#include <qpe/resource.h> 20#include <qpe/resource.h>
24#include <qpe/storage.h> 21#include <qpe/storage.h>
22using namespace Opie::Core;
25 23
24/* QT */
26#include <qcheckbox.h> 25#include <qcheckbox.h>
27#include <qcombobox.h> 26#include <qcombobox.h>
28//#include <qdatetime.h>
29#include <qdir.h> 27#include <qdir.h>
30#include <qgroupbox.h> 28#include <qgroupbox.h>
31#include <qlabel.h> 29#include <qlabel.h>
32#include <qlayout.h> 30#include <qlayout.h>
33#include <qlistview.h> 31#include <qlistview.h>
34#include <qmessagebox.h> 32#include <qmessagebox.h>
35#include <qpopupmenu.h> 33#include <qpopupmenu.h>
36#include <qpushbutton.h> 34#include <qpushbutton.h>
37#include <qslider.h> 35#include <qslider.h>
38#include <qtabwidget.h> 36#include <qtabwidget.h>
39#include <qtimer.h> 37#include <qtimer.h>
40 38
39/* STD */
41#include <errno.h> 40#include <errno.h>
42#include <fcntl.h> 41#include <fcntl.h>
43#include <math.h> 42#include <math.h>
44#include <mntent.h> 43#include <mntent.h>
45#include <stdio.h> 44#include <stdio.h>
46#include <stdlib.h> 45#include <stdlib.h>
@@ -50,13 +49,13 @@ extern "C" {
50#include <sys/time.h> 49#include <sys/time.h>
51#include <sys/types.h> 50#include <sys/types.h>
52#include <sys/vfs.h> 51#include <sys/vfs.h>
53#include <unistd.h> 52#include <unistd.h>
54#include <sys/wait.h> 53#include <sys/wait.h>
55#include <sys/signal.h> 54#include <sys/signal.h>
56 55#include <pthread.h>
57 56
58#ifdef PDAUDIO //ALSA 57#ifdef PDAUDIO //ALSA
59#include <alsa/asoundlib.h> 58#include <alsa/asoundlib.h>
60static int deviceSampleRates[8] = { 32000, 44100, 48000, 88200, 96000, 176400, 192000, -1 }; 59static int deviceSampleRates[8] = { 32000, 44100, 48000, 88200, 96000, 176400, 192000, -1 };
61static int deviceBitRates[] = { 8, 16, 24, 32, -1 }; 60static int deviceBitRates[] = { 8, 16, 24, 32, -1 };
62#else //OSS 61#else //OSS
@@ -133,43 +132,43 @@ void quickRec()
133 bytesWritten = 0; 132 bytesWritten = 0;
134 number = 0; 133 number = 0;
135 QString num; 134 QString num;
136 int level = 0; 135 int level = 0;
137 int threshold = 0; 136 int threshold = 0;
138// int bits = filePara.resolution; 137// int bits = filePara.resolution;
139// qDebug("bits %d", bits); 138// odebug << "bits " << bits << "" << oendl;
140 139
141 if( filePara.resolution == 16 ) { //AFMT_S16_LE) 140 if( filePara.resolution == 16 ) { //AFMT_S16_LE)
142// qDebug("AFMT_S16_LE size %d", filePara.SecondsToRecord); 141// odebug << "AFMT_S16_LE size " << filePara.SecondsToRecord << "" << oendl;
143// qDebug("samples to record %d", filePara.samplesToRecord); 142// odebug << "samples to record " << filePara.samplesToRecord << "" << oendl;
144// qDebug("%d", filePara.sd); 143// odebug << "" << filePara.sd << "" << oendl;
145 level = 7; 144 level = 7;
146 threshold = 0; 145 threshold = 0;
147 146
148 if( filePara.format == WAVE_FORMAT_DVI_ADPCM) { 147 if( filePara.format == WAVE_FORMAT_DVI_ADPCM) {
149// qDebug("start recording WAVE_FORMAT_DVI_ADPCM"); 148// odebug << "start recording WAVE_FORMAT_DVI_ADPCM" << oendl;
150 // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>> 149 // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_DVI_ADPCM >>>>>>>>>>>>>>>>>>>>>>
151 char abuf[ BUFSIZE/2 ]; 150 char abuf[ BUFSIZE/2 ];
152 short sbuf[ BUFSIZE ]; 151 short sbuf[ BUFSIZE ];
153 short sbuf2[ BUFSIZE ]; 152 short sbuf2[ BUFSIZE ];
154 memset( abuf, 0, BUFSIZE/2); 153 memset( abuf, 0, BUFSIZE/2);
155 memset( sbuf, 0, BUFSIZE); 154 memset( sbuf, 0, BUFSIZE);
156 memset( sbuf2, 0, BUFSIZE); 155 memset( sbuf2, 0, BUFSIZE);
157 156
158 for(;;) { 157 for(;;) {
159 if ( stopped) { 158 if ( stopped) {
160 // qDebug("quickRec:: stopped"); 159 // odebug << "quickRec:: stopped" << oendl;
161 break; 160 break;
162 } 161 }
163 162
164// number=::read( filePara.sd, sbuf, BUFSIZE); 163// number=::read( filePara.sd, sbuf, BUFSIZE);
165 number = soundDevice ->devRead( filePara.sd, sbuf, BUFSIZE); 164 number = soundDevice ->devRead( filePara.sd, sbuf, BUFSIZE);
166 165
167 if(number <= 0) { 166 if(number <= 0) {
168 perror("recording error "); 167 perror("recording error ");
169 qDebug( "%s %d", filePara.fileName, number); 168 odebug << "" << filePara.fileName << " " << number << "" << oendl;
170 stopped = true; 169 stopped = true;
171 return; 170 return;
172 } 171 }
173 //if(stereo == 2) { 172 //if(stereo == 2) {
174// adpcm_coder( sbuf2, abuf, number/2, &encoder_state); 173// adpcm_coder( sbuf2, abuf, number/2, &encoder_state);
175 adpcm_coder( sbuf, abuf, number/2, &encoder_state); 174 adpcm_coder( sbuf, abuf, number/2, &encoder_state);
@@ -189,31 +188,31 @@ void quickRec()
189 stopped = true; 188 stopped = true;
190 break; 189 break;
191 } 190 }
192 } 191 }
193 } else { 192 } else {
194 // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_PCM >>>>>>>>>>>>>>>>>>>>>> 193 // <<<<<<<<<<<<<<<<<<<<<<<<<<< WAVE_FORMAT_PCM >>>>>>>>>>>>>>>>>>>>>>
195 qDebug("start recording WAVE_FORMAT_PCM"); 194 odebug << "start recording WAVE_FORMAT_PCM" << oendl;
196 short inbuffer[ BUFSIZE ], outbuffer[ BUFSIZE ]; 195 short inbuffer[ BUFSIZE ], outbuffer[ BUFSIZE ];
197 memset( inbuffer, 0, BUFSIZE); 196 memset( inbuffer, 0, BUFSIZE);
198 memset( outbuffer, 0, BUFSIZE); 197 memset( outbuffer, 0, BUFSIZE);
199 198
200 for(;;) { 199 for(;;) {
201 if ( stopped) { 200 if ( stopped) {
202 qDebug("quickRec:: stopped"); 201 odebug << "quickRec:: stopped" << oendl;
203 stopped = true; 202 stopped = true;
204 break; // stop if playing was set to false 203 break; // stop if playing was set to false
205 return; 204 return;
206 } 205 }
207 206
208 number = soundDevice->devRead( filePara.sd, (short *)inbuffer, BUFSIZE); 207 number = soundDevice->devRead( filePara.sd, (short *)inbuffer, BUFSIZE);
209 waveform->newSamples( inbuffer, number ); 208 waveform->newSamples( inbuffer, number );
210 209
211 if( number <= 0) { 210 if( number <= 0) {
212 perror( "recording error "); 211 perror( "recording error ");
213 qDebug( filePara.fileName); 212 odebug << filePara.fileName << oendl;
214 stopped = true; 213 stopped = true;
215 return; 214 return;
216 } 215 }
217 216
218 bytesWritten = ::write( filePara.fd , inbuffer, number); 217 bytesWritten = ::write( filePara.fd , inbuffer, number);
219 218
@@ -247,13 +246,13 @@ void quickRec()
247 unsigned char unsigned_inbuffer[ BUFSIZE ], unsigned_outbuffer[ BUFSIZE ]; 246 unsigned char unsigned_inbuffer[ BUFSIZE ], unsigned_outbuffer[ BUFSIZE ];
248 memset( unsigned_inbuffer, 0, BUFSIZE); 247 memset( unsigned_inbuffer, 0, BUFSIZE);
249 memset( unsigned_outbuffer, 0, BUFSIZE); 248 memset( unsigned_outbuffer, 0, BUFSIZE);
250 249
251 for(;;) { 250 for(;;) {
252 if ( stopped) { 251 if ( stopped) {
253 qDebug("quickRec:: stopped"); 252 odebug << "quickRec:: stopped" << oendl;
254 break; // stop if playing was set to false 253 break; // stop if playing was set to false
255 } 254 }
256 255
257 number = ::read( filePara.sd, unsigned_inbuffer, BUFSIZE); 256 number = ::read( filePara.sd, unsigned_inbuffer, BUFSIZE);
258 bytesWritten = ::write( filePara.fd , unsigned_inbuffer, number); 257 bytesWritten = ::write( filePara.fd , unsigned_inbuffer, number);
259 258
@@ -370,13 +369,13 @@ void playIt()
370// timeString.sprintf("%.2f",filePara.numberOfRecordedSeconds); 369// timeString.sprintf("%.2f",filePara.numberOfRecordedSeconds);
371// timeLabel->setText( timeString + tr(" seconds")); 370// timeLabel->setText( timeString + tr(" seconds"));
372 371
373 qApp->processEvents(); 372 qApp->processEvents();
374 373
375 if( /*total >= filePara.numberSamples || */ bytesWritten == 0) { 374 if( /*total >= filePara.numberSamples || */ bytesWritten == 0) {
376 qWarning("Jane! Stop this crazy thing!"); 375 owarn << "Jane! Stop this crazy thing!" << oendl;
377 stopped = true; 376 stopped = true;
378// playing = false; 377// playing = false;
379 break; 378 break;
380 } 379 }
381 } 380 }
382 printf("\nplaying number %d, bytes %d, total %d\r",number, bytesWritten, total); 381 printf("\nplaying number %d, bytes %d, total %d\r",number, bytesWritten, total);
@@ -715,13 +714,13 @@ void QtRec::initIconView() {
715 Config cfg("OpieRec"); 714 Config cfg("OpieRec");
716 cfg.setGroup("Sounds"); 715 cfg.setGroup("Sounds");
717 QString temp; 716 QString temp;
718 QPixmap image0( ( const char** ) image0_data ); 717 QPixmap image0( ( const char** ) image0_data );
719 718
720 int nFiles = cfg.readNumEntry("NumberofFiles",0); 719 int nFiles = cfg.readNumEntry("NumberofFiles",0);
721 // qDebug("init number of files %d", nFiles); 720 // odebug << "init number of files " << nFiles << "" << oendl;
722 721
723 for(int i=1;i<= nFiles;i++) { 722 for(int i=1;i<= nFiles;i++) {
724 723
725 QListViewItem * item; 724 QListViewItem * item;
726 QString fileS, mediaLocation, fileDate, filePath; 725 QString fileS, mediaLocation, fileDate, filePath;
727 726
@@ -857,13 +856,13 @@ void QtRec::initConfig() {
857 cofg.setGroup( "Volume"); 856 cofg.setGroup( "Volume");
858 outMuteCheckBox->setChecked( cofg.readBoolEntry( "Mute",0)); 857 outMuteCheckBox->setChecked( cofg.readBoolEntry( "Mute",0));
859 inMuteCheckBox->setChecked( cofg.readBoolEntry( "MicMute",0)); 858 inMuteCheckBox->setChecked( cofg.readBoolEntry( "MicMute",0));
860} 859}
861 860
862void QtRec::stop() { 861void QtRec::stop() {
863 qWarning("STOP"); 862 owarn << "STOP" << oendl;
864 setRecordButton(false); 863 setRecordButton(false);
865 864
866 if( !recording) 865 if( !recording)
867 endPlaying(); 866 endPlaying();
868 else 867 else
869 endRecording(); 868 endRecording();
@@ -919,38 +918,38 @@ bool QtRec::rec() { //record
919// qDebug( "<<<<<<<Device bits %d, device rate %d, device channels %d", 918// qDebug( "<<<<<<<Device bits %d, device rate %d, device channels %d",
920// soundDevice->getDeviceBits(), 919// soundDevice->getDeviceBits(),
921// soundDevice->getDeviceRate(), 920// soundDevice->getDeviceRate(),
922// soundDevice->getDeviceChannels()); 921// soundDevice->getDeviceChannels());
923 922
924 //filePara.sampleRate = cfg.readNumEntry("samplerate", 22050); 923 //filePara.sampleRate = cfg.readNumEntry("samplerate", 22050);
925// qDebug("sample rate is %d", filePara.sampleRate); 924// odebug << "sample rate is " << filePara.sampleRate << "" << oendl;
926 filePara.SecondsToRecord = getCurrentSizeLimit(); 925 filePara.SecondsToRecord = getCurrentSizeLimit();
927 926
928// qDebug("size limit %d sec", filePara.SecondsToRecord); 927// odebug << "size limit " << filePara.SecondsToRecord << " sec" << oendl;
929 int diskSize = checkDiskSpace( (const QString &) wavFile->trackName()); 928 int diskSize = checkDiskSpace( (const QString &) wavFile->trackName());
930 929
931 if( filePara.SecondsToRecord == 0) { 930 if( filePara.SecondsToRecord == 0) {
932 fileSize = diskSize; 931 fileSize = diskSize;
933 } else if( filePara.format == WAVE_FORMAT_PCM) { 932 } else if( filePara.format == WAVE_FORMAT_PCM) {
934// qDebug("WAVE_FORMAT_PCM"); 933// odebug << "WAVE_FORMAT_PCM" << oendl;
935 fileSize = (filePara.SecondsToRecord ) * filePara.channels 934 fileSize = (filePara.SecondsToRecord ) * filePara.channels
936 * filePara.sampleRate * ( filePara.resolution / 8) + 1000; 935 * filePara.sampleRate * ( filePara.resolution / 8) + 1000;
937 } else { 936 } else {
938// qDebug("WAVE_FORMAT_DVI_ADPCM"); 937// odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl;
939 fileSize = ((filePara.SecondsToRecord) * filePara.channels 938 fileSize = ((filePara.SecondsToRecord) * filePara.channels
940 * filePara.sampleRate * ( filePara.resolution / 8) ) / 4 + 250; 939 * filePara.sampleRate * ( filePara.resolution / 8) ) / 4 + 250;
941 } 940 }
942 941
943 filePara.samplesToRecord = fileSize; 942 filePara.samplesToRecord = fileSize;
944 qDebug("filesize should be %d, bits %d, rate %d", 943 qDebug("filesize should be %d, bits %d, rate %d",
945 filePara.samplesToRecord, filePara.resolution, filePara.sampleRate); 944 filePara.samplesToRecord, filePara.resolution, filePara.sampleRate);
946 if( paused) { 945 if( paused) {
947 paused = false; 946 paused = false;
948 } 947 }
949 // else { 948 // else {
950 qDebug("Setting timeslider %d", filePara.samplesToRecord); 949 odebug << "Setting timeslider " << filePara.samplesToRecord << "" << oendl;
951 // if(fileSize != 0) 950 // if(fileSize != 0)
952 timeSlider->setRange(0, filePara.samplesToRecord); 951 timeSlider->setRange(0, filePara.samplesToRecord);
953 // } 952 // }
954 953
955 if( diskSize < fileSize/1024) { 954 if( diskSize < fileSize/1024) {
956 QMessageBox::warning(this, 955 QMessageBox::warning(this,
@@ -963,13 +962,13 @@ bool QtRec::rec() { //record
963 QString msg; 962 QString msg;
964 msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution); 963 msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution);
965#ifdef DEV_VERSION 964#ifdef DEV_VERSION
966 setCaption( msg); 965 setCaption( msg);
967#endif 966#endif
968 filePara.fileName=currentFile.latin1(); 967 filePara.fileName=currentFile.latin1();
969 qDebug("Start recording thread"); 968 odebug << "Start recording thread" << oendl;
970 stopped = false; 969 stopped = false;
971 970
972#ifdef THREADED 971#ifdef THREADED
973 pthread_t thread1; 972 pthread_t thread1;
974 pthread_create( &thread1, NULL, (void * (*)(void *))quickRec, NULL/* &*/); 973 pthread_create( &thread1, NULL, (void * (*)(void *))quickRec, NULL/* &*/);
975#endif 974#endif
@@ -1007,19 +1006,19 @@ void QtRec::thisTab(QWidget* widg) {
1007 update(); 1006 update();
1008 } 1007 }
1009} 1008}
1010 1009
1011void QtRec::getOutVol( ) { 1010void QtRec::getOutVol( ) {
1012 filePara.outVol = soundDevice->getOutVolume(); 1011 filePara.outVol = soundDevice->getOutVolume();
1013// qDebug("out vol %d", filePara.outVol); 1012// odebug << "out vol " << filePara.outVol << "" << oendl;
1014 OutputSlider->setValue( -filePara.outVol); 1013 OutputSlider->setValue( -filePara.outVol);
1015} 1014}
1016 1015
1017void QtRec::getInVol() { 1016void QtRec::getInVol() {
1018 filePara.inVol = soundDevice->getInVolume(); 1017 filePara.inVol = soundDevice->getInVolume();
1019// qDebug("in vol %d", filePara.inVol); 1018// odebug << "in vol " << filePara.inVol << "" << oendl;
1020 InputSlider->setValue( -filePara.inVol); 1019 InputSlider->setValue( -filePara.inVol);
1021} 1020}
1022 1021
1023void QtRec::changedOutVolume() { 1022void QtRec::changedOutVolume() {
1024 soundDevice->changedOutVolume( -OutputSlider->value()); 1023 soundDevice->changedOutVolume( -OutputSlider->value());
1025} 1024}
@@ -1087,17 +1086,17 @@ bool QtRec::setupAudio( bool b) {
1087 sampleformat = AFMT_S16_LE; 1086 sampleformat = AFMT_S16_LE;
1088 else 1087 else
1089 sampleformat = AFMT_U8; 1088 sampleformat = AFMT_U8;
1090 1089
1091 if( !compressionCheckBox->isChecked()) { 1090 if( !compressionCheckBox->isChecked()) {
1092 filePara.format = WAVE_FORMAT_PCM; 1091 filePara.format = WAVE_FORMAT_PCM;
1093// qDebug("WAVE_FORMAT_PCM"); 1092// odebug << "WAVE_FORMAT_PCM" << oendl;
1094 } else { 1093 } else {
1095 filePara.format = WAVE_FORMAT_DVI_ADPCM; 1094 filePara.format = WAVE_FORMAT_DVI_ADPCM;
1096 sampleformat = AFMT_S16_LE; 1095 sampleformat = AFMT_S16_LE;
1097// qDebug("WAVE_FORMAT_DVI_ADPCM"); 1096// odebug << "WAVE_FORMAT_DVI_ADPCM" << oendl;
1098 } 1097 }
1099#endif 1098#endif
1100 1099
1101 stereo = filePara.channels; 1100 stereo = filePara.channels;
1102// filePara.sampleRate = sampleRateComboBox->currentText().toInt( &ok,10);//44100; 1101// filePara.sampleRate = sampleRateComboBox->currentText().toInt( &ok,10);//44100;
1103 flags= O_RDWR; 1102 flags= O_RDWR;
@@ -1107,21 +1106,21 @@ bool QtRec::setupAudio( bool b) {
1107 dspString = hwcfg.readEntry( "Audio", DSPSTRIN); 1106 dspString = hwcfg.readEntry( "Audio", DSPSTRIN);
1108 mixerString = hwcfg.readEntry( "Mixer", DSPSTRMIXERIN); 1107 mixerString = hwcfg.readEntry( "Mixer", DSPSTRMIXERIN);
1109 recording = true; 1108 recording = true;
1110 } 1109 }
1111 1110
1112 // if(soundDevice) delete soundDevice; 1111 // if(soundDevice) delete soundDevice;
1113 qDebug("<<<<<<<<<<<<<<<<<<<open dsp %d %d %d", filePara.sampleRate, filePara.channels, sampleformat); 1112 odebug << "<<<<<<<<<<<<<<<<<<<open dsp " << filePara.sampleRate << " " << filePara.channels << " " << sampleformat << "" << oendl;
1114 qWarning("change waveform settings"); 1113 owarn << "change waveform settings" << oendl;
1115 waveform->changeSettings( filePara.sampleRate, filePara.channels ); 1114 waveform->changeSettings( filePara.sampleRate, filePara.channels );
1116 1115
1117 soundDevice = new Device( this, dspString, mixerString, b); 1116 soundDevice = new Device( this, dspString, mixerString, b);
1118// soundDevice->openDsp(); 1117// soundDevice->openDsp();
1119 soundDevice->reset(); 1118 soundDevice->reset();
1120 1119
1121 qDebug("device has been made %d", soundDevice->sd); 1120 odebug << "device has been made " << soundDevice->sd << "" << oendl;
1122 1121
1123 ////////////////// <<<<<<<<<<<<>>>>>>>>>>>> 1122 ////////////////// <<<<<<<<<<<<>>>>>>>>>>>>
1124 soundDevice->setDeviceFormat( sampleformat); 1123 soundDevice->setDeviceFormat( sampleformat);
1125 soundDevice->setDeviceChannels( filePara.channels); 1124 soundDevice->setDeviceChannels( filePara.channels);
1126 soundDevice->setDeviceRate( filePara.sampleRate); 1125 soundDevice->setDeviceRate( filePara.sampleRate);
1127 soundDevice->getDeviceFragSize(); 1126 soundDevice->getDeviceFragSize();
@@ -1146,13 +1145,13 @@ bool QtRec::setupAudio( bool b) {
1146 1145
1147 return true; 1146 return true;
1148} 1147}
1149 1148
1150 1149
1151bool QtRec::setUpFile() { //setup file for recording 1150bool QtRec::setUpFile() { //setup file for recording
1152// qDebug("Setting up wavfile"); 1151// odebug << "Setting up wavfile" << oendl;
1153// if(wavFile) delete wavFile; 1152// if(wavFile) delete wavFile;
1154 wavFile = new WavFile( this, (const QString &)"", 1153 wavFile = new WavFile( this, (const QString &)"",
1155 true, 1154 true,
1156 filePara.sampleRate, 1155 filePara.sampleRate,
1157 filePara.channels, 1156 filePara.channels,
1158 filePara.resolution, 1157 filePara.resolution,
@@ -1179,13 +1178,13 @@ bool QtRec::doPlay() {
1179 } 1178 }
1180 playing = true; 1179 playing = true;
1181 stopped = false; 1180 stopped = false;
1182 recording = false; 1181 recording = false;
1183 1182
1184 QString num; 1183 QString num;
1185 qDebug( "Play number of samples %d", filePara.numberSamples); 1184 odebug << "Play number of samples " << filePara.numberSamples << "" << oendl;
1186 1185
1187// timeSlider->setRange( 0, filePara.numberSamples); 1186// timeSlider->setRange( 0, filePara.numberSamples);
1188 1187
1189 timeString.sprintf("%f", filePara.numberOfRecordedSeconds); 1188 timeString.sprintf("%f", filePara.numberOfRecordedSeconds);
1190 timeLabel->setText( timeString+ tr(" seconds")); 1189 timeLabel->setText( timeString+ tr(" seconds"));
1191 1190
@@ -1231,13 +1230,13 @@ void QtRec::changesamplerateCombo(int i) {
1231 cfg.setGroup("Settings"); 1230 cfg.setGroup("Settings");
1232 int rate=0; 1231 int rate=0;
1233 bool ok; 1232 bool ok;
1234 rate = sampleRateComboBox->text(i).toInt(&ok, 10); 1233 rate = sampleRateComboBox->text(i).toInt(&ok, 10);
1235 cfg.writeEntry( "samplerate",rate); 1234 cfg.writeEntry( "samplerate",rate);
1236 filePara.sampleRate=rate; 1235 filePara.sampleRate=rate;
1237 qDebug( "Change sample rate %d", rate); 1236 odebug << "Change sample rate " << rate << "" << oendl;
1238 cfg.write(); 1237 cfg.write();
1239} 1238}
1240 1239
1241 1240
1242void QtRec::changeDirCombo(int index) { 1241void QtRec::changeDirCombo(int index) {
1243 Config cfg("OpieRec"); 1242 Config cfg("OpieRec");
@@ -1251,13 +1250,13 @@ void QtRec::changeDirCombo(int index) {
1251 for( ; it.current(); ++it ){ 1250 for( ; it.current(); ++it ){
1252 if( sName == (*it)->name()+" "+ (*it)->path() || 1251 if( sName == (*it)->name()+" "+ (*it)->path() ||
1253 (*it)->name() == sName ) { 1252 (*it)->name() == sName ) {
1254 const QString path = (*it)->path(); 1253 const QString path = (*it)->path();
1255 recDir = path; 1254 recDir = path;
1256 cfg.writeEntry("directory", recDir); 1255 cfg.writeEntry("directory", recDir);
1257 qDebug("new rec dir "+recDir); 1256 odebug << "new rec dir "+recDir << oendl;
1258 } 1257 }
1259 } 1258 }
1260 cfg.write(); 1259 cfg.write();
1261} 1260}
1262 1261
1263 1262
@@ -1371,13 +1370,13 @@ void QtRec::keyPressEvent( QKeyEvent *e) {
1371 // stop(); 1370 // stop();
1372 break; 1371 break;
1373 case Key_Down: 1372 case Key_Down:
1374 // newSound(); 1373 // newSound();
1375 break; 1374 break;
1376 case Key_Left: { 1375 case Key_Left: {
1377 qDebug("rewinding"); 1376 odebug << "rewinding" << oendl;
1378 if( !e->isAutoRepeat()) 1377 if( !e->isAutoRepeat())
1379 rewindPressed(); 1378 rewindPressed();
1380 } 1379 }
1381 break; 1380 break;
1382 case Key_Right: { 1381 case Key_Right: {
1383 if( !e->isAutoRepeat()) 1382 if( !e->isAutoRepeat())
@@ -1425,25 +1424,25 @@ void QtRec::keyReleaseEvent( QKeyEvent *e) {
1425 break; 1424 break;
1426 case Key_Delete: 1425 case Key_Delete:
1427 deleteSound(); 1426 deleteSound();
1428 break; 1427 break;
1429 case Key_Up: 1428 case Key_Up:
1430 // stop(); 1429 // stop();
1431 qDebug("Up"); 1430 odebug << "Up" << oendl;
1432 break; 1431 break;
1433 case Key_Down: 1432 case Key_Down:
1434 // start(); 1433 // start();
1435 // qDebug("Down"); 1434 // odebug << "Down" << oendl;
1436 // newSound(); 1435 // newSound();
1437 break; 1436 break;
1438 case Key_Left: 1437 case Key_Left:
1439 qDebug("Left"); 1438 odebug << "Left" << oendl;
1440 rewindReleased(); 1439 rewindReleased();
1441 break; 1440 break;
1442 case Key_Right: 1441 case Key_Right:
1443 qDebug("Right"); 1442 odebug << "Right" << oendl;
1444 FastforwardReleased(); 1443 FastforwardReleased();
1445 break; 1444 break;
1446 } 1445 }
1447} 1446}
1448 1447
1449void QtRec::endRecording() { 1448void QtRec::endRecording() {
@@ -1472,17 +1471,17 @@ void QtRec::endRecording() {
1472 filePara.fd=0; 1471 filePara.fd=0;
1473 1472
1474 if( wavFile->isTempFile()) { 1473 if( wavFile->isTempFile()) {
1475// move tmp file to regular file 1474// move tmp file to regular file
1476 QString cmd; 1475 QString cmd;
1477 cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName); 1476 cmd.sprintf("mv "+ wavFile->trackName() + " " + wavFile->currentFileName);
1478// qDebug("moving tmp file to "+currentFileName); 1477// odebug << "moving tmp file to "+currentFileName << oendl;
1479 system( cmd.latin1()); 1478 system( cmd.latin1());
1480 } 1479 }
1481 1480
1482 qDebug("Just moved " + wavFile->currentFileName); 1481 odebug << "Just moved " + wavFile->currentFileName << oendl;
1483 Config cfg("OpieRec"); 1482 Config cfg("OpieRec");
1484 cfg.setGroup("Sounds"); 1483 cfg.setGroup("Sounds");
1485 1484
1486 int nFiles = cfg.readNumEntry( "NumberofFiles",0); 1485 int nFiles = cfg.readNumEntry( "NumberofFiles",0);
1487 1486
1488 currentFile = QFileInfo( wavFile->currentFileName).fileName(); 1487 currentFile = QFileInfo( wavFile->currentFileName).fileName();
@@ -1492,16 +1491,16 @@ void QtRec::endRecording() {
1492 cfg.writeEntry( QString::number( nFiles + 1), currentFile); 1491 cfg.writeEntry( QString::number( nFiles + 1), currentFile);
1493 cfg.writeEntry( currentFile, wavFile->currentFileName); 1492 cfg.writeEntry( currentFile, wavFile->currentFileName);
1494 1493
1495 QString time; 1494 QString time;
1496 time.sprintf("%.2f", filePara.numberOfRecordedSeconds); 1495 time.sprintf("%.2f", filePara.numberOfRecordedSeconds);
1497 cfg.writeEntry( wavFile->currentFileName, time ); 1496 cfg.writeEntry( wavFile->currentFileName, time );
1498// qDebug("writing config numberOfRecordedSeconds "+time); 1497// odebug << "writing config numberOfRecordedSeconds "+time << oendl;
1499 1498
1500 cfg.write(); 1499 cfg.write();
1501 qDebug("finished recording"); 1500 odebug << "finished recording" << oendl;
1502 timeLabel->setText(""); 1501 timeLabel->setText("");
1503 } 1502 }
1504 1503
1505 if(soundDevice) delete soundDevice; 1504 if(soundDevice) delete soundDevice;
1506 1505
1507 timeSlider->setValue(0); 1506 timeSlider->setValue(0);
@@ -1513,36 +1512,36 @@ void QtRec::endPlaying() {
1513 monitoring = false; 1512 monitoring = false;
1514 recording = false; 1513 recording = false;
1515 playing = false; 1514 playing = false;
1516 stopped = true; 1515 stopped = true;
1517 waveform->reset(); 1516 waveform->reset();
1518// errorStop(); 1517// errorStop();
1519// qDebug("end playing"); 1518// odebug << "end playing" << oendl;
1520 setRecordButton( false); 1519 setRecordButton( false);
1521 1520
1522 toBeginningButton->setEnabled( true); 1521 toBeginningButton->setEnabled( true);
1523 toEndButton->setEnabled( true); 1522 toEndButton->setEnabled( true);
1524 1523
1525 if(autoMute) 1524 if(autoMute)
1526 doMute( true); 1525 doMute( true);
1527 1526
1528 soundDevice->closeDevice( false); 1527 soundDevice->closeDevice( false);
1529 soundDevice->sd = -1; 1528 soundDevice->sd = -1;
1530 // if(soundDevice) delete soundDevice; 1529 // if(soundDevice) delete soundDevice;
1531// qDebug("file and sound device closed"); 1530// odebug << "file and sound device closed" << oendl;
1532 timeLabel->setText(""); 1531 timeLabel->setText("");
1533 total = 0; 1532 total = 0;
1534 filePara.numberSamples = 0; 1533 filePara.numberSamples = 0;
1535 filePara.sd = -1; 1534 filePara.sd = -1;
1536// wavFile->closeFile(); 1535// wavFile->closeFile();
1537 filePara.fd = 0; 1536 filePara.fd = 0;
1538// if(wavFile) delete wavFile; //this crashes 1537// if(wavFile) delete wavFile; //this crashes
1539 1538
1540// qDebug("track closed"); 1539// odebug << "track closed" << oendl;
1541 killTimers(); 1540 killTimers();
1542 qWarning("reset slider"); 1541 owarn << "reset slider" << oendl;
1543 timeSlider->setValue(0); 1542 timeSlider->setValue(0);
1544 1543
1545 if(soundDevice) delete soundDevice; 1544 if(soundDevice) delete soundDevice;
1546 1545
1547} 1546}
1548 1547
@@ -1558,13 +1557,13 @@ bool QtRec::openPlayFile() {
1558 Config cfg("OpieRec"); 1557 Config cfg("OpieRec");
1559 cfg.setGroup("Sounds"); 1558 cfg.setGroup("Sounds");
1560 int nFiles = cfg.readNumEntry( "NumberofFiles", 0); 1559 int nFiles = cfg.readNumEntry( "NumberofFiles", 0);
1561 for(int i=0;i<nFiles+1;i++) { //look for file 1560 for(int i=0;i<nFiles+1;i++) { //look for file
1562 if( cfg.readEntry( QString::number(i),"").find( currentFile,0,true) != -1) { 1561 if( cfg.readEntry( QString::number(i),"").find( currentFile,0,true) != -1) {
1563 currentFileName = cfg.readEntry( currentFile, "" ); 1562 currentFileName = cfg.readEntry( currentFile, "" );
1564 qDebug("opening for play: " + currentFileName); 1563 odebug << "opening for play: " + currentFileName << oendl;
1565 } 1564 }
1566 } 1565 }
1567 wavFile = new WavFile(this, 1566 wavFile = new WavFile(this,
1568 currentFileName, 1567 currentFileName,
1569 false); 1568 false);
1570 filePara.fd = wavFile->wavHandle(); 1569 filePara.fd = wavFile->wavHandle();
@@ -1583,16 +1582,16 @@ bool QtRec::openPlayFile() {
1583 filePara.sampleRate = wavFile->getSampleRate(); 1582 filePara.sampleRate = wavFile->getSampleRate();
1584 filePara.resolution = wavFile->getResolution(); 1583 filePara.resolution = wavFile->getResolution();
1585 filePara.channels = wavFile->getChannels(); 1584 filePara.channels = wavFile->getChannels();
1586 timeSlider->setPageStep(1); 1585 timeSlider->setPageStep(1);
1587 monitoring = true; 1586 monitoring = true;
1588 1587
1589 qDebug("file %d, samples %d %d", filePara.fd, filePara.numberSamples, filePara.sampleRate); 1588 odebug << "file " << filePara.fd << ", samples " << filePara.numberSamples << " " << filePara.sampleRate << "" << oendl;
1590 int sec = (int) (( filePara.numberSamples / filePara.sampleRate) / filePara.channels) / ( filePara.channels*( filePara.resolution/8)); 1589 int sec = (int) (( filePara.numberSamples / filePara.sampleRate) / filePara.channels) / ( filePara.channels*( filePara.resolution/8));
1591 1590
1592 qWarning("seconds %d", sec); 1591 owarn << "seconds " << sec << "" << oendl;
1593 1592
1594 timeSlider->setRange(0, filePara.numberSamples ); 1593 timeSlider->setRange(0, filePara.numberSamples );
1595 } 1594 }
1596 1595
1597 return true; 1596 return true;
1598} 1597}
@@ -1687,25 +1686,25 @@ void QtRec::doRename() {
1687 renameBox->setFocus(); 1686 renameBox->setFocus();
1688 renameBox->show(); 1687 renameBox->show();
1689 1688
1690} 1689}
1691 1690
1692void QtRec::okRename() { 1691void QtRec::okRename() {
1693 qDebug(renameBox->text()); 1692 odebug << renameBox->text() << oendl;
1694 QString filename = renameBox->text(); 1693 QString filename = renameBox->text();
1695 cancelRename(); 1694 cancelRename();
1696 1695
1697 if( ListView1->currentItem() == NULL) 1696 if( ListView1->currentItem() == NULL)
1698 return; 1697 return;
1699 1698
1700 Config cfg("OpieRec"); 1699 Config cfg("OpieRec");
1701 cfg.setGroup("Sounds"); 1700 cfg.setGroup("Sounds");
1702 1701
1703 QString file = ListView1->currentItem()->text(0); 1702 QString file = ListView1->currentItem()->text(0);
1704 1703
1705 qDebug("filename is " + filename); 1704 odebug << "filename is " + filename << oendl;
1706 1705
1707 int nFiles = cfg.readNumEntry("NumberofFiles",0); 1706 int nFiles = cfg.readNumEntry("NumberofFiles",0);
1708 1707
1709 for(int i=0;i<nFiles+1;i++) { //look for file 1708 for(int i=0;i<nFiles+1;i++) { //look for file
1710 if( cfg.readEntry( QString::number(i),"").find(file,0,true) != -1) { 1709 if( cfg.readEntry( QString::number(i),"").find(file,0,true) != -1) {
1711 1710
@@ -1770,13 +1769,13 @@ void QtRec::doVolMuting(bool b) {
1770 cfg.writeEntry( "Mute",b); 1769 cfg.writeEntry( "Mute",b);
1771 cfg.write(); 1770 cfg.write();
1772 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << b; 1771 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << b;
1773} 1772}
1774 1773
1775void QtRec::doMicMuting(bool b) { 1774void QtRec::doMicMuting(bool b) {
1776 // qDebug("mic mute"); 1775 // odebug << "mic mute" << oendl;
1777 Config cfg( "qpe" ); 1776 Config cfg( "qpe" );
1778 cfg. setGroup( "Volume" ); 1777 cfg. setGroup( "Volume" );
1779 cfg.writeEntry( "MicMute",b); 1778 cfg.writeEntry( "MicMute",b);
1780 cfg.write(); 1779 cfg.write();
1781 QCopEnvelope( "QPE/System", "micChange(bool)" ) << b; 1780 QCopEnvelope( "QPE/System", "micChange(bool)" ) << b;
1782} 1781}
@@ -1826,13 +1825,13 @@ long QtRec::checkDiskSpace(const QString &path) {
1826// long f_files; /* Total number of file nodes */ 1825// long f_files; /* Total number of file nodes */
1827// long f_ffree; /* Count of free file nodes */ 1826// long f_ffree; /* Count of free file nodes */
1828// char f_fname[6]; /* Volumename */ 1827// char f_fname[6]; /* Volumename */
1829// char f_fpack[6]; /* Pack name */ 1828// char f_fpack[6]; /* Pack name */
1830 1829
1831void QtRec::receive( const QCString &msg, const QByteArray & ) { 1830void QtRec::receive( const QCString &msg, const QByteArray & ) {
1832 qDebug("Voicerecord received message "+msg); 1831 odebug << "Voicerecord received message "+msg << oendl;
1833 1832
1834} 1833}
1835 1834
1836 1835
1837///////////////////////////// timerEvent 1836///////////////////////////// timerEvent
1838void QtRec::timerEvent( QTimerEvent * ) { 1837void QtRec::timerEvent( QTimerEvent * ) {
@@ -1851,13 +1850,13 @@ void QtRec::timerEvent( QTimerEvent * ) {
1851 } 1850 }
1852 1851
1853 if( recording && filePara.SecondsToRecord < secCount && filePara.SecondsToRecord != 0) { 1852 if( recording && filePara.SecondsToRecord < secCount && filePara.SecondsToRecord != 0) {
1854 stop(); 1853 stop();
1855 } 1854 }
1856 1855
1857 qDebug( "%d", secCount ); 1856 odebug << "" << secCount << "" << oendl;
1858 QString timeString; 1857 QString timeString;
1859#ifdef DEV_VERSION 1858#ifdef DEV_VERSION
1860 QString msg; 1859 QString msg;
1861 msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution); 1860 msg.sprintf("%d, %d, %d", filePara.sampleRate, filePara.channels, filePara.resolution);
1862 setCaption( msg +" :: "+QString::number(secCount)); 1861 setCaption( msg +" :: "+QString::number(secCount));
1863#endif 1862#endif
@@ -1867,13 +1866,13 @@ void QtRec::timerEvent( QTimerEvent * ) {
1867 1866
1868 secCount++; 1867 secCount++;
1869} 1868}
1870 1869
1871void QtRec::changeTimeSlider(int index) { 1870void QtRec::changeTimeSlider(int index) {
1872 if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return; 1871 if( ListView1->currentItem() == 0 || !wavFile->track.isOpen()) return;
1873 // qDebug("Slider moved to %d",index); 1872 // odebug << "Slider moved to " << index << "" << oendl;
1874 paused = true; 1873 paused = true;
1875 stopped = true; 1874 stopped = true;
1876 1875
1877 sliderPos=index; 1876 sliderPos=index;
1878 1877
1879 QString timeString; 1878 QString timeString;
@@ -1882,22 +1881,22 @@ void QtRec::changeTimeSlider(int index) {
1882 secCount = (int)filePara.numberOfRecordedSeconds; 1881 secCount = (int)filePara.numberOfRecordedSeconds;
1883 timeLabel->setText( timeString + tr(" seconds")); 1882 timeLabel->setText( timeString + tr(" seconds"));
1884} 1883}
1885 1884
1886void QtRec::timeSliderPressed() { 1885void QtRec::timeSliderPressed() {
1887 if( ListView1->currentItem() == 0) return; 1886 if( ListView1->currentItem() == 0) return;
1888 // qDebug("slider pressed"); 1887 // odebug << "slider pressed" << oendl;
1889 paused = true; 1888 paused = true;
1890 stopped = true; 1889 stopped = true;
1891} 1890}
1892 1891
1893void QtRec::timeSliderReleased() { 1892void QtRec::timeSliderReleased() {
1894 if( ListView1->currentItem() == 0) return; 1893 if( ListView1->currentItem() == 0) return;
1895 sliderPos = timeSlider->value(); 1894 sliderPos = timeSlider->value();
1896 1895
1897 // qDebug("slider released %d", sliderPos); 1896 // odebug << "slider released " << sliderPos << "" << oendl;
1898 stopped = false; 1897 stopped = false;
1899 int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); 1898 int newPos = lseek( filePara.fd, sliderPos, SEEK_SET);
1900 total = newPos*4; 1899 total = newPos*4;
1901 filePara.numberOfRecordedSeconds = (float)sliderPos / (float)filePara.sampleRate * (float)2; 1900 filePara.numberOfRecordedSeconds = (float)sliderPos / (float)filePara.sampleRate * (float)2;
1902 1901
1903 doPlay(); 1902 doPlay();
@@ -1921,13 +1920,13 @@ void QtRec::rewindPressed() {
1921 1920
1922void QtRec::rewindTimerTimeout() { 1921void QtRec::rewindTimerTimeout() {
1923 int sliderValue = timeSlider->value(); 1922 int sliderValue = timeSlider->value();
1924 sliderValue = sliderValue - ( filePara.numberSamples / 100); 1923 sliderValue = sliderValue - ( filePara.numberSamples / 100);
1925 // if(toBeginningButton->isDown()) 1924 // if(toBeginningButton->isDown())
1926 timeSlider->setValue( sliderValue ) ; 1925 timeSlider->setValue( sliderValue ) ;
1927 // qDebug("%d", sliderValue); 1926 // odebug << "" << sliderValue << "" << oendl;
1928 QString timeString; 1927 QString timeString;
1929 filePara.numberOfRecordedSeconds = (float)sliderValue / (float)filePara.sampleRate * (float)2; 1928 filePara.numberOfRecordedSeconds = (float)sliderValue / (float)filePara.sampleRate * (float)2;
1930 timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds); 1929 timeString.sprintf( "%.2f", filePara.numberOfRecordedSeconds);
1931 timeLabel->setText( timeString+ tr(" seconds")); 1930 timeLabel->setText( timeString+ tr(" seconds"));
1932} 1931}
1933 1932
@@ -1935,13 +1934,13 @@ void QtRec::rewindReleased() {
1935 rewindTimer->stop(); 1934 rewindTimer->stop();
1936 if( wavFile->track.isOpen()) { 1935 if( wavFile->track.isOpen()) {
1937 sliderPos=timeSlider->value(); 1936 sliderPos=timeSlider->value();
1938 stopped = false; 1937 stopped = false;
1939 int newPos = lseek( filePara.fd, sliderPos, SEEK_SET); 1938 int newPos = lseek( filePara.fd, sliderPos, SEEK_SET);
1940 total = newPos * 4; 1939 total = newPos * 4;
1941 // qDebug("rewind released %d", total); 1940 // odebug << "rewind released " << total << "" << oendl;
1942 startTimer( 1000); 1941 startTimer( 1000);
1943 doPlay(); 1942 doPlay();
1944 } 1943 }
1945} 1944}
1946 1945
1947void QtRec::FastforwardPressed() { 1946void QtRec::FastforwardPressed() {
@@ -1999,13 +1998,13 @@ QString QtRec::getStorage(const QString &fileName) {
1999 const QString disk = ( *it)->disk(); 1998 const QString disk = ( *it)->disk();
2000 if( fileName.find( path,0,true) != -1) 1999 if( fileName.find( path,0,true) != -1)
2001 storage = name; 2000 storage = name;
2002 // const QString options = (*it)->options(); 2001 // const QString options = (*it)->options();
2003 // if( name.find( tr("Internal"),0,true) == -1) { 2002 // if( name.find( tr("Internal"),0,true) == -1) {
2004 // storageComboBox->insertItem( name +" -> "+disk); 2003 // storageComboBox->insertItem( name +" -> "+disk);
2005 // qDebug(name); 2004 // odebug << name << oendl;
2006 } 2005 }
2007 return storage; 2006 return storage;
2008 // struct mntent *me; 2007 // struct mntent *me;
2009 // // if(fileName == "/etc/mtab") { 2008 // // if(fileName == "/etc/mtab") {
2010 // FILE *mntfp = setmntent( fileName.latin1(), "r" ); 2009 // FILE *mntfp = setmntent( fileName.latin1(), "r" );
2011 // if ( mntfp ) { 2010 // if ( mntfp ) {
diff --git a/noncore/multimedia/opierec/wavFile.cpp b/noncore/multimedia/opierec/wavFile.cpp
index 35bc14d..7e9b50f 100644
--- a/noncore/multimedia/opierec/wavFile.cpp
+++ b/noncore/multimedia/opierec/wavFile.cpp
@@ -1,33 +1,36 @@
1//wavFile.cpp 1//wavFile.cpp
2#include "wavFile.h" 2#include "wavFile.h"
3#include "qtrec.h" 3#include "qtrec.h"
4 4
5/* OPIE */
6#include <opie2/odebug.h>
7#include <qpe/config.h>
8using namespace Opie::Core;
9
10/* QT */
5#include <qmessagebox.h> 11#include <qmessagebox.h>
6#include <qdir.h> 12#include <qdir.h>
7 13
8#include <qpe/config.h> 14/* STD */
9
10#include <errno.h> 15#include <errno.h>
11
12#include <sys/time.h> 16#include <sys/time.h>
13#include <sys/types.h> 17#include <sys/types.h>
14#include <sys/vfs.h> 18#include <sys/vfs.h>
15
16#include <fcntl.h> 19#include <fcntl.h>
17#include <math.h> 20#include <math.h>
18#include <mntent.h> 21#include <mntent.h>
19#include <stdio.h> 22#include <stdio.h>
20#include <stdlib.h> 23#include <stdlib.h>
21#include <unistd.h> 24#include <unistd.h>
22 25
23WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int sampleRate, 26WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int sampleRate,
24 int channels, int resolution, int format ) 27 int channels, int resolution, int format )
25 : QObject( parent) 28 : QObject( parent)
26{ 29{
27//qDebug("new wave file"); 30//odebug << "new wave file" << oendl;
28 bool b = makeNwFile; 31 bool b = makeNwFile;
29 wavSampleRate=sampleRate; 32 wavSampleRate=sampleRate;
30 wavFormat=format; 33 wavFormat=format;
31 wavChannels=channels; 34 wavChannels=channels;
32 wavResolution=resolution; 35 wavResolution=resolution;
33 useTmpFile=false; 36 useTmpFile=false;
@@ -37,13 +40,13 @@ WavFile::WavFile( QObject * parent,const QString &fileName, bool makeNwFile, int
37 openFile(fileName); 40 openFile(fileName);
38 } 41 }
39} 42}
40 43
41bool WavFile::newFile() { 44bool WavFile::newFile() {
42 45
43// qDebug("Set up new file"); 46// odebug << "Set up new file" << oendl;
44 Config cfg("OpieRec"); 47 Config cfg("OpieRec");
45 cfg.setGroup("Settings"); 48 cfg.setGroup("Settings");
46 49
47 currentFileName=cfg.readEntry("directory",QDir::homeDirPath()); 50 currentFileName=cfg.readEntry("directory",QDir::homeDirPath());
48 QString date; 51 QString date;
49 QDateTime dt = QDateTime::currentDateTime(); 52 QDateTime dt = QDateTime::currentDateTime();
@@ -57,13 +60,13 @@ bool WavFile::newFile() {
57 if(currentFileName.right(1).find("/",0,true) == -1) 60 if(currentFileName.right(1).find("/",0,true) == -1)
58 currentFileName += "/" + date; 61 currentFileName += "/" + date;
59 else 62 else
60 currentFileName += date; 63 currentFileName += date;
61 currentFileName+=".wav"; 64 currentFileName+=".wav";
62 65
63// qDebug("set up file for recording: "+currentFileName); 66// odebug << "set up file for recording: "+currentFileName << oendl;
64 char pointer[] = "/tmp/opierec-XXXXXX"; 67 char pointer[] = "/tmp/opierec-XXXXXX";
65 int fd = 0; 68 int fd = 0;
66 69
67 if( currentFileName.find("/mnt",0,true) == -1 70 if( currentFileName.find("/mnt",0,true) == -1
68 && currentFileName.find("/tmp",0,true) == -1 ) { 71 && currentFileName.find("/tmp",0,true) == -1 ) {
69 // if destination file is most likely in flash (assuming jffs2) 72 // if destination file is most likely in flash (assuming jffs2)
@@ -72,23 +75,23 @@ bool WavFile::newFile() {
72 useTmpFile = true; 75 useTmpFile = true;
73 if(( fd = mkstemp( pointer)) < 0 ) { 76 if(( fd = mkstemp( pointer)) < 0 ) {
74 perror("mkstemp failed"); 77 perror("mkstemp failed");
75 return false; 78 return false;
76 } 79 }
77 80
78// qDebug("Opening tmp file %s",pointer); 81// odebug << "Opening tmp file " << pointer << "" << oendl;
79 track.setName( pointer); 82 track.setName( pointer);
80 83
81 } else { //just use regular file.. no moving 84 } else { //just use regular file.. no moving
82 85
83 useTmpFile = false; 86 useTmpFile = false;
84 track.setName( currentFileName); 87 track.setName( currentFileName);
85 } 88 }
86 if(!track.open( IO_ReadWrite | IO_Truncate)) { 89 if(!track.open( IO_ReadWrite | IO_Truncate)) {
87 QString errorMsg=(QString)strerror(errno); 90 QString errorMsg=(QString)strerror(errno);
88 qDebug(errorMsg); 91 odebug << errorMsg << oendl;
89 QMessageBox::message("Note", "Error opening file.\n" +errorMsg); 92 QMessageBox::message("Note", "Error opening file.\n" +errorMsg);
90 93
91 return false; 94 return false;
92 } else { 95 } else {
93 setWavHeader( track.handle() , &hdr); 96 setWavHeader( track.handle() , &hdr);
94 } 97 }
@@ -103,20 +106,20 @@ WavFile::~WavFile() {
103void WavFile::closeFile() { 106void WavFile::closeFile() {
104 if(track.isOpen()) 107 if(track.isOpen())
105 track.close(); 108 track.close();
106} 109}
107 110
108int WavFile::openFile(const QString &currentFileName) { 111int WavFile::openFile(const QString &currentFileName) {
109// qDebug("open play file "+currentFileName); 112// odebug << "open play file "+currentFileName << oendl;
110 closeFile(); 113 closeFile();
111 114
112 track.setName(currentFileName); 115 track.setName(currentFileName);
113 116
114 if(!track.open(IO_ReadOnly)) { 117 if(!track.open(IO_ReadOnly)) {
115 QString errorMsg=(QString)strerror(errno); 118 QString errorMsg=(QString)strerror(errno);
116 qDebug("<<<<<<<<<<< "+errorMsg+currentFileName); 119 odebug << "<<<<<<<<<<< "+errorMsg+currentFileName << oendl;
117 QMessageBox::message("Note", "Error opening file.\n" +errorMsg); 120 QMessageBox::message("Note", "Error opening file.\n" +errorMsg);
118 return -1; 121 return -1;
119 } else { 122 } else {
120 parseWavHeader( track.handle()); 123 parseWavHeader( track.handle());
121 } 124 }
122 return track.handle(); 125 return track.handle();
@@ -128,17 +131,17 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) {
128 strncpy((*hdr).wavID, "WAVE", 4); //WAVE 131 strncpy((*hdr).wavID, "WAVE", 4); //WAVE
129 strncpy((*hdr).fmtID, "fmt ", 4); // fmt 132 strncpy((*hdr).fmtID, "fmt ", 4); // fmt
130 (*hdr).fmtLen = 16; // format length = 16 133 (*hdr).fmtLen = 16; // format length = 16
131 134
132 if( wavFormat == WAVE_FORMAT_PCM) { 135 if( wavFormat == WAVE_FORMAT_PCM) {
133 (*hdr).fmtTag = 1; // PCM 136 (*hdr).fmtTag = 1; // PCM
134// qDebug("set header WAVE_FORMAT_PCM"); 137// odebug << "set header WAVE_FORMAT_PCM" << oendl;
135 } 138 }
136 else { 139 else {
137 (*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel ADPCM 140 (*hdr).fmtTag = WAVE_FORMAT_DVI_ADPCM; //intel ADPCM
138 // qDebug("set header WAVE_FORMAT_DVI_ADPCM"); 141 // odebug << "set header WAVE_FORMAT_DVI_ADPCM" << oendl;
139 } 142 }
140 143
141 // (*hdr).nChannels = 1;//filePara.channels;// ? 2 : 1*/; // channels 144 // (*hdr).nChannels = 1;//filePara.channels;// ? 2 : 1*/; // channels
142 (*hdr).nChannels = wavChannels;// ? 2 : 1*/; // channels 145 (*hdr).nChannels = wavChannels;// ? 2 : 1*/; // channels
143 146
144 (*hdr).sampleRate = wavSampleRate; //samples per second 147 (*hdr).sampleRate = wavSampleRate; //samples per second
@@ -157,112 +160,112 @@ bool WavFile::setWavHeader(int fd, wavhdr *hdr) {
157bool WavFile::adjustHeaders(int fd, int total) { 160bool WavFile::adjustHeaders(int fd, int total) {
158 lseek(fd, 4, SEEK_SET); 161 lseek(fd, 4, SEEK_SET);
159 int i = total + 36; 162 int i = total + 36;
160 write( fd, &i, sizeof(i)); 163 write( fd, &i, sizeof(i));
161 lseek( fd, 40, SEEK_SET); 164 lseek( fd, 40, SEEK_SET);
162 write( fd, &total, sizeof(total)); 165 write( fd, &total, sizeof(total));
163 qDebug("adjusting header %d", total); 166 odebug << "adjusting header " << total << "" << oendl;
164 return true; 167 return true;
165} 168}
166 169
167int WavFile::parseWavHeader(int fd) { 170int WavFile::parseWavHeader(int fd) {
168 qDebug("Parsing wav header"); 171 odebug << "Parsing wav header" << oendl;
169 char string[4]; 172 char string[4];
170 int found; 173 int found;
171 short fmt; 174 short fmt;
172 unsigned short ch, bitrate; 175 unsigned short ch, bitrate;
173 unsigned long samplerrate, longdata; 176 unsigned long samplerrate, longdata;
174 177
175 if (read(fd, string, 4) < 4) { 178 if (read(fd, string, 4) < 4) {
176 qDebug(" Could not read from sound file.\n"); 179 odebug << " Could not read from sound file.\n" << oendl;
177 return -1; 180 return -1;
178 } 181 }
179 if (strncmp(string, "RIFF", 4)) { 182 if (strncmp(string, "RIFF", 4)) {
180 qDebug(" not a valid WAV file.\n"); 183 odebug << " not a valid WAV file.\n" << oendl;
181 return -1; 184 return -1;
182 } 185 }
183 lseek(fd, 4, SEEK_CUR); 186 lseek(fd, 4, SEEK_CUR);
184 if (read(fd, string, 4) < 4) { 187 if (read(fd, string, 4) < 4) {
185 qDebug("Could not read from sound file.\n"); 188 odebug << "Could not read from sound file.\n" << oendl;
186 return -1; 189 return -1;
187 } 190 }
188 if (strncmp(string, "WAVE", 4)) { 191 if (strncmp(string, "WAVE", 4)) {
189 qDebug("not a valid WAV file.\n"); 192 odebug << "not a valid WAV file.\n" << oendl;
190 return -1; 193 return -1;
191 } 194 }
192 found = 0; 195 found = 0;
193 196
194 while (!found) { 197 while (!found) {
195 if (read(fd, string, 4) < 4) { 198 if (read(fd, string, 4) < 4) {
196 qDebug("Could not read from sound file.\n"); 199 odebug << "Could not read from sound file.\n" << oendl;
197 return -1; 200 return -1;
198 } 201 }
199 if (strncmp(string, "fmt ", 4)) { 202 if (strncmp(string, "fmt ", 4)) {
200 if (read(fd, &longdata, 4) < 4) { 203 if (read(fd, &longdata, 4) < 4) {
201 qDebug("Could not read from sound file.\n"); 204 odebug << "Could not read from sound file.\n" << oendl;
202 return -1; 205 return -1;
203 } 206 }
204 lseek(fd, longdata, SEEK_CUR); 207 lseek(fd, longdata, SEEK_CUR);
205 } else { 208 } else {
206 lseek(fd, 4, SEEK_CUR); 209 lseek(fd, 4, SEEK_CUR);
207 if (read(fd, &fmt, 2) < 2) { 210 if (read(fd, &fmt, 2) < 2) {
208 qDebug("Could not read format chunk.\n"); 211 odebug << "Could not read format chunk.\n" << oendl;
209 return -1; 212 return -1;
210 } 213 }
211 if (fmt != WAVE_FORMAT_PCM && fmt != WAVE_FORMAT_DVI_ADPCM) { 214 if (fmt != WAVE_FORMAT_PCM && fmt != WAVE_FORMAT_DVI_ADPCM) {
212 qDebug("Wave file contains unknown format." 215 qDebug("Wave file contains unknown format."
213 " Unable to continue.\n"); 216 " Unable to continue.\n");
214 return -1; 217 return -1;
215 } 218 }
216 wavFormat = fmt; 219 wavFormat = fmt;
217 // compressionFormat=fmt; 220 // compressionFormat=fmt;
218 qDebug("compressionFormat is %d", fmt); 221 odebug << "compressionFormat is " << fmt << "" << oendl;
219 if (read(fd, &ch, 2) < 2) { 222 if (read(fd, &ch, 2) < 2) {
220 qDebug("Could not read format chunk.\n"); 223 odebug << "Could not read format chunk.\n" << oendl;
221 return -1; 224 return -1;
222 } else { 225 } else {
223 wavChannels = ch; 226 wavChannels = ch;
224 qDebug("File has %d channels", ch); 227 odebug << "File has " << ch << " channels" << oendl;
225 } 228 }
226 if (read(fd, &samplerrate, 4) < 4) { 229 if (read(fd, &samplerrate, 4) < 4) {
227 qDebug("Could not read from format chunk.\n"); 230 odebug << "Could not read from format chunk.\n" << oendl;
228 return -1; 231 return -1;
229 } else { 232 } else {
230 wavSampleRate = samplerrate; 233 wavSampleRate = samplerrate;
231 // sampleRate = samplerrate; 234 // sampleRate = samplerrate;
232 qDebug("File has samplerate of %d",(int) samplerrate); 235 odebug << "File has samplerate of " << (int) samplerrate << "" << oendl;
233 } 236 }
234 lseek(fd, 6, SEEK_CUR); 237 lseek(fd, 6, SEEK_CUR);
235 if (read(fd, &bitrate, 2) < 2) { 238 if (read(fd, &bitrate, 2) < 2) {
236 qDebug("Could not read format chunk.\n"); 239 odebug << "Could not read format chunk.\n" << oendl;
237 return -1; 240 return -1;
238 } else { 241 } else {
239 wavResolution=bitrate; 242 wavResolution=bitrate;
240 // resolution = bitrate; 243 // resolution = bitrate;
241 qDebug("File has bitrate of %d", bitrate); 244 odebug << "File has bitrate of " << bitrate << "" << oendl;
242 } 245 }
243 found++; 246 found++;
244 } 247 }
245 } 248 }
246 found = 0; 249 found = 0;
247 while (!found) { 250 while (!found) {
248 if (read(fd, string, 4) < 4) { 251 if (read(fd, string, 4) < 4) {
249 qDebug("Could not read from sound file.\n"); 252 odebug << "Could not read from sound file.\n" << oendl;
250 return -1; 253 return -1;
251 } 254 }
252 255
253 if (strncmp(string, "data", 4)) { 256 if (strncmp(string, "data", 4)) {
254 if (read(fd, &longdata, 4)<4) { 257 if (read(fd, &longdata, 4)<4) {
255 qDebug("Could not read from sound file.\n"); 258 odebug << "Could not read from sound file.\n" << oendl;
256 return -1; 259 return -1;
257 } 260 }
258 261
259 lseek(fd, longdata, SEEK_CUR); 262 lseek(fd, longdata, SEEK_CUR);
260 } else { 263 } else {
261 if (read(fd, &longdata, 4) < 4) { 264 if (read(fd, &longdata, 4) < 4) {
262 qDebug("Could not read from sound file.\n"); 265 odebug << "Could not read from sound file.\n" << oendl;
263 return -1; 266 return -1;
264 } else { 267 } else {
265 wavNumberSamples = longdata; 268 wavNumberSamples = longdata;
266 qDebug("file has length of %d \nlasting %d seconds", (int)longdata, 269 qDebug("file has length of %d \nlasting %d seconds", (int)longdata,
267 (int)(( longdata / wavSampleRate) / wavChannels) / ( wavChannels*( wavResolution/8)) ); 270 (int)(( longdata / wavSampleRate) / wavChannels) / ( wavChannels*( wavResolution/8)) );
268// wavSeconds = (( longdata / wavSampleRate) / wavChannels) / ( wavChannels*( wavResolution/8)); 271// wavSeconds = (( longdata / wavSampleRate) / wavChannels) / ( wavChannels*( wavResolution/8));
diff --git a/noncore/multimedia/opierec/waveform.cpp b/noncore/multimedia/opierec/waveform.cpp
index 9cc40b4..7c9a25f 100644
--- a/noncore/multimedia/opierec/waveform.cpp
+++ b/noncore/multimedia/opierec/waveform.cpp
@@ -16,14 +16,18 @@
16 ** Contact info@trolltech.com if any conditions of this licensing are 16 ** Contact info@trolltech.com if any conditions of this licensing are
17 ** not clear to you. 17 ** not clear to you.
18 ** 18 **
19 **********************************************************************/ 19 **********************************************************************/
20#include "waveform.h" 20#include "waveform.h"
21 21
22#include <qpainter.h> 22/* OPIE */
23#include <opie2/odebug.h>
24using namespace Opie::Core;
23 25
26/* QT */
27#include <qpainter.h>
24 28
25Waveform::Waveform( QWidget *parent, const char *name, WFlags fl ) 29Waveform::Waveform( QWidget *parent, const char *name, WFlags fl )
26 : QWidget( parent, name, fl ) 30 : QWidget( parent, name, fl )
27{ 31{
28 pixmap = 0; 32 pixmap = 0;
29 windowSize = 100; 33 windowSize = 100;
@@ -35,15 +39,15 @@ Waveform::Waveform( QWidget *parent, const char *name, WFlags fl )
35} 39}
36 40
37 41
38void Waveform::changeSettings( int frequency, int channels ) 42void Waveform::changeSettings( int frequency, int channels )
39{ 43{
40 makePixmap(); 44 makePixmap();
41// qWarning("change waveform %d, %d", frequency, channels); 45// owarn << "change waveform " << frequency << ", " << channels << "" << oendl;
42 samplesPerPixel = frequency * channels / (5 * windowSize); 46 samplesPerPixel = frequency * channels / (5 * windowSize);
43 qWarning("Waveform::changeSettings %d", samplesPerPixel); 47 owarn << "Waveform::changeSettings " << samplesPerPixel << "" << oendl;
44 if ( !samplesPerPixel ) 48 if ( !samplesPerPixel )
45 samplesPerPixel = 1; 49 samplesPerPixel = 1;
46 currentValue = 0; 50 currentValue = 0;
47 numSamples = 0; 51 numSamples = 0;
48 windowPosn = 0; 52 windowPosn = 0;
49 draw(); 53 draw();
@@ -93,13 +97,13 @@ void Waveform::newSamples( const short *buf, int len )
93 numSamples = 0; 97 numSamples = 0;
94 currentValue = 0; 98 currentValue = 0;
95 } 99 }
96 } 100 }
97 101
98 // Copy the final state back to the object. 102 // Copy the final state back to the object.
99//qWarning("%d, %d, %d", currentValue, numSamples, windowPosn); 103//owarn << "" << currentValue << ", " << numSamples << ", " << windowPosn << "" << oendl;
100 this->currentValue = currentValue; 104 this->currentValue = currentValue;
101 this->numSamples = numSamples; 105 this->numSamples = numSamples;
102 this->windowPosn = windowPosn; 106 this->windowPosn = windowPosn;
103} 107}
104 108
105 109
diff --git a/noncore/multimedia/powerchord/config.in b/noncore/multimedia/powerchord/config.in
index ab1512b..5db784a 100644
--- a/noncore/multimedia/powerchord/config.in
+++ b/noncore/multimedia/powerchord/config.in
@@ -1,7 +1,7 @@
1 config POWERCHORD 1 config POWERCHORD
2 boolean "opie-powerchord (guitar chord generator and tuning)" 2 boolean "opie-powerchord (guitar chord generator and tuning)"
3 default "n" 3 default "n"
4 depends ( LIBQPE || LIBQPE-X11 ) 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
5 comment "opie-powerchord needs a libqpe" 5 comment "opie-powerchord needs a libqpe and libopiecore2"
6 depends !(( LIBQPE || LIBQPE-X11 ) ) 6 depends !(( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE )
7 7
diff --git a/noncore/multimedia/powerchord/powerchord.pro b/noncore/multimedia/powerchord/powerchord.pro
index 917c88f..f7af6d6 100644
--- a/noncore/multimedia/powerchord/powerchord.pro
+++ b/noncore/multimedia/powerchord/powerchord.pro
@@ -15,13 +15,12 @@ SOURCES = main.cpp \
15 vumeter.cpp \ 15 vumeter.cpp \
16 gs.cpp gt.cpp \ 16 gs.cpp gt.cpp \
17 powerchordbase.cpp 17 powerchordbase.cpp
18 18
19 INCLUDEPATH+= $(OPIEDIR)/include 19 INCLUDEPATH+= $(OPIEDIR)/include
20 DEPENDPATH+= $(OPIEDIR)/include 20 DEPENDPATH+= $(OPIEDIR)/include
21LIBS += -lqpe 21LIBS += -lqpe -lopiecore2
22 #INTERFACES= powerchordbase.ui
23DESTDIR = $(OPIEDIR)/bin 22DESTDIR = $(OPIEDIR)/bin
24 TARGET = powerchord 23 TARGET = powerchord
25 24
26include ( $(OPIEDIR)/include.pro ) 25include ( $(OPIEDIR)/include.pro )
27 26
diff --git a/noncore/multimedia/powerchord/powerchordbase.cpp b/noncore/multimedia/powerchord/powerchordbase.cpp
index 4fb5dda..0694ba3 100644
--- a/noncore/multimedia/powerchord/powerchordbase.cpp
+++ b/noncore/multimedia/powerchord/powerchordbase.cpp
@@ -4,25 +4,29 @@
4** Created: Sun Jan 13 23:05:11 2002 4** Created: Sun Jan 13 23:05:11 2002
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#include "powerchordbase.h" 9#include "powerchordbase.h"
10
11#include "fretboard.h" 10#include "fretboard.h"
12#include "vumeter.h" 11#include "vumeter.h"
12
13/* OPIE */
14#include <opie2/odebug.h>
15#include <qpe/resource.h>
16using namespace Opie::Core;
17
18/* QT */
13#include <qcombobox.h> 19#include <qcombobox.h>
14#include <qlabel.h> 20#include <qlabel.h>
15#include <qlistbox.h> 21#include <qlistbox.h>
16#include <qpushbutton.h> 22#include <qpushbutton.h>
17#include <qspinbox.h> 23#include <qspinbox.h>
18#include <qtabwidget.h> 24#include <qtabwidget.h>
19#include <qlayout.h> 25#include <qlayout.h>
20#include <qtooltip.h> 26#include <qtooltip.h>
21#include <qpe/resource.h>
22
23 27
24/* 28/*
25 * Constructs a PowerchordBase which is a child of 'parent', with the 29 * Constructs a PowerchordBase which is a child of 'parent', with the
26 * name 'name' and widget flags set to 'f' 30 * name 'name' and widget flags set to 'f'
27 */ 31 */
28PowerchordBase::PowerchordBase( QWidget* parent, const char* name, WFlags fl ) 32PowerchordBase::PowerchordBase( QWidget* parent, const char* name, WFlags fl )
@@ -577,9 +581,9 @@ PowerchordBase::~PowerchordBase()
577{ 581{
578 // no need to delete child widgets, Qt does it all for us 582 // no need to delete child widgets, Qt does it all for us
579} 583}
580 584
581void PowerchordBase::change_handler() 585void PowerchordBase::change_handler()
582{ 586{
583 qWarning( "PowerchordBase::change_handler(): Not implemented yet!" ); 587 owarn << "PowerchordBase::change_handler(): Not implemented yet!" << oendl;
584} 588}
585 589
diff --git a/noncore/multimedia/showimg/ImageFileSelector.cpp b/noncore/multimedia/showimg/ImageFileSelector.cpp
index 79ee925..53cc883 100644
--- a/noncore/multimedia/showimg/ImageFileSelector.cpp
+++ b/noncore/multimedia/showimg/ImageFileSelector.cpp
@@ -1,17 +1,19 @@
1#include "ImageFileSelector.h"
1 2
3/* OPIE */
4#include <opie2/odebug.h>
5#include <qpe/qpeapplication.h>
6using namespace Opie::Core;
2 7
3#include "qpe/qpeapplication.h" 8/* QT */
4 9#include <qlabel.h>
5#include <stdlib.h>
6
7#include <qlabel.h>
8#include <qfileinfo.h> 10#include <qfileinfo.h>
9 11
10#include "ImageFileSelector.h" 12/* STD */
11 13#include <stdlib.h>
12 14
13ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w) 15ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w)
14 : QWidget( parent ),fl(f) 16 : QWidget( parent ),fl(f)
15{ 17{
16 setBackgroundMode(NoBackground); 18 setBackgroundMode(NoBackground);
17 if ( w!=-1 ) 19 if ( w!=-1 )
@@ -152,13 +154,13 @@ void ImageFileSelector::updateSizes()
152 background->setMinimumWidth(thumb->visibleWidth()); 154 background->setMinimumWidth(thumb->visibleWidth());
153 thumb->updateScrollBars(); 155 thumb->updateScrollBars();
154} 156}
155 157
156void ImageFileSelector::reread(bool) 158void ImageFileSelector::reread(bool)
157{ 159{
158// qDebug("reread"); 160// odebug << "reread" << oendl;
159 ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->selectedItem(); 161 ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->selectedItem();
160 QString oldFile; 162 QString oldFile;
161 if ( item ) 163 if ( item )
162 oldFile = item->file().file(); 164 oldFile = item->file().file();
163 detailed->clear(); 165 detailed->clear();
164 tList.clear(); 166 tList.clear();
@@ -218,13 +220,13 @@ void ImageFileSelector::reread(bool)
218int ImageFileSelector::fileCount() 220int ImageFileSelector::fileCount()
219{ 221{
220 return count; 222 return count;
221} 223}
222const DocLnk * ImageFileSelector::selected() 224const DocLnk * ImageFileSelector::selected()
223{ 225{
224 qDebug("image selected"); 226 odebug << "image selected" << oendl;
225 ImageFileSelectorItem *item = (ImageFileSelectorItem *) detailed->selectedItem(); 227 ImageFileSelectorItem *item = (ImageFileSelectorItem *) detailed->selectedItem();
226 if ( item ) 228 if ( item )
227 return new DocLnk( item->file() ); 229 return new DocLnk( item->file() );
228 return 0; 230 return 0;
229} 231}
230 232
diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp
index 696a57b..24377ed 100644
--- a/noncore/multimedia/showimg/showimg.cpp
+++ b/noncore/multimedia/showimg/showimg.cpp
@@ -23,29 +23,31 @@
23// 23//
24 24
25#include "showimg.h" 25#include "showimg.h"
26#include "ImageFileSelector.h" 26#include "ImageFileSelector.h"
27#include "settingsdialog.h" 27#include "settingsdialog.h"
28 28
29 29/* OPIE */
30#include <opie2/odebug.h>
30#include <opie2/ofiledialog.h> 31#include <opie2/ofiledialog.h>
31
32#include <qpe/qpeapplication.h> 32#include <qpe/qpeapplication.h>
33#include <qpe/config.h> 33#include <qpe/config.h>
34#include <qpe/resource.h> 34#include <qpe/resource.h>
35#include <qtoolbar.h> 35using namespace Opie::Core;
36using namespace Opie::Ui;
36 37
38/* QT */
39#include <qtoolbar.h>
37#include <qaction.h> 40#include <qaction.h>
38#include <qfiledialog.h> 41#include <qfiledialog.h>
39#include <qmenubar.h> 42#include <qmenubar.h>
40#include <qspinbox.h> 43#include <qspinbox.h>
41 44
45/* STD */
42#include <math.h> 46#include <math.h>
43 47
44
45using namespace Opie::Ui;
46ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) 48ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent)
47 : QDialog(parent,0,true) 49 : QDialog(parent,0,true)
48{ 50{
49 setCaption(caption); 51 setCaption(caption);
50 52
51 if ( parent ) { 53 if ( parent ) {
@@ -283,13 +285,13 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int /*wFlags*/ )
283 ImageFileSelector::CURRENT_VIEW cv; 285 ImageFileSelector::CURRENT_VIEW cv;
284 if(showThumbView) 286 if(showThumbView)
285 cv=ImageFileSelector::THUMBNAIL; 287 cv=ImageFileSelector::THUMBNAIL;
286 else 288 else
287 cv=ImageFileSelector::DETAILED; 289 cv=ImageFileSelector::DETAILED;
288 290
289 qDebug("cv = %d",cv); 291 odebug << "cv = " << cv << "" << oendl;
290 292
291 fileSelector = new ImageFileSelector( cv,stack, "fs"); 293 fileSelector = new ImageFileSelector( cv,stack, "fs");
292 294
293 //switchThumbView(); 295 //switchThumbView();
294 296
295 297
@@ -410,13 +412,13 @@ void ImageViewer::settings()
410 dlg.setRepeat( slideRepeat ); 412 dlg.setRepeat( slideRepeat );
411 dlg.setReverse( slideReverse ); 413 dlg.setReverse( slideReverse );
412 dlg.setRotate(rotateOnLoad); 414 dlg.setRotate(rotateOnLoad);
413 dlg.setFastLoad(fastLoad); 415 dlg.setFastLoad(fastLoad);
414 416
415 if ( QPEApplication::execDialog(&dlg) == QDialog::Accepted ) { 417 if ( QPEApplication::execDialog(&dlg) == QDialog::Accepted ) {
416 qDebug("<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>"); 418 odebug << "<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>" << oendl;
417 slideDelay = dlg.delay(); 419 slideDelay = dlg.delay();
418 slideRepeat = dlg.repeat(); 420 slideRepeat = dlg.repeat();
419 slideReverse = dlg.reverse(); 421 slideReverse = dlg.reverse();
420 rotateOnLoad = dlg.rotate(); 422 rotateOnLoad = dlg.rotate();
421 fastLoad = dlg.fastLoad(); 423 fastLoad = dlg.fastLoad();
422 424
@@ -502,13 +504,13 @@ void ImageViewer::show()
502 normalView(); 504 normalView();
503 QMainWindow::show(); 505 QMainWindow::show();
504} 506}
505 507
506void ImageViewer::show(const QString& fileref) 508void ImageViewer::show(const QString& fileref)
507{ 509{
508// qDebug("Show "+fileref); 510// odebug << "Show "+fileref << oendl;
509 bFromDocView = TRUE; 511 bFromDocView = TRUE;
510 closeFileSelector(); 512 closeFileSelector();
511 DocLnk link(fileref); 513 DocLnk link(fileref);
512 if ( link.isValid() ) { 514 if ( link.isValid() ) {
513 openFile(link); 515 openFile(link);
514 } else { 516 } else {
@@ -532,13 +534,13 @@ void ImageViewer::openFile() {
532} 534}
533 535
534void ImageViewer::openFile( const DocLnk &link ) 536void ImageViewer::openFile( const DocLnk &link )
535{ 537{
536 closeFileSelector(); 538 closeFileSelector();
537// DocLnk link(file); 539// DocLnk link(file);
538 qDebug("open "+link.name()); 540 odebug << "open "+link.name() << oendl;
539 updateCaption( link.name() ); 541 updateCaption( link.name() );
540 loadImage( link.file() ); 542 loadImage( link.file() );
541 if (slideTimer->isActive()) { 543 if (slideTimer->isActive()) {
542 slideTimer->start(slideDelay * 1000, FALSE); 544 slideTimer->start(slideDelay * 1000, FALSE);
543 } 545 }
544 546
diff --git a/noncore/multimedia/showimg/showimg.pro b/noncore/multimedia/showimg/showimg.pro
index 6fd019e..c905da8 100644
--- a/noncore/multimedia/showimg/showimg.pro
+++ b/noncore/multimedia/showimg/showimg.pro
@@ -1,7 +1,7 @@
1CONFIG += qt warn_on quick-app 1CONFIG += qt warn_on quick-app
2HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h 2HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h
3SOURCES = main.cpp showimg.cpp ImageFileSelector.cpp settingsdialog.cpp settingsdialogbase.cpp 3SOURCES = main.cpp showimg.cpp ImageFileSelector.cpp settingsdialog.cpp settingsdialogbase.cpp
4TARGET = showimg 4TARGET = showimg
5INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
6DEPENDPATH += $(OPIEDIR)/include 6DEPENDPATH += $(OPIEDIR)/include
7LIBS += -lqpe -lopiecore2 -lopieui2 7LIBS += -lqpe -lopiecore2 -lopieui2
diff --git a/noncore/multimedia/tonleiter/config.in b/noncore/multimedia/tonleiter/config.in
index d580ad7..9bd167e 100644
--- a/noncore/multimedia/tonleiter/config.in
+++ b/noncore/multimedia/tonleiter/config.in
@@ -1,4 +1,4 @@
1 config TONLEITER 1 config TONLEITER
2 boolean "tonleiter (shows scales on sting instruments)" 2 boolean "tonleiter (shows scales on sting instruments)"
3 default "n" 3 default "n"
4 depends ( LIBQPE || LIBQPE-X11 ) 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE
diff --git a/noncore/multimedia/tonleiter/editinst.cpp b/noncore/multimedia/tonleiter/editinst.cpp
index ccb4560..a8c20c8 100644
--- a/noncore/multimedia/tonleiter/editinst.cpp
+++ b/noncore/multimedia/tonleiter/editinst.cpp
@@ -1,11 +1,16 @@
1#include "editinst.h" 1#include "editinst.h"
2 2
3#include <qpushbutton.h> 3/* OPIE */
4 4#include <opie2/odebug.h>
5#include <qpe/config.h>
5#include <qpe/qpeapplication.h> 6#include <qpe/qpeapplication.h>
7using namespace Opie::Core;
8
9/* QT */
10#include <qpushbutton.h>
6 11
7Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name) 12Menu::InstEditDialog::InstEditDialog(TonleiterData* data,QWidget* parent,const char* name)
8:QDialog(parent,name,true,0),data(data) 13:QDialog(parent,name,true,0),data(data)
9{ 14{
10 setCaption("Tonleiter::"+tr("Instrument")); 15 setCaption("Tonleiter::"+tr("Instrument"));
11 QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom); 16 QBoxLayout* masterlayout=new QBoxLayout(this,QBoxLayout::TopToBottom);
@@ -97,13 +102,13 @@ void Menu::InstEditDialog::saveInstrument()
97} 102}
98//**************************************************************************** 103//****************************************************************************
99void Menu::InstEditDialog::loadInstrument() 104void Menu::InstEditDialog::loadInstrument()
100{ 105{
101 stringlist.clear(); 106 stringlist.clear();
102 Instrument inst=data->getInstrument(instid); 107 Instrument inst=data->getInstrument(instid);
103 qDebug("load Instrument : %d strings",inst.noOfStrings()); 108 odebug << "load Instrument : " << inst.noOfStrings() << " strings" << oendl;
104 for(uint s=0;s<inst.noOfStrings();s++) 109 for(uint s=0;s<inst.noOfStrings();s++)
105 { 110 {
106 stringlist.append(new EditStringWidget(inst.string(s),stringwidget)); 111 stringlist.append(new EditStringWidget(inst.string(s),stringwidget));
107 } 112 }
108} 113}
109//**************************************************************************** 114//****************************************************************************
diff --git a/noncore/multimedia/tonleiter/fretboard.cpp b/noncore/multimedia/tonleiter/fretboard.cpp
index 7e63e01..58bdb86 100644
--- a/noncore/multimedia/tonleiter/fretboard.cpp
+++ b/noncore/multimedia/tonleiter/fretboard.cpp
@@ -1,8 +1,13 @@
1#include "fretboard.h" 1#include "fretboard.h"
2 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
7/* QT */
3#include <qpainter.h> 8#include <qpainter.h>
4 9
5Graph::FretBoard::FretBoard(TonleiterData* data,QWidget* parent,const char* name,WFlags f) 10Graph::FretBoard::FretBoard(TonleiterData* data,QWidget* parent,const char* name,WFlags f)
6:QWidget(parent,name,f),data(data) 11:QWidget(parent,name,f),data(data)
7{ 12{
8 setBackgroundColor(QColor(0,0,0)); 13 setBackgroundColor(QColor(0,0,0));
@@ -24,13 +29,13 @@ void Graph::FretBoard::dataChange()
24void Graph::FretBoard::paintEvent(QPaintEvent* pe) 29void Graph::FretBoard::paintEvent(QPaintEvent* pe)
25{ 30{
26 Q_UNUSED(pe); 31 Q_UNUSED(pe);
27 32
28 int instid=data->getCurrentInstrumentID(); 33 int instid=data->getCurrentInstrumentID();
29 inst=data->getInstrument(instid); 34 inst=data->getInstrument(instid);
30 //qDebug("inst %d is %s",instid,inst.instName().data()); 35 //odebug << "inst " << instid << " is " << inst.instName().data() << "" << oendl;
31 36
32 QRect mysize=rect(); 37 QRect mysize=rect();
33 38
34 xmargin=(int)(mysize.width()*0.05); 39 xmargin=(int)(mysize.width()*0.05);
35 xmin=2*xmargin; 40 xmin=2*xmargin;
36 xmax=mysize.width()-xmargin; 41 xmax=mysize.width()-xmargin;
@@ -140,23 +145,23 @@ void Graph::FretBoard::paintScale(QPainter* p)
140 { 145 {
141 int x=(int)(fretdist*f)+xmin; 146 int x=(int)(fretdist*f)+xmin;
142 147
143 //no more than six octaves can be visualised (there is a zero octave) 148 //no more than six octaves can be visualised (there is a zero octave)
144 int octave=Note::octaveOfBaseNote(data->getCurrentBaseNote(),note)-baseoctave; 149 int octave=Note::octaveOfBaseNote(data->getCurrentBaseNote(),note)-baseoctave;
145 if(octave<0) 150 if(octave<0)
146 qDebug("%d,%d",octave,baseoctave); 151 odebug << "" << octave << "," << baseoctave << "" << oendl;
147 if(octave>5) 152 if(octave>5)
148 { 153 {
149 qDebug("octave out of range"); 154 odebug << "octave out of range" << oendl;
150 octave=5; 155 octave=5;
151 } 156 }
152 157
153 p->setPen(QColor(255,0,0)); 158 p->setPen(QColor(255,0,0));
154 int c= ( (note-12*baseoctave) - (12*octave+data->getCurrentBaseNote()) )*15; 159 int c= ( (note-12*baseoctave) - (12*octave+data->getCurrentBaseNote()) )*15;
155 if(c<0 || c>255) 160 if(c<0 || c>255)
156 qDebug("%d = %d - ( %d + %d)",c,note,12*octave,data->getCurrentBaseNote()); 161 odebug << "" << c << " = " << note << " - ( " << 12*octave << " + " << data->getCurrentBaseNote() << ")" << oendl;
157 QColor dotcolor(255,255,255); 162 QColor dotcolor(255,255,255);
158 163
159 if(octave==0) 164 if(octave==0)
160 dotcolor=QColor(c,c,255); 165 dotcolor=QColor(c,c,255);
161 else if(octave==1) 166 else if(octave==1)
162 dotcolor=QColor(c,255,c); 167 dotcolor=QColor(c,255,c);
diff --git a/noncore/multimedia/tonleiter/tonleiter.pro b/noncore/multimedia/tonleiter/tonleiter.pro
index 4bd1bc2..4be3bef 100644
--- a/noncore/multimedia/tonleiter/tonleiter.pro
+++ b/noncore/multimedia/tonleiter/tonleiter.pro
@@ -1,13 +1,11 @@
1TEMPLATE = app 1TEMPLATE = app
2#CONFIG = qt warn_on
3CONFIG = qt warn_on 2CONFIG = qt warn_on
4HEADERS = mainwidget.h tonleiterdata.h tonleiterdatahelper.h fretboard.h menuwidget.h editinst.h editstringwidget.h editscale.h pianoscale.h 3HEADERS = mainwidget.h tonleiterdata.h tonleiterdatahelper.h fretboard.h menuwidget.h editinst.h editstringwidget.h editscale.h pianoscale.h
5SOURCES = mainwidget.cpp tonleiterdata.cpp tonleiterdatahelper.cpp fretboard.cpp menuwidget.cpp main.cpp editinst.cpp editstringwidget.cpp editscale.cpp pianoscale.cpp 4SOURCES = mainwidget.cpp tonleiterdata.cpp tonleiterdatahelper.cpp fretboard.cpp menuwidget.cpp main.cpp editinst.cpp editstringwidget.cpp editscale.cpp pianoscale.cpp
6INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
7DEPENDPATH += $(OPIEDIR)/include 6DEPENDPATH += $(OPIEDIR)/include
8LIBS += -lqpe 7LIBS += -lqpe -lopiecore2
9INTERFACES =
10TARGET = tonleiter 8TARGET = tonleiter
11DESTDIR = $(OPIEDIR)/bin 9DESTDIR = $(OPIEDIR)/bin
12#TMAKE_CXXFLAGS += -DQT_QWS_VERCEL_IDR -DQWS -fno-exceptions -fno-rtti 10
13include ( $(OPIEDIR)/include.pro ) 11include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/multimedia/tonleiter/tonleiterdata.cpp b/noncore/multimedia/tonleiter/tonleiterdata.cpp
index 33b3c49..564b7f0 100644
--- a/noncore/multimedia/tonleiter/tonleiterdata.cpp
+++ b/noncore/multimedia/tonleiter/tonleiterdata.cpp
@@ -1,12 +1,13 @@
1#include "tonleiterdata.h" 1#include "tonleiterdata.h"
2
3#include <qpe/config.h>
4
5using namespace Data; 2using namespace Data;
6 3
4/* OPIE */
5#include <opie2/odebug.h>
6#include <qpe/config.h>
7using namespace Opie::Core;
7 8
8TonleiterData::TonleiterData(QObject* parent) 9TonleiterData::TonleiterData(QObject* parent)
9:QObject(parent) 10:QObject(parent)
10{ 11{
11 drawnames=true; 12 drawnames=true;
12 loadData(); 13 loadData();
@@ -149,13 +150,13 @@ int TonleiterData::noOfInstruments()
149Instrument TonleiterData::getInstrument(int id) 150Instrument TonleiterData::getInstrument(int id)
150{ 151{
151 if(id>=0 && id<noOfInstruments()) 152 if(id>=0 && id<noOfInstruments())
152 return instruments[id]; 153 return instruments[id];
153 else 154 else
154 { 155 {
155 qDebug("undefined insrtument %d of %d",id,instruments.count()); 156 odebug << "undefined insrtument " << id << " of " << instruments.count() << "" << oendl;
156 return Instrument(); 157 return Instrument();
157 } 158 }
158 159
159} 160}
160//**************************************************************************** 161//****************************************************************************
161int TonleiterData::getCurrentInstrumentID() 162int TonleiterData::getCurrentInstrumentID()
@@ -171,13 +172,13 @@ int TonleiterData::noOfScales()
171Scale TonleiterData::getScale(int id) 172Scale TonleiterData::getScale(int id)
172{ 173{
173 if(id>=0 && id<noOfScales()) 174 if(id>=0 && id<noOfScales())
174 return scales[id]; 175 return scales[id];
175 else 176 else
176 { 177 {
177 qDebug("Undefined scale"); 178 odebug << "Undefined scale" << oendl;
178 return Scale(); 179 return Scale();
179 } 180 }
180} 181}
181//**************************************************************************** 182//****************************************************************************
182int TonleiterData::getCurrentScaleID() 183int TonleiterData::getCurrentScaleID()
183{ 184{
diff --git a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
index d904a71..285d2c1 100644
--- a/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
+++ b/noncore/multimedia/tonleiter/tonleiterdatahelper.cpp
@@ -31,13 +31,13 @@ int Note::getNoteFromName(QString name,int octave)
31} 31}
32//**************************************************************************** 32//****************************************************************************
33int Note::octaveOfBaseNote(int base,int note) 33int Note::octaveOfBaseNote(int base,int note)
34{ 34{
35 int normnote = (note>=base) ? note-base : (12-base)+note; 35 int normnote = (note>=base) ? note-base : (12-base)+note;
36 int octave=getOctaveOfNote(normnote); 36 int octave=getOctaveOfNote(normnote);
37 //qDebug("note %d of %d base is norm %d -> ocatve %d",note,base,normnote,octave); 37 //odebug << "note " << note << " of " << base << " base is norm " << normnote << " -> ocatve " << octave << "" << oendl;
38 return octave; 38 return octave;
39} 39}
40//**************************************************************************** 40//****************************************************************************
41//**************************************************************************** 41//****************************************************************************
42Instrument::Instrument() 42Instrument::Instrument()
43{ 43{
@@ -128,17 +128,17 @@ bool Scale::noteInScale(int base,int note)
128 int octave=Note::getOctaveOfNote(note); 128 int octave=Note::getOctaveOfNote(note);
129 note-=12*octave; 129 note-=12*octave;
130 int normnote = (note>=base) ? note-base : (12-base)+note; 130 int normnote = (note>=base) ? note-base : (12-base)+note;
131 131
132 if(halftones.contains(normnote)>0) 132 if(halftones.contains(normnote)>0)
133 { 133 {
134 //qDebug("OK : base : %d, note %d -> norm %d",base,note,normnote); 134 //odebug << "OK : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl;
135 return true; 135 return true;
136 } 136 }
137 else 137 else
138 { 138 {
139 //qDebug("BAD : base : %d, note %d -> norm %d",base,note,normnote); 139 //odebug << "BAD : base : " << base << ", note " << note << " -> norm " << normnote << "" << oendl;
140 return false; 140 return false;
141 } 141 }
142} 142}
143//**************************************************************************** 143//****************************************************************************
144//**************************************************************************** 144//****************************************************************************
diff --git a/noncore/net/mail/accountitem.cpp b/noncore/net/mail/accountitem.cpp
index 54d2da2..ae28313 100644
--- a/noncore/net/mail/accountitem.cpp
+++ b/noncore/net/mail/accountitem.cpp
@@ -75,13 +75,13 @@ void POP3viewItem::refresh()
75 } 75 }
76 delete folders; 76 delete folders;
77} 77}
78 78
79RECBODYP POP3viewItem::fetchBody( const RecMailP &mail ) 79RECBODYP POP3viewItem::fetchBody( const RecMailP &mail )
80{ 80{
81 qDebug( "POP3 fetchBody" ); 81 odebug << "POP3 fetchBody" << oendl;
82 return wrapper->fetchBody( mail ); 82 return wrapper->fetchBody( mail );
83} 83}
84 84
85QPopupMenu * POP3viewItem::getContextMenu() 85QPopupMenu * POP3viewItem::getContextMenu()
86{ 86{
87 QPopupMenu *m = new QPopupMenu(0); 87 QPopupMenu *m = new QPopupMenu(0);
@@ -266,13 +266,13 @@ void NNTPviewItem::refresh()
266 } 266 }
267 delete folders; 267 delete folders;
268} 268}
269 269
270RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail ) 270RECBODYP NNTPviewItem::fetchBody( const RecMailP &mail )
271{ 271{
272 qDebug( "NNTP fetchBody" ); 272 odebug << "NNTP fetchBody" << oendl;
273 return wrapper->fetchBody( mail ); 273 return wrapper->fetchBody( mail );
274} 274}
275 275
276QPopupMenu * NNTPviewItem::getContextMenu() 276QPopupMenu * NNTPviewItem::getContextMenu()
277{ 277{
278 QPopupMenu *m = new QPopupMenu(0); 278 QPopupMenu *m = new QPopupMenu(0);
@@ -457,13 +457,13 @@ void IMAPviewItem::refreshFolders(bool force)
457 for ( it = folders->begin(); it!=folders->end(); ++it) 457 for ( it = folders->begin(); it!=folders->end(); ++it)
458 { 458 {
459 if ((*it)->getDisplayName().lower()=="inbox") 459 if ((*it)->getDisplayName().lower()=="inbox")
460 { 460 {
461 item = new IMAPfolderItem( (*it), this , item ); 461 item = new IMAPfolderItem( (*it), this , item );
462 folders->remove(it); 462 folders->remove(it);
463 qDebug("inbox found"); 463 odebug << "inbox found" << oendl;
464 break; 464 break;
465 } 465 }
466 } 466 }
467 for ( it = folders->begin(); it!=folders->end(); ++it) 467 for ( it = folders->begin(); it!=folders->end(); ++it)
468 { 468 {
469 fname = (*it)->getDisplayName(); 469 fname = (*it)->getDisplayName();
@@ -530,13 +530,13 @@ void IMAPviewItem::createNewFolder()
530 } 530 }
531 } 531 }
532} 532}
533 533
534void IMAPviewItem::contextMenuSelected(int id) 534void IMAPviewItem::contextMenuSelected(int id)
535{ 535{
536 qDebug("Id selected: %i",id); 536 odebug << "Id selected: " << id << "" << oendl;
537 switch (id) 537 switch (id)
538 { 538 {
539 case 0: 539 case 0:
540 refreshFolders(true); 540 refreshFolders(true);
541 break; 541 break;
542 case 1: 542 case 1:
@@ -668,13 +668,13 @@ void IMAPfolderItem::createNewFolder()
668void IMAPfolderItem::deleteFolder() 668void IMAPfolderItem::deleteFolder()
669{ 669{
670 int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName), 670 int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName),
671 QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()), 671 QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()),
672 QObject::tr("Yes",contextName), 672 QObject::tr("Yes",contextName),
673 QObject::tr("No",contextName),QString::null,1,1); 673 QObject::tr("No",contextName),QString::null,1,1);
674 qDebug("Auswahl: %i",yesno); 674 odebug << "Auswahl: " << yesno << "" << oendl;
675 if (yesno == 0) 675 if (yesno == 0)
676 { 676 {
677 if (imap->getWrapper()->deleteMbox(folder)) 677 if (imap->getWrapper()->deleteMbox(folder))
678 { 678 {
679 QListView*v=listView(); 679 QListView*v=listView();
680 IMAPviewItem * box = imap; 680 IMAPviewItem * box = imap;
@@ -695,13 +695,13 @@ void IMAPfolderItem::downloadMails()
695 if (!bl) return; 695 if (!bl) return;
696 bl->downloadMails(folder,imap->getWrapper()); 696 bl->downloadMails(folder,imap->getWrapper());
697} 697}
698 698
699void IMAPfolderItem::contextMenuSelected(int id) 699void IMAPfolderItem::contextMenuSelected(int id)
700{ 700{
701 qDebug("Selected id: %i",id); 701 odebug << "Selected id: " << id << "" << oendl;
702 AccountView * view = (AccountView*)listView(); 702 AccountView * view = (AccountView*)listView();
703 switch(id) 703 switch(id)
704 { 704 {
705 case 0: 705 case 0:
706 view->refreshCurrent(); 706 view->refreshCurrent();
707 break; 707 break;
@@ -799,13 +799,13 @@ void MHviewItem::refresh(bool force)
799 } 799 }
800 delete folders; 800 delete folders;
801} 801}
802 802
803RECBODYP MHviewItem::fetchBody( const RecMailP &mail ) 803RECBODYP MHviewItem::fetchBody( const RecMailP &mail )
804{ 804{
805 qDebug( "MH fetchBody" ); 805 odebug << "MH fetchBody" << oendl;
806 return wrapper->fetchBody( mail ); 806 return wrapper->fetchBody( mail );
807} 807}
808 808
809QPopupMenu * MHviewItem::getContextMenu() 809QPopupMenu * MHviewItem::getContextMenu()
810{ 810{
811 QPopupMenu *m = new QPopupMenu(0); 811 QPopupMenu *m = new QPopupMenu(0);
@@ -929,13 +929,13 @@ RECBODYP MHfolderItem::fetchBody(const RecMailP&aMail)
929void MHfolderItem::deleteFolder() 929void MHfolderItem::deleteFolder()
930{ 930{
931 int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName), 931 int yesno = QMessageBox::warning(0,QObject::tr("Delete folder",contextName),
932 QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()), 932 QObject::tr("<center>Realy delete folder <br><b>%1</b><br>and all if it content?</center>",contextName).arg(folder->getDisplayName()),
933 QObject::tr("Yes",contextName), 933 QObject::tr("Yes",contextName),
934 QObject::tr("No",contextName),QString::null,1,1); 934 QObject::tr("No",contextName),QString::null,1,1);
935 qDebug("Auswahl: %i",yesno); 935 odebug << "Auswahl: " << yesno << "" << oendl;
936 if (yesno == 0) 936 if (yesno == 0)
937 { 937 {
938 if (mbox->getWrapper()->deleteMbox(folder)) 938 if (mbox->getWrapper()->deleteMbox(folder))
939 { 939 {
940 QListView*v=listView(); 940 QListView*v=listView();
941 MHviewItem * box = mbox; 941 MHviewItem * box = mbox;
@@ -1071,13 +1071,13 @@ void AccountViewItem::deleteAllMail(AbstractMail*wrapper,const FolderP&folder)
1071 if (folder) fname = folder->getDisplayName(); 1071 if (folder) fname = folder->getDisplayName();
1072 int yesno = QMessageBox::warning(0,QObject::tr("Delete all mails",contextName), 1072 int yesno = QMessageBox::warning(0,QObject::tr("Delete all mails",contextName),
1073 QObject::tr("<center>Realy delete all mails in box <br>%1</center>",contextName). 1073 QObject::tr("<center>Realy delete all mails in box <br>%1</center>",contextName).
1074 arg(fname), 1074 arg(fname),
1075 QObject::tr("Yes",contextName), 1075 QObject::tr("Yes",contextName),
1076 QObject::tr("No",contextName),QString::null,1,1); 1076 QObject::tr("No",contextName),QString::null,1,1);
1077 qDebug("Auswahl: %i",yesno); 1077 odebug << "Auswahl: " << yesno << "" << oendl;
1078 if (yesno == 0) 1078 if (yesno == 0)
1079 { 1079 {
1080 if (wrapper->deleteAllMail(folder)) 1080 if (wrapper->deleteAllMail(folder))
1081 { 1081 {
1082 AccountView * view = (AccountView*)listView(); 1082 AccountView * view = (AccountView*)listView();
1083 if (view) view->refreshCurrent(); 1083 if (view) view->refreshCurrent();
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index f0a163e..0052061 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -63,36 +63,36 @@ void AccountView::populate( QList<Account> list )
63 Account *it; 63 Account *it;
64 for ( it = list.first(); it; it = list.next() ) 64 for ( it = list.first(); it; it = list.next() )
65 { 65 {
66 if ( it->getType() == MAILLIB::A_IMAP ) 66 if ( it->getType() == MAILLIB::A_IMAP )
67 { 67 {
68 IMAPaccount *imap = static_cast<IMAPaccount *>(it); 68 IMAPaccount *imap = static_cast<IMAPaccount *>(it);
69 qDebug( "added IMAP " + imap->getAccountName() ); 69 odebug << "added IMAP " + imap->getAccountName() << oendl;
70 imapAccounts.append(new IMAPviewItem( imap, this )); 70 imapAccounts.append(new IMAPviewItem( imap, this ));
71 } 71 }
72 else if ( it->getType() == MAILLIB::A_POP3 ) 72 else if ( it->getType() == MAILLIB::A_POP3 )
73 { 73 {
74 POP3account *pop3 = static_cast<POP3account *>(it); 74 POP3account *pop3 = static_cast<POP3account *>(it);
75 qDebug( "added POP3 " + pop3->getAccountName() ); 75 odebug << "added POP3 " + pop3->getAccountName() << oendl;
76 /* must not be hold 'cause it isn't required */ 76 /* must not be hold 'cause it isn't required */
77 (void) new POP3viewItem( pop3, this ); 77 (void) new POP3viewItem( pop3, this );
78 } 78 }
79 else if ( it->getType() == MAILLIB::A_NNTP ) 79 else if ( it->getType() == MAILLIB::A_NNTP )
80 { 80 {
81 NNTPaccount *nntp = static_cast<NNTPaccount *>(it); 81 NNTPaccount *nntp = static_cast<NNTPaccount *>(it);
82 qDebug( "added NNTP " + nntp->getAccountName() ); 82 odebug << "added NNTP " + nntp->getAccountName() << oendl;
83 /* must not be hold 'cause it isn't required */ 83 /* must not be hold 'cause it isn't required */
84 (void) new NNTPviewItem( nntp, this ); 84 (void) new NNTPviewItem( nntp, this );
85 } 85 }
86 } 86 }
87} 87}
88 88
89void AccountView::refresh(QListViewItem *item) 89void AccountView::refresh(QListViewItem *item)
90{ 90{
91 91
92 qDebug("AccountView refresh..."); 92 odebug << "AccountView refresh..." << oendl;
93 if ( item ) 93 if ( item )
94 { 94 {
95 m_currentItem = item; 95 m_currentItem = item;
96 QValueList<RecMailP> headerlist; 96 QValueList<RecMailP> headerlist;
97 AccountViewItem *view = static_cast<AccountViewItem *>(item); 97 AccountViewItem *view = static_cast<AccountViewItem *>(item);
98 view->refresh(headerlist); 98 view->refresh(headerlist);
@@ -159,14 +159,14 @@ void AccountView::downloadMails(const FolderP&fromFolder,AbstractMail*fromWrappe
159 if (sels.newFolder() && !targetMail->createMbox(targetFolder)) 159 if (sels.newFolder() && !targetMail->createMbox(targetFolder))
160 { 160 {
161 QMessageBox::critical(0,tr("Error creating new Folder"), 161 QMessageBox::critical(0,tr("Error creating new Folder"),
162 tr("<center>Error while creating<br>new folder - breaking.</center>")); 162 tr("<center>Error while creating<br>new folder - breaking.</center>"));
163 return; 163 return;
164 } 164 }
165 qDebug("Targetfolder: %s",targetFolder.latin1()); 165 odebug << "Targetfolder: " << targetFolder.latin1() << "" << oendl;
166 qDebug("Fromfolder: %s",fromFolder->getName().latin1()); 166 odebug << "Fromfolder: " << fromFolder->getName().latin1() << "" << oendl;
167 fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails()); 167 fromWrapper->mvcpAllMails(fromFolder,targetFolder,targetMail,sels.moveMails());
168 refreshCurrent(); 168 refreshCurrent();
169} 169}
170 170
171bool AccountView::currentisDraft() 171bool AccountView::currentisDraft()
172{ 172{
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index 988a1d9..fa703c4 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -180,13 +180,13 @@ void ComposeMail::removeAttachment()
180 } 180 }
181} 181}
182 182
183void ComposeMail::accept() 183void ComposeMail::accept()
184{ 184{
185 if ( checkBoxLater->isChecked() ) { 185 if ( checkBoxLater->isChecked() ) {
186 qDebug( "Send later" ); 186 odebug << "Send later" << oendl;
187 } 187 }
188 188
189#if 0 189#if 0
190 qDebug( "Sending Mail with " + 190 qDebug( "Sending Mail with " +
191 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); 191 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() );
192#endif 192#endif
@@ -253,13 +253,13 @@ void ComposeMail::reject()
253 } 253 }
254 QString txt = message->text(); 254 QString txt = message->text();
255 if ( !sigMultiLine->text().isEmpty() ) { 255 if ( !sigMultiLine->text().isEmpty() ) {
256 txt.append( "\n--\n" ); 256 txt.append( "\n--\n" );
257 txt.append( sigMultiLine->text() ); 257 txt.append( sigMultiLine->text() );
258 } 258 }
259 qDebug(txt); 259 odebug << txt << oendl;
260 mail->setMessage( txt ); 260 mail->setMessage( txt );
261 261
262 /* only use the default drafts folder name! */ 262 /* only use the default drafts folder name! */
263 Storemail wrapper(AbstractMail::draftFolder()); 263 Storemail wrapper(AbstractMail::draftFolder());
264 wrapper.storeMail(mail); 264 wrapper.storeMail(mail);
265 265
@@ -289,13 +289,13 @@ void ComposeMail::reEditMail(const RecMailP&current)
289} 289}
290 290
291AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) 291AttachViewItem::AttachViewItem( QListView *parent, Attachment *att )
292 : QListViewItem( parent ) 292 : QListViewItem( parent )
293{ 293{
294 attachment = att; 294 attachment = att;
295 qDebug( att->getMimeType() ); 295 odebug << att->getMimeType() << oendl;
296 setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ? 296 setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ?
297 Resource::loadPixmap( "UnknownDocument-14" ) : 297 Resource::loadPixmap( "UnknownDocument-14" ) :
298 attachment->getDocLnk().pixmap() ); 298 attachment->getDocLnk().pixmap() );
299 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() ); 299 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() );
300 setText( 1, QString::number( att->getSize() ) ); 300 setText( 1, QString::number( att->getSize() ) );
301} 301}
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index 5c4bdf7..de064ca 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -37,13 +37,13 @@ AccountListItem::AccountListItem( QListView *parent, Account *a)
37 setText( 1, ttext); 37 setText( 1, ttext);
38} 38}
39 39
40EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 40EditAccounts::EditAccounts( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
41 : EditAccountsUI( parent, name, modal, flags ) 41 : EditAccountsUI( parent, name, modal, flags )
42{ 42{
43 qDebug( "New Account Configuration Widget" ); 43 odebug << "New Account Configuration Widget" << oendl;
44 settings = s; 44 settings = s;
45 45
46 mailList->addColumn( tr( "Account" ) ); 46 mailList->addColumn( tr( "Account" ) );
47 mailList->addColumn( tr( "Type" ) ); 47 mailList->addColumn( tr( "Type" ) );
48 48
49 newsList->addColumn( tr( "Account" ) ); 49 newsList->addColumn( tr( "Account" ) );
@@ -77,13 +77,13 @@ void EditAccounts::slotFillLists()
77 } 77 }
78 } 78 }
79} 79}
80 80
81void EditAccounts::slotNewMail() 81void EditAccounts::slotNewMail()
82{ 82{
83 qDebug( "New Mail Account" ); 83 odebug << "New Mail Account" << oendl;
84 QString *selection = new QString(); 84 QString *selection = new QString();
85 SelectMailType selType( selection, this, 0, true ); 85 SelectMailType selType( selection, this, 0, true );
86 selType.show(); 86 selType.show();
87 if ( QDialog::Accepted == selType.exec() ) 87 if ( QDialog::Accepted == selType.exec() )
88 { 88 {
89 slotNewAccount( *selection ); 89 slotNewAccount( *selection );
@@ -91,13 +91,13 @@ void EditAccounts::slotNewMail()
91} 91}
92 92
93void EditAccounts::slotNewAccount( const QString &type ) 93void EditAccounts::slotNewAccount( const QString &type )
94{ 94{
95 if ( type.compare( "IMAP" ) == 0 ) 95 if ( type.compare( "IMAP" ) == 0 )
96 { 96 {
97 qDebug( "-> config IMAP" ); 97 odebug << "-> config IMAP" << oendl;
98 IMAPaccount *account = new IMAPaccount(); 98 IMAPaccount *account = new IMAPaccount();
99 IMAPconfig imap( account, this, 0, true ); 99 IMAPconfig imap( account, this, 0, true );
100 if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) ) 100 if ( QDialog::Accepted == QPEApplication::execDialog( &imap ) )
101 { 101 {
102 settings->addAccount( account ); 102 settings->addAccount( account );
103 account->save(); 103 account->save();
@@ -107,13 +107,13 @@ void EditAccounts::slotNewAccount( const QString &type )
107 { 107 {
108 account->remove(); 108 account->remove();
109 } 109 }
110 } 110 }
111 else if ( type.compare( "POP3" ) == 0 ) 111 else if ( type.compare( "POP3" ) == 0 )
112 { 112 {
113 qDebug( "-> config POP3" ); 113 odebug << "-> config POP3" << oendl;
114 POP3account *account = new POP3account(); 114 POP3account *account = new POP3account();
115 POP3config pop3( account, this, 0, true, WStyle_ContextHelp ); 115 POP3config pop3( account, this, 0, true, WStyle_ContextHelp );
116 if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) ) 116 if ( QDialog::Accepted == QPEApplication::execDialog( &pop3 ) )
117 { 117 {
118 settings->addAccount( account ); 118 settings->addAccount( account );
119 account->save(); 119 account->save();
@@ -123,13 +123,13 @@ void EditAccounts::slotNewAccount( const QString &type )
123 { 123 {
124 account->remove(); 124 account->remove();
125 } 125 }
126 } 126 }
127 else if ( type.compare( "SMTP" ) == 0 ) 127 else if ( type.compare( "SMTP" ) == 0 )
128 { 128 {
129 qDebug( "-> config SMTP" ); 129 odebug << "-> config SMTP" << oendl;
130 SMTPaccount *account = new SMTPaccount(); 130 SMTPaccount *account = new SMTPaccount();
131 SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp ); 131 SMTPconfig smtp( account, this, 0, true, WStyle_ContextHelp );
132 if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) ) 132 if ( QDialog::Accepted == QPEApplication::execDialog( &smtp ) )
133 { 133 {
134 settings->addAccount( account ); 134 settings->addAccount( account );
135 account->save(); 135 account->save();
@@ -140,13 +140,13 @@ void EditAccounts::slotNewAccount( const QString &type )
140 { 140 {
141 account->remove(); 141 account->remove();
142 } 142 }
143 } 143 }
144 else if ( type.compare( "NNTP" ) == 0 ) 144 else if ( type.compare( "NNTP" ) == 0 )
145 { 145 {
146 qDebug( "-> config NNTP" ); 146 odebug << "-> config NNTP" << oendl;
147 NNTPaccount *account = new NNTPaccount(); 147 NNTPaccount *account = new NNTPaccount();
148 NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp ); 148 NNTPconfig nntp( account, this, 0, true, WStyle_ContextHelp );
149 if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) ) 149 if ( QDialog::Accepted == QPEApplication::execDialog( &nntp ) )
150 { 150 {
151 settings->addAccount( account ); 151 settings->addAccount( account );
152 account->save(); 152 account->save();
@@ -209,13 +209,13 @@ void EditAccounts::slotDeleteAccount( Account *account )
209 slotFillLists(); 209 slotFillLists();
210 } 210 }
211} 211}
212 212
213void EditAccounts::slotEditMail() 213void EditAccounts::slotEditMail()
214{ 214{
215 qDebug( "Edit Mail Account" ); 215 odebug << "Edit Mail Account" << oendl;
216 if ( !mailList->currentItem() ) 216 if ( !mailList->currentItem() )
217 { 217 {
218 QMessageBox::information( this, tr( "Error" ), 218 QMessageBox::information( this, tr( "Error" ),
219 tr( "<p>Please select an account.</p>" ), 219 tr( "<p>Please select an account.</p>" ),
220 tr( "Ok" ) ); 220 tr( "Ok" ) );
221 return; 221 return;
@@ -238,19 +238,19 @@ void EditAccounts::slotDeleteMail()
238 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount(); 238 Account *a = ((AccountListItem *) mailList->currentItem())->getAccount();
239 slotDeleteAccount( a ); 239 slotDeleteAccount( a );
240} 240}
241 241
242void EditAccounts::slotNewNews() 242void EditAccounts::slotNewNews()
243{ 243{
244 qDebug( "New News Account" ); 244 odebug << "New News Account" << oendl;
245 slotNewAccount( "NNTP" ); 245 slotNewAccount( "NNTP" );
246} 246}
247 247
248void EditAccounts::slotEditNews() 248void EditAccounts::slotEditNews()
249{ 249{
250 qDebug( "Edit News Account" ); 250 odebug << "Edit News Account" << oendl;
251 if ( !newsList->currentItem() ) 251 if ( !newsList->currentItem() )
252 { 252 {
253 QMessageBox::information( this, tr( "Error" ), 253 QMessageBox::information( this, tr( "Error" ),
254 tr( "<p>Please select an account.</p>" ), 254 tr( "<p>Please select an account.</p>" ),
255 tr( "Ok" ) ); 255 tr( "Ok" ) );
256 return; 256 return;
@@ -259,13 +259,13 @@ void EditAccounts::slotEditNews()
259 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount(); 259 Account *a = ((AccountListItem *) newsList->currentItem())->getAccount();
260 slotEditAccount( a ); 260 slotEditAccount( a );
261} 261}
262 262
263void EditAccounts::slotDeleteNews() 263void EditAccounts::slotDeleteNews()
264{ 264{
265 qDebug( "Delete News Account" ); 265 odebug << "Delete News Account" << oendl;
266 if ( !newsList->currentItem() ) 266 if ( !newsList->currentItem() )
267 { 267 {
268 QMessageBox::information( this, tr( "Error" ), 268 QMessageBox::information( this, tr( "Error" ),
269 tr( "<p>Please select an account.</p>" ), 269 tr( "<p>Please select an account.</p>" ),
270 tr( "Ok" ) ); 270 tr( "Ok" ) );
271 return; 271 return;
@@ -575,13 +575,13 @@ void NNTPconfig::save()
575 QListViewItemIterator list_it( ListViewGroups ); 575 QListViewItemIterator list_it( ListViewGroups );
576 576
577 QStringList groupList; 577 QStringList groupList;
578 for ( ; list_it.current(); ++list_it ) { 578 for ( ; list_it.current(); ++list_it ) {
579 579
580 if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { 580 if ( ( (QCheckListItem*)list_it.current() )->isOn() ) {
581 qDebug(list_it.current()->text(0) ); 581 odebug << list_it.current()->text(0) << oendl;
582 groupList.append( list_it.current()->text(0) ); 582 groupList.append( list_it.current()->text(0) );
583 } 583 }
584 584
585 } 585 }
586 data->setGroups( groupList ); 586 data->setGroups( groupList );
587} 587}
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp
index 6bebb7b..1a26351 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.cpp
+++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp
@@ -49,13 +49,13 @@ AbstractMail* AbstractMail::getWrapper(Account*a)
49 return 0; 49 return 0;
50 } 50 }
51} 51}
52 52
53encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) 53encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc)
54{ 54{
55 qDebug("Decode string start"); 55 odebug << "Decode string start" << oendl;
56 char*result_text; 56 char*result_text;
57 size_t index = 0; 57 size_t index = 0;
58 /* reset for recursive use! */ 58 /* reset for recursive use! */
59 size_t target_length = 0; 59 size_t target_length = 0;
60 result_text = 0; 60 result_text = 0;
61 int mimetype = MAILMIME_MECHANISM_7BIT; 61 int mimetype = MAILMIME_MECHANISM_7BIT;
@@ -73,13 +73,13 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin
73 &result_text,&target_length); 73 &result_text,&target_length);
74 74
75 encodedString* result = new encodedString(); 75 encodedString* result = new encodedString();
76 if (err == MAILIMF_NO_ERROR) { 76 if (err == MAILIMF_NO_ERROR) {
77 result->setContent(result_text,target_length); 77 result->setContent(result_text,target_length);
78 } 78 }
79 qDebug("Decode string finished"); 79 odebug << "Decode string finished" << oendl;
80 return result; 80 return result;
81} 81}
82 82
83QString AbstractMail::convert_String(const char*text) 83QString AbstractMail::convert_String(const char*text)
84{ 84{
85 //size_t index = 0; 85 //size_t index = 0;
@@ -88,16 +88,16 @@ QString AbstractMail::convert_String(const char*text)
88 88
89 QString result(text); 89 QString result(text);
90 90
91 /* due a bug in libetpan it isn't usable this moment */ 91 /* due a bug in libetpan it isn't usable this moment */
92/* int err = mailmime_encoded_phrase_parse("iso-8859-1", 92/* int err = mailmime_encoded_phrase_parse("iso-8859-1",
93 text, strlen(text),&index, "iso-8859-1",&res);*/ 93 text, strlen(text),&index, "iso-8859-1",&res);*/
94 //qDebug("Input: %s",text); 94 //odebug << "Input: " << text << "" << oendl;
95 if (err == MAILIMF_NO_ERROR && res && strlen(res)) { 95 if (err == MAILIMF_NO_ERROR && res && strlen(res)) {
96// result = QString(res); 96// result = QString(res);
97// qDebug("Res: %s, length: %i",res,strlen(res)); 97// odebug << "Res: " << res << ", length: " << strlen(res) << "" << oendl;
98 } 98 }
99 if (res) free(res); 99 if (res) free(res);
100 return result; 100 return result;
101} 101}
102 102
103/* cp & paste from launcher */ 103/* cp & paste from launcher */
diff --git a/noncore/net/mail/libmailwrapper/generatemail.cpp b/noncore/net/mail/libmailwrapper/generatemail.cpp
index cb58d82..36ec232 100644
--- a/noncore/net/mail/libmailwrapper/generatemail.cpp
+++ b/noncore/net/mail/libmailwrapper/generatemail.cpp
@@ -94,35 +94,35 @@ mailimf_address_list *Generatemail::parseAddresses(const QString&addr ) {
94 break; 94 break;
95 case ',': 95 case ',':
96 if (!literal_open) { 96 if (!literal_open) {
97 s = addr.mid(startpos,i-startpos); 97 s = addr.mid(startpos,i-startpos);
98 if (!s.isEmpty()) { 98 if (!s.isEmpty()) {
99 list.append(s); 99 list.append(s);
100 qDebug("Appended %s",s.latin1()); 100 odebug << "Appended " << s.latin1() << "" << oendl;
101 } 101 }
102 // !!!! this is a MUST BE! 102 // !!!! this is a MUST BE!
103 startpos = ++i; 103 startpos = ++i;
104 } 104 }
105 break; 105 break;
106 default: 106 default:
107 break; 107 break;
108 } 108 }
109 } 109 }
110 s = addr.mid(startpos,i-startpos); 110 s = addr.mid(startpos,i-startpos);
111 if (!s.isEmpty()) { 111 if (!s.isEmpty()) {
112 list.append(s); 112 list.append(s);
113 qDebug("Appended %s",s.latin1()); 113 odebug << "Appended " << s.latin1() << "" << oendl;
114 } 114 }
115 QStringList::Iterator it; 115 QStringList::Iterator it;
116 for ( it = list.begin(); it != list.end(); it++ ) { 116 for ( it = list.begin(); it != list.end(); it++ ) {
117 int err = mailimf_address_list_add_parse( addresses, (char*)(*it).latin1() ); 117 int err = mailimf_address_list_add_parse( addresses, (char*)(*it).latin1() );
118 if ( err != MAILIMF_NO_ERROR ) { 118 if ( err != MAILIMF_NO_ERROR ) {
119 qDebug( "Error parsing" ); 119 odebug << "Error parsing" << oendl;
120 qDebug( *it ); 120 odebug << *it << oendl;
121 } else { 121 } else {
122 qDebug( "Parse success! %s",(*it).latin1()); 122 odebug << "Parse success! " << (*it).latin1() << "" << oendl;
123 } 123 }
124 } 124 }
125 return addresses; 125 return addresses;
126} 126}
127 127
128mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimetype,const QString&TextContent ) { 128mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimetype,const QString&TextContent ) {
@@ -172,13 +172,13 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet
172 if (filename.length()>0) { 172 if (filename.length()>0) {
173 err = mailmime_set_body_file( filePart, file ); 173 err = mailmime_set_body_file( filePart, file );
174 } else { 174 } else {
175 err = mailmime_set_body_text(filePart,strdup(TextContent.data()),TextContent.length()); 175 err = mailmime_set_body_text(filePart,strdup(TextContent.data()),TextContent.length());
176 } 176 }
177 if (err != MAILIMF_NO_ERROR) { 177 if (err != MAILIMF_NO_ERROR) {
178 qDebug("Error setting body with file %s",file); 178 odebug << "Error setting body with file " << file << "" << oendl;
179 mailmime_free( filePart ); 179 mailmime_free( filePart );
180 filePart = 0; 180 filePart = 0;
181 } 181 }
182 } 182 }
183 183
184 if (!filePart) { 184 if (!filePart) {
@@ -203,29 +203,29 @@ mailmime *Generatemail::buildFilePart(const QString&filename,const QString&mimet
203 203
204} 204}
205 205
206void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files ) { 206void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files ) {
207 const Attachment *it; 207 const Attachment *it;
208 unsigned int count = files.count(); 208 unsigned int count = files.count();
209 qDebug("List contains %i values",count); 209 odebug << "List contains " << count << " values" << oendl;
210 for ( unsigned int i = 0; i < count; ++i ) { 210 for ( unsigned int i = 0; i < count; ++i ) {
211 qDebug( "Adding file" ); 211 odebug << "Adding file" << oendl;
212 mailmime *filePart; 212 mailmime *filePart;
213 int err; 213 int err;
214 it = ((QList<Attachment>)files).at(i); 214 it = ((QList<Attachment>)files).at(i);
215 215
216 filePart = buildFilePart( it->getFileName(), it->getMimeType(),"" ); 216 filePart = buildFilePart( it->getFileName(), it->getMimeType(),"" );
217 if ( filePart == NULL ) { 217 if ( filePart == NULL ) {
218 qDebug( "addFileParts: error adding file:" ); 218 odebug << "addFileParts: error adding file:" << oendl;
219 qDebug( it->getFileName() ); 219 odebug << it->getFileName() << oendl;
220 continue; 220 continue;
221 } 221 }
222 err = mailmime_smart_add_part( message, filePart ); 222 err = mailmime_smart_add_part( message, filePart );
223 if ( err != MAILIMF_NO_ERROR ) { 223 if ( err != MAILIMF_NO_ERROR ) {
224 mailmime_free( filePart ); 224 mailmime_free( filePart );
225 qDebug("error smart add"); 225 odebug << "error smart add" << oendl;
226 } 226 }
227 } 227 }
228} 228}
229 229
230mailmime *Generatemail::buildTxtPart(const QString&str ) { 230mailmime *Generatemail::buildTxtPart(const QString&str ) {
231 mailmime *txtPart; 231 mailmime *txtPart;
@@ -267,13 +267,13 @@ err_free_fields:
267 mailmime_fields_free( fields ); 267 mailmime_fields_free( fields );
268err_free_content: 268err_free_content:
269 mailmime_content_free( content ); 269 mailmime_content_free( content );
270err_free_param: 270err_free_param:
271 mailmime_parameter_free( param ); 271 mailmime_parameter_free( param );
272err_free: 272err_free:
273 qDebug( "buildTxtPart - error" ); 273 odebug << "buildTxtPart - error" << oendl;
274 274
275 return NULL; // Error :( 275 return NULL; // Error :(
276} 276}
277 277
278mailimf_mailbox *Generatemail::newMailbox(const QString&name, const QString&mail ) { 278mailimf_mailbox *Generatemail::newMailbox(const QString&name, const QString&mail ) {
279 return mailimf_mailbox_new( strdup( name.latin1() ), 279 return mailimf_mailbox_new( strdup( name.latin1() ),
@@ -342,21 +342,21 @@ mailimf_fields *Generatemail::createImfFields(const Opie::Core::OSmartPointer<Ma
342 nsize = strlen(h.latin1()); 342 nsize = strlen(h.latin1());
343 /* yes! must be malloc! */ 343 /* yes! must be malloc! */
344 c_reply = (char*)malloc( (nsize+1)*sizeof(char)); 344 c_reply = (char*)malloc( (nsize+1)*sizeof(char));
345 memset(c_reply,0,nsize+1); 345 memset(c_reply,0,nsize+1);
346 memcpy(c_reply,h.latin1(),nsize); 346 memcpy(c_reply,h.latin1(),nsize);
347 clist_append(in_reply_to,c_reply); 347 clist_append(in_reply_to,c_reply);
348 qDebug("In reply to: %s",c_reply); 348 odebug << "In reply to: " << c_reply << "" << oendl;
349 } 349 }
350 } 350 }
351 351
352 if (res) { 352 if (res) {
353 fields = mailimf_fields_new_with_data( from, sender, reply, to, cc, bcc, 353 fields = mailimf_fields_new_with_data( from, sender, reply, to, cc, bcc,
354 in_reply_to, NULL, subject ); 354 in_reply_to, NULL, subject );
355 if ( fields == NULL ) { 355 if ( fields == NULL ) {
356 qDebug("Error creating mailimf fields"); 356 odebug << "Error creating mailimf fields" << oendl;
357 res = 0; 357 res = 0;
358 } 358 }
359 } 359 }
360 if (res) xmailer = mailimf_field_new_custom( strdup( "User-Agent" ), 360 if (res) xmailer = mailimf_field_new_custom( strdup( "User-Agent" ),
361 strdup( USER_AGENT ) ); 361 strdup( USER_AGENT ) );
362 if ( xmailer == NULL ) { 362 if ( xmailer == NULL ) {
@@ -432,13 +432,13 @@ err_free_txtPart:
432 mailmime_free( txtPart ); 432 mailmime_free( txtPart );
433err_free_message: 433err_free_message:
434 mailmime_free( message ); 434 mailmime_free( message );
435err_free_fields: 435err_free_fields:
436 mailimf_fields_free( fields ); 436 mailimf_fields_free( fields );
437err_free: 437err_free:
438 qDebug( "createMimeMail: error" ); 438 odebug << "createMimeMail: error" << oendl;
439 439
440 return NULL; // Error :( 440 return NULL; // Error :(
441} 441}
442 442
443clist *Generatemail::createRcptList( mailimf_fields *fields ) { 443clist *Generatemail::createRcptList( mailimf_fields *fields ) {
444 clist *rcptList; 444 clist *rcptList;
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index 0c68280..fae4c99 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -132,13 +132,13 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc)
132 return enc; 132 return enc;
133} 133}
134 134
135void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count) 135void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count)
136{ 136{
137 if (current_rec >= 10) { 137 if (current_rec >= 10) {
138 qDebug("too deep recursion!"); 138 odebug << "too deep recursion!" << oendl;
139 } 139 }
140 if (!message || !mime) { 140 if (!message || !mime) {
141 return; 141 return;
142 } 142 }
143 int r; 143 int r;
144 char*data = 0; 144 char*data = 0;
@@ -269,13 +269,13 @@ QString Genericwrapper::parseAddressList( mailimf_address_list *list )
269 result.append( parseMailbox( addr->ad_data.ad_mailbox ) ); 269 result.append( parseMailbox( addr->ad_data.ad_mailbox ) );
270 break; 270 break;
271 case MAILIMF_ADDRESS_GROUP: 271 case MAILIMF_ADDRESS_GROUP:
272 result.append( parseGroup( addr->ad_data.ad_group ) ); 272 result.append( parseGroup( addr->ad_data.ad_group ) );
273 break; 273 break;
274 default: 274 default:
275 qDebug( "Generic: unkown mailimf address type" ); 275 odebug << "Generic: unkown mailimf address type" << oendl;
276 break; 276 break;
277 } 277 }
278 } 278 }
279 279
280 return result; 280 return result;
281} 281}
@@ -362,13 +362,13 @@ void Genericwrapper::cleanMimeCache()
362 for (;it!=bodyCache.end();++it) { 362 for (;it!=bodyCache.end();++it) {
363 encodedString*t = it.data(); 363 encodedString*t = it.data();
364 //it.setValue(0); 364 //it.setValue(0);
365 if (t) delete t; 365 if (t) delete t;
366 } 366 }
367 bodyCache.clear(); 367 bodyCache.clear();
368 qDebug("Genericwrapper: cache cleaned"); 368 odebug << "Genericwrapper: cache cleaned" << oendl;
369} 369}
370 370
371QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) 371QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
372{ 372{
373 QStringList res; 373 QStringList res;
374 if (!in_replies || !in_replies->mid_list) return res; 374 if (!in_replies || !in_replies->mid_list) return res;
@@ -391,18 +391,18 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
391void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to) 391void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to)
392{ 392{
393 int r; 393 int r;
394 mailmessage_list * env_list = 0; 394 mailmessage_list * env_list = 0;
395 r = mailsession_get_messages_list(session,&env_list); 395 r = mailsession_get_messages_list(session,&env_list);
396 if (r != MAIL_NO_ERROR) { 396 if (r != MAIL_NO_ERROR) {
397 qDebug("Error message list"); 397 odebug << "Error message list" << oendl;
398 return; 398 return;
399 } 399 }
400 r = mailsession_get_envelopes_list(session, env_list); 400 r = mailsession_get_envelopes_list(session, env_list);
401 if (r != MAIL_NO_ERROR) { 401 if (r != MAIL_NO_ERROR) {
402 qDebug("Error filling message list"); 402 odebug << "Error filling message list" << oendl;
403 if (env_list) { 403 if (env_list) {
404 mailmessage_list_free(env_list); 404 mailmessage_list_free(env_list);
405 } 405 }
406 return; 406 return;
407 } 407 }
408 mailimf_references * refs = 0; 408 mailimf_references * refs = 0;
@@ -410,13 +410,13 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &
410 uint32_t i = 0; 410 uint32_t i = 0;
411 for(; i < carray_count(env_list->msg_tab) ; ++i) { 411 for(; i < carray_count(env_list->msg_tab) ; ++i) {
412 mailmessage * msg; 412 mailmessage * msg;
413 QBitArray mFlags(7); 413 QBitArray mFlags(7);
414 msg = (mailmessage*)carray_get(env_list->msg_tab, i); 414 msg = (mailmessage*)carray_get(env_list->msg_tab, i);
415 if (msg->msg_fields == NULL) { 415 if (msg->msg_fields == NULL) {
416 //qDebug("could not fetch envelope of message %i", i); 416 //odebug << "could not fetch envelope of message " << i << "" << oendl;
417 continue; 417 continue;
418 } 418 }
419 RecMailP mail = new RecMail(); 419 RecMailP mail = new RecMail();
420 mail->setWrapper(this); 420 mail->setWrapper(this);
421 mail_flags * flag_result = 0; 421 mail_flags * flag_result = 0;
422 r = mailmessage_get_flags(msg,&flag_result); 422 r = mailmessage_get_flags(msg,&flag_result);
@@ -445,13 +445,13 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &
445 mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); 445 mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) );
446 if (single_fields.fld_orig_date) 446 if (single_fields.fld_orig_date)
447 mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) ); 447 mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) );
448 // crashes when accessing pop3 account? 448 // crashes when accessing pop3 account?
449 if (single_fields.fld_message_id->mid_value) { 449 if (single_fields.fld_message_id->mid_value) {
450 mail->setMsgid(QString(single_fields.fld_message_id->mid_value)); 450 mail->setMsgid(QString(single_fields.fld_message_id->mid_value));
451 qDebug("Msgid == %s",mail->Msgid().latin1()); 451 odebug << "Msgid == " << mail->Msgid().latin1() << "" << oendl;
452 } 452 }
453 453
454 if (single_fields.fld_reply_to) { 454 if (single_fields.fld_reply_to) {
455 QStringList t = parseAddressList(single_fields.fld_reply_to->rt_addr_list); 455 QStringList t = parseAddressList(single_fields.fld_reply_to->rt_addr_list);
456 if (t.count()>0) { 456 if (t.count()>0) {
457 mail->setReplyto(t[0]); 457 mail->setReplyto(t[0]);
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 657c2ba..35468fe 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -27,36 +27,36 @@ int IMAPwrapper::selectMbox(const QString&mbox)
27{ 27{
28 if (mbox == m_Lastmbox) { 28 if (mbox == m_Lastmbox) {
29 return MAILIMAP_NO_ERROR; 29 return MAILIMAP_NO_ERROR;
30 } 30 }
31 int err = mailimap_select( m_imap, (char*)mbox.latin1()); 31 int err = mailimap_select( m_imap, (char*)mbox.latin1());
32 if ( err != MAILIMAP_NO_ERROR ) { 32 if ( err != MAILIMAP_NO_ERROR ) {
33 qDebug("error selecting mailbox: %s",m_imap->imap_response); 33 odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl;
34 m_Lastmbox = ""; 34 m_Lastmbox = "";
35 return err; 35 return err;
36 } 36 }
37 m_Lastmbox = mbox; 37 m_Lastmbox = mbox;
38 return err; 38 return err;
39} 39}
40 40
41void IMAPwrapper::imap_progress( size_t current, size_t maximum ) 41void IMAPwrapper::imap_progress( size_t current, size_t maximum )
42{ 42{
43 qApp->processEvents(); 43 qApp->processEvents();
44 qDebug( "IMAP: %i of %i", current, maximum ); 44 odebug << "IMAP: " << current << " of " << maximum << "" << oendl;
45} 45}
46 46
47bool IMAPwrapper::start_tls(bool force_tls) 47bool IMAPwrapper::start_tls(bool force_tls)
48{ 48{
49 int err; 49 int err;
50 bool try_tls; 50 bool try_tls;
51 mailimap_capability_data * cap_data = 0; 51 mailimap_capability_data * cap_data = 0;
52 52
53 err = mailimap_capability(m_imap,&cap_data); 53 err = mailimap_capability(m_imap,&cap_data);
54 if (err != MAILIMAP_NO_ERROR) { 54 if (err != MAILIMAP_NO_ERROR) {
55 Global::statusMessage("error getting capabilities!"); 55 Global::statusMessage("error getting capabilities!");
56 qDebug("error getting capabilities!"); 56 odebug << "error getting capabilities!" << oendl;
57 return false; 57 return false;
58 } 58 }
59 clistiter * cur; 59 clistiter * cur;
60 for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) { 60 for(cur = clist_begin(cap_data->cap_list) ; cur != NULL;cur = clist_next(cur)) {
61 struct mailimap_capability * cap; 61 struct mailimap_capability * cap;
62 cap = (struct mailimap_capability *)clist_content(cur); 62 cap = (struct mailimap_capability *)clist_content(cur);
@@ -71,13 +71,13 @@ bool IMAPwrapper::start_tls(bool force_tls)
71 mailimap_capability_data_free(cap_data); 71 mailimap_capability_data_free(cap_data);
72 } 72 }
73 if (try_tls) { 73 if (try_tls) {
74 err = mailimap_starttls(m_imap); 74 err = mailimap_starttls(m_imap);
75 if (err != MAILIMAP_NO_ERROR && force_tls) { 75 if (err != MAILIMAP_NO_ERROR && force_tls) {
76 Global::statusMessage(tr("Server has no TLS support!")); 76 Global::statusMessage(tr("Server has no TLS support!"));
77 qDebug("Server has no TLS support!"); 77 odebug << "Server has no TLS support!" << oendl;
78 try_tls = false; 78 try_tls = false;
79 } else { 79 } else {
80 mailstream_low * low; 80 mailstream_low * low;
81 mailstream_low * new_low; 81 mailstream_low * new_low;
82 low = mailstream_get_low(m_imap->imap_stream); 82 low = mailstream_get_low(m_imap->imap_stream);
83 if (!low) { 83 if (!low) {
@@ -122,13 +122,13 @@ void IMAPwrapper::login()
122 if ( QDialog::Accepted == login.exec() ) { 122 if ( QDialog::Accepted == login.exec() ) {
123 // ok 123 // ok
124 user = login.getUser().latin1(); 124 user = login.getUser().latin1();
125 pass = login.getPassword().latin1(); 125 pass = login.getPassword().latin1();
126 } else { 126 } else {
127 // cancel 127 // cancel
128 qDebug( "IMAP: Login canceled" ); 128 odebug << "IMAP: Login canceled" << oendl;
129 return; 129 return;
130 } 130 }
131 } else { 131 } else {
132 user = account->getUser().latin1(); 132 user = account->getUser().latin1();
133 pass = account->getPassword().latin1(); 133 pass = account->getPassword().latin1();
134 } 134 }
@@ -145,13 +145,13 @@ void IMAPwrapper::login()
145 } 145 }
146 if (account->ConnectionType()==1) { 146 if (account->ConnectionType()==1) {
147 force_tls = true; 147 force_tls = true;
148 } 148 }
149 149
150 if ( ssl ) { 150 if ( ssl ) {
151 qDebug( "using ssl" ); 151 odebug << "using ssl" << oendl;
152 err = mailimap_ssl_connect( m_imap, (char*)server, port ); 152 err = mailimap_ssl_connect( m_imap, (char*)server, port );
153 } else { 153 } else {
154 err = mailimap_socket_connect( m_imap, (char*)server, port ); 154 err = mailimap_socket_connect( m_imap, (char*)server, port );
155 } 155 }
156 156
157 if ( err != MAILIMAP_NO_ERROR && 157 if ( err != MAILIMAP_NO_ERROR &&
@@ -173,13 +173,13 @@ void IMAPwrapper::login()
173 try_tls = start_tls(force_tls); 173 try_tls = start_tls(force_tls);
174 } 174 }
175 175
176 bool ok = true; 176 bool ok = true;
177 if (force_tls && !try_tls) { 177 if (force_tls && !try_tls) {
178 Global::statusMessage(tr("Server has no TLS support!")); 178 Global::statusMessage(tr("Server has no TLS support!"));
179 qDebug("Server has no TLS support!"); 179 odebug << "Server has no TLS support!" << oendl;
180 ok = false; 180 ok = false;
181 } 181 }
182 182
183 183
184 /* login */ 184 /* login */
185 185
@@ -314,23 +314,23 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
314 } 314 }
315 } 315 }
316 } 316 }
317 folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); 317 folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix()));
318 } 318 }
319 } else { 319 } else {
320 qDebug("error fetching folders: %s",m_imap->imap_response); 320 odebug << "error fetching folders: " << m_imap->imap_response << "" << oendl;
321 } 321 }
322 mailimap_list_result_free( result ); 322 mailimap_list_result_free( result );
323 323
324/* 324/*
325 * second stage - get the other then inbox folders 325 * second stage - get the other then inbox folders
326 */ 326 */
327 mask = "*" ; 327 mask = "*" ;
328 path = account->getPrefix().latin1(); 328 path = account->getPrefix().latin1();
329 if (!path) path = ""; 329 if (!path) path = "";
330 qDebug(path); 330 odebug << path << oendl;
331 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); 331 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
332 if ( err == MAILIMAP_NO_ERROR ) { 332 if ( err == MAILIMAP_NO_ERROR ) {
333 current = result->first; 333 current = result->first;
334 for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { 334 for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
335 no_inferiors = false; 335 no_inferiors = false;
336 list = (mailimap_mailbox_list *) current->data; 336 list = (mailimap_mailbox_list *) current->data;
@@ -351,13 +351,13 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
351 } 351 }
352 } 352 }
353 del = list->mb_delimiter; 353 del = list->mb_delimiter;
354 folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); 354 folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix()));
355 } 355 }
356 } else { 356 } else {
357 qDebug("error fetching folders %s",m_imap->imap_response); 357 odebug << "error fetching folders " << m_imap->imap_response << "" << oendl;
358 } 358 }
359 if (result) mailimap_list_result_free( result ); 359 if (result) mailimap_list_result_free( result );
360 return folders; 360 return folders;
361} 361}
362 362
363RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) 363RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
@@ -463,14 +463,14 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
463 m->setMsgid(QString(head->env_message_id)); 463 m->setMsgid(QString(head->env_message_id));
464 } 464 }
465 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) { 465 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) {
466#if 0 466#if 0
467 mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; 467 mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date;
468 QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); 468 QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec));
469 qDebug("%i %i %i - %i %i %i",d->dt_year,d->dt_month,d->dt_day,d->dt_hour,d->dt_min,d->dt_sec); 469 odebug << "" << d->dt_year << " " << d->dt_month << " " << d->dt_day << " - " << d->dt_hour << " " << d->dt_min << " " << d->dt_sec << "" << oendl;
470 qDebug(da.toString()); 470 odebug << da.toString() << oendl;
471#endif 471#endif
472 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { 472 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) {
473 size = item->att_data.att_static->att_data.att_rfc822_size; 473 size = item->att_data.att_static->att_data.att_rfc822_size;
474 } 474 }
475 } 475 }
476 /* msg is already deleted */ 476 /* msg is already deleted */
@@ -521,13 +521,13 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail)
521 msg_att = (mailimap_msg_att*)current->data; 521 msg_att = (mailimap_msg_att*)current->data;
522 mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; 522 mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data;
523 QValueList<int> path; 523 QValueList<int> path;
524 body_desc = item->att_data.att_static->att_data.att_body; 524 body_desc = item->att_data.att_static->att_data.att_body;
525 traverseBody(mail,body_desc,body,0,path); 525 traverseBody(mail,body_desc,body,0,path);
526 } else { 526 } else {
527 qDebug("error fetching body: %s",m_imap->imap_response); 527 odebug << "error fetching body: " << m_imap->imap_response << "" << oendl;
528 } 528 }
529 if (result) mailimap_fetch_list_free(result); 529 if (result) mailimap_fetch_list_free(result);
530 return body; 530 return body;
531} 531}
532 532
533QStringList IMAPwrapper::address_list_to_stringlist(clist*list) 533QStringList IMAPwrapper::address_list_to_stringlist(clist*list)
@@ -633,13 +633,13 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int
633 msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part = 0L; 633 msg_att_item->att_data.att_static->att_data.att_body_section->sec_body_part = 0L;
634 res->setContent(text,msg_att_item->att_data.att_static->att_data.att_body_section->sec_length); 634 res->setContent(text,msg_att_item->att_data.att_static->att_data.att_body_section->sec_length);
635 } 635 }
636 } 636 }
637 } 637 }
638 } else { 638 } else {
639 qDebug("error fetching text: %s",m_imap->imap_response); 639 odebug << "error fetching text: " << m_imap->imap_response << "" << oendl;
640 } 640 }
641 if (result) mailimap_fetch_list_free(result); 641 if (result) mailimap_fetch_list_free(result);
642 return res; 642 return res;
643} 643}
644 644
645/* current_recursion is for recursive calls. 645/* current_recursion is for recursive calls.
@@ -660,13 +660,13 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t
660 QString id(""); 660 QString id("");
661 currentPart->setPositionlist(countlist); 661 currentPart->setPositionlist(countlist);
662 for (unsigned int j = 0; j < countlist.count();++j) { 662 for (unsigned int j = 0; j < countlist.count();++j) {
663 id+=(j>0?" ":""); 663 id+=(j>0?" ":"");
664 id+=QString("%1").arg(countlist[j]); 664 id+=QString("%1").arg(countlist[j]);
665 } 665 }
666 qDebug("ID = %s",id.latin1()); 666 odebug << "ID = " << id.latin1() << "" << oendl;
667 currentPart->setIdentifier(id); 667 currentPart->setIdentifier(id);
668 fillSinglePart(currentPart,part1); 668 fillSinglePart(currentPart,part1);
669 /* important: Check for is NULL 'cause a body can be empty! 669 /* important: Check for is NULL 'cause a body can be empty!
670 And we put it only into the mail if it is the FIRST part */ 670 And we put it only into the mail if it is the FIRST part */
671 if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { 671 if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) {
672 QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); 672 QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding());
@@ -701,13 +701,13 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t
701 target_body->addPart(targetPart); 701 target_body->addPart(targetPart);
702 QString id(""); 702 QString id("");
703 for (unsigned int j = 0; j < countlist.count();++j) { 703 for (unsigned int j = 0; j < countlist.count();++j) {
704 id+=(j>0?" ":""); 704 id+=(j>0?" ":"");
705 id+=QString("%1").arg(countlist[j]); 705 id+=QString("%1").arg(countlist[j]);
706 } 706 }
707 qDebug("ID(mpart) = %s",id.latin1()); 707 odebug << "ID(mpart) = " << id.latin1() << "" << oendl;
708 } 708 }
709 traverseBody(mail,current_body,target_body,current_recursion+1,countlist,ccount); 709 traverseBody(mail,current_body,target_body,current_recursion+1,countlist,ccount);
710 if (current_body->bd_type==MAILIMAP_BODY_MPART) { 710 if (current_body->bd_type==MAILIMAP_BODY_MPART) {
711 countlist = recList; 711 countlist = recList;
712 } 712 }
713 ++ccount; 713 ++ccount;
@@ -745,25 +745,25 @@ void IMAPwrapper::fillSingleTextPart(RecPartP&target_part,mailimap_body_type_tex
745{ 745{
746 if (!which) { 746 if (!which) {
747 return; 747 return;
748 } 748 }
749 QString sub; 749 QString sub;
750 sub = which->bd_media_text; 750 sub = which->bd_media_text;
751 qDebug("Type= text/%s",which->bd_media_text); 751 odebug << "Type= text/" << which->bd_media_text << "" << oendl;
752 target_part->setSubtype(sub.lower()); 752 target_part->setSubtype(sub.lower());
753 target_part->setLines(which->bd_lines); 753 target_part->setLines(which->bd_lines);
754 fillBodyFields(target_part,which->bd_fields); 754 fillBodyFields(target_part,which->bd_fields);
755} 755}
756 756
757void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which) 757void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which)
758{ 758{
759 if (!which) { 759 if (!which) {
760 return; 760 return;
761 } 761 }
762 target_part->setSubtype("rfc822"); 762 target_part->setSubtype("rfc822");
763 qDebug("Message part"); 763 odebug << "Message part" << oendl;
764 /* we set this type to text/plain */ 764 /* we set this type to text/plain */
765 target_part->setLines(which->bd_lines); 765 target_part->setLines(which->bd_lines);
766 fillBodyFields(target_part,which->bd_fields); 766 fillBodyFields(target_part,which->bd_fields);
767} 767}
768 768
769void IMAPwrapper::fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which) 769void IMAPwrapper::fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which)
@@ -816,13 +816,13 @@ void IMAPwrapper::fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_ba
816 } 816 }
817 if (which->bd_media_basic->med_subtype) { 817 if (which->bd_media_basic->med_subtype) {
818 sub = which->bd_media_basic->med_subtype; 818 sub = which->bd_media_basic->med_subtype;
819 } else { 819 } else {
820 sub = ""; 820 sub = "";
821 } 821 }
822 qDebug("Type = %s/%s",type.latin1(),sub.latin1()); 822 odebug << "Type = " << type.latin1() << "/" << sub.latin1() << "" << oendl;
823 target_part->setType(type.lower()); 823 target_part->setType(type.lower());
824 target_part->setSubtype(sub.lower()); 824 target_part->setSubtype(sub.lower());
825 fillBodyFields(target_part,which->bd_fields); 825 fillBodyFields(target_part,which->bd_fields);
826} 826}
827 827
828void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which) 828void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which)
@@ -892,22 +892,22 @@ void IMAPwrapper::deleteMail(const RecMailP&mail)
892 set = mailimap_set_new_single(mail->getNumber()); 892 set = mailimap_set_new_single(mail->getNumber());
893 err = mailimap_store(m_imap,set,store_flags); 893 err = mailimap_store(m_imap,set,store_flags);
894 mailimap_set_free( set ); 894 mailimap_set_free( set );
895 mailimap_store_att_flags_free(store_flags); 895 mailimap_store_att_flags_free(store_flags);
896 896
897 if (err != MAILIMAP_NO_ERROR) { 897 if (err != MAILIMAP_NO_ERROR) {
898 qDebug("error deleting mail: %s",m_imap->imap_response); 898 odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl;
899 return; 899 return;
900 } 900 }
901 qDebug("deleting mail: %s",m_imap->imap_response); 901 odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
902 /* should we realy do that at this moment? */ 902 /* should we realy do that at this moment? */
903 err = mailimap_expunge(m_imap); 903 err = mailimap_expunge(m_imap);
904 if (err != MAILIMAP_NO_ERROR) { 904 if (err != MAILIMAP_NO_ERROR) {
905 qDebug("error deleting mail: %s",m_imap->imap_response); 905 odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl;
906 } 906 }
907 qDebug("Delete successfull %s",m_imap->imap_response); 907 odebug << "Delete successfull " << m_imap->imap_response << "" << oendl;
908} 908}
909 909
910void IMAPwrapper::answeredMail(const RecMailP&mail) 910void IMAPwrapper::answeredMail(const RecMailP&mail)
911{ 911{
912 mailimap_flag_list*flist; 912 mailimap_flag_list*flist;
913 mailimap_set *set; 913 mailimap_set *set;
@@ -927,13 +927,13 @@ void IMAPwrapper::answeredMail(const RecMailP&mail)
927 set = mailimap_set_new_single(mail->getNumber()); 927 set = mailimap_set_new_single(mail->getNumber());
928 err = mailimap_store(m_imap,set,store_flags); 928 err = mailimap_store(m_imap,set,store_flags);
929 mailimap_set_free( set ); 929 mailimap_set_free( set );
930 mailimap_store_att_flags_free(store_flags); 930 mailimap_store_att_flags_free(store_flags);
931 931
932 if (err != MAILIMAP_NO_ERROR) { 932 if (err != MAILIMAP_NO_ERROR) {
933 qDebug("error marking mail: %s",m_imap->imap_response); 933 odebug << "error marking mail: " << m_imap->imap_response << "" << oendl;
934 return; 934 return;
935 } 935 }
936} 936}
937 937
938QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) 938QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc)
939{ 939{
@@ -995,20 +995,20 @@ int IMAPwrapper::deleteAllMail(const FolderP&folder)
995 mailimap_set_free( set ); 995 mailimap_set_free( set );
996 mailimap_store_att_flags_free(store_flags); 996 mailimap_store_att_flags_free(store_flags);
997 if (err != MAILIMAP_NO_ERROR) { 997 if (err != MAILIMAP_NO_ERROR) {
998 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); 998 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response));
999 return 0; 999 return 0;
1000 } 1000 }
1001 qDebug("deleting mail: %s",m_imap->imap_response); 1001 odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
1002 /* should we realy do that at this moment? */ 1002 /* should we realy do that at this moment? */
1003 err = mailimap_expunge(m_imap); 1003 err = mailimap_expunge(m_imap);
1004 if (err != MAILIMAP_NO_ERROR) { 1004 if (err != MAILIMAP_NO_ERROR) {
1005 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); 1005 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response));
1006 return 0; 1006 return 0;
1007 } 1007 }
1008 qDebug("Delete successfull %s",m_imap->imap_response); 1008 odebug << "Delete successfull " << m_imap->imap_response << "" << oendl;
1009 return 1; 1009 return 1;
1010} 1010}
1011 1011
1012int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder) 1012int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,const QString& delemiter,bool getsubfolder)
1013{ 1013{
1014 if (folder.length()==0) return 0; 1014 if (folder.length()==0) return 0;
@@ -1027,13 +1027,13 @@ int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,cons
1027 pre+=delemiter; 1027 pre+=delemiter;
1028 } else { 1028 } else {
1029 Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre)); 1029 Global::statusMessage(tr("Cannot create folder %1 for holding subfolders").arg(pre));
1030 return 0; 1030 return 0;
1031 } 1031 }
1032 } 1032 }
1033 qDebug("Creating %s",pre.latin1()); 1033 odebug << "Creating " << pre.latin1() << "" << oendl;
1034 int res = mailimap_create(m_imap,pre.latin1()); 1034 int res = mailimap_create(m_imap,pre.latin1());
1035 if (res != MAILIMAP_NO_ERROR) { 1035 if (res != MAILIMAP_NO_ERROR) {
1036 Global::statusMessage(tr("%1").arg(m_imap->imap_response)); 1036 Global::statusMessage(tr("%1").arg(m_imap->imap_response));
1037 return 0; 1037 return 0;
1038 } 1038 }
1039 return 1; 1039 return 1;
@@ -1086,13 +1086,13 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
1086 case MAILIMAP_STATUS_ATT_UNSEEN: 1086 case MAILIMAP_STATUS_ATT_UNSEEN:
1087 target_stat.message_unseen = status_info->st_value; 1087 target_stat.message_unseen = status_info->st_value;
1088 break; 1088 break;
1089 } 1089 }
1090 } 1090 }
1091 } else { 1091 } else {
1092 qDebug("Error retrieving status"); 1092 odebug << "Error retrieving status" << oendl;
1093 } 1093 }
1094 if (status) mailimap_mailbox_data_status_free(status); 1094 if (status) mailimap_mailbox_data_status_free(status);
1095 if (att_list) mailimap_status_att_list_free(att_list); 1095 if (att_list) mailimap_status_att_list_free(att_list);
1096} 1096}
1097 1097
1098void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folder) 1098void IMAPwrapper::storeMessage(const char*msg,size_t length, const QString&folder)
@@ -1110,13 +1110,13 @@ MAILLIB::ATYPE IMAPwrapper::getType()const
1110{ 1110{
1111 return account->getType(); 1111 return account->getType();
1112} 1112}
1113 1113
1114const QString&IMAPwrapper::getName()const 1114const QString&IMAPwrapper::getName()const
1115{ 1115{
1116 qDebug("Get name: %s",account->getAccountName().latin1()); 1116 odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl;
1117 return account->getAccountName(); 1117 return account->getAccountName();
1118} 1118}
1119 1119
1120encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) 1120encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail)
1121{ 1121{
1122 // dummy 1122 // dummy
@@ -1126,13 +1126,13 @@ encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail)
1126 1126
1127void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, 1127void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
1128 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 1128 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
1129{ 1129{
1130 if (targetWrapper != this) { 1130 if (targetWrapper != this) {
1131 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); 1131 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit);
1132 qDebug("Using generic"); 1132 odebug << "Using generic" << oendl;
1133 return; 1133 return;
1134 } 1134 }
1135 mailimap_set *set = 0; 1135 mailimap_set *set = 0;
1136 login(); 1136 login();
1137 if (!m_imap) { 1137 if (!m_imap) {
1138 return; 1138 return;
@@ -1145,24 +1145,24 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
1145 set = mailimap_set_new_interval( 1, last ); 1145 set = mailimap_set_new_interval( 1, last );
1146 err = mailimap_copy(m_imap,set,targetFolder.latin1()); 1146 err = mailimap_copy(m_imap,set,targetFolder.latin1());
1147 mailimap_set_free( set ); 1147 mailimap_set_free( set );
1148 if ( err != MAILIMAP_NO_ERROR ) { 1148 if ( err != MAILIMAP_NO_ERROR ) {
1149 QString error_msg = tr("error copy mails: %1").arg(m_imap->imap_response); 1149 QString error_msg = tr("error copy mails: %1").arg(m_imap->imap_response);
1150 Global::statusMessage(error_msg); 1150 Global::statusMessage(error_msg);
1151 qDebug(error_msg); 1151 odebug << error_msg << oendl;
1152 return; 1152 return;
1153 } 1153 }
1154 if (moveit) { 1154 if (moveit) {
1155 deleteAllMail(fromFolder); 1155 deleteAllMail(fromFolder);
1156 } 1156 }
1157} 1157}
1158 1158
1159void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 1159void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
1160{ 1160{
1161 if (targetWrapper != this) { 1161 if (targetWrapper != this) {
1162 qDebug("Using generic"); 1162 odebug << "Using generic" << oendl;
1163 AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit); 1163 AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit);
1164 return; 1164 return;
1165 } 1165 }
1166 mailimap_set *set = 0; 1166 mailimap_set *set = 0;
1167 login(); 1167 login();
1168 if (!m_imap) { 1168 if (!m_imap) {
@@ -1175,13 +1175,13 @@ void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstra
1175 set = mailimap_set_new_single(mail->getNumber()); 1175 set = mailimap_set_new_single(mail->getNumber());
1176 err = mailimap_copy(m_imap,set,targetFolder.latin1()); 1176 err = mailimap_copy(m_imap,set,targetFolder.latin1());
1177 mailimap_set_free( set ); 1177 mailimap_set_free( set );
1178 if ( err != MAILIMAP_NO_ERROR ) { 1178 if ( err != MAILIMAP_NO_ERROR ) {
1179 QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response); 1179 QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response);
1180 Global::statusMessage(error_msg); 1180 Global::statusMessage(error_msg);
1181 qDebug(error_msg); 1181 odebug << error_msg << oendl;
1182 return; 1182 return;
1183 } 1183 }
1184 if (moveit) { 1184 if (moveit) {
1185 deleteMail(mail); 1185 deleteMail(mail);
1186 } 1186 }
1187} 1187}
diff --git a/noncore/net/mail/libmailwrapper/logindialog.cpp b/noncore/net/mail/libmailwrapper/logindialog.cpp
index 01d177e..c9ae190 100644
--- a/noncore/net/mail/libmailwrapper/logindialog.cpp
+++ b/noncore/net/mail/libmailwrapper/logindialog.cpp
@@ -21,9 +21,9 @@ void LoginDialog::accept()
21{ 21{
22 //_user.replace( 0, _user.length(), userLine->text() ); 22 //_user.replace( 0, _user.length(), userLine->text() );
23 //_pass.replace( 0, _pass.length(), passLine->text() ); 23 //_pass.replace( 0, _pass.length(), passLine->text() );
24 _user = userLine->text(); 24 _user = userLine->text();
25 _pass = passLine->text(); 25 _pass = passLine->text();
26 26
27 qDebug("User im accept: |%s|",_user.latin1()); 27 odebug << "User im accept: |" << _user.latin1() << "|" << oendl;
28 QDialog::accept(); 28 QDialog::accept();
29} 29}
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp
index 90b8865..6d44db4 100644
--- a/noncore/net/mail/libmailwrapper/mailtypes.cpp
+++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp
@@ -10,13 +10,13 @@ RecMail::RecMail()
10 10
11RecMail::RecMail(const RecMail&old) 11RecMail::RecMail(const RecMail&old)
12 :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) 12 :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7)
13{ 13{
14 init(); 14 init();
15 copy_old(old); 15 copy_old(old);
16 qDebug("Copy constructor RecMail"); 16 odebug << "Copy constructor RecMail" << oendl;
17} 17}
18 18
19RecMail::~RecMail() 19RecMail::~RecMail()
20{ 20{
21 wrapper = 0; 21 wrapper = 0;
22} 22}
@@ -128,13 +128,13 @@ RecPart::RecPart(const RecPart&old)
128 m_encoding = old.m_encoding; 128 m_encoding = old.m_encoding;
129 m_description = old.m_description; 129 m_description = old.m_description;
130 m_lines = old.m_lines; 130 m_lines = old.m_lines;
131 m_size = old.m_size; 131 m_size = old.m_size;
132 m_Parameters = old.m_Parameters; 132 m_Parameters = old.m_Parameters;
133 m_poslist = old.m_poslist; 133 m_poslist = old.m_poslist;
134 qDebug("RecPart copy constructor"); 134 odebug << "RecPart copy constructor" << oendl;
135} 135}
136 136
137RecPart::~RecPart() 137RecPart::~RecPart()
138{ 138{
139} 139}
140 140
@@ -252,13 +252,13 @@ RecBody::RecBody()
252RecBody::RecBody(const RecBody&old) 252RecBody::RecBody(const RecBody&old)
253 :Opie::Core::ORefCount(),m_BodyText(),m_PartsList(),m_description(new RecPart()) 253 :Opie::Core::ORefCount(),m_BodyText(),m_PartsList(),m_description(new RecPart())
254{ 254{
255 m_BodyText = old.m_BodyText; 255 m_BodyText = old.m_BodyText;
256 m_PartsList = old.m_PartsList; 256 m_PartsList = old.m_PartsList;
257 m_description = old.m_description; 257 m_description = old.m_description;
258 qDebug("Recbody copy constructor"); 258 odebug << "Recbody copy constructor" << oendl;
259} 259}
260 260
261RecBody::~RecBody() 261RecBody::~RecBody()
262{ 262{
263} 263}
264 264
@@ -317,20 +317,20 @@ encodedString::encodedString(char*nContent,unsigned int nSize)
317} 317}
318 318
319encodedString::encodedString(const encodedString&old) 319encodedString::encodedString(const encodedString&old)
320{ 320{
321 init(); 321 init();
322 copy_old(old); 322 copy_old(old);
323 qDebug("encodedeString: copy constructor!"); 323 odebug << "encodedeString: copy constructor!" << oendl;
324} 324}
325 325
326encodedString& encodedString::operator=(const encodedString&old) 326encodedString& encodedString::operator=(const encodedString&old)
327{ 327{
328 init(); 328 init();
329 copy_old(old); 329 copy_old(old);
330 qDebug("encodedString: assign operator!"); 330 odebug << "encodedString: assign operator!" << oendl;
331 return *this; 331 return *this;
332} 332}
333 333
334encodedString::~encodedString() 334encodedString::~encodedString()
335{ 335{
336 clean(); 336 clean();
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
index eddc0b9..2b0d112 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
@@ -48,13 +48,13 @@ const QString& Folder::Separator()const
48IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no_inf, const QString&aprefix ) 48IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no_inf, const QString&aprefix )
49 : Folder( name,sep ),m_MaySelect(select),m_NoInferior(no_inf) 49 : Folder( name,sep ),m_MaySelect(select),m_NoInferior(no_inf)
50{ 50{
51 // Decode IMAP foldername 51 // Decode IMAP foldername
52 nameDisplay = IMAPFolder::decodeFolderName( name ); 52 nameDisplay = IMAPFolder::decodeFolderName( name );
53 /* 53 /*
54 qDebug( "folder " + name + " - displayed as " + nameDisplay ); 54 odebug << "folder " + name + " - displayed as " + nameDisplay << oendl;
55 */ 55 */
56 prefix = aprefix; 56 prefix = aprefix;
57 57
58 if (prefix.length()>0) { 58 if (prefix.length()>0) {
59 if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) { 59 if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) {
60 nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length()); 60 nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length());
diff --git a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
index e3c75f3..df2112f 100644
--- a/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mboxwrapper.cpp
@@ -28,13 +28,13 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &ta
28 28
29 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); 29 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
30 mailfolder*folder; 30 mailfolder*folder;
31 folder = mailfolder_new( storage,(char*)p.latin1(),NULL); 31 folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
32 r = mailfolder_connect(folder); 32 r = mailfolder_connect(folder);
33 if (r != MAIL_NO_ERROR) { 33 if (r != MAIL_NO_ERROR) {
34 qDebug("Error initializing mbox"); 34 odebug << "Error initializing mbox" << oendl;
35 mailfolder_free(folder); 35 mailfolder_free(folder);
36 mailstorage_free(storage); 36 mailstorage_free(storage);
37 return; 37 return;
38 } 38 }
39 39
40 parseList(target,folder->fld_session,mailbox); 40 parseList(target,folder->fld_session,mailbox);
@@ -67,20 +67,20 @@ void MBOXwrapper::deleteMail(const RecMailP & mail)
67 p+=mail->getMbox(); 67 p+=mail->getMbox();
68 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); 68 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
69 mailfolder*folder; 69 mailfolder*folder;
70 folder = mailfolder_new( storage,(char*)p.latin1(),NULL); 70 folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
71 r = mailfolder_connect(folder); 71 r = mailfolder_connect(folder);
72 if (r != MAIL_NO_ERROR) { 72 if (r != MAIL_NO_ERROR) {
73 qDebug("Error initializing mbox"); 73 odebug << "Error initializing mbox" << oendl;
74 mailfolder_free(folder); 74 mailfolder_free(folder);
75 mailstorage_free(storage); 75 mailstorage_free(storage);
76 return; 76 return;
77 } 77 }
78 r = mailsession_remove_message(folder->fld_session,mail->getNumber()); 78 r = mailsession_remove_message(folder->fld_session,mail->getNumber());
79 if (r != MAIL_NO_ERROR) { 79 if (r != MAIL_NO_ERROR) {
80 qDebug("error deleting mail"); 80 odebug << "error deleting mail" << oendl;
81 } 81 }
82 mailfolder_free(folder); 82 mailfolder_free(folder);
83 mailstorage_free(storage); 83 mailstorage_free(storage);
84} 84}
85 85
86void MBOXwrapper::answeredMail(const RecMailP&) 86void MBOXwrapper::answeredMail(const RecMailP&)
@@ -99,27 +99,27 @@ RecBodyP MBOXwrapper::fetchBody( const RecMailP &mail )
99 99
100 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); 100 int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0);
101 mailfolder*folder; 101 mailfolder*folder;
102 folder = mailfolder_new( storage,(char*)p.latin1(),NULL); 102 folder = mailfolder_new( storage,(char*)p.latin1(),NULL);
103 r = mailfolder_connect(folder); 103 r = mailfolder_connect(folder);
104 if (r != MAIL_NO_ERROR) { 104 if (r != MAIL_NO_ERROR) {
105 qDebug("Error initializing mbox"); 105 odebug << "Error initializing mbox" << oendl;
106 mailfolder_free(folder); 106 mailfolder_free(folder);
107 mailstorage_free(storage); 107 mailstorage_free(storage);
108 return body; 108 return body;
109 } 109 }
110 r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg); 110 r = mailsession_get_message(folder->fld_session, mail->getNumber(), &msg);
111 if (r != MAIL_NO_ERROR) { 111 if (r != MAIL_NO_ERROR) {
112 qDebug("Error fetching mail %i",mail->getNumber()); 112 odebug << "Error fetching mail " << mail->getNumber() << "" << oendl;
113 mailfolder_free(folder); 113 mailfolder_free(folder);
114 mailstorage_free(storage); 114 mailstorage_free(storage);
115 return body; 115 return body;
116 } 116 }
117 r = mailmessage_fetch(msg,&data,&size); 117 r = mailmessage_fetch(msg,&data,&size);
118 if (r != MAIL_NO_ERROR) { 118 if (r != MAIL_NO_ERROR) {
119 qDebug("Error fetching mail %i",mail->getNumber()); 119 odebug << "Error fetching mail " << mail->getNumber() << "" << oendl;
120 mailfolder_free(folder); 120 mailfolder_free(folder);
121 mailstorage_free(storage); 121 mailstorage_free(storage);
122 mailmessage_free(msg); 122 mailmessage_free(msg);
123 return body; 123 return body;
124 } 124 }
125 body = parseMail(msg); 125 body = parseMail(msg);
@@ -129,13 +129,13 @@ RecBodyP MBOXwrapper::fetchBody( const RecMailP &mail )
129 129
130 return body; 130 return body;
131} 131}
132 132
133void MBOXwrapper::mbox_progress( size_t current, size_t maximum ) 133void MBOXwrapper::mbox_progress( size_t current, size_t maximum )
134{ 134{
135 qDebug("MBOX %i von %i",current,maximum); 135 odebug << "MBOX " << current << " von " << maximum << "" << oendl;
136} 136}
137 137
138int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool ) 138int MBOXwrapper::createMbox(const QString&folder,const FolderP&,const QString&,bool )
139{ 139{
140 QString p = MBOXPath+"/"; 140 QString p = MBOXPath+"/";
141 p+=folder; 141 p+=folder;
@@ -217,13 +217,13 @@ void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP>
217{ 217{
218 QString p = MBOXPath+"/"; 218 QString p = MBOXPath+"/";
219 p+=mailbox; 219 p+=mailbox;
220 mailmbox_folder*f = 0; 220 mailmbox_folder*f = 0;
221 int r = mailmbox_init(p.latin1(),0,1,0,&f); 221 int r = mailmbox_init(p.latin1(),0,1,0,&f);
222 if (r != MAIL_NO_ERROR) { 222 if (r != MAIL_NO_ERROR) {
223 qDebug("Error init folder"); 223 odebug << "Error init folder" << oendl;
224 return; 224 return;
225 } 225 }
226 deleteMails(f,target); 226 deleteMails(f,target);
227 mailmbox_done(f); 227 mailmbox_done(f);
228} 228}
229 229
@@ -232,18 +232,18 @@ void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &targ
232 if (!f) return; 232 if (!f) return;
233 int r; 233 int r;
234 QValueList<RecMailP>::ConstIterator it; 234 QValueList<RecMailP>::ConstIterator it;
235 for (it=target.begin(); it != target.end();++it) { 235 for (it=target.begin(); it != target.end();++it) {
236 r = mailmbox_delete_msg(f,(*it)->getNumber()); 236 r = mailmbox_delete_msg(f,(*it)->getNumber());
237 if (r!=MAILMBOX_NO_ERROR) { 237 if (r!=MAILMBOX_NO_ERROR) {
238 qDebug("error delete mail"); 238 odebug << "error delete mail" << oendl;
239 } 239 }
240 } 240 }
241 r = mailmbox_expunge(f); 241 r = mailmbox_expunge(f);
242 if (r != MAILMBOX_NO_ERROR) { 242 if (r != MAILMBOX_NO_ERROR) {
243 qDebug("error expunge mailbox"); 243 odebug << "error expunge mailbox" << oendl;
244 } 244 }
245} 245}
246 246
247int MBOXwrapper::deleteAllMail(const FolderP&tfolder) 247int MBOXwrapper::deleteAllMail(const FolderP&tfolder)
248{ 248{
249 if (!tfolder) return 0; 249 if (!tfolder) return 0;
@@ -266,13 +266,13 @@ int MBOXwrapper::deleteAllMail(const FolderP&tfolder)
266 res = 0; 266 res = 0;
267 } 267 }
268 } 268 }
269 if (res) { 269 if (res) {
270 r = mailsession_get_messages_list(folder->fld_session,&l); 270 r = mailsession_get_messages_list(folder->fld_session,&l);
271 if (r != MAIL_NO_ERROR) { 271 if (r != MAIL_NO_ERROR) {
272 qDebug("Error message list"); 272 odebug << "Error message list" << oendl;
273 res=0; 273 res=0;
274 } 274 }
275 } 275 }
276 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { 276 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
277 r = mailsession_remove_message(folder->fld_session,i+1); 277 r = mailsession_remove_message(folder->fld_session,i+1);
278 if (r != MAIL_NO_ERROR) { 278 if (r != MAIL_NO_ERROR) {
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 12472e9..cd7cecb 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -13,13 +13,13 @@ MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
13 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) 13 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name)
14{ 14{
15 if (MHPath.length()>0) { 15 if (MHPath.length()>0) {
16 if (MHPath[MHPath.length()-1]=='/') { 16 if (MHPath[MHPath.length()-1]=='/') {
17 MHPath=MHPath.left(MHPath.length()-1); 17 MHPath=MHPath.left(MHPath.length()-1);
18 } 18 }
19 qDebug(MHPath); 19 odebug << MHPath << oendl;
20 QDir dir(MHPath); 20 QDir dir(MHPath);
21 if (!dir.exists()) { 21 if (!dir.exists()) {
22 dir.mkdir(MHPath); 22 dir.mkdir(MHPath);
23 } 23 }
24 init_storage(); 24 init_storage();
25 } 25 }
@@ -30,21 +30,21 @@ void MHwrapper::init_storage()
30 int r; 30 int r;
31 QString pre = MHPath; 31 QString pre = MHPath;
32 if (!m_storage) { 32 if (!m_storage) {
33 m_storage = mailstorage_new(NULL); 33 m_storage = mailstorage_new(NULL);
34 r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0); 34 r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0);
35 if (r != MAIL_NO_ERROR) { 35 if (r != MAIL_NO_ERROR) {
36 qDebug("error initializing storage"); 36 odebug << "error initializing storage" << oendl;
37 mailstorage_free(m_storage); 37 mailstorage_free(m_storage);
38 m_storage = 0; 38 m_storage = 0;
39 return; 39 return;
40 } 40 }
41 } 41 }
42 r = mailstorage_connect(m_storage); 42 r = mailstorage_connect(m_storage);
43 if (r!=MAIL_NO_ERROR) { 43 if (r!=MAIL_NO_ERROR) {
44 qDebug("error connecting storage"); 44 odebug << "error connecting storage" << oendl;
45 mailstorage_free(m_storage); 45 mailstorage_free(m_storage);
46 m_storage = 0; 46 m_storage = 0;
47 } 47 }
48} 48}
49 49
50void MHwrapper::clean_storage() 50void MHwrapper::clean_storage()
@@ -67,13 +67,13 @@ void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSm
67 if (!m_storage) { 67 if (!m_storage) {
68 return; 68 return;
69 } 69 }
70 QString f = buildPath(mailbox); 70 QString f = buildPath(mailbox);
71 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 71 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
72 if (r!=MAIL_NO_ERROR) { 72 if (r!=MAIL_NO_ERROR) {
73 qDebug("listMessages: error selecting folder!"); 73 odebug << "listMessages: error selecting folder!" << oendl;
74 return; 74 return;
75 } 75 }
76 parseList(target,m_storage->sto_session,f); 76 parseList(target,m_storage->sto_session,f);
77 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); 77 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count()));
78} 78}
79 79
@@ -87,13 +87,13 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders()
87 return folders; 87 return folders;
88 } 88 }
89 mail_list*flist = 0; 89 mail_list*flist = 0;
90 clistcell*current=0; 90 clistcell*current=0;
91 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist); 91 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist);
92 if (r != MAIL_NO_ERROR || !flist) { 92 if (r != MAIL_NO_ERROR || !flist) {
93 qDebug("error getting folder list"); 93 odebug << "error getting folder list" << oendl;
94 return folders; 94 return folders;
95 } 95 }
96 for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) { 96 for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) {
97 QString t = (char*)current->data; 97 QString t = (char*)current->data;
98 t.replace(0,MHPath.length(),""); 98 t.replace(0,MHPath.length(),"");
99 folders->append(new MHFolder(t,MHPath)); 99 folders->append(new MHFolder(t,MHPath));
@@ -107,18 +107,18 @@ void MHwrapper::deleteMail(const RecMailP&mail)
107 init_storage(); 107 init_storage();
108 if (!m_storage) { 108 if (!m_storage) {
109 return; 109 return;
110 } 110 }
111 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 111 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
112 if (r!=MAIL_NO_ERROR) { 112 if (r!=MAIL_NO_ERROR) {
113 qDebug("error selecting folder!"); 113 odebug << "error selecting folder!" << oendl;
114 return; 114 return;
115 } 115 }
116 r = mailsession_remove_message(m_storage->sto_session,mail->getNumber()); 116 r = mailsession_remove_message(m_storage->sto_session,mail->getNumber());
117 if (r != MAIL_NO_ERROR) { 117 if (r != MAIL_NO_ERROR) {
118 qDebug("error deleting mail"); 118 odebug << "error deleting mail" << oendl;
119 } 119 }
120} 120}
121 121
122void MHwrapper::answeredMail(const RecMailP&) 122void MHwrapper::answeredMail(const RecMailP&)
123{ 123{
124} 124}
@@ -137,23 +137,23 @@ RecBodyP MHwrapper::fetchBody( const RecMailP &mail )
137 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 137 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
138 if (r != MAIL_NO_ERROR) { 138 if (r != MAIL_NO_ERROR) {
139 return body; 139 return body;
140 } 140 }
141 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); 141 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg);
142 if (r != MAIL_NO_ERROR) { 142 if (r != MAIL_NO_ERROR) {
143 qDebug("Error fetching mail %i",mail->getNumber()); 143 odebug << "Error fetching mail " << mail->getNumber() << "" << oendl;
144 return body; 144 return body;
145 } 145 }
146 body = parseMail(msg); 146 body = parseMail(msg);
147 mailmessage_fetch_result_free(msg,data); 147 mailmessage_fetch_result_free(msg,data);
148 return body; 148 return body;
149} 149}
150 150
151void MHwrapper::mbox_progress( size_t current, size_t maximum ) 151void MHwrapper::mbox_progress( size_t current, size_t maximum )
152{ 152{
153 qDebug("MH %i von %i",current,maximum); 153 odebug << "MH " << current << " von " << maximum << "" << oendl;
154} 154}
155 155
156QString MHwrapper::buildPath(const QString&p) 156QString MHwrapper::buildPath(const QString&p)
157{ 157{
158 QString f=""; 158 QString f="";
159 if (p.length()==0||p=="/") 159 if (p.length()==0||p=="/")
@@ -180,37 +180,37 @@ int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QStri
180 f = buildPath(folder); 180 f = buildPath(folder);
181 } else { 181 } else {
182 f = pfolder->getName(); 182 f = pfolder->getName();
183 f+="/"; 183 f+="/";
184 f+=folder; 184 f+=folder;
185 } 185 }
186 qDebug(f); 186 odebug << f << oendl;
187 int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1()); 187 int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1());
188 if (r != MAIL_NO_ERROR) { 188 if (r != MAIL_NO_ERROR) {
189 qDebug("error creating folder %i",r); 189 odebug << "error creating folder " << r << "" << oendl;
190 return 0; 190 return 0;
191 } 191 }
192 qDebug("Folder created"); 192 odebug << "Folder created" << oendl;
193 return 1; 193 return 1;
194} 194}
195 195
196void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) 196void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder)
197{ 197{
198 init_storage(); 198 init_storage();
199 if (!m_storage) { 199 if (!m_storage) {
200 return; 200 return;
201 } 201 }
202 QString f = buildPath(Folder); 202 QString f = buildPath(Folder);
203 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 203 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
204 if (r!=MAIL_NO_ERROR) { 204 if (r!=MAIL_NO_ERROR) {
205 qDebug("error selecting folder!"); 205 odebug << "error selecting folder!" << oendl;
206 return; 206 return;
207 } 207 }
208 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); 208 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length);
209 if (r!=MAIL_NO_ERROR) { 209 if (r!=MAIL_NO_ERROR) {
210 qDebug("error storing mail"); 210 odebug << "error storing mail" << oendl;
211 } 211 }
212 return; 212 return;
213} 213}
214 214
215encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) 215encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
216{ 216{
@@ -221,13 +221,13 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
221 } 221 }
222 mailmessage * msg = 0; 222 mailmessage * msg = 0;
223 char*data=0; 223 char*data=0;
224 size_t size; 224 size_t size;
225 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 225 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
226 if (r!=MAIL_NO_ERROR) { 226 if (r!=MAIL_NO_ERROR) {
227 qDebug("error selecting folder!"); 227 odebug << "error selecting folder!" << oendl;
228 return result; 228 return result;
229 } 229 }
230 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); 230 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg);
231 if (r != MAIL_NO_ERROR) { 231 if (r != MAIL_NO_ERROR) {
232 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); 232 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber()));
233 return 0; 233 return 0;
@@ -245,20 +245,20 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
245 245
246void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) 246void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target)
247{ 247{
248 QString f = buildPath(mailbox); 248 QString f = buildPath(mailbox);
249 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 249 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
250 if (r!=MAIL_NO_ERROR) { 250 if (r!=MAIL_NO_ERROR) {
251 qDebug("deleteMails: error selecting folder!"); 251 odebug << "deleteMails: error selecting folder!" << oendl;
252 return; 252 return;
253 } 253 }
254 QValueList<RecMailP>::ConstIterator it; 254 QValueList<RecMailP>::ConstIterator it;
255 for (it=target.begin(); it!=target.end();++it) { 255 for (it=target.begin(); it!=target.end();++it) {
256 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); 256 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber());
257 if (r != MAIL_NO_ERROR) { 257 if (r != MAIL_NO_ERROR) {
258 qDebug("error deleting mail"); 258 odebug << "error deleting mail" << oendl;
259 break; 259 break;
260 } 260 }
261 } 261 }
262} 262}
263 263
264int MHwrapper::deleteAllMail(const FolderP&tfolder) 264int MHwrapper::deleteAllMail(const FolderP&tfolder)
@@ -268,19 +268,19 @@ int MHwrapper::deleteAllMail(const FolderP&tfolder)
268 return 0; 268 return 0;
269 } 269 }
270 int res = 1; 270 int res = 1;
271 if (!tfolder) return 0; 271 if (!tfolder) return 0;
272 int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); 272 int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
273 if (r!=MAIL_NO_ERROR) { 273 if (r!=MAIL_NO_ERROR) {
274 qDebug("error selecting folder!"); 274 odebug << "error selecting folder!" << oendl;
275 return 0; 275 return 0;
276 } 276 }
277 mailmessage_list*l=0; 277 mailmessage_list*l=0;
278 r = mailsession_get_messages_list(m_storage->sto_session,&l); 278 r = mailsession_get_messages_list(m_storage->sto_session,&l);
279 if (r != MAIL_NO_ERROR) { 279 if (r != MAIL_NO_ERROR) {
280 qDebug("Error message list"); 280 odebug << "Error message list" << oendl;
281 res = 0; 281 res = 0;
282 } 282 }
283 unsigned j = 0; 283 unsigned j = 0;
284 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { 284 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
285 mailmessage * msg; 285 mailmessage * msg;
286 msg = (mailmessage*)carray_get(l->msg_tab, i); 286 msg = (mailmessage*)carray_get(l->msg_tab, i);
@@ -305,13 +305,13 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
305 if (!tfolder) return 0; 305 if (!tfolder) return 0;
306 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; 306 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0;
307 307
308 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); 308 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
309 309
310 if (r != MAIL_NO_ERROR) { 310 if (r != MAIL_NO_ERROR) {
311 qDebug("error deleting mail box"); 311 odebug << "error deleting mail box" << oendl;
312 return 0; 312 return 0;
313 } 313 }
314 QString cmd = "rm -rf "+tfolder->getName(); 314 QString cmd = "rm -rf "+tfolder->getName();
315 QStringList command; 315 QStringList command;
316 command << "/bin/sh"; 316 command << "/bin/sh";
317 command << "-c"; 317 command << "-c";
@@ -323,16 +323,16 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
323 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), 323 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
324 this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); 324 this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
325 325
326 *process << command; 326 *process << command;
327 removeMboxfailed = false; 327 removeMboxfailed = false;
328 if(!process->start(OProcess::Block, OProcess::All) ) { 328 if(!process->start(OProcess::Block, OProcess::All) ) {
329 qDebug("could not start process"); 329 odebug << "could not start process" << oendl;
330 return 0; 330 return 0;
331 } 331 }
332 qDebug("mail box deleted"); 332 odebug << "mail box deleted" << oendl;
333 return 1; 333 return 1;
334} 334}
335 335
336void MHwrapper::processEnded(OProcess *p) 336void MHwrapper::processEnded(OProcess *p)
337{ 337{
338 if (p) delete p; 338 if (p) delete p;
@@ -375,68 +375,68 @@ void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstract
375{ 375{
376 init_storage(); 376 init_storage();
377 if (!m_storage) { 377 if (!m_storage) {
378 return; 378 return;
379 } 379 }
380 if (targetWrapper != this) { 380 if (targetWrapper != this) {
381 qDebug("Using generic"); 381 odebug << "Using generic" << oendl;
382 Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit); 382 Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit);
383 return; 383 return;
384 } 384 }
385 qDebug("Using internal routines for move/copy"); 385 odebug << "Using internal routines for move/copy" << oendl;
386 QString tf = buildPath(targetFolder); 386 QString tf = buildPath(targetFolder);
387 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 387 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
388 if (r != MAIL_NO_ERROR) { 388 if (r != MAIL_NO_ERROR) {
389 qDebug("Error selecting source mailbox"); 389 odebug << "Error selecting source mailbox" << oendl;
390 return; 390 return;
391 } 391 }
392 if (moveit) { 392 if (moveit) {
393 r = mailsession_move_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); 393 r = mailsession_move_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1());
394 } else { 394 } else {
395 r = mailsession_copy_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); 395 r = mailsession_copy_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1());
396 } 396 }
397 if (r != MAIL_NO_ERROR) { 397 if (r != MAIL_NO_ERROR) {
398 qDebug("Error copy/moving mail internal (%i)",r); 398 odebug << "Error copy/moving mail internal (" << r << ")" << oendl;
399 } 399 }
400} 400}
401 401
402void MHwrapper::mvcpAllMails(const FolderP&fromFolder, 402void MHwrapper::mvcpAllMails(const FolderP&fromFolder,
403 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 403 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
404{ 404{
405 init_storage(); 405 init_storage();
406 if (!m_storage) { 406 if (!m_storage) {
407 return; 407 return;
408 } 408 }
409 if (targetWrapper != this) { 409 if (targetWrapper != this) {
410 qDebug("Using generic"); 410 odebug << "Using generic" << oendl;
411 Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); 411 Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit);
412 return; 412 return;
413 } 413 }
414 if (!fromFolder) return; 414 if (!fromFolder) return;
415 int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1()); 415 int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1());
416 if (r!=MAIL_NO_ERROR) { 416 if (r!=MAIL_NO_ERROR) {
417 qDebug("error selecting source folder!"); 417 odebug << "error selecting source folder!" << oendl;
418 return; 418 return;
419 } 419 }
420 QString tf = buildPath(targetFolder); 420 QString tf = buildPath(targetFolder);
421 mailmessage_list*l=0; 421 mailmessage_list*l=0;
422 r = mailsession_get_messages_list(m_storage->sto_session,&l); 422 r = mailsession_get_messages_list(m_storage->sto_session,&l);
423 if (r != MAIL_NO_ERROR) { 423 if (r != MAIL_NO_ERROR) {
424 qDebug("Error message list"); 424 odebug << "Error message list" << oendl;
425 } 425 }
426 unsigned j = 0; 426 unsigned j = 0;
427 for(unsigned int i = 0 ; l!= 0 && i < carray_count(l->msg_tab) ; ++i) { 427 for(unsigned int i = 0 ; l!= 0 && i < carray_count(l->msg_tab) ; ++i) {
428 mailmessage * msg; 428 mailmessage * msg;
429 msg = (mailmessage*)carray_get(l->msg_tab, i); 429 msg = (mailmessage*)carray_get(l->msg_tab, i);
430 j = msg->msg_index; 430 j = msg->msg_index;
431 if (moveit) { 431 if (moveit) {
432 r = mailsession_move_message(m_storage->sto_session,j,(char*)tf.latin1()); 432 r = mailsession_move_message(m_storage->sto_session,j,(char*)tf.latin1());
433 } else { 433 } else {
434 r = mailsession_copy_message(m_storage->sto_session,j,(char*)tf.latin1()); 434 r = mailsession_copy_message(m_storage->sto_session,j,(char*)tf.latin1());
435 } 435 }
436 if (r != MAIL_NO_ERROR) { 436 if (r != MAIL_NO_ERROR) {
437 qDebug("Error copy/moving mail internal (%i)",r); 437 odebug << "Error copy/moving mail internal (" << r << ")" << oendl;
438 break; 438 break;
439 } 439 }
440 } 440 }
441 if (l) mailmessage_list_free(l); 441 if (l) mailmessage_list_free(l);
442} 442}
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
index cfded43..5d5011a 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
@@ -26,13 +26,13 @@ NNTPwrapper::~NNTPwrapper() {
26 if (msg_cache.exists()) { 26 if (msg_cache.exists()) {
27 msg_cache.remove(); 27 msg_cache.remove();
28 } 28 }
29} 29}
30 30
31void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) { 31void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) {
32 qDebug( "NNTP: %i of %i", current, maximum ); 32 odebug << "NNTP: " << current << " of " << maximum << "" << oendl;
33} 33}
34 34
35 35
36RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { 36RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) {
37 int err = NEWSNNTP_NO_ERROR; 37 int err = NEWSNNTP_NO_ERROR;
38 char *message = 0; 38 char *message = 0;
@@ -43,13 +43,13 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) {
43 if ( !m_nntp ) { 43 if ( !m_nntp ) {
44 return body; 44 return body;
45 } 45 }
46 46
47 mailmessage * mailmsg; 47 mailmessage * mailmsg;
48 if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { 48 if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) {
49 qDebug("Message to large: %i",mail->Msgsize()); 49 odebug << "Message to large: " << mail->Msgsize() << "" << oendl;
50 return body; 50 return body;
51 } 51 }
52 52
53 QFile msg_cache(msgTempName); 53 QFile msg_cache(msgTempName);
54 54
55 cleanMimeCache(); 55 cleanMimeCache();
@@ -131,13 +131,13 @@ void NNTPwrapper::login()
131 if ( QDialog::Accepted == login.exec() ) { 131 if ( QDialog::Accepted == login.exec() ) {
132 // ok 132 // ok
133 User = login.getUser().latin1(); 133 User = login.getUser().latin1();
134 Pass = login.getPassword().latin1(); 134 Pass = login.getPassword().latin1();
135 } else { 135 } else {
136 // cancel 136 // cancel
137 qDebug( "NNTP: Login canceled" ); 137 odebug << "NNTP: Login canceled" << oendl;
138 return; 138 return;
139 } 139 }
140 } else { 140 } else {
141 User = account->getUser().latin1(); 141 User = account->getUser().latin1();
142 Pass = account->getPassword().latin1(); 142 Pass = account->getPassword().latin1();
143 } 143 }
@@ -168,13 +168,13 @@ void NNTPwrapper::login()
168 nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN, 168 nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, CONNECTION_TYPE_PLAIN, NNTP_AUTH_TYPE_PLAIN,
169 (char*)user,(char*)pass,0,0,0); 169 (char*)user,(char*)pass,0,0,0);
170 170
171 err = mailstorage_connect( m_nntp ); 171 err = mailstorage_connect( m_nntp );
172 172
173 if (err != NEWSNNTP_NO_ERROR) { 173 if (err != NEWSNNTP_NO_ERROR) {
174 qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); 174 odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl;
175 // Global::statusMessage(tr("Error initializing folder")); 175 // Global::statusMessage(tr("Error initializing folder"));
176 mailstorage_free(m_nntp); 176 mailstorage_free(m_nntp);
177 m_nntp = 0; 177 m_nntp = 0;
178 178
179 } else { 179 } else {
180 mailsession * session = m_nntp->sto_session; 180 mailsession * session = m_nntp->sto_session;
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index 5467547..c586c29 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -25,13 +25,13 @@ POP3wrapper::~POP3wrapper() {
25 if (msg_cache.exists()) { 25 if (msg_cache.exists()) {
26 msg_cache.remove(); 26 msg_cache.remove();
27 } 27 }
28} 28}
29 29
30void POP3wrapper::pop3_progress( size_t current, size_t maximum ) { 30void POP3wrapper::pop3_progress( size_t current, size_t maximum ) {
31 qDebug( "POP3: %i of %i", current, maximum ); 31 odebug << "POP3: " << current << " of " << maximum << "" << oendl;
32} 32}
33 33
34RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { 34RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) {
35 int err = MAILPOP3_NO_ERROR; 35 int err = MAILPOP3_NO_ERROR;
36 char *message = 0; 36 char *message = 0;
37 size_t length = 0; 37 size_t length = 0;
@@ -42,13 +42,13 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) {
42 if ( !m_pop3 ) { 42 if ( !m_pop3 ) {
43 return body; 43 return body;
44 } 44 }
45 45
46 mailmessage * mailmsg; 46 mailmessage * mailmsg;
47 if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { 47 if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) {
48 qDebug("Message to large: %i",mail->Msgsize()); 48 odebug << "Message to large: " << mail->Msgsize() << "" << oendl;
49 return body; 49 return body;
50 } 50 }
51 51
52 QFile msg_cache(msgTempName); 52 QFile msg_cache(msgTempName);
53 53
54 cleanMimeCache(); 54 cleanMimeCache();
@@ -127,13 +127,13 @@ void POP3wrapper::login()
127 if ( QDialog::Accepted == login.exec() ) { 127 if ( QDialog::Accepted == login.exec() ) {
128 // ok 128 // ok
129 user = login.getUser().latin1(); 129 user = login.getUser().latin1();
130 pass = login.getPassword().latin1(); 130 pass = login.getPassword().latin1();
131 } else { 131 } else {
132 // cancel 132 // cancel
133 qDebug( "POP3: Login canceled" ); 133 odebug << "POP3: Login canceled" << oendl;
134 return; 134 return;
135 } 135 }
136 } else { 136 } else {
137 user = account->getUser().latin1(); 137 user = account->getUser().latin1();
138 pass = account->getPassword().latin1(); 138 pass = account->getPassword().latin1();
139 } 139 }
@@ -159,13 +159,13 @@ void POP3wrapper::login()
159 pop3_mailstorage_init(m_pop3,(char*)server, port, NULL, conntype, POP3_AUTH_TYPE_PLAIN, 159 pop3_mailstorage_init(m_pop3,(char*)server, port, NULL, conntype, POP3_AUTH_TYPE_PLAIN,
160 (char*)user,(char*)pass,0,0,0); 160 (char*)user,(char*)pass,0,0,0);
161 161
162 162
163 err = mailstorage_connect(m_pop3); 163 err = mailstorage_connect(m_pop3);
164 if (err != MAIL_NO_ERROR) { 164 if (err != MAIL_NO_ERROR) {
165 qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); 165 odebug << QString( "FEHLERNUMMER %1" ).arg( err ) << oendl;
166 Global::statusMessage(tr("Error initializing folder")); 166 Global::statusMessage(tr("Error initializing folder"));
167 mailstorage_free(m_pop3); 167 mailstorage_free(m_pop3);
168 m_pop3 = 0; 168 m_pop3 = 0;
169 } else { 169 } else {
170 mailsession * session = m_pop3->sto_session; 170 mailsession * session = m_pop3->sto_session;
171 mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session; 171 mailpop3 * mail = ( ( pop3_session_state_data * )session->sess_data )->pop3_session;
@@ -233,13 +233,13 @@ void POP3wrapper::statusFolder(folderStat&target_stat,const QString&) {
233 target_stat.message_recent = 0; 233 target_stat.message_recent = 0;
234 if (!m_pop3) 234 if (!m_pop3)
235 return; 235 return;
236 int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count, 236 int r = mailsession_status_folder(m_pop3->sto_session,0,&target_stat.message_count,
237 &target_stat.message_recent,&target_stat.message_unseen); 237 &target_stat.message_recent,&target_stat.message_unseen);
238 if (r != MAIL_NO_ERROR) { 238 if (r != MAIL_NO_ERROR) {
239 qDebug("error getting folter status."); 239 odebug << "error getting folter status." << oendl;
240 } 240 }
241} 241}
242 242
243encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) { 243encodedString* POP3wrapper::fetchRawBody(const RecMailP&mail) {
244 char*target=0; 244 char*target=0;
245 size_t length=0; 245 size_t length=0;
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp
index 2c81963..de36eeb 100644
--- a/noncore/net/mail/libmailwrapper/settings.cpp
+++ b/noncore/net/mail/libmailwrapper/settings.cpp
@@ -23,13 +23,13 @@ Settings::Settings()
23} 23}
24 24
25void Settings::checkDirectory() 25void Settings::checkDirectory()
26{ 26{
27 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { 27 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) {
28 system( "mkdir -p $HOME/Applications/opiemail" ); 28 system( "mkdir -p $HOME/Applications/opiemail" );
29 qDebug( "$HOME/Applications/opiemail created" ); 29 odebug << "$HOME/Applications/opiemail created" << oendl;
30 } 30 }
31} 31}
32 32
33QList<Account> Settings::getAccounts() 33QList<Account> Settings::getAccounts()
34{ 34{
35 return accounts; 35 return accounts;
@@ -51,34 +51,34 @@ void Settings::updateAccounts()
51 accounts.clear(); 51 accounts.clear();
52 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 52 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
53 QStringList::Iterator it; 53 QStringList::Iterator it;
54 54
55 QStringList imap = dir.entryList( "imap-*" ); 55 QStringList imap = dir.entryList( "imap-*" );
56 for ( it = imap.begin(); it != imap.end(); it++ ) { 56 for ( it = imap.begin(); it != imap.end(); it++ ) {
57 qDebug( "Added IMAP account" ); 57 odebug << "Added IMAP account" << oendl;
58 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); 58 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") );
59 accounts.append( account ); 59 accounts.append( account );
60 } 60 }
61 61
62 QStringList pop3 = dir.entryList( "pop3-*" ); 62 QStringList pop3 = dir.entryList( "pop3-*" );
63 for ( it = pop3.begin(); it != pop3.end(); it++ ) { 63 for ( it = pop3.begin(); it != pop3.end(); it++ ) {
64 qDebug( "Added POP account" ); 64 odebug << "Added POP account" << oendl;
65 POP3account *account = new POP3account( (*it).replace(0, 5, "") ); 65 POP3account *account = new POP3account( (*it).replace(0, 5, "") );
66 accounts.append( account ); 66 accounts.append( account );
67 } 67 }
68 68
69 QStringList smtp = dir.entryList( "smtp-*" ); 69 QStringList smtp = dir.entryList( "smtp-*" );
70 for ( it = smtp.begin(); it != smtp.end(); it++ ) { 70 for ( it = smtp.begin(); it != smtp.end(); it++ ) {
71 qDebug( "Added SMTP account" ); 71 odebug << "Added SMTP account" << oendl;
72 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") ); 72 SMTPaccount *account = new SMTPaccount( (*it).replace(0, 5, "") );
73 accounts.append( account ); 73 accounts.append( account );
74 } 74 }
75 75
76 QStringList nntp = dir.entryList( "nntp-*" ); 76 QStringList nntp = dir.entryList( "nntp-*" );
77 for ( it = nntp.begin(); it != nntp.end(); it++ ) { 77 for ( it = nntp.begin(); it != nntp.end(); it++ ) {
78 qDebug( "Added NNTP account" ); 78 odebug << "Added NNTP account" << oendl;
79 NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") ); 79 NNTPaccount *account = new NNTPaccount( (*it).replace(0, 5, "") );
80 accounts.append( account ); 80 accounts.append( account );
81 } 81 }
82 82
83 readAccounts(); 83 readAccounts();
84} 84}
@@ -176,13 +176,13 @@ void IMAPaccount::read()
176 offline = conf->readBoolEntry("Offline",false); 176 offline = conf->readBoolEntry("Offline",false);
177 delete conf; 177 delete conf;
178} 178}
179 179
180void IMAPaccount::save() 180void IMAPaccount::save()
181{ 181{
182 qDebug( "saving " + getFileName() ); 182 odebug << "saving " + getFileName() << oendl;
183 Settings::checkDirectory(); 183 Settings::checkDirectory();
184 184
185 Config *conf = new Config( getFileName(), Config::File ); 185 Config *conf = new Config( getFileName(), Config::File );
186 conf->setGroup( "IMAP Account" ); 186 conf->setGroup( "IMAP Account" );
187 conf->writeEntry( "Account", accountName ); 187 conf->writeEntry( "Account", accountName );
188 conf->writeEntry( "Server", server ); 188 conf->writeEntry( "Server", server );
@@ -254,13 +254,13 @@ void POP3account::read()
254 offline = conf->readBoolEntry("Offline",false); 254 offline = conf->readBoolEntry("Offline",false);
255 delete conf; 255 delete conf;
256} 256}
257 257
258void POP3account::save() 258void POP3account::save()
259{ 259{
260 qDebug( "saving " + getFileName() ); 260 odebug << "saving " + getFileName() << oendl;
261 Settings::checkDirectory(); 261 Settings::checkDirectory();
262 262
263 Config *conf = new Config( getFileName(), Config::File ); 263 Config *conf = new Config( getFileName(), Config::File );
264 conf->setGroup( "POP3 Account" ); 264 conf->setGroup( "POP3 Account" );
265 conf->writeEntry( "Account", accountName ); 265 conf->writeEntry( "Account", accountName );
266 conf->writeEntry( "Server", server ); 266 conf->writeEntry( "Server", server );
@@ -336,13 +336,13 @@ void SMTPaccount::read()
336 password = conf->readEntryCrypt( "Password" ); 336 password = conf->readEntryCrypt( "Password" );
337 delete conf; 337 delete conf;
338} 338}
339 339
340void SMTPaccount::save() 340void SMTPaccount::save()
341{ 341{
342 qDebug( "saving " + getFileName() ); 342 odebug << "saving " + getFileName() << oendl;
343 Settings::checkDirectory(); 343 Settings::checkDirectory();
344 344
345 Config *conf = new Config( getFileName(), Config::File ); 345 Config *conf = new Config( getFileName(), Config::File );
346 conf->setGroup( "SMTP Account" ); 346 conf->setGroup( "SMTP Account" );
347 conf->writeEntry( "Account", accountName ); 347 conf->writeEntry( "Account", accountName );
348 conf->writeEntry( "Server", server ); 348 conf->writeEntry( "Server", server );
@@ -413,13 +413,13 @@ void NNTPaccount::read()
413 subscribedGroups = conf->readListEntry( "Subscribed", ',' ); 413 subscribedGroups = conf->readListEntry( "Subscribed", ',' );
414 delete conf; 414 delete conf;
415} 415}
416 416
417void NNTPaccount::save() 417void NNTPaccount::save()
418{ 418{
419 qDebug( "saving " + getFileName() ); 419 odebug << "saving " + getFileName() << oendl;
420 Settings::checkDirectory(); 420 Settings::checkDirectory();
421 421
422 Config *conf = new Config( getFileName(), Config::File ); 422 Config *conf = new Config( getFileName(), Config::File );
423 conf->setGroup( "NNTP Account" ); 423 conf->setGroup( "NNTP Account" );
424 conf->writeEntry( "Account", accountName ); 424 conf->writeEntry( "Account", accountName );
425 conf->writeEntry( "Server", server ); 425 conf->writeEntry( "Server", server );
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index e2cea7a..ba78c3b 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -112,13 +112,13 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later) {
112 int r = mailmessage_fetch(msg,&data,&size); 112 int r = mailmessage_fetch(msg,&data,&size);
113 mime_message_detach_mime(msg); 113 mime_message_detach_mime(msg);
114 mailmessage_free(msg); 114 mailmessage_free(msg);
115 if (r != MAIL_NO_ERROR || !data) { 115 if (r != MAIL_NO_ERROR || !data) {
116 if (data) 116 if (data)
117 free(data); 117 free(data);
118 qDebug("Error fetching mime..."); 118 odebug << "Error fetching mime..." << oendl;
119 return; 119 return;
120 } 120 }
121 msg = 0; 121 msg = 0;
122 if (later) { 122 if (later) {
123 storeMail(data,size,"Outgoing"); 123 storeMail(data,size,"Outgoing");
124 if (data) 124 if (data)
@@ -205,22 +205,22 @@ void SMTPwrapper::connect_server()
205 /* no failure message cause this happens when problems with memory - than we 205 /* no failure message cause this happens when problems with memory - than we
206 we can not display any messagebox */ 206 we can not display any messagebox */
207 return; 207 return;
208 } 208 }
209 209
210 int err = MAILSMTP_NO_ERROR; 210 int err = MAILSMTP_NO_ERROR;
211 qDebug( "Servername %s at port %i", server, port ); 211 odebug << "Servername " << server << " at port " << port << "" << oendl;
212 if ( ssl ) { 212 if ( ssl ) {
213 qDebug( "SSL session" ); 213 odebug << "SSL session" << oendl;
214 err = mailsmtp_ssl_connect( m_smtp, server, port ); 214 err = mailsmtp_ssl_connect( m_smtp, server, port );
215 } else { 215 } else {
216 qDebug( "No SSL session" ); 216 odebug << "No SSL session" << oendl;
217 err = mailsmtp_socket_connect( m_smtp, server, port ); 217 err = mailsmtp_socket_connect( m_smtp, server, port );
218 } 218 }
219 if ( err != MAILSMTP_NO_ERROR ) { 219 if ( err != MAILSMTP_NO_ERROR ) {
220 qDebug("Error init connection"); 220 odebug << "Error init connection" << oendl;
221 failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err)); 221 failuretext = tr("Error init SMTP connection: %1").arg(mailsmtpError(err));
222 result = 0; 222 result = 0;
223 } 223 }
224 224
225 /* switch to tls after init 'cause there it will send the ehlo */ 225 /* switch to tls after init 'cause there it will send the ehlo */
226 if (result) { 226 if (result) {
@@ -243,13 +243,13 @@ void SMTPwrapper::connect_server()
243 if (!try_tls && force_tls) { 243 if (!try_tls && force_tls) {
244 result = 0; 244 result = 0;
245 failuretext = tr("Error init SMTP tls: %1").arg(mailsmtpError(err)); 245 failuretext = tr("Error init SMTP tls: %1").arg(mailsmtpError(err));
246 } 246 }
247 247
248 if (result==1 && m_SmtpAccount->getLogin() ) { 248 if (result==1 && m_SmtpAccount->getLogin() ) {
249 qDebug("smtp with auth"); 249 odebug << "smtp with auth" << oendl;
250 if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) { 250 if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) {
251 // get'em 251 // get'em
252 LoginDialog login( m_SmtpAccount->getUser(), 252 LoginDialog login( m_SmtpAccount->getUser(),
253 m_SmtpAccount->getPassword(), NULL, 0, true ); 253 m_SmtpAccount->getPassword(), NULL, 0, true );
254 login.show(); 254 login.show();
255 if ( QDialog::Accepted == login.exec() ) { 255 if ( QDialog::Accepted == login.exec() ) {
@@ -261,17 +261,17 @@ void SMTPwrapper::connect_server()
261 failuretext=tr("Login aborted - storing mail to localfolder"); 261 failuretext=tr("Login aborted - storing mail to localfolder");
262 } 262 }
263 } else { 263 } else {
264 user = m_SmtpAccount->getUser().latin1(); 264 user = m_SmtpAccount->getUser().latin1();
265 pass = m_SmtpAccount->getPassword().latin1(); 265 pass = m_SmtpAccount->getPassword().latin1();
266 } 266 }
267 qDebug( "session->auth: %i", m_smtp->auth); 267 odebug << "session->auth: " << m_smtp->auth << "" << oendl;
268 if (result) { 268 if (result) {
269 err = mailsmtp_auth( m_smtp, (char*)user, (char*)pass ); 269 err = mailsmtp_auth( m_smtp, (char*)user, (char*)pass );
270 if ( err == MAILSMTP_NO_ERROR ) { 270 if ( err == MAILSMTP_NO_ERROR ) {
271 qDebug("auth ok"); 271 odebug << "auth ok" << oendl;
272 } else { 272 } else {
273 failuretext = tr("Authentification failed"); 273 failuretext = tr("Authentification failed");
274 result = 0; 274 result = 0;
275 } 275 }
276 } 276 }
277 } 277 }
@@ -304,31 +304,31 @@ int SMTPwrapper::smtpSend(char*from,clist*rcpts,const char*data,size_t size )
304 result = 0; 304 result = 0;
305 } 305 }
306 306
307 if (!result) { 307 if (!result) {
308 storeFailedMail(data,size,failuretext); 308 storeFailedMail(data,size,failuretext);
309 } else { 309 } else {
310 qDebug( "Mail sent." ); 310 odebug << "Mail sent." << oendl;
311 storeMail(data,size,"Sent"); 311 storeMail(data,size,"Sent");
312 } 312 }
313 return result; 313 return result;
314} 314}
315 315
316void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later ) 316void SMTPwrapper::sendMail(const Opie::Core::OSmartPointer<Mail>&mail,bool later )
317{ 317{
318 mailmime * mimeMail; 318 mailmime * mimeMail;
319 319
320 mimeMail = createMimeMail(mail ); 320 mimeMail = createMimeMail(mail );
321 if ( mimeMail == NULL ) { 321 if ( mimeMail == NULL ) {
322 qDebug( "sendMail: error creating mime mail" ); 322 odebug << "sendMail: error creating mime mail" << oendl;
323 } else { 323 } else {
324 sendProgress = new progressMailSend(); 324 sendProgress = new progressMailSend();
325 sendProgress->show(); 325 sendProgress->show();
326 sendProgress->setMaxMails(1); 326 sendProgress->setMaxMails(1);
327 smtpSend( mimeMail,later); 327 smtpSend( mimeMail,later);
328 qDebug("Clean up done"); 328 odebug << "Clean up done" << oendl;
329 sendProgress->hide(); 329 sendProgress->hide();
330 delete sendProgress; 330 delete sendProgress;
331 sendProgress = 0; 331 sendProgress = 0;
332 mailmime_free( mimeMail ); 332 mailmime_free( mimeMail );
333 } 333 }
334} 334}
@@ -375,33 +375,33 @@ int SMTPwrapper::sendQueuedMail(AbstractMail*wrap,const RecMailP&which) {
375} 375}
376 376
377/* this is a special fun */ 377/* this is a special fun */
378bool SMTPwrapper::flushOutbox() { 378bool SMTPwrapper::flushOutbox() {
379 bool returnValue = true; 379 bool returnValue = true;
380 380
381 qDebug("Sending the queue"); 381 odebug << "Sending the queue" << oendl;
382 if (!m_SmtpAccount) { 382 if (!m_SmtpAccount) {
383 qDebug("No smtp account given"); 383 odebug << "No smtp account given" << oendl;
384 return false; 384 return false;
385 } 385 }
386 386
387 bool reset_user_value = false; 387 bool reset_user_value = false;
388 QString localfolders = AbstractMail::defaultLocalfolder(); 388 QString localfolders = AbstractMail::defaultLocalfolder();
389 AbstractMail*wrap = AbstractMail::getWrapper(localfolders); 389 AbstractMail*wrap = AbstractMail::getWrapper(localfolders);
390 if (!wrap) { 390 if (!wrap) {
391 qDebug("memory error"); 391 odebug << "memory error" << oendl;
392 return false; 392 return false;
393 } 393 }
394 QString oldPw, oldUser; 394 QString oldPw, oldUser;
395 QValueList<RecMailP> mailsToSend; 395 QValueList<RecMailP> mailsToSend;
396 QValueList<RecMailP> mailsToRemove; 396 QValueList<RecMailP> mailsToRemove;
397 QString mbox("Outgoing"); 397 QString mbox("Outgoing");
398 wrap->listMessages(mbox,mailsToSend); 398 wrap->listMessages(mbox,mailsToSend);
399 if (mailsToSend.count()==0) { 399 if (mailsToSend.count()==0) {
400 delete wrap; 400 delete wrap;
401 qDebug("No mails to send"); 401 odebug << "No mails to send" << oendl;
402 return false; 402 return false;
403 } 403 }
404 404
405 oldPw = m_SmtpAccount->getPassword(); 405 oldPw = m_SmtpAccount->getPassword();
406 oldUser = m_SmtpAccount->getUser(); 406 oldUser = m_SmtpAccount->getUser();
407 if (m_SmtpAccount->getLogin() && (m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty()) ) { 407 if (m_SmtpAccount->getLogin() && (m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty()) ) {
diff --git a/noncore/net/mail/libmailwrapper/statusmail.cpp b/noncore/net/mail/libmailwrapper/statusmail.cpp
index b78244d..51383f6 100644
--- a/noncore/net/mail/libmailwrapper/statusmail.cpp
+++ b/noncore/net/mail/libmailwrapper/statusmail.cpp
@@ -40,13 +40,13 @@ void StatusMail::initAccounts(QList<Account>&accounts)
40 connectionList.append(current); 40 connectionList.append(current);
41 current->statusFolder(currentStat); 41 current->statusFolder(currentStat);
42 currentPop3Stat.message_count+=currentStat.message_count; 42 currentPop3Stat.message_count+=currentStat.message_count;
43 } 43 }
44 current->logout(); 44 current->logout();
45 } 45 }
46 qDebug("Pop3 init count: %i",currentPop3Stat.message_count); 46 odebug << "Pop3 init count: " << currentPop3Stat.message_count << "" << oendl;
47 currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; 47 currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0;
48 lastPop3Stat.message_unseen = currentPop3Stat.message_unseen; 48 lastPop3Stat.message_unseen = currentPop3Stat.message_unseen;
49 lastPop3Stat.message_recent = currentPop3Stat.message_recent; 49 lastPop3Stat.message_recent = currentPop3Stat.message_recent;
50 lastPop3Stat.message_count = currentPop3Stat.message_count; 50 lastPop3Stat.message_count = currentPop3Stat.message_count;
51} 51}
52 52
@@ -69,16 +69,16 @@ void StatusMail::check_current_stat(folderStat&targetStat)
69 if (it->getType() == MAILLIB::A_IMAP) { 69 if (it->getType() == MAILLIB::A_IMAP) {
70 currentImapStat.message_unseen+=currentStat.message_unseen; 70 currentImapStat.message_unseen+=currentStat.message_unseen;
71 currentImapStat.message_recent+=currentStat.message_recent; 71 currentImapStat.message_recent+=currentStat.message_recent;
72 currentImapStat.message_count+=currentStat.message_count; 72 currentImapStat.message_count+=currentStat.message_count;
73 } else if (it->getType() == MAILLIB::A_POP3) { 73 } else if (it->getType() == MAILLIB::A_POP3) {
74 currentPop3Stat.message_count+=currentStat.message_count; 74 currentPop3Stat.message_count+=currentStat.message_count;
75 qDebug("Pop3 count: %i",currentPop3Stat.message_count); 75 odebug << "Pop3 count: " << currentPop3Stat.message_count << "" << oendl;
76 } 76 }
77 } 77 }
78 qDebug("Pop3 last: %i",lastPop3Stat.message_count); 78 odebug << "Pop3 last: " << lastPop3Stat.message_count << "" << oendl;
79 if (currentPop3Stat.message_count > lastPop3Stat.message_count) { 79 if (currentPop3Stat.message_count > lastPop3Stat.message_count) {
80 currentPop3Stat.message_recent = currentPop3Stat.message_count - lastPop3Stat.message_count; 80 currentPop3Stat.message_recent = currentPop3Stat.message_count - lastPop3Stat.message_count;
81 currentPop3Stat.message_unseen = currentPop3Stat.message_recent; 81 currentPop3Stat.message_unseen = currentPop3Stat.message_recent;
82 } else { 82 } else {
83 lastPop3Stat.message_count = currentPop3Stat.message_count; 83 lastPop3Stat.message_count = currentPop3Stat.message_count;
84 currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0; 84 currentPop3Stat.message_recent = currentPop3Stat.message_unseen = 0;
diff --git a/noncore/net/mail/libmailwrapper/storemail.cpp b/noncore/net/mail/libmailwrapper/storemail.cpp
index 914a11d..546d756 100644
--- a/noncore/net/mail/libmailwrapper/storemail.cpp
+++ b/noncore/net/mail/libmailwrapper/storemail.cpp
@@ -55,13 +55,13 @@ int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail)
55 if (!wrapper) return 0; 55 if (!wrapper) return 0;
56 int ret = 1; 56 int ret = 1;
57 57
58 mailmime * mimeMail = 0; 58 mailmime * mimeMail = 0;
59 mimeMail = createMimeMail(mail ); 59 mimeMail = createMimeMail(mail );
60 if ( mimeMail == NULL ) { 60 if ( mimeMail == NULL ) {
61 qDebug( "storeMail: error creating mime mail" ); 61 odebug << "storeMail: error creating mime mail" << oendl;
62 return 0; 62 return 0;
63 } 63 }
64 char *data; 64 char *data;
65 size_t size; 65 size_t size;
66 data = 0; 66 data = 0;
67 67
@@ -70,13 +70,13 @@ int Storemail::storeMail(const Opie::Core::OSmartPointer<Mail>&mail)
70 mime_message_set_tmpdir(msg,getenv( "HOME" )); 70 mime_message_set_tmpdir(msg,getenv( "HOME" ));
71 int r = mailmessage_fetch(msg,&data,&size); 71 int r = mailmessage_fetch(msg,&data,&size);
72 mime_message_detach_mime(msg); 72 mime_message_detach_mime(msg);
73 mailmessage_free(msg); 73 mailmessage_free(msg);
74 msg = 0; 74 msg = 0;
75 if (r != MAIL_NO_ERROR || !data) { 75 if (r != MAIL_NO_ERROR || !data) {
76 qDebug("Error fetching mime..."); 76 odebug << "Error fetching mime..." << oendl;
77 ret = 0; 77 ret = 0;
78 } 78 }
79 79
80 if (ret) { 80 if (ret) {
81 wrapper->storeMessage(data,size,m_tfolder); 81 wrapper->storeMessage(data,size,m_tfolder);
82 } 82 }
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index c23ad3f..4c87d64 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -138,13 +138,13 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
138MainWindow::~MainWindow() 138MainWindow::~MainWindow()
139{ 139{
140} 140}
141 141
142void MainWindow::appMessage(const QCString &, const QByteArray &) 142void MainWindow::appMessage(const QCString &, const QByteArray &)
143{ 143{
144 qDebug("appMessage not reached"); 144 odebug << "appMessage not reached" << oendl;
145} 145}
146 146
147void MainWindow::slotAdjustLayout() { 147void MainWindow::slotAdjustLayout() {
148 148
149 QWidget *d = QApplication::desktop(); 149 QWidget *d = QApplication::desktop();
150 150
@@ -172,38 +172,38 @@ void MainWindow::slotAdjustColumns()
172void MainWindow::slotEditSettings() 172void MainWindow::slotEditSettings()
173{ 173{
174} 174}
175 175
176void MainWindow::slotShowFolders( bool ) 176void MainWindow::slotShowFolders( bool )
177{ 177{
178 qDebug( "slotShowFolders not reached" ); 178 odebug << "slotShowFolders not reached" << oendl;
179} 179}
180 180
181void MainWindow::refreshMailView(const QValueList<RecMailP>&) 181void MainWindow::refreshMailView(const QValueList<RecMailP>&)
182{ 182{
183 qDebug( "refreshMailView not reached" ); 183 odebug << "refreshMailView not reached" << oendl;
184} 184}
185 185
186void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int ) 186void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int )
187{ 187{
188 qDebug( "mailLeftClicked not reached" ); 188 odebug << "mailLeftClicked not reached" << oendl;
189} 189}
190 190
191void MainWindow::displayMail() 191void MainWindow::displayMail()
192{ 192{
193 qDebug("displayMail not reached"); 193 odebug << "displayMail not reached" << oendl;
194} 194}
195 195
196void MainWindow::slotDeleteMail() 196void MainWindow::slotDeleteMail()
197{ 197{
198 qDebug("deleteMail not reached"); 198 odebug << "deleteMail not reached" << oendl;
199} 199}
200 200
201void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) 201void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int )
202{ 202{
203 qDebug("mailHold not reached"); 203 odebug << "mailHold not reached" << oendl;
204} 204}
205 205
206void MainWindow::slotSendQueued() 206void MainWindow::slotSendQueued()
207{ 207{
208} 208}
209 209
diff --git a/noncore/net/mail/nntpgroups.cpp b/noncore/net/mail/nntpgroups.cpp
index 8741c4b..3243ee3 100644
--- a/noncore/net/mail/nntpgroups.cpp
+++ b/noncore/net/mail/nntpgroups.cpp
@@ -50,13 +50,13 @@ void NNTPGroups::storeValues()
50{ 50{
51 if (!m_Account) return; 51 if (!m_Account) return;
52 QListViewItemIterator list_it( GroupListView ); 52 QListViewItemIterator list_it( GroupListView );
53 subscribedGroups.clear(); 53 subscribedGroups.clear();
54 for ( ; list_it.current(); ++list_it ) { 54 for ( ; list_it.current(); ++list_it ) {
55 if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { 55 if ( ( (QCheckListItem*)list_it.current() )->isOn() ) {
56 qDebug(list_it.current()->text(0) ); 56 odebug << list_it.current()->text(0) << oendl;
57 subscribedGroups.append( list_it.current()->text(0) ); 57 subscribedGroups.append( list_it.current()->text(0) );
58 } 58 }
59 } 59 }
60 subscribedGroups+=subscribedGroupsNotListed; 60 subscribedGroups+=subscribedGroupsNotListed;
61 m_Account->setGroups( subscribedGroups ); 61 m_Account->setGroups( subscribedGroups );
62} 62}
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp
index 5da2161..0669b5a 100644
--- a/noncore/net/mail/opiemail.cpp
+++ b/noncore/net/mail/opiemail.cpp
@@ -64,19 +64,19 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email)
64 compose.slotAdjustColumns(); 64 compose.slotAdjustColumns();
65 QPEApplication::execDialog( &compose ); 65 QPEApplication::execDialog( &compose );
66} 66}
67 67
68void OpieMail::slotComposeMail() 68void OpieMail::slotComposeMail()
69{ 69{
70 qDebug( "Compose Mail" ); 70 odebug << "Compose Mail" << oendl;
71 slotwriteMail(0l,0l); 71 slotwriteMail(0l,0l);
72} 72}
73 73
74void OpieMail::slotSendQueued() 74void OpieMail::slotSendQueued()
75{ 75{
76 qDebug( "Send Queued" ); 76 odebug << "Send Queued" << oendl;
77 SMTPaccount *smtp = 0; 77 SMTPaccount *smtp = 0;
78 78
79 QList<Account> list = settings->getAccounts(); 79 QList<Account> list = settings->getAccounts();
80 QList<SMTPaccount> smtpList; 80 QList<SMTPaccount> smtpList;
81 smtpList.setAutoDelete(false); 81 smtpList.setAutoDelete(false);
82 Account *it; 82 Account *it;
@@ -117,24 +117,24 @@ void OpieMail::slotSendQueued()
117 delete wrap; 117 delete wrap;
118 } 118 }
119} 119}
120 120
121void OpieMail::slotSearchMails() 121void OpieMail::slotSearchMails()
122{ 122{
123 qDebug( "Search Mails" ); 123 odebug << "Search Mails" << oendl;
124} 124}
125 125
126void OpieMail::slotEditSettings() 126void OpieMail::slotEditSettings()
127{ 127{
128 SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); 128 SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp );
129 QPEApplication::execDialog( &settingsDialog ); 129 QPEApplication::execDialog( &settingsDialog );
130} 130}
131 131
132void OpieMail::slotEditAccounts() 132void OpieMail::slotEditAccounts()
133{ 133{
134 qDebug( "Edit Accounts" ); 134 odebug << "Edit Accounts" << oendl;
135 EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp ); 135 EditAccounts eaDialog( settings, this, 0, true, WStyle_ContextHelp );
136 eaDialog.slotAdjustColumns(); 136 eaDialog.slotAdjustColumns();
137 QPEApplication::execDialog( &eaDialog ); 137 QPEApplication::execDialog( &eaDialog );
138 if ( settings ) delete settings; 138 if ( settings ) delete settings;
139 settings = new Settings(); 139 settings = new Settings();
140 140
@@ -177,13 +177,13 @@ void OpieMail::slotDeleteMail()
177void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) 177void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
178{ 178{
179 if (!mailView->currentItem()) return; 179 if (!mailView->currentItem()) return;
180 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); 180 MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType();
181 /* just the RIGHT button - or hold on pda */ 181 /* just the RIGHT button - or hold on pda */
182 if (button!=2) {return;} 182 if (button!=2) {return;}
183 qDebug("Event right/hold"); 183 odebug << "Event right/hold" << oendl;
184 if (!item) return; 184 if (!item) return;
185 QPopupMenu *m = new QPopupMenu(0); 185 QPopupMenu *m = new QPopupMenu(0);
186 if (m) 186 if (m)
187 { 187 {
188 if (mailtype==MAILLIB::A_NNTP) { 188 if (mailtype==MAILLIB::A_NNTP) {
189 m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); 189 m->insertItem(tr("Read this posting"),this,SLOT(displayMail()));
@@ -201,21 +201,21 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int )
201 delete m; 201 delete m;
202 } 202 }
203} 203}
204 204
205void OpieMail::slotShowFolders( bool show ) 205void OpieMail::slotShowFolders( bool show )
206{ 206{
207 qDebug( "Show Folders" ); 207 odebug << "Show Folders" << oendl;
208 if ( show && folderView->isHidden() ) 208 if ( show && folderView->isHidden() )
209 { 209 {
210 qDebug( "-> showing" ); 210 odebug << "-> showing" << oendl;
211 folderView->show(); 211 folderView->show();
212 } 212 }
213 else if ( !show && !folderView->isHidden() ) 213 else if ( !show && !folderView->isHidden() )
214 { 214 {
215 qDebug( "-> hiding" ); 215 odebug << "-> hiding" << oendl;
216 folderView->hide(); 216 folderView->hide();
217 } 217 }
218} 218}
219 219
220void OpieMail::refreshMailView(const QValueList<RecMailP>&list) 220void OpieMail::refreshMailView(const QValueList<RecMailP>&list)
221{ 221{
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.cpp b/noncore/net/mail/taskbarapplet/mailapplet.cpp
index f672a36..cac9048 100644
--- a/noncore/net/mail/taskbarapplet/mailapplet.cpp
+++ b/noncore/net/mail/taskbarapplet/mailapplet.cpp
@@ -101,13 +101,13 @@ void MailApplet::slotCheck() {
101 } 101 }
102 102
103 folderStat stat; 103 folderStat stat;
104 m_statusMail->check_current_stat( stat ); 104 m_statusMail->check_current_stat( stat );
105 int newMailsOld = m_newMails; 105 int newMailsOld = m_newMails;
106 m_newMails = stat.message_unseen; 106 m_newMails = stat.message_unseen;
107 qDebug( QString( "test %1" ).arg( m_newMails ) ); 107 odebug << QString( "test %1" ).arg( m_newMails ) << oendl;
108 if ( m_newMails > 0 && newMailsOld != m_newMails ) { 108 if ( m_newMails > 0 && newMailsOld != m_newMails ) {
109 ODevice *device = ODevice::inst(); 109 ODevice *device = ODevice::inst();
110 if ( isHidden() ) 110 if ( isHidden() )
111 show(); 111 show();
112 if ( m_config->readBoolEntry( "BlinkLed", true ) ) { 112 if ( m_config->readBoolEntry( "BlinkLed", true ) ) {
113 if ( !device->ledList().isEmpty() ) { 113 if ( !device->ledList().isEmpty() ) {
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 156e11d..a574ea1 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -136,13 +136,13 @@ void ViewMail::setBody(const RecBodyP&body )
136 { 136 {
137 filename = ""; 137 filename = "";
138 type = body->Parts()[i]->Type()+"/"+body->Parts()[i]->Subtype(); 138 type = body->Parts()[i]->Type()+"/"+body->Parts()[i]->Subtype();
139 part_plist_t::ConstIterator it = body->Parts()[i]->Parameters().begin(); 139 part_plist_t::ConstIterator it = body->Parts()[i]->Parameters().begin();
140 for (;it!=body->Parts()[i]->Parameters().end();++it) 140 for (;it!=body->Parts()[i]->Parameters().end();++it)
141 { 141 {
142 qDebug(it.key()); 142 odebug << it.key() << oendl;
143 if (it.key().lower()=="name") 143 if (it.key().lower()=="name")
144 { 144 {
145 filename=it.data(); 145 filename=it.data();
146 } 146 }
147 } 147 }
148 s = body->Parts()[i]->Size(); 148 s = body->Parts()[i]->Size();
diff --git a/noncore/net/opieftp/config.in b/noncore/net/opieftp/config.in
index 96e8b27..95cf73c 100644
--- a/noncore/net/opieftp/config.in
+++ b/noncore/net/opieftp/config.in
@@ -1,4 +1,4 @@
1 config OPIEFTP 1 config OPIEFTP
2 boolean "opie-ftp (ftp client for Opie)" 2 boolean "opie-ftp (ftp client for Opie)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && FTPLIB 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && FTPLIB
diff --git a/noncore/net/opieftp/filePermissions.cpp b/noncore/net/opieftp/filePermissions.cpp
index f545c1f..991fcd5 100644
--- a/noncore/net/opieftp/filePermissions.cpp
+++ b/noncore/net/opieftp/filePermissions.cpp
@@ -29,13 +29,13 @@
29 29
30filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName, bool useRemote ) 30filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName, bool useRemote )
31 : QDialog( parent, name, modal, fl ) 31 : QDialog( parent, name, modal, fl )
32{ 32{
33 if ( !name ) 33 if ( !name )
34 setName( tr("filePermissions") ); 34 setName( tr("filePermissions") );
35// qDebug("FilePermissions "+fileName); 35// odebug << "FilePermissions "+fileName << oendl;
36 resize( 236, 210 ); 36 resize( 236, 210 );
37 isRemote=useRemote; 37 isRemote=useRemote;
38 setMaximumSize( QSize( 236, 210 ) ); 38 setMaximumSize( QSize( 236, 210 ) );
39 setCaption( tr( "Set File Permissions" ) ); 39 setCaption( tr( "Set File Permissions" ) );
40 40
41 TextLabel1 = new QLabel( this, "TextLabel1" ); 41 TextLabel1 = new QLabel( this, "TextLabel1" );
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp
index 4c39569..fe96103 100644
--- a/noncore/net/opieftp/opieftp.cpp
+++ b/noncore/net/opieftp/opieftp.cpp
@@ -16,37 +16,40 @@
16extern "C" { 16extern "C" {
17#include "../ftplib/ftplib.h" 17#include "../ftplib/ftplib.h"
18} 18}
19 19
20#include "inputDialog.h" 20#include "inputDialog.h"
21 21
22#include <qmenubar.h> 22/* OPIE */
23#include <opie2/odebug.h>
23#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
24#include <qpe/resource.h> 25#include <qpe/resource.h>
25#include <qpe/config.h> 26#include <qpe/config.h>
26#include <qpe/mimetype.h> 27#include <qpe/mimetype.h>
28using namespace Opie::Core;
27 29
28#include <qtextstream.h> 30#include <qtextstream.h>
29#include <qpushbutton.h> 31#include <qpushbutton.h>
30#include <qtoolbutton.h> 32#include <qtoolbutton.h>
31#include <qcombobox.h> 33#include <qcombobox.h>
32#include <qlistview.h> 34#include <qlistview.h>
33#include <qlabel.h> 35#include <qlabel.h>
34#include <qprogressbar.h> 36#include <qprogressbar.h>
35#include <qspinbox.h> 37#include <qspinbox.h>
36#include <qtabwidget.h> 38#include <qtabwidget.h>
37#include <qlayout.h> 39#include <qlayout.h>
38#include <qmessagebox.h> 40#include <qmessagebox.h>
41#include <qmenubar.h>
39#include <qlineedit.h> 42#include <qlineedit.h>
40#include <qlistbox.h> 43#include <qlistbox.h>
41#include <qvbox.h> 44#include <qvbox.h>
42 45
46/* STD */
43#include <unistd.h> 47#include <unistd.h>
44#include <stdlib.h> 48#include <stdlib.h>
45 49
46
47QProgressBar *ProgressBar; 50QProgressBar *ProgressBar;
48static netbuf *conn=NULL; 51static netbuf *conn=NULL;
49 52
50static int log_progress(netbuf *, int xfered, void *) 53static int log_progress(netbuf *, int xfered, void *)
51{ 54{
52// int fsz = *(int *)arg; 55// int fsz = *(int *)arg;
@@ -58,13 +61,13 @@ static int log_progress(netbuf *, int xfered, void *)
58 return 1; 61 return 1;
59} 62}
60 63
61OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl) 64OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl)
62 : QMainWindow( parent, name, fl ) 65 : QMainWindow( parent, name, fl )
63{ 66{
64 qDebug("OpieFtp constructor"); 67 odebug << "OpieFtp constructor" << oendl;
65 setCaption( tr( "OpieFtp" ) ); 68 setCaption( tr( "OpieFtp" ) );
66 fuckeduphack=FALSE; 69 fuckeduphack=FALSE;
67 70
68 QVBox* wrapperBox = new QVBox( this ); 71 QVBox* wrapperBox = new QVBox( this );
69 setCentralWidget( wrapperBox ); 72 setCentralWidget( wrapperBox );
70 73
@@ -331,13 +334,13 @@ OpieFtp::OpieFtp( QWidget* parent, const char* name, WFlags fl)
331#endif 334#endif
332 readConfig(); 335 readConfig();
333 336
334// ServerComboBox->setCurrentItem(currentServerConfig); 337// ServerComboBox->setCurrentItem(currentServerConfig);
335 338
336 TabWidget->setCurrentPage(2); 339 TabWidget->setCurrentPage(2);
337 qDebug("Constructor done"); 340 odebug << "Constructor done" << oendl;
338} 341}
339 342
340OpieFtp::~OpieFtp() 343OpieFtp::~OpieFtp()
341{ 344{
342} 345}
343 346
@@ -402,13 +405,13 @@ void OpieFtp::newConnection()
402 TabWidget->setCurrentPage(2); 405 TabWidget->setCurrentPage(2);
403} 406}
404 407
405void OpieFtp::serverComboEdited(const QString & ) 408void OpieFtp::serverComboEdited(const QString & )
406{ 409{
407// if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) { 410// if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) {
408// qDebug("ServerComboEdited"); 411// odebug << "ServerComboEdited" << oendl;
409// // currentServerConfig = -1; 412// // currentServerConfig = -1;
410// } 413// }
411} 414}
412 415
413void OpieFtp::UsernameComboBoxEdited(const QString &) { 416void OpieFtp::UsernameComboBoxEdited(const QString &) {
414// currentServerConfig = -1; 417// currentServerConfig = -1;
@@ -527,13 +530,13 @@ void OpieFtp::localUpload()
527 ProgressBar->setTotalSteps(fsz); 530 ProgressBar->setTotalSteps(fsz);
528 531
529 FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn); 532 FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn);
530 FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn); 533 FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn);
531 FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); 534 FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn);
532 FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); 535 FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn);
533 qDebug("Put: %s, %s",localFile.latin1(),remoteFile.latin1()); 536 odebug << "Put: " << localFile.latin1() << ", " << remoteFile.latin1() << "" << oendl;
534 537
535 if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { 538 if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) {
536 QString msg; 539 QString msg;
537 msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); 540 msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn));
538 msg.replace(QRegExp(":"),"\n"); 541 msg.replace(QRegExp(":"),"\n");
539 QMessageBox::message(tr("Note"),msg); 542 QMessageBox::message(tr("Note"),msg);
@@ -588,13 +591,13 @@ void OpieFtp::remoteDownload()
588 591
589 ProgressBar->setTotalSteps(fsz); 592 ProgressBar->setTotalSteps(fsz);
590 FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn); 593 FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn);
591 FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn); 594 FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn);
592 FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); 595 FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn);
593 FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); 596 FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn);
594 qDebug("Get: %s, %s",localFile.latin1(),remoteFile.latin1()); 597 odebug << "Get: " << localFile.latin1() << ", " << remoteFile.latin1() << "" << oendl;
595 598
596 if(!FtpGet( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { 599 if(!FtpGet( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) {
597 QString msg; 600 QString msg;
598 msg.sprintf(tr("Unable to download \n")+"%s",FtpLastResponse(conn)); 601 msg.sprintf(tr("Unable to download \n")+"%s",FtpLastResponse(conn));
599 msg.replace(QRegExp(":"),"\n"); 602 msg.replace(QRegExp(":"),"\n");
600 QMessageBox::message(tr("Note"),msg); 603 QMessageBox::message(tr("Note"),msg);
@@ -617,13 +620,13 @@ bool OpieFtp::remoteDirList(const QString &dir)
617{ 620{
618 QString tmp = QDir::homeDirPath(); 621 QString tmp = QDir::homeDirPath();
619 if(tmp.right(1) != "/") 622 if(tmp.right(1) != "/")
620 tmp+="/._temp"; 623 tmp+="/._temp";
621 else 624 else
622 tmp+="._temp"; 625 tmp+="._temp";
623// qDebug("Listing remote dir "+tmp); 626// odebug << "Listing remote dir "+tmp << oendl;
624// QCopEnvelope ( "QPE/System", "busy()" ); 627// QCopEnvelope ( "QPE/System", "busy()" );
625 if (!FtpDir( tmp.latin1(), dir.latin1(), conn) ) { 628 if (!FtpDir( tmp.latin1(), dir.latin1(), conn) ) {
626 QString msg; 629 QString msg;
627 msg.sprintf(tr("Unable to list the directory\n")+dir+"\n%s",FtpLastResponse(conn) ); 630 msg.sprintf(tr("Unable to list the directory\n")+dir+"\n%s",FtpLastResponse(conn) );
628 msg.replace(QRegExp(":"),"\n"); 631 msg.replace(QRegExp(":"),"\n");
629 QMessageBox::message(tr("Note"),msg); 632 QMessageBox::message(tr("Note"),msg);
@@ -639,13 +642,13 @@ bool OpieFtp::remoteChDir(const QString &dir)
639// QCopEnvelope ( "QPE/System", "busy()" ); 642// QCopEnvelope ( "QPE/System", "busy()" );
640 if (!FtpChdir( dir.latin1(), conn )) { 643 if (!FtpChdir( dir.latin1(), conn )) {
641 QString msg; 644 QString msg;
642 msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn)); 645 msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn));
643 msg.replace(QRegExp(":"),"\n"); 646 msg.replace(QRegExp(":"),"\n");
644 QMessageBox::message(tr("Note"),msg); 647 QMessageBox::message(tr("Note"),msg);
645// qDebug(msg); 648// odebug << msg << oendl;
646// QCopEnvelope ( "QPE/System", "notBusy()" ); 649// QCopEnvelope ( "QPE/System", "notBusy()" );
647 return FALSE; 650 return FALSE;
648 } 651 }
649// QCopEnvelope ( "QPE/System", "notBusy()" ); 652// QCopEnvelope ( "QPE/System", "notBusy()" );
650 return TRUE; 653 return TRUE;
651} 654}
@@ -661,26 +664,26 @@ void OpieFtp::populateLocalView()
661 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 664 const QFileInfoList *list = currentDir.entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
662 QFileInfoListIterator it(*list); 665 QFileInfoListIterator it(*list);
663 QFileInfo *fi; 666 QFileInfo *fi;
664 while ( (fi=it.current()) ) { 667 while ( (fi=it.current()) ) {
665 if (fi->isSymLink() ){ 668 if (fi->isSymLink() ){
666 QString symLink=fi->readLink(); 669 QString symLink=fi->readLink();
667 qDebug("Symlink detected "+symLink); 670 odebug << "Symlink detected "+symLink << oendl;
668 QFileInfo sym( symLink); 671 QFileInfo sym( symLink);
669 fileS.sprintf( "%10i", sym.size() ); 672 fileS.sprintf( "%10i", sym.size() );
670 fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); 673 fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() );
671 fileDate = sym.lastModified().toString(); 674 fileDate = sym.lastModified().toString();
672 } else { 675 } else {
673 qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); 676 odebug << "Not a dir: "+currentDir.canonicalPath()+fileL << oendl;
674 fileS.sprintf( "%10i", fi->size() ); 677 fileS.sprintf( "%10i", fi->size() );
675 fileL.sprintf( "%s",fi->fileName().data() ); 678 fileL.sprintf( "%s",fi->fileName().data() );
676 fileDate= fi->lastModified().toString(); 679 fileDate= fi->lastModified().toString();
677 if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { 680 if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) {
678 fileL+="/"; 681 fileL+="/";
679 isDir=TRUE; 682 isDir=TRUE;
680 qDebug( fileL); 683 odebug << fileL << oendl;
681 } 684 }
682 } 685 }
683 if(fileL !="./" && fi->exists()) { 686 if(fileL !="./" && fi->exists()) {
684 item = new QListViewItem( Local_View,fileL, fileDate, fileS ); 687 item = new QListViewItem( Local_View,fileL, fileDate, fileS );
685 QPixmap pm; 688 QPixmap pm;
686 689
@@ -717,13 +720,13 @@ void OpieFtp::populateLocalView()
717 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() ); 720 currentPathCombo->lineEdit()->setText( currentDir.canonicalPath() );
718 fillCombo( (const QString &)currentDir); 721 fillCombo( (const QString &)currentDir);
719} 722}
720 723
721bool OpieFtp::populateRemoteView( ) 724bool OpieFtp::populateRemoteView( )
722{ 725{
723// qDebug("populate remoteview"); 726// odebug << "populate remoteview" << oendl;
724 QString sfile=QDir::homeDirPath(); 727 QString sfile=QDir::homeDirPath();
725 if(sfile.right(1) != "/") 728 if(sfile.right(1) != "/")
726 sfile+="/._temp"; 729 sfile+="/._temp";
727 else 730 else
728 sfile+="._temp"; 731 sfile+="._temp";
729 QFile file( sfile); 732 QFile file( sfile);
@@ -766,13 +769,13 @@ bool OpieFtp::populateRemoteView( )
766 QListViewItem * item1 = new QListViewItem( Remote_View, "../"); 769 QListViewItem * item1 = new QListViewItem( Remote_View, "../");
767 item1->setPixmap( 0, Resource::loadPixmap( "folder" )); 770 item1->setPixmap( 0, Resource::loadPixmap( "folder" ));
768 file.close(); 771 file.close();
769 if( file.exists()) 772 if( file.exists())
770 file. remove(); 773 file. remove();
771 } else 774 } else
772 qDebug("temp file not opened successfully "+sfile); 775 odebug << "temp file not opened successfully "+sfile << oendl;
773 Remote_View->setSorting( 4,TRUE); 776 Remote_View->setSorting( 4,TRUE);
774 return true; 777 return true;
775} 778}
776 779
777void OpieFtp::remoteListClicked(QListViewItem *selectedItem) 780void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
778{ 781{
@@ -785,38 +788,38 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem)
785 if(strItem == "../") { // the user wants to go ^ 788 if(strItem == "../") { // the user wants to go ^
786 if( FtpCDUp( conn) == 0) { 789 if( FtpCDUp( conn) == 0) {
787 QString msg; 790 QString msg;
788 msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn)); 791 msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn));
789 msg.replace(QRegExp(":"),"\n"); 792 msg.replace(QRegExp(":"),"\n");
790 QMessageBox::message(tr("Note"),msg); 793 QMessageBox::message(tr("Note"),msg);
791// qDebug(msg); 794// odebug << msg << oendl;
792 } 795 }
793 char path[256]; 796 char path[256];
794 if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string 797 if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string
795 QString msg; 798 QString msg;
796 msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn)); 799 msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn));
797 msg.replace(QRegExp(":"),"\n"); 800 msg.replace(QRegExp(":"),"\n");
798 QMessageBox::message(tr("Note"),msg); 801 QMessageBox::message(tr("Note"),msg);
799// qDebug(msg); 802// odebug << msg << oendl;
800 } 803 }
801 currentRemoteDir=path; 804 currentRemoteDir=path;
802 } else { 805 } else {
803 if(strItem.find("->",0,TRUE) != -1) { //symlink on some servers 806 if(strItem.find("->",0,TRUE) != -1) { //symlink on some servers
804 strItem=strItem.right( strItem.length() - strItem.find("->",0,TRUE) - 2 ); 807 strItem=strItem.right( strItem.length() - strItem.find("->",0,TRUE) - 2 );
805 strItem = strItem.stripWhiteSpace(); 808 strItem = strItem.stripWhiteSpace();
806 currentRemoteDir = strItem; 809 currentRemoteDir = strItem;
807 if( !remoteChDir( (const QString &)strItem)) { 810 if( !remoteChDir( (const QString &)strItem)) {
808 currentRemoteDir = oldRemoteCurrentDir; 811 currentRemoteDir = oldRemoteCurrentDir;
809 strItem=""; 812 strItem="";
810// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); 813// odebug << "RemoteCurrentDir1 "+oldRemoteCurrentDir << oendl;
811 } 814 }
812 } else if(strItem.find("/",0,TRUE) != -1) { // this is a directory 815 } else if(strItem.find("/",0,TRUE) != -1) { // this is a directory
813 if( !remoteChDir( (const QString &)currentRemoteDir + strItem)) { 816 if( !remoteChDir( (const QString &)currentRemoteDir + strItem)) {
814 currentRemoteDir = oldRemoteCurrentDir; 817 currentRemoteDir = oldRemoteCurrentDir;
815 strItem=""; 818 strItem="";
816// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); 819// odebug << "RemoteCurrentDir1 "+oldRemoteCurrentDir << oendl;
817 820
818 } else { 821 } else {
819 currentRemoteDir = currentRemoteDir+strItem; 822 currentRemoteDir = currentRemoteDir+strItem;
820 } 823 }
821 } else { 824 } else {
822// QCopEnvelope ( "QPE/System", "notBusy()" ); 825// QCopEnvelope ( "QPE/System", "notBusy()" );
@@ -863,13 +866,13 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem)
863 currentDir.cd(strItem, TRUE); 866 currentDir.cd(strItem, TRUE);
864 populateLocalView(); 867 populateLocalView();
865 } 868 }
866 } else { 869 } else {
867 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); 870 strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem);
868 if( QFile::exists(strItem ) ) { 871 if( QFile::exists(strItem ) ) {
869 // qDebug("upload "+strItem); 872 // odebug << "upload "+strItem << oendl;
870 return; 873 return;
871 } 874 }
872 } //end not symlink 875 } //end not symlink
873 chdir(strItem.latin1()); 876 chdir(strItem.latin1());
874 } 877 }
875 Local_View->ensureItemVisible(Local_View->firstChild()); 878 Local_View->ensureItemVisible(Local_View->firstChild());
@@ -1167,13 +1170,13 @@ void OpieFtp::fillRemoteCombo(const QString &currentPath) {
1167 } 1170 }
1168} 1171}
1169 1172
1170void OpieFtp::currentPathComboChanged() 1173void OpieFtp::currentPathComboChanged()
1171{ 1174{
1172 QString oldRemoteCurrentDir = currentRemoteDir; 1175 QString oldRemoteCurrentDir = currentRemoteDir;
1173// qDebug("oldRemoteCurrentDir "+oldRemoteCurrentDir); 1176// odebug << "oldRemoteCurrentDir "+oldRemoteCurrentDir << oendl;
1174 if (TabWidget->currentPageIndex() == 0) { 1177 if (TabWidget->currentPageIndex() == 0) {
1175 if(QDir( currentPathCombo->lineEdit()->text()).exists()) { 1178 if(QDir( currentPathCombo->lineEdit()->text()).exists()) {
1176 currentDir.setPath( currentPathCombo->lineEdit()->text() ); 1179 currentDir.setPath( currentPathCombo->lineEdit()->text() );
1177 populateLocalView(); 1180 populateLocalView();
1178 } else { 1181 } else {
1179 QMessageBox::message(tr("Note"),tr("That directory does not exist")); 1182 QMessageBox::message(tr("Note"),tr("That directory does not exist"));
@@ -1213,20 +1216,20 @@ void OpieFtp::readConfig()
1213{ 1216{
1214 fillCombos(); 1217 fillCombos();
1215 Config cfg("opieftp"); 1218 Config cfg("opieftp");
1216 cfg.setGroup("Server"); 1219 cfg.setGroup("Server");
1217 currentServerConfig = cfg.readNumEntry("currentServer", -1); 1220 currentServerConfig = cfg.readNumEntry("currentServer", -1);
1218 1221
1219// qDebug("Reading %d", currentServerConfig); 1222// odebug << "Reading " << currentServerConfig << "" << oendl;
1220 serverComboSelected( currentServerConfig-1); 1223 serverComboSelected( currentServerConfig-1);
1221 1224
1222} 1225}
1223 1226
1224void OpieFtp::writeConfig() 1227void OpieFtp::writeConfig()
1225{ 1228{
1226 qDebug("write config"); 1229 odebug << "write config" << oendl;
1227 Config cfg("opieftp"); 1230 Config cfg("opieftp");
1228 cfg.setGroup("Server"); 1231 cfg.setGroup("Server");
1229 1232
1230 QString username, remoteServerStr, remotePathStr, password, port, temp; 1233 QString username, remoteServerStr, remotePathStr, password, port, temp;
1231 1234
1232 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1235 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
@@ -1251,13 +1254,13 @@ void OpieFtp::writeConfig()
1251 cfg.setGroup("Server"); 1254 cfg.setGroup("Server");
1252 1255
1253 cfg.writeEntry( temp, ServerComboBox->currentText() +":"+PortSpinBox->cleanText() ); 1256 cfg.writeEntry( temp, ServerComboBox->currentText() +":"+PortSpinBox->cleanText() );
1254 cfg.writeEntry("currentServer", numberOfEntries+1); 1257 cfg.writeEntry("currentServer", numberOfEntries+1);
1255 1258
1256 currentServerConfig = numberOfEntries+1; 1259 currentServerConfig = numberOfEntries+1;
1257 qDebug("setting currentserverconfig to %d", currentServerConfig); 1260 odebug << "setting currentserverconfig to " << currentServerConfig << "" << oendl;
1258 1261
1259 cfg.setGroup(temp); 1262 cfg.setGroup(temp);
1260 if(!newServerName.isEmpty()) 1263 if(!newServerName.isEmpty())
1261 cfg.writeEntry("ServerName", newServerName); 1264 cfg.writeEntry("ServerName", newServerName);
1262 1265
1263 cfg.writeEntry("RemotePath", remotePath->text()); 1266 cfg.writeEntry("RemotePath", remotePath->text());
@@ -1270,13 +1273,13 @@ void OpieFtp::writeConfig()
1270 cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); 1273 cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 ));
1271 1274
1272 } 1275 }
1273} 1276}
1274 1277
1275void OpieFtp::clearCombos() { 1278void OpieFtp::clearCombos() {
1276 qDebug("clearing"); 1279 odebug << "clearing" << oendl;
1277 ServerComboBox->clear(); 1280 ServerComboBox->clear();
1278 UsernameComboBox->clear(); 1281 UsernameComboBox->clear();
1279 PasswordEdit->clear(); 1282 PasswordEdit->clear();
1280 serverListView->clear(); 1283 serverListView->clear();
1281} 1284}
1282 1285
@@ -1289,24 +1292,24 @@ void OpieFtp::fillCombos()
1289 cfg.setGroup("Server"); 1292 cfg.setGroup("Server");
1290 QString username, remoteServerStr, remotePathStr, password, port, temp; 1293 QString username, remoteServerStr, remotePathStr, password, port, temp;
1291 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1294 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
1292 1295
1293 for (int i = 1; i <= numberOfEntries; i++) { 1296 for (int i = 1; i <= numberOfEntries; i++) {
1294 temp.setNum(i); 1297 temp.setNum(i);
1295 qDebug(temp); 1298 odebug << temp << oendl;
1296 cfg.setGroup("Server"); 1299 cfg.setGroup("Server");
1297 remoteServerStr = cfg.readEntry( temp,""); 1300 remoteServerStr = cfg.readEntry( temp,"");
1298 qDebug( remoteServerStr); 1301 odebug << remoteServerStr << oendl;
1299 1302
1300 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); 1303 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE);
1301 port = remoteServerStr.right( divider - 1); 1304 port = remoteServerStr.right( divider - 1);
1302 bool ok; 1305 bool ok;
1303 PortSpinBox->setValue( port.toInt(&ok,10)); 1306 PortSpinBox->setValue( port.toInt(&ok,10));
1304 1307
1305 remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider); 1308 remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider);
1306 qDebug( "remote server string "+remoteServerStr); 1309 odebug << "remote server string "+remoteServerStr << oendl;
1307 ServerComboBox->insertItem( remoteServerStr ); 1310 ServerComboBox->insertItem( remoteServerStr );
1308 1311
1309 cfg.setGroup(temp); 1312 cfg.setGroup(temp);
1310 1313
1311 username = cfg.readEntry(temp); 1314 username = cfg.readEntry(temp);
1312 UsernameComboBox->insertItem(username); 1315 UsernameComboBox->insertItem(username);
@@ -1318,26 +1321,26 @@ void OpieFtp::fillCombos()
1318} 1321}
1319 1322
1320 1323
1321void OpieFtp::serverComboSelected(int index) 1324void OpieFtp::serverComboSelected(int index)
1322{ 1325{
1323 currentServerConfig = index+1; 1326 currentServerConfig = index+1;
1324 qDebug("server combo selected %d", index+1); 1327 odebug << "server combo selected " << index+1 << "" << oendl;
1325 QString username, remoteServerStr, remotePathStr, password, port, temp; 1328 QString username, remoteServerStr, remotePathStr, password, port, temp;
1326// remoteServerStr = ServerComboBox->text(index); 1329// remoteServerStr = ServerComboBox->text(index);
1327 1330
1328 Config cfg("opieftp"); 1331 Config cfg("opieftp");
1329 cfg.setGroup("Server"); 1332 cfg.setGroup("Server");
1330// int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1333// int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
1331 1334
1332 temp.setNum(index+1); 1335 temp.setNum(index+1);
1333 remoteServerStr = cfg.readEntry( temp,""); 1336 remoteServerStr = cfg.readEntry( temp,"");
1334 1337
1335 qDebug("Group" +temp); 1338 odebug << "Group" +temp << oendl;
1336 cfg.setGroup(temp); 1339 cfg.setGroup(temp);
1337// qDebug(temp); 1340// odebug << temp << oendl;
1338 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); 1341 int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE);
1339 port = remoteServerStr.right( divider - 1); 1342 port = remoteServerStr.right( divider - 1);
1340 bool ok; 1343 bool ok;
1341 int portInt = port.toInt(&ok,10); 1344 int portInt = port.toInt(&ok,10);
1342 if( portInt == 0) portInt = 21; 1345 if( portInt == 0) portInt = 21;
1343 1346
@@ -1346,26 +1349,26 @@ void OpieFtp::serverComboSelected(int index)
1346 PortSpinBox->setValue( portInt); 1349 PortSpinBox->setValue( portInt);
1347 1350
1348 remotePath->setText(cfg.readEntry("RemotePath", "/")); 1351 remotePath->setText(cfg.readEntry("RemotePath", "/"));
1349 1352
1350 username = cfg.readEntry("Username", "anonymous"); 1353 username = cfg.readEntry("Username", "anonymous");
1351 UsernameComboBox->lineEdit()->setText(username); 1354 UsernameComboBox->lineEdit()->setText(username);
1352 qDebug(username); 1355 odebug << username << oendl;
1353// qDebug("Password is "+cfg.readEntryCrypt(username, "me@opieftp.org")); 1356// odebug << "Password is "+cfg.readEntryCrypt(username << oendl;
1354 PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); 1357 PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org"));
1355// UsernameComboBox 1358// UsernameComboBox
1356// PasswordEdit 1359// PasswordEdit
1357 1360
1358 cfg.setGroup("Server"); 1361 cfg.setGroup("Server");
1359 temp.sprintf("%d",currentServerConfig); 1362 temp.sprintf("%d",currentServerConfig);
1360 cfg.writeEntry("currentServer", temp); 1363 cfg.writeEntry("currentServer", temp);
1361 1364
1362 fuckeduphack = TRUE; 1365 fuckeduphack = TRUE;
1363 serverListView->setCurrentItem( index); 1366 serverListView->setCurrentItem( index);
1364 fuckeduphack=FALSE; 1367 fuckeduphack=FALSE;
1365 qDebug("server list set selected %d",index); 1368 odebug << "server list set selected " << index << "" << oendl;
1366 update(); 1369 update();
1367} 1370}
1368 1371
1369void OpieFtp::deleteServer() 1372void OpieFtp::deleteServer()
1370{ 1373{
1371 QString username, remoteServerStr, remotePathStr, password, port, temp, servername; 1374 QString username, remoteServerStr, remotePathStr, password, port, temp, servername;
@@ -1388,13 +1391,13 @@ void OpieFtp::deleteServer()
1388// servername.find( cfg.readEntry("ServerName")) != -1 && 1391// servername.find( cfg.readEntry("ServerName")) != -1 &&
1389// remoteServerStr.find( cfg.readEntry("RemotePath")) != -1 && 1392// remoteServerStr.find( cfg.readEntry("RemotePath")) != -1 &&
1390// username.find( cfg.readEntry("Username")) != -1) { 1393// username.find( cfg.readEntry("Username")) != -1) {
1391 1394
1392 serverListView->removeItem(i); 1395 serverListView->removeItem(i);
1393 1396
1394 qDebug("OK DELETE "+tempname); 1397 odebug << "OK DELETE "+tempname << oendl;
1395 cfg.removeEntry(QString::number(i)); 1398 cfg.removeEntry(QString::number(i));
1396 for ( ; i <= numberOfEntries; i++) { 1399 for ( ; i <= numberOfEntries; i++) {
1397 cfg.setGroup("Server"); 1400 cfg.setGroup("Server");
1398 cfg.writeEntry("Server", QString::number(numberOfEntries + 1 )); 1401 cfg.writeEntry("Server", QString::number(numberOfEntries + 1 ));
1399 1402
1400 cfg.setGroup(QString::number(i+1)); //get next server config 1403 cfg.setGroup(QString::number(i+1)); //get next server config
@@ -1443,21 +1446,21 @@ void OpieFtp::upDir()
1443 } else { 1446 } else {
1444 if( FtpCDUp( conn) == 0) { 1447 if( FtpCDUp( conn) == 0) {
1445 QString msg; 1448 QString msg;
1446 msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn)); 1449 msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn));
1447 msg.replace(QRegExp(":"),"\n"); 1450 msg.replace(QRegExp(":"),"\n");
1448 QMessageBox::message(tr("Note"),msg); 1451 QMessageBox::message(tr("Note"),msg);
1449// qDebug(msg); 1452// odebug << msg << oendl;
1450 } 1453 }
1451 char path[256]; 1454 char path[256];
1452 if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string 1455 if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string
1453 QString msg; 1456 QString msg;
1454 msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn)); 1457 msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn));
1455 msg.replace(QRegExp(":"),"\n"); 1458 msg.replace(QRegExp(":"),"\n");
1456 QMessageBox::message(tr("Note"),msg); 1459 QMessageBox::message(tr("Note"),msg);
1457// qDebug(msg); 1460// odebug << msg << oendl;
1458 } 1461 }
1459 currentRemoteDir=path; 1462 currentRemoteDir=path;
1460 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate 1463 remoteDirList( (const QString &)currentRemoteDir); //this also calls populate
1461 if(currentRemoteDir.right(1) !="/") 1464 if(currentRemoteDir.right(1) !="/")
1462 currentRemoteDir +="/"; 1465 currentRemoteDir +="/";
1463 currentPathCombo->lineEdit()->setText( currentRemoteDir); 1466 currentPathCombo->lineEdit()->setText( currentRemoteDir);
@@ -1512,13 +1515,13 @@ void OpieFtp::NewServer() {
1512 } 1515 }
1513} 1516}
1514 1517
1515void OpieFtp::serverListClicked( const QString &item) { 1518void OpieFtp::serverListClicked( const QString &item) {
1516 if(item.isEmpty()) return; 1519 if(item.isEmpty()) return;
1517 Config cfg("opieftp"); 1520 Config cfg("opieftp");
1518 qDebug("highltined "+item); 1521 odebug << "highltined "+item << oendl;
1519 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); 1522 int numberOfEntries = cfg.readNumEntry("numberOfEntries",0);
1520 for (int i = 1; i <= numberOfEntries; i++) { 1523 for (int i = 1; i <= numberOfEntries; i++) {
1521 cfg.setGroup(QString::number(i)); 1524 cfg.setGroup(QString::number(i));
1522 if(cfg.readEntry( "ServerName").find(item) != -1 && !fuckeduphack) 1525 if(cfg.readEntry( "ServerName").find(item) != -1 && !fuckeduphack)
1523 serverComboSelected(i-1); 1526 serverComboSelected(i-1);
1524 } 1527 }
diff --git a/noncore/net/opieftp/opieftp.pro b/noncore/net/opieftp/opieftp.pro
index 2f97dc2..003b166 100644
--- a/noncore/net/opieftp/opieftp.pro
+++ b/noncore/net/opieftp/opieftp.pro
@@ -1,11 +1,10 @@
1#CONFIG += qt warn_on quick-app 1CONFIG += qt warn_on
2CONFIG += qt warn_on 2HEADERS = opieftp.h inputDialog.h
3HEADERS = opieftp.h inputDialog.h 3SOURCES = opieftp.cpp inputDialog.cpp main.cpp
4SOURCES = opieftp.cpp inputDialog.cpp main.cpp 4TARGET = opieftp
5TARGET = opieftp
6INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
7DEPENDPATH += $(OPIEDIR)/include 6DEPENDPATH += $(OPIEDIR)/include
8LIBS += -lqpe -lftplib 7LIBS += -lqpe -lopiecore2 -lftplib
9DESTDIR = $(OPIEDIR)/bin 8DESTDIR = $(OPIEDIR)/bin
10 9
11include ( $(OPIEDIR)/include.pro ) 10include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/opieirc/config.in b/noncore/net/opieirc/config.in
index a61cf70..2c56523 100644
--- a/noncore/net/opieirc/config.in
+++ b/noncore/net/opieirc/config.in
@@ -1,4 +1,4 @@
1 config OPIEIRC 1 config OPIEIRC
2 boolean "opie-irc (chat via your favorite IRC server)" 2 boolean "opie-irc (chat via your favorite IRC server)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LIBQTAUX 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBQTAUX
diff --git a/noncore/net/opieirc/ircmisc.cpp b/noncore/net/opieirc/ircmisc.cpp
index 22387b3..6d93a34 100644
--- a/noncore/net/opieirc/ircmisc.cpp
+++ b/noncore/net/opieirc/ircmisc.cpp
@@ -1,9 +1,12 @@
1#include <stdio.h>
2#include "ircmisc.h" 1#include "ircmisc.h"
3 2
3/* OPIE */
4#include <opie2/odebug.h>
5using namespace Opie::Core;
6
4IRCTabBar::IRCTabBar(QWidget *parent, const char *name) : QTabBar(parent, name) { 7IRCTabBar::IRCTabBar(QWidget *parent, const char *name) : QTabBar(parent, name) {
5} 8}
6 9
7int IRCTabBar::insertTab(QTab *tab, int index) { 10int IRCTabBar::insertTab(QTab *tab, int index) {
8 /* FIXME: find some nicer way to do this */ 11 /* FIXME: find some nicer way to do this */
9 QExtTab *ext = new QExtTab(); 12 QExtTab *ext = new QExtTab();
@@ -61,23 +64,23 @@ void IRCHistoryLineEdit::keyPressEvent(QKeyEvent *event) {
61 setText(""); 64 setText("");
62 } 65 }
63 } else if (key == Key_Return) { 66 } else if (key == Key_Return) {
64 m_history.prepend(text()); 67 m_history.prepend(text());
65 m_index = -1; 68 m_index = -1;
66 } else if (key == Key_Tab) { 69 } else if (key == Key_Tab) {
67 printf("got tab\n"); 70 odebug << "got tab" << oendl;
68 return; 71 return;
69 } 72 }
70 QLineEdit::keyPressEvent(event); 73 QLineEdit::keyPressEvent(event);
71} 74}
72 75
73bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) { 76bool IRCHistoryLineEdit::eventFilter(QObject *object, QEvent *event) {
74 if (event->type() == QEvent::KeyPress) { 77 if (event->type() == QEvent::KeyPress) {
75 QKeyEvent *k = (QKeyEvent *) event; 78 QKeyEvent *k = (QKeyEvent *) event;
76 /* Catch tab characters */ 79 /* Catch tab characters */
77 if (k->key() == Key_Tab) { 80 if (k->key() == Key_Tab) {
78 qDebug("tab!"); 81 odebug << "tab!" << oendl;
79 return TRUE; 82 return TRUE;
80 } 83 }
81 } 84 }
82 return QLineEdit::eventFilter(object, event); 85 return QLineEdit::eventFilter(object, event);
83} 86}
diff --git a/noncore/net/opieirc/opieirc.pro b/noncore/net/opieirc/opieirc.pro
index 4f9092f..2455ec4 100644
--- a/noncore/net/opieirc/opieirc.pro
+++ b/noncore/net/opieirc/opieirc.pro
@@ -1,25 +1,24 @@
1 CONFIG = qt warn_on quick-app 1 CONFIG = qt warn_on quick-app
2 HEADERS = ircchannel.h ircconnection.h \ 2HEADERS = ircchannel.h ircconnection.h \
3 ircmessage.h \ 3 ircmessage.h \
4 ircmessageparser.h ircoutput.h \ 4 ircmessageparser.h ircoutput.h \
5 ircperson.h ircserver.h ircsession.h \ 5 ircperson.h ircserver.h ircsession.h \
6 mainwindow.h irctab.h ircservertab.h \ 6 mainwindow.h irctab.h ircservertab.h \
7 ircchanneltab.h ircchannellist.h \ 7 ircchanneltab.h ircchannellist.h \
8 ircserverlist.h ircservereditor.h \ 8 ircserverlist.h ircservereditor.h \
9 ircquerytab.h ircsettings.h ircmisc.h 9 ircquerytab.h ircsettings.h ircmisc.h
10 SOURCES = ircchannel.cpp ircconnection.cpp \ 10 SOURCES = ircchannel.cpp ircconnection.cpp \
11 ircmessage.cpp \ 11 ircmessage.cpp \
12 ircmessageparser.cpp ircoutput.cpp \ 12 ircmessageparser.cpp ircoutput.cpp \
13 ircperson.cpp ircserver.cpp \ 13 ircperson.cpp ircserver.cpp \
14 ircsession.cpp main.cpp mainwindow.cpp \ 14 ircsession.cpp main.cpp mainwindow.cpp \
15 irctab.cpp ircservertab.cpp \ 15 irctab.cpp ircservertab.cpp \
16 ircchanneltab.cpp ircchannellist.cpp \ 16 ircchanneltab.cpp ircchannellist.cpp \
17 ircserverlist.cpp ircservereditor.cpp \ 17 ircserverlist.cpp ircservereditor.cpp \
18 ircquerytab.cpp ircsettings.cpp ircmisc.cpp 18 ircquerytab.cpp ircsettings.cpp ircmisc.cpp
19INCLUDEPATH += $(OPIEDIR)/include 19INCLUDEPATH += $(OPIEDIR)/include
20 DEPENDPATH+= $(OPIEDIR)/include 20DEPENDPATH += $(OPIEDIR)/include
21LIBS += -lqpe -lopieui2 -lqtaux2 21LIBS += -lqpe -lopiecore2 -lopieui2 -lqtaux2
22 22TARGET = opieirc
23 TARGET= opieirc
24 23
25include ( $(OPIEDIR)/include.pro ) 24include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/opietooth/applet/bluezapplet.cpp b/noncore/net/opietooth/applet/bluezapplet.cpp
index 8a7f0bc..1d93f5c 100644
--- a/noncore/net/opietooth/applet/bluezapplet.cpp
+++ b/noncore/net/opietooth/applet/bluezapplet.cpp
@@ -203,13 +203,13 @@ namespace OpieTooth {
203/** 203/**
204 * Implementation of the paint event 204 * Implementation of the paint event
205 * @param the QPaintEvent 205 * @param the QPaintEvent
206 */ 206 */
207 void BluezApplet::paintEvent( QPaintEvent* ) { 207 void BluezApplet::paintEvent( QPaintEvent* ) {
208 QPainter p(this); 208 QPainter p(this);
209 qDebug("paint bluetooth pixmap"); 209 odebug << "paint bluetooth pixmap" << oendl;
210 210
211 if (bluezactive > 0) { 211 if (bluezactive > 0) {
212 p.drawPixmap( 0, 1, bluezOnPixmap ); 212 p.drawPixmap( 0, 1, bluezOnPixmap );
213 } else { 213 } else {
214 p.drawPixmap( 0, 1, bluezOffPixmap ); 214 p.drawPixmap( 0, 1, bluezOffPixmap );
215 } 215 }
diff --git a/noncore/net/opietooth/lib/startdunconnection.cpp b/noncore/net/opietooth/lib/startdunconnection.cpp
index 09b19d2..37f2ae7 100644
--- a/noncore/net/opietooth/lib/startdunconnection.cpp
+++ b/noncore/net/opietooth/lib/startdunconnection.cpp
@@ -42,13 +42,13 @@ void StartDunConnection::start() {
42 42
43 connect( m_dunConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) , 43 connect( m_dunConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
44 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 44 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
45 connect( m_dunConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), 45 connect( m_dunConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
46 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) ); 46 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
47 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 47 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
48 qWarning( "could not start" ); 48 owarn << "could not start" << oendl;
49 delete m_dunConnect; 49 delete m_dunConnect;
50 } 50 }
51} 51}
52 52
53 53
54void StartDunConnection::slotExited( OProcess* proc ) { 54void StartDunConnection::slotExited( OProcess* proc ) {
diff --git a/noncore/net/opietooth/lib/startpanconnection.cpp b/noncore/net/opietooth/lib/startpanconnection.cpp
index 24ac530..50afc9f 100644
--- a/noncore/net/opietooth/lib/startpanconnection.cpp
+++ b/noncore/net/opietooth/lib/startpanconnection.cpp
@@ -36,21 +36,21 @@ void StartPanConnection::setConnectionType() {
36StartConnection::ConnectionType StartPanConnection::type() { 36StartConnection::ConnectionType StartPanConnection::type() {
37 return m_connectionType; 37 return m_connectionType;
38} 38}
39 39
40void StartPanConnection::start() { 40void StartPanConnection::start() {
41 m_panConnect = new OProcess(); 41 m_panConnect = new OProcess();
42 qDebug( "IM START " + m_mac ); 42 odebug << "IM START " + m_mac << oendl;
43 *m_panConnect << "pand" << "--connect" << m_mac; 43 *m_panConnect << "pand" << "--connect" << m_mac;
44 44
45 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) , 45 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
46 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 46 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
47 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), 47 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
48 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) ); 48 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
49 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 49 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
50 qWarning( "could not start" ); 50 owarn << "could not start" << oendl;
51 delete m_panConnect; 51 delete m_panConnect;
52 } 52 }
53} 53}
54 54
55 55
56void StartPanConnection::slotExited( OProcess* proc ) { 56void StartPanConnection::slotExited( OProcess* proc ) {
@@ -65,20 +65,20 @@ void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len)
65void StartPanConnection::stop() { 65void StartPanConnection::stop() {
66 if ( m_panConnect ) { 66 if ( m_panConnect ) {
67 delete m_panConnect; 67 delete m_panConnect;
68 m_panConnect = 0l; 68 m_panConnect = 0l;
69 } 69 }
70 m_panConnect = new OProcess(); 70 m_panConnect = new OProcess();
71 qDebug("IM STOP " + m_mac); 71 odebug << "IM STOP " + m_mac << oendl;
72 72
73 *m_panConnect << "pand" << "--kill" << m_mac; 73 *m_panConnect << "pand" << "--kill" << m_mac;
74 74
75 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) , 75 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
76 this, SLOT( slotExited(Opie::Core::OProcess*) ) ); 76 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
77 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), 77 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
78 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) ); 78 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
79 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 79 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
80 qWarning( "could not stop" ); 80 owarn << "could not stop" << oendl;
81 delete m_panConnect; 81 delete m_panConnect;
82 } 82 }
83} 83}
84 84
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 29030ab..b1cddd2 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -152,13 +152,13 @@ void BlueBase::writeConfig()
152 152
153/** 153/**
154 * Modify the hcid.conf file to our needs 154 * Modify the hcid.conf file to our needs
155 */ 155 */
156void BlueBase::writeToHciConfig() 156void BlueBase::writeToHciConfig()
157{ 157{
158 qWarning("writeToHciConfig"); 158 owarn << "writeToHciConfig" << oendl;
159 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 159 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
160 hciconf.load(); 160 hciconf.load();
161 hciconf.setPinHelper( "/opt/QtPalmtop/bin/bluepin" ); 161 hciconf.setPinHelper( "/opt/QtPalmtop/bin/bluepin" );
162 hciconf.setName( m_deviceName ); 162 hciconf.setName( m_deviceName );
163 hciconf.setEncrypt( m_useEncryption ); 163 hciconf.setEncrypt( m_useEncryption );
164 hciconf.setAuth( m_enableAuthentification ); 164 hciconf.setAuth( m_enableAuthentification );
@@ -364,31 +364,31 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
364 BTServiceItem* service = (BTServiceItem*)item; 364 BTServiceItem* service = (BTServiceItem*)item;
365 QMap<int, QString> list = service->services().classIdList(); 365 QMap<int, QString> list = service->services().classIdList();
366 QMap<int, QString>::Iterator it = list.begin(); 366 QMap<int, QString>::Iterator it = list.begin();
367 QPopupMenu *popup =0l; 367 QPopupMenu *popup =0l;
368 if ( it != list.end() ) 368 if ( it != list.end() )
369 { 369 {
370 qWarning("Searching id %d %s", it.key(), it.data().latin1() ); 370 owarn << "Searching id " << it.key() << " " << it.data().latin1() << "" << oendl;
371 popup = m_popHelper.find( it.key(), 371 popup = m_popHelper.find( it.key(),
372 service->services(), 372 service->services(),
373 (BTDeviceItem*)service->parent() ); 373 (BTDeviceItem*)service->parent() );
374 } 374 }
375 else 375 else
376 { 376 {
377 qWarning("Empty"); 377 owarn << "Empty" << oendl;
378 } 378 }
379 379
380 if ( popup == 0l ) 380 if ( popup == 0l )
381 { 381 {
382 qWarning("factory returned 0l"); 382 owarn << "factory returned 0l" << oendl;
383 popup = new QPopupMenu(); 383 popup = new QPopupMenu();
384 } 384 }
385 int test1 = popup->insertItem( tr("Test1:"), 2); 385 int test1 = popup->insertItem( tr("Test1:"), 2);
386 386
387 ret = popup->exec( point ); 387 ret = popup->exec( point );
388 qWarning("returned from exec() "); 388 owarn << "returned from exec() " << oendl;
389 if ( ret == -1 ) 389 if ( ret == -1 )
390 { 390 {
391 ; 391 ;
392 } 392 }
393 else if ( ret == test1 ) 393 else if ( ret == test1 )
394 { 394 {
@@ -403,13 +403,13 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
403/** 403/**
404 * Search and display avail. services for a device (on expand from device listing) 404 * Search and display avail. services for a device (on expand from device listing)
405 * @param item the service item returned 405 * @param item the service item returned
406 */ 406 */
407void BlueBase::addServicesToDevice( BTDeviceItem * item ) 407void BlueBase::addServicesToDevice( BTDeviceItem * item )
408{ 408{
409 qDebug("addServicesToDevice"); 409 odebug << "addServicesToDevice" << oendl;
410 // row of mac adress text(3) 410 // row of mac adress text(3)
411 RemoteDevice device = item->remoteDevice(); 411 RemoteDevice device = item->remoteDevice();
412 m_deviceList.insert( item->mac() , item ); 412 m_deviceList.insert( item->mac() , item );
413 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back 413 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back
414 m_localDevice->searchServices( device ); 414 m_localDevice->searchServices( device );
415} 415}
@@ -420,13 +420,13 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item )
420 ted to the foundServices signal 420 ted to the foundServices signal
421 * @param device the mac address of the remote device 421 * @param device the mac address of the remote device
422 * @param servicesList the list with the service the device has. 422 * @param servicesList the list with the service the device has.
423 */ 423 */
424void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) 424void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList )
425{ 425{
426 qDebug("fill services list"); 426 odebug << "fill services list" << oendl;
427 427
428 QMap<QString,BTDeviceItem*>::Iterator it; 428 QMap<QString,BTDeviceItem*>::Iterator it;
429 BTDeviceItem* deviceItem = 0; 429 BTDeviceItem* deviceItem = 0;
430 430
431 // get the right devices which requested the search 431 // get the right devices which requested the search
432 it = m_deviceList.find( device ); 432 it = m_deviceList.find( device );
@@ -604,13 +604,13 @@ void BlueBase::deviceActive( const RemoteDevice &device )
604 * The signal catcher. Set the avail. status on device. 604 * The signal catcher. Set the avail. status on device.
605 * @param device - the mac address 605 * @param device - the mac address
606 * @param connected - if it is avail. or not 606 * @param connected - if it is avail. or not
607 */ 607 */
608void BlueBase::deviceActive( const QString& device, bool connected ) 608void BlueBase::deviceActive( const QString& device, bool connected )
609{ 609{
610 qDebug("deviceActive slot"); 610 odebug << "deviceActive slot" << oendl;
611 611
612 QMap<QString,BTDeviceItem*>::Iterator it; 612 QMap<QString,BTDeviceItem*>::Iterator it;
613 613
614 it = m_deviceList.find( device ); 614 it = m_deviceList.find( device );
615 if( it == m_deviceList.end() ) 615 if( it == m_deviceList.end() )
616 return; 616 return;
diff --git a/noncore/net/opietooth/manager/devicehandler.cpp b/noncore/net/opietooth/manager/devicehandler.cpp
index 9c5b817..bd34351 100644
--- a/noncore/net/opietooth/manager/devicehandler.cpp
+++ b/noncore/net/opietooth/manager/devicehandler.cpp
@@ -30,19 +30,19 @@ QString path = QDir::homeDirPath() + "/Settings/bluetooth";
30 QString mac; 30 QString mac;
31 QStringList::Iterator it; 31 QStringList::Iterator it;
32 for (it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) { 32 for (it = devicesFileList.begin(); it != devicesFileList.end(); ++it ) {
33 if ( (*it) == "." || (*it) == ".." ) 33 if ( (*it) == "." || (*it) == ".." )
34 continue; 34 continue;
35 35
36 qDebug((*it).latin1() ); 36 odebug << (*it).latin1() << oendl;
37 Config conf(path + "/"+(*it), Config::File); 37 Config conf(path + "/"+(*it), Config::File);
38 conf.setGroup("Info"); 38 conf.setGroup("Info");
39 name = conf.readEntry("name", "Error"); 39 name = conf.readEntry("name", "Error");
40 mac = conf.readEntry("mac", QString::null); 40 mac = conf.readEntry("mac", QString::null);
41 qDebug("MAC: " + mac); 41 odebug << "MAC: " + mac << oendl;
42 qDebug("NAME: " + name); 42 odebug << "NAME: " + name << oendl;
43 if (mac.isEmpty() ) 43 if (mac.isEmpty() )
44 continue; 44 continue;
45 RemoteDevice currentDevice( mac , name ); 45 RemoteDevice currentDevice( mac , name );
46 list.append( currentDevice ); 46 list.append( currentDevice );
47 } 47 }
48 } 48 }
@@ -63,20 +63,20 @@ void DeviceHandler::save( const RemoteDevice::ValueList& list) {
63 63
64 /** 64 /**
65 * Create a new dir 65 * Create a new dir
66 */ 66 */
67 rm = "mkdir "; 67 rm = "mkdir ";
68 rm += QDir::homeDirPath() + "/Settings/bluetooth"; 68 rm += QDir::homeDirPath() + "/Settings/bluetooth";
69 qWarning("out %s", rm.data() ); 69 owarn << "out " << rm.data() << "" << oendl;
70 system( rm.data() ); 70 system( rm.data() );
71 71
72 RemoteDevice::ValueList::ConstIterator it; 72 RemoteDevice::ValueList::ConstIterator it;
73 // write the config 73 // write the config
74 74
75 for ( it = list.begin(); it != list.end(); ++it ) { 75 for ( it = list.begin(); it != list.end(); ++it ) {
76 qDebug( "/Settings/bluetooth/" + (*it).mac() + ".conf"); 76 odebug << "/Settings/bluetooth/" + (*it).mac() + ".conf" << oendl;
77 77
78 Config conf( QDir::homeDirPath() + 78 Config conf( QDir::homeDirPath() +
79 "/Settings/bluetooth/" + 79 "/Settings/bluetooth/" +
80 (*it).mac() + ".conf", Config::File ); 80 (*it).mac() + ".conf", Config::File );
81 81
82 conf.setGroup( "Info" ); 82 conf.setGroup( "Info" );
diff --git a/noncore/net/opietooth/manager/dunpopup.cpp b/noncore/net/opietooth/manager/dunpopup.cpp
index 3043f71..5b01d2f 100644
--- a/noncore/net/opietooth/manager/dunpopup.cpp
+++ b/noncore/net/opietooth/manager/dunpopup.cpp
@@ -8,13 +8,13 @@ using namespace OpieTooth;
8 8
9/* 9/*
10 * c'tor init the QAction 10 * c'tor init the QAction
11 */ 11 */
12DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { 12DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
13 13
14 qWarning("DunPopup c'tor"); 14 owarn << "DunPopup c'tor" << oendl;
15 15
16 m_item = item; 16 m_item = item;
17 QAction *a, *b, *c; 17 QAction *a, *b, *c;
18 18
19 m_dunconnection = 0l; 19 m_dunconnection = 0l;
20 /* connect action */ 20 /* connect action */
diff --git a/noncore/net/opietooth/manager/hciconfwrapper.cpp b/noncore/net/opietooth/manager/hciconfwrapper.cpp
index 35e9cd9..71c935c 100644
--- a/noncore/net/opietooth/manager/hciconfwrapper.cpp
+++ b/noncore/net/opietooth/manager/hciconfwrapper.cpp
@@ -71,22 +71,22 @@ namespace OpieTooth {
71 QStringList::Iterator it; 71 QStringList::Iterator it;
72 72
73 QString str; 73 QString str;
74 for (it = m_file.begin(); it != m_file.end(); ++it ) { 74 for (it = m_file.begin(); it != m_file.end(); ++it ) {
75 str = (*it); 75 str = (*it);
76 if( (str.contains(key)) > 0 ) { 76 if( (str.contains(key)) > 0 ) {
77 qDebug("Found"); 77 odebug << "Found" << oendl;
78 // still need to look if its commented out!!! 78 // still need to look if its commented out!!!
79 str.simplifyWhiteSpace(); 79 str.simplifyWhiteSpace();
80 qDebug( key ); 80 odebug << key << oendl;
81 if (str.startsWith("#")) { 81 if (str.startsWith("#")) {
82 str = (key + " " + value + ";"); 82 str = (key + " " + value + ";");
83 } else { 83 } else {
84 str = str.replace( QRegExp( "\\s*"+key+"\\s+[^\\s][^;]*;" ), key + " " + value + ";"); 84 str = str.replace( QRegExp( "\\s*"+key+"\\s+[^\\s][^;]*;" ), key + " " + value + ";");
85 } 85 }
86 qDebug( str ); 86 odebug << str << oendl;
87 it = m_file.remove( it ); 87 it = m_file.remove( it );
88 it = m_file.insert( it, str ); 88 it = m_file.insert( it, str );
89 //return; the regexp is too wide -zecke // all set 89 //return; the regexp is too wide -zecke // all set
90 } 90 }
91 } 91 }
92 92
@@ -95,17 +95,17 @@ namespace OpieTooth {
95 95
96 /** 96 /**
97 * This loads the config file and stores it inside 97 * This loads the config file and stores it inside
98 * the m_file 98 * the m_file
99 */ 99 */
100 void HciConfWrapper::load() { 100 void HciConfWrapper::load() {
101 qWarning("loaded"); 101 owarn << "loaded" << oendl;
102 m_file.clear(); 102 m_file.clear();
103 QFile file( m_fileName ); 103 QFile file( m_fileName );
104 if (!file.open( IO_ReadOnly ) ) { 104 if (!file.open( IO_ReadOnly ) ) {
105 qDebug("Could not open"); 105 odebug << "Could not open" << oendl;
106 return; 106 return;
107 } 107 }
108 108
109 /** 109 /**
110 * readAll() into a QByteArray 110 * readAll() into a QByteArray
111 * QStringList::split('\n', array ) 111 * QStringList::split('\n', array )
@@ -116,24 +116,24 @@ namespace OpieTooth {
116 while ( !stream.atEnd() ) { 116 while ( !stream.atEnd() ) {
117 tmp = stream.readLine(); 117 tmp = stream.readLine();
118 m_file.append( tmp ); 118 m_file.append( tmp );
119 } 119 }
120 } 120 }
121 void HciConfWrapper::save() { 121 void HciConfWrapper::save() {
122 qWarning("save"); 122 owarn << "save" << oendl;
123 if (m_file.isEmpty() ) // load first 123 if (m_file.isEmpty() ) // load first
124 return; 124 return;
125 125
126 QFile file( m_fileName ); 126 QFile file( m_fileName );
127 if ( !file.open(IO_WriteOnly ) ) { 127 if ( !file.open(IO_WriteOnly ) ) {
128 qWarning("could not open %s", m_fileName.latin1() ); 128 owarn << "could not open " << m_fileName.latin1() << "" << oendl;
129 return; 129 return;
130 } 130 }
131 131
132 QTextStream stream(&file ); 132 QTextStream stream(&file );
133 QStringList::Iterator it; 133 QStringList::Iterator it;
134 for ( it = m_file.begin(); it != m_file.end(); ++it ) { 134 for ( it = m_file.begin(); it != m_file.end(); ++it ) {
135 stream << (*it) << endl; 135 stream << (*it) << endl;
136 } 136 }
137 qWarning("saved"); 137 owarn << "saved" << oendl;
138 }; 138 };
139} 139}
diff --git a/noncore/net/opietooth/manager/obexdialog.cpp b/noncore/net/opietooth/manager/obexdialog.cpp
index 1ef862a..3a3dbb0 100644
--- a/noncore/net/opietooth/manager/obexdialog.cpp
+++ b/noncore/net/opietooth/manager/obexdialog.cpp
@@ -77,13 +77,13 @@ void ObexDialog::sendData() {
77 if ( !modifiedName.isEmpty() ) { 77 if ( !modifiedName.isEmpty() ) {
78 *obexSend << "ussp-push" << m_device << fileURL << modifiedName; 78 *obexSend << "ussp-push" << m_device << fileURL << modifiedName;
79 } else { 79 } else {
80 *obexSend << "ussp-push" << m_device << fileURL << file; 80 *obexSend << "ussp-push" << m_device << fileURL << file;
81 } 81 }
82 if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) { 82 if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) {
83 qWarning("could not start"); 83 owarn << "could not start" << oendl;
84 delete obexSend; 84 delete obexSend;
85 } 85 }
86 86
87 87
88 88
89} 89}
diff --git a/noncore/net/opietooth/manager/obexpopup.cpp b/noncore/net/opietooth/manager/obexpopup.cpp
index d147d52..9a50199 100644
--- a/noncore/net/opietooth/manager/obexpopup.cpp
+++ b/noncore/net/opietooth/manager/obexpopup.cpp
@@ -13,13 +13,13 @@ using namespace OpieTooth;
13/* 13/*
14 * c'tor init the QAction 14 * c'tor init the QAction
15 */ 15 */
16ObexPopup::ObexPopup() 16ObexPopup::ObexPopup()
17 : QPopupMenu() 17 : QPopupMenu()
18{ 18{
19 qWarning("RfcCommPopup c'tor"); 19 owarn << "RfcCommPopup c'tor" << oendl;
20 20
21 QAction* a; 21 QAction* a;
22 22
23 /* connect action */ 23 /* connect action */
24 a = new QAction( ); // so it's get deleted 24 a = new QAction( ); // so it's get deleted
25 a->setText("Push file"); 25 a->setText("Push file");
@@ -33,13 +33,13 @@ ObexPopup::~ObexPopup()
33{} 33{}
34 34
35 35
36void ObexPopup::slotPush() 36void ObexPopup::slotPush()
37{ 37{
38 38
39 qWarning("push something"); 39 owarn << "push something" << oendl;
40 40
41 ObexDialog obexDialog; 41 ObexDialog obexDialog;
42 QPEApplication::execDialog( &obexDialog ); 42 QPEApplication::execDialog( &obexDialog );
43} 43}
44 44
45 45
diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp
index 8b05964..43c2777 100644
--- a/noncore/net/opietooth/manager/panpopup.cpp
+++ b/noncore/net/opietooth/manager/panpopup.cpp
@@ -8,13 +8,13 @@ using namespace OpieTooth;
8 8
9/* 9/*
10 * c'tor init the QAction 10 * c'tor init the QAction
11 */ 11 */
12PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { 12PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
13 13
14 qWarning("PanPopup c'tor"); 14 owarn << "PanPopup c'tor" << oendl;
15 15
16 m_item = item; 16 m_item = item;
17 QAction *a, *b, *c; 17 QAction *a, *b, *c;
18 18
19 m_panconnection = 0l; 19 m_panconnection = 0l;
20 /* connect action */ 20 /* connect action */
diff --git a/noncore/net/opietooth/manager/popuphelper.cpp b/noncore/net/opietooth/manager/popuphelper.cpp
index ab22fea..19deb19 100644
--- a/noncore/net/opietooth/manager/popuphelper.cpp
+++ b/noncore/net/opietooth/manager/popuphelper.cpp
@@ -13,16 +13,16 @@ PopupHelper::~PopupHelper() {
13 13
14void PopupHelper::insert( int id, popupFactory fact ) { 14void PopupHelper::insert( int id, popupFactory fact ) {
15 m_map.insert(id, fact ); 15 m_map.insert(id, fact );
16} 16}
17 17
18QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) { 18QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) {
19 //qWarning("find"); 19 //owarn << "find" << oendl;
20 FactoryMap::Iterator it = m_map.find(id ); 20 FactoryMap::Iterator it = m_map.find(id );
21 if ( it != m_map.end() ) { 21 if ( it != m_map.end() ) {
22 //qWarning("found"); 22 //owarn << "found" << oendl;
23 popupFactory fact = it.data(); 23 popupFactory fact = it.data();
24 return (*fact)(ser, item); 24 return (*fact)(ser, item);
25 } 25 }
26 return 0l; 26 return 0l;
27} 27}
28 28
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp
index 78c1501..989bf45 100644
--- a/noncore/net/opietooth/manager/pppdialog.cpp
+++ b/noncore/net/opietooth/manager/pppdialog.cpp
@@ -53,13 +53,13 @@ void PPPDialog::connectToDevice() {
53 QString connectScript = "/etc/ppp/peers/" + cmdLine->text(); 53 QString connectScript = "/etc/ppp/peers/" + cmdLine->text();
54 OProcess* pppDial = new OProcess(); 54 OProcess* pppDial = new OProcess();
55 *pppDial << "pppd" << m_device << "call" << connectScript; 55 *pppDial << "pppd" << m_device << "call" << connectScript;
56 connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ), 56 connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ),
57 this, SLOT(fillOutPut(Opie::Core::OProcess*,char*,int) ) ); 57 this, SLOT(fillOutPut(Opie::Core::OProcess*,char*,int) ) );
58 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) { 58 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) {
59 qWarning("could not start"); 59 owarn << "could not start" << oendl;
60 delete pppDial; 60 delete pppDial;
61 } 61 }
62} 62}
63 63
64void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) { 64void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) {
65 QCString str(cha, len ); 65 QCString str(cha, len );
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
index fc76301..4469129 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
+++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
@@ -68,13 +68,13 @@ void RfcommAssignDialog::newDevice( const QString & mac )
68 RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); 68 RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box );
69 m_itemList.insert( i , rfcomm ); 69 m_itemList.insert( i , rfcomm );
70 rfcomm->setIdent( i ); 70 rfcomm->setIdent( i );
71 rfcomm->setMac( mac ); 71 rfcomm->setMac( mac );
72 rfcomm->setChannel( newDev->channel() ); 72 rfcomm->setChannel( newDev->channel() );
73 rfcomm->setComment( newDev->comment() ); 73 rfcomm->setComment( newDev->comment() );
74 qDebug( "New device set up" ); 74 odebug << "New device set up" << oendl;
75 } 75 }
76 } 76 }
77 } 77 }
78} 78}
79 79
80void RfcommAssignDialog::loadConfig() 80void RfcommAssignDialog::loadConfig()
@@ -89,13 +89,13 @@ void RfcommAssignDialog::loadConfig()
89 m_itemList.insert( i , rfcomm ); 89 m_itemList.insert( i , rfcomm );
90 rfcomm->setIdent( i ); 90 rfcomm->setIdent( i );
91 QMap<QString, RfCommConfObject*>::Iterator it; 91 QMap<QString, RfCommConfObject*>::Iterator it;
92 it = confHandler->foundEntries().find( QString("%1").arg( i ) ); 92 it = confHandler->foundEntries().find( QString("%1").arg( i ) );
93 if ( it != confHandler->foundEntries().end() ) 93 if ( it != confHandler->foundEntries().end() )
94 { 94 {
95 qDebug( "Found key in foundEntries() " ); 95 odebug << "Found key in foundEntries() " << oendl;
96 rfcomm->setMac( it.data()->mac() ); 96 rfcomm->setMac( it.data()->mac() );
97 rfcomm->setChannel( it.data()->channel() ); 97 rfcomm->setChannel( it.data()->channel() );
98 rfcomm->setComment( it.data()->comment() ); 98 rfcomm->setComment( it.data()->comment() );
99 } 99 }
100 /* Use rfcomm.conf directly for now 100 /* Use rfcomm.conf directly for now
101 * rfcomm->setMac( cfg.readEntry( "mac", "" ) ); 101 * rfcomm->setMac( cfg.readEntry( "mac", "" ) );
diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.cpp b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
index 20453e8..2ef95ff 100644
--- a/noncore/net/opietooth/manager/rfcommconfhandler.cpp
+++ b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
@@ -89,26 +89,26 @@ void RfCommConfHandler::load() {
89 for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) { 89 for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) {
90 90
91 QString tmpLine = ( *line ).stripWhiteSpace(); 91 QString tmpLine = ( *line ).stripWhiteSpace();
92 92
93 if ( tmpLine.startsWith("rfcomm") ) { 93 if ( tmpLine.startsWith("rfcomm") ) {
94 QString number = tmpLine.mid( 6,1 ); 94 QString number = tmpLine.mid( 6,1 );
95 qDebug( tmpLine ); 95 odebug << tmpLine << oendl;
96 qDebug( "TEST " + number ); 96 odebug << "TEST " + number << oendl;
97 } else if ( tmpLine.startsWith( "}" ) ) { 97 } else if ( tmpLine.startsWith( "}" ) ) {
98 m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) ); 98 m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) );
99 } else if ( tmpLine.startsWith( "device" ) ) { 99 } else if ( tmpLine.startsWith( "device" ) ) {
100 mac = tmpLine.mid( 7, 17 ); 100 mac = tmpLine.mid( 7, 17 );
101 qDebug( "mac" + mac ); 101 odebug << "mac" + mac << oendl;
102 } else if ( tmpLine.startsWith( "channel" ) ) { 102 } else if ( tmpLine.startsWith( "channel" ) ) {
103 channel = tmpLine.mid( 8, 1 ); 103 channel = tmpLine.mid( 8, 1 );
104 qDebug ( "Channel :" + channel ); 104 qDebug ( "Channel :" + channel );
105 } else if ( tmpLine.startsWith( "comment" ) ) { 105 } else if ( tmpLine.startsWith( "comment" ) ) {
106 comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 ); 106 comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 );
107 qDebug( "Comment: " + comment ); 107 odebug << "Comment: " + comment << oendl;
108 } 108 }
109 } 109 }
110 rfCommConf.close(); 110 rfCommConf.close();
111 } 111 }
112 save( m_foundEntries ); 112 save( m_foundEntries );
113 qDebug( QString( "ENTries: %1").arg( m_foundEntries.count() ) ); 113 odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl;
114} 114}
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp
index 04bfe48..01ad616 100644
--- a/noncore/net/opietooth/manager/rfcpopup.cpp
+++ b/noncore/net/opietooth/manager/rfcpopup.cpp
@@ -14,13 +14,13 @@ using namespace OpieTooth;
14/* 14/*
15 * c'tor init the QAction 15 * c'tor init the QAction
16 */ 16 */
17RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item ) 17RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item )
18 : QPopupMenu() 18 : QPopupMenu()
19{ 19{
20 qWarning("RfcCommPopup c'tor"); 20 owarn << "RfcCommPopup c'tor" << oendl;
21 21
22 QAction* a; 22 QAction* a;
23 23
24 24
25 m_item = item; 25 m_item = item;
26 26
@@ -67,22 +67,22 @@ RfcCommPopup::~RfcCommPopup()
67} 67}
68 68
69 69
70void RfcCommPopup::slotConnect() 70void RfcCommPopup::slotConnect()
71{ 71{
72 72
73 qWarning("connect"); 73 owarn << "connect" << oendl;
74 74
75 PPPDialog pppDialog; 75 PPPDialog pppDialog;
76 QPEApplication::execDialog( &pppDialog ); 76 QPEApplication::execDialog( &pppDialog );
77} 77}
78 78
79 79
80void RfcCommPopup::slotDisconnect() 80void RfcCommPopup::slotDisconnect()
81{ 81{
82 qWarning("slot disconnected"); 82 owarn << "slot disconnected" << oendl;
83} 83}
84 84
85 85
86void RfcCommPopup::slotBind() 86void RfcCommPopup::slotBind()
87{ 87{
88 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); 88 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
@@ -95,9 +95,9 @@ void RfcCommPopup::slotBind()
95 } 95 }
96} 96}
97 97
98 98
99void RfcCommPopup::slotBar() 99void RfcCommPopup::slotBar()
100{ 100{
101 qWarning("slotBar"); 101 owarn << "slotBar" << oendl;
102}; 102};
103 103
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index c8ea3e3..3b005c4 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -152,10 +152,10 @@ namespace OpieTooth {
152 } 152 }
153 153
154/** 154/**
155 * Cleanup 155 * Cleanup
156 */ 156 */
157 ScanDialog::~ScanDialog() { 157 ScanDialog::~ScanDialog() {
158 qWarning("delete scan dialog"); 158 owarn << "delete scan dialog" << oendl;
159 delete localDevice; 159 delete localDevice;
160 } 160 }
161} 161}
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index da39113..bfdb20a 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -20,13 +20,15 @@
20/* OPIE */ 20/* OPIE */
21#include <opie2/onetwork.h> 21#include <opie2/onetwork.h>
22#ifdef QWS 22#ifdef QWS
23#include <opie2/oapplication.h> 23#include <opie2/oapplication.h>
24#include <opie2/oconfig.h> 24#include <opie2/oconfig.h>
25#include <opie2/odevice.h> 25#include <opie2/odevice.h>
26using namespace Opie; 26#include <opie2/odebug.h>
27using namespace Opie::Core;
28using namespace Opie::Net;
27#endif 29#endif
28 30
29/* QT */ 31/* QT */
30#include <qapplication.h> 32#include <qapplication.h>
31#include <qcheckbox.h> 33#include <qcheckbox.h>
32#include <qcombobox.h> 34#include <qcombobox.h>
@@ -37,21 +39,15 @@ using namespace Opie;
37#include <qpushbutton.h> 39#include <qpushbutton.h>
38#include <qtabwidget.h> 40#include <qtabwidget.h>
39#include <qtoolbutton.h> 41#include <qtoolbutton.h>
40#include <qspinbox.h> 42#include <qspinbox.h>
41#include <qtextstream.h> 43#include <qtextstream.h>
42 44
43/* POSIX */ 45/* STD */
44#include <assert.h> 46#include <assert.h>
45 47
46using namespace Opie::Core;
47using namespace Opie::Net;
48using namespace Opie::Core;
49using namespace Opie::Net;
50using namespace Opie::Core;
51using namespace Opie::Net;
52WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; 48WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0;
53 49
54WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) 50WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f )
55 :WellenreiterConfigBase( parent, name, true, f ) 51 :WellenreiterConfigBase( parent, name, true, f )
56{ 52{
57 _devicetype[ "cisco" ] = DEVTYPE_CISCO; 53 _devicetype[ "cisco" ] = DEVTYPE_CISCO;
@@ -113,13 +109,13 @@ WellenreiterConfigWindow::~WellenreiterConfigWindow()
113void WellenreiterConfigWindow::performAutodetection() 109void WellenreiterConfigWindow::performAutodetection()
114{ 110{
115 //TODO: insert modal splash screen here 111 //TODO: insert modal splash screen here
116 // and sleep a second, so that it looks 112 // and sleep a second, so that it looks
117 // like we're actually doing something fancy... ;-) 113 // like we're actually doing something fancy... ;-)
118 114
119 qDebug( "WellenreiterConfigWindow::performAutodetection()" ); 115 odebug << "WellenreiterConfigWindow::performAutodetection()" << oendl;
120 116
121 // try to guess device type 117 // try to guess device type
122 QFile m( "/proc/modules" ); 118 QFile m( "/proc/modules" );
123 if ( m.open( IO_ReadOnly ) ) 119 if ( m.open( IO_ReadOnly ) )
124 { 120 {
125 int devicetype(0); 121 int devicetype(0);
@@ -134,13 +130,13 @@ void WellenreiterConfigWindow::performAutodetection()
134 else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO; 130 else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO;
135 } 131 }
136 if ( devicetype ) 132 if ( devicetype )
137 { 133 {
138 deviceType->setCurrentItem( devicetype ); 134 deviceType->setCurrentItem( devicetype );
139 _guess = devicetype; 135 _guess = devicetype;
140 qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); 136 odebug << "Wellenreiter: guessed device type to be #" << devicetype << "" << oendl;
141 } 137 }
142 } 138 }
143} 139}
144 140
145 141
146int WellenreiterConfigWindow::driverType() const 142int WellenreiterConfigWindow::driverType() const
@@ -238,13 +234,13 @@ void WellenreiterConfigWindow::changedStationAction(int t)
238} 234}
239 235
240 236
241void WellenreiterConfigWindow::getCaptureFileNameClicked() 237void WellenreiterConfigWindow::getCaptureFileNameClicked()
242{ 238{
243 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); 239 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true);
244 qDebug( "name = %s", (const char*) name ); 240 odebug << "name = " << (const char*) name << "" << oendl;
245 if ( !name.isEmpty() ) 241 if ( !name.isEmpty() )
246 { 242 {
247 captureFileName->setText( name ); 243 captureFileName->setText( name );
248 } 244 }
249} 245}
250 246
@@ -313,17 +309,17 @@ void WellenreiterConfigWindow::performAction( const QString& type,
313 { 309 {
314 action = newStationAction->currentItem(); 310 action = newStationAction->currentItem();
315 script = newStationScript->text(); 311 script = newStationScript->text();
316 } 312 }
317 else 313 else
318 { 314 {
319 qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type ); 315 owarn << "WellenreiterConfigWindow::performAction(): unknown type '" << (const char*) type << "'" << oendl;
320 return; 316 return;
321 } 317 }
322 318
323 qDebug( "for event '%s' I'm going to perform action %d (script='%s')", (const char*) type, action, (const char*) script ); 319 odebug << "for event '" << (const char*) type << "' I'm going to perform action " << action << " (script='" << (const char*) script << "')" << oendl;
324 320
325 switch( action ) 321 switch( action )
326 { 322 {
327 case 0: /* Ignore */ return; 323 case 0: /* Ignore */ return;
328 case 1: /* Play Alarm */ ODevice::inst()->playAlarmSound(); return; 324 case 1: /* Play Alarm */ ODevice::inst()->playAlarmSound(); return;
329 case 2: /* Play Click */ ODevice::inst()->playTouchSound(); return; 325 case 2: /* Play Click */ ODevice::inst()->playTouchSound(); return;
@@ -342,15 +338,15 @@ void WellenreiterConfigWindow::performAction( const QString& type,
342 **/ 338 **/
343 script = script.replace( QRegExp( "$SSID" ), essid ); 339 script = script.replace( QRegExp( "$SSID" ), essid );
344 script = script.replace( QRegExp( "$MAC" ), mac ); 340 script = script.replace( QRegExp( "$MAC" ), mac );
345 script = script.replace( QRegExp( "$WEP" ), wep ? QString( "true" ) : QString( "false" ) ); 341 script = script.replace( QRegExp( "$WEP" ), wep ? QString( "true" ) : QString( "false" ) );
346 script = script.replace( QRegExp( "$CHAN" ), QString::number( channel ) ); 342 script = script.replace( QRegExp( "$CHAN" ), QString::number( channel ) );
347 343
348 qDebug( "going to call script '%s'", (const char*) script ); 344 odebug << "going to call script '" << (const char*) script << "'" << oendl;
349 ::system( script ); 345 ::system( script );
350 qDebug( "script returned." ); 346 odebug << "script returned." << oendl;
351 return; 347 return;
352 } 348 }
353 default: assert( false ); 349 default: assert( false );
354 } 350 }
355} 351}
356 352
@@ -358,13 +354,13 @@ void WellenreiterConfigWindow::performAction( const QString& type,
358void WellenreiterConfigWindow::load() 354void WellenreiterConfigWindow::load()
359{ 355{
360#ifdef Q_WS_X11 356#ifdef Q_WS_X11
361 #warning Persistent Configuration not yet implemented for standalone X11 build 357 #warning Persistent Configuration not yet implemented for standalone X11 build
362 performAutodetection(); 358 performAutodetection();
363#else 359#else
364 qDebug( "loading configuration settings..." ); 360 odebug << "loading configuration settings..." << oendl;
365 361
366 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ 362 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */
367 363
368 OConfig* c = oApp->config(); 364 OConfig* c = oApp->config();
369 365
370 c->setGroup( "Interface" ); 366 c->setGroup( "Interface" );
@@ -436,13 +432,13 @@ void WellenreiterConfigWindow::load()
436 432
437void WellenreiterConfigWindow::save() 433void WellenreiterConfigWindow::save()
438{ 434{
439#ifdef Q_WS_X11 435#ifdef Q_WS_X11
440 #warning Persistent Configuration not yet implemented for standalone X11 build 436 #warning Persistent Configuration not yet implemented for standalone X11 build
441#else 437#else
442 qDebug( "saving configuration settings..." ); 438 odebug << "saving configuration settings..." << oendl;
443 439
444 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ 440 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */
445 441
446 OConfig* c = oApp->config(); 442 OConfig* c = oApp->config();
447 443
448 c->setGroup( "Interface" ); 444 c->setGroup( "Interface" );
diff --git a/noncore/net/wellenreiter/gui/gps.cpp b/noncore/net/wellenreiter/gui/gps.cpp
index a47b4ec..bd91e35 100644
--- a/noncore/net/wellenreiter/gui/gps.cpp
+++ b/noncore/net/wellenreiter/gui/gps.cpp
@@ -12,30 +12,34 @@
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**********************************************************************/ 14**********************************************************************/
15 15
16#include "gps.h" 16#include "gps.h"
17 17
18/* OPIE */
19#include <opie2/odebug.h>
20using namespace Opie::Core;
21
18/* QT */ 22/* QT */
19#include <qtextstream.h> 23#include <qtextstream.h>
20 24
21/* STD */ 25/* STD */
22#include <stdlib.h> 26#include <stdlib.h>
23#include <unistd.h> 27#include <unistd.h>
24 28
25GPS::GPS( QObject* parent, const char * name ) 29GPS::GPS( QObject* parent, const char * name )
26 :QObject( parent, name ) 30 :QObject( parent, name )
27{ 31{
28 qDebug( "GPS::GPS()" ); 32 odebug << "GPS::GPS()" << oendl;
29 _socket = new QSocket( this, "gpsd commsock" ); 33 _socket = new QSocket( this, "gpsd commsock" );
30} 34}
31 35
32 36
33GPS::~GPS() 37GPS::~GPS()
34{ 38{
35 qDebug( "GPS::~GPS()" ); 39 odebug << "GPS::~GPS()" << oendl;
36} 40}
37 41
38 42
39bool GPS::open( const QString& host, int port ) 43bool GPS::open( const QString& host, int port )
40{ 44{
41 _socket->connectToHost( host, port ); 45 _socket->connectToHost( host, port );
@@ -50,21 +54,21 @@ GpsLocation GPS::position() const
50 54
51 int result = _socket->writeBlock( "p\r\n", 3 ); 55 int result = _socket->writeBlock( "p\r\n", 3 );
52 _socket->flush(); 56 _socket->flush();
53 if ( result ) 57 if ( result )
54 { 58 {
55 int numAvail = _socket->bytesAvailable(); 59 int numAvail = _socket->bytesAvailable();
56 qDebug( "GPS write succeeded, %d bytes available for reading...", numAvail ); 60 odebug << "GPS write succeeded, " << numAvail << " bytes available for reading..." << oendl;
57 if ( numAvail ) 61 if ( numAvail )
58 { 62 {
59 int numRead = _socket->readBlock( &buf[0], sizeof buf ); 63 int numRead = _socket->readBlock( &buf[0], sizeof buf );
60 int numScan = ::sscanf( &buf[0], "GPSD,P=%lg %lg", &lat, &lon); 64 int numScan = ::sscanf( &buf[0], "GPSD,P=%lg %lg", &lat, &lon);
61 65
62 if ( numRead < 7 || numScan != 2 ) 66 if ( numRead < 7 || numScan != 2 )
63 { 67 {
64 qDebug( "GPS read %d bytes succeeded, invalid response: '%s'", numRead, &buf[0] ); 68 odebug << "GPS read " << numRead << " bytes succeeded, invalid response: '" << &buf[0] << "'" << oendl;
65 return GpsLocation( -111, -111 ); 69 return GpsLocation( -111, -111 );
66 } 70 }
67 else 71 else
68 { 72 {
69 return GpsLocation( lat, lon ); 73 return GpsLocation( lat, lon );
70 } 74 }
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp
index 1c72cf4..714a9a9 100644
--- a/noncore/net/wellenreiter/gui/logwindow.cpp
+++ b/noncore/net/wellenreiter/gui/logwindow.cpp
@@ -11,12 +11,18 @@
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**********************************************************************/ 14**********************************************************************/
15 15
16#include "logwindow.h" 16#include "logwindow.h"
17
18/* OPIE */
19#include <opie2/odebug.h>
20using namespace Opie::Core;
21
22/* QT */
17#include <qmultilineedit.h> 23#include <qmultilineedit.h>
18#include <qdatetime.h> 24#include <qdatetime.h>
19 25
20MLogWindow* MLogWindow::_instance; 26MLogWindow* MLogWindow::_instance;
21 27
22MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) 28MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f )
@@ -35,13 +41,13 @@ void MLogWindow::log( QString text )
35 QString line; 41 QString line;
36 line.sprintf( "[%s] %s\n", (const char*) time.toString(), (const char*) text ); 42 line.sprintf( "[%s] %s\n", (const char*) time.toString(), (const char*) text );
37 int col; 43 int col;
38 int row; 44 int row;
39 ledit->getCursorPosition( &col, &row ); 45 ledit->getCursorPosition( &col, &row );
40 ledit->insertAt( line, col, row ); 46 ledit->insertAt( line, col, row );
41 qDebug( line ); 47 odebug << line << oendl;
42} 48}
43 49
44 50
45void MLogWindow::clear() 51void MLogWindow::clear()
46{ 52{
47 ledit->clear(); 53 ledit->clear();
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp
index 6bbc39b..62db967 100644
--- a/noncore/net/wellenreiter/gui/main.cpp
+++ b/noncore/net/wellenreiter/gui/main.cpp
@@ -11,30 +11,33 @@
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**********************************************************************/ 14**********************************************************************/
15 15
16#include "mainwindow.h" 16#include "mainwindow.h"
17
17#ifdef QWS 18#ifdef QWS
19#include <opie2/odebug.h>
18#include <opie2/oapplication.h> 20#include <opie2/oapplication.h>
19#include <opie2/oprocess.h> 21#include <opie2/oprocess.h>
20#else 22#else
21#include <qapplication.h> 23#include <qapplication.h>
22#endif 24#endif
23 25
26/* QT */
24#include <qmessagebox.h> 27#include <qmessagebox.h>
25#include <qstringlist.h> 28#include <qstringlist.h>
26 29
30/* STD */
27#include <errno.h> 31#include <errno.h>
28#include <signal.h> 32#include <signal.h>
29#include <string.h> 33#include <string.h>
30#include <unistd.h> 34#include <unistd.h>
31 35
32using namespace Opie::Core; 36using namespace Opie::Core;
33using namespace Opie::Core; 37
34using namespace Opie::Core;
35int main( int argc, char **argv ) 38int main( int argc, char **argv )
36{ 39{
37 #ifdef QWS 40 #ifdef QWS
38 OApplication a( argc, argv, "Wellenreiter II" ); 41 OApplication a( argc, argv, "Wellenreiter II" );
39 #else 42 #else
40 QApplication a( argc, argv ); 43 QApplication a( argc, argv );
@@ -52,27 +55,27 @@ int main( int argc, char **argv )
52 int result = -1; 55 int result = -1;
53 static int killed = false; 56 static int killed = false;
54 57
55 bool check = true; 58 bool check = true;
56 for ( int i = 1; i < argc; ++i ) 59 for ( int i = 1; i < argc; ++i )
57 { 60 {
58 qDebug( "Wellenreiter::main() parsing argument %d = '%s'", i, argv[i] ); 61 odebug << "Wellenreiter::main() parsing argument " << i << " = '" << argv[i] << "'" << oendl;
59 if ( !strcmp( "-nocheck", argv[i] ) ) 62 if ( !strcmp( "-nocheck", argv[i] ) )
60 { 63 {
61 qDebug( "-nocheck found" ); 64 odebug << "-nocheck found" << oendl;
62 check = false; 65 check = false;
63 break; 66 break;
64 } 67 }
65 } 68 }
66 69
67 if ( check ) 70 if ( check )
68 { 71 {
69 // root check 72 // root check
70 if ( getuid() ) 73 if ( getuid() )
71 { 74 {
72 qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) ); 75 owarn << QObject::tr( "Wellenreiter: trying to run as non-root!" ) << oendl;
73 result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n" 76 result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n"
74 "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ), 77 "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ),
75 QMessageBox::Yes, QMessageBox::No ); 78 QMessageBox::Yes, QMessageBox::No );
76 if ( result == QMessageBox::No ) return -1; 79 if ( result == QMessageBox::No ) return -1;
77 } 80 }
78 81
@@ -83,13 +86,13 @@ int main( int argc, char **argv )
83 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n" 86 result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", QObject::tr( "You have a dhcp client running.\n"
84 "(PID = %1)\nThis can severly limit scanning!\nShould I kill it for you?" ).arg( dhcpid ), 87 "(PID = %1)\nThis can severly limit scanning!\nShould I kill it for you?" ).arg( dhcpid ),
85 QMessageBox::Yes, QMessageBox::No ); 88 QMessageBox::Yes, QMessageBox::No );
86 if ( result == QMessageBox::Yes ) 89 if ( result == QMessageBox::Yes )
87 { 90 {
88 if ( -1 == ::kill( dhcpid, SIGTERM ) ) 91 if ( -1 == ::kill( dhcpid, SIGTERM ) )
89 qWarning( "Wellenreiter: can't kill process #%d (%s)", result, strerror( errno ) ); 92 owarn << "Wellenreiter: can't kill process #" << result << " (" << strerror( errno ) << ")" << oendl;
90 else 93 else
91 killed = true; 94 killed = true;
92 } 95 }
93 } 96 }
94 } 97 }
95 98
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 7add6cd..a4b8839 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -18,12 +18,27 @@
18#include "logwindow.h" 18#include "logwindow.h"
19#include "packetview.h" 19#include "packetview.h"
20#include "mainwindow.h" 20#include "mainwindow.h"
21#include "wellenreiter.h" 21#include "wellenreiter.h"
22#include "scanlist.h" 22#include "scanlist.h"
23 23
24/* OPIE */
25#ifdef QWS
26#include <qpe/resource.h>
27#include <opie2/odebug.h>
28#include <opie2/ofiledialog.h>
29#else
30#include "resource.h"
31#include <qapplication.h>
32#include <qfiledialog.h>
33#endif
34using namespace Opie::Core;
35using namespace Opie::Net;
36using namespace Opie::Ui;
37
38/* QT */
24#include <qcombobox.h> 39#include <qcombobox.h>
25#include <qdatastream.h> 40#include <qdatastream.h>
26#include <qfile.h> 41#include <qfile.h>
27#include <qfileinfo.h> 42#include <qfileinfo.h>
28#include <qlabel.h> 43#include <qlabel.h>
29#include <qlayout.h> 44#include <qlayout.h>
@@ -36,29 +51,15 @@
36#include <qstatusbar.h> 51#include <qstatusbar.h>
37#include <qspinbox.h> 52#include <qspinbox.h>
38#include <qtextstream.h> 53#include <qtextstream.h>
39#include <qtoolbutton.h> 54#include <qtoolbutton.h>
40#include <qwhatsthis.h> 55#include <qwhatsthis.h>
41 56
42#ifdef QWS 57/* STD */
43#include <qpe/resource.h>
44#include <opie2/ofiledialog.h>
45using namespace Opie;
46#else
47#include "resource.h"
48#include <qapplication.h>
49#include <qfiledialog.h>
50#endif
51
52#include <unistd.h> 58#include <unistd.h>
53 59
54using namespace Opie::Ui;
55using namespace Opie::Net;
56using namespace Opie::Ui;
57using namespace Opie::Net;
58using namespace Opie::Net;
59WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) 60WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f )
60 :QMainWindow( parent, name, f ) 61 :QMainWindow( parent, name, f )
61{ 62{
62 cw = new WellenreiterConfigWindow( this ); 63 cw = new WellenreiterConfigWindow( this );
63 mw = new Wellenreiter( this ); 64 mw = new Wellenreiter( this );
64 mw->setConfigWindow( cw ); 65 mw->setConfigWindow( cw );
@@ -185,13 +186,13 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
185}; 186};
186 187
187 188
188 189
189void WellenreiterMainWindow::showConfigure() 190void WellenreiterMainWindow::showConfigure()
190{ 191{
191 qDebug( "show configure..." ); 192 odebug << "show configure..." << oendl;
192 cw->setCaption( tr( "Configure" ) ); 193 cw->setCaption( tr( "Configure" ) );
193 int result = QPEApplication::execDialog( cw ); 194 int result = QPEApplication::execDialog( cw );
194 195
195 if ( result ) updateToolButtonState(); 196 if ( result ) updateToolButtonState();
196} 197}
197 198
@@ -228,13 +229,13 @@ void WellenreiterMainWindow::changedSniffingState()
228 } 229 }
229} 230}
230 231
231 232
232WellenreiterMainWindow::~WellenreiterMainWindow() 233WellenreiterMainWindow::~WellenreiterMainWindow()
233{ 234{
234 qDebug( "Wellenreiter: bye." ); 235 odebug << "Wellenreiter: bye." << oendl;
235}; 236};
236 237
237 238
238void WellenreiterMainWindow::demoAddStations() 239void WellenreiterMainWindow::demoAddStations()
239{ 240{
240 //mw = 0; // test SIGSEGV handling 241 //mw = 0; // test SIGSEGV handling
@@ -248,13 +249,13 @@ void WellenreiterMainWindow::demoAddStations()
248 249
249 250
250void WellenreiterMainWindow::demoReadFromGps() 251void WellenreiterMainWindow::demoReadFromGps()
251{ 252{
252 WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance(); 253 WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance();
253 GPS* gps = new GPS( this ); 254 GPS* gps = new GPS( this );
254 qDebug( "Wellenreiter::demoReadFromGps(): url=gps://%s:%d/", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 255 odebug << "Wellenreiter::demoReadFromGps(): url=gps://" << (const char*) configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "/" << oendl;
255 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 256 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
256 GpsLocation loc = gps->position(); 257 GpsLocation loc = gps->position();
257 QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n%1" ).arg( loc.dmsPosition() ) ); 258 QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n%1" ).arg( loc.dmsPosition() ) );
258 delete gps; 259 delete gps;
259} 260}
260 261
@@ -302,17 +303,17 @@ void WellenreiterMainWindow::fileSaveLog()
302 QFile f( fname ); 303 QFile f( fname );
303 if ( f.open(IO_WriteOnly) ) 304 if ( f.open(IO_WriteOnly) )
304 { 305 {
305 QTextStream t( &f ); 306 QTextStream t( &f );
306 t << mw->logWindow()->getLog(); 307 t << mw->logWindow()->getLog();
307 f.close(); 308 f.close();
308 qDebug( "Saved log to file '%s'", (const char*) fname ); 309 odebug << "Saved log to file '" << (const char*) fname << "'" << oendl;
309 } 310 }
310 else 311 else
311 { 312 {
312 qDebug( "Problem saving log to file '%s'", (const char*) fname ); 313 odebug << "Problem saving log to file '" << (const char*) fname << "'" << oendl;
313 } 314 }
314 } 315 }
315} 316}
316 317
317void WellenreiterMainWindow::fileSaveSession() 318void WellenreiterMainWindow::fileSaveSession()
318{ 319{
@@ -323,17 +324,17 @@ void WellenreiterMainWindow::fileSaveSession()
323 QFile f( fname ); 324 QFile f( fname );
324 if ( f.open(IO_WriteOnly) ) 325 if ( f.open(IO_WriteOnly) )
325 { 326 {
326 QDataStream t( &f ); 327 QDataStream t( &f );
327 t << *mw->netView(); 328 t << *mw->netView();
328 f.close(); 329 f.close();
329 qDebug( "Saved session to file '%s'", (const char*) fname ); 330 odebug << "Saved session to file '" << (const char*) fname << "'" << oendl;
330 } 331 }
331 else 332 else
332 { 333 {
333 qDebug( "Problem saving session to file '%s'", (const char*) fname ); 334 odebug << "Problem saving session to file '" << (const char*) fname << "'" << oendl;
334 } 335 }
335 } 336 }
336} 337}
337 338
338void WellenreiterMainWindow::fileSaveHex() 339void WellenreiterMainWindow::fileSaveHex()
339{ 340{
@@ -345,17 +346,17 @@ void WellenreiterMainWindow::fileSaveHex()
345 QFile f( fname ); 346 QFile f( fname );
346 if ( f.open(IO_WriteOnly) ) 347 if ( f.open(IO_WriteOnly) )
347 { 348 {
348 QTextStream t( &f ); 349 QTextStream t( &f );
349 t << mw->hexWindow()->getLog(); 350 t << mw->hexWindow()->getLog();
350 f.close(); 351 f.close();
351 qDebug( "Saved hex log to file '%s'", (const char*) fname ); 352 odebug << "Saved hex log to file '" << (const char*) fname << "'" << oendl;
352 } 353 }
353 else 354 else
354 { 355 {
355 qDebug( "Problem saving hex log to file '%s'", (const char*) fname ); 356 odebug << "Problem saving hex log to file '" << (const char*) fname << "'" << oendl;
356 } 357 }
357 } 358 }
358 */ 359 */
359} 360}
360 361
361void WellenreiterMainWindow::fileLoadSession() 362void WellenreiterMainWindow::fileLoadSession()
@@ -366,17 +367,17 @@ void WellenreiterMainWindow::fileLoadSession()
366 QFile f( fname ); 367 QFile f( fname );
367 if ( f.open(IO_ReadOnly) ) 368 if ( f.open(IO_ReadOnly) )
368 { 369 {
369 QDataStream t( &f ); 370 QDataStream t( &f );
370 t >> *mw->netView(); 371 t >> *mw->netView();
371 f.close(); 372 f.close();
372 qDebug( "Loaded session from file '%s'", (const char*) fname ); 373 odebug << "Loaded session from file '" << (const char*) fname << "'" << oendl;
373 } 374 }
374 else 375 else
375 { 376 {
376 qDebug( "Problem loading session from file '%s'", (const char*) fname ); 377 odebug << "Problem loading session from file '" << (const char*) fname << "'" << oendl;
377 } 378 }
378 } 379 }
379} 380}
380 381
381 382
382void WellenreiterMainWindow::fileNew() 383void WellenreiterMainWindow::fileNew()
@@ -435,17 +436,17 @@ void WellenreiterMainWindow::uploadSession()
435 connect( accept, SIGNAL( clicked() ), d, SLOT( accept() ) ); 436 connect( accept, SIGNAL( clicked() ), d, SLOT( accept() ) );
436 connect( reject, SIGNAL( clicked() ), d, SLOT( reject() ) ); 437 connect( reject, SIGNAL( clicked() ), d, SLOT( reject() ) );
437 int result = d->exec(); 438 int result = d->exec();
438 439
439 if ( !result ) 440 if ( !result )
440 { 441 {
441 qDebug( "Session upload cancelled :(" ); 442 odebug << "Session upload cancelled :(" << oendl;
442 return; 443 return;
443 } 444 }
444 445
445 qDebug( "Starting upload..." ); 446 odebug << "Starting upload..." << oendl;
446 447
447 struct sockaddr_in raddr; 448 struct sockaddr_in raddr;
448 struct hostent *rhost_info; 449 struct hostent *rhost_info;
449 int sock = -1; 450 int sock = -1;
450 bool ok = false; 451 bool ok = false;
451 452
diff --git a/noncore/net/wellenreiter/gui/packetview.cpp b/noncore/net/wellenreiter/gui/packetview.cpp
index 3d3aa18..4df01da 100644
--- a/noncore/net/wellenreiter/gui/packetview.cpp
+++ b/noncore/net/wellenreiter/gui/packetview.cpp
@@ -81,13 +81,13 @@ void PacketView::showPacket( int number )
81 { 81 {
82 _doSubPackets( const_cast<QObjectList*>( p->children() ), 0 ); 82 _doSubPackets( const_cast<QObjectList*>( p->children() ), 0 );
83 _doHexPacket( p ); 83 _doHexPacket( p );
84 } 84 }
85 else 85 else
86 { 86 {
87 qDebug( "D'oh! No packet!" ); 87 odebug << "D'oh! No packet!" << oendl;
88 } 88 }
89} 89}
90 90
91void PacketView::_doSubPackets( QObjectList* l, int counter ) 91void PacketView::_doSubPackets( QObjectList* l, int counter )
92{ 92{
93 if (!l) return; 93 if (!l) return;
diff --git a/noncore/net/wellenreiter/gui/resource.cpp b/noncore/net/wellenreiter/gui/resource.cpp
index d98ef0b..cb17f51 100644
--- a/noncore/net/wellenreiter/gui/resource.cpp
+++ b/noncore/net/wellenreiter/gui/resource.cpp
@@ -26,24 +26,24 @@ QPixmap loadPixmap( const QString& pix )
26{ 26{
27 QString filename; 27 QString filename;
28 filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix ); 28 filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix );
29 QPixmap pixmap( filename ); 29 QPixmap pixmap( filename );
30 if ( pixmap.isNull() ) 30 if ( pixmap.isNull() )
31 { 31 {
32 qDebug( "Wellenreiter::Resource: can't find pixmap " + filename ); 32 odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl;
33 } 33 }
34 return pixmap; 34 return pixmap;
35}; 35};
36 36
37QIconSet loadIconSet( const QString& pix ) 37QIconSet loadIconSet( const QString& pix )
38{ 38{
39 QString filename; 39 QString filename;
40 filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix ); 40 filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix );
41 QPixmap pixmap( filename ); 41 QPixmap pixmap( filename );
42 if ( pixmap.isNull() ) 42 if ( pixmap.isNull() )
43 { 43 {
44 qDebug( "Wellenreiter::Resource: can't find pixmap " + filename ); 44 odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl;
45 } 45 }
46 return QIconSet( pixmap ); 46 return QIconSet( pixmap );
47}; 47};
48 48
49}; 49};
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 3b7120a..a2be782 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -14,27 +14,32 @@
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "scanlist.h" 16#include "scanlist.h"
17#include "configwindow.h" 17#include "configwindow.h"
18#include "logwindow.h" 18#include "logwindow.h"
19 19
20#include <assert.h> 20/* OPIE */
21#include <qcursor.h>
22#include <qdatetime.h>
23#include <qpopupmenu.h>
24#include <qcheckbox.h>
25
26#ifdef QWS 21#ifdef QWS
22#include <opie2/odebug.h>
27#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
28#endif
29
30#ifdef QWS
31#include <qpe/resource.h> 24#include <qpe/resource.h>
32#else 25#else
33#include "resource.h" 26#include "resource.h"
34#endif 27#endif
28using namespace Opie::Core;
29using namespace Opie::Ui;
30using namespace Opie::Net;
31
32/* QT */
33#include <qcursor.h>
34#include <qdatetime.h>
35#include <qpopupmenu.h>
36#include <qcheckbox.h>
37
38/* STD */
39#include <assert.h>
35 40
36const int col_type = 0; 41const int col_type = 0;
37const int col_essid = 0; 42const int col_essid = 0;
38const int col_sig = 1; 43const int col_sig = 1;
39const int col_ap = 2; 44const int col_ap = 2;
40const int col_channel = 3; 45const int col_channel = 3;
@@ -43,18 +48,12 @@ const int col_traffic = 5;
43const int col_ip = 6; 48const int col_ip = 6;
44const int col_manuf = 7; 49const int col_manuf = 7;
45const int col_firstseen = 8; 50const int col_firstseen = 8;
46const int col_lastseen = 9; 51const int col_lastseen = 9;
47const int col_location = 10; 52const int col_location = 10;
48 53
49using namespace Opie::Net;
50using namespace Opie::Ui;
51using namespace Opie::Net;
52using namespace Opie::Ui;
53using namespace Opie::Ui;
54using namespace Opie::Net;
55MScanListView::MScanListView( QWidget* parent, const char* name ) 54MScanListView::MScanListView( QWidget* parent, const char* name )
56 :OListView( parent, name ) 55 :OListView( parent, name )
57{ 56{
58 setFrameShape( QListView::StyledPanel ); 57 setFrameShape( QListView::StyledPanel );
59 setFrameShadow( QListView::Sunken ); 58 setFrameShadow( QListView::Sunken );
60 59
@@ -103,20 +102,20 @@ OListViewItem* MScanListView::childFactory()
103 return new MScanListItem( this ); 102 return new MScanListItem( this );
104} 103}
105 104
106 105
107void MScanListView::serializeTo( QDataStream& s) const 106void MScanListView::serializeTo( QDataStream& s) const
108{ 107{
109 qDebug( "serializing MScanListView" ); 108 odebug << "serializing MScanListView" << oendl;
110 OListView::serializeTo( s ); 109 OListView::serializeTo( s );
111} 110}
112 111
113 112
114void MScanListView::serializeFrom( QDataStream& s) 113void MScanListView::serializeFrom( QDataStream& s)
115{ 114{
116 qDebug( "serializing MScanListView" ); 115 odebug << "serializing MScanListView" << oendl;
117 OListView::serializeFrom( s ); 116 OListView::serializeFrom( s );
118} 117}
119 118
120 119
121void MScanListView::addNewItem( const QString& type, 120void MScanListView::addNewItem( const QString& type,
122 const QString& essid, 121 const QString& essid,
@@ -140,13 +139,13 @@ void MScanListView::addNewItem( const QString& type,
140 MScanListItem* network; 139 MScanListItem* network;
141 MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); 140 MScanListItem* item = static_cast<MScanListItem*> ( firstChild() );
142 141
143 while ( item && ( item->text( col_essid ) != essid ) ) 142 while ( item && ( item->text( col_essid ) != essid ) )
144 { 143 {
145 #ifdef DEBUG 144 #ifdef DEBUG
146 qDebug( "itemtext: %s", (const char*) item->text( col_essid ) ); 145 odebug << "itemtext: " << (const char*) item->text( col_essid ) << "" << oendl;
147 #endif 146 #endif
148 item = static_cast<MScanListItem*> ( item->nextSibling() ); 147 item = static_cast<MScanListItem*> ( item->nextSibling() );
149 } 148 }
150 if ( item ) 149 if ( item )
151 { 150 {
152 // we have already seen this net, check all childs if MAC exists 151 // we have already seen this net, check all childs if MAC exists
@@ -156,22 +155,22 @@ void MScanListView::addNewItem( const QString& type,
156 item = static_cast<MScanListItem*> ( item->firstChild() ); 155 item = static_cast<MScanListItem*> ( item->firstChild() );
157 assert( item ); // this shouldn't fail 156 assert( item ); // this shouldn't fail
158 157
159 while ( item && ( item->text( col_ap ) != macaddr ) ) 158 while ( item && ( item->text( col_ap ) != macaddr ) )
160 { 159 {
161 #ifdef DEBUG 160 #ifdef DEBUG
162 qDebug( "subitemtext: %s", (const char*) item->text( col_ap ) ); 161 odebug << "subitemtext: " << (const char*) item->text( col_ap ) << "" << oendl;
163 #endif 162 #endif
164 item = static_cast<MScanListItem*> ( item->nextSibling() ); 163 item = static_cast<MScanListItem*> ( item->nextSibling() );
165 } 164 }
166 165
167 if ( item ) 166 if ( item )
168 { 167 {
169 // we have already seen this item, it's a dupe 168 // we have already seen this item, it's a dupe
170 #ifdef DEBUG 169 #ifdef DEBUG
171 qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); 170 odebug << "" << (const char*) macaddr << " is a dupe - ignoring..." << oendl;
172 #endif 171 #endif
173 item->receivedBeacon(); 172 item->receivedBeacon();
174 return; 173 return;
175 } 174 }
176 } 175 }
177 else 176 else
@@ -183,13 +182,13 @@ void MScanListView::addNewItem( const QString& type,
183 182
184 183
185 // insert new station as child from network 184 // insert new station as child from network
186 // no essid to reduce clutter, maybe later we have a nick or stationname to display!? 185 // no essid to reduce clutter, maybe later we have a nick or stationname to display!?
187 186
188 #ifdef DEBUG 187 #ifdef DEBUG
189 qDebug( "inserting new station %s", (const char*) macaddr ); 188 odebug << "inserting new station " << (const char*) macaddr << "" << oendl;
190 #endif 189 #endif
191 190
192 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); 191 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
193 station->setManufacturer( mac.manufacturer() ); 192 station->setManufacturer( mac.manufacturer() );
194 station->setLocation( loc.dmsPosition() ); 193 station->setLocation( loc.dmsPosition() );
195 194
@@ -209,22 +208,22 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress&
209{ 208{
210 MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() ); 209 MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() );
211 210
212 while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) ) 211 while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) )
213 { 212 {
214 #ifdef DEBUG 213 #ifdef DEBUG
215 qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) ); 214 odebug << "subitemtext: " << (const char*) subitem->text( col_ap ) << "" << oendl;
216 #endif 215 #endif
217 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); 216 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
218 } 217 }
219 218
220 if ( subitem ) 219 if ( subitem )
221 { 220 {
222 // we have already seen this item, it's a dupe 221 // we have already seen this item, it's a dupe
223 #ifdef DEBUG 222 #ifdef DEBUG
224 qDebug( "%s is a dupe - ignoring...", (const char*) addr.toString(true) ); 223 odebug << "" << (const char*) addr.toString(true) << " is a dupe - ignoring..." << oendl;
225 #endif 224 #endif
226 subitem->receivedBeacon(); //FIXME: sent data bit 225 subitem->receivedBeacon(); //FIXME: sent data bit
227 return; 226 return;
228 } 227 }
229 228
230 // Hey, it seems to be a new item :-D 229 // Hey, it seems to be a new item :-D
@@ -243,13 +242,13 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress&
243 MLogWindow::logwindow()->log( s ); 242 MLogWindow::logwindow()->log( s );
244} 243}
245 244
246 245
247void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) 246void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo )
248{ 247{
249 qDebug( "WDSTraffic: %s and %s seem to form a WDS", (const char*) viaFrom.toString(), (const char*) viaTo.toString() ); 248 odebug << "WDSTraffic: " << (const char*) viaFrom.toString() << " and " << (const char*) viaTo.toString() << " seem to form a WDS" << oendl;
250 QString s; 249 QString s;
251 MScanListItem* network; 250 MScanListItem* network;
252 251
253 QListViewItemIterator it( this ); 252 QListViewItemIterator it( this );
254 while ( it.current() && 253 while ( it.current() &&
255 it.current()->text( col_ap ) != viaFrom.toString(true) && 254 it.current()->text( col_ap ) != viaFrom.toString(true) &&
@@ -261,13 +260,13 @@ void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to,
261 { 260 {
262 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from ); 261 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from );
263 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), to ); 262 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), to );
264 } 263 }
265 else 264 else
266 { 265 {
267 qDebug( "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" ); 266 odebug << "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" << oendl;
268 MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" ); 267 MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" );
269 } 268 }
270} 269}
271 270
272 271
273void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) 272void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
@@ -283,13 +282,13 @@ void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to,
283 if ( item ) // AP has shown up yet, so just add our new "from" - station 282 if ( item ) // AP has shown up yet, so just add our new "from" - station
284 { 283 {
285 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "adhoc" ); 284 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "adhoc" );
286 } 285 }
287 else 286 else
288 { 287 {
289 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); 288 odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl;
290 MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" ); 289 MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" );
291 290
292 } 291 }
293} 292}
294 293
295 294
@@ -306,47 +305,47 @@ void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& t
306 if ( item ) // AP has shown up yet, so just add our new "from" - station 305 if ( item ) // AP has shown up yet, so just add our new "from" - station
307 { 306 {
308 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "station" ); 307 addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "station" );
309 } 308 }
310 else 309 else
311 { 310 {
312 qDebug( "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" ); 311 odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl;
313 MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" ); 312 MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" );
314 } 313 }
315} 314}
316 315
317 316
318void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) 317void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via )
319{ 318{
320 qWarning( "D'oh! Not yet implemented..." ); 319 owarn << "D'oh! Not yet implemented..." << oendl;
321 MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" ); 320 MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" );
322} 321}
323 322
324 323
325void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) 324void MScanListView::identify( const OMacAddress& macaddr, const QString& ip )
326{ 325{
327 qDebug( "identify %s = %s", (const char*) macaddr.toString(), (const char*) ip ); 326 odebug << "identify " << (const char*) macaddr.toString() << " = " << (const char*) ip << "" << oendl;
328 327
329 QListViewItemIterator it( this ); 328 QListViewItemIterator it( this );
330 for ( ; it.current(); ++it ) 329 for ( ; it.current(); ++it )
331 { 330 {
332 if ( it.current()->text( col_ap ) == macaddr.toString(true) ) 331 if ( it.current()->text( col_ap ) == macaddr.toString(true) )
333 { 332 {
334 it.current()->setText( col_ip, ip ); 333 it.current()->setText( col_ip, ip );
335 return; 334 return;
336 } 335 }
337 } 336 }
338 qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" ); 337 odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl;
339 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", 338 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!",
340 (const char*) macaddr.toString(), (const char*) ip ) ); 339 (const char*) macaddr.toString(), (const char*) ip ) );
341} 340}
342 341
343 342
344void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) 343void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip )
345{ 344{
346 qDebug( "addService '%s', Server = %s = %s", (const char*) name, (const char*) macaddr.toString(), (const char*) ip ); 345 odebug << "addService '" << (const char*) name << "', Server = " << (const char*) macaddr.toString() << " = " << (const char*) ip << "" << oendl;
347 346
348 //TODO: Refactor that out, we need it all over the place. 347 //TODO: Refactor that out, we need it all over the place.
349 // Best to do it in a more comfortable abstraction in OListView 348 // Best to do it in a more comfortable abstraction in OListView
350 // (Hmm, didn't I already start something in this direction?) 349 // (Hmm, didn't I already start something in this direction?)
351 350
352 QListViewItemIterator it( this ); 351 QListViewItemIterator it( this );
@@ -357,22 +356,22 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr,
357 356
358 MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() ); 357 MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() );
359 358
360 while ( subitem && ( subitem->text( col_essid ) != name ) ) 359 while ( subitem && ( subitem->text( col_essid ) != name ) )
361 { 360 {
362 #ifdef DEBUG 361 #ifdef DEBUG
363 qDebug( "subitemtext: %s", (const char*) subitem->text( col_essid ) ); 362 odebug << "subitemtext: " << (const char*) subitem->text( col_essid ) << "" << oendl;
364 #endif 363 #endif
365 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); 364 subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
366 } 365 }
367 366
368 if ( subitem ) 367 if ( subitem )
369 { 368 {
370 // we have already seen this item, it's a dupe 369 // we have already seen this item, it's a dupe
371 #ifdef DEBUG 370 #ifdef DEBUG
372 qDebug( "%s is a dupe - ignoring...", (const char*) name ); 371 odebug << "" << (const char*) name << " is a dupe - ignoring..." << oendl;
373 #endif 372 #endif
374 subitem->receivedBeacon(); //FIXME: sent data bit 373 subitem->receivedBeacon(); //FIXME: sent data bit
375 return; 374 return;
376 } 375 }
377 376
378 // never seen that - add new item 377 // never seen that - add new item
@@ -380,13 +379,13 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr,
380 MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 ); 379 MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 );
381 item->setText( col_essid, name ); 380 item->setText( col_essid, name );
382 381
383 return; 382 return;
384 } 383 }
385 } 384 }
386 qDebug( "D'oh! Received identification, but item not yet in list... ==> Handle this!" ); 385 odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl;
387 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", 386 MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!",
388 (const char*) macaddr.toString(), (const char*) ip ) ); 387 (const char*) macaddr.toString(), (const char*) ip ) );
389} 388}
390 389
391 390
392void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) 391void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col )
@@ -418,13 +417,13 @@ MScanListItem::MScanListItem( QListView* parent, const QString& type, const QStr
418 bool wep, int channel, int signal, bool probed ) 417 bool wep, int channel, int signal, bool probed )
419 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), 418 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
420 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), 419 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
421 _channel( channel ), _signal( signal ), _beacons( 1 ) 420 _channel( channel ), _signal( signal ), _beacons( 1 )
422{ 421{
423 #ifdef DEBUG 422 #ifdef DEBUG
424 qDebug( "creating scanlist item" ); 423 odebug << "creating scanlist item" << oendl;
425 #endif 424 #endif
426 425
427 if ( WellenreiterConfigWindow::instance() ) 426 if ( WellenreiterConfigWindow::instance() )
428 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here 427 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
429 428
430 decorateItem( type, essid, macaddr, wep, channel, signal, probed ); 429 decorateItem( type, essid, macaddr, wep, channel, signal, probed );
@@ -432,13 +431,13 @@ MScanListItem::MScanListItem( QListView* parent, const QString& type, const QStr
432 431
433MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr, 432MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr,
434 bool wep, int channel, int signal ) 433 bool wep, int channel, int signal )
435 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) 434 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
436{ 435{
437 #ifdef DEBUG 436 #ifdef DEBUG
438 qDebug( "creating scanlist item" ); 437 odebug << "creating scanlist item" << oendl;
439 #endif 438 #endif
440 if ( WellenreiterConfigWindow::instance() ) 439 if ( WellenreiterConfigWindow::instance() )
441 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here 440 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
442 441
443 decorateItem( type, essid, macaddr, wep, channel, signal, false ); 442 decorateItem( type, essid, macaddr, wep, channel, signal, false );
444} 443}
@@ -456,24 +455,24 @@ OListViewItem* MScanListItem::childFactory()
456 return new MScanListItem( this ); 455 return new MScanListItem( this );
457} 456}
458 457
459void MScanListItem::serializeTo( QDataStream& s ) const 458void MScanListItem::serializeTo( QDataStream& s ) const
460{ 459{
461 #ifdef DEBUG 460 #ifdef DEBUG
462 qDebug( "serializing MScanListItem" ); 461 odebug << "serializing MScanListItem" << oendl;
463 #endif 462 #endif
464 OListViewItem::serializeTo( s ); 463 OListViewItem::serializeTo( s );
465 464
466 s << _type; 465 s << _type;
467 s << (Q_UINT8) ( _wep ? 'y' : 'n' ); 466 s << (Q_UINT8) ( _wep ? 'y' : 'n' );
468} 467}
469 468
470void MScanListItem::serializeFrom( QDataStream& s ) 469void MScanListItem::serializeFrom( QDataStream& s )
471{ 470{
472 #ifdef DEBUG 471 #ifdef DEBUG
473 qDebug( "serializing MScanListItem" ); 472 odebug << "serializing MScanListItem" << oendl;
474 #endif 473 #endif
475 OListViewItem::serializeFrom( s ); 474 OListViewItem::serializeFrom( s );
476 475
477 char wep; 476 char wep;
478 s >> _type; 477 s >> _type;
479 s >> (Q_UINT8) wep; 478 s >> (Q_UINT8) wep;
@@ -553,13 +552,13 @@ void MScanListItem::setLocation( const QString& location )
553 552
554 553
555void MScanListItem::receivedBeacon() 554void MScanListItem::receivedBeacon()
556{ 555{
557 _beacons++; 556 _beacons++;
558 #ifdef DEBUG 557 #ifdef DEBUG
559 qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); 558 odebug << "MScanListItem " << (const char*) _macaddr << ": received beacon #" << _beacons << "" << oendl;
560 #endif 559 #endif
561 setText( col_sig, QString::number( _beacons ) ); 560 setText( col_sig, QString::number( _beacons ) );
562 setText( col_lastseen, QTime::currentTime().toString() ); 561 setText( col_lastseen, QTime::currentTime().toString() );
563 562
564 MScanListItem* p = (MScanListItem*) parent(); 563 MScanListItem* p = (MScanListItem*) parent();
565 if ( p ) p->receivedBeacon(); 564 if ( p ) p->receivedBeacon();
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index fff7c35..fad6efd 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -8,40 +8,39 @@
8** 8**
9** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 9** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 10** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11** 11**
12***********************************************************************/ 12***********************************************************************/
13 13
14// Local
15
16#include "gps.h" 14#include "gps.h"
17#include "wellenreiter.h" 15#include "wellenreiter.h"
18#include "scanlist.h" 16#include "scanlist.h"
19#include "logwindow.h" 17#include "logwindow.h"
20#include "packetview.h" 18#include "packetview.h"
21#include "configwindow.h" 19#include "configwindow.h"
22#include "statwindow.h" 20#include "statwindow.h"
23#include "graphwindow.h" 21#include "graphwindow.h"
24#include "protolistview.h" 22#include "protolistview.h"
25 23
26// Opie 24/* OPIE */
27
28#ifdef QWS 25#ifdef QWS
29#include <opie2/oapplication.h> 26#include <opie2/oapplication.h>
27#include <opie2/odebug.h>
30#include <opie2/odevice.h> 28#include <opie2/odevice.h>
31#else 29#else
32#include <qapplication.h> 30#include <qapplication.h>
33#endif 31#endif
34#include <opie2/omanufacturerdb.h> 32#include <opie2/omanufacturerdb.h>
35#include <opie2/onetwork.h> 33#include <opie2/onetwork.h>
36#include <opie2/opcap.h> 34#include <opie2/opcap.h>
37#include <qpe/qcopenvelope_qws.h> 35#include <qpe/qcopenvelope_qws.h>
38using namespace Opie; 36using namespace Opie::Core;
39 37using namespace Opie::Net;
40// Qt 38using namespace Opie::Ui;
41 39
40/* QT */
42#include <qcheckbox.h> 41#include <qcheckbox.h>
43#include <qcombobox.h> 42#include <qcombobox.h>
44#include <qdatetime.h> 43#include <qdatetime.h>
45#include <qpushbutton.h> 44#include <qpushbutton.h>
46#include <qlineedit.h> 45#include <qlineedit.h>
47#include <qmessagebox.h> 46#include <qmessagebox.h>
@@ -49,27 +48,20 @@ using namespace Opie;
49#include <qregexp.h> 48#include <qregexp.h>
50#include <qspinbox.h> 49#include <qspinbox.h>
51#include <qtimer.h> 50#include <qtimer.h>
52#include <qtoolbutton.h> 51#include <qtoolbutton.h>
53#include <qmainwindow.h> 52#include <qmainwindow.h>
54 53
55// Standard 54/* STD */
56
57#include <assert.h> 55#include <assert.h>
58#include <errno.h> 56#include <errno.h>
59#include <unistd.h> 57#include <unistd.h>
60#include <string.h> 58#include <string.h>
61#include <sys/types.h> 59#include <sys/types.h>
62#include <stdlib.h> 60#include <stdlib.h>
63 61
64using namespace Opie::Core;
65using namespace Opie::Net;
66using namespace Opie::Net;
67using namespace Opie::Core;
68using namespace Opie::Net;
69using namespace Opie::Core;
70Wellenreiter::Wellenreiter( QWidget* parent ) 62Wellenreiter::Wellenreiter( QWidget* parent )
71 : WellenreiterBase( parent, 0, 0 ), 63 : WellenreiterBase( parent, 0, 0 ),
72 sniffing( false ), iface( 0 ), configwindow( 0 ) 64 sniffing( false ), iface( 0 ), configwindow( 0 )
73{ 65{
74 66
75 logwindow->log( "(i) Wellenreiter has been started." ); 67 logwindow->log( "(i) Wellenreiter has been started." );
@@ -103,13 +95,13 @@ Wellenreiter::~Wellenreiter()
103 delete pcap; 95 delete pcap;
104} 96}
105 97
106 98
107void Wellenreiter::initialTimer() 99void Wellenreiter::initialTimer()
108{ 100{
109 qDebug( "Wellenreiter::preloading manufacturer database..." ); 101 odebug << "Wellenreiter::preloading manufacturer database..." << oendl;
110 OManufacturerDB::instance(); 102 OManufacturerDB::instance();
111} 103}
112 104
113 105
114void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) 106void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
115{ 107{
@@ -146,30 +138,30 @@ void Wellenreiter::handleNotification( OPacket* p )
146 while ( (o = it.current()) != 0 ) 138 while ( (o = it.current()) != 0 )
147 { 139 {
148 QString name = it.current()->name(); 140 QString name = it.current()->name();
149 if ( configwindow->parsePackets->isProtocolChecked( name ) ) 141 if ( configwindow->parsePackets->isProtocolChecked( name ) )
150 { 142 {
151 QString action = configwindow->parsePackets->protocolAction( name ); 143 QString action = configwindow->parsePackets->protocolAction( name );
152 qDebug( "parsePacket-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); 144 odebug << "parsePacket-action for '" << (const char*) name << "' seems to be '" << (const char*) action << "'" << oendl;
153 doAction( action, name, p ); 145 doAction( action, name, p );
154 } 146 }
155 else 147 else
156 { 148 {
157 qDebug( "protocol '%s' not checked in parsePackets.", (const char*) name ); 149 odebug << "protocol '" << (const char*) name << "' not checked in parsePackets." << oendl;
158 } 150 }
159 ++it; 151 ++it;
160 } 152 }
161} 153}
162 154
163 155
164void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage ) 156void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* manage )
165{ 157{
166 if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage ); 158 if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage );
167 else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage ); 159 else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage );
168 else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage ); 160 else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage );
169 else qWarning( "Wellenreiter::handleManagementFrame(): '%s' - please handle me!", (const char*) manage->managementType() ); 161 else owarn << "Wellenreiter::handleManagementFrame(): '" << (const char*) manage->managementType() << "' - please handle me!" << oendl;
170} 162}
171 163
172 164
173void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request ) 165void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request )
174{ 166{
175 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 167 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
@@ -179,20 +171,20 @@ void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManage
179 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 171 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
180 172
181 GpsLocation loc( -111, -111 ); 173 GpsLocation loc( -111, -111 );
182 if ( configwindow->enableGPS->isChecked() ) 174 if ( configwindow->enableGPS->isChecked() )
183 { 175 {
184 // TODO: add check if GPS is working!? 176 // TODO: add check if GPS is working!?
185 qDebug( "Wellenreiter::gathering GPS data..." ); 177 odebug << "Wellenreiter::gathering GPS data..." << oendl;
186 loc = gps->position(); 178 loc = gps->position();
187 qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() ); 179 odebug << "Wellenreiter::GPS data received is ( " << loc.latitude() << " , " << loc.longitude() << " ) - dms string = '" << loc.dmsPosition().latin1() << "'" << oendl;
188 } 180 }
189 181
190 if ( essid.length() ) 182 if ( essid.length() )
191 netView()->addNewItem( "adhoc", essid, header->macAddress2(), false /* should check FrameControl field */, -1, 0, loc, true /* only probed */ ); 183 netView()->addNewItem( "adhoc", essid, header->macAddress2(), false /* should check FrameControl field */, -1, 0, loc, true /* only probed */ );
192 qDebug( "Wellenreiter::invalid frame [possibly noise] detected!" ); 184 odebug << "Wellenreiter::invalid frame [possibly noise] detected!" << oendl;
193} 185}
194 186
195 187
196void Wellenreiter::handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* response ) 188void Wellenreiter::handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* response )
197{ 189{
198} 190}
@@ -208,13 +200,13 @@ void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPa
208 else if ( beacon->canESS() ) 200 else if ( beacon->canESS() )
209 { 201 {
210 type = "managed"; 202 type = "managed";
211 } 203 }
212 else 204 else
213 { 205 {
214 qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" ); 206 owarn << "Wellenreiter::invalid frame [possibly noise] detected!" << oendl;
215 return; 207 return;
216 } 208 }
217 209
218 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 210 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
219 QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>"); 211 QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>");
220 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); 212 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
@@ -223,15 +215,15 @@ void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPa
223 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 215 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
224 216
225 GpsLocation loc( -111, -111 ); 217 GpsLocation loc( -111, -111 );
226 if ( configwindow->enableGPS->isChecked() ) 218 if ( configwindow->enableGPS->isChecked() )
227 { 219 {
228 // TODO: add check if GPS is working!? 220 // TODO: add check if GPS is working!?
229 qDebug( "Wellenreiter::gathering GPS data..." ); 221 odebug << "Wellenreiter::gathering GPS data..." << oendl;
230 loc = gps->position(); 222 loc = gps->position();
231 qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() ); 223 odebug << "Wellenreiter::GPS data received is ( " << loc.latitude() << " , " << loc.longitude() << " ) - dms string = '" << loc.dmsPosition().latin1() << "'" << oendl;
232 } 224 }
233 225
234 netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0, loc ); 226 netView()->addNewItem( type, essid, header->macAddress2(), beacon->canPrivacy(), channel, 0, loc );
235 227
236 // update graph window 228 // update graph window
237 if ( ds ) 229 if ( ds )
@@ -252,13 +244,13 @@ void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* contro
252 if ( control->controlType() == "Acknowledge" ) 244 if ( control->controlType() == "Acknowledge" )
253 { 245 {
254 netView()->addNewItem( "adhoc", "<unknown>", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) ); 246 netView()->addNewItem( "adhoc", "<unknown>", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) );
255 } 247 }
256 else 248 else
257 { 249 {
258 qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() ); 250 odebug << "Wellenreiter::handleControlFrame - please handle " << (const char*) control->controlType() << " in a future version! :D" << oendl;
259 } 251 }
260} 252}
261 253
262 254
263void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) 255void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to )
264{ 256{
@@ -301,13 +293,13 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd
301 293
302void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) 294void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest )
303{ 295{
304 OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); 296 OARPPacket* arp = (OARPPacket*) p->child( "ARP" );
305 if ( arp ) 297 if ( arp )
306 { 298 {
307 qDebug( "Received ARP traffic (type '%s'): ", (const char*) arp->type() ); 299 odebug << "Received ARP traffic (type '" << (const char*) arp->type() << "'): " << oendl;
308 if ( arp->type() == "REQUEST" ) 300 if ( arp->type() == "REQUEST" )
309 { 301 {
310 netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); 302 netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() );
311 } 303 }
312 else if ( arp->type() == "REPLY" ) 304 else if ( arp->type() == "REPLY" )
313 { 305 {
@@ -322,22 +314,22 @@ void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source,
322{ 314{
323 //TODO: Implement more IP based protocols 315 //TODO: Implement more IP based protocols
324 316
325 ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" ); 317 ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" );
326 if ( dhcp ) 318 if ( dhcp )
327 { 319 {
328 qDebug( "Received DHCP '%s' packet", (const char*) dhcp->type() ); 320 odebug << "Received DHCP '" << (const char*) dhcp->type() << "' packet" << oendl;
329 if ( dhcp->type() == "OFFER" ) 321 if ( dhcp->type() == "OFFER" )
330 { 322 {
331 qDebug( "DHCP: '%s' ('%s') seems to be a DHCP server.", (const char*) source.toString(), (const char*) dhcp->serverAddress().toString() ); 323 odebug << "DHCP: '" << (const char*) source.toString() << "' ('" << (const char*) dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl;
332 netView()->identify( source, dhcp->serverAddress().toString() ); 324 netView()->identify( source, dhcp->serverAddress().toString() );
333 netView()->addService( "DHCP", source, dhcp->serverAddress().toString() ); 325 netView()->addService( "DHCP", source, dhcp->serverAddress().toString() );
334 } 326 }
335 else if ( dhcp->type() == "ACK" ) 327 else if ( dhcp->type() == "ACK" )
336 { 328 {
337 qDebug( "DHCP: '%s' ('%s') accepted the offered DHCP address.", (const char*) dhcp->clientMacAddress().toString(), (const char*) dhcp->yourAddress().toString() ); 329 odebug << "DHCP: '" << (const char*) dhcp->clientMacAddress().toString() << "' ('" << (const char*) dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl;
338 netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() ); 330 netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() );
339 } 331 }
340 } 332 }
341} 333}
342 334
343 335
@@ -365,22 +357,22 @@ bool Wellenreiter::checkDumpPacket( OPacket* p )
365 while ( (o = it.current()) != 0 ) 357 while ( (o = it.current()) != 0 )
366 { 358 {
367 QString name = it.current()->name(); 359 QString name = it.current()->name();
368 if ( configwindow->capturePackets->isProtocolChecked( name ) ) 360 if ( configwindow->capturePackets->isProtocolChecked( name ) )
369 { 361 {
370 QString action = configwindow->capturePackets->protocolAction( name ); 362 QString action = configwindow->capturePackets->protocolAction( name );
371 qDebug( "capturePackets-action for '%s' seems to be '%s'", (const char*) name, (const char*) action ); 363 odebug << "capturePackets-action for '" << (const char*) name << "' seems to be '" << (const char*) action << "'" << oendl;
372 if ( action == "Discard" ) 364 if ( action == "Discard" )
373 { 365 {
374 logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); 366 logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) );
375 return false; 367 return false;
376 } 368 }
377 } 369 }
378 else 370 else
379 { 371 {
380 qDebug( "protocol '%s' not checked in capturePackets.", (const char*) name ); 372 odebug << "protocol '" << (const char*) name << "' not checked in capturePackets." << oendl;
381 } 373 }
382 ++it; 374 ++it;
383 } 375 }
384 return true; 376 return true;
385} 377}
386 378
@@ -548,13 +540,13 @@ void Wellenreiter::startClicked()
548 { 540 {
549 case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; 541 case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break;
550 case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; 542 case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break;
551 case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; 543 case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break;
552 case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break; 544 case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break;
553 case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break; 545 case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break;
554 case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; 546 case DEVTYPE_FILE: odebug << "Wellenreiter: Capturing from file '" << (const char*) interface << "'" << oendl; break;
555 default: assert( 0 ); // shouldn't reach this 547 default: assert( 0 ); // shouldn't reach this
556 } 548 }
557 549
558 // switch device into monitor mode 550 // switch device into monitor mode
559 if ( cardtype < DEVTYPE_FILE ) 551 if ( cardtype < DEVTYPE_FILE )
560 { 552 {
@@ -569,13 +561,13 @@ void Wellenreiter::startClicked()
569 } 561 }
570 } 562 }
571 563
572 // open GPS device 564 // open GPS device
573 if ( configwindow->enableGPS->isChecked() ) 565 if ( configwindow->enableGPS->isChecked() )
574 { 566 {
575 qDebug( "Wellenreiter:GPS enabled @ %s:%d", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 567 odebug << "Wellenreiter:GPS enabled @ " << (const char*) configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "" << oendl;
576 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); 568 gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() );
577 } 569 }
578 570
579 // open pcap and start sniffing 571 // open pcap and start sniffing
580 572
581 if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file? 573 if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file?
@@ -593,13 +585,13 @@ void Wellenreiter::startClicked()
593 585
594 if ( cardtype != DEVTYPE_FILE ) 586 if ( cardtype != DEVTYPE_FILE )
595 pcap->open( interface ); 587 pcap->open( interface );
596 else 588 else
597 pcap->open( QFile( interface ) ); 589 pcap->open( QFile( interface ) );
598 590
599 qDebug( "Wellenreiter:: dumping to %s", (const char*) dumpname ); 591 odebug << "Wellenreiter:: dumping to " << (const char*) dumpname << "" << oendl;
600 pcap->openDumpFile( dumpname ); 592 pcap->openDumpFile( dumpname );
601 593
602 if ( !pcap->isOpen() ) 594 if ( !pcap->isOpen() )
603 { 595 {
604 QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg( 596 QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg(
605 cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) )); 597 cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) ));
@@ -649,13 +641,13 @@ void Wellenreiter::startClicked()
649 } 641 }
650} 642}
651 643
652 644
653void Wellenreiter::timerEvent( QTimerEvent* ) 645void Wellenreiter::timerEvent( QTimerEvent* )
654{ 646{
655 qDebug( "Wellenreiter::timerEvent()" ); 647 odebug << "Wellenreiter::timerEvent()" << oendl;
656 OPacket* p = pcap->next(); 648 OPacket* p = pcap->next();
657 if ( !p ) // no more packets available 649 if ( !p ) // no more packets available
658 { 650 {
659 stopClicked(); 651 stopClicked();
660 } 652 }
661 else 653 else
@@ -712,21 +704,21 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch
712 (const char*) essid, 704 (const char*) essid,
713 channel, 705 channel,
714 (const char*) macaddr ); 706 (const char*) macaddr );
715 707
716 QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); 708 QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" );
717 int count = 3; 709 int count = 3;
718 qDebug("sending %d messages",count); 710 odebug << "sending " << count << " messages" << oendl;
719 msg << QString("count") << QString::number(count); 711 msg << QString("count") << QString::number(count);
720 qDebug("msg >%s< Mode >%s<", iface->name(),type.latin1() ); 712 odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl;
721 msg << QString(iface->name()) << QString("Mode") << type; 713 msg << QString(iface->name()) << QString("Mode") << type;
722 qDebug("msg >%s< essid >%s<", iface->name(),essid.latin1()); 714 odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl;
723 msg << QString(iface->name()) << QString("ESSID") << essid; 715 msg << QString(iface->name()) << QString("ESSID") << essid;
724 qDebug("msg >%s< channel >%d<", iface->name(),channel); 716 odebug << "msg >" << iface->name() << "< channel >" << channel << "<" << oendl;
725 msg << QString(iface->name()) << QString("Channel") << channel; 717 msg << QString(iface->name()) << QString("Channel") << channel;
726// qDebug("msg >%s< mac >%s<", iface->name(),macaddr); 718// odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl;
727// msg << QString(iface->name()) << QString("MacAddr") << macaddr; 719// msg << QString(iface->name()) << QString("MacAddr") << macaddr;
728 #else 720 #else
729 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) ); 721 QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) );
730 #endif 722 #endif
731 723
732} 724}
diff --git a/noncore/settings/backup/backuprestore.cpp b/noncore/settings/backup/backuprestore.cpp
index 58e5c71..2eccdfe 100644
--- a/noncore/settings/backup/backuprestore.cpp
+++ b/noncore/settings/backup/backuprestore.cpp
@@ -1,13 +1,14 @@
1
2#include "backuprestore.h" 1#include "backuprestore.h"
3#include "errordialog.h" 2#include "errordialog.h"
4 3
5/* OPIE */ 4/* OPIE */
5#include <opie2/odebug.h>
6#include <opie2/ostorageinfo.h> 6#include <opie2/ostorageinfo.h>
7#include <qpe/qpeapplication.h> 7#include <qpe/qpeapplication.h>
8using namespace Opie::Core;
8 9
9/* QT */ 10/* QT */
10#include <qapplication.h> 11#include <qapplication.h>
11#include <qmultilineedit.h> 12#include <qmultilineedit.h>
12#include <qdir.h> 13#include <qdir.h>
13#include <qfile.h> 14#include <qfile.h>
@@ -37,13 +38,12 @@
37#define BACKUP_LOCATION 2 38#define BACKUP_LOCATION 2
38 39
39#define EXTENSION ".bck" 40#define EXTENSION ".bck"
40 41
41const QString tempFileName = "/tmp/backup.err"; 42const QString tempFileName = "/tmp/backup.err";
42 43
43
44BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl) 44BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags fl)
45 : BackupAndRestoreBase(parent, name, fl) 45 : BackupAndRestoreBase(parent, name, fl)
46{ 46{
47 backupList->header()->hide(); 47 backupList->header()->hide();
48 restoreList->header()->hide(); 48 restoreList->header()->hide();
49 connect(backupButton, SIGNAL(clicked()), 49 connect(backupButton, SIGNAL(clicked()),
@@ -70,23 +70,23 @@ BackupAndRestore::BackupAndRestore( QWidget* parent, const char* name, WFlags f
70 Opie::Core::OStorageInfo storage; 70 Opie::Core::OStorageInfo storage;
71 71
72 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" ); 72 backupLocations.insert( "Documents", QDir::homeDirPath() + "/Documents" );
73 if ( storage.hasCf() ) 73 if ( storage.hasCf() )
74 { 74 {
75 backupLocations.insert( "CF", storage.cfPath() ); 75 backupLocations.insert( "CF", storage.cfPath() );
76 qDebug( "Cf Path: " + storage.cfPath() ); 76 odebug << "Cf Path: " + storage.cfPath() << oendl;
77 } 77 }
78 if ( storage.hasSd() ) 78 if ( storage.hasSd() )
79 { 79 {
80 backupLocations.insert( "SD", storage.sdPath() ); 80 backupLocations.insert( "SD", storage.sdPath() );
81 qDebug( " Sd Path: " + storage.sdPath() ); 81 odebug << " Sd Path: " + storage.sdPath() << oendl;
82 } 82 }
83 if ( storage.hasMmc() ) 83 if ( storage.hasMmc() )
84 { 84 {
85 backupLocations.insert( "MMC", storage.mmcPath() ); 85 backupLocations.insert( "MMC", storage.mmcPath() );
86 qDebug( "Mmc Path: " + storage.mmcPath() ); 86 odebug << "Mmc Path: " + storage.mmcPath() << oendl;
87 } 87 }
88 88
89 Config config("BackupAndRestore"); 89 Config config("BackupAndRestore");
90 //read last locations 90 //read last locations
91 config.setGroup("LastLocation"); 91 config.setGroup("LastLocation");
92 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" ); 92 QString lastStoreLocation = config.readEntry( "LastStoreLocation", "" );
@@ -200,13 +200,13 @@ void BackupAndRestore::scanForApplicationSettings()
200 d.setFilter( QDir::Dirs | QDir::Files | QDir::NoSymLinks ); 200 d.setFilter( QDir::Dirs | QDir::Files | QDir::NoSymLinks );
201 const QFileInfoList *list = d.entryInfoList(); 201 const QFileInfoList *list = d.entryInfoList();
202 QFileInfoListIterator it( *list ); 202 QFileInfoListIterator it( *list );
203 QFileInfo *fi; 203 QFileInfo *fi;
204 while ( (fi=it.current()) ) 204 while ( (fi=it.current()) )
205 { 205 {
206 //qDebug((d.path()+"/"+fi->fileName()).latin1()); 206 //odebug << (d.path()+"/"+fi->fileName()).latin1() << oendl;
207 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) ) 207 if ( ( fi->fileName() != "." ) && ( fi->fileName() != ".." ) )
208 { 208 {
209 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName()); 209 QListViewItem *newItem = new QListViewItem(applicationSettings, fi->fileName());
210 selectItem(newItem); 210 selectItem(newItem);
211 } 211 }
212 ++it; 212 ++it;
@@ -246,22 +246,22 @@ void BackupAndRestore::backup()
246 c++; 246 c++;
247 } 247 }
248 248
249 // We execute tar and compressing its output with gzip.. 249 // We execute tar and compressing its output with gzip..
250 // The error output will be written into a temp-file which could be provided 250 // The error output will be written into a temp-file which could be provided
251 // for debugging.. 251 // for debugging..
252 qDebug( "Storing file: %s", outputFile.latin1() ); 252 odebug << "Storing file: " << outputFile.latin1() << "" << oendl;
253 outputFile += EXTENSION; 253 outputFile += EXTENSION;
254 254
255 QString commandLine = QString( "cd %1 && (tar -X %1 -cz %2 Applications/backup/exclude -f %3 ) 2> %4" ).arg( QDir::homeDirPath() ) 255 QString commandLine = QString( "cd %1 && (tar -X %1 -cz %2 Applications/backup/exclude -f %3 ) 2> %4" ).arg( QDir::homeDirPath() )
256 .arg( getExcludeFile() ) 256 .arg( getExcludeFile() )
257 .arg( backupFiles ) 257 .arg( backupFiles )
258 .arg( outputFile.latin1() ) 258 .arg( outputFile.latin1() )
259 .arg( tempFileName.latin1() ); 259 .arg( tempFileName.latin1() );
260 260
261 qDebug( commandLine ); 261 odebug << commandLine << oendl;
262 262
263 int r = system( commandLine ); 263 int r = system( commandLine );
264 264
265 if(r != 0) 265 if(r != 0)
266 { 266 {
267 perror("Error: "); 267 perror("Error: ");
@@ -269,13 +269,13 @@ void BackupAndRestore::backup()
269 269
270 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n" 270 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Backup Failed!" ) + "\n"
271 + errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) ) 271 + errorMsg, QString( tr( "Ok" ) ), QString( tr( "Details" ) ) ) )
272 { 272 {
273 273
274 case 1: 274 case 1:
275 qWarning("Details pressed !"); 275 owarn << "Details pressed !" << oendl;
276 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); 276 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
277 QFile errorFile( tempFileName ); 277 QFile errorFile( tempFileName );
278 if ( errorFile.open(IO_ReadOnly) ) 278 if ( errorFile.open(IO_ReadOnly) )
279 { 279 {
280 QTextStream t( &errorFile ); 280 QTextStream t( &errorFile );
281 QString s; 281 QString s;
@@ -356,25 +356,25 @@ void BackupAndRestore::sourceDirChanged(int selection)
356 restoreList->clear(); 356 restoreList->clear();
357 rescanFolder(backupLocations[restoreSource->text(selection)]); 357 rescanFolder(backupLocations[restoreSource->text(selection)]);
358} 358}
359 359
360void BackupAndRestore::fileListUpdate() 360void BackupAndRestore::fileListUpdate()
361{ 361{
362 qWarning("void BackupAndRestore::fileListUpdate()"); 362 owarn << "void BackupAndRestore::fileListUpdate()" << oendl;
363 restoreList->clear(); 363 restoreList->clear();
364 rescanFolder( backupLocations[restoreSource->currentText()] ); 364 rescanFolder( backupLocations[restoreSource->currentText()] );
365} 365}
366 366
367/** 367/**
368 * Scans directory for any backup files. Will recursivly go down, 368 * Scans directory for any backup files. Will recursivly go down,
369 * but will not follow symlinks. 369 * but will not follow symlinks.
370 * @param directory - the directory to look in. 370 * @param directory - the directory to look in.
371 */ 371 */
372void BackupAndRestore::rescanFolder(QString directory) 372void BackupAndRestore::rescanFolder(QString directory)
373{ 373{
374 //qDebug(QString("rescanFolder: ") + directory.latin1()); 374 //odebug << QString("rescanFolder: ") + directory.latin1() << oendl;
375 QDir d(directory); 375 QDir d(directory);
376 if(!d.exists()) 376 if(!d.exists())
377 return; 377 return;
378 378
379 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs); 379 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs);
380 const QFileInfoList *list = d.entryInfoList(); 380 const QFileInfoList *list = d.entryInfoList();
@@ -416,13 +416,13 @@ void BackupAndRestore::restore()
416 setCaption(tr("Backup and Restore... working...")); 416 setCaption(tr("Backup and Restore... working..."));
417 417
418 QString restoreFile = backupLocations[restoreSource->currentText()]; 418 QString restoreFile = backupLocations[restoreSource->currentText()];
419 419
420 restoreFile += "/" + restoreItem->text(0); 420 restoreFile += "/" + restoreItem->text(0);
421 421
422 qDebug( restoreFile ); 422 odebug << restoreFile << oendl;
423 423
424 //check if backup file come from opie 1.0.x 424 //check if backup file come from opie 1.0.x
425 425
426 QString commandLine = QString( "tar -tzf %1 | grep Applications/backup/exclude" ).arg( restoreFile.latin1() ); 426 QString commandLine = QString( "tar -tzf %1 | grep Applications/backup/exclude" ).arg( restoreFile.latin1() );
427 427
428 int r = system( commandLine ); 428 int r = system( commandLine );
@@ -439,25 +439,25 @@ void BackupAndRestore::restore()
439 439
440 //unpack backup file 440 //unpack backup file
441 commandLine = QString( "cd %1 && tar -zxf %2 2> %3" ).arg( startDir ) 441 commandLine = QString( "cd %1 && tar -zxf %2 2> %3" ).arg( startDir )
442 .arg( restoreFile.latin1() ) 442 .arg( restoreFile.latin1() )
443 .arg( tempFileName.latin1() ); 443 .arg( tempFileName.latin1() );
444 444
445 qDebug( commandLine ); 445 odebug << commandLine << oendl;
446 446
447 r = system( commandLine ); 447 r = system( commandLine );
448 448
449 //error handling 449 //error handling
450 if(r != 0) 450 if(r != 0)
451 { 451 {
452 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno ); 452 QString errorMsg= tr( "Error from System:\n" ) + (QString)strerror( errno );
453 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n" 453 switch( QMessageBox::critical(this, tr( "Message" ), tr( "Restore Failed." ) + "\n"
454 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) ) 454 + errorMsg, QString( tr( "Ok") ), QString( tr( "Details" ) ) ) )
455 { 455 {
456 case 1: 456 case 1:
457 qWarning("Details pressed !"); 457 owarn << "Details pressed !" << oendl;
458 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true ); 458 ErrorDialog* pErrDialog = new ErrorDialog( this, NULL, true );
459 QFile errorFile( tempFileName ); 459 QFile errorFile( tempFileName );
460 if ( errorFile.open(IO_ReadOnly) ) 460 if ( errorFile.open(IO_ReadOnly) )
461 { 461 {
462 QTextStream t( &errorFile ); 462 QTextStream t( &errorFile );
463 QString s; 463 QString s;
diff --git a/noncore/settings/netsystemtime/settingstabwidget.cpp b/noncore/settings/netsystemtime/settingstabwidget.cpp
index ad80e05..1307082 100644
--- a/noncore/settings/netsystemtime/settingstabwidget.cpp
+++ b/noncore/settings/netsystemtime/settingstabwidget.cpp
@@ -136,13 +136,13 @@ void SettingsTabWidget::saveSettings()
136 ntpSrvs.writeEntry( "count", ++srvCount ); 136 ntpSrvs.writeEntry( "count", ++srvCount );
137 ntpSrvs.setGroup( "0" ); 137 ntpSrvs.setGroup( "0" );
138 ntpSrvs.writeEntry( "name", edit ); 138 ntpSrvs.writeEntry( "name", edit );
139 curSrv = 0; 139 curSrv = 0;
140 for ( int i = 1; i < srvCount; i++ ) 140 for ( int i = 1; i < srvCount; i++ )
141 { 141 {
142 // qDebug( "ntpSrvs[%i/%i]=%s", i, srvCount, cbTimeServer->text( i ).latin1() ); 142 // odebug << "ntpSrvs[" << i << "/" << srvCount << "]=" << cbTimeServer->text( i ).latin1() << "" << oendl;
143 ntpSrvs.setGroup( QString::number( i ) ); 143 ntpSrvs.setGroup( QString::number( i ) );
144 ntpSrvs.writeEntry( "name", cbTimeServer->text( i-1 ) ); 144 ntpSrvs.writeEntry( "name", cbTimeServer->text( i-1 ) );
145 } 145 }
146 } 146 }
147 Config config( "ntp", Config::User ); 147 Config config( "ntp", Config::User );
148 config.setGroup( "settings" ); 148 config.setGroup( "settings" );
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp
index b00b899..d2b106a 100644
--- a/noncore/settings/networksettings/interfaces/interface.cpp
+++ b/noncore/settings/networksettings/interfaces/interface.cpp
@@ -134,19 +134,19 @@ bool Interface::refresh(){
134 return true; 134 return true;
135 } 135 }
136 136
137 QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name()); 137 QString fileName = QString("/tmp/%1_ifconfig_info").arg(this->name());
138 int ret = system(QString("LANG=C %1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1()); 138 int ret = system(QString("LANG=C %1 %2 > %3").arg(IFCONFIG).arg(this->name()).arg(fileName).latin1());
139 if(ret != 0){ 139 if(ret != 0){
140 qDebug(QString("Interface: Ifconfig return value: %1, is not 0").arg(ret).latin1()); 140 odebug << QString("Interface: Ifconfig return value: %1, is not 0").arg(ret).latin1() << oendl;
141 return false; 141 return false;
142 } 142 }
143 143
144 QFile file(fileName); 144 QFile file(fileName);
145 if (!file.open(IO_ReadOnly)){ 145 if (!file.open(IO_ReadOnly)){
146 qDebug(QString("Interface: Can't open file: %1").arg(fileName).latin1()); 146 odebug << QString("Interface: Can't open file: %1").arg(fileName).latin1() << oendl;
147 return false; 147 return false;
148 } 148 }
149 149
150 // Set to the defaults 150 // Set to the defaults
151 macAddress = ""; 151 macAddress = "";
152 ip = "0.0.0.0"; 152 ip = "0.0.0.0";
@@ -198,13 +198,13 @@ bool Interface::refresh(){
198 emit(updateInterface(this)); 198 emit(updateInterface(this));
199 return true; 199 return true;
200 } 200 }
201 201
202 file.setName(dhcpFile); 202 file.setName(dhcpFile);
203 if (!file.open(IO_ReadOnly)){ 203 if (!file.open(IO_ReadOnly)){
204 qDebug(QString("Interface: Can't open file: %1").arg(dhcpFile).latin1()); 204 odebug << QString("Interface: Can't open file: %1").arg(dhcpFile).latin1() << oendl;
205 return false; 205 return false;
206 } 206 }
207 207
208 // leaseTime and renewalTime and used if pid and deamon exe can be accessed. 208 // leaseTime and renewalTime and used if pid and deamon exe can be accessed.
209 int leaseTime = 0; 209 int leaseTime = 0;
210 int renewalTime = 0; 210 int renewalTime = 0;
@@ -217,42 +217,42 @@ bool Interface::refresh(){
217 if(line.contains("LEASETIME=")) 217 if(line.contains("LEASETIME="))
218 leaseTime = line.mid(10, line.length()).toInt(); 218 leaseTime = line.mid(10, line.length()).toInt();
219 if(line.contains("RENEWALTIME=")) 219 if(line.contains("RENEWALTIME="))
220 renewalTime = line.mid(12, line.length()).toInt(); 220 renewalTime = line.mid(12, line.length()).toInt();
221 } 221 }
222 file.close(); 222 file.close();
223 //qDebug(QString("Interface: leaseTime: %1").arg(leaseTime).latin1()); 223 //odebug << QString("Interface: leaseTime: %1").arg(leaseTime).latin1() << oendl;
224 //qDebug(QString("Interface: renewalTime: %1").arg(renewalTime).latin1()); 224 //odebug << QString("Interface: renewalTime: %1").arg(renewalTime).latin1() << oendl;
225 225
226 // Get the pid of the deamond 226 // Get the pid of the deamond
227 dhcpFile = (QString(dhcpDirectory+"/dhcpcd-%1.pid").arg(this->name())); 227 dhcpFile = (QString(dhcpDirectory+"/dhcpcd-%1.pid").arg(this->name()));
228 file.setName(dhcpFile); 228 file.setName(dhcpFile);
229 if (!file.open(IO_ReadOnly)){ 229 if (!file.open(IO_ReadOnly)){
230 qDebug(QString("Interface: Can't open file: %1").arg(dhcpFile).latin1()); 230 odebug << QString("Interface: Can't open file: %1").arg(dhcpFile).latin1() << oendl;
231 return false; 231 return false;
232 } 232 }
233 233
234 int pid = -1; 234 int pid = -1;
235 stream.setDevice( &file ); 235 stream.setDevice( &file );
236 while ( !stream.eof() ) { 236 while ( !stream.eof() ) {
237 line = stream.readLine(); 237 line = stream.readLine();
238 pid = line.toInt(); 238 pid = line.toInt();
239 } 239 }
240 file.close(); 240 file.close();
241 241
242 if( pid == -1){ 242 if( pid == -1){
243 qDebug("Interface: Could not get pid of dhcpc deamon."); 243 odebug << "Interface: Could not get pid of dhcpc deamon." << oendl;
244 return false; 244 return false;
245 } 245 }
246 246
247 // Get the start running time of the deamon 247 // Get the start running time of the deamon
248 fileName = (QString("/proc/%1/stat").arg(pid)); 248 fileName = (QString("/proc/%1/stat").arg(pid));
249 file.setName(fileName); 249 file.setName(fileName);
250 stream.setDevice( &file ); 250 stream.setDevice( &file );
251 if (!file.open(IO_ReadOnly)){ 251 if (!file.open(IO_ReadOnly)){
252 qDebug(QString("Interface: Can't open file: %1").arg(fileName).latin1()); 252 odebug << QString("Interface: Can't open file: %1").arg(fileName).latin1() << oendl;
253 return false; 253 return false;
254 } 254 }
255 while ( !stream.eof() ) { 255 while ( !stream.eof() ) {
256 line = stream.readLine(); 256 line = stream.readLine();
257 } 257 }
258 file.close(); 258 file.close();
@@ -275,18 +275,18 @@ bool Interface::refresh(){
275 int sec = 0; 275 int sec = 0;
276 t >> sec; 276 t >> sec;
277 datetime = datetime.addSecs((-1*sec)); 277 datetime = datetime.addSecs((-1*sec));
278 f.close(); 278 f.close();
279 } 279 }
280 else{ 280 else{
281 qDebug("Interface: Can't open /proc/uptime to retrive uptime."); 281 odebug << "Interface: Can't open /proc/uptime to retrive uptime." << oendl;
282 return false; 282 return false;
283 } 283 }
284 284
285 datetime = datetime.addSecs(time); 285 datetime = datetime.addSecs(time);
286 //qDebug(QString("Interface: %1 %2").arg(datetime.toString()).arg(pid).latin1()); 286 //odebug << QString("Interface: %1 %2").arg(datetime.toString()).arg(pid).latin1() << oendl;
287 287
288 // Calculate the start and renew times 288 // Calculate the start and renew times
289 leaseObtained= datetime.toString(); 289 leaseObtained= datetime.toString();
290 290
291 // Calculate the start and renew times 291 // Calculate the start and renew times
292 datetime = datetime.addSecs(leaseTime); 292 datetime = datetime.addSecs(leaseTime);
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp
index 6b161ae..e283926 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaces.cpp
@@ -21,13 +21,13 @@ Interfaces::Interfaces(QString useInterfacesFile){
21 acceptedFamily.append(INTERFACES_FAMILY_IPX); 21 acceptedFamily.append(INTERFACES_FAMILY_IPX);
22 acceptedFamily.append(INTERFACES_FAMILY_INET6); 22 acceptedFamily.append(INTERFACES_FAMILY_INET6);
23 23
24 interfacesFile = useInterfacesFile; 24 interfacesFile = useInterfacesFile;
25 QFile file(interfacesFile); 25 QFile file(interfacesFile);
26 if (!file.open(IO_ReadOnly)){ 26 if (!file.open(IO_ReadOnly)){
27 qDebug("Interfaces: Can't open file: %s for reading.", interfacesFile.latin1() ); 27 odebug << "Interfaces: Can't open file: " << interfacesFile.latin1() << " for reading." << oendl;
28 currentIface = interfaces.end(); 28 currentIface = interfaces.end();
29 currentMapping = interfaces.end(); 29 currentMapping = interfaces.end();
30 return; 30 return;
31 } 31 }
32 QTextStream stream( &file ); 32 QTextStream stream( &file );
33 QString line; 33 QString line;
@@ -73,13 +73,13 @@ QStringList Interfaces::getInterfaceList(){
73 * @return true is interface is in auto 73 * @return true is interface is in auto
74 */ 74 */
75bool Interfaces::isAuto(const QString &interface) const { 75bool Interfaces::isAuto(const QString &interface) const {
76 QStringList autoLines = interfaces.grep(QRegExp(AUTO)); 76 QStringList autoLines = interfaces.grep(QRegExp(AUTO));
77 QStringList awi = autoLines.grep(QRegExp(interface)); 77 QStringList awi = autoLines.grep(QRegExp(interface));
78 if(awi.count() > 1) 78 if(awi.count() > 1)
79 qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1()); 79 odebug << QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1() << oendl;
80 return awi.count() > 0; 80 return awi.count() > 0;
81} 81}
82 82
83/** 83/**
84 * Attempt to set the auto option for interface to setAuto. 84 * Attempt to set the auto option for interface to setAuto.
85 * @param interface the interface to set 85 * @param interface the interface to set
@@ -149,13 +149,13 @@ bool Interfaces::isInterfaceSet() const {
149 * @param family the family of this interface inet or inet, ipx or inet6 149 * @param family the family of this interface inet or inet, ipx or inet6
150 * Must of one of the families defined in interfaces.h 150 * Must of one of the families defined in interfaces.h
151 * @param method for the family. see interfaces man page for family methods. 151 * @param method for the family. see interfaces man page for family methods.
152 * @return true if successful. 152 * @return true if successful.
153 */ 153 */
154bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ 154bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){
155 qDebug("Interfaces::addInterface(%s)",interface.latin1()); 155 odebug << "Interfaces::addInterface(" << interface.latin1() << ")" << oendl;
156 if(0 == acceptedFamily.contains(family)) 156 if(0 == acceptedFamily.contains(family))
157 return false; 157 return false;
158 QString newInterface = interface.simplifyWhiteSpace(); 158 QString newInterface = interface.simplifyWhiteSpace();
159 newInterface = newInterface.replace(QRegExp(" "), ""); 159 newInterface = newInterface.replace(QRegExp(" "), "");
160 interfaces.append(""); 160 interfaces.append("");
161 interfaces.append(QString(IFACE " %1 %2 %3").arg(newInterface).arg(family).arg(method)); 161 interfaces.append(QString(IFACE " %1 %2 %3").arg(newInterface).arg(family).arg(method));
@@ -165,13 +165,13 @@ bool Interfaces::addInterface(const QString &interface, const QString &family, c
165/** 165/**
166 * Copies interface with name interface to name newInterface 166 * Copies interface with name interface to name newInterface
167 * @param newInterface name of the new interface. 167 * @param newInterface name of the new interface.
168 * @return bool true if successful 168 * @return bool true if successful
169 */ 169 */
170bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){ 170bool Interfaces::copyInterface(const QString &interface, const QString &newInterface){
171 qDebug("copy interface %s to %s", interface.latin1(), newInterface.latin1()); 171 odebug << "copy interface " << interface.latin1() << " to " << newInterface.latin1() << "" << oendl;
172 if(!setInterface(interface)) 172 if(!setInterface(interface))
173 return false; 173 return false;
174 174
175 // Store the old interface and bump past the stanza line. 175 // Store the old interface and bump past the stanza line.
176 QStringList::Iterator it = currentIface; 176 QStringList::Iterator it = currentIface;
177 it++; 177 it++;
@@ -272,20 +272,20 @@ QString Interfaces::getInterfaceMethod(bool &error){
272/** 272/**
273 * Sets the interface name to newName. 273 * Sets the interface name to newName.
274 * @param newName the new name of the interface. All whitespace is removed. 274 * @param newName the new name of the interface. All whitespace is removed.
275 * @return bool true if successful. 275 * @return bool true if successful.
276 */ 276 */
277bool Interfaces::setInterfaceName(const QString &newName){ 277bool Interfaces::setInterfaceName(const QString &newName){
278 qDebug("setInterfaceName %s", newName.latin1()); 278 odebug << "setInterfaceName " << newName.latin1() << "" << oendl;
279 if(currentIface == interfaces.end()) 279 if(currentIface == interfaces.end())
280 return false; 280 return false;
281 QString name = newName.simplifyWhiteSpace(); 281 QString name = newName.simplifyWhiteSpace();
282 name = name.replace(QRegExp(" "), ""); 282 name = name.replace(QRegExp(" "), "");
283 bool returnValue = false; 283 bool returnValue = false;
284 QString tmp = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue)); 284 QString tmp = QString("iface %1 %2 %3").arg(name).arg(getInterfaceFamily(returnValue)).arg(getInterfaceMethod(returnValue));
285 qDebug("setting %s",tmp.latin1()); 285 odebug << "setting " << tmp.latin1() << "" << oendl;
286 286
287 (*currentIface) = tmp; 287 (*currentIface) = tmp;
288 return !returnValue; 288 return !returnValue;
289} 289}
290 290
291/** 291/**
@@ -342,13 +342,13 @@ QString Interfaces::getInterfaceOption(const QString &option, bool &error){
342 * @return QString the options value. QString::null if error == true 342 * @return QString the options value. QString::null if error == true
343 */ 343 */
344bool Interfaces::setInterfaceOption(const QString &option, const QString &value){ 344bool Interfaces::setInterfaceOption(const QString &option, const QString &value){
345 if( value.stripWhiteSpace().isEmpty() ) 345 if( value.stripWhiteSpace().isEmpty() )
346 return removeInterfaceOption( option ); 346 return removeInterfaceOption( option );
347 347
348 qDebug("iface >%s< option >%s< value >%s<", (*currentIface).latin1(), option.latin1(),value.latin1()); 348 odebug << "iface >" << (*currentIface).latin1() << "< option >" << option.latin1() << "< value >" << value.latin1() << "<" << oendl;
349 return setOption(currentIface, option, value); 349 return setOption(currentIface, option, value);
350} 350}
351 351
352/** 352/**
353 * Removes a value for an option in the currently selected interface. 353 * Removes a value for an option in the currently selected interface.
354 * @param option the options to set the value. 354 * @param option the options to set the value.
@@ -483,13 +483,13 @@ bool Interfaces::setStanza(const QString &stanza, const QString &option, QString
483 // There are more chars in the line. check -1 483 // There are more chars in the line. check -1
484 if(line.at(point) != ' ') 484 if(line.at(point) != ' ')
485 valid = false; 485 valid = false;
486 } 486 }
487 if(valid){ 487 if(valid){
488 if(found == true){ 488 if(found == true){
489 qDebug(QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1()); 489 odebug << QString("Interfaces: Found multiple stanza's for search: %1 %2").arg(stanza).arg(option).latin1() << oendl;
490 } 490 }
491 found = true; 491 found = true;
492 iterator = it; 492 iterator = it;
493 } 493 }
494 } 494 }
495 } 495 }
@@ -502,53 +502,53 @@ bool Interfaces::setStanza(const QString &stanza, const QString &option, QString
502 * @param option the option to use when setting value. 502 * @param option the option to use when setting value.
503 * @return bool true if successful, false otherwise. 503 * @return bool true if successful, false otherwise.
504 */ 504 */
505bool Interfaces::setOption(const QStringList::Iterator &start, const QString &option, const QString &value){ 505bool Interfaces::setOption(const QStringList::Iterator &start, const QString &option, const QString &value){
506 if(start == interfaces.end()) 506 if(start == interfaces.end())
507 return false; 507 return false;
508 qDebug("setting option"); 508 odebug << "setting option" << oendl;
509 bool found = false; 509 bool found = false;
510 bool replaced = false; 510 bool replaced = false;
511 QStringList::Iterator insertAt = NULL; 511 QStringList::Iterator insertAt = NULL;
512 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 512 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
513 qDebug(" Interfaces::setOption got line >%s<",(*it).latin1()); 513 odebug << " Interfaces::setOption got line >" << (*it).latin1() << "<" << oendl;
514 // FIXME: was not completly stupid just wrong sice all options got inserted bevore the iface line 514 // FIXME: was not completly stupid just wrong sice all options got inserted bevore the iface line
515 // but since it works with an empty interfaces file I (tille) will not do anything more 515 // but since it works with an empty interfaces file I (tille) will not do anything more
516 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) ){ 516 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) ){
517 if (found) break; 517 if (found) break;
518// && it != start){ 518// && it != start){
519// if(!found && value != ""){ 519// if(!found && value != ""){
520// // Got to the end of the stanza without finding it, so append it. 520// // Got to the end of the stanza without finding it, so append it.
521// qDebug(" Got to the end of the stanza without finding it, so append it."); 521// odebug << " Got to the end of the stanza without finding it, so append it." << oendl;
522// interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value)); 522// interfaces.insert(--it, QString("\t%1 %2").arg(option).arg(value));
523// } 523// }
524 qDebug("found 1"); 524 odebug << "found 1" << oendl;
525// interfaces.insert(++it, QString("\t%1 %2").arg(option).arg(value)); 525// interfaces.insert(++it, QString("\t%1 %2").arg(option).arg(value));
526 found = true; 526 found = true;
527 insertAt = it; 527 insertAt = it;
528 528
529 } 529 }
530 if((*it).contains(option) && it != start && (*it).at(0) != '#'){ 530 if((*it).contains(option) && it != start && (*it).at(0) != '#'){
531 // Found it in stanza so replace it. 531 // Found it in stanza so replace it.
532 qDebug("found 2"); 532 odebug << "found 2" << oendl;
533 if(found) 533 if(found)
534 qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); 534 odebug << QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1() << oendl;
535 found = true; 535 found = true;
536 replaced = true; 536 replaced = true;
537 (*it) = QString("\t%1 %2").arg(option).arg(value); 537 (*it) = QString("\t%1 %2").arg(option).arg(value);
538 } 538 }
539 } 539 }
540 if(!found){ 540 if(!found){
541 qDebug("! found insert anyway"); 541 odebug << "! found insert anyway" << oendl;
542 QStringList::Iterator p = start; 542 QStringList::Iterator p = start;
543 interfaces.insert(++p, QString("\t%1 %2").arg(option).arg(value)); 543 interfaces.insert(++p, QString("\t%1 %2").arg(option).arg(value));
544 found = true; 544 found = true;
545 } 545 }
546 546
547 if(found && !replaced){ 547 if(found && !replaced){
548 qDebug("found iface but not the option so insert it here..."); 548 odebug << "found iface but not the option so insert it here..." << oendl;
549 interfaces.insert(++insertAt, QString("\t%1 %2").arg(option).arg(value)); 549 interfaces.insert(++insertAt, QString("\t%1 %2").arg(option).arg(value));
550 } 550 }
551 return found; 551 return found;
552} 552}
553 553
554/** 554/**
@@ -579,13 +579,13 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString
579 // got to the end without finding it 579 // got to the end without finding it
580 break; 580 break;
581 } 581 }
582 if((*it).contains(option) && it != start && (*it).at(0) != '#'){ 582 if((*it).contains(option) && it != start && (*it).at(0) != '#'){
583 // Found it in stanza so replace it. 583 // Found it in stanza so replace it.
584 if(found) 584 if(found)
585 qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); 585 odebug << QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1() << oendl;
586 found = true; 586 found = true;
587 it = interfaces.remove( it ); // we really want to remove the line 587 it = interfaces.remove( it ); // we really want to remove the line
588 --it; // we do ++it later in the head of the for loop 588 --it; // we do ++it later in the head of the for loop
589 } 589 }
590 } 590 }
591 return found; 591 return found;
@@ -607,13 +607,13 @@ bool Interfaces::removeOption(const QStringList::Iterator &start, const QString
607 // got to the end without finding it 607 // got to the end without finding it
608 break; 608 break;
609 } 609 }
610 if((*it).contains(option) && (*it).contains(value) && it != start && (*it).at(0) != '#'){ 610 if((*it).contains(option) && (*it).contains(value) && it != start && (*it).at(0) != '#'){
611 // Found it in stanza so replace it. 611 // Found it in stanza so replace it.
612 if(found) 612 if(found)
613 qDebug(QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1()); 613 odebug << QString("Interfaces: Set Options found more then one value for option: %1 in stanza: %1").arg(option).arg((*start)).latin1() << oendl;
614 found = true; 614 found = true;
615 it = interfaces.remove( it ); // we really want to remove the line 615 it = interfaces.remove( it ); // we really want to remove the line
616 --it; // we do ++it later in the head of the for loop 616 --it; // we do ++it later in the head of the for loop
617 } 617 }
618 } 618 }
619 return found; 619 return found;
@@ -660,13 +660,13 @@ QString Interfaces::getOption(const QStringList::Iterator &start, const QString
660 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) { 660 for ( QStringList::Iterator it = start; it != interfaces.end(); ++it ) {
661 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){ 661 if(((*it).contains(IFACE) || (*it).contains(MAPPING) || (*it).contains(AUTO)) && it != start){
662 break; 662 break;
663 } 663 }
664 if((*it).contains(option) && (*it).at(0) != '#'){ 664 if((*it).contains(option) && (*it).at(0) != '#'){
665 if(found) 665 if(found)
666 qDebug(QString("Interfaces: getOption found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1()); 666 odebug << QString("Interfaces: getOption found more then one value: %1 for option: %2 in stanza %3").arg((*it)).arg(option).arg((*start)).latin1() << oendl;
667 found = true; 667 found = true;
668 QString line = (*it).simplifyWhiteSpace(); 668 QString line = (*it).simplifyWhiteSpace();
669 int space = line.find(" ", option.length()); 669 int space = line.find(" ", option.length());
670 if(space != -1){ 670 if(space != -1){
671 value = line.mid(space+1, line.length()); 671 value = line.mid(space+1, line.length());
672 break; 672 break;
@@ -684,26 +684,26 @@ QString Interfaces::getOption(const QStringList::Iterator &start, const QString
684 */ 684 */
685bool Interfaces::write(){ 685bool Interfaces::write(){
686 QFile::remove(interfacesFile); 686 QFile::remove(interfacesFile);
687 QFile file(interfacesFile); 687 QFile file(interfacesFile);
688 688
689 if (!file.open(IO_ReadWrite)){ 689 if (!file.open(IO_ReadWrite)){
690 qDebug(QString("Interfaces: Can't open file: %1 for writing.").arg(interfacesFile).latin1()); 690 odebug << QString("Interfaces: Can't open file: %1 for writing.").arg(interfacesFile).latin1() << oendl;
691 return false; 691 return false;
692 } 692 }
693 QTextStream stream( &file ); 693 QTextStream stream( &file );
694 int whiteSpaceCount = 0; 694 int whiteSpaceCount = 0;
695 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) { 695 for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
696 QString line = (*it).simplifyWhiteSpace(); 696 QString line = (*it).simplifyWhiteSpace();
697 line = line.replace(QRegExp(" "),""); 697 line = line.replace(QRegExp(" "),"");
698 if(line.length() == 0) 698 if(line.length() == 0)
699 whiteSpaceCount++; 699 whiteSpaceCount++;
700 else 700 else
701 whiteSpaceCount = 0; 701 whiteSpaceCount = 0;
702 if(whiteSpaceCount < 2){ 702 if(whiteSpaceCount < 2){
703 qDebug((*it).latin1()); 703 odebug << (*it).latin1() << oendl;
704 stream << (*it) << '\n'; 704 stream << (*it) << '\n';
705 } 705 }
706 } 706 }
707 file.close(); 707 file.close();
708 return true; 708 return true;
709} 709}
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
index 7c2f85c..ec3bad3 100644
--- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp
@@ -43,13 +43,13 @@ InterfaceSetupImp::~InterfaceSetupImp(){
43/** 43/**
44 * Save the current settings, then write out the interfaces file and close. 44 * Save the current settings, then write out the interfaces file and close.
45 */ 45 */
46bool InterfaceSetupImp::saveChanges(){ 46bool InterfaceSetupImp::saveChanges(){
47 bool error; 47 bool error;
48 QString iface = interfaces->getInterfaceName(error); 48 QString iface = interfaces->getInterfaceName(error);
49 qDebug("InterfaceSetupImp::saveChanges saves interface %s", iface.latin1() ); 49 odebug << "InterfaceSetupImp::saveChanges saves interface " << iface.latin1() << "" << oendl;
50 if(!saveSettings()) 50 if(!saveSettings())
51 return false; 51 return false;
52 52
53 interfaces->write(); 53 interfaces->write();
54 54
55 if (interface->getStatus()) { 55 if (interface->getStatus()) {
@@ -69,13 +69,13 @@ bool InterfaceSetupImp::saveChanges(){
69 Global::statusMessage( tr( "Restarting interface" ) ); 69 Global::statusMessage( tr( "Restarting interface" ) );
70 70
71 owait->show(); 71 owait->show();
72 qApp->processEvents(); 72 qApp->processEvents();
73 73
74 if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) { 74 if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) {
75 qWarning("unstable to spawn ifdown/ifup"); 75 owarn << "unstable to spawn ifdown/ifup" << oendl;
76 } 76 }
77 77
78 owait->hide(); 78 owait->hide();
79 delete owait; 79 delete owait;
80 80
81 interface->refresh(); 81 interface->refresh();
@@ -154,23 +154,23 @@ void InterfaceSetupImp::setProfile(const QString &profile){
154 // Add making for this new interface if need too 154 // Add making for this new interface if need too
155 if(profile != ""){ 155 if(profile != ""){
156 interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); 156 interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName);
157 if(!interfaces->setMapping(interface->getInterfaceName())){ 157 if(!interfaces->setMapping(interface->getInterfaceName())){
158 interfaces->addMapping(interface->getInterfaceName()); 158 interfaces->addMapping(interface->getInterfaceName());
159 if(!interfaces->setMapping(interface->getInterfaceName())){ 159 if(!interfaces->setMapping(interface->getInterfaceName())){
160 qDebug("InterfaceSetupImp: Added Mapping, but still can't setInterface."); 160 odebug << "InterfaceSetupImp: Added Mapping, but still can't setInterface." << oendl;
161 return; 161 return;
162 } 162 }
163 } 163 }
164 interfaces->setMap("map", newInterfaceName); 164 interfaces->setMap("map", newInterfaceName);
165 interfaces->setScript("getprofile.sh"); 165 interfaces->setScript("getprofile.sh");
166 } 166 }
167 else{ 167 else{
168 interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); 168 interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP);
169 if(!interfaces->setInterface(newInterfaceName)){ 169 if(!interfaces->setInterface(newInterfaceName)){
170 qDebug("InterfaceSetupImp: Added interface, but still can't setInterface."); 170 odebug << "InterfaceSetupImp: Added interface, but still can't setInterface." << oendl;
171 return; 171 return;
172 } 172 }
173 } 173 }
174 } 174 }
175 175
176 // We must have a valid interface to get this far so read some settings. 176 // We must have a valid interface to get this far so read some settings.
@@ -182,13 +182,13 @@ void InterfaceSetupImp::setProfile(const QString &profile){
182 else 182 else
183 dhcpCheckBox->setChecked(false); 183 dhcpCheckBox->setChecked(false);
184 184
185 // IP Information 185 // IP Information
186 autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); 186 autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName()));
187 QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); 187 QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error);
188 qDebug("dns >%s<",dns.latin1()); 188 odebug << "dns >" << dns.latin1() << "<" << oendl;
189 if(dns.contains(" ")){ 189 if(dns.contains(" ")){
190 firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); 190 firstDNSLineEdit->setText(dns.mid(0, dns.find(" ")));
191 secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); 191 secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length()));
192 }else firstDNSLineEdit->setText(dns); 192 }else firstDNSLineEdit->setText(dns);
193 193
194 ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); 194 ipAddressEdit->setText(interfaces->getInterfaceOption("address", error));
@@ -196,13 +196,13 @@ void InterfaceSetupImp::setProfile(const QString &profile){
196 if (subnetMaskEdit->text().isEmpty()) 196 if (subnetMaskEdit->text().isEmpty())
197 subnetMaskEdit->setText( "255.255.255.0" ); 197 subnetMaskEdit->setText( "255.255.255.0" );
198 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); 198 gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error));
199 199
200 200
201 201
202 qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); 202 owarn << "InterfaceSetupImp::setProfile(" << profile.latin1() << ")\n" << oendl;
203 qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); 203 owarn << "InterfaceSetupImp::setProfile: iface is " << interfaces->getInterfaceName(error).latin1() << "\n" << oendl;
204 204
205} 205}
206 206
207// interfacesetup.cpp 207// interfacesetup.cpp
208 208
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 1e16b97..3e1a650 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -76,13 +76,13 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi
76 /* 76 /*
77 * we skipped it in getAllInterfaces now 77 * we skipped it in getAllInterfaces now
78 * we need to ignore it as well 78 * we need to ignore it as well
79 */ 79 */
80 if (m_handledIfaces.contains( *ni) ) 80 if (m_handledIfaces.contains( *ni) )
81 { 81 {
82 qDebug("Not up iface handled by module"); 82 odebug << "Not up iface handled by module" << oendl;
83 continue; 83 continue;
84 } 84 }
85 bool found = false; 85 bool found = false;
86 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ) 86 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it )
87 { 87 {
88 if(it.key() == (*ni)) 88 if(it.key() == (*ni))
@@ -216,13 +216,13 @@ void MainWindowImp::getAllInterfaces()
216 216
217 for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) 217 for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it)
218 { 218 {
219 int flags = 0; 219 int flags = 0;
220 if ( m_handledIfaces.contains( (*it) ) ) 220 if ( m_handledIfaces.contains( (*it) ) )
221 { 221 {
222 qDebug(" %s is handled by a module", (*it).latin1() ); 222 odebug << " " << (*it).latin1() << " is handled by a module" << oendl;
223 continue; 223 continue;
224 } 224 }
225 // int family; 225 // int family;
226 i = NULL; 226 i = NULL;
227 227
228 strcpy(ifr.ifr_name, (*it).latin1()); 228 strcpy(ifr.ifr_name, (*it).latin1());
@@ -246,13 +246,13 @@ void MainWindowImp::getAllInterfaces()
246 i->setHardwareName("Multicast"); 246 i->setHardwareName("Multicast");
247 else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK) 247 else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK)
248 i->setHardwareName("Loopback"); 248 i->setHardwareName("Loopback");
249 else 249 else
250 i->setHardwareName("Unknown"); 250 i->setHardwareName("Unknown");
251 251
252 qWarning("Adding interface %s to interfaceNames\n", ifr.ifr_name); 252 owarn << "Adding interface " << ifr.ifr_name << " to interfaceNames\n" << oendl;
253 interfaceNames.insert(i->getInterfaceName(), i); 253 interfaceNames.insert(i->getInterfaceName(), i);
254 updateInterface(i); 254 updateInterface(i);
255 connect(i, SIGNAL(updateInterface(Interface*)), 255 connect(i, SIGNAL(updateInterface(Interface*)),
256 this, SLOT(updateInterface(Interface*))); 256 this, SLOT(updateInterface(Interface*)));
257 } 257 }
258 // now lets ask the plugins too ;) 258 // now lets ask the plugins too ;)
@@ -262,13 +262,13 @@ void MainWindowImp::getAllInterfaces()
262 { 262 {
263 if(it.key()) 263 if(it.key())
264 { 264 {
265 ilist = it.key()->getInterfaces(); 265 ilist = it.key()->getInterfaces();
266 for( i = ilist.first(); i != 0; i = ilist.next() ) 266 for( i = ilist.first(); i != 0; i = ilist.next() )
267 { 267 {
268 qWarning("Adding interface %s to interfaceNames\n", i->getInterfaceName().latin1() ); 268 owarn << "Adding interface " << i->getInterfaceName().latin1() << " to interfaceNames\n" << oendl;
269 interfaceNames.insert(i->getInterfaceName(), i); 269 interfaceNames.insert(i->getInterfaceName(), i);
270 updateInterface(i); 270 updateInterface(i);
271 connect(i, SIGNAL(updateInterface(Interface*)), 271 connect(i, SIGNAL(updateInterface(Interface*)),
272 this, SLOT(updateInterface(Interface*))); 272 this, SLOT(updateInterface(Interface*)));
273 } 273 }
274 } 274 }
@@ -280,13 +280,13 @@ void MainWindowImp::getAllInterfaces()
280 * @param path a directory that is scaned for any plugins that can be loaded 280 * @param path a directory that is scaned for any plugins that can be loaded
281 * and attempts to load them 281 * and attempts to load them
282 */ 282 */
283void MainWindowImp::loadModules(const QString &path) 283void MainWindowImp::loadModules(const QString &path)
284{ 284{
285#ifdef DEBUG 285#ifdef DEBUG
286 qDebug("MainWindowImp::loadModules: %s", path.latin1()); 286 odebug << "MainWindowImp::loadModules: " << path.latin1() << "" << oendl;
287#endif 287#endif
288 QDir d(path); 288 QDir d(path);
289 if(!d.exists()) 289 if(!d.exists())
290 return; 290 return;
291 291
292 // Don't want sym links 292 // Don't want sym links
@@ -301,13 +301,13 @@ void MainWindowImp::loadModules(const QString &path)
301 { 301 {
302#else 302#else
303 if(fi->fileName().contains(".so") && fi->fileName().contains("networksettings_")) 303 if(fi->fileName().contains(".so") && fi->fileName().contains("networksettings_"))
304 { 304 {
305#endif 305#endif
306 loadPlugin(path + "/" + fi->fileName()); 306 loadPlugin(path + "/" + fi->fileName());
307 qDebug("loaded plugin: >%s< ",QString(path + "/" + fi->fileName()).latin1()); 307 odebug << "loaded plugin: >" << QString(path + "/" + fi->fileName()).latin1() << "< " << oendl;
308 } 308 }
309 ++it; 309 ++it;
310 } 310 }
311} 311}
312 312
313/** 313/**
@@ -316,31 +316,31 @@ void MainWindowImp::loadModules(const QString &path)
316 * @param resolveString - function pointer to resolve 316 * @param resolveString - function pointer to resolve
317 * @return pointer to the function with name resolveString or NULL 317 * @return pointer to the function with name resolveString or NULL
318 */ 318 */
319Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString) 319Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString)
320{ 320{
321#ifdef DEBUG 321#ifdef DEBUG
322 qDebug("MainWindowImp::loadPlugin: %s: resolving %s", pluginFileName.latin1(), resolveString.latin1()); 322 odebug << "MainWindowImp::loadPlugin: " << pluginFileName.latin1() << ": resolving " << resolveString.latin1() << "" << oendl;
323#endif 323#endif
324#ifdef QWS 324#ifdef QWS
325 QLibrary *lib = new QLibrary(pluginFileName); 325 QLibrary *lib = new QLibrary(pluginFileName);
326 void *functionPointer = lib->resolve(resolveString); 326 void *functionPointer = lib->resolve(resolveString);
327 if( !functionPointer ) 327 if( !functionPointer )
328 { 328 {
329#ifdef DEBUG 329#ifdef DEBUG
330 qDebug("MainWindowImp::loadPlugin: Warning: %s is not a plugin", pluginFileName.latin1()); 330 odebug << "MainWindowImp::loadPlugin: Warning: " << pluginFileName.latin1() << " is not a plugin" << oendl;
331#endif 331#endif
332 delete lib; 332 delete lib;
333 return NULL; 333 return NULL;
334 } 334 }
335 // Try to get an object. 335 // Try to get an object.
336 Module *object = ((Module* (*)()) functionPointer)(); 336 Module *object = ((Module* (*)()) functionPointer)();
337 if(object == NULL) 337 if(object == NULL)
338 { 338 {
339#ifdef DEBUG 339#ifdef DEBUG
340 qDebug("MainWindowImp: Couldn't create object, but did load library!"); 340 odebug << "MainWindowImp: Couldn't create object, but did load library!" << oendl;
341#endif 341#endif
342 delete lib; 342 delete lib;
343 return NULL; 343 return NULL;
344 } 344 }
345 345
346 m_handledIfaces += object->handledInterfaceNames(); 346 m_handledIfaces += object->handledInterfaceNames();
@@ -349,26 +349,26 @@ Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &
349 return object; 349 return object;
350 350
351#else 351#else
352 QLibrary *lib = loader->library(pluginFileName); 352 QLibrary *lib = loader->library(pluginFileName);
353 if( !lib || !lib->hasSymbol(resolveString) ) 353 if( !lib || !lib->hasSymbol(resolveString) )
354 { 354 {
355 qDebug(QString("MainWindowImp::loadPlugin: File: %1 is not a plugin, but though was.").arg(pluginFileName).latin1()); 355 odebug << QString("MainWindowImp::loadPlugin: File: %1 is not a plugin, but though was.").arg(pluginFileName).latin1() << oendl;
356 return NULL; 356 return NULL;
357 } 357 }
358 // Try to get an object. 358 // Try to get an object.
359 Module *object = ((Module* (*)()) lib->symbol(resolveString))(); 359 Module *object = ((Module* (*)()) lib->symbol(resolveString))();
360 if(object == NULL) 360 if(object == NULL)
361 { 361 {
362#ifdef DEBUG 362#ifdef DEBUG
363 qDebug("MainWindowImp: Couldn't create object, but did load library!"); 363 odebug << "MainWindowImp: Couldn't create object, but did load library!" << oendl;
364#endif 364#endif
365 return NULL; 365 return NULL;
366 } 366 }
367#ifdef DEBUG 367#ifdef DEBUG
368 qDebug("MainWindowImp::loadPlugin:: Found object, storing."); 368 odebug << "MainWindowImp::loadPlugin:: Found object, storing." << oendl;
369#endif 369#endif
370 // Store for deletion later 370 // Store for deletion later
371 libraries.insert(object, lib); 371 libraries.insert(object, lib);
372 return object; 372 return object;
373#endif 373#endif
374} 374}
@@ -408,13 +408,13 @@ void MainWindowImp::addClicked()
408 { 408 {
409 if(it.key()) 409 if(it.key())
410 { 410 {
411 Interface *i = (it.key())->addNewInterface(item->text(0)); 411 Interface *i = (it.key())->addNewInterface(item->text(0));
412 if(i) 412 if(i)
413 { 413 {
414 qDebug("iface name %s",i->getInterfaceName().latin1()); 414 odebug << "iface name " << i->getInterfaceName().latin1() << "" << oendl;
415 interfaceNames.insert(i->getInterfaceName(), i); 415 interfaceNames.insert(i->getInterfaceName(), i);
416 updateInterface(i); 416 updateInterface(i);
417 } 417 }
418 } 418 }
419 } 419 }
420 } 420 }
@@ -510,13 +510,13 @@ void MainWindowImp::informationClicked()
510 { 510 {
511 QWidget *moduleInformation = i->getModuleOwner()->information(i); 511 QWidget *moduleInformation = i->getModuleOwner()->information(i);
512 if(moduleInformation != NULL) 512 if(moduleInformation != NULL)
513 { 513 {
514 QPEApplication::showWidget( moduleInformation ); 514 QPEApplication::showWidget( moduleInformation );
515#ifdef DEBUG 515#ifdef DEBUG
516 qDebug("MainWindowImp::informationClicked:: Module owner has created, we showed."); 516 odebug << "MainWindowImp::informationClicked:: Module owner has created, we showed." << oendl;
517#endif 517#endif
518 return; 518 return;
519 } 519 }
520 } 520 }
521 InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog | Qt::WStyle_ContextHelp); 521 InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog | Qt::WStyle_ContextHelp);
522 QPEApplication::showWidget( information ); 522 QPEApplication::showWidget( information );
@@ -647,13 +647,13 @@ void MainWindowImp::removeProfile()
647 Interfaces interfaces; 647 Interfaces interfaces;
648 // Go through them one by one 648 // Go through them one by one
649 QMap<Interface*, QListViewItem*>::Iterator it; 649 QMap<Interface*, QListViewItem*>::Iterator it;
650 for( it = items.begin(); it != items.end(); ++it ) 650 for( it = items.begin(); it != items.end(); ++it )
651 { 651 {
652 QString interfaceName = it.key()->getInterfaceName(); 652 QString interfaceName = it.key()->getInterfaceName();
653 qDebug(interfaceName.latin1()); 653 odebug << interfaceName.latin1() << oendl;
654 if(interfaces.setInterface(interfaceName + "_" + profileToRemove)) 654 if(interfaces.setInterface(interfaceName + "_" + profileToRemove))
655 { 655 {
656 interfaces.removeInterface(); 656 interfaces.removeInterface();
657 if(interfaces.setMapping(interfaceName)) 657 if(interfaces.setMapping(interfaceName))
658 { 658 {
659 if(profilesList->count() == 1) 659 if(profilesList->count() == 1)
@@ -716,33 +716,33 @@ void MainWindowImp::makeChannel()
716 this, SLOT(receive(const QCString&,const QByteArray&)) ); 716 this, SLOT(receive(const QCString&,const QByteArray&)) );
717} 717}
718 718
719void MainWindowImp::receive(const QCString &msg, const QByteArray &arg) 719void MainWindowImp::receive(const QCString &msg, const QByteArray &arg)
720{ 720{
721 bool found = false; 721 bool found = false;
722 qDebug("MainWindowImp::receive QCop msg >"+msg+"<"); 722 odebug << "MainWindowImp::receive QCop msg >"+msg+"<" << oendl;
723 if (msg == "raise") 723 if (msg == "raise")
724 { 724 {
725 raise(); 725 raise();
726 return; 726 return;
727 } 727 }
728 728
729 QString dest = msg.left(msg.find("(")); 729 QString dest = msg.left(msg.find("("));
730 QCString param = msg.right(msg.length() - msg.find("(") - 1); 730 QCString param = msg.right(msg.length() - msg.find("(") - 1);
731 param = param.left( param.length() - 1 ); 731 param = param.left( param.length() - 1 );
732 qDebug("dest >%s< param >"+param+"<",dest.latin1()); 732 odebug << "dest >" << dest.latin1() << "< param >"+param+"<" << oendl;
733 733
734 QMap<Module*, QLibrary*>::Iterator it; 734 QMap<Module*, QLibrary*>::Iterator it;
735 for( it = libraries.begin(); it != libraries.end(); ++it ) 735 for( it = libraries.begin(); it != libraries.end(); ++it )
736 { 736 {
737 qDebug("plugin >%s<", it.key()->type().latin1() ); 737 odebug << "plugin >" << it.key()->type().latin1() << "<" << oendl;
738 if(it.key()->type() == dest) 738 if(it.key()->type() == dest)
739 { 739 {
740 it.key()->receive( param, arg ); 740 it.key()->receive( param, arg );
741 found = true; 741 found = true;
742 } 742 }
743 } 743 }
744 744
745 745
746 if (found) QPEApplication::setKeepRunning(); 746 if (found) QPEApplication::setKeepRunning();
747 else qDebug("Huh what do ya want"); 747 else odebug << "Huh what do ya want" << oendl;
748} 748}
diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp
index b8a1925a..aedc0b9 100644
--- a/noncore/settings/networksettings/ppp/accounts.cpp
+++ b/noncore/settings/networksettings/ppp/accounts.cpp
@@ -115,13 +115,13 @@ void AccountWidget::create()
115 // return; 115 // return;
116 // } 116 // }
117 117
118 int result; 118 int result;
119 if (_pppdata->newaccount() == -1) 119 if (_pppdata->newaccount() == -1)
120 { 120 {
121 qDebug("_pppdata->newaccount() == -1"); 121 odebug << "_pppdata->newaccount() == -1" << oendl;
122 return; 122 return;
123 } 123 }
124 result = doTab(); 124 result = doTab();
125 125
126 if(result == QDialog::Accepted) 126 if(result == QDialog::Accepted)
127 { 127 {
diff --git a/noncore/settings/networksettings/ppp/authwidget.cpp b/noncore/settings/networksettings/ppp/authwidget.cpp
index fa2b164..f3d842f 100644
--- a/noncore/settings/networksettings/ppp/authwidget.cpp
+++ b/noncore/settings/networksettings/ppp/authwidget.cpp
@@ -139,22 +139,22 @@ void AuthWidget::save()
139 if (store_password->isChecked()) 139 if (store_password->isChecked())
140 _pppdata->setStoredPassword( passWord->text() ); 140 _pppdata->setStoredPassword( passWord->text() );
141} 141}
142 142
143void AuthWidget::authChanged( const QString &authStr ) 143void AuthWidget::authChanged( const QString &authStr )
144{ 144{
145 qDebug("AuthWidget::authChanged( %s )", authStr.latin1() ); 145 odebug << "AuthWidget::authChanged( " << authStr.latin1() << " )" << oendl;
146 if ( authStr.contains( tr("Script-based") ) ){ 146 if ( authStr.contains( tr("Script-based") ) ){
147 showUsernamePassword( false ); 147 showUsernamePassword( false );
148 showScriptWindow( true ); 148 showScriptWindow( true );
149 } else if ( authStr.contains( tr("PAP") ) || 149 } else if ( authStr.contains( tr("PAP") ) ||
150 authStr.contains( tr("CHAP") ) ){ 150 authStr.contains( tr("CHAP") ) ){
151 showUsernamePassword( true ); 151 showUsernamePassword( true );
152 showScriptWindow( false ); 152 showScriptWindow( false );
153 } else { 153 } else {
154 qDebug("do not really know how to handle"); 154 odebug << "do not really know how to handle" << oendl;
155 showUsernamePassword( false ); 155 showUsernamePassword( false );
156 showScriptWindow( false ); 156 showScriptWindow( false );
157 } 157 }
158} 158}
159 159
160 160
diff --git a/noncore/settings/networksettings/ppp/connect.cpp b/noncore/settings/networksettings/ppp/connect.cpp
index e3fab24..b75410c 100644
--- a/noncore/settings/networksettings/ppp/connect.cpp
+++ b/noncore/settings/networksettings/ppp/connect.cpp
@@ -469,13 +469,13 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
469 timeout_timer->start(scriptTimeout); 469 timeout_timer->start(scriptTimeout);
470 470
471 if((unsigned) scriptindex < comlist->count()) { 471 if((unsigned) scriptindex < comlist->count()) {
472 scriptCommand = *(comlist->at(scriptindex)); 472 scriptCommand = *(comlist->at(scriptindex));
473 scriptArgument = *(arglist->at(scriptindex)); 473 scriptArgument = *(arglist->at(scriptindex));
474 } else { 474 } else {
475 qDebug( "End of script" ); 475 odebug << "End of script" << oendl;
476 vmain = 10; 476 vmain = 10;
477 return; 477 return;
478 } 478 }
479 479
480 if (scriptCommand == "Scan") { 480 if (scriptCommand == "Scan") {
481 QString bm = QObject::tr("Scanning %1").arg(scriptArgument); 481 QString bm = QObject::tr("Scanning %1").arg(scriptArgument);
@@ -835,23 +835,23 @@ void ConnectWidget::timerEvent(QTimerEvent *) {
835 and closing the thing prevents pppd from using it later. */ 835 and closing the thing prevents pppd from using it later. */
836 //_ifaceppp->modem()->closetty(); 836 //_ifaceppp->modem()->closetty();
837 837
838 killTimer( main_timer_ID ); 838 killTimer( main_timer_ID );
839 839
840 if_timeout_timer->start(_ifaceppp->data()->pppdTimeout()*1000); 840 if_timeout_timer->start(_ifaceppp->data()->pppdTimeout()*1000);
841 qDebug( "started if timeout timer with %i", _ifaceppp->data()->pppdTimeout()*1000); 841 odebug << "started if timeout timer with " << _ifaceppp->data()->pppdTimeout()*1000 << "" << oendl;
842 842
843 // find out PPP interface and notify the stats module 843 // find out PPP interface and notify the stats module
844// stats->setUnit(pppInterfaceNumber()); 844// stats->setUnit(pppInterfaceNumber());
845 845
846 qApp->flushX(); 846 qApp->flushX();
847 semaphore = true; 847 semaphore = true;
848 result = execppp(); 848 result = execppp();
849 849
850 emit debugMessage(QObject::tr("Starting pppd...")); 850 emit debugMessage(QObject::tr("Starting pppd..."));
851 qDebug("execppp() returned with return-code %i", result ); 851 odebug << "execppp() returned with return-code " << result << "" << oendl;
852 852
853 if(result) { 853 if(result) {
854 if(!_ifaceppp->data()->autoDNS()) 854 if(!_ifaceppp->data()->autoDNS())
855 adddns( _ifaceppp ); 855 adddns( _ifaceppp );
856 856
857 // O.K we are done here, let's change over to the if_waiting loop 857 // O.K we are done here, let's change over to the if_waiting loop
@@ -1061,13 +1061,13 @@ void ConnectWidget::setExpect(const QString &n) {
1061} 1061}
1062 1062
1063 1063
1064void ConnectWidget::if_waiting_timed_out() { 1064void ConnectWidget::if_waiting_timed_out() {
1065 if_timer->stop(); 1065 if_timer->stop();
1066 if_timeout_timer->stop(); 1066 if_timeout_timer->stop();
1067 qDebug("if_waiting_timed_out()"); 1067 odebug << "if_waiting_timed_out()" << oendl;
1068 1068
1069 _ifaceppp->data()->setpppdError(E_IF_TIMEOUT); 1069 _ifaceppp->data()->setpppdError(E_IF_TIMEOUT);
1070 1070
1071 // let's kill the stuck pppd 1071 // let's kill the stuck pppd
1072 _ifaceppp->modem()->killPPPDaemon(); 1072 _ifaceppp->modem()->killPPPDaemon();
1073 1073
@@ -1268,13 +1268,13 @@ bool ConnectWidget::execppp() {
1268 "2024 characters in length." 1268 "2024 characters in length."
1269 )); 1269 ));
1270 1270
1271 return false; // nonsensically long command which would bust my buffer buf. 1271 return false; // nonsensically long command which would bust my buffer buf.
1272 } 1272 }
1273 1273
1274 qWarning("Command IS: %s",command.latin1() ); 1274 owarn << "Command IS: " << command.latin1() << "" << oendl;
1275 1275
1276 qApp->flushX(); 1276 qApp->flushX();
1277 1277
1278 return _ifaceppp->modem()->execPPPDaemon(command); 1278 return _ifaceppp->modem()->execPPPDaemon(command);
1279} 1279}
1280 1280
diff --git a/noncore/settings/networksettings/ppp/devices.cpp b/noncore/settings/networksettings/ppp/devices.cpp
index 9da090d..350ff32 100644
--- a/noncore/settings/networksettings/ppp/devices.cpp
+++ b/noncore/settings/networksettings/ppp/devices.cpp
@@ -69,17 +69,17 @@ DevicesWidget::DevicesWidget( InterfacePPP* ip, QWidget *parent, const char *nam
69 "<font color=\"red\"><b>Use with care!</b></font>")); 69 "<font color=\"red\"><b>Use with care!</b></font>"));
70 70
71 copy_b->setEnabled( false ); //FIXME 71 copy_b->setEnabled( false ); //FIXME
72// delete_b->setEnabled( false ); //FIXME 72// delete_b->setEnabled( false ); //FIXME
73 73
74 QStringList tmp = _pppdata->getDevicesNamesList(); 74 QStringList tmp = _pppdata->getDevicesNamesList();
75 qDebug("DevicesWidget::DevicesWidget got devices %s",tmp.join("--").latin1()); 75 odebug << "DevicesWidget::DevicesWidget got devices " << tmp.join("--").latin1() << "" << oendl;
76 listListbox->insertStringList(tmp); 76 listListbox->insertStringList(tmp);
77 77
78 for (uint i = 0; i < listListbox->count(); i++){ 78 for (uint i = 0; i < listListbox->count(); i++){
79 qDebug("listListbox->text(i) %s == _pppdata->devname() %s",listListbox->text(i).latin1(), _pppdata->devname().latin1()); 79 odebug << "listListbox->text(i) " << listListbox->text(i).latin1() << " == _pppdata->devname() " << _pppdata->devname().latin1() << "" << oendl;
80 if ( listListbox->text(i) == _pppdata->devname() ) 80 if ( listListbox->text(i) == _pppdata->devname() )
81 listListbox->setCurrentItem( i ); 81 listListbox->setCurrentItem( i );
82 } 82 }
83} 83}
84 84
85 85
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp
index 81dab38..69bb682 100644
--- a/noncore/settings/networksettings/ppp/general.cpp
+++ b/noncore/settings/networksettings/ppp/general.cpp
@@ -332,13 +332,13 @@ bool ModemWidget::save()
332{ 332{
333 //first check to make sure that the device name is unique! 333 //first check to make sure that the device name is unique!
334 if(modemname->text().isEmpty() || 334 if(modemname->text().isEmpty() ||
335 !_pppdata->isUniqueDevname(modemname->text())) 335 !_pppdata->isUniqueDevname(modemname->text()))
336 return false; 336 return false;
337 337
338 qDebug("ModemWidget::save saving modem1 data"); 338 odebug << "ModemWidget::save saving modem1 data" << oendl;
339 _pppdata->setDevname( modemname->text() ); 339 _pppdata->setDevname( modemname->text() );
340 _pppdata->setModemDevice( modemdevice->currentText() ); 340 _pppdata->setModemDevice( modemdevice->currentText() );
341 _pppdata->setFlowcontrol(flowcontrol->currentText()); 341 _pppdata->setFlowcontrol(flowcontrol->currentText());
342 _pppdata->setFlowcontrol(flowcontrol->currentText()); 342 _pppdata->setFlowcontrol(flowcontrol->currentText());
343 _pppdata->setSpeed(baud_c->currentText()); 343 _pppdata->setSpeed(baud_c->currentText());
344 _pppdata->setModemLockFile( modemlockfile->isChecked()); 344 _pppdata->setModemLockFile( modemlockfile->isChecked());
diff --git a/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp b/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp
index 6b158b9..5a76293 100644
--- a/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp
+++ b/noncore/settings/networksettings/ppp/interfaceinformationppp.cpp
@@ -17,13 +17,13 @@
17 * Constructor for the InterfaceInformationImp class. This class pretty much 17 * Constructor for the InterfaceInformationImp class. This class pretty much
18 * just display's information about the interface that is passed to it. 18 * just display's information about the interface that is passed to it.
19 */ 19 */
20InterfaceInformationPPP::InterfaceInformationPPP(QWidget *parent, const char *name, Interface *i, WFlags f) 20InterfaceInformationPPP::InterfaceInformationPPP(QWidget *parent, const char *name, Interface *i, WFlags f)
21 :InterfaceInformationImp(parent, name, i, Qt::WStyle_ContextHelp) 21 :InterfaceInformationImp(parent, name, i, Qt::WStyle_ContextHelp)
22{ 22{
23 qDebug("InterfaceInformationPPP::InterfaceInformationPPP %s", name); 23 odebug << "InterfaceInformationPPP::InterfaceInformationPPP " << name << "" << oendl;
24 con = new ConnectWidget( (InterfacePPP*)i, this, "con" ); 24 con = new ConnectWidget( (InterfacePPP*)i, this, "con" );
25 con->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, 25 con->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding,
26 QSizePolicy::Fixed) ); 26 QSizePolicy::Fixed) );
27 27
28 macAddressLabel->hide(); 28 macAddressLabel->hide();
29 subnetMaskLabel->hide(); 29 subnetMaskLabel->hide();
diff --git a/noncore/settings/networksettings/ppp/interfaceppp.cpp b/noncore/settings/networksettings/ppp/interfaceppp.cpp
index f443f3c..5cc6f70 100644
--- a/noncore/settings/networksettings/ppp/interfaceppp.cpp
+++ b/noncore/settings/networksettings/ppp/interfaceppp.cpp
@@ -11,38 +11,38 @@
11 11
12InterfacePPP::InterfacePPP(QObject *parent, const char *name, bool status) 12InterfacePPP::InterfacePPP(QObject *parent, const char *name, bool status)
13 : Interface(parent, name, status), 13 : Interface(parent, name, status),
14 _modemPtr(0), 14 _modemPtr(0),
15 _dataPtr(0) 15 _dataPtr(0)
16{ 16{
17 qDebug("InterfacePPP::InterfacePPP("); 17 odebug << "InterfacePPP::InterfacePPP(" << oendl;
18} 18}
19 19
20PPPData* InterfacePPP::data()const 20PPPData* InterfacePPP::data()const
21{ 21{
22 if (!_dataPtr){ 22 if (!_dataPtr){
23 qDebug("creating new Data obj"); 23 odebug << "creating new Data obj" << oendl;
24 _dataPtr = new PPPData(); 24 _dataPtr = new PPPData();
25 _dataPtr->setDevice( getInterfaceName() ); 25 _dataPtr->setDevice( getInterfaceName() );
26 _dataPtr->setAccount( getHardwareName() ); 26 _dataPtr->setAccount( getHardwareName() );
27 } 27 }
28 return _dataPtr; 28 return _dataPtr;
29} 29}
30 30
31Modem* InterfacePPP::modem()const 31Modem* InterfacePPP::modem()const
32{ 32{
33 if (!_modemPtr){ 33 if (!_modemPtr){
34 qDebug("creating new modem obj"); 34 odebug << "creating new modem obj" << oendl;
35 _modemPtr = new Modem( data() ); 35 _modemPtr = new Modem( data() );
36 } 36 }
37 return _modemPtr; 37 return _modemPtr;
38} 38}
39 39
40bool InterfacePPP::refresh() 40bool InterfacePPP::refresh()
41{ 41{
42 qDebug("InterfacePPP::refresh()"); 42 odebug << "InterfacePPP::refresh()" << oendl;
43 QString old = getInterfaceName(); 43 QString old = getInterfaceName();
44 setInterfaceName( modem()->pppDevice() ); 44 setInterfaceName( modem()->pppDevice() );
45 45
46 (void)Interface::refresh(); 46 (void)Interface::refresh();
47 47
48 setInterfaceName( old ); 48 setInterfaceName( old );
@@ -50,13 +50,13 @@ bool InterfacePPP::refresh()
50 50
51 return true; 51 return true;
52} 52}
53 53
54void InterfacePPP::start() 54void InterfacePPP::start()
55{ 55{
56 qDebug("InterfacePPP::start"); 56 odebug << "InterfacePPP::start" << oendl;
57 57
58 if (data()->password().isEmpty() && !data()->storedUsername().isEmpty() ) { 58 if (data()->password().isEmpty() && !data()->storedUsername().isEmpty() ) {
59 59
60 QDialog mb( 0, "Dialog", true ); 60 QDialog mb( 0, "Dialog", true );
61 mb.setCaption( tr( "No password" ) ); 61 mb.setCaption( tr( "No password" ) );
62 QVBoxLayout layout( &mb ); 62 QVBoxLayout layout( &mb );
@@ -140,18 +140,18 @@ void InterfacePPP::start()
140 // SEGFAULTS: 140 // SEGFAULTS:
141// setStatus( true ); 141// setStatus( true );
142// emit updateInterface((Interface*) this); 142// emit updateInterface((Interface*) this);
143 143
144 emit begin_connect(); 144 emit begin_connect();
145 145
146 qDebug("InterfacePPP::start END"); 146 odebug << "InterfacePPP::start END" << oendl;
147} 147}
148 148
149void InterfacePPP::stop() 149void InterfacePPP::stop()
150{ 150{
151 qDebug("InterfacePPP::stop"); 151 odebug << "InterfacePPP::stop" << oendl;
152 // emit hangup_now(); 152 // emit hangup_now();
153 status = false; // not connected 153 status = false; // not connected
154 setStatus( false ); 154 setStatus( false );
155 emit hangup_now(); 155 emit hangup_now();
156 refresh(); 156 refresh();
157 157
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp
index e21bbc7..fd09332 100644
--- a/noncore/settings/networksettings/ppp/kpppwidget.cpp
+++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp
@@ -71,19 +71,19 @@ KPPPWidget::KPPPWidget(PPPData*pd, Interface *i, QWidget *parent, const char *na
71{ 71{
72// tabWindow = 0; 72// tabWindow = 0;
73 p_kppp = this; 73 p_kppp = this;
74 // before doing anything else, run a few tests 74 // before doing anything else, run a few tests
75 if (!_pppdata->setModemDevice( i->getInterfaceName() )) 75 if (!_pppdata->setModemDevice( i->getInterfaceName() ))
76 _pppdata->setModemDevice("/dev/modem"); 76 _pppdata->setModemDevice("/dev/modem");
77 qDebug("PPPConfigWidget::PPPConfigWidget"); 77 odebug << "PPPConfigWidget::PPPConfigWidget" << oendl;
78 qDebug(" interface->getHardwareName >%s<", i->getHardwareName().latin1()); 78 odebug << " interface->getHardwareName >" << i->getHardwareName().latin1() << "<" << oendl;
79 if (!_pppdata->setAccount( i->getHardwareName() )) 79 if (!_pppdata->setAccount( i->getHardwareName() ))
80 _pppdata->setAccount( 0 ); 80 _pppdata->setAccount( 0 );
81 81
82 qDebug(" _pppdata->accname >%s<",_pppdata->accname().latin1()); 82 odebug << " _pppdata->accname >" << _pppdata->accname().latin1() << "<" << oendl;
83 qDebug(" _pppdata->currentAccountID() >%i<",_pppdata->currentAccountID()); 83 odebug << " _pppdata->currentAccountID() >" << _pppdata->currentAccountID() << "<" << oendl;
84 84
85 int result = runTests(); 85 int result = runTests();
86 if(result == TEST_CRITICAL) 86 if(result == TEST_CRITICAL)
87 exit(4); 87 exit(4);
88 88
89// installEventFilter(this); 89// installEventFilter(this);
@@ -302,13 +302,13 @@ KPPPWidget::~KPPPWidget()
302} 302}
303 303
304// bool KPPPWidget::eventFilter(QObject *o, QEvent *e) { 304// bool KPPPWidget::eventFilter(QObject *o, QEvent *e) {
305// if(e->type() == QEvent::User) { 305// if(e->type() == QEvent::User) {
306// switch(((SignalEvent*)e)->sigType()) { 306// switch(((SignalEvent*)e)->sigType()) {
307// case SIGINT: 307// case SIGINT:
308// qDebug( "Received a SIGINT" ); 308// odebug << "Received a SIGINT" << oendl;
309// interruptConnection(); 309// interruptConnection();
310// break; 310// break;
311// case SIGCHLD: 311// case SIGCHLD:
312// sigChld(); 312// sigChld();
313// break; 313// break;
314// case SIGUSR1: 314// case SIGUSR1:
@@ -420,32 +420,32 @@ void KPPPWidget::interruptConnection() {
420 if (_pppdata->pppdRunning()) 420 if (_pppdata->pppdRunning())
421 emit disconnect(); 421 emit disconnect();
422} 422}
423 423
424 424
425void KPPPWidget::sigPPPDDied() { 425void KPPPWidget::sigPPPDDied() {
426 qDebug( "Received a SIGUSR1" ); 426 odebug << "Received a SIGUSR1" << oendl;
427 427
428 // if we are not connected pppdpid is -1 so have have to check for that 428 // if we are not connected pppdpid is -1 so have have to check for that
429 // in the followin line to make sure that we don't raise a false alarm 429 // in the followin line to make sure that we don't raise a false alarm
430 // such as would be the case when the log file viewer exits. 430 // such as would be the case when the log file viewer exits.
431 if(_pppdata->pppdRunning() || _pppdata->pppdError()) { 431 if(_pppdata->pppdRunning() || _pppdata->pppdError()) {
432 qDebug( "It was pppd that died" ); 432 odebug << "It was pppd that died" << oendl;
433 433
434 // when we killpppd() on Cancel in ConnectWidget 434 // when we killpppd() on Cancel in ConnectWidget
435 // we set pppid to -1 so we won't 435 // we set pppid to -1 so we won't
436 // enter this block 436 // enter this block
437 437
438 // just to be sure 438 // just to be sure
439 439
440 Modem::modem->removeSecret(AUTH_PAP); 440 Modem::modem->removeSecret(AUTH_PAP);
441 Modem::modem->removeSecret(AUTH_CHAP); 441 Modem::modem->removeSecret(AUTH_CHAP);
442 442
443 _pppdata->setpppdRunning(false); 443 _pppdata->setpppdRunning(false);
444 444
445 qDebug( "Executing command on disconnect since pppd has died." ); 445 odebug << "Executing command on disconnect since pppd has died." << oendl;
446 QApplication::flushX(); 446 QApplication::flushX();
447 execute_command(_pppdata->command_on_disconnect()); 447 execute_command(_pppdata->command_on_disconnect());
448 448
449// stopAccounting(); 449// stopAccounting();
450 450
451 con_win->stopClock(); 451 con_win->stopClock();
@@ -486,13 +486,13 @@ void KPPPWidget::sigPPPDDied() {
486 } 486 }
487 487
488 // if(QMessageBox::warning(0, msg, QObject::tr("Error"), QObject::tr("&OK"), QObject::tr("&Details...")) == QMessageBox::No) 488 // if(QMessageBox::warning(0, msg, QObject::tr("Error"), QObject::tr("&OK"), QObject::tr("&Details...")) == QMessageBox::No)
489 // // PPPL_ShowLog(); 489 // // PPPL_ShowLog();
490// } else { /* reconnect on disconnect */ 490// } else { /* reconnect on disconnect */
491 if (false){ 491 if (false){
492 qDebug( "Trying to reconnect... " ); 492 odebug << "Trying to reconnect... " << oendl;
493 493
494 if(_pppdata->authMethod() == AUTH_PAP || 494 if(_pppdata->authMethod() == AUTH_PAP ||
495 _pppdata->authMethod() == AUTH_CHAP || 495 _pppdata->authMethod() == AUTH_CHAP ||
496 _pppdata->authMethod() == AUTH_PAPCHAP) 496 _pppdata->authMethod() == AUTH_PAPCHAP)
497 Modem::modem->setSecret(_pppdata->authMethod(), 497 Modem::modem->setSecret(_pppdata->authMethod(),
498 encodeWord(_pppdata->storedUsername()), 498 encodeWord(_pppdata->storedUsername()),
@@ -508,13 +508,13 @@ void KPPPWidget::sigPPPDDied() {
508 } 508 }
509 _pppdata->setpppdError(0); 509 _pppdata->setpppdError(0);
510 } 510 }
511} 511}
512 512
513// void KPPPWidget::sigChld() { 513// void KPPPWidget::sigChld() {
514// qDebug( "sigchld()" ); 514// odebug << "sigchld()" << oendl;
515// // pid_t id = wait(0L); 515// // pid_t id = wait(0L);
516// // if(id == helperPid && helperPid != -1) { 516// // if(id == helperPid && helperPid != -1) {
517// // kdDebug(5002) << "It was the setuid child that died" << endl; 517// // kdDebug(5002) << "It was the setuid child that died" << endl;
518// // helperPid = -1; 518// // helperPid = -1;
519// QString msg = QObject::tr("kppp's helper process just died.\n" 519// QString msg = QObject::tr("kppp's helper process just died.\n"
520// "Since a further execution would be pointless, " 520// "Since a further execution would be pointless, "
diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp
index 3dbc8c3..f3f2639 100644
--- a/noncore/settings/networksettings/ppp/modem.cpp
+++ b/noncore/settings/networksettings/ppp/modem.cpp
@@ -52,13 +52,13 @@
52#include "modem.h" 52#include "modem.h"
53#include "pppdata.h" 53#include "pppdata.h"
54#define qError qDebug 54#define qError qDebug
55 55
56 56
57#define MY_ASSERT(x) if (!(x)) { \ 57#define MY_ASSERT(x) if (!(x)) { \
58 qFatal( "ASSERT: \"%s\" in %s (%d)\n",#x,__FILE__,__LINE__); \ 58 ofatal << "ASSERT: \"" << #x << "\" in " << __FILE__ << " (" << __LINE__ << ")\n" << oendl; \
59 exit(1); } 59 exit(1); }
60 60
61 61
62static sigjmp_buf jmp_buffer; 62static sigjmp_buf jmp_buffer;
63 63
64//Modem *Modem::modem = 0; 64//Modem *Modem::modem = 0;
@@ -162,13 +162,13 @@ bool Modem::opentty() {
162 // int flags; 162 // int flags;
163 163
164//begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { 164//begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) {
165 close(modemfd); 165 close(modemfd);
166 device = _pppdata->modemDevice(); 166 device = _pppdata->modemDevice();
167 if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { 167 if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) {
168 qDebug("error opening modem device !"); 168 odebug << "error opening modem device !" << oendl;
169 errmsg = QObject::tr("Unable to open modem."); 169 errmsg = QObject::tr("Unable to open modem.");
170 return false; 170 return false;
171 } 171 }
172//bend if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { 172//bend if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) {
173//} 173//}
174 174
@@ -303,28 +303,28 @@ void Modem::stop() {
303 303
304void Modem::startNotifier() { 304void Modem::startNotifier() {
305 if(modemfd >= 0) { 305 if(modemfd >= 0) {
306 if(sn == 0) { 306 if(sn == 0) {
307 sn = new QSocketNotifier(modemfd, QSocketNotifier::Read, this); 307 sn = new QSocketNotifier(modemfd, QSocketNotifier::Read, this);
308 connect(sn, SIGNAL(activated(int)), SLOT(readtty(int))); 308 connect(sn, SIGNAL(activated(int)), SLOT(readtty(int)));
309 qDebug("QSocketNotifier started!"); 309 odebug << "QSocketNotifier started!" << oendl;
310 } else { 310 } else {
311 qDebug("QSocketNotifier re-enabled!"); 311 odebug << "QSocketNotifier re-enabled!" << oendl;
312 sn->setEnabled(true); 312 sn->setEnabled(true);
313 } 313 }
314 } 314 }
315} 315}
316 316
317 317
318void Modem::stopNotifier() { 318void Modem::stopNotifier() {
319 if(sn != 0) { 319 if(sn != 0) {
320 sn->setEnabled(false); 320 sn->setEnabled(false);
321 disconnect(sn); 321 disconnect(sn);
322 delete sn; 322 delete sn;
323 sn = 0; 323 sn = 0;
324 qDebug( "QSocketNotifier stopped!" ); 324 odebug << "QSocketNotifier stopped!" << oendl;
325 } 325 }
326} 326}
327 327
328 328
329void Modem::flush() { 329void Modem::flush() {
330 char c; 330 char c;
@@ -334,13 +334,13 @@ void Modem::flush() {
334 334
335bool Modem::writeChar(unsigned char c) { 335bool Modem::writeChar(unsigned char c) {
336 int s; 336 int s;
337 do { 337 do {
338 s = write(modemfd, &c, 1); 338 s = write(modemfd, &c, 1);
339 if (s < 0) { 339 if (s < 0) {
340 qError( "write() in Modem::writeChar failed" ); 340 oerr << "write() in Modem::writeChar failed" << oendl;
341 return false; 341 return false;
342 } 342 }
343 } while(s == 0); 343 } while(s == 0);
344 344
345 return true; 345 return true;
346} 346}
@@ -362,13 +362,13 @@ bool Modem::writeLine(const char *buf) {
362 } 362 }
363 int l = len; 363 int l = len;
364 while(l) { 364 while(l) {
365 int wr = write(modemfd, &b[len-l], l); 365 int wr = write(modemfd, &b[len-l], l);
366 if(wr < 0) { 366 if(wr < 0) {
367 // TODO do something meaningful with the error code (or ignore it 367 // TODO do something meaningful with the error code (or ignore it
368 qError( "write() in Modem::writeLine failed" ); 368 oerr << "write() in Modem::writeLine failed" << oendl;
369 delete[] b; 369 delete[] b;
370 return false; 370 return false;
371 } 371 }
372 l -= wr; 372 l -= wr;
373 } 373 }
374 delete[] b; 374 delete[] b;
@@ -471,13 +471,13 @@ QString Modem::parseModemSpeed(const QString &s) {
471 // this is a small (and bad) parser for modem speeds 471 // this is a small (and bad) parser for modem speeds
472 int rx = -1; 472 int rx = -1;
473 int tx = -1; 473 int tx = -1;
474 int i; 474 int i;
475 QString result; 475 QString result;
476 476
477 qDebug( "Modem reported result string: %s", s.latin1()); 477 odebug << "Modem reported result string: " << s.latin1() << "" << oendl;
478 478
479 const int RXMAX = 7; 479 const int RXMAX = 7;
480 const int TXMAX = 2; 480 const int TXMAX = 2;
481 QRegExp rrx[RXMAX] = { 481 QRegExp rrx[RXMAX] = {
482 QRegExp("[0-9]+[:/ ]RX", false), 482 QRegExp("[0-9]+[:/ ]RX", false),
483 QRegExp("[0-9]+RX", false), 483 QRegExp("[0-9]+RX", false),
@@ -557,26 +557,26 @@ QString Modem::parseModemSpeed(const QString &s) {
557 result.setNum(rx); 557 result.setNum(rx);
558 else if(rx == -1) // should not happen 558 else if(rx == -1) // should not happen
559 result.setNum(tx); 559 result.setNum(tx);
560 else 560 else
561 result.sprintf("%d/%d", rx, tx); 561 result.sprintf("%d/%d", rx, tx);
562 562
563 qDebug( "The parsed result is: %s", result.latin1()); 563 odebug << "The parsed result is: " << result.latin1() << "" << oendl;
564 564
565 return result; 565 return result;
566} 566}
567 567
568 568
569// Lock modem device. Returns 0 on success 1 if the modem is locked and -1 if 569// Lock modem device. Returns 0 on success 1 if the modem is locked and -1 if
570// a lock file can't be created ( permission problem ) 570// a lock file can't be created ( permission problem )
571int Modem::lockdevice() { 571int Modem::lockdevice() {
572 int fd; 572 int fd;
573 char newlock[80]=""; // safe 573 char newlock[80]=""; // safe
574 574
575 if(!_pppdata->modemLockFile()) { 575 if(!_pppdata->modemLockFile()) {
576 qDebug("The user doesn't want a lockfile."); 576 odebug << "The user doesn't want a lockfile." << oendl;
577 return 0; 577 return 0;
578 } 578 }
579 579
580 if (modem_is_locked) 580 if (modem_is_locked)
581 return 1; 581 return 1;
582 582
@@ -592,33 +592,33 @@ if ((fd = openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) {
592 int sz = read(fd, &oldlock, 32); 592 int sz = read(fd, &oldlock, 32);
593 close (fd); 593 close (fd);
594 if (sz <= 0) 594 if (sz <= 0)
595 return 1; 595 return 1;
596 oldlock[sz] = '\0'; 596 oldlock[sz] = '\0';
597 597
598 qDebug( "Device is locked by: %s", oldlock); 598 odebug << "Device is locked by: " << oldlock << "" << oendl;
599 599
600 int oldpid; 600 int oldpid;
601 int match = sscanf(oldlock, "%d", &oldpid); 601 int match = sscanf(oldlock, "%d", &oldpid);
602 602
603 // found a pid in lockfile ? 603 // found a pid in lockfile ?
604 if (match < 1 || oldpid <= 0) 604 if (match < 1 || oldpid <= 0)
605 return 1; 605 return 1;
606 606
607 // check if process exists 607 // check if process exists
608 if (kill((pid_t)oldpid, 0) == 0 || errno != ESRCH) 608 if (kill((pid_t)oldpid, 0) == 0 || errno != ESRCH)
609 return 1; 609 return 1;
610 610
611 qDebug( "lockfile is stale" ); 611 odebug << "lockfile is stale" << oendl;
612 } 612 }
613 } 613 }
614 614
615 fd = openLockfile(_pppdata->modemDevice(),O_WRONLY|O_TRUNC|O_CREAT); 615 fd = openLockfile(_pppdata->modemDevice(),O_WRONLY|O_TRUNC|O_CREAT);
616 if(fd >= 0) { 616 if(fd >= 0) {
617 sprintf(newlock,"%010d\n", getpid()); 617 sprintf(newlock,"%010d\n", getpid());
618 qDebug("Locking Device: %s", newlock); 618 odebug << "Locking Device: " << newlock << "" << oendl;
619 619
620 write(fd, newlock, strlen(newlock)); 620 write(fd, newlock, strlen(newlock));
621 close(fd); 621 close(fd);
622 modem_is_locked=true; 622 modem_is_locked=true;
623 623
624 return 0; 624 return 0;
@@ -629,13 +629,13 @@ if ((fd = openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) {
629} 629}
630 630
631 631
632// UnLock modem device 632// UnLock modem device
633void Modem::unlockdevice() { 633void Modem::unlockdevice() {
634 if (modem_is_locked) { 634 if (modem_is_locked) {
635 qDebug( "UnLocking Modem Device" ); 635 odebug << "UnLocking Modem Device" << oendl;
636 close(modemfd); 636 close(modemfd);
637 modemfd = -1; 637 modemfd = -1;
638 unlink(lockfile); 638 unlink(lockfile);
639 lockfile[0] = '\0'; 639 lockfile[0] = '\0';
640 modem_is_locked=false; 640 modem_is_locked=false;
641 } 641 }
@@ -651,25 +651,25 @@ int Modem::openLockfile( QString lockfile, int flags)
651 else 651 else
652 mode = 0; 652 mode = 0;
653 653
654 lockfile = LOCK_DIR; 654 lockfile = LOCK_DIR;
655 lockfile += "/LCK.."; 655 lockfile += "/LCK..";
656 lockfile += device.right( device.length() - device.findRev("/") -1 ); 656 lockfile += device.right( device.length() - device.findRev("/") -1 );
657 qDebug("lockfile >%s<",lockfile.latin1()); 657 odebug << "lockfile >" << lockfile.latin1() << "<" << oendl;
658 // TODO: 658 // TODO:
659 // struct stat st; 659 // struct stat st;
660 // if(stat(lockfile.data(), &st) == -1) { 660 // if(stat(lockfile.data(), &st) == -1) {
661 // if(errno == EBADF) 661 // if(errno == EBADF)
662 // return -1; 662 // return -1;
663 // } else { 663 // } else {
664 // // make sure that this is a regular file 664 // // make sure that this is a regular file
665 // if(!S_ISREG(st.st_mode)) 665 // if(!S_ISREG(st.st_mode))
666 // return -1; 666 // return -1;
667 // } 667 // }
668 if ((fd = open(lockfile, flags, mode)) == -1) { 668 if ((fd = open(lockfile, flags, mode)) == -1) {
669 qDebug("error opening lockfile!"); 669 odebug << "error opening lockfile!" << oendl;
670 lockfile = QString::null; 670 lockfile = QString::null;
671 fd = open(DEVNULL, O_RDONLY); 671 fd = open(DEVNULL, O_RDONLY);
672 } else 672 } else
673 fchown(fd, 0, 0); 673 fchown(fd, 0, 0);
674 return fd; 674 return fd;
675} 675}
@@ -924,21 +924,21 @@ bool Modem::execpppd(const char *arguments) {
924 924
925 execve(pppdPath(), args, 0L); 925 execve(pppdPath(), args, 0L);
926 _exit(0); 926 _exit(0);
927 break; 927 break;
928 928
929 default: 929 default:
930 qDebug("In parent: pppd pid %d\n",pppdPid); 930 odebug << "In parent: pppd pid " << pppdPid << "\n" << oendl;
931 close(modemfd); 931 close(modemfd);
932 932
933 ::close( m_pppdLOG[1] ); 933 ::close( m_pppdLOG[1] );
934 // set it to nonblocking io 934 // set it to nonblocking io
935 int flag = ::fcntl( m_pppdLOG[0], F_GETFL ); 935 int flag = ::fcntl( m_pppdLOG[0], F_GETFL );
936 936
937 if ( !(flag & O_NONBLOCK) ) { 937 if ( !(flag & O_NONBLOCK) ) {
938 qDebug("Setting nonblocking io"); 938 odebug << "Setting nonblocking io" << oendl;
939 flag |= O_NONBLOCK; 939 flag |= O_NONBLOCK;
940 ::fcntl(m_pppdLOG[0], F_SETFL, flag ); 940 ::fcntl(m_pppdLOG[0], F_SETFL, flag );
941 } 941 }
942 942
943 delete m_modemDebug; 943 delete m_modemDebug;
944 m_modemDebug = new QSocketNotifier(m_pppdLOG[0], QSocketNotifier::Read, this ); 944 m_modemDebug = new QSocketNotifier(m_pppdLOG[0], QSocketNotifier::Read, this );
@@ -951,21 +951,21 @@ bool Modem::execpppd(const char *arguments) {
951 break; 951 break;
952 } 952 }
953} 953}
954 954
955 955
956bool Modem::killpppd() { 956bool Modem::killpppd() {
957 qDebug("In killpppd and pid is %d", pppdPid ); 957 odebug << "In killpppd and pid is " << pppdPid << "" << oendl;
958 if(pppdPid > 0) { 958 if(pppdPid > 0) {
959 delete m_modemDebug; 959 delete m_modemDebug;
960 m_modemDebug = 0; 960 m_modemDebug = 0;
961 qDebug("In killpppd(): Sending SIGTERM to %d\n", pppdPid); 961 odebug << "In killpppd(): Sending SIGTERM to " << pppdPid << "\n" << oendl;
962 if(kill(pppdPid, SIGTERM) < 0) { 962 if(kill(pppdPid, SIGTERM) < 0) {
963 qDebug("Error terminating %d. Sending SIGKILL\n", pppdPid); 963 odebug << "Error terminating " << pppdPid << ". Sending SIGKILL\n" << oendl;
964 if(kill(pppdPid, SIGKILL) < 0) { 964 if(kill(pppdPid, SIGKILL) < 0) {
965 qDebug("Error killing %d\n", pppdPid); 965 odebug << "Error killing " << pppdPid << "\n" << oendl;
966 return false; 966 return false;
967 } 967 }
968 } 968 }
969 } 969 }
970 return true; 970 return true;
971} 971}
@@ -1032,13 +1032,13 @@ int Modem::pppdExitStatus()
1032} 1032}
1033 1033
1034int Modem::openResolv(int flags) 1034int Modem::openResolv(int flags)
1035{ 1035{
1036 int fd; 1036 int fd;
1037 if ((fd = open(_PATH_RESCONF, flags)) == -1) { 1037 if ((fd = open(_PATH_RESCONF, flags)) == -1) {
1038 qDebug("error opening resolv.conf!"); 1038 odebug << "error opening resolv.conf!" << oendl;
1039 fd = open(DEVNULL, O_RDONLY); 1039 fd = open(DEVNULL, O_RDONLY);
1040 } 1040 }
1041 return fd; 1041 return fd;
1042} 1042}
1043 1043
1044bool Modem::setHostname(const QString & name) 1044bool Modem::setHostname(const QString & name)
@@ -1053,13 +1053,13 @@ void Modem::setPPPDevice( const QString& dev ) {
1053 m_pppdDev = dev; 1053 m_pppdDev = dev;
1054} 1054}
1055pid_t Modem::pppPID()const { 1055pid_t Modem::pppPID()const {
1056 return pppdPid; 1056 return pppdPid;
1057} 1057}
1058void Modem::setPPPDPid( pid_t pid ) { 1058void Modem::setPPPDPid( pid_t pid ) {
1059 qDebug("Modem setting pid"); 1059 odebug << "Modem setting pid" << oendl;
1060 _pppdExitStatus = -1; 1060 _pppdExitStatus = -1;
1061 pppdPid = pid; 1061 pppdPid = pid;
1062 modemfd = -1; 1062 modemfd = -1;
1063} 1063}
1064void Modem::slotModemDebug(int fd) { 1064void Modem::slotModemDebug(int fd) {
1065 char buf[2049]; 1065 char buf[2049];
diff --git a/noncore/settings/networksettings/ppp/pppconfig.cpp b/noncore/settings/networksettings/ppp/pppconfig.cpp
index 97baf31..a8c99fd 100644
--- a/noncore/settings/networksettings/ppp/pppconfig.cpp
+++ b/noncore/settings/networksettings/ppp/pppconfig.cpp
@@ -22,16 +22,16 @@ PPPConfigWidget::PPPConfigWidget( InterfacePPP* iface, QWidget *parent,
22 if(result == TEST_CRITICAL){ 22 if(result == TEST_CRITICAL){
23 QMessageBox::critical(0, tr("Modem failure"), tr("A critical failure appeard while testing the modem") ); 23 QMessageBox::critical(0, tr("Modem failure"), tr("A critical failure appeard while testing the modem") );
24 return; 24 return;
25 } 25 }
26 26
27 interface = iface; 27 interface = iface;
28 qDebug("PPPConfigWidget::PPPConfigWidget"); 28 odebug << "PPPConfigWidget::PPPConfigWidget" << oendl;
29 qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1()); 29 odebug << " interface->getHardwareName >" << interface->getHardwareName().latin1() << "<" << oendl;
30 30
31 qDebug(" _pppdata->accname >%s<",interface->data()->accname().latin1()); 31 odebug << " _pppdata->accname >" << interface->data()->accname().latin1() << "<" << oendl;
32 32
33 33
34 QVBoxLayout *layout = new QVBoxLayout( this ); 34 QVBoxLayout *layout = new QVBoxLayout( this );
35 layout->setSpacing( 0 ); 35 layout->setSpacing( 0 );
36 layout->setMargin( 1 ); 36 layout->setMargin( 1 );
37 tabWindow = new QTabWidget( this, "tabWidget" ); 37 tabWindow = new QTabWidget( this, "tabWidget" );
@@ -55,15 +55,15 @@ PPPConfigWidget::~PPPConfigWidget()
55{ 55{
56 56
57} 57}
58 58
59void PPPConfigWidget::accept() 59void PPPConfigWidget::accept()
60{ 60{
61 qDebug("PPPConfigWidget::accept"); 61 odebug << "PPPConfigWidget::accept" << oendl;
62 qDebug(" _pppdata->accname >%s<",interface->data()->accname().latin1()); 62 odebug << " _pppdata->accname >" << interface->data()->accname().latin1() << "<" << oendl;
63 qDebug(" interface->getHardwareName >%s<", interface->getHardwareName().latin1()); 63 odebug << " interface->getHardwareName >" << interface->getHardwareName().latin1() << "<" << oendl;
64 interface->setInterfaceName( interface->data()->devname() ); 64 interface->setInterfaceName( interface->data()->devname() );
65 interface->setHardwareName( interface->data()->accname() ); 65 interface->setHardwareName( interface->data()->accname() );
66 interface->save(); 66 interface->save();
67 QDialog::accept(); 67 QDialog::accept();
68} 68}
69 69
diff --git a/noncore/settings/networksettings/ppp/pppdata.cpp b/noncore/settings/networksettings/ppp/pppdata.cpp
index f4727c1..567ccf8 100644
--- a/noncore/settings/networksettings/ppp/pppdata.cpp
+++ b/noncore/settings/networksettings/ppp/pppdata.cpp
@@ -53,14 +53,14 @@ PPPData::PPPData()
53 highcount = readNumConfig(GENERAL_GRP, NUMACCOUNTS_KEY, 0) - 1; 53 highcount = readNumConfig(GENERAL_GRP, NUMACCOUNTS_KEY, 0) - 1;
54 highcountdev = readNumConfig(GENERAL_GRP, NUMDEVICES_KEY, 0) - 1; 54 highcountdev = readNumConfig(GENERAL_GRP, NUMDEVICES_KEY, 0) - 1;
55 Config cfg = config(); 55 Config cfg = config();
56 cfg.setGroup(GENERAL_GRP); 56 cfg.setGroup(GENERAL_GRP);
57 accountList = cfg.readListEntry(ACCOUNT_LIST, ',' ); 57 accountList = cfg.readListEntry(ACCOUNT_LIST, ',' );
58 deviceList = cfg.readListEntry(DEVICESNAMES_LIST, ',' ); 58 deviceList = cfg.readListEntry(DEVICESNAMES_LIST, ',' );
59 qDebug("PPPData::PPPData has a accountList %s", accountList.join("---").latin1()); 59 odebug << "PPPData::PPPData has a accountList " << accountList.join("---").latin1() << "" << oendl;
60 qDebug("PPPData::PPPData has a deviceList %s", deviceList.join("---").latin1()); 60 odebug << "PPPData::PPPData has a deviceList " << deviceList.join("---").latin1() << "" << oendl;
61 61
62// if (highcount > MAX_ACCOUNTS) 62// if (highcount > MAX_ACCOUNTS)
63// highcount = MAX_ACCOUNTS; 63// highcount = MAX_ACCOUNTS;
64 64
65 // if(highcount >= 0 && defaultAccount().isEmpty()) { 65 // if(highcount >= 0 && defaultAccount().isEmpty()) {
66// setAccountbyIndex(0); 66// setAccountbyIndex(0);
@@ -83,13 +83,13 @@ Config PPPData::config()
83 83
84// 84//
85// save configuration 85// save configuration
86// 86//
87void PPPData::save() 87void PPPData::save()
88{ 88{
89 qDebug("PPPData saving data"); 89 odebug << "PPPData saving data" << oendl;
90 writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count()); 90 writeConfig(GENERAL_GRP, NUMACCOUNTS_KEY, count());
91 writeConfig(GENERAL_GRP, NUMDEVICES_KEY, highcountdev + 1); 91 writeConfig(GENERAL_GRP, NUMDEVICES_KEY, highcountdev + 1);
92 QString key; 92 QString key;
93 QStringList keys; 93 QStringList keys;
94 Config cfg = config(); 94 Config cfg = config();
95 cfg.setGroup(GENERAL_GRP); 95 cfg.setGroup(GENERAL_GRP);
@@ -97,34 +97,34 @@ void PPPData::save()
97 cfg.writeEntry(DEVICESNAMES_LIST, deviceList, ',' ); 97 cfg.writeEntry(DEVICESNAMES_LIST, deviceList, ',' );
98 98
99 for( QMap<QString,QString>::Iterator it = stringEntries.begin(); 99 for( QMap<QString,QString>::Iterator it = stringEntries.begin();
100 it != stringEntries.end(); ++it ){ 100 it != stringEntries.end(); ++it ){
101 QString val = it.data(); 101 QString val = it.data();
102 key = it.key(); 102 key = it.key();
103// qDebug("saving %s -> %s", key.latin1(), val.latin1() ); 103// odebug << "saving " << key.latin1() << " -> " << val.latin1() << "" << oendl;
104 keys = QStringList::split( "SEPARATOR", key ); 104 keys = QStringList::split( "SEPARATOR", key );
105 //qDebug("group >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() ); 105 //odebug << "group >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.latin1() << "<" << oendl;
106 cfg.setGroup(keys[0]); 106 cfg.setGroup(keys[0]);
107 cfg.writeEntry(keys[1], val); 107 cfg.writeEntry(keys[1], val);
108 } 108 }
109 for( QMap<QString,int>::Iterator it = intEntries.begin(); 109 for( QMap<QString,int>::Iterator it = intEntries.begin();
110 it != intEntries.end(); ++it ){ 110 it != intEntries.end(); ++it ){
111 int val = it.data(); 111 int val = it.data();
112 key = it.key(); 112 key = it.key();
113// qDebug("saving %s -> %i", key.latin1(), val ); 113// odebug << "saving " << key.latin1() << " -> " << val << "" << oendl;
114 keys = QStringList::split( "SEPARATOR", key ); 114 keys = QStringList::split( "SEPARATOR", key );
115 //qDebug("group >%s< key >%s< val %i", keys[0].latin1(), keys[1].latin1(), val ); 115 //odebug << "group >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< val " << val << "" << oendl;
116 cfg.setGroup(keys[0]); 116 cfg.setGroup(keys[0]);
117 cfg.writeEntry(keys[1], val); 117 cfg.writeEntry(keys[1], val);
118 } 118 }
119 for( QMap<QString,QStringList>::Iterator it = listEntries.begin(); 119 for( QMap<QString,QStringList>::Iterator it = listEntries.begin();
120 it != listEntries.end(); ++it ){ 120 it != listEntries.end(); ++it ){
121 QStringList val = it.data(); 121 QStringList val = it.data();
122 key = it.key(); 122 key = it.key();
123 QChar sep = sepEntries[key]; 123 QChar sep = sepEntries[key];
124// qDebug("saving %s -> %s", key.latin1(), val.join(sep).latin1() ); 124// odebug << "saving " << key.latin1() << " -> " << val.join(sep).latin1() << "" << oendl;
125 keys = QStringList::split( "SEPARATOR", key ); 125 keys = QStringList::split( "SEPARATOR", key );
126 cfg.setGroup(keys[0]); 126 cfg.setGroup(keys[0]);
127 cfg.writeEntry(keys[1], val, sep); 127 cfg.writeEntry(keys[1], val, sep);
128 } 128 }
129} 129}
130 130
@@ -139,13 +139,13 @@ void PPPData::cancel() {
139} 139}
140 140
141// functions to read/write date to configuration file 141// functions to read/write date to configuration file
142QString PPPData::readConfig(const QString &group, const QString &key, 142QString PPPData::readConfig(const QString &group, const QString &key,
143 const QString &defvalue = "") 143 const QString &defvalue = "")
144{ 144{
145// qDebug("PPPData::readConfig key >%s< group >%s<",key.latin1(), group.latin1()); 145// odebug << "PPPData::readConfig key >" << key.latin1() << "< group >" << group.latin1() << "<" << oendl;
146 QString idx = SEP.arg(group).arg(key); 146 QString idx = SEP.arg(group).arg(key);
147 if (stringEntries.find(idx) != stringEntries.end()) 147 if (stringEntries.find(idx) != stringEntries.end())
148 return stringEntries[idx]; 148 return stringEntries[idx];
149 Config cfg = config(); 149 Config cfg = config();
150 cfg.setGroup(group); 150 cfg.setGroup(group);
151 return cfg.readEntry(key, defvalue); 151 return cfg.readEntry(key, defvalue);
@@ -362,27 +362,27 @@ const QString PPPData::modemDevice() {
362// const QString PPPData::modemName() 362// const QString PPPData::modemName()
363// { 363// {
364// return readConfig(modemGroup(), MODEMNAME_KEY); 364// return readConfig(modemGroup(), MODEMNAME_KEY);
365// } 365// }
366 366
367// bool PPPData::setModemName(const QString &n) { 367// bool PPPData::setModemName(const QString &n) {
368// qDebug("Setting modem name to >%s<", n.latin1()); 368// odebug << "Setting modem name to >" << n.latin1() << "<" << oendl;
369// _modemName = n; 369// _modemName = n;
370// writeConfig(cgroup, MODEMNAME_KEY, n); 370// writeConfig(cgroup, MODEMNAME_KEY, n);
371// return true; //FIXME 371// return true; //FIXME
372// } 372// }
373 373
374// bool PPPData::changeModemName(const QString &n) { 374// bool PPPData::changeModemName(const QString &n) {
375// qDebug("Setting modem name to >%s<", n.latin1()); 375// odebug << "Setting modem name to >" << n.latin1() << "<" << oendl;
376// _modemName = n; 376// _modemName = n;
377// writeConfig(modemGroup(), MODEMNAME_KEY, n); 377// writeConfig(modemGroup(), MODEMNAME_KEY, n);
378// return true; //FIXME 378// return true; //FIXME
379// } 379// }
380 380
381bool PPPData::setModemDevice(const QString &n) { 381bool PPPData::setModemDevice(const QString &n) {
382 qDebug("Setting modem dev to >%s<", n.latin1()); 382 odebug << "Setting modem dev to >" << n.latin1() << "<" << oendl;
383 writeConfig(modemGroup(), MODEMDEV_KEY, n); 383 writeConfig(modemGroup(), MODEMDEV_KEY, n);
384 return true; //FIXME 384 return true; //FIXME
385} 385}
386 386
387 387
388const QString PPPData::flowcontrol() { 388const QString PPPData::flowcontrol() {
@@ -736,24 +736,24 @@ void PPPData::setEnter(const QString &n) {
736int PPPData::count() const { 736int PPPData::count() const {
737 return highcount + 1; 737 return highcount + 1;
738} 738}
739 739
740 740
741bool PPPData::setAccount(const QString &aname) { 741bool PPPData::setAccount(const QString &aname) {
742 qDebug("setting account to >%s<", aname.latin1()); 742 odebug << "setting account to >" << aname.latin1() << "<" << oendl;
743 for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) { 743 for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) {
744 cgroup = *it; 744 cgroup = *it;
745 qDebug("PPPData::setAccount %s", cgroup.latin1()); 745 odebug << "PPPData::setAccount " << cgroup.latin1() << "" << oendl;
746 qDebug( "iterator %s", (*it).latin1() ); 746 odebug << "iterator " << (*it).latin1() << "" << oendl;
747 if(accname() == aname) { 747 if(accname() == aname) {
748 qDebug("SUCCESS"); 748 odebug << "SUCCESS" << oendl;
749 return true; 749 return true;
750 } 750 }
751 751
752 } 752 }
753 qDebug("FAILURE"); 753 odebug << "FAILURE" << oendl;
754 return false; 754 return false;
755} 755}
756 756
757/* 757/*
758bool PPPData::setAccountbyIndex(int i) { 758bool PPPData::setAccountbyIndex(int i) {
759 if(i >= 0 && i <= highcount) { 759 if(i >= 0 && i <= highcount) {
@@ -769,35 +769,35 @@ bool PPPData::setAccountbyIndex(int i) {
769*/ 769*/
770 770
771bool PPPData::isUniqueAccname(const QString &n) { 771bool PPPData::isUniqueAccname(const QString &n) {
772 QString save_cgroup = cgroup; 772 QString save_cgroup = cgroup;
773 for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) { 773 for ( QStringList::Iterator it = accountList.begin(); it != accountList.end(); ++it ) {
774 cgroup = *it; 774 cgroup = *it;
775 qDebug("PPPData::setAccount %s", cgroup.latin1()); 775 odebug << "PPPData::setAccount " << cgroup.latin1() << "" << oendl;
776 qDebug( "%s \n", (*it).latin1() ); 776 odebug << "" << (*it).latin1() << " \n" << oendl;
777 if(accname() == n && cgroup != save_cgroup) { 777 if(accname() == n && cgroup != save_cgroup) {
778 cgroup = save_cgroup; 778 cgroup = save_cgroup;
779 qDebug("SUCCESS"); 779 odebug << "SUCCESS" << oendl;
780 return false; 780 return false;
781 } 781 }
782 782
783 } 783 }
784 cgroup = save_cgroup; 784 cgroup = save_cgroup;
785 return true; 785 return true;
786} 786}
787 787
788 788
789bool PPPData::isUniqueDevname(const QString &n) { 789bool PPPData::isUniqueDevname(const QString &n) {
790 QString save_mName = _modemName; 790 QString save_mName = _modemName;
791 qDebug("PPPData::isUniqueDevname checking if %s is unique", n.latin1()); 791 odebug << "PPPData::isUniqueDevname checking if " << n.latin1() << " is unique" << oendl;
792 for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) { 792 for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) {
793 _modemName = *it; 793 _modemName = *it;
794 qDebug("PPPData::isUniqueDevname %s == %s", n.latin1() , devname().latin1()); 794 odebug << "PPPData::isUniqueDevname " << n.latin1() << " == " << devname().latin1() << "" << oendl;
795 if(devname() == n && _modemName != save_mName) { 795 if(devname() == n && _modemName != save_mName) {
796 _modemName = save_mName; 796 _modemName = save_mName;
797 qDebug("NOT UNIQUE"); 797 odebug << "NOT UNIQUE" << oendl;
798 return false; 798 return false;
799 } 799 }
800 800
801 } 801 }
802 _modemName = save_mName; 802 _modemName = save_mName;
803 return true; 803 return true;
@@ -817,33 +817,33 @@ bool PPPData::deleteAccount() {
817 it != stringEntries.end(); ++it ){ 817 it != stringEntries.end(); ++it ){
818 QString val = it.data(); 818 QString val = it.data();
819 key = it.key(); 819 key = it.key();
820 keys = QStringList::split( "SEPARATOR", key ); 820 keys = QStringList::split( "SEPARATOR", key );
821 if(keys[0]==cgroup){ 821 if(keys[0]==cgroup){
822 stringEntries.remove( it ); 822 stringEntries.remove( it );
823 qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() ); 823 odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.latin1() << "<" << oendl;
824 } 824 }
825 } 825 }
826 for( QMap<QString,int>::Iterator it = intEntries.begin(); 826 for( QMap<QString,int>::Iterator it = intEntries.begin();
827 it != intEntries.end(); ++it ){ 827 it != intEntries.end(); ++it ){
828 int val = it.data(); 828 int val = it.data();
829 key = it.key(); 829 key = it.key();
830 keys = QStringList::split( "SEPARATOR", key ); 830 keys = QStringList::split( "SEPARATOR", key );
831 if(keys[0]==cgroup){ 831 if(keys[0]==cgroup){
832 intEntries.remove( it ); 832 intEntries.remove( it );
833 qDebug("deleting >%s< key >%s< value >%i<", keys[0].latin1(), keys[1].latin1(), val ); 833 odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val << "<" << oendl;
834 } 834 }
835 } 835 }
836 for( QMap<QString,QStringList>::Iterator it = listEntries.begin(); 836 for( QMap<QString,QStringList>::Iterator it = listEntries.begin();
837 it != listEntries.end(); ++it ){ 837 it != listEntries.end(); ++it ){
838 QStringList val = it.data(); 838 QStringList val = it.data();
839 key = it.key(); 839 key = it.key();
840 if(keys[0]==cgroup){ 840 if(keys[0]==cgroup){
841 listEntries.remove( it ); 841 listEntries.remove( it );
842 sepEntries.remove( key ); 842 sepEntries.remove( key );
843 qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.join("").latin1() ); 843 odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.join("").latin1() << "<" << oendl;
844 } 844 }
845 } 845 }
846 846
847 return true; 847 return true;
848} 848}
849 849
@@ -857,22 +857,22 @@ bool PPPData::deleteAccount(const QString &aname) {
857 return true; 857 return true;
858} 858}
859 859
860 860
861int PPPData::newaccount() { 861int PPPData::newaccount() {
862 862
863 qDebug("PPPData::newaccount highcount %i/%i",highcount,MAX_ACCOUNTS); 863 odebug << "PPPData::newaccount highcount " << highcount << "/" << MAX_ACCOUNTS << "" << oendl;
864// if(!config) open(); 864// if(!config) open();
865// if (highcount >= MAX_ACCOUNTS) return -1; 865// if (highcount >= MAX_ACCOUNTS) return -1;
866 866
867 867
868 QString tmp; 868 QString tmp;
869 tmp.sprintf("%s%i", ACCOUNT_GRP, ++highcount); 869 tmp.sprintf("%s%i", ACCOUNT_GRP, ++highcount);
870 cgroup = QString(tmp); 870 cgroup = QString(tmp);
871 accountList << tmp; 871 accountList << tmp;
872 qDebug("PPPData::newaccount() Group: >%s<",cgroup.latin1()); 872 odebug << "PPPData::newaccount() Group: >" << cgroup.latin1() << "<" << oendl;
873 setpppdArgumentDefaults(); 873 setpppdArgumentDefaults();
874 return highcount; 874 return highcount;
875} 875}
876 876
877int PPPData::copyaccount(const QString&) { 877int PPPData::copyaccount(const QString&) {
878// FIXME: PPPData::copyaccount 878// FIXME: PPPData::copyaccount
@@ -962,15 +962,15 @@ const QString PPPData::storedUsername() {
962void PPPData::setStoredUsername(const QString &b) { 962void PPPData::setStoredUsername(const QString &b) {
963 writeConfig(cgroup, STORED_USERNAME_KEY, b); 963 writeConfig(cgroup, STORED_USERNAME_KEY, b);
964} 964}
965 965
966 966
967const QString PPPData::storedPassword() { 967const QString PPPData::storedPassword() {
968 qDebug("getting stored pw"); 968 odebug << "getting stored pw" << oendl;
969 qDebug("g %s", cgroup.latin1() ); 969 odebug << "g " << cgroup.latin1() << "" << oendl;
970 qDebug("k %s", STORED_PASSWORD_KEY); 970 odebug << "k " << STORED_PASSWORD_KEY << "" << oendl;
971 return readConfig(cgroup, STORED_PASSWORD_KEY, ""); 971 return readConfig(cgroup, STORED_PASSWORD_KEY, "");
972} 972}
973 973
974 974
975void PPPData::setStoredPassword(const QString &b) { 975void PPPData::setStoredPassword(const QString &b) {
976 writeConfig(cgroup, STORED_PASSWORD_KEY, b); 976 writeConfig(cgroup, STORED_PASSWORD_KEY, b);
@@ -1326,16 +1326,16 @@ void PPPData::setConfiguredInterfaces( QMap<QString,QString> ifaces )
1326 int i = 0; 1326 int i = 0;
1327 Config cfg = config(); 1327 Config cfg = config();
1328 for( it = ifaces.begin(); it != ifaces.end(); ++it ){ 1328 for( it = ifaces.begin(); it != ifaces.end(); ++it ){
1329 cfg.setGroup(QString("%1_%1").arg(ACCLIST_GRP).arg(i++)); 1329 cfg.setGroup(QString("%1_%1").arg(ACCLIST_GRP).arg(i++));
1330 cfg.writeEntry( ACOUNTS_DEV, it.key() ); 1330 cfg.writeEntry( ACOUNTS_DEV, it.key() );
1331 cfg.writeEntry( ACOUNTS_ACC, it.data() ); 1331 cfg.writeEntry( ACOUNTS_ACC, it.data() );
1332 qDebug("I %i",i); 1332 odebug << "I " << i << "" << oendl;
1333 } 1333 }
1334 cfg.setGroup( ACCLIST_GRP ); 1334 cfg.setGroup( ACCLIST_GRP );
1335 qDebug("saved %i account settings", i); 1335 odebug << "saved " << i << " account settings" << oendl;
1336 cfg.writeEntry( ACCOUNTS_COUNT, i ); 1336 cfg.writeEntry( ACCOUNTS_COUNT, i );
1337 1337
1338} 1338}
1339 1339
1340/** 1340/**
1341 * pppd's getword() function knows about escape characters. 1341 * pppd's getword() function knows about escape characters.
@@ -1369,13 +1369,13 @@ QStringList PPPData::getAccountList()
1369}; 1369};
1370 1370
1371 1371
1372const QString PPPData::devname() 1372const QString PPPData::devname()
1373{ 1373{
1374 QString tmp = readConfig(modemGroup(), MODEMNAME_KEY ); 1374 QString tmp = readConfig(modemGroup(), MODEMNAME_KEY );
1375 qDebug("PPPData::devname() of %s is %s", modemGroup().latin1(), tmp.latin1()); 1375 odebug << "PPPData::devname() of " << modemGroup().latin1() << " is " << tmp.latin1() << "" << oendl;
1376 return tmp; 1376 return tmp;
1377} 1377}
1378 1378
1379void PPPData::setDevname(const QString &n) { 1379void PPPData::setDevname(const QString &n) {
1380 // if(!cgroup.isNull()) { 1380 // if(!cgroup.isNull()) {
1381// // are we manipulating the default account's name ? then change it, too. 1381// // are we manipulating the default account's name ? then change it, too.
@@ -1387,26 +1387,26 @@ void PPPData::setDevname(const QString &n) {
1387 writeConfig(modemGroup(), MODEMNAME_KEY, n ); 1387 writeConfig(modemGroup(), MODEMNAME_KEY, n );
1388} 1388}
1389 1389
1390 1390
1391bool PPPData::setDevice(const QString &dev ) 1391bool PPPData::setDevice(const QString &dev )
1392{ 1392{
1393 qDebug("setting device to >%s<", dev.latin1()); 1393 odebug << "setting device to >" << dev.latin1() << "<" << oendl;
1394 QString save_mName = _modemName; 1394 QString save_mName = _modemName;
1395 for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) { 1395 for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) {
1396 _modemName = *it; 1396 _modemName = *it;
1397 qDebug("PPPData::setDevice %s is named %s", _modemName.latin1(), devname().latin1() ); 1397 odebug << "PPPData::setDevice " << _modemName.latin1() << " is named " << devname().latin1() << "" << oendl;
1398 qDebug( "iterator %s", (*it).latin1() ); 1398 odebug << "iterator " << (*it).latin1() << "" << oendl;
1399 if(devname() == dev) { 1399 if(devname() == dev) {
1400 qDebug("SUCCESS"); 1400 odebug << "SUCCESS" << oendl;
1401 return true; 1401 return true;
1402 } 1402 }
1403 1403
1404 } 1404 }
1405 _modemName = save_mName; 1405 _modemName = save_mName;
1406 qDebug("FAILURE"); 1406 odebug << "FAILURE" << oendl;
1407 return false; 1407 return false;
1408} 1408}
1409 1409
1410bool PPPData::deleteDevice() 1410bool PPPData::deleteDevice()
1411{ 1411{
1412 // FIXME: check if this account exists in a config... 1412 // FIXME: check if this account exists in a config...
@@ -1421,33 +1421,33 @@ bool PPPData::deleteDevice()
1421 it != stringEntries.end(); ++it ){ 1421 it != stringEntries.end(); ++it ){
1422 QString val = it.data(); 1422 QString val = it.data();
1423 key = it.key(); 1423 key = it.key();
1424 keys = QStringList::split( "SEPARATOR", key ); 1424 keys = QStringList::split( "SEPARATOR", key );
1425 if(keys[0]==modemGroup()){ 1425 if(keys[0]==modemGroup()){
1426 stringEntries.remove( it ); 1426 stringEntries.remove( it );
1427 qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.latin1() ); 1427 odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.latin1() << "<" << oendl;
1428 } 1428 }
1429 } 1429 }
1430 for( QMap<QString,int>::Iterator it = intEntries.begin(); 1430 for( QMap<QString,int>::Iterator it = intEntries.begin();
1431 it != intEntries.end(); ++it ){ 1431 it != intEntries.end(); ++it ){
1432 int val = it.data(); 1432 int val = it.data();
1433 key = it.key(); 1433 key = it.key();
1434 keys = QStringList::split( "SEPARATOR", key ); 1434 keys = QStringList::split( "SEPARATOR", key );
1435 if(keys[0]==modemGroup()){ 1435 if(keys[0]==modemGroup()){
1436 intEntries.remove( it ); 1436 intEntries.remove( it );
1437 qDebug("deleting >%s< key >%s< value >%i<", keys[0].latin1(), keys[1].latin1(), val ); 1437 odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val << "<" << oendl;
1438 } 1438 }
1439 } 1439 }
1440 for( QMap<QString,QStringList>::Iterator it = listEntries.begin(); 1440 for( QMap<QString,QStringList>::Iterator it = listEntries.begin();
1441 it != listEntries.end(); ++it ){ 1441 it != listEntries.end(); ++it ){
1442 QStringList val = it.data(); 1442 QStringList val = it.data();
1443 key = it.key(); 1443 key = it.key();
1444 if(keys[0]==modemGroup()){ 1444 if(keys[0]==modemGroup()){
1445 listEntries.remove( it ); 1445 listEntries.remove( it );
1446 sepEntries.remove( key ); 1446 sepEntries.remove( key );
1447 qDebug("deleting >%s< key >%s< value >%s<", keys[0].latin1(), keys[1].latin1(), val.join("").latin1() ); 1447 odebug << "deleting >" << keys[0].latin1() << "< key >" << keys[1].latin1() << "< value >" << val.join("").latin1() << "<" << oendl;
1448 } 1448 }
1449 } 1449 }
1450 1450
1451 return true; 1451 return true;
1452 1452
1453} 1453}
@@ -1460,20 +1460,20 @@ bool PPPData::deleteDevice(const QString &dev)
1460 return deleteDevice(); 1460 return deleteDevice();
1461} 1461}
1462 1462
1463int PPPData::newdevice() 1463int PPPData::newdevice()
1464{ 1464{
1465 1465
1466 qDebug("PPPData::newdevice highcount %i",highcountdev); 1466 odebug << "PPPData::newdevice highcount " << highcountdev << "" << oendl;
1467 1467
1468 1468
1469 QString tmp; 1469 QString tmp;
1470 tmp.sprintf("%s%i", MODEM_GRP, ++highcountdev); 1470 tmp.sprintf("%s%i", MODEM_GRP, ++highcountdev);
1471 _modemName = QString(tmp); 1471 _modemName = QString(tmp);
1472 deviceList << tmp; 1472 deviceList << tmp;
1473 qDebug("PPPData::newdevice() Group: >%s<",cgroup.latin1()); 1473 odebug << "PPPData::newdevice() Group: >" << cgroup.latin1() << "<" << oendl;
1474 return highcountdev; 1474 return highcountdev;
1475} 1475}
1476 1476
1477int PPPData::copydevice(const QString&) 1477int PPPData::copydevice(const QString&)
1478{ 1478{
1479 return false; 1479 return false;
@@ -1481,15 +1481,15 @@ int PPPData::copydevice(const QString&)
1481 1481
1482 1482
1483QStringList PPPData::getDevicesNamesList() 1483QStringList PPPData::getDevicesNamesList()
1484{ 1484{
1485 QStringList list; 1485 QStringList list;
1486 QString save_mName = _modemName; 1486 QString save_mName = _modemName;
1487 qDebug("PPPData::getDevicesNamesList has %s", deviceList.join("---").latin1()); 1487 odebug << "PPPData::getDevicesNamesList has " << deviceList.join("---").latin1() << "" << oendl;
1488 for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) { 1488 for ( QStringList::Iterator it = deviceList.begin(); it != deviceList.end(); ++it ) {
1489 _modemName = *it; 1489 _modemName = *it;
1490 qDebug("PPPData::getDevicesNamesList adding %s as %s",_modemName.latin1(), devname().latin1()); 1490 odebug << "PPPData::getDevicesNamesList adding " << _modemName.latin1() << " as " << devname().latin1() << "" << oendl;
1491 list << devname(); 1491 list << devname();
1492 } 1492 }
1493 _modemName = save_mName; 1493 _modemName = save_mName;
1494 return list; 1494 return list;
1495}; 1495};
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index a7caffe..2291e8a 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -57,24 +57,24 @@ PPPModule::PPPModule() : Module()
57 QMap<QString,Connection> running = inFace.interfaces(); 57 QMap<QString,Connection> running = inFace.interfaces();
58 QStringList handledInterfaceNames; 58 QStringList handledInterfaceNames;
59 59
60 QMap<QString,QString> ifaces = PPPData::getConfiguredInterfaces(); 60 QMap<QString,QString> ifaces = PPPData::getConfiguredInterfaces();
61 QMap<QString,QString>::Iterator it; 61 QMap<QString,QString>::Iterator it;
62 InterfacePPP *iface; 62 InterfacePPP *iface;
63 qDebug("getting interfaces"); 63 odebug << "getting interfaces" << oendl;
64 for( it = ifaces.begin(); it != ifaces.end(); ++it ) 64 for( it = ifaces.begin(); it != ifaces.end(); ++it )
65 { 65 {
66 qDebug("ifaces %s %s", it.key().latin1(), it.data().latin1() ); 66 odebug << "ifaces " << it.key().latin1() << " " << it.data().latin1() << "" << oendl;
67 iface = new InterfacePPP( 0, it.key() ); 67 iface = new InterfacePPP( 0, it.key() );
68 iface->setHardwareName( it.data() ); 68 iface->setHardwareName( it.data() );
69 list.append( (Interface*)iface ); 69 list.append( (Interface*)iface );
70 70
71 // check if (*it) is one of the running ifaces 71 // check if (*it) is one of the running ifaces
72 if ( running.contains( it.data() ) ) 72 if ( running.contains( it.data() ) )
73 { 73 {
74 qDebug("iface is running %s", it.key().latin1() ); 74 odebug << "iface is running " << it.key().latin1() << "" << oendl;
75 handledInterfaceNames << running[it.data()].device; 75 handledInterfaceNames << running[it.data()].device;
76 iface->setStatus( true ); 76 iface->setStatus( true );
77 iface->setPPPDpid( running[it.data()].pid ); 77 iface->setPPPDpid( running[it.data()].pid );
78 iface->modem()->setPPPDevice( running[it.data()].device ); 78 iface->modem()->setPPPDevice( running[it.data()].device );
79 iface->refresh(); 79 iface->refresh();
80 } 80 }
@@ -85,22 +85,22 @@ PPPModule::PPPModule() : Module()
85 85
86/** 86/**
87 * Delete any interfaces that we own. 87 * Delete any interfaces that we own.
88 */ 88 */
89PPPModule::~PPPModule() 89PPPModule::~PPPModule()
90{ 90{
91 qDebug("PPPModule::~PPPModule() " ); 91 odebug << "PPPModule::~PPPModule() " << oendl;
92 QMap<QString,QString> ifaces; 92 QMap<QString,QString> ifaces;
93 InterfaceKeeper keeper; 93 InterfaceKeeper keeper;
94 Interface *i; 94 Interface *i;
95 for ( i=list.first(); i != 0; i=list.next() ) 95 for ( i=list.first(); i != 0; i=list.next() )
96 { 96 {
97 /* if online save the state */ 97 /* if online save the state */
98 if ( i->getStatus() ) 98 if ( i->getStatus() )
99 { 99 {
100 qDebug("Iface %s is still up", i->getHardwareName().latin1() ); 100 odebug << "Iface " << i->getHardwareName().latin1() << " is still up" << oendl;
101 InterfacePPP* ppp = static_cast<InterfacePPP*>(i); 101 InterfacePPP* ppp = static_cast<InterfacePPP*>(i);
102 keeper.addInterface( ppp->pppPID(), ppp->pppDev(), ppp->getHardwareName() ); 102 keeper.addInterface( ppp->pppPID(), ppp->pppDev(), ppp->getHardwareName() );
103 } 103 }
104 ifaces.insert( i->getInterfaceName(), i->getHardwareName() ); 104 ifaces.insert( i->getInterfaceName(), i->getHardwareName() );
105 delete i; 105 delete i;
106 } 106 }
@@ -138,13 +138,13 @@ bool PPPModule::isOwner(Interface *i)
138/** 138/**
139 * Create, and return the WLANConfigure Module 139 * Create, and return the WLANConfigure Module
140 * @return QWidget* pointer to this modules configure. 140 * @return QWidget* pointer to this modules configure.
141 */ 141 */
142QWidget *PPPModule::configure(Interface *i) 142QWidget *PPPModule::configure(Interface *i)
143{ 143{
144 qDebug("return ModemWidget"); 144 odebug << "return ModemWidget" << oendl;
145 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i, 145 PPPConfigWidget *pppconfig = new PPPConfigWidget( (InterfacePPP*)i,
146 0, "PPPConfig", false, 146 0, "PPPConfig", false,
147 (Qt::WDestructiveClose | Qt::WStyle_ContextHelp)); 147 (Qt::WDestructiveClose | Qt::WStyle_ContextHelp));
148 return pppconfig; 148 return pppconfig;
149} 149}
150 150
@@ -165,13 +165,13 @@ QWidget *PPPModule::information(Interface *i)
165 * @return QList<Interface> A list of interfaces that exsist that havn't 165 * @return QList<Interface> A list of interfaces that exsist that havn't
166 * been called by isOwner() 166 * been called by isOwner()
167 */ 167 */
168QList<Interface> PPPModule::getInterfaces() 168QList<Interface> PPPModule::getInterfaces()
169{ 169{
170 // List all of the files in the peer directory 170 // List all of the files in the peer directory
171 qDebug("PPPModule::getInterfaces"); 171 odebug << "PPPModule::getInterfaces" << oendl;
172 return list; 172 return list;
173} 173}
174 174
175/** 175/**
176 * Attempt to add a new interface as defined by name 176 * Attempt to add a new interface as defined by name
177 * @param name the name of the type of interface that should be created given 177 * @param name the name of the type of interface that should be created given
@@ -258,26 +258,26 @@ namespace
258 { 258 {
259 Connection con; 259 Connection con;
260 cfg.setGroup( (*it) ); 260 cfg.setGroup( (*it) );
261 con.name = (*it); 261 con.name = (*it);
262 con.pid = cfg.readNumEntry("pid"); 262 con.pid = cfg.readNumEntry("pid");
263 con.device = cfg.readEntry("device"); 263 con.device = cfg.readEntry("device");
264 qDebug(" %s %s %d", con.name.latin1(), con.device.latin1(), con.pid ); 264 odebug << " " << con.name.latin1() << " " << con.device.latin1() << " " << con.pid << "" << oendl;
265 265
266 if ( con.pid != -1 && isAvailable( con.pid ) ) 266 if ( con.pid != -1 && isAvailable( con.pid ) )
267 ifaces.insert( con.name, con ); 267 ifaces.insert( con.name, con );
268 } 268 }
269 return ifaces; 269 return ifaces;
270 } 270 }
271 bool InterfaceKeeper::isAvailable( pid_t p)const 271 bool InterfaceKeeper::isAvailable( pid_t p)const
272 { 272 {
273 if (::kill(p, 0 ) == 0 || errno != ESRCH ) 273 if (::kill(p, 0 ) == 0 || errno != ESRCH )
274 { 274 {
275 qDebug("isAvailable %d", p); 275 odebug << "isAvailable " << p << "" << oendl;
276 return true; 276 return true;
277 } 277 }
278 278
279 qDebug("notAvailable %d", p); 279 odebug << "notAvailable " << p << "" << oendl;
280 return false; 280 return false;
281 } 281 }
282 282
283} 283}
diff --git a/noncore/settings/networksettings/wlan/infoimp.cpp b/noncore/settings/networksettings/wlan/infoimp.cpp
index bd56678..c558f5e 100644
--- a/noncore/settings/networksettings/wlan/infoimp.cpp
+++ b/noncore/settings/networksettings/wlan/infoimp.cpp
@@ -10,13 +10,13 @@
10 * start a timer that every second will update the information. 10 * start a timer that every second will update the information.
11 */ 11 */
12WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){ 12WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){
13 WExtensions *wExtensions = new WExtensions(name); 13 WExtensions *wExtensions = new WExtensions(name);
14 if(!wExtensions->doesHaveWirelessExtensions()){ 14 if(!wExtensions->doesHaveWirelessExtensions()){
15 delete wExtensions; 15 delete wExtensions;
16 qDebug("WlanInfoImp::No wireless extension"); 16 odebug << "WlanInfoImp::No wireless extension" << oendl;
17 return; 17 return;
18 } 18 }
19 delete wExtensions; 19 delete wExtensions;
20 timer = new QTimer( this ); 20 timer = new QTimer( this );
21 connect( timer, SIGNAL(timeout()), this, SLOT(update())); 21 connect( timer, SIGNAL(timeout()), this, SLOT(update()));
22 timer->start( 1000, false ); 22 timer->start( 1000, false );
@@ -25,13 +25,13 @@ WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInf
25/** 25/**
26 * Updates the information about the wireless device. 26 * Updates the information about the wireless device.
27 */ 27 */
28void WlanInfoImp::update(){ 28void WlanInfoImp::update(){
29 WExtensions *wExtensions = new WExtensions(this->name()); 29 WExtensions *wExtensions = new WExtensions(this->name());
30 if(!wExtensions->doesHaveWirelessExtensions()){ 30 if(!wExtensions->doesHaveWirelessExtensions()){
31 qDebug("No extension"); 31 odebug << "No extension" << oendl;
32 delete wExtensions; 32 delete wExtensions;
33 timer->stop(); 33 timer->stop();
34 return; 34 return;
35 } 35 }
36 essidLabel->setText(wExtensions->essid()); 36 essidLabel->setText(wExtensions->essid());
37 apLabel->setText(wExtensions->ap()); 37 apLabel->setText(wExtensions->ap());
diff --git a/noncore/settings/networksettings/wlan/wextensions.cpp b/noncore/settings/networksettings/wlan/wextensions.cpp
index d1fff88..9c64323 100644
--- a/noncore/settings/networksettings/wlan/wextensions.cpp
+++ b/noncore/settings/networksettings/wlan/wextensions.cpp
@@ -109,13 +109,13 @@ int WExtensions::channel(){
109 for(int channel = 1; channel<= 15; channel++){ 109 for(int channel = 1; channel<= 15; channel++){
110 if( num >= left && num <= right ) 110 if( num >= left && num <= right )
111 return channel; 111 return channel;
112 left += 0.005; 112 left += 0.005;
113 right += 0.005; 113 right += 0.005;
114 } 114 }
115 qDebug(QString("Unknown frequency: %1, returning -1 for the channel.").arg(num).latin1()); 115 odebug << QString("Unknown frequency: %1, returning -1 for the channel.").arg(num).latin1() << oendl;
116 return -1; 116 return -1;
117} 117}
118 118
119/*** 119/***
120 * Get the current rate that the card is transmiting at. 120 * Get the current rate that the card is transmiting at.
121 * @return double the rate, 0 if error. 121 * @return double the rate, 0 if error.
@@ -174,26 +174,26 @@ bool WExtensions::stats(int &signal, int &noise, int &quality){
174 wstream.readLine(); // skip the first two lines 174 wstream.readLine(); // skip the first two lines
175 wstream.readLine(); // because they only contain headers 175 wstream.readLine(); // because they only contain headers
176 while(!wstream.atEnd()){ 176 while(!wstream.atEnd()){
177 wstream >> name >> status >> quality >> c >> signal >> c >> noise; 177 wstream >> name >> status >> quality >> c >> signal >> c >> noise;
178 if(name == QString("%1:").arg(interface)){ 178 if(name == QString("%1:").arg(interface)){
179 if ( quality > 92 ) 179 if ( quality > 92 )
180 qDebug( "WIFIAPPLET: D'oh! Quality %d > estimated max!\n", quality ); 180 odebug << "WIFIAPPLET: D'oh! Quality " << quality << " > estimated max!\n" << oendl;
181 if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) ) 181 if ( ( signal > IW_UPPER ) || ( signal < IW_LOWER ) )
182 qDebug( "WIFIAPPLET: Doh! Strength %d > estimated max!\n", signal ); 182 odebug << "WIFIAPPLET: Doh! Strength " << signal << " > estimated max!\n" << oendl;
183 if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) ) 183 if ( ( noise > IW_UPPER ) || ( noise < IW_LOWER ) )
184 qDebug( "WIFIAPPLET: Doh! Noise %d > estimated max!\n", noise ); 184 odebug << "WIFIAPPLET: Doh! Noise " << noise << " > estimated max!\n" << oendl;
185 //qDebug(QString("q:%1, s:%2, n:%3").arg(quality).arg(signal).arg(noise).latin1()); 185 //odebug << QString("q:%1, s:%2, n:%3").arg(quality).arg(signal).arg(noise).latin1() << oendl;
186 signal = ( ( signal-IW_LOWER ) * 100 ) / IW_UPPER; 186 signal = ( ( signal-IW_LOWER ) * 100 ) / IW_UPPER;
187 noise = ( ( noise-IW_LOWER ) * 100 ) / IW_UPPER; 187 noise = ( ( noise-IW_LOWER ) * 100 ) / IW_UPPER;
188 quality = ( quality*100 ) / 92; 188 quality = ( quality*100 ) / 92;
189 return true; 189 return true;
190 } 190 }
191 } 191 }
192 192
193 qDebug("WExtensions::statsCard no longer present."); 193 odebug << "WExtensions::statsCard no longer present." << oendl;
194 quality = -1; 194 quality = -1;
195 signal = IW_LOWER; 195 signal = IW_LOWER;
196 noise = IW_LOWER; 196 noise = IW_LOWER;
197 return false; 197 return false;
198} 198}
199 199
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 80a9927..fe7941d 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -42,13 +42,13 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W
42 } 42 }
43 file.close(); 43 file.close();
44 settingsFileText = QStringList::split("\n", line, true); 44 settingsFileText = QStringList::split("\n", line, true);
45 parseSettingFile(); 45 parseSettingFile();
46 } 46 }
47 else 47 else
48 qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1()); 48 odebug << QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1() << oendl;
49 connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int))); 49 connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int)));
50} 50}
51 51
52void WLANImp::typeChanged(int mod){ 52void WLANImp::typeChanged(int mod){
53 networkChannel->setEnabled(mod); 53 networkChannel->setEnabled(mod);
54 channelLabel->setEnabled(mod); 54 channelLabel->setEnabled(mod);
@@ -143,13 +143,13 @@ void WLANImp::parseSettingFile(){
143void WLANImp::changeAndSaveSettingFile(){ 143void WLANImp::changeAndSaveSettingFile(){
144 QString wlanFile = WIRELESS_OPTS; 144 QString wlanFile = WIRELESS_OPTS;
145 QFile::remove(wlanFile); 145 QFile::remove(wlanFile);
146 QFile file(wlanFile); 146 QFile file(wlanFile);
147 147
148 if (!file.open(IO_ReadWrite)){ 148 if (!file.open(IO_ReadWrite)){
149 qDebug(QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1()); 149 odebug << QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1() << oendl;
150 return; 150 return;
151 } 151 }
152 152
153 QTextStream stream( &file ); 153 QTextStream stream( &file );
154 bool foundCase = false; 154 bool foundCase = false;
155 bool found = false; 155 bool found = false;
@@ -233,13 +233,13 @@ void WLANImp::accept(){
233 OProcess insert; 233 OProcess insert;
234 insert << "sh"; 234 insert << "sh";
235 insert << "-c"; 235 insert << "-c";
236 insert << "cardctl eject && cardctl insert"; 236 insert << "cardctl eject && cardctl insert";
237 237
238 if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { 238 if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) {
239 qWarning("could not start cardctl"); 239 owarn << "could not start cardctl" << oendl;
240 } 240 }
241 241
242 // Close out the dialog 242 // Close out the dialog
243 QDialog::accept(); 243 QDialog::accept();
244} 244}
245 245
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp
index eeebe7f..e483efe 100644
--- a/noncore/settings/networksettings/wlan/wlanimp2.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp
@@ -49,13 +49,13 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W
49 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); 49 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces);
50 tabWidget->insertTab(interfaceSetup, "TCP/IP"); 50 tabWidget->insertTab(interfaceSetup, "TCP/IP");
51 51
52 // Check sanity - the existance of the wireless-tools if-pre-up script 52 // Check sanity - the existance of the wireless-tools if-pre-up script
53 QFile file(QString(PREUP)); 53 QFile file(QString(PREUP));
54 if (file.exists()) { 54 if (file.exists()) {
55 qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); 55 owarn << QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools") << oendl;
56 } 56 }
57 57
58 connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); 58 connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) );
59 connect( netView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( selectNetwork(QListViewItem*) ) ); 59 connect( netView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( selectNetwork(QListViewItem*) ) );
60 netView->setColumnAlignment( col_chn, AlignCenter ); 60 netView->setColumnAlignment( col_chn, AlignCenter );
61 netView->setItemMargin( 3 ); 61 netView->setItemMargin( 3 );
@@ -230,13 +230,13 @@ void WLANImp::writeOpts() {
230 if(!interfaces->isInterfaceSet()){ 230 if(!interfaces->isInterfaceSet()){
231 QMessageBox::warning(0,"Inface not set","should not happen!!!"); 231 QMessageBox::warning(0,"Inface not set","should not happen!!!");
232 return; 232 return;
233 } 233 }
234 bool error = false; 234 bool error = false;
235 235
236 qDebug("setting wlan interface %s", interfaces->getInterfaceName( error ).latin1() ); 236 odebug << "setting wlan interface " << interfaces->getInterfaceName( error ).latin1() << "" << oendl;
237 237
238 if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!"); 238 if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!");
239 239
240 interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); 240 interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText());
241 interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); 241 interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText());
242 242
@@ -304,13 +304,13 @@ void WLANImp::writeOpts() {
304 * ... powered by Wellenreiter II technology (C) Michael 'Mickey' Lauer <mickeyl@handhelds.org> 304 * ... powered by Wellenreiter II technology (C) Michael 'Mickey' Lauer <mickeyl@handhelds.org>
305 */ 305 */
306 306
307void WLANImp::rescanNeighbourhood() 307void WLANImp::rescanNeighbourhood()
308{ 308{
309 QString name = interface->getInterfaceName(); 309 QString name = interface->getInterfaceName();
310 qDebug( "rescanNeighbourhood via '%s'", (const char*) name ); 310 odebug << "rescanNeighbourhood via '" << (const char*) name << "'" << oendl;
311 311
312 OWirelessNetworkInterface* wiface = static_cast<OWirelessNetworkInterface*>( ONetwork::instance()->interface( name ) ); 312 OWirelessNetworkInterface* wiface = static_cast<OWirelessNetworkInterface*>( ONetwork::instance()->interface( name ) );
313 assert( wiface ); 313 assert( wiface );
314 314
315 // try to guess device type 315 // try to guess device type
316 QString devicetype; 316 QString devicetype;
@@ -327,18 +327,18 @@ void WLANImp::rescanNeighbourhood()
327 else if ( line.contains( "prism" ) ) devicetype = "wlan-ng"; /* puke */ 327 else if ( line.contains( "prism" ) ) devicetype = "wlan-ng"; /* puke */
328 else if ( line.contains( "orinoco" ) ) devicetype = "orinoco"; 328 else if ( line.contains( "orinoco" ) ) devicetype = "orinoco";
329 } 329 }
330 } 330 }
331 if ( devicetype.isEmpty() ) 331 if ( devicetype.isEmpty() )
332 { 332 {
333 qWarning( "rescanNeighbourhood(): couldn't guess device type :(" ); 333 owarn << "rescanNeighbourhood(): couldn't guess device type :(" << oendl;
334 return; 334 return;
335 } 335 }
336 else 336 else
337 { 337 {
338 qDebug( "rescanNeighbourhood(): device type seems to be '%s'", (const char*) devicetype ); 338 odebug << "rescanNeighbourhood(): device type seems to be '" << (const char*) devicetype << "'" << oendl;
339 } 339 }
340 340
341 // configure interface to receive 802.11 management frames 341 // configure interface to receive 802.11 management frames
342 342
343 wiface->setUp( true ); 343 wiface->setUp( true );
344 wiface->setPromiscuousMode( true ); 344 wiface->setPromiscuousMode( true );
@@ -346,29 +346,29 @@ void WLANImp::rescanNeighbourhood()
346 if ( devicetype == "cisco" ) wiface->setMonitoring( new OCiscoMonitoringInterface( wiface, false ) ); 346 if ( devicetype == "cisco" ) wiface->setMonitoring( new OCiscoMonitoringInterface( wiface, false ) );
347 else if ( devicetype == "hostap" ) wiface->setMonitoring( new OHostAPMonitoringInterface( wiface, false ) ); 347 else if ( devicetype == "hostap" ) wiface->setMonitoring( new OHostAPMonitoringInterface( wiface, false ) );
348 else if ( devicetype == "wlan-ng" ) wiface->setMonitoring( new OWlanNGMonitoringInterface( wiface, false ) ); 348 else if ( devicetype == "wlan-ng" ) wiface->setMonitoring( new OWlanNGMonitoringInterface( wiface, false ) );
349 else if ( devicetype == "orinoco" ) wiface->setMonitoring( new OOrinocoMonitoringInterface( wiface, false ) ); 349 else if ( devicetype == "orinoco" ) wiface->setMonitoring( new OOrinocoMonitoringInterface( wiface, false ) );
350 else 350 else
351 { 351 {
352 qDebug( "rescanNeighbourhood(): unsupported device type for monitoring :(" ); 352 odebug << "rescanNeighbourhood(): unsupported device type for monitoring :(" << oendl;
353 return; 353 return;
354 } 354 }
355 355
356 wiface->setMode( "monitor" ); 356 wiface->setMode( "monitor" );
357 if ( wiface->mode() != "monitor" ) 357 if ( wiface->mode() != "monitor" )
358 { 358 {
359 qWarning( "rescanNeighbourhood(): Unable to bring device into monitor mode (%s).", strerror( errno ) ); 359 owarn << "rescanNeighbourhood(): Unable to bring device into monitor mode (" << strerror( errno ) << ")." << oendl;
360 return; 360 return;
361 } 361 }
362 362
363 // open a packet capturer 363 // open a packet capturer
364 OPacketCapturer* cap = new OPacketCapturer(); 364 OPacketCapturer* cap = new OPacketCapturer();
365 cap->open( name ); 365 cap->open( name );
366 if ( !cap->isOpen() ) 366 if ( !cap->isOpen() )
367 { 367 {
368 qWarning( "rescanNeighbourhood(): Unable to open libpcap (%s).", strerror( errno ) ); 368 owarn << "rescanNeighbourhood(): Unable to open libpcap (" << strerror( errno ) << ")." << oendl;
369 return; 369 return;
370 } 370 }
371 371
372 // display splash screen 372 // display splash screen
373 QFrame* splash = new QFrame( this, "splash", false, WStyle_StaysOnTop | WStyle_DialogBorder | WStyle_Customize ); 373 QFrame* splash = new QFrame( this, "splash", false, WStyle_StaysOnTop | WStyle_DialogBorder | WStyle_Customize );
374 splash->setLineWidth( 2 ); 374 splash->setLineWidth( 2 );
@@ -395,21 +395,21 @@ void WLANImp::rescanNeighbourhood()
395 395
396 for ( int i = 1; i <= wiface->channels(); ++i ) 396 for ( int i = 1; i <= wiface->channels(); ++i )
397 { 397 {
398 wiface->setChannel( i ); 398 wiface->setChannel( i );
399 pb->setProgress( i ); 399 pb->setProgress( i );
400 qApp->processEvents(); 400 qApp->processEvents();
401 qDebug( "rescanNeighbourhood(): listening on channel %d...", i ); 401 odebug << "rescanNeighbourhood(): listening on channel " << i << "..." << oendl;
402 OPacket* p = cap->next( 1000 ); 402 OPacket* p = cap->next( 1000 );
403 if ( !p ) 403 if ( !p )
404 { 404 {
405 qDebug( "rescanNeighbourhood(): nothing received on channel %d", i ); 405 odebug << "rescanNeighbourhood(): nothing received on channel " << i << "" << oendl;
406 } 406 }
407 else 407 else
408 { 408 {
409 qDebug( "rescanNeighbourhood(): TADAA - something came in on channel %d", i ); 409 odebug << "rescanNeighbourhood(): TADAA - something came in on channel " << i << "" << oendl;
410 handlePacket( p ); 410 handlePacket( p );
411 } 411 }
412 } 412 }
413 413
414 cap->close(); 414 cap->close();
415 wiface->setMode( "managed" ); // TODO: use previous mode 415 wiface->setMode( "managed" ); // TODO: use previous mode
@@ -436,13 +436,13 @@ void WLANImp::handlePacket( OPacket* p )
436 else if ( beacon->canESS() ) 436 else if ( beacon->canESS() )
437 { 437 {
438 type = "managed"; 438 type = "managed";
439 } 439 }
440 else 440 else
441 { 441 {
442 qWarning( "handlePacket(): invalid frame [possibly noise] detected!" ); 442 owarn << "handlePacket(): invalid frame [possibly noise] detected!" << oendl;
443 return; 443 return;
444 } 444 }
445 445
446 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 446 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
447 QString essid = ssid ? ssid->ID() : QString("<unknown>"); 447 QString essid = ssid ? ssid->ID() : QString("<unknown>");
448 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); 448 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 74d7f8e..886af10 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -119,59 +119,59 @@ bool WLANModule::remove(Interface*){
119 // Can't remove a hardware device, you can stop it though. 119 // Can't remove a hardware device, you can stop it though.
120 return false; 120 return false;
121} 121}
122 122
123void WLANModule::receive(const QCString &param, const QByteArray &arg) 123void WLANModule::receive(const QCString &param, const QByteArray &arg)
124{ 124{
125 qDebug("WLANModule::receive "+param); 125 odebug << "WLANModule::receive "+param << oendl;
126 QStringList params = QStringList::split(",",param); 126 QStringList params = QStringList::split(",",param);
127 int count = params.count(); 127 int count = params.count();
128 qDebug("WLANModule got %i params", count ); 128 odebug << "WLANModule got " << count << " params" << oendl;
129 if (count < 2){ 129 if (count < 2){
130 qDebug("Erorr less than 2 parameter"); 130 odebug << "Erorr less than 2 parameter" << oendl;
131 qDebug("RETURNING"); 131 odebug << "RETURNING" << oendl;
132 return; 132 return;
133 } 133 }
134 134
135 QDataStream stream(arg,IO_ReadOnly); 135 QDataStream stream(arg,IO_ReadOnly);
136 QString interface; 136 QString interface;
137 QString action; 137 QString action;
138 int countMsgs = 0; 138 int countMsgs = 0;
139 stream >> interface; 139 stream >> interface;
140 qDebug("got count? >%s<",interface.latin1()); 140 odebug << "got count? >" << interface.latin1() << "<" << oendl;
141 if (interface == "count"){ 141 if (interface == "count"){
142 qDebug("got count"); 142 odebug << "got count" << oendl;
143 stream >> action; 143 stream >> action;
144 qDebug("Got count num >%s<", action.latin1()); 144 odebug << "Got count num >" << action.latin1() << "<" << oendl;
145 countMsgs = action.toInt(); 145 countMsgs = action.toInt();
146 } 146 }
147 147
148 QDialog *toShow; 148 QDialog *toShow;
149 //while (! stream.atEnd() ){ 149 //while (! stream.atEnd() ){
150 for (int i = 0; i < countMsgs; i++){ 150 for (int i = 0; i < countMsgs; i++){
151 qDebug("start stream %d/%d",i,countMsgs); 151 odebug << "start stream " << i << "/" << countMsgs << "" << oendl;
152 if (stream.atEnd()){ 152 if (stream.atEnd()){
153 qDebug("end of stream"); 153 odebug << "end of stream" << oendl;
154 return; 154 return;
155 } 155 }
156 stream >> interface; 156 stream >> interface;
157 qDebug("got iface"); 157 odebug << "got iface" << oendl;
158 stream >> action; 158 stream >> action;
159 qDebug("WLANModule got interface %s and acion %s", interface.latin1(), action.latin1()); 159 odebug << "WLANModule got interface " << interface.latin1() << " and acion " << action.latin1() << "" << oendl;
160 // find interfaces 160 // find interfaces
161 Interface *ifa=0; 161 Interface *ifa=0;
162 for ( Interface *i=list.first(); i != 0; i=list.next() ){ 162 for ( Interface *i=list.first(); i != 0; i=list.next() ){
163 if (i->getInterfaceName() == interface){ 163 if (i->getInterfaceName() == interface){
164 qDebug("WLANModule found interface %s",interface.latin1()); 164 odebug << "WLANModule found interface " << interface.latin1() << "" << oendl;
165 ifa = i; 165 ifa = i;
166 } 166 }
167 } 167 }
168 168
169 if (ifa == 0){ 169 if (ifa == 0){
170 qDebug("WLANModule Did not find %s",interface.latin1()); 170 odebug << "WLANModule Did not find " << interface.latin1() << "" << oendl;
171 qDebug("skipping"); 171 odebug << "skipping" << oendl;
172 count = 0; 172 count = 0;
173 } 173 }
174 174
175 if (count == 2){ 175 if (count == 2){
176 // those should call the interface directly 176 // those should call the interface directly
177 QWidget *info = getInfo( ifa ); 177 QWidget *info = getInfo( ifa );
@@ -192,15 +192,15 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
192 //FIXME: what if it got closed meanwhile? 192 //FIXME: what if it got closed meanwhile?
193 wlanconfigWiget = (WLANImp*) configure(ifa); 193 wlanconfigWiget = (WLANImp*) configure(ifa);
194 toShow = (QDialog*) wlanconfigWiget; 194 toShow = (QDialog*) wlanconfigWiget;
195 } 195 }
196 QPEApplication::showWidget( wlanconfigWiget ); 196 QPEApplication::showWidget( wlanconfigWiget );
197 stream >> value; 197 stream >> value;
198 qDebug("WLANModule (build 4) is setting %s of %s to %s", action.latin1(), interface.latin1(), value.latin1() ); 198 odebug << "WLANModule (build 4) is setting " << action.latin1() << " of " << interface.latin1() << " to " << value.latin1() << "" << oendl;
199 if (value.isEmpty()){ 199 if (value.isEmpty()){
200 qDebug("value is empty!!!\nreturning"); 200 odebug << "value is empty!!!\nreturning" << oendl;
201 return; 201 return;
202 } 202 }
203 if ( action.contains("ESSID") ){ 203 if ( action.contains("ESSID") ){
204 QComboBox *combo = wlanconfigWiget->essid; 204 QComboBox *combo = wlanconfigWiget->essid;
205 bool found = false; 205 bool found = false;
206 for ( int i = 0; i < combo->count(); i++) 206 for ( int i = 0; i < combo->count(); i++)
@@ -215,41 +215,41 @@ void WLANModule::receive(const QCString &param, const QByteArray &arg)
215 if ( combo->text( i ) == value ){ 215 if ( combo->text( i ) == value ){
216 combo->setCurrentItem( i ); 216 combo->setCurrentItem( i );
217 } 217 }
218 218
219 }else if (action.contains("Channel")){ 219 }else if (action.contains("Channel")){
220 bool ok; 220 bool ok;
221 qDebug("converting channel"); 221 odebug << "converting channel" << oendl;
222 int chan = value.toInt( &ok ); 222 int chan = value.toInt( &ok );
223 if (ok){ 223 if (ok){
224 qDebug("ok setting channel"); 224 odebug << "ok setting channel" << oendl;
225 wlanconfigWiget->specifyChan->setChecked( true ); 225 wlanconfigWiget->specifyChan->setChecked( true );
226 wlanconfigWiget->networkChannel->setValue( chan ); 226 wlanconfigWiget->networkChannel->setValue( chan );
227 } 227 }
228 }else if (action.contains("MacAddr")){ 228 }else if (action.contains("MacAddr")){
229 wlanconfigWiget->specifyAp->setChecked( true ); 229 wlanconfigWiget->specifyAp->setChecked( true );
230 wlanconfigWiget->macEdit->setText( value ); 230 wlanconfigWiget->macEdit->setText( value );
231 }else 231 }else
232 qDebug("wlan plugin has no clue"); 232 odebug << "wlan plugin has no clue" << oendl;
233 } 233 }
234 qDebug("next stream"); 234 odebug << "next stream" << oendl;
235 }// while stream 235 }// while stream
236 qDebug("end of stream"); 236 odebug << "end of stream" << oendl;
237 if (toShow) toShow->exec(); 237 if (toShow) toShow->exec();
238 qDebug("returning"); 238 odebug << "returning" << oendl;
239} 239}
240 240
241QWidget *WLANModule::getInfo( Interface *i) 241QWidget *WLANModule::getInfo( Interface *i)
242{ 242{
243 qDebug("WLANModule::getInfo start"); 243 odebug << "WLANModule::getInfo start" << oendl;
244 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); 244 WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose);
245 InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); 245 InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i);
246 info->tabWidget->insertTab(information, "TCP/IP", 0); 246 info->tabWidget->insertTab(information, "TCP/IP", 0);
247 info->tabWidget->setCurrentPage( 0 ); 247 info->tabWidget->setCurrentPage( 0 );
248 info->tabWidget->showPage( information ); 248 info->tabWidget->showPage( information );
249 if (info->tabWidget->currentPage() == information ) qDebug("infotab OK"); 249 if (info->tabWidget->currentPage() == information ) odebug << "infotab OK" << oendl;
250 else qDebug("infotab NOT OK"); 250 else odebug << "infotab NOT OK" << oendl;
251 qDebug("current idx %d", info->tabWidget->currentPageIndex()); 251 odebug << "current idx " << info->tabWidget->currentPageIndex() << "" << oendl;
252 qDebug("WLANModule::getInfo return"); 252 odebug << "WLANModule::getInfo return" << oendl;
253 return info; 253 return info;
254} 254}
255 255
diff --git a/noncore/settings/sound/sound.pro b/noncore/settings/sound/sound.pro
index a3804c3..58e94f3 100644
--- a/noncore/settings/sound/sound.pro
+++ b/noncore/settings/sound/sound.pro
@@ -1,10 +1,9 @@
1CONFIG += qt warn_on quick-app 1CONFIG += qt warn_on quick-app
2HEADERS = soundsettings.h soundsettingsbase.h 2HEADERS = soundsettings.h soundsettingsbase.h
3SOURCES = soundsettings.cpp soundsettingsbase.cpp main.cpp 3SOURCES = soundsettings.cpp soundsettingsbase.cpp main.cpp
4#INTERFACES = soundsettingsbase.ui
5INCLUDEPATH += $(OPIEDIR)/include 4INCLUDEPATH += $(OPIEDIR)/include
6DEPENDPATH += $(OPIEDIR)/include 5DEPENDPATH += $(OPIEDIR)/include
7LIBS += -lqpe -lopiecore2 6LIBS += -lqpe -lopiecore2
8TARGET = sound 7TARGET = sound
9 8
10include ( $(OPIEDIR)/include.pro ) 9include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index 8ad0a3f..d55a751 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -18,26 +18,30 @@
18 ** 18 **
19 **********************************************************************/ 19 **********************************************************************/
20// parts copyright 2002 L.J. Potter 20// parts copyright 2002 L.J. Potter
21 21
22#include "soundsettings.h" 22#include "soundsettings.h"
23 23
24/* OPIE */
25#include <opie2/odebug.h>
24#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
25#include <qpe/config.h> 27#include <qpe/config.h>
26#include <qpe/qcopenvelope_qws.h> 28#include <qpe/qcopenvelope_qws.h>
27#include <qpe/storage.h> 29#include <qpe/storage.h>
30using namespace Opie::Core;
28 31
32/* QT */
29#include <qcheckbox.h> 33#include <qcheckbox.h>
30#include <qcombobox.h> 34#include <qcombobox.h>
31#include <qlabel.h> 35#include <qlabel.h>
32 36
37/* STD */
33#include <sys/utsname.h> 38#include <sys/utsname.h>
34#include <sys/time.h> 39#include <sys/time.h>
35#include <sys/types.h> 40#include <sys/types.h>
36#include <unistd.h> 41#include <unistd.h>
37#include <stdio.h>
38#include <sys/stat.h> 42#include <sys/stat.h>
39 43
40 44
41SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) 45SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl )
42 : SoundSettingsBase( parent, objname, TRUE, fl ) 46 : SoundSettingsBase( parent, objname, TRUE, fl )
43{ 47{
@@ -70,25 +74,25 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl )
70//devices 74//devices
71 bool systemZaurus=FALSE; 75 bool systemZaurus=FALSE;
72 struct utsname name; /* check for embedix kernel running on the zaurus*/ 76 struct utsname name; /* check for embedix kernel running on the zaurus*/
73 if (uname(&name) != -1) {// TODO change this here,... 77 if (uname(&name) != -1) {// TODO change this here,...
74 QString release=name.release; 78 QString release=name.release;
75 if( release.find("embedix",0,TRUE) != -1) { 79 if( release.find("embedix",0,TRUE) != -1) {
76 qDebug("IS System Zaurus"); 80 odebug << "IS System Zaurus" << oendl;
77 systemZaurus=TRUE; 81 systemZaurus=TRUE;
78 } 82 }
79 } 83 }
80 if(!systemZaurus) { 84 if(!systemZaurus) {
81 stereoCheckBox->setChecked(TRUE); 85 stereoCheckBox->setChecked(TRUE);
82 } 86 }
83 stereoCheckBox->setEnabled(FALSE); 87 stereoCheckBox->setEnabled(FALSE);
84 sixteenBitCheckBox->setEnabled(FALSE); 88 sixteenBitCheckBox->setEnabled(FALSE);
85#else 89#else
86#endif 90#endif
87 int sRate=cfg.readNumEntry("SizeLimit", 30); 91 int sRate=cfg.readNumEntry("SizeLimit", 30);
88 qDebug("%d",sRate); 92 odebug << "" << sRate << "" << oendl;
89 93
90 if(sRate ==30) 94 if(sRate ==30)
91 timeLimitComboBox->setCurrentItem(0); 95 timeLimitComboBox->setCurrentItem(0);
92 else if(sRate==20) 96 else if(sRate==20)
93 timeLimitComboBox->setCurrentItem(1); 97 timeLimitComboBox->setCurrentItem(1);
94 else if(sRate == 15) 98 else if(sRate == 15)
@@ -140,30 +144,30 @@ void SoundSettings::updateStorageCombo() {
140 144
141 const QList<FileSystem> &fs = storageInfo.fileSystems(); 145 const QList<FileSystem> &fs = storageInfo.fileSystems();
142 QListIterator<FileSystem> it ( fs ); 146 QListIterator<FileSystem> it ( fs );
143 for( ; it.current(); ++it ){ 147 for( ; it.current(); ++it ){
144 const QString name = (*it)->name(); 148 const QString name = (*it)->name();
145 const QString path = (*it)->path(); 149 const QString path = (*it)->path();
146 qDebug("storage name "+name +" storage path is "+path); 150 odebug << "storage name "+name +" storage path is "+path << oendl;
147 list << name + ": " +path; 151 list << name + ": " +path;
148 if( loc.find( path,0,TRUE) != -1) 152 if( loc.find( path,0,TRUE) != -1)
149 set = i; 153 set = i;
150// if(dit.current()->file().find(path) != -1 ) storage=name; 154// if(dit.current()->file().find(path) != -1 ) storage=name;
151 i++; 155 i++;
152 } 156 }
153 157
154 LocationComboBox->insertStringList(list); 158 LocationComboBox->insertStringList(list);
155 qDebug("set item %d", set); 159 odebug << "set item " << set << "" << oendl;
156 LocationComboBox->setCurrentItem(set); 160 LocationComboBox->setCurrentItem(set);
157} 161}
158 162
159void SoundSettings::setLocation(const QString & string) { 163void SoundSettings::setLocation(const QString & string) {
160 Config config( "Vmemo" ); 164 Config config( "Vmemo" );
161 config.setGroup( "System" ); 165 config.setGroup( "System" );
162 config.writeEntry("RecLocation",string); 166 config.writeEntry("RecLocation",string);
163 qDebug("set location "+string); 167 odebug << "set location "+string << oendl;
164 config.write(); 168 config.write();
165} 169}
166 170
167void SoundSettings::cleanUp() { 171void SoundSettings::cleanUp() {
168 Config cfg("Vmemo"); 172 Config cfg("Vmemo");
169 cfg.writeEntry("Alert",AlertCheckBox->isChecked()); 173 cfg.writeEntry("Alert",AlertCheckBox->isChecked());
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp
index 96bcdfc..4163fb2 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.cpp
+++ b/noncore/settings/sysinfo/benchmarkinfo.cpp
@@ -16,19 +16,22 @@
16** 16**
17**********************************************************************/ 17**********************************************************************/
18 18
19#include "benchmarkinfo.h" 19#include "benchmarkinfo.h"
20 20
21/* OPIE */ 21/* OPIE */
22#include <opie2/odebug.h>
22#include <opie2/ostorageinfo.h> 23#include <opie2/ostorageinfo.h>
23#include <opie2/olistview.h> 24#include <opie2/olistview.h>
24#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
25#include <qpe/qcopenvelope_qws.h> 26#include <qpe/qcopenvelope_qws.h>
26#include <qpe/qpedecoration_qws.h> 27#include <qpe/qpedecoration_qws.h>
27#include <qpe/resource.h> 28#include <qpe/resource.h>
28#include <qpe/config.h> 29#include <qpe/config.h>
30using namespace Opie::Core;
31using namespace Opie::Ui;
29 32
30/* QT */ 33/* QT */
31#include <qclipboard.h> 34#include <qclipboard.h>
32#include <qcolor.h> 35#include <qcolor.h>
33#include <qcombobox.h> 36#include <qcombobox.h>
34#include <qdirectpainter_qws.h> 37#include <qdirectpainter_qws.h>
@@ -48,16 +51,13 @@
48#include <stdlib.h> 51#include <stdlib.h>
49#include <math.h> 52#include <math.h>
50#if defined (__GNUC__) && (__GNUC__ < 3) 53#if defined (__GNUC__) && (__GNUC__ < 3)
51#define round qRound 54#define round qRound
52#endif 55#endif
53 56
54using namespace Opie::Ui;
55using namespace Opie::Core;
56extern "C" 57extern "C"
57
58{ 58{
59 void BenchFFT( void ); 59 void BenchFFT( void );
60 double dhry_main( int ); 60 double dhry_main( int );
61} 61}
62 62
63#define DHRYSTONE_RUNS 20000000 63#define DHRYSTONE_RUNS 20000000
@@ -145,13 +145,13 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
145 QWhatsThis::add( machineCombo, tr( "Choose a model to compare your results with." ) ); 145 QWhatsThis::add( machineCombo, tr( "Choose a model to compare your results with." ) );
146 146
147 QTextStream ts( &f ); 147 QTextStream ts( &f );
148 while( !ts.eof() ) 148 while( !ts.eof() )
149 { 149 {
150 QString machline = ts.readLine(); 150 QString machline = ts.readLine();
151 qDebug( "sysinfo: parsing benchmark results for '%s'", (const char*) machline ); 151 odebug << "sysinfo: parsing benchmark results for '" << (const char*) machline << "'" << oendl;
152 QString resline = ts.readLine(); 152 QString resline = ts.readLine();
153 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) ); 153 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) );
154 machineCombo->insertItem( machline ); 154 machineCombo->insertItem( machline );
155 } 155 }
156 156
157 QHBoxLayout* hb = new QHBoxLayout( vb ); 157 QHBoxLayout* hb = new QHBoxLayout( vb );
@@ -170,13 +170,13 @@ BenchmarkInfo::~BenchmarkInfo()
170 170
171void BenchmarkInfo::machineActivated( int index ) 171void BenchmarkInfo::machineActivated( int index )
172{ 172{
173 QStringList* results = machines[ machineCombo->text( index ) ]; 173 QStringList* results = machines[ machineCombo->text( index ) ];
174 if ( !results ) 174 if ( !results )
175 { 175 {
176 qDebug( "sysinfo: no results available." ); 176 odebug << "sysinfo: no results available." << oendl;
177 return; 177 return;
178 } 178 }
179 QStringList::Iterator it = results->begin(); 179 QStringList::Iterator it = results->begin();
180 test_alu->setText( 2, *(it++) ); 180 test_alu->setText( 2, *(it++) );
181 test_fpu->setText( 2, *(it++) ); 181 test_fpu->setText( 2, *(it++) );
182 test_txt->setText( 2, *(it++) ); 182 test_txt->setText( 2, *(it++) );
diff --git a/noncore/settings/tabmanager/tabmanager.cpp b/noncore/settings/tabmanager/tabmanager.cpp
index 15aeaf5..4274203 100644
--- a/noncore/settings/tabmanager/tabmanager.cpp
+++ b/noncore/settings/tabmanager/tabmanager.cpp
@@ -60,13 +60,13 @@ TabManager::~TabManager(){
60 * but will not follow symlinks. 60 * but will not follow symlinks.
61 * @param directory - the directory to look in. 61 * @param directory - the directory to look in.
62 * @param parent - the parent to place any new tabs or apps into. If parent is 62 * @param parent - the parent to place any new tabs or apps into. If parent is
63 * NULL then the item is a tab and should be placed as a child of the window. 63 * NULL then the item is a tab and should be placed as a child of the window.
64 */ 64 */
65void TabManager::rescanFolder(QString directory, QListViewItem* parent){ 65void TabManager::rescanFolder(QString directory, QListViewItem* parent){
66 //qDebug(QString("rescanFolder: ") + directory.latin1()); 66 //odebug << QString("rescanFolder: ") + directory.latin1() << oendl;
67 67
68 QDir d; 68 QDir d;
69 d.setPath(directory); 69 d.setPath(directory);
70 // Show hidden files for .directories 70 // Show hidden files for .directories
71 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs); 71 d.setFilter( QDir::Files | QDir::Hidden | QDir::Dirs);
72 72
@@ -204,13 +204,13 @@ void TabManager::removeItem(){
204 else 204 else
205 removeSuccessful = true; 205 removeSuccessful = true;
206 } 206 }
207 207
208 // If removing failed. 208 // If removing failed.
209 if(!removeSuccessful){ 209 if(!removeSuccessful){
210 qDebug((QString("removeItem: ") + location).latin1()); 210 odebug << (QString("removeItem: ") + location).latin1() << oendl;
211 QMessageBox::critical(this, tr("Message"), tr("Can't remove."), tr("Ok") ); 211 QMessageBox::critical(this, tr("Message"), tr("Can't remove."), tr("Ok") );
212 return; 212 return;
213 } 213 }
214 214
215 // Remove from the installer so it wont fail. 215 // Remove from the installer so it wont fail.
216 // Don't need to do this sense the current install uses rm -f so no error 216 // Don't need to do this sense the current install uses rm -f so no error
@@ -241,13 +241,13 @@ void TabManager::editCurrentItem(){
241void TabManager::editItem( QListViewItem * item){ 241void TabManager::editItem( QListViewItem * item){
242 if(!item) 242 if(!item)
243 return; 243 return;
244 244
245 TabAppLnk app(itemList[item]); 245 TabAppLnk app(itemList[item]);
246 if(!app.isValid()){ 246 if(!app.isValid()){
247 qDebug(QString("editItem: Not a valid applnk file: ") + itemList[item].latin1()); 247 odebug << QString("editItem: Not a valid applnk file: ") + itemList[item].latin1() << oendl;
248 return; 248 return;
249 } 249 }
250 250
251 // Fill with all of the icons 251 // Fill with all of the icons
252 if(!application){ 252 if(!application){
253 Wait waitDialog(this, "Wait dialog"); 253 Wait waitDialog(this, "Wait dialog");
@@ -270,13 +270,13 @@ void TabManager::editItem( QListViewItem * item){
270 QPixmap imageOfFile(Resource::loadPixmap(fileName)); 270 QPixmap imageOfFile(Resource::loadPixmap(fileName));
271 QImage foo = imageOfFile.convertToImage(); 271 QImage foo = imageOfFile.convertToImage();
272 foo = foo.smoothScale(16,16); 272 foo = foo.smoothScale(16,16);
273 imageOfFile.convertFromImage(foo); 273 imageOfFile.convertFromImage(foo);
274 application->iconLineEdit->insertItem(imageOfFile,fileName); 274 application->iconLineEdit->insertItem(imageOfFile,fileName);
275 } 275 }
276 //qDebug(fi->fileName().latin1()); 276 //odebug << fi->fileName().latin1() << oendl;
277 ++it; 277 ++it;
278 } 278 }
279 waitDialog.hide(); 279 waitDialog.hide();
280 } 280 }
281 int pixmap = -1; 281 int pixmap = -1;
282 QString pixmapText = app.pixmapString(); 282 QString pixmapText = app.pixmapString();
@@ -399,26 +399,26 @@ void TabManager::moveApplication(QListViewItem *item, QListViewItem *newGroup){
399 // Move file 399 // Move file
400 QDir r; 400 QDir r;
401 if(!r.rename(itemList[item], newFolder)){ 401 if(!r.rename(itemList[item], newFolder)){
402 QMessageBox::critical(this, tr("Message"), "Can't move application.", tr("Ok") ); 402 QMessageBox::critical(this, tr("Message"), "Can't move application.", tr("Ok") );
403 return; 403 return;
404 } 404 }
405 //qDebug((QString("moveApplication: ") + itemList[item]).latin1()); 405 //odebug << (QString("moveApplication: ") + itemList[item]).latin1() << oendl;
406 //qDebug((QString("moveApplication: ") + newFolder).latin1()); 406 //odebug << (QString("moveApplication: ") + newFolder).latin1() << oendl;
407 407
408 // Move in the gui 408 // Move in the gui
409 item->parent()->takeItem(item); 409 item->parent()->takeItem(item);
410 newGroup->insertItem(item); 410 newGroup->insertItem(item);
411 newGroup->setOpen(true); 411 newGroup->setOpen(true);
412 412
413 // Move file in the installer 413 // Move file in the installer
414 QString installedAppFile; 414 QString installedAppFile;
415 if(findInstalledApplication(desktopFile, installedAppFile)) 415 if(findInstalledApplication(desktopFile, installedAppFile))
416 swapInstalledLocation(installedAppFile, desktopFile, newFolder); 416 swapInstalledLocation(installedAppFile, desktopFile, newFolder);
417 else 417 else
418 qDebug("moveApplication: No installed app found for dekstop file"); 418 odebug << "moveApplication: No installed app found for dekstop file" << oendl;
419 419
420 // Move application type 420 // Move application type
421 AppLnk app(newFolder); 421 AppLnk app(newFolder);
422 app.setType(folderName); 422 app.setType(folderName);
423 app.writeLink(); 423 app.writeLink();
424 424
@@ -461,13 +461,13 @@ bool TabManager::findInstalledApplication(QString desktopFile, QString &installe
461 return true; 461 return true;
462 } 462 }
463 } 463 }
464 file.close(); 464 file.close();
465 } 465 }
466 else 466 else
467 qDebug((QString("findInstalledApplication: Can't open file") + HOME_APP_INSTALL_DIR + "/" + fi->fileName()).latin1()); 467 odebug << (QString("findInstalledApplication: Can't open file") + HOME_APP_INSTALL_DIR + "/" + fi->fileName()).latin1() << oendl;
468 ++it; // goto next list element 468 ++it; // goto next list element
469 } 469 }
470 return false; 470 return false;
471} 471}
472 472
473/** 473/**
@@ -476,13 +476,13 @@ bool TabManager::findInstalledApplication(QString desktopFile, QString &installe
476 * @param desktopFile old .desktop file 476 * @param desktopFile old .desktop file
477 * @param newLocation new .desktop file 477 * @param newLocation new .desktop file
478 */ 478 */
479void TabManager::swapInstalledLocation( QString installedAppFile, QString desktopFile, QString newLocation ){ 479void TabManager::swapInstalledLocation( QString installedAppFile, QString desktopFile, QString newLocation ){
480 QFile file(installedAppFile); 480 QFile file(installedAppFile);
481 if ( !file.open(IO_ReadOnly) ){ 481 if ( !file.open(IO_ReadOnly) ){
482 qDebug(QString("swapInstalledLocation: Can't edit file: %1").arg(installedAppFile).latin1()); 482 odebug << QString("swapInstalledLocation: Can't edit file: %1").arg(installedAppFile).latin1() << oendl;
483 return; 483 return;
484 } 484 }
485 485
486 QTextStream stream( &file ); // use a text stream 486 QTextStream stream( &file ); // use a text stream
487 QString allLines; 487 QString allLines;
488 while ( !stream.eof() ) { // until end of file... 488 while ( !stream.eof() ) { // until end of file...
@@ -493,13 +493,13 @@ void TabManager::swapInstalledLocation( QString installedAppFile, QString deskto
493 allLines += line; 493 allLines += line;
494 allLines += '\n'; 494 allLines += '\n';
495 } 495 }
496 file.close(); 496 file.close();
497 497
498 if ( !file.open(IO_ReadWrite) ){ 498 if ( !file.open(IO_ReadWrite) ){
499 qDebug(QString("swapInstalledLocation: Can't edit file: %1").arg(installedAppFile).latin1()); 499 odebug << QString("swapInstalledLocation: Can't edit file: %1").arg(installedAppFile).latin1() << oendl;
500 return; 500 return;
501 } 501 }
502 QTextStream streamOut( &file ); 502 QTextStream streamOut( &file );
503 streamOut << allLines; 503 streamOut << allLines;
504 file.close(); 504 file.close();
505} 505}
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp
index 5854fe0..3616507 100644
--- a/noncore/settings/usermanager/userdialog.cpp
+++ b/noncore/settings/usermanager/userdialog.cpp
@@ -8,14 +8,17 @@
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10#include "userdialog.h" 10#include "userdialog.h"
11#include "passwd.h" 11#include "passwd.h"
12 12
13/* OPIE */ 13/* OPIE */
14#include <opie2/odebug.h>
14#include <opie2/odevice.h> 15#include <opie2/odevice.h>
15#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
17using namespace Opie::Core;
18using namespace Opie::Ui;
16 19
17/* QT */ 20/* QT */
18#include <qlayout.h> 21#include <qlayout.h>
19#include <qlabel.h> 22#include <qlabel.h>
20#include <qmessagebox.h> 23#include <qmessagebox.h>
21#include <qfile.h> 24#include <qfile.h>
@@ -23,21 +26,16 @@
23/* STD */ 26/* STD */
24#include <sys/types.h> 27#include <sys/types.h>
25#include <sys/wait.h> 28#include <sys/wait.h>
26#include <unistd.h> 29#include <unistd.h>
27#include <signal.h> 30#include <signal.h>
28 31
29
30using namespace Opie::Core;
31
32
33/** 32/**
34 * UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups. 33 * UserDialog constructor. Setup the dialog, fill the groupComboBox & groupsListView with all groups.
35 * 34 *
36 */ 35 */
37using namespace Opie::Ui;
38UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl) 36UserDialog::UserDialog(int viewmode, QWidget* parent, const char* name, bool modal, WFlags fl) : QDialog(parent, name, modal, fl)
39{ 37{
40 vm=viewmode; 38 vm=viewmode;
41 QVBoxLayout *layout = new QVBoxLayout(this); 39 QVBoxLayout *layout = new QVBoxLayout(this);
42 myTabWidget=new QTabWidget(this,"User Tab Widget"); 40 myTabWidget=new QTabWidget(this,"User Tab Widget");
43 layout->addWidget(myTabWidget); 41 layout->addWidget(myTabWidget);
@@ -242,13 +240,13 @@ bool UserDialog::addUser(int uid, int gid)
242 // Show the dialog! 240 // Show the dialog!
243 if(!(adduserDialog->exec())) return false; 241 if(!(adduserDialog->exec())) return false;
244 if((adduserDialog->groupComboBox->currentItem()!=0)) 242 if((adduserDialog->groupComboBox->currentItem()!=0))
245 { 243 {
246 accounts->findGroup(adduserDialog->groupComboBox->currentText()); 244 accounts->findGroup(adduserDialog->groupComboBox->currentText());
247 adduserDialog->groupID=accounts->gr_gid; 245 adduserDialog->groupID=accounts->gr_gid;
248 qWarning(QString::number(accounts->gr_gid)); 246 owarn << QString::number(accounts->gr_gid) << oendl;
249 } 247 }
250 if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), 248 if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(),
251 adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(), 249 adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(),
252 QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) 250 QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText())))
253 { 251 {
254 QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user."); 252 QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user.");
@@ -371,13 +369,13 @@ bool UserDialog::editUser(const char *username)
371 QCheckListItem *temp; 369 QCheckListItem *temp;
372 // BAH!!! QRegExp in qt2 sucks... or maybe I do... can't figure out how to check for EITHER end of input ($) OR a comma, so here we do two different QRegExps instead. 370 // BAH!!! QRegExp in qt2 sucks... or maybe I do... can't figure out how to check for EITHER end of input ($) OR a comma, so here we do two different QRegExps instead.
373 QRegExp userRegExp(QString("[:,]%1$").arg(username)); // The end of line variant. 371 QRegExp userRegExp(QString("[:,]%1$").arg(username)); // The end of line variant.
374 QStringList tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of. 372 QStringList tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
375 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) 373 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
376 { // Iterate over all of them. 374 { // Iterate over all of them.
377 qWarning(*it); 375 owarn << *it << oendl;
378 QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups. 376 QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
379 for ( ; lvit.current(); ++lvit ) 377 for ( ; lvit.current(); ++lvit )
380 { 378 {
381 if(lvit.current()->text(0)==(*it).left((*it).find(":"))) 379 if(lvit.current()->text(0)==(*it).left((*it).find(":")))
382 { 380 {
383 temp=(QCheckListItem*)lvit.current(); 381 temp=(QCheckListItem*)lvit.current();
@@ -386,13 +384,13 @@ bool UserDialog::editUser(const char *username)
386 } 384 }
387 } 385 }
388 userRegExp=QRegExp(QString("[:,]%1,").arg(username)); // And the other one. (not end of line.) 386 userRegExp=QRegExp(QString("[:,]%1,").arg(username)); // And the other one. (not end of line.)
389 tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of. 387 tempList=accounts->groupStringList.grep(userRegExp); // Find all entries in the group database, that the user is a member of.
390 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it) 388 for(QStringList::Iterator it=tempList.begin(); it!=tempList.end(); ++it)
391 { // Iterate over all of them. 389 { // Iterate over all of them.
392 qWarning(*it); 390 owarn << *it << oendl;
393 QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups. 391 QListViewItemIterator lvit( edituserDialog->groupsListView ); // Compare to all groups.
394 for ( ; lvit.current(); ++lvit ) 392 for ( ; lvit.current(); ++lvit )
395 { 393 {
396 if(lvit.current()->text(0)==(*it).left((*it).find(":"))) 394 if(lvit.current()->text(0)==(*it).left((*it).find(":")))
397 { 395 {
398 temp=(QCheckListItem*)lvit.current(); 396 temp=(QCheckListItem*)lvit.current();
diff --git a/noncore/settings/usermanager/usermanager.cpp b/noncore/settings/usermanager/usermanager.cpp
index a1130d4..1d345ee 100644
--- a/noncore/settings/usermanager/usermanager.cpp
+++ b/noncore/settings/usermanager/usermanager.cpp
@@ -6,18 +6,21 @@
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10#include "usermanager.h" 10#include "usermanager.h"
11 11
12#include <qlayout.h> 12/* OPIE */
13#include <opie2/odebug.h>
14#include <qpe/resource.h>
15using namespace Opie::Core;
13 16
17/* QT */
18#include <qlayout.h>
14#include <qmessagebox.h> 19#include <qmessagebox.h>
15#include <qfile.h> 20#include <qfile.h>
16#include <qpe/resource.h>
17
18#include <qregexp.h> 21#include <qregexp.h>
19 22
20/** 23/**
21 * The mainwindow constructor. 24 * The mainwindow constructor.
22 * 25 *
23 * @param QWidget *parent 26 * @param QWidget *parent
@@ -250,8 +253,8 @@ void UserConfig::delGroup() {
250 QMessageBox::information(this,"No selection","No group has been selected."); 253 QMessageBox::information(this,"No selection","No group has been selected.");
251 } 254 }
252} 255}
253 256
254void UserConfig::showUserMenu(QListViewItem *item) { 257void UserConfig::showUserMenu(QListViewItem *item) {
255 //userPopupMenu.exec(item->mapToGlobal(QPoint(0,0))); 258 //userPopupMenu.exec(item->mapToGlobal(QPoint(0,0)));
256 qWarning("Pressed!"); 259 owarn << "Pressed!" << oendl;
257} 260}
diff --git a/noncore/settings/usermanager/usermanager.pro b/noncore/settings/usermanager/usermanager.pro
index d0647dd..31f52a6 100644
--- a/noncore/settings/usermanager/usermanager.pro
+++ b/noncore/settings/usermanager/usermanager.pro
@@ -1,10 +1,9 @@
1#CONFIG = qt warn_on 1CONFIG = qt warn_on quick-app
2CONFIG = qt warn_on quick-app
3HEADERS = usermanager.h userdialog.h groupdialog.h passwd.h 2HEADERS = usermanager.h userdialog.h groupdialog.h passwd.h
4SOURCES = usermanager.cpp userdialog.cpp groupdialog.cpp passwd.cpp main.cpp 3SOURCES = usermanager.cpp userdialog.cpp groupdialog.cpp passwd.cpp main.cpp
5INCLUDEPATH += $(OPIEDIR)/include 4INCLUDEPATH += $(OPIEDIR)/include
6DEPENDPATH += $(OPIEDIR)/include 5DEPENDPATH += $(OPIEDIR)/include
7LIBS += -lqpe -lopiecore2 -lopieui2 -lcrypt 6LIBS += -lqpe -lopiecore2 -lopieui2 -lcrypt
8TARGET = usermanager 7TARGET = usermanager
9 8
10include ( $(OPIEDIR)/include.pro ) 9include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/styles/liquid/config.in b/noncore/styles/liquid/config.in
index 23f8637..cffdb39 100644
--- a/noncore/styles/liquid/config.in
+++ b/noncore/styles/liquid/config.in
@@ -1,4 +1,4 @@
1 config LIQUID 1 config LIQUID
2 boolean "opie-liquid (Mosfet's well known Liquid GUI style from KDE)" 2 boolean "opie-liquid (Mosfet's well known Liquid GUI style from KDE)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBQTAUX 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBQTAUX && LIBOPIE2CORE
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index bac882c..51814e7 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -8,18 +8,25 @@
8 8
9 9
10#ifndef INCLUDE_MENUITEM_DEF 10#ifndef INCLUDE_MENUITEM_DEF
11#define INCLUDE_MENUITEM_DEF 11#define INCLUDE_MENUITEM_DEF
12#endif 12#endif
13 13
14#include <qmenudata.h>
15#include "liquid.h" 14#include "liquid.h"
16//#include "liquiddeco.h" 15#include "effects.h"
17#include <qapplication.h> 16#include "htmlmasks.h"
17#include "embeddata.h"
18
19/* OPIE */
20#include <opie2/odebug.h>
18#include <qpe/config.h> 21#include <qpe/config.h>
19#include "effects.h" 22using namespace Opie::Core;
23
24/* QT */
25#include <qmenudata.h>
26#include <qapplication.h>
20#include <qpalette.h> 27#include <qpalette.h>
21#include <qbitmap.h> 28#include <qbitmap.h>
22#include <qtabbar.h> 29#include <qtabbar.h>
23#include <qpopupmenu.h> 30#include <qpopupmenu.h>
24#include <qobjectlist.h> 31#include <qobjectlist.h>
25#include <qimage.h> 32#include <qimage.h>
@@ -28,23 +35,21 @@
28#include <qradiobutton.h> 35#include <qradiobutton.h>
29#include <qcombobox.h> 36#include <qcombobox.h>
30#include <qdrawutil.h> 37#include <qdrawutil.h>
31#include <qwidgetlist.h> 38#include <qwidgetlist.h>
32#include <qtoolbutton.h> 39#include <qtoolbutton.h>
33#include <qheader.h> 40#include <qheader.h>
34#include <unistd.h>
35#include <qmenubar.h> 41#include <qmenubar.h>
36#include <qprogressbar.h> 42#include <qprogressbar.h>
37#include <qlineedit.h> 43#include <qlineedit.h>
38#include <qlistbox.h> 44#include <qlistbox.h>
39 45
46/* STD */
47#include <unistd.h>
40#include <stdio.h> 48#include <stdio.h>
41 49
42#include "htmlmasks.h"
43#include "embeddata.h"
44
45 50
46typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, 51typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *,
47 QColorGroup &, bool, bool); 52 QColorGroup &, bool, bool);
48 53
49QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl); 54QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl);
50 55
@@ -146,13 +151,13 @@ bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev)
146 delete ol; 151 delete ol;
147 } 152 }
148 } 153 }
149 else if(ev->type() == QEvent::Hide){ 154 else if(ev->type() == QEvent::Hide){
150 if(type == TransStippleBg || type == TransStippleBtn || 155 if(type == TransStippleBg || type == TransStippleBtn ||
151 type == Custom){ 156 type == Custom){
152// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); 157// owarn << "Deleting menu pixmap, width " << pixDict.find(p->winId())->width() << "" << oendl;
153 158
154 pixDict.remove(p->winId()); 159 pixDict.remove(p->winId());
155 if ( !p->inherits("QPopupMenu")) 160 if ( !p->inherits("QPopupMenu"))
156 p->setBackgroundMode(QWidget::PaletteBackground); 161 p->setBackgroundMode(QWidget::PaletteBackground);
157 162
158 QObjectList *ol = p-> queryList("QWidget"); 163 QObjectList *ol = p-> queryList("QWidget");
@@ -491,13 +496,13 @@ void LiquidStyle::drawRoundButton(QPainter *painter, const QColor &c,
491QPixmap* LiquidStyle::processEmbedded(const char *label, int h, int s, int v, 496QPixmap* LiquidStyle::processEmbedded(const char *label, int h, int s, int v,
492 bool blend) 497 bool blend)
493{ 498{
494 QImage img(qembed_findImage(label)); 499 QImage img(qembed_findImage(label));
495 img.detach(); 500 img.detach();
496 if(img.isNull()){ // shouldn't happen, been tested 501 if(img.isNull()){ // shouldn't happen, been tested
497 qWarning("Invalid embedded label %s", label); 502 owarn << "Invalid embedded label " << label << "" << oendl;
498 return(NULL); 503 return(NULL);
499 } 504 }
500 if(img.depth() != 32) 505 if(img.depth() != 32)
501 img = img.convertDepth(32); 506 img = img.convertDepth(32);
502 unsigned int *data = (unsigned int *)img.bits(); 507 unsigned int *data = (unsigned int *)img.bits();
503 int total = img.width()*img.height(); 508 int total = img.width()*img.height();
@@ -857,13 +862,13 @@ void LiquidStyle::polish(QWidget *w)
857 if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ 862 if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){
858 return; 863 return;
859 } 864 }
860 865
861 if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> 866 if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())->
862 palette().active().brush(QColorGroup::Background).pixmap()){ 867 palette().active().brush(QColorGroup::Background).pixmap()){
863 qWarning("No parent pixmap for child widget %s", w->className()); 868 owarn << "No parent pixmap for child widget " << w->className() << "" << oendl;
864 return; 869 return;
865 } 870 }
866 if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) && 871 if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) &&
867 !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) { 872 !( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) {
868 if(w->backgroundMode() == QWidget::PaletteBackground || 873 if(w->backgroundMode() == QWidget::PaletteBackground ||
869 w->backgroundMode() == QWidget::PaletteButton){ 874 w->backgroundMode() == QWidget::PaletteButton){
diff --git a/noncore/styles/liquid/liquid.pro b/noncore/styles/liquid/liquid.pro
index 7fe2829..767007f 100644
--- a/noncore/styles/liquid/liquid.pro
+++ b/noncore/styles/liquid/liquid.pro
@@ -1,19 +1,19 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG = qt plugin embedded warn_on 2CONFIG = qt plugin embedded warn_on
3SOURCES = liquid.cpp \ 3SOURCES = liquid.cpp \
4 effects.cpp \ 4 effects.cpp \
5 liquidset.cpp \ 5 liquidset.cpp \
6 plugin.cpp 6 plugin.cpp
7 7
8HEADERS = liquid.h \ 8HEADERS = liquid.h \
9 effects.h \ 9 effects.h \
10 liquidset.h \ 10 liquidset.h \
11 plugin.h 11 plugin.h
12 12
13LIBS += -lqpe -lqtaux2 13LIBS += -lqpe -lqtaux2 -lopiecore2
14INCLUDEPATH += $(OPIEDIR)/include 14INCLUDEPATH += $(OPIEDIR)/include
15DESTDIR = $(OPIEDIR)/plugins/styles 15DESTDIR = $(OPIEDIR)/plugins/styles
16TARGET = liquid 16TARGET = liquid
17VERSION = 1.0.0 17VERSION = 1.0.1
18 18
19include ( $(OPIEDIR)/include.pro ) 19include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/styles/theme/othemebase.cpp b/noncore/styles/theme/othemebase.cpp
index 62b3a11..7ce4e5a 100644
--- a/noncore/styles/theme/othemebase.cpp
+++ b/noncore/styles/theme/othemebase.cpp
@@ -12,30 +12,32 @@
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17*/ 17*/
18
18#include "othemebase.h" 19#include "othemebase.h"
19#include "ogfxeffect.h" 20#include "ogfxeffect.h"
21
22/* OPIE */
23#include <opie2/odebug.h>
20#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
21//#include <kdebug.h> 25#include <qpe/config.h>
22//#include <klocale.h> 26using namespace Opie::Core;
23#include <qpe/config.h> 27
24//#include <kglobal.h> 28/* QT */
25//#include <kglobalsettings.h>
26//#include <kstddirs.h>
27#include <qfile.h> 29#include <qfile.h>
28#include <qtextstream.h> 30#include <qtextstream.h>
29#include <qdir.h> 31#include <qdir.h>
30#include <qpainter.h> 32#include <qpainter.h>
31#include <qbitmap.h> 33#include <qbitmap.h>
32#include <stdlib.h>
33#include <qstringlist.h> 34#include <qstringlist.h>
34 35
35#include <stdio.h> 36/* STD */
37#include <stdlib.h>
36 38
37 39
38template class QIntCache<OThemePixmap> 40template class QIntCache<OThemePixmap>
39; 41;
40 42
41static const char *widgetEntries[] = 43static const char *widgetEntries[] =
@@ -259,46 +261,39 @@ void OThemeBase::readConfig( Qt::GUIStyle /*style*/ )
259 cfg. setGroup ( "Appearance" ); 261 cfg. setGroup ( "Appearance" );
260 262
261 configFileName = cfg. readEntry ( "Theme", "default" ); 263 configFileName = cfg. readEntry ( "Theme", "default" );
262 } 264 }
263 Config config( configFilePath + "/themes/" + configFileName + ".themerc" , Config::File ); 265 Config config( configFilePath + "/themes/" + configFileName + ".themerc" , Config::File );
264 266
265 //printf ( "Opened config file: %s\n", ( configFilePath + "/themes/" + configFileName + ".themerc" ). ascii());
266
267 // Are we initalized? 267 // Are we initalized?
268 applyMiscResourceGroup( &config ); 268 applyMiscResourceGroup( &config );
269 for ( i = 0; i < INHERIT_ITEMS; ++i ) { 269 for ( i = 0; i < INHERIT_ITEMS; ++i ) {
270 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); 270 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames );
271 // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() );
272 } 271 }
273 for ( ; i < INHERIT_ITEMS*2; ++i ) { 272 for ( ; i < INHERIT_ITEMS*2; ++i ) {
274 if ( config.hasGroup( QString( widgetEntries[ i ] ) ) ) { 273 if ( config.hasGroup( QString( widgetEntries[ i ] ) ) ) {
275 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); 274 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames );
276 // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() );
277 } 275 }
278 else { 276 else {
279 copyfrom [ i ] = widgetEntries[ i - INHERIT_ITEMS ]; 277 copyfrom [ i ] = widgetEntries[ i - INHERIT_ITEMS ];
280 // printf ( "%d [%s]: copy=%s\n", i, widgetEntries [i], copyfrom [i].latin1());
281 } 278 }
282 } 279 }
283 for ( ; i < WIDGETS; ++i ) { 280 for ( ; i < WIDGETS; ++i ) {
284 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); 281 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames );
285 // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() );
286 } 282 }
287 283
288 // initalize defaults that may not be read 284 // initalize defaults that may not be read
289 for ( i = 0; i < WIDGETS; ++i ) 285 for ( i = 0; i < WIDGETS; ++i )
290 loaded[ i ] = false; 286 loaded[ i ] = false;
291 btnXShift = btnYShift = focus3DOffset = 0; 287 btnXShift = btnYShift = focus3DOffset = 0;
292 aTabLine = iTabLine = true; 288 aTabLine = iTabLine = true;
293 roundedButton = roundedCombo = roundedSlider = focus3D = false; 289 roundedButton = roundedCombo = roundedSlider = focus3D = false;
294 splitterWidth = 10; 290 splitterWidth = 10;
295 291
296 for ( i = 0; i < WIDGETS; ++i ) { 292 for ( i = 0; i < WIDGETS; ++i ) {
297 readResourceGroup( i, copyfrom, pixnames, brdnames, loaded ); 293 readResourceGroup( i, copyfrom, pixnames, brdnames, loaded );
298 // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s, colors=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1(), (colors[i]?colors[i]->background().name().latin1():"<none)" ));
299 } 294 }
300 295
301 // misc items 296 // misc items
302 readMiscResourceGroup(); 297 readMiscResourceGroup();
303 298
304 // Handle preblend items 299 // Handle preblend items
@@ -404,13 +399,13 @@ OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget )
404 if ( cachePix ) { 399 if ( cachePix ) {
405 cachePix = new OThemePixmap( *cachePix ); 400 cachePix = new OThemePixmap( *cachePix );
406 if ( pixmaps[ widget ] ) 401 if ( pixmaps[ widget ] )
407 cache->insert( pixmaps[ widget ], OThemeCache::FullScale, 402 cache->insert( pixmaps[ widget ], OThemeCache::FullScale,
408 widget ); 403 widget );
409 else 404 else
410 qDebug( "We would have inserted a null pixmap!\n" ); 405 odebug << "We would have inserted a null pixmap!\n" << oendl;
411 pixmaps[ widget ] = cachePix; 406 pixmaps[ widget ] = cachePix;
412 } 407 }
413 else { 408 else {
414 cache->insert( pixmaps[ widget ], OThemeCache::FullScale, widget ); 409 cache->insert( pixmaps[ widget ], OThemeCache::FullScale, widget );
415 QImage tmpImg = images[ widget ] ->smoothScale( w, h ); 410 QImage tmpImg = images[ widget ] ->smoothScale( w, h );
416 pixmaps[ widget ] = new OThemePixmap; 411 pixmaps[ widget ] = new OThemePixmap;
diff --git a/noncore/todayplugins/fortune/fortune.pro b/noncore/todayplugins/fortune/fortune.pro
index 2e4b4b3..74c60b1 100644
--- a/noncore/todayplugins/fortune/fortune.pro
+++ b/noncore/todayplugins/fortune/fortune.pro
@@ -1,8 +1,7 @@
1TEMPLATE = lib 1TEMPLATE = lib
2#CONFIG -= moc
3CONFIG += qt plugin 2CONFIG += qt plugin
4 3
5# Input 4# Input
6HEADERS = fortuneplugin.h fortunepluginimpl.h \ 5HEADERS = fortuneplugin.h fortunepluginimpl.h \
7 fortunepluginwidget.h 6 fortunepluginwidget.h
8SOURCES = fortuneplugin.cpp fortunepluginimpl.cpp \ 7SOURCES = fortuneplugin.cpp fortunepluginimpl.cpp \
diff --git a/noncore/todayplugins/fortune/fortunepluginwidget.cpp b/noncore/todayplugins/fortune/fortunepluginwidget.cpp
index c3ee546..c147567 100644
--- a/noncore/todayplugins/fortune/fortunepluginwidget.cpp
+++ b/noncore/todayplugins/fortune/fortunepluginwidget.cpp
@@ -13,24 +13,27 @@
13 * (at your option) any later version. * 13 * (at your option) any later version. *
14 * * 14 * *
15 ***************************************************************************/ 15 ***************************************************************************/
16 16
17#include "fortunepluginwidget.h" 17#include "fortunepluginwidget.h"
18 18
19/* OPIE */
20#include <opie2/odebug.h>
19#include <qpe/config.h> 21#include <qpe/config.h>
20#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
23using namespace Opie::Core;
24using namespace Opie::Ui;
21 25
26/* QT */
22#include <qvaluelist.h> 27#include <qvaluelist.h>
23#include <qtl.h> 28#include <qtl.h>
24#include <qstring.h> 29#include <qstring.h>
25#include <qscrollview.h> 30#include <qscrollview.h>
26#include <qobject.h> 31#include <qobject.h>
27#include <qlayout.h> 32#include <qlayout.h>
28 33
29using namespace Opie::Core;
30using namespace Opie::Ui;
31FortunePluginWidget::FortunePluginWidget( QWidget *parent, const char* name ) 34FortunePluginWidget::FortunePluginWidget( QWidget *parent, const char* name )
32 : QWidget( parent, name ) 35 : QWidget( parent, name )
33{ 36{
34 37
35 fortune = NULL; 38 fortune = NULL;
36 getFortune(); 39 getFortune();
@@ -64,13 +67,13 @@ void FortunePluginWidget::getFortune() {
64 *fortuneProcess << "fortune"; 67 *fortuneProcess << "fortune";
65 68
66 connect(fortuneProcess, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ), 69 connect(fortuneProcess, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ),
67 this, SLOT(slotStdOut(Opie::Core::OProcess*,char*,int) ) ); 70 this, SLOT(slotStdOut(Opie::Core::OProcess*,char*,int) ) );
68 71
69 if(!fortuneProcess->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 72 if(!fortuneProcess->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
70 qWarning("could not start :("); 73 owarn << "could not start :(" << oendl;
71 fortune->setText( QString("Failed to obtain fortune.") ); 74 fortune->setText( QString("Failed to obtain fortune.") );
72 delete fortuneProcess; 75 delete fortuneProcess;
73 fortuneProcess = 0; 76 fortuneProcess = 0;
74 } 77 }
75 78
76} 79}
diff --git a/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp b/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp
index ce35256..ae219d7 100644
--- a/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp
+++ b/noncore/todayplugins/stockticker/stockticker/inputDialog.cpp
@@ -1,27 +1,29 @@
1#include "inputDialog.h" 1#include "inputDialog.h"
2#include "helpwindow.h"
3
4/* OPIE */
5#include <opie2/odebug.h>
6#include <qpe/config.h>
7using namespace Opie::Core;
2 8
9/* QT */
3#include <qapplication.h> 10#include <qapplication.h>
4#include <qlayout.h> 11#include <qlayout.h>
5#include <qcheckbox.h> 12#include <qcheckbox.h>
6#include <qlineedit.h> 13#include <qlineedit.h>
7#include <qvariant.h> 14#include <qvariant.h>
8#include <qpushbutton.h> 15#include <qpushbutton.h>
9#include <qwhatsthis.h> 16#include <qwhatsthis.h>
10#include <qlabel.h> 17#include <qlabel.h>
11#include <qlayout.h> 18#include <qlayout.h>
12#include <qpe/config.h>
13#include <qstringlist.h> 19#include <qstringlist.h>
14using namespace Opie::Core;
15using namespace Opie::Core;
16#include <qmainwindow.h> 20#include <qmainwindow.h>
17#include "helpwindow.h"
18 21
22/* STD */
19#include <stdlib.h> 23#include <stdlib.h>
20// #include <sys/stat.h>
21// #include <unistd.h>
22 24
23InputDialog::InputDialog( ) 25InputDialog::InputDialog( )
24 : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) { 26 : QMainWindow( 0x0, 0x0, WStyle_ContextHelp ) {
25 setCaption( tr("Symbol Lookup")); 27 setCaption( tr("Symbol Lookup"));
26 28
27 QGridLayout *layout = new QGridLayout( this ); 29 QGridLayout *layout = new QGridLayout( this );
@@ -51,13 +53,13 @@ InputDialog::~InputDialog() {
51void InputDialog::doLookup() { 53void InputDialog::doLookup() {
52// http://finance.yahoo.com/l?m=&s=siemens&t= 54// http://finance.yahoo.com/l?m=&s=siemens&t=
53 55
54 QString url = "\"http://finance.yahoo.com/l?m=&s="+LineEdit1->text()+"\""; 56 QString url = "\"http://finance.yahoo.com/l?m=&s="+LineEdit1->text()+"\"";
55 QString tempHtml = "/tmp/stockticker.html"; 57 QString tempHtml = "/tmp/stockticker.html";
56 QString cmd = "wget -O "+tempHtml+" "+url; 58 QString cmd = "wget -O "+tempHtml+" "+url;
57 qDebug(cmd); 59 odebug << cmd << oendl;
58 60
59 61
60/* 62/*
61 OProcess proc; 63 OProcess proc;
62 proc << "/usr/bin/wget"; 64 proc << "/usr/bin/wget";
63 proc<<"-O"<< tempHtml<< url; 65 proc<<"-O"<< tempHtml<< url;
@@ -73,13 +75,13 @@ void InputDialog::doLookup() {
73 LineEdit1->text(); 75 LineEdit1->text();
74 76
75 77
76} 78}
77 79
78void InputDialog::showBrowser(OProcess*) { 80void InputDialog::showBrowser(OProcess*) {
79 qDebug("BLAH"); 81 odebug << "BLAH" << oendl;
80 QString tempHtml = "/tmp/stockticker.html"; 82 QString tempHtml = "/tmp/stockticker.html";
81 83
82 HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup"); 84 HelpWindow *StockLookup = new HelpWindow( tempHtml,".",this, "SymbolLookup");
83 StockLookup->setCaption("Symbol"); 85 StockLookup->setCaption("Symbol");
84 StockLookup->showMaximized(); 86 StockLookup->showMaximized();
85 StockLookup->show(); 87 StockLookup->show();
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/config.in b/noncore/todayplugins/stockticker/stocktickerlib/config.in
index 4d589f9..7dbe03a 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/config.in
+++ b/noncore/todayplugins/stockticker/stocktickerlib/config.in
@@ -1,4 +1,4 @@
1config TODAY_STOCKTICKERLIB 1config TODAY_STOCKTICKERLIB
2 boolean 2 boolean
3 default "y" if TODAY_STOCKTICKER 3 default "y" if TODAY_STOCKTICKER
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && LIBOPIE2PIM && TODAY 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI && LIBOPIE2PIM && TODAY
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro
index e70d1c0..6dcf945 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerlib.pro
@@ -1,8 +1,7 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG -= moc
3CONFIG += qt plugin 2CONFIG += qt plugin
4 3
5HEADERS = stocktickerplugin.h stocktickerpluginimpl.h stocktickerpluginwidget.h stocktickerconfig.h \ 4HEADERS = stocktickerplugin.h stocktickerpluginimpl.h stocktickerpluginwidget.h stocktickerconfig.h \
6 ../libstocks/csv.h \ 5 ../libstocks/csv.h \
7 ../libstocks/http.h \ 6 ../libstocks/http.h \
8 ../libstocks/lists.h \ 7 ../libstocks/lists.h \
@@ -17,13 +16,13 @@ SOURCES = stocktickerplugin.cpp stocktickerpluginimpl.cpp stocktickerpluginwidge
17 16
18INCLUDEPATH += $(OPIEDIR)/include \ 17INCLUDEPATH += $(OPIEDIR)/include \
19 ../ ../library 18 ../ ../library
20DEPENDPATH += $(OPIEDIR)/include \ 19DEPENDPATH += $(OPIEDIR)/include \
21 ../ ../library 20 ../ ../library
22 21
23LIBS+= -lqpe -lopieui2 -lopiepim2 -lpthread 22LIBS += -lqpe -lopiecore2 -lopieui2 -lopiepim2 -lpthread
24TMAKE_CFLAGS += -D__UNIX__ 23DEFINES += __UNIX__
25 24
26DESTDIR = $(OPIEDIR)/plugins/today 25DESTDIR = $(OPIEDIR)/plugins/today
27TARGET = todaystocktickerplugin 26TARGET = todaystocktickerplugin
28 27
29include ( $(OPIEDIR)/include.pro ) 28include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
index aaeb5ee..4855ac6 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerpluginwidget.cpp
@@ -42,13 +42,13 @@ void getStocks(char *blah) {
42 // stocktickerTicker->setText( "Downloading stock data."); 42 // stocktickerTicker->setText( "Downloading stock data.");
43 stock *stocks_quotes=NULL; 43 stock *stocks_quotes=NULL;
44 stock *stocks_tmp; 44 stock *stocks_tmp;
45 stock_liste = blah; 45 stock_liste = blah;
46 ::free ( blah ); 46 ::free ( blah );
47 // char *stock_liste = (char *)blah->latin1(); 47 // char *stock_liste = (char *)blah->latin1();
48 // qDebug("%s", stock_liste.data() ); 48 // odebug << "" << stock_liste.data() << "" << oendl;
49 output = ""; 49 output = "";
50 QString tempString; 50 QString tempString;
51 libstocks_return_code error; 51 libstocks_return_code error;
52 52
53// Config cfg( "stockticker"); 53// Config cfg( "stockticker");
54// cfg.setGroup( "Fields" ); 54// cfg.setGroup( "Fields" );
@@ -275,39 +275,39 @@ void getStocks(char *blah) {
275 void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) { 275 void StockTickerPluginWidget::timerEvent( QTimerEvent *e ) {
276 killTimer(e->timerId()); 276 killTimer(e->timerId());
277 checkConnection(); 277 checkConnection();
278 } 278 }
279 279
280 void StockTickerPluginWidget::checkConnection() { 280 void StockTickerPluginWidget::checkConnection() {
281 // qDebug("checking connection"); 281 // odebug << "checking connection" << oendl;
282 // Sock = new QSocket( this ); 282 // Sock = new QSocket( this );
283 283
284 // if( wasError) 284 // if( wasError)
285 // stocktickerTicker->setText("Checking connection"); 285 // stocktickerTicker->setText("Checking connection");
286 286
287 // if(Sock->state() == QSocket::Idle) { 287 // if(Sock->state() == QSocket::Idle) {
288 // Sock->connectToHost("finance.yahoo.com", 80); 288 // Sock->connectToHost("finance.yahoo.com", 80);
289 // connect( Sock, SIGNAL( error(int) ), SLOT(socketError(int)) ); 289 // connect( Sock, SIGNAL( error(int) ), SLOT(socketError(int)) );
290 // connect( Sock, SIGNAL( hostFound() ), SLOT(isConnected()) ); 290 // connect( Sock, SIGNAL( hostFound() ), SLOT(isConnected()) );
291 // } else { 291 // } else {
292 // qDebug("State is not Idle"); 292 // odebug << "State is not Idle" << oendl;
293 isConnected(); 293 isConnected();
294 // } 294 // }
295 } 295 }
296 296
297 void StockTickerPluginWidget::isConnected() { 297 void StockTickerPluginWidget::isConnected() {
298 // qDebug("We connect, so ok to grab stocks"); 298 // odebug << "We connect, so ok to grab stocks" << oendl;
299 if(this->isVisible()) 299 if(this->isVisible())
300 doStocks(); 300 doStocks();
301 301
302 Config cfg( "stockticker"); 302 Config cfg( "stockticker");
303 cfg.setGroup("Timer"); 303 cfg.setGroup("Timer");
304 timerDelay= cfg.readNumEntry("Delay",0); 304 timerDelay= cfg.readNumEntry("Delay",0);
305 if(timerDelay > 0) 305 if(timerDelay > 0)
306 startTimer(timerDelay*60000); 306 startTimer(timerDelay*60000);
307 // qDebug("timer set for %d",(timerDelay*60000)/60000); 307 // odebug << "timer set for " << (timerDelay*60000)/60000 << "" << oendl;
308 wasError = false; 308 wasError = false;
309 309
310 // Sock->close(); 310 // Sock->close();
311 } 311 }
312 312
313 void StockTickerPluginWidget::socketError(int errcode) { 313 void StockTickerPluginWidget::socketError(int errcode) {
diff --git a/noncore/tools/calc2/engine.cpp b/noncore/tools/calc2/engine.cpp
index a9a47c4..e843e29 100644
--- a/noncore/tools/calc2/engine.cpp
+++ b/noncore/tools/calc2/engine.cpp
@@ -98,13 +98,13 @@ void Engine::pushValue (char v)
98 default: 98 default:
99 displayString.append(v); 99 displayString.append(v);
100 num.i=displayString.toInt(&ok, calcBase()); 100 num.i=displayString.toInt(&ok, calcBase());
101 }; 101 };
102 if (!ok) { 102 if (!ok) {
103 state = sError; 103 state = sError;
104 qDebug("pushValue() - num->string conversion"); 104 odebug << "pushValue() - num->string conversion" << oendl;
105 } else { 105 } else {
106 const QString constString = displayString; 106 const QString constString = displayString;
107 emit(display(constString)); 107 emit(display(constString));
108 }; 108 };
109 109
110 } else if (state == sStart) { 110 } else if (state == sStart) {
@@ -124,35 +124,35 @@ void Engine::del ()
124 switch (currentRep) { 124 switch (currentRep) {
125 case rDouble: 125 case rDouble:
126 displayString.truncate(displayString.length()); 126 displayString.truncate(displayString.length());
127 num.dbl=displayString.toDouble(&ok); 127 num.dbl=displayString.toDouble(&ok);
128 break; 128 break;
129 case rFraction: 129 case rFraction:
130 qDebug("not available"); 130 odebug << "not available" << oendl;
131 break; 131 break;
132 default: 132 default:
133 displayString.truncate(displayString.length()); 133 displayString.truncate(displayString.length());
134 num.i = displayString.toInt(&ok, calcBase()); 134 num.i = displayString.toInt(&ok, calcBase());
135 }; 135 };
136 136
137 if (!ok) { 137 if (!ok) {
138 state = sError; 138 state = sError;
139 qDebug("del() - num->string conversion"); 139 odebug << "del() - num->string conversion" << oendl;
140 } else { 140 } else {
141 const QString constString = displayString; 141 const QString constString = displayString;
142 emit(display(constString)); 142 emit(display(constString));
143 }; 143 };
144} 144}
145 145
146void Engine::displayData(Data d) { 146void Engine::displayData(Data d) {
147 switch (currentRep) { 147 switch (currentRep) {
148 case rDouble: 148 case rDouble:
149 displayString.setNum(d.dbl); 149 displayString.setNum(d.dbl);
150 break; 150 break;
151 case rFraction: 151 case rFraction:
152 qDebug("fractional display not yet impl"); 152 odebug << "fractional display not yet impl" << oendl;
153 break; 153 break;
154 default: 154 default:
155 displayString.setNum(d.i, calcBase()); 155 displayString.setNum(d.i, calcBase());
156 break; 156 break;
157 }; 157 };
158 const QString constString= displayString; 158 const QString constString= displayString;
@@ -169,13 +169,13 @@ int Engine::calcBase () {
169 case rDec: 169 case rDec:
170 return 10; 170 return 10;
171 case rHex: 171 case rHex:
172 return 16; 172 return 16;
173 default: 173 default:
174 state = sError; 174 state = sError;
175 qDebug("Error - attempt to calc base for non-integer"); 175 odebug << "Error - attempt to calc base for non-integer" << oendl;
176 return 10; 176 return 10;
177 }; 177 };
178} 178}
179 179
180// Special instruction for internal use only 180// Special instruction for internal use only
181class iOpenBrace:public Instruction { 181class iOpenBrace:public Instruction {
diff --git a/noncore/tools/calculator/calculator.pro b/noncore/tools/calculator/calculator.pro
index ae6a666..78d4519 100644
--- a/noncore/tools/calculator/calculator.pro
+++ b/noncore/tools/calculator/calculator.pro
@@ -1,11 +1,11 @@
1 CONFIG = qt warn_on quick-app 1 CONFIG = qt warn_on quick-app
2 HEADERS = calculatorimpl.h 2 HEADERS = calculatorimpl.h
3 SOURCES = calculatorimpl.cpp \ 3 SOURCES = calculatorimpl.cpp \
4 main.cpp 4 main.cpp
5INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
6 DEPENDPATH+= $(OPIEDIR)/include 6 DEPENDPATH+= $(OPIEDIR)/include
7LIBS += -lqpe -lopiecore2 7LIBS += -lqpe -lopiecore2
8 INTERFACES= calculator.ui 8 INTERFACES= calculator.ui
9 TARGET = calculator 9 TARGET = calculator
10 10
11include ( $(OPIEDIR)/include.pro ) 11include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/tools/calculator/calculatorimpl.cpp b/noncore/tools/calculator/calculatorimpl.cpp
index dead03d..05cb9b5 100644
--- a/noncore/tools/calculator/calculatorimpl.cpp
+++ b/noncore/tools/calculator/calculatorimpl.cpp
@@ -23,26 +23,33 @@
23 * Added support for Temperature conversions. 23 * Added support for Temperature conversions.
24 */ 24 */
25// Sat 03-09-2002 L.J. Potter added the inlined pixmaps here 25// Sat 03-09-2002 L.J. Potter added the inlined pixmaps here
26 26
27#include "calculatorimpl.h" 27#include "calculatorimpl.h"
28 28
29/* OPIE */
30#include <opie2/odebug.h>
29#include <qpe/resource.h> 31#include <qpe/resource.h>
30#include <qpe/qmath.h> 32#include <qpe/qmath.h>
31#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
34using namespace Opie::Core;
32 35
36/* QT */
33#include <qpushbutton.h> 37#include <qpushbutton.h>
34#include <qcombobox.h> 38#include <qcombobox.h>
35#include <qlabel.h> 39#include <qlabel.h>
36#include <qfont.h> 40#include <qfont.h>
37#include <qlayout.h> 41#include <qlayout.h>
38#include <qstringlist.h> 42#include <qstringlist.h>
39#include <qfile.h> 43#include <qfile.h>
40#include <qtextstream.h> 44#include <qtextstream.h>
41#include <qmessagebox.h> 45#include <qmessagebox.h>
46
47/* STD */
42#include <math.h> 48#include <math.h>
49
43/* XPM */ 50/* XPM */
44static char *oneoverx_xpm[] = { 51static char *oneoverx_xpm[] = {
45/* width height num_colors chars_per_pixel */ 52/* width height num_colors chars_per_pixel */
46" 13 11 2 1", 53" 13 11 2 1",
47/* colors */ 54/* colors */
48". c None", 55". c None",
@@ -230,13 +237,13 @@ CalculatorImpl::CalculatorImpl( QWidget * parent, const char * name,
230 // now add in the conversion modes 237 // now add in the conversion modes
231 // when the menu gets done, these should be in a submenu 238 // when the menu gets done, these should be in a submenu
232 QString tmp = QPEApplication::qpeDir(); 239 QString tmp = QPEApplication::qpeDir();
233 tmp += "etc/unit_conversion.dat"; 240 tmp += "etc/unit_conversion.dat";
234 QFile myfile(tmp); 241 QFile myfile(tmp);
235 if ( !myfile.open( IO_Translate | IO_ReadOnly ) ) { 242 if ( !myfile.open( IO_Translate | IO_ReadOnly ) ) {
236 qDebug("Data file unit_conversion.dat not found\nNo conversion features will be available\n"+tmp); 243 odebug << "Data file unit_conversion.dat not found\nNo conversion features will be available\n"+tmp << oendl;
237 // disable the f button if no conv file available 244 // disable the f button if no conv file available
238 ComboBoxFunction->setEnabled(FALSE); 245 ComboBoxFunction->setEnabled(FALSE);
239 } 246 }
240 else { 247 else {
241 QString line, line2; 248 QString line, line2;
242 QTextStream ts(&myfile); 249 QTextStream ts(&myfile);
@@ -504,13 +511,13 @@ void CalculatorImpl::execOp( Operation i )
504 } 511 }
505 case oCloseBrace: { 512 case oCloseBrace: {
506 if ( numOpenBraces == 0 ) 513 if ( numOpenBraces == 0 )
507 return; 514 return;
508 processStack( oAdd ); 515 processStack( oAdd );
509 if ( operationStack.top().operation != oOpenBrace ) 516 if ( operationStack.top().operation != oOpenBrace )
510 qDebug( "Calculator: internal Error" ); 517 odebug << "Calculator: internal Error" << oendl;
511 operationStack.pop(); 518 operationStack.pop();
512 state = sNewNumber; 519 state = sNewNumber;
513 numOpenBraces--; 520 numOpenBraces--;
514 break; 521 break;
515 } 522 }
516 523
diff --git a/noncore/tools/formatter/formatter.cpp b/noncore/tools/formatter/formatter.cpp
index 4204d73..642196e 100644
--- a/noncore/tools/formatter/formatter.cpp
+++ b/noncore/tools/formatter/formatter.cpp
@@ -8,19 +8,20 @@
8 8
9#include "formatter.h" 9#include "formatter.h"
10#include "inputDialog.h" 10#include "inputDialog.h"
11#include "output.h" 11#include "output.h"
12 12
13/* OPIE */ 13/* OPIE */
14#include <qtoolbar.h> 14#include <opie2/odebug.h>
15#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/config.h> 17#include <qpe/config.h>
18#include <qpe/mimetype.h> 18#include <qpe/mimetype.h>
19#include <qpe/qcopenvelope_qws.h> 19#include <qpe/qcopenvelope_qws.h>
20#include <qpe/storage.h> 20#include <qpe/storage.h>
21using namespace Opie::Core;
21 22
22/* QT */ 23/* QT */
23#include <qmenubar.h> 24#include <qmenubar.h>
24#include <qmultilineedit.h> 25#include <qmultilineedit.h>
25#include <qstring.h> 26#include <qstring.h>
26#include <qlist.h> 27#include <qlist.h>
@@ -32,12 +33,13 @@
32#include <qpopupmenu.h> 33#include <qpopupmenu.h>
33#include <qmessagebox.h> 34#include <qmessagebox.h>
34#include <qregexp.h> 35#include <qregexp.h>
35#include <qlabel.h> 36#include <qlabel.h>
36#include <qlineedit.h> 37#include <qlineedit.h>
37#include <qpushbutton.h> 38#include <qpushbutton.h>
39#include <qtoolbar.h>
38#include <qtabwidget.h> 40#include <qtabwidget.h>
39#include <qwidget.h> 41#include <qwidget.h>
40#include <qlayout.h> 42#include <qlayout.h>
41#include <qvariant.h> 43#include <qvariant.h>
42 44
43/* STD */ 45/* STD */
@@ -235,31 +237,31 @@ void FormatterApp::doFormat()
235 237
236 238
237 outDlg->OutputEdit->append( tr("Trying to umount %1.").arg( currentText) ); 239 outDlg->OutputEdit->append( tr("Trying to umount %1.").arg( currentText) );
238 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 240 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
239 241
240 sleep(1); 242 sleep(1);
241 qDebug("Command is "+umountS); 243 odebug << "Command is "+umountS << oendl;
242 fp = popen( (const char *) umountS, "r"); 244 fp = popen( (const char *) umountS, "r");
243 // qDebug("%d", fp); 245 // odebug << "" << fp << "" << oendl;
244 if ( !fp ) 246 if ( !fp )
245 { 247 {
246 qDebug("Could not execute '" + umountS + "'! err=%d\n" +(QString)strerror(errno), err); 248 odebug << "Could not execute '" + umountS + "'! err=" << err << "\n" +(QString)strerror(errno) << oendl;
247 QMessageBox::warning( this, tr("Formatter"), tr("umount failed!"), tr("&OK") ); 249 QMessageBox::warning( this, tr("Formatter"), tr("umount failed!"), tr("&OK") );
248 pclose(fp); 250 pclose(fp);
249 return; 251 return;
250 } 252 }
251 else 253 else
252 { 254 {
253 // outDlg->OutputEdit->append( currentText + tr("\nhas been successfully umounted.")); 255 // outDlg->OutputEdit->append( currentText + tr("\nhas been successfully umounted."));
254 // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 256 // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
255 while ( fgets( line, sizeof line, fp)) 257 while ( fgets( line, sizeof line, fp))
256 { 258 {
257 if( ((QString)line).find("busy",0,TRUE) != -1) 259 if( ((QString)line).find("busy",0,TRUE) != -1)
258 { 260 {
259 qDebug("Could not find '" + umountS); 261 odebug << "Could not find '" + umountS << oendl;
260 QMessageBox::warning( this, tr("Formatter"), tr("Could not umount.\nDevice is busy!"), tr("&OK") ); 262 QMessageBox::warning( this, tr("Formatter"), tr("Could not umount.\nDevice is busy!"), tr("&OK") );
261 pclose(fp); 263 pclose(fp);
262 return; 264 return;
263 } 265 }
264 else 266 else
265 { 267 {
@@ -269,22 +271,22 @@ void FormatterApp::doFormat()
269 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 271 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
270 } 272 }
271 } 273 }
272 } 274 }
273 pclose(fp); 275 pclose(fp);
274 276
275 qDebug("Command would be: "+cmd); 277 odebug << "Command would be: "+cmd << oendl;
276 outDlg->OutputEdit->append( tr("Trying to format.") ); 278 outDlg->OutputEdit->append( tr("Trying to format.") );
277 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 279 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
278 280
279 fp = popen( (const char *) cmd, "r"); 281 fp = popen( (const char *) cmd, "r");
280 while ( fgets( line, sizeof line, fp)) 282 while ( fgets( line, sizeof line, fp))
281 { 283 {
282 if( ((QString)line).find("No such device",0,TRUE) != -1) 284 if( ((QString)line).find("No such device",0,TRUE) != -1)
283 { 285 {
284 qDebug("No such device '" + umountS); 286 odebug << "No such device '" + umountS << oendl;
285 QMessageBox::warning( this, tr("Formatter"), tr("No such device!"), tr("&OK") ); 287 QMessageBox::warning( this, tr("Formatter"), tr("No such device!"), tr("&OK") );
286 pclose(fp); 288 pclose(fp);
287 // outDlg->OutputEdit->append("No such device"); 289 // outDlg->OutputEdit->append("No such device");
288 // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 290 // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
289 return; 291 return;
290 } 292 }
@@ -302,13 +304,13 @@ void FormatterApp::doFormat()
302 304
303 outDlg->OutputEdit->append( tr("Trying to mount %1.").arg( currentText) ); 305 outDlg->OutputEdit->append( tr("Trying to mount %1.").arg( currentText) );
304 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 306 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
305 fp = popen( (const char *) remountS, "r"); 307 fp = popen( (const char *) remountS, "r");
306 if ( !fp) 308 if ( !fp)
307 { 309 {
308 qDebug("Could not execute '" + remountS + "'! err=%d\n" +(QString)strerror(errno), err); 310 odebug << "Could not execute '" + remountS + "'! err=" << err << "\n" +(QString)strerror(errno) << oendl;
309 QMessageBox::warning( this, tr("Formatter"), tr("Card mount failed!"), tr("&OK") ); 311 QMessageBox::warning( this, tr("Formatter"), tr("Card mount failed!"), tr("&OK") );
310 312
311 } 313 }
312 else 314 else
313 { 315 {
314 outDlg->OutputEdit->append(tr("%1\nhas been successfully mounted.").arg( currentText )); 316 outDlg->OutputEdit->append(tr("%1\nhas been successfully mounted.").arg( currentText ));
@@ -377,13 +379,13 @@ void FormatterApp::storageComboSelected(int index )
377 QString nameS = currentText.left( currentText.find("->",0,TRUE)); 379 QString nameS = currentText.left( currentText.find("->",0,TRUE));
378 380
379 TextLabel4->setText( tr( "Storage Type: %1").arg( nameS) ); 381 TextLabel4->setText( tr( "Storage Type: %1").arg( nameS) );
380 currentText = currentText.right( currentText.length() - currentText.find(" -> ",0,TRUE) - 4); 382 currentText = currentText.right( currentText.length() - currentText.find(" -> ",0,TRUE) - 4);
381 383
382 QString fsType = getFileSystemType((const QString &) currentText); 384 QString fsType = getFileSystemType((const QString &) currentText);
383 // qDebug(fsType); 385 // odebug << fsType << oendl;
384 for(int i = 0; i < fileSystemsCombo->count(); i++) 386 for(int i = 0; i < fileSystemsCombo->count(); i++)
385 { 387 {
386 if( fsType == fileSystemsCombo->text(i)) 388 if( fsType == fileSystemsCombo->text(i))
387 fileSystemsCombo->setCurrentItem(i); 389 fileSystemsCombo->setCurrentItem(i);
388 } 390 }
389 // deviceComboSelected(index); 391 // deviceComboSelected(index);
@@ -461,13 +463,13 @@ void FormatterApp::parsetab(const QString &fileName)
461 if( fsList.contains(filesystemType) == 0 463 if( fsList.contains(filesystemType) == 0
462 & filesystemType.find("proc",0,TRUE) == -1 464 & filesystemType.find("proc",0,TRUE) == -1
463 & filesystemType.find("cramfs",0,TRUE) == -1 465 & filesystemType.find("cramfs",0,TRUE) == -1
464 & filesystemType.find("auto",0,TRUE) == -1) 466 & filesystemType.find("auto",0,TRUE) == -1)
465 fsList << filesystemType; 467 fsList << filesystemType;
466 deviceList << deviceName; 468 deviceList << deviceName;
467 qDebug(deviceName+"::"+filesystemType); 469 odebug << deviceName+"::"+filesystemType << oendl;
468 fileSystemTypeList << deviceName+"::"+filesystemType; 470 fileSystemTypeList << deviceName+"::"+filesystemType;
469 } 471 }
470 } 472 }
471 } 473 }
472 endmntent( mntfp ); 474 endmntent( mntfp );
473 // } else if(fileName == "/etc/fstab") { 475 // } else if(fileName == "/etc/fstab") {
@@ -503,13 +505,13 @@ QString FormatterApp::getFileSystemType(const QString &currentText)
503 for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) 505 for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it )
504 { 506 {
505 QString temp = (*it); 507 QString temp = (*it);
506 if( temp.find( currentText,0,TRUE) != -1) 508 if( temp.find( currentText,0,TRUE) != -1)
507 { 509 {
508 return temp.right( temp.length() - temp.find("::",0,TRUE) - 2); 510 return temp.right( temp.length() - temp.find("::",0,TRUE) - 2);
509 // qDebug(fsType); 511 // odebug << fsType << oendl;
510 } 512 }
511 } 513 }
512 return ""; 514 return "";
513} 515}
514 516
515bool FormatterApp::doFsck() 517bool FormatterApp::doFsck()
@@ -530,13 +532,13 @@ bool FormatterApp::doFsck()
530 // selectedDevice ="/dev/fd0"; 532 // selectedDevice ="/dev/fd0";
531 533
532 // #endif 534 // #endif
533 535
534 QString fsType = getFileSystemType((const QString &)selectedDevice); 536 QString fsType = getFileSystemType((const QString &)selectedDevice);
535 QString cmd; 537 QString cmd;
536 qDebug( selectedDevice +" "+ fsType); 538 odebug << selectedDevice +" "+ fsType << oendl;
537 if(fsType == "vfat") cmd = "dosfsck -vy "; 539 if(fsType == "vfat") cmd = "dosfsck -vy ";
538 if(fsType == "ext2") cmd = "e2fsck -cpvy "; 540 if(fsType == "ext2") cmd = "e2fsck -cpvy ";
539 cmd += selectedDevice + " 2>&1"; 541 cmd += selectedDevice + " 2>&1";
540 542
541 outDlg = new Output(this, tr("Formatter Output"),FALSE); 543 outDlg = new Output(this, tr("Formatter Output"),FALSE);
542 QPEApplication::showDialog( outDlg ); 544 QPEApplication::showDialog( outDlg );
@@ -544,31 +546,31 @@ bool FormatterApp::doFsck()
544 FILE *fp; 546 FILE *fp;
545 char line[130]; 547 char line[130];
546 outDlg->OutputEdit->append( tr("Trying to umount.")); 548 outDlg->OutputEdit->append( tr("Trying to umount."));
547 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 549 outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
548 550
549 sleep(1); 551 sleep(1);
550 // qDebug("Command is "+umountS); 552 // odebug << "Command is "+umountS << oendl;
551 fp = popen( (const char *) umountS, "r"); 553 fp = popen( (const char *) umountS, "r");
552 // qDebug("%d", fp); 554 // odebug << "" << fp << "" << oendl;
553 if ( !fp ) 555 if ( !fp )
554 { 556 {
555 qDebug("Could not execute '" + umountS + "'!\n" +(QString)strerror(errno)); 557 odebug << "Could not execute '" + umountS + "'!\n" +(QString)strerror(errno) << oendl;
556 QMessageBox::warning( this, tr("Formatter"), tr("umount failed!"), tr("&OK") ); 558 QMessageBox::warning( this, tr("Formatter"), tr("umount failed!"), tr("&OK") );
557 pclose(fp); 559 pclose(fp);
558 return false; 560 return false;
559 } 561 }
560 else 562 else
561 { 563 {
562 // outDlg->OutputEdit->append( currentText + tr("\nhas been successfully umounted.")); 564 // outDlg->OutputEdit->append( currentText + tr("\nhas been successfully umounted."));
563 // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 565 // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
564 while ( fgets( line, sizeof line, fp)) 566 while ( fgets( line, sizeof line, fp))
565 { 567 {
566 if( ((QString)line).find("busy",0,TRUE) != -1) 568 if( ((QString)line).find("busy",0,TRUE) != -1)
567 { 569 {
568 qDebug("Could not find '" + umountS); 570 odebug << "Could not find '" + umountS << oendl;
569 QMessageBox::warning( this, tr("Formatter"), 571 QMessageBox::warning( this, tr("Formatter"),
570 tr("Could not umount.\nDevice is busy!"), tr("&OK") ); 572 tr("Could not umount.\nDevice is busy!"), tr("&OK") );
571 pclose(fp); 573 pclose(fp);
572 return false; 574 return false;
573 } 575 }
574 else 576 else
@@ -584,13 +586,13 @@ bool FormatterApp::doFsck()
584 ///////////////////////////////////// 586 /////////////////////////////////////
585 fp = popen( (const char *) cmd, "r"); 587 fp = popen( (const char *) cmd, "r");
586 while ( fgets( line, sizeof line, fp)) 588 while ( fgets( line, sizeof line, fp))
587 { 589 {
588 if( ((QString)line).find("No such device",0,TRUE) != -1) 590 if( ((QString)line).find("No such device",0,TRUE) != -1)
589 { 591 {
590 qDebug("No such device '" + umountS); 592 odebug << "No such device '" + umountS << oendl;
591 QMessageBox::warning( this, tr("Formatter"), tr("No such device!"), tr("&OK") ); 593 QMessageBox::warning( this, tr("Formatter"), tr("No such device!"), tr("&OK") );
592 pclose(fp); 594 pclose(fp);
593 // outDlg->OutputEdit->append("No such device"); 595 // outDlg->OutputEdit->append("No such device");
594 // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); 596 // outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE);
595 return false; 597 return false;
596 } 598 }
diff --git a/noncore/tools/formatter/formatter.pro b/noncore/tools/formatter/formatter.pro
index 913cca8..f6d34c7 100644
--- a/noncore/tools/formatter/formatter.pro
+++ b/noncore/tools/formatter/formatter.pro
@@ -1,9 +1,9 @@
1CONFIG += qt warn_on quick-app 1CONFIG += qt warn_on quick-app
2HEADERS = formatter.h inputDialog.h output.h 2HEADERS = formatter.h inputDialog.h output.h
3SOURCES = formatter.cpp inputDialog.cpp output.cpp main.cpp 3SOURCES = formatter.cpp inputDialog.cpp output.cpp main.cpp
4TARGET = formatter 4TARGET = formatter
5INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
6DEPENDPATH += $(OPIEDIR)/include 6DEPENDPATH += $(OPIEDIR)/include
7LIBS += -lqpe -lopiecore2 7LIBS += -lqpe -lopiecore2
8 8
9include ( $(OPIEDIR)/include.pro ) 9include ( $(OPIEDIR)/include.pro )