-rw-r--r-- | noncore/applets/autorotateapplet/autorotate.cpp | 10 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/swapfile.cpp | 21 | ||||
-rw-r--r-- | noncore/applets/networkapplet/networkapplet.cpp | 16 | ||||
-rw-r--r-- | noncore/applets/notesapplet/config.in | 2 | ||||
-rw-r--r-- | noncore/applets/notesapplet/notes.cpp | 54 | ||||
-rw-r--r-- | noncore/applets/notesapplet/notesapplet.pro | 18 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.cpp | 44 | ||||
-rw-r--r-- | noncore/applets/zkbapplet/zkbwidget.cpp | 2 |
8 files changed, 89 insertions, 78 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 @@ -12,18 +12,18 @@ #include "autorotate.h" /* OPIE */ -#include <opie2/odevice.h> +#include <opie2/odebug.h> #include <opie2/otaskbarapplet.h> #include <qpe/applnk.h> #include <qpe/config.h> #include <qpe/resource.h> +using namespace Opie::Core; /* QT */ #include <qpainter.h> -using namespace Opie::Ui; AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) { setFixedWidth( AppLnk::smallIconSize() ); setFixedHeight( AppLnk::smallIconSize() ); @@ -86,12 +86,12 @@ bool AutoRotate::isRotateEnabled() bool res = cfg.readBoolEntry( "rotateEnabled" ); if (res ) - qDebug("Enabled"); + odebug << "Enabled" << oendl; else - qDebug("Disabled"); + odebug << "Disabled" << oendl; return res; } -EXPORT_OPIE_APPLET_v1( AutoRotate ) +EXPORT_OPIE_APPLET_v1( AutoRotate ) 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 @@ -19,8 +19,14 @@ **********************************************************************/ #include "swapfile.h" +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/resource.h> +using namespace Opie::Core; + +/* QT */ #include <qfile.h> #include <qtextstream.h> #include <qlabel.h> #include <qtimer.h> @@ -33,15 +39,14 @@ #include <qcombobox.h> #include <qvgroupbox.h> #include <qhbox.h> #include <qmessagebox.h> +#include <qcopchannel_qws.h> + +/* STD */ #include <stdio.h> #include <stdlib.h> #include <string.h> - -#include <qcopchannel_qws.h> -#include <qpe/resource.h> - #include <unistd.h> #include <fcntl.h> #include <sys/vfs.h> #include <mntent.h> @@ -53,13 +58,13 @@ Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) { // are we running as root? isRoot = geteuid() == 0; - QVBoxLayout* vb = new QVBoxLayout(this, 5); + QVBoxLayout* vb = new QVBoxLayout(this, 5); QHButtonGroup* cfsdRBG = new QHButtonGroup(tr("Swapfile location"), this); cfsdRBG->setRadioButtonExclusive(true); - vb->addWidget(cfsdRBG); + vb->addWidget(cfsdRBG); ramRB = new QRadioButton(tr("RAM"), cfsdRBG); cfRB = new QRadioButton(tr("CF Card"), cfsdRBG); sdRB = new QRadioButton(tr("SD Card"), cfsdRBG); @@ -74,9 +79,9 @@ Swapfile::Swapfile( QWidget *parent, const char *name, WFlags f ) QPushButton* swapOff = new QPushButton(tr(" Off "), hb1); vb->addWidget(hb1); QVGroupBox* box1 = new QVGroupBox(tr("Manage Swapfile"), this); - vb->addWidget(box1); + vb->addWidget(box1); QHBox *hb2 = new QHBox(box1); hb2->setSpacing(5); QPushButton* mkSwap = new QPushButton(tr("Generate"), hb2); @@ -212,9 +217,9 @@ void Swapfile::getStatusPcmcia() } } } else { // no file found - qDebug("no file found"); + odebug << "no file found" << oendl; cardInPcmcia0 = FALSE; cardInPcmcia1 = FALSE; } Swapfile::cfsdchecked(); 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 @@ -35,19 +35,21 @@ #include <opie2/onetwork.h> #include <opie2/otaskbarapplet.h> #include <qpe/applnk.h> #include <qpe/resource.h> -#include <qpainter.h> +using namespace Opie::Core; +using namespace Opie::Ui; +using namespace Opie::Net; /* QT */ +#include <qpainter.h> #include <qlabel.h> #include <qlayout.h> #include <qobjectlist.h> +/* STD */ #include <assert.h> -using namespace Opie::Ui; -using namespace Opie::Net; IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name ) :QToolButton( parent, name ) { _iface = ONetwork::instance()->interface( name ); @@ -166,17 +168,17 @@ QString NetworkAppletControl::guessDevice( ONetworkInterface* iface ) void NetworkAppletControl::showEvent( QShowEvent* e ) { - qDebug( "showEvent" ); + odebug << "showEvent" << oendl; build(); QWidget::showEvent( e ); } void NetworkAppletControl::hideEvent( QHideEvent* e ) { - qDebug( "hideEvent" ); + odebug << "hideEvent" << oendl; QWidget::hideEvent( e ); delete l; @@ -191,9 +193,9 @@ void NetworkAppletControl::hideEvent( QHideEvent* e ) } list = const_cast<QObjectList*>( children() ); if ( list ) - qWarning( "D'oh! We still have %d children...", list->count() ); + owarn << "D'oh! We still have " << list->count() << " children..." << oendl; // renew layout l = new QVBoxLayout( this, 4, 2 ); resize( 0, 0 ); @@ -202,9 +204,9 @@ void NetworkAppletControl::hideEvent( QHideEvent* e ) QSize NetworkAppletControl::sizeHint() const { ONetwork::instance()->synchronize(); // rebuild interface database - qDebug( "sizeHint (#ifaces=%d)", ONetwork::instance()->count() ); + odebug << "sizeHint (#ifaces=" << ONetwork::instance()->count() << ")" << oendl; return QSize( 14+35+105+14 + 8, ONetwork::instance()->count() * 26 ); } 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 @@ config NOTESAPPLET boolean "opie-notesapplet (quick note taking applet)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) + 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 @@ -14,27 +14,26 @@ **********************************************************************/ #include "notes.h" -#include <qapplication.h> -#include <stdlib.h> -#include <qstringlist.h> - +/* OPIE */ +#include <opie2/odebug.h> #include <opie2/otaskbarapplet.h> #include <qpe/filemanager.h> #include <qpe/qpeapplication.h> #include <qpe/timestring.h> #include <qpe/applnk.h> #include <qpe/ir.h> #include <qpe/config.h> +using namespace Opie::Core; +using namespace Opie::Ui; -// #include <qsocket.h> -// #include <qclipboard.h> +/* QT */ #include <qmultilineedit.h> #include <qlistbox.h> #include <qpopupmenu.h> #include <qmessagebox.h> - +#include <qapplication.h> #include <qdir.h> #include <qfile.h> #include <qpoint.h> #include <qpushbutton.h> @@ -42,12 +41,15 @@ #include <qlayout.h> #include <qframe.h> #include <qpixmap.h> #include <qstring.h> +#include <qstringlist.h> #include <qtimer.h> +/* STD */ +#include <stdlib.h> + /* XPM */ -using namespace Opie::Ui; static char * notes_xpm[] = { "16 16 11 1", " c None", ". c #000000", @@ -83,11 +85,11 @@ NotesControl::NotesControl( QWidget *, const char * ) // : QFrame( parent, name, WDestructiveClose | WStyle_StaysOnTop | WType_Popup ) { QDir d( QDir::homeDirPath()+"/notes"); if( !d.exists()) { - qDebug("make dir"); + odebug << "make dir" << oendl; if(!d.mkdir( QDir::homeDirPath()+"/notes", true)) - qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed"); + odebug << "<<<<<<<<<<<<<<<<<<<<<<<<<<<make dir failed" << oendl; } Config cfg("Notes"); cfg.setGroup("Options"); showMax = cfg.readBoolEntry("ShowMax", false); @@ -164,9 +166,9 @@ void NotesControl::slotDeleteButtonClicked() { void NotesControl::slotDeleteButton() { QString selectedText = box->currentText(); - qDebug("deleting "+selectedText); + odebug << "deleting "+selectedText << oendl; if( !selectedText.isEmpty()) { Config cfg("Notes"); @@ -175,14 +177,14 @@ void NotesControl::slotDeleteButton() { QString entryName, entryName2;; for ( int i = 0; i < noOfFiles; i++ ) { entryName.sprintf( "File%i", i + 1 ); if(selectedText == cfg.readEntry( entryName )) { - qDebug("removing %s, %d", selectedText.latin1(), i); + odebug << "removing " << selectedText.latin1() << ", " << i << "" << oendl; for ( int j = i; j < noOfFiles; j++ ) { entryName.sprintf( "File%i", i + 1 ); entryName2.sprintf( "File%i", i + 2 ); QString temp = cfg.readEntry(entryName2); - qDebug("move "+temp); + odebug << "move "+temp << oendl; cfg.writeEntry(entryName, temp); i++; } cfg.writeEntry("NumberOfFiles", noOfFiles-1 ); @@ -191,12 +193,12 @@ void NotesControl::slotDeleteButton() { cfg.write(); DocLnk nf(selectedText); nf.removeFiles(); QString fi=QPEApplication::documentDir()+"/text/plain/"+selectedText+".desktop"; - qDebug(fi); + odebug << fi << oendl; QFile f( fi); - if( !f.remove()) qDebug(".desktop file not removed"); + if( !f.remove()) odebug << ".desktop file not removed" << oendl; } } view->clear(); @@ -282,9 +284,9 @@ void NotesControl::focusOutEvent ( QFocusEvent * e) { void NotesControl::save() { Config cfg("Notes"); cfg.setGroup("Docs"); if( edited) { -// qDebug("is edited"); +// odebug << "is edited" << oendl; QString rt = view->text(); if( rt.length()>1) { QString pt = rt.simplifyWhiteSpace(); int i = pt.find( ' ', pt.find( ' ' )+2 ); @@ -300,9 +302,9 @@ void NotesControl::save() { if ( docname.length() > 40 ) docname = docname.left(40); if ( docname.isEmpty() ) docname = "Empty Text"; -// qDebug(docname); +// odebug << docname << oendl; if( oldDocName != docname) { int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); QString entryName; @@ -311,13 +313,13 @@ void NotesControl::save() { cfg.writeEntry("NumberOfFiles", noOfFiles+1 ); cfg.write(); } // else -// qDebug("oldname equals docname"); +// odebug << "oldname equals docname" << oendl; doc = new DocLnk(docname); if(QFile(doc->linkFile()).exists()) - qDebug("puppie"); + odebug << "puppie" << oendl; doc->setType("text/plain"); doc->setName(docname); QString temp = docname.replace( QRegExp(" "), "_" ); doc->setFile( QDir::homeDirPath()+"/notes/"+temp); @@ -326,9 +328,9 @@ void NotesControl::save() { } oldDocName=docname; edited=false; -// qDebug("save"); +// odebug << "save" << oendl; if (doPopulate) populateBox(); } cfg.writeEntry( "LastDoc",oldDocName ); @@ -338,9 +340,9 @@ void NotesControl::save() { } void NotesControl::populateBox() { box->clear(); -// qDebug("populate"); +// odebug << "populate" << oendl; Config cfg("Notes"); cfg.setGroup("Docs"); int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); QStringList list; @@ -373,9 +375,9 @@ void NotesControl::load() { } } void NotesControl::load(const QString & file) { - qDebug("loading "+file); + odebug << "loading "+file << oendl; QString name = file; QString temp; if( !QFile( QDir::homeDirPath()+"/"+file).exists() ) temp = QDir::homeDirPath()+"/notes/"+ name.replace( QRegExp(" "), "_" ); @@ -400,9 +402,9 @@ void NotesControl::load(const QString & file) { void NotesControl::loadDoc( const DocLnk &f) { FileManager fm; QString txt; if ( !fm.loadFile( f, txt ) ) { - qDebug("could not load file "+f.file()); + odebug << "could not load file "+f.file() << oendl; return; } view->setText(txt); } @@ -434,9 +436,9 @@ void NotesControl::slotSearch() { // switch ( e->state() ) { // case ControlButton: // if(e->key() == Key_C) { //copy -// qDebug("copy"); +// odebug << "copy" << oendl; // QClipboard *cb = QApplication::clipboard(); // QString text; // // Copy text from the clipboard (paste) @@ -481,12 +483,12 @@ void NotesApplet::mousePressEvent( QMouseEvent *) { } else { // vc = new NotesControl; // QPoint curPos = mapToGlobal( rect().topLeft() ); if(vc->showMax) { - qDebug("show max"); + odebug << "show max" << oendl; vc->showMaximized(); } else { - qDebug("no show max"); + odebug << "no show max" << oendl; QWidget *wid = QPEApplication::desktop(); QRect rect = QApplication::desktop()->geometry(); vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180); vc->move ( (rect.center()/2) - (vc->rect().center()/2)); 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 @@ -TEMPLATE = lib -CONFIG += qt plugin warn_on -HEADERS = notes.h -SOURCES = notes.cpp -TARGET = notesapplet -DESTDIR = $(OPIEDIR)/plugins/applets +TEMPLATE = lib +CONFIG += qt plugin warn_on +HEADERS = notes.h +SOURCES = notes.cpp +TARGET = notesapplet +DESTDIR = $(OPIEDIR)/plugins/applets INCLUDEPATH += $(OPIEDIR)/include -DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -VERSION = 1.0.0 +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lqpe -lopiecore2 +VERSION = 1.0.1 include ( $(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 @@ -15,12 +15,16 @@ #include "mgraph.h" #include "advancedconfig.h" /* OPIE */ +#include <opie2/odebug.h> #include <opie2/onetwork.h> #include <opie2/otaskbarapplet.h> #include <qpe/config.h> #include <qpe/qpeapplication.h> +using namespace Opie::Core; +using namespace Opie::Ui; +using namespace Opie::Net; /* QT */ #include <qradiobutton.h> #include <qpushbutton.h> @@ -42,10 +46,8 @@ //#define MDEBUG #undef MDEBUG -using namespace Opie::Ui; -using namespace Opie::Net; WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) { @@ -206,25 +208,25 @@ void WirelessApplet::checkInterface() if ( interface ) { #ifdef MDEBUG - qDebug( "WIFIAPPLET: using interface '%s'", ( const char* ) interface->name() ); + odebug << "WIFIAPPLET: using interface '" << ( const char* ) interface->name() << "'" << oendl; #endif } else { #ifdef MDEBUG - qDebug( "WIFIAPPLET: D'oh! No Wireless interface present... :(" ); + odebug << "WIFIAPPLET: D'oh! No Wireless interface present... :(" << oendl; #endif hide(); } } void WirelessApplet::renewDHCP() { #ifdef MDEBUG - qDebug( "WIFIAPPLET: Going to request a DHCP configuration renew." ); + odebug << "WIFIAPPLET: Going to request a DHCP configuration renew." << oendl; #endif QString pidfile; if ( !interface ) @@ -234,9 +236,9 @@ void WirelessApplet::renewDHCP() // At first we are trying dhcpcd pidfile.sprintf( "/var/run/dhcpcd-%s.pid", ( const char* ) ifacename ); #ifdef MDEBUG - qDebug( "WIFIAPPLET: dhcpcd pidfile is '%s'", ( const char* ) pidfile ); + odebug << "WIFIAPPLET: dhcpcd pidfile is '" << ( const char* ) pidfile << "'" << oendl; #endif int pid; QFile pfile( pidfile ); bool hasFile = pfile.open( IO_ReadOnly ); @@ -244,30 +246,30 @@ void WirelessApplet::renewDHCP() if ( hasFile ) { s >> pid; #ifdef MDEBUG - qDebug( "WIFIAPPLET: sent SIGALARM to pid %d", pid ); + odebug << "WIFIAPPLET: sent SIGALARM to pid " << pid << "" << oendl; #endif kill( pid, SIGALRM ); return ; } // No dhcpcd, so we are trying udhcpc #ifdef MDEBUG - qDebug( "WIFIAPPLET: dhcpcd not available." ); + odebug << "WIFIAPPLET: dhcpcd not available." << oendl; #endif pidfile.sprintf( "/var/run/udhcpc.%s.pid", ( const char* ) ifacename ); #ifdef MDEBUG - qDebug( "WIFIAPPLET: udhcpc pidfile is '%s'", ( const char* ) pidfile ); + odebug << "WIFIAPPLET: udhcpc pidfile is '" << ( const char* ) pidfile << "'" << oendl; #endif QFile pfile2( pidfile ); hasFile = pfile2.open( IO_ReadOnly ); QTextStream s2( &pfile2 ); if ( hasFile ) { s2 >> pid; #ifdef MDEBUG - qDebug( "WIFIAPPLET: sent SIGUSR1 to pid %d", pid ); + odebug << "WIFIAPPLET: sent SIGUSR1 to pid " << pid << "" << oendl; #endif kill( pid, SIGUSR1 ); return ; } @@ -302,16 +304,16 @@ WirelessApplet::~WirelessApplet() void WirelessApplet::timerEvent( QTimerEvent* ) { #ifdef MDEBUG - qDebug( "WirelessApplet::timerEvent" ); + odebug << "WirelessApplet::timerEvent" << oendl; #endif if ( interface ) { if ( !ONetwork::instance()->isPresent( (const char*) interface->name() ) ) { #ifdef MDEBUG - qDebug( "WIFIAPPLET: Interface no longer present." ); + odebug << "WIFIAPPLET: Interface no longer present." << oendl; #endif interface = 0L; mustRepaint(); return; @@ -319,9 +321,9 @@ void WirelessApplet::timerEvent( QTimerEvent* ) if ( mustRepaint() ) { #ifdef MDEBUG - qDebug( "WIFIAPPLET: A value has changed -> repainting." ); + odebug << "WIFIAPPLET: A value has changed -> repainting." << oendl; #endif repaint(); } @@ -355,16 +357,16 @@ bool WirelessApplet::mustRepaint() oldiface = interface; if ( interface ) { #ifdef MDEBUG - qDebug( "WIFIAPPLET: We had no interface but now we have one! :-)" ); + odebug << "WIFIAPPLET: We had no interface but now we have one! :-)" << oendl; #endif show(); } else { #ifdef MDEBUG - qDebug( "WIFIAPPLET: We had a interface but now we don't have one! ;-(" ); + odebug << "WIFIAPPLET: We had a interface but now we don't have one! ;-(" << oendl; #endif hide(); return true; } @@ -394,30 +396,30 @@ bool WirelessApplet::mustRepaint() if ( rocESSID && ( oldESSID != interface->SSID() ) ) { #ifdef MDEBUG - qDebug( "WIFIAPPLET: ESSID has changed." ); + odebug << "WIFIAPPLET: ESSID has changed." << oendl; #endif renewDHCP(); } else if ( rocFREQ && ( oldFREQ != interface->frequency() ) ) { #ifdef MDEBUG - qDebug( "WIFIAPPLET: FREQ has changed." ); + odebug << "WIFIAPPLET: FREQ has changed." << oendl; #endif renewDHCP(); } else if ( rocAP && ( oldAP != interface->associatedAP().toString() ) ) { #ifdef MDEBUG - qDebug( "WIFIAPPLET: AP has changed." ); + odebug << "WIFIAPPLET: AP has changed." << oendl; #endif renewDHCP(); } else if ( rocMODE && ( oldMODE != interface->mode() ) ) { #ifdef MDEBUG - qDebug( "WIFIAPPLET: MODE has changed." ); + odebug << "WIFIAPPLET: MODE has changed." << oendl; #endif renewDHCP(); } @@ -449,9 +451,9 @@ void WirelessApplet::updatePopupWindow() int WirelessApplet::numberOfRings() { if ( !interface ) return -1; int qualityH = interface->signalStrength(); - qDebug( "quality = %d", qualityH ); + odebug << "quality = " << qualityH << "" << oendl; if ( qualityH < 1 ) return -1; if ( qualityH < 20 ) return 0; if ( qualityH < 40 ) return 1; if ( qualityH < 60 ) return 2; @@ -480,9 +482,9 @@ void WirelessApplet::paintEvent( QPaintEvent* ) p.drawLine( w/2+m+m, h/2-m-m, w/2-m-m, h/2+m+m ); return; } - qDebug( "WirelessApplet: painting %d rings", rings ); + odebug << "WirelessApplet: painting " << rings << " rings" << oendl; int radius = 2; int rstep = 4; int maxrings = w/rstep; 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 @@ -93,9 +93,9 @@ QSize ZkbWidget::sizeHint() const { return QSize(AppLnk::smallIconSize(),AppLnk::smallIconSize()); } void ZkbWidget::stateChanged(const QString& s) { -// qDebug("stateChanged: %s\n", (const char*) s.utf8()); +// odebug << "stateChanged: " << (const char*) s.utf8() << "\n" << oendl; setText(s); } void ZkbWidget::labelChanged(int id) { |