summaryrefslogtreecommitdiff
path: root/core/apps
Side-by-side diff
Diffstat (limited to 'core/apps') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/helpbrowser/helpbrowser.cpp11
-rw-r--r--core/apps/taboapp/main.cpp20
-rw-r--r--core/apps/textedit/filePermissions.cpp2
-rw-r--r--core/apps/textedit/textedit.cpp77
4 files changed, 59 insertions, 51 deletions
diff --git a/core/apps/helpbrowser/helpbrowser.cpp b/core/apps/helpbrowser/helpbrowser.cpp
index 336d9fb..cbb4059 100644
--- a/core/apps/helpbrowser/helpbrowser.cpp
+++ b/core/apps/helpbrowser/helpbrowser.cpp
@@ -20,22 +20,23 @@
#define QTOPIA_INTERNAL_LANGLIST
#include "helpbrowser.h"
+#include "magictextbrowser.h"
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
+using namespace Opie::Core;
+/* QT */
#include <qmenubar.h>
#include <qtoolbar.h>
#include <qpe/qcopenvelope_qws.h>
#include <qfileinfo.h>
#include <qaction.h>
-#include <cctype>
-
-#include "magictextbrowser.h"
-
HelpBrowser::HelpBrowser( QWidget* parent, const char *name, WFlags f )
: QMainWindow( parent, name, f ),
selectedURL()
{
@@ -116,9 +117,9 @@ void HelpBrowser::init( const QString& _home )
}
void HelpBrowser::appMessage(const QCString& msg, const QByteArray& data)
{
- qDebug("reached appMessage");
+ odebug << "reached appMessage" << oendl;
if ( msg == "showFile(QString)" ) {
QDataStream ds(data,IO_ReadOnly);
QString fn;
ds >> fn;
diff --git a/core/apps/taboapp/main.cpp b/core/apps/taboapp/main.cpp
index e46c71f..e43f118 100644
--- a/core/apps/taboapp/main.cpp
+++ b/core/apps/taboapp/main.cpp
@@ -1,18 +1,22 @@
-#include <qdir.h>
-
-#include <qpe/qpeapplication.h>
-#include <qpe/qlibrary.h>
+/* OPIE */
#include <oappinterface.h>
#include <oappplugin.h>
-
+#include <opie2/odebug.h>
#include <opie2/otabwidget.h>
+#include <qpe/qpeapplication.h>
+#include <qpe/qlibrary.h>
+using namespace Opie::Core;
+using namespace Opie::Ui;
+
+/* QT */
+#include <qdir.h>
int main( int argc, char **argv )
{
QPEApplication a( argc, argv );
- Opie::Ui::OTabWidget *tabwidget = new Opie::Ui::OTabWidget(0, "tab widget");
+ OTabWidget *tabwidget = new OTabWidget(0, "tab widget");
QString path = QPEApplication::qpeDir() + "/plugins/app";
QDir dir( path, "lib*.so" );
@@ -22,11 +26,11 @@ int main( int argc, char **argv )
QInterfacePtr<OAppInterface> iface;
for ( it = list.begin(); it != list.end(); ++it ) {
QLibrary *lib = new QLibrary( path + "/" + *it );
- qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
+ odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl;
if ( lib->queryInterface( IID_OAppInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
- qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() );
+ odebug << "accepted: " << QString( path + "/" + *it ) << "" << oendl;
QList<QWidget> list = iface->widgets();
QWidget *widget;
for ( widget = list.first(); widget != 0; widget = list.next() )
diff --git a/core/apps/textedit/filePermissions.cpp b/core/apps/textedit/filePermissions.cpp
index db353a9..a059dce 100644
--- a/core/apps/textedit/filePermissions.cpp
+++ b/core/apps/textedit/filePermissions.cpp
@@ -31,9 +31,9 @@ filePermissions::filePermissions( QWidget* parent, const char* name, bool modal
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( tr("File Permissions") );
-// qDebug("FilePermissions "+fileName);
+// odebug << "FilePermissions "+fileName << oendl;
resize( 236, 210 );
setMaximumSize( QSize( 236, 210 ) );
setCaption( tr( "Set File Permissions" ) );
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp
index 5bb65a9..c9178a5 100644
--- a/core/apps/textedit/textedit.cpp
+++ b/core/apps/textedit/textedit.cpp
@@ -10,38 +10,41 @@
** packaging of this file.
**
**********************************************************************/
// changes added by L. J. Potter Sun 02-17-2002 21:31:31
+
#include "textedit.h"
#include "filePermissions.h"
-
+/* OPIE */
+#include <opie2/odebug.h>
#include <opie2/ofileselector.h>
#include <opie2/ofiledialog.h>
#include <opie2/ofontselector.h>
-
#include <qpe/resource.h>
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
+using namespace Opie::Core;
+using namespace Opie::Ui;
+
+/* QT */
#include <qmenubar.h>
#include <qtoolbar.h>
-
#include <qtextstream.h>
#include <qclipboard.h>
#include <qaction.h>
#include <qlineedit.h>
#include <qmessagebox.h>
#include <qlayout.h>
#include <qtimer.h>
#include <qdir.h>
+
+/* STD */
#include <unistd.h>
#include <sys/stat.h>
#include <stdlib.h> //getenv
-using namespace Opie::Ui;
-
#if QT_VERSION < 300
-
class QpeEditor : public QMultiLineEdit
{
public:
@@ -410,9 +413,9 @@ TextEdit::TextEdit( QWidget *parent, const char *name, WFlags f )
viewSelection = cfg.readNumEntry( "FileView", 0 );
}
TextEdit::~TextEdit() {
- qWarning("textedit d'tor");
+ owarn << "textedit d'tor" << oendl;
delete editor;
}
void TextEdit::closeEvent(QCloseEvent *) {
@@ -645,18 +648,18 @@ void TextEdit::newFile( const DocLnk &f ) {
setWState (WState_Reserved1 );
editor->setFocus();
doc = new DocLnk(nf);
currentFileName = "Unnamed";
- qDebug("newFile "+currentFileName);
+ odebug << "newFile "+currentFileName << oendl;
updateCaption( currentFileName);
// editor->setEdited( false);
}
void TextEdit::openDotFile( const QString &f ) {
if(!currentFileName.isEmpty()) {
currentFileName=f;
- qDebug("openFile dotfile " + currentFileName);
+ odebug << "openFile dotfile " + currentFileName << oendl;
QString txt;
QFile file(f);
file.open(IO_ReadWrite);
QTextStream t(&file);
@@ -673,9 +676,9 @@ void TextEdit::openDotFile( const QString &f ) {
updateCaption( currentFileName);
}
void TextEdit::openFile( const QString &f ) {
- qDebug("filename is "+ f);
+ odebug << "filename is "+ f << oendl;
QString filer;
QFileInfo fi( f);
// bFromDocView = true;
if(f.find(".desktop",0,true) != -1 && !openDesktop )
@@ -692,9 +695,9 @@ void TextEdit::openFile( const QString &f ) {
};
}
else if(fi.baseName().left(1) == "")
{
- qDebug("opening dotfile");
+ odebug << "opening dotfile" << oendl;
currentFileName=f;
openDotFile(currentFileName);
return;
}
@@ -720,9 +723,9 @@ void TextEdit::openFile( const QString &f ) {
nf.setName(fi.baseName());
openFile(nf);
- qDebug("openFile string "+currentFileName);
+ odebug << "openFile string "+currentFileName << oendl;
showEditTools();
// Show filename in caption
QString name = filer;
@@ -737,12 +740,12 @@ void TextEdit::openFile( const DocLnk &f ) {
// bFromDocView = true;
FileManager fm;
QString txt;
currentFileName=f.file();
- qDebug("openFile doclnk " + currentFileName);
+ odebug << "openFile doclnk " + currentFileName << oendl;
if ( !fm.loadFile( f, txt ) ) {
// ####### could be a new file
- qDebug( "Cannot open file" );
+ odebug << "Cannot open file" << oendl;
}
// fileNew();
if ( doc )
delete doc;
@@ -769,25 +772,25 @@ void TextEdit::showEditTools() {
/*!
unprompted save */
bool TextEdit::save() {
- qDebug("saveAsFile " + currentFileName);
+ odebug << "saveAsFile " + currentFileName << oendl;
if(currentFileName.isEmpty()) {
saveAs();
return false;
}
QString file = doc->file();
- qDebug("saver file "+file);
+ odebug << "saver file "+file << oendl;
QString name= doc->name();
- qDebug("File named "+name);
+ odebug << "File named "+name << oendl;
QString rt = editor->text();
if( !rt.isEmpty() ) {
if(name.isEmpty()) {
saveAs();
} else {
currentFileName= name ;
- qDebug("saveFile "+currentFileName);
+ odebug << "saveFile "+currentFileName << oendl;
struct stat buf;
mode_t mode;
stat(file.latin1(), &buf);
@@ -800,9 +803,9 @@ bool TextEdit::save() {
QMessageBox::message(tr("Text Edit"),tr("Save Failed"));
return false;
}
} else {
- qDebug("regular save file");
+ odebug << "regular save file" << oendl;
QFile f(file);
if( f.open(IO_WriteOnly)) {
QCString crt = rt.utf8();
f.writeBlock(crt,crt.length());
@@ -831,13 +834,13 @@ bool TextEdit::save() {
bool TextEdit::saveAs() {
if(caption() == tr("Text Editor"))
return false;
- qDebug("saveAsFile " + currentFileName);
+ odebug << "saveAsFile " + currentFileName << oendl;
// case of nothing to save...
// if ( !doc && !currentFileName.isEmpty()) {
// //|| !bFromDocView)
-// qDebug("no doc");
+// odebug << "no doc" << oendl;
// return true;
// }
// if ( !editor->edited() ) {
// delete doc;
@@ -845,14 +848,14 @@ bool TextEdit::saveAs() {
// return true;
// }
QString rt = editor->text();
- qDebug(currentFileName);
+ odebug << currentFileName << oendl;
if( currentFileName.isEmpty()
|| currentFileName == tr("Unnamed")
|| currentFileName == tr("Text Editor")) {
- qDebug("do silly TT filename thing");
+ odebug << "do silly TT filename thing" << oendl;
// if ( doc && doc->name().isEmpty() ) {
QString pt = rt.simplifyWhiteSpace();
int i = pt.find( ' ' );
QString docname = pt;
@@ -871,9 +874,9 @@ bool TextEdit::saveAs() {
if(doc) doc->setName(docname);
currentFileName=docname;
// }
// else
-// qDebug("hmmmmmm");
+// odebug << "hmmmmmm" << oendl;
}
QMap<QString, QStringList> map;
@@ -899,9 +902,9 @@ bool TextEdit::saveAs() {
if(!str.isEmpty()) {
QString fileNm=str;
- qDebug("saving filename "+fileNm);
+ odebug << "saving filename "+fileNm << oendl;
QFileInfo fi(fileNm);
currentFileName=fi.fileName();
if(doc)
// QString file = doc->file();
@@ -911,9 +914,9 @@ bool TextEdit::saveAs() {
nf.setType("text/plain");
nf.setFile( fileNm);
doc = new DocLnk(nf);
// editor->setText(rt);
- qDebug("Saving file as "+currentFileName);
+ odebug << "Saving file as "+currentFileName << oendl;
doc->setName( currentFileName);
updateCaption( currentFileName);
FileManager fm;
@@ -940,9 +943,9 @@ bool TextEdit::saveAs() {
setCaption(caption().right(caption().length()-1));
return true;
}
- qDebug("returning false");
+ odebug << "returning false" << oendl;
return false;
} //end saveAs
void TextEdit::clear() {
@@ -971,16 +974,16 @@ void TextEdit::updateCaption( const QString &name ) {
void TextEdit::setDocument(const QString& fileref) {
if(fileref != "Unnamed") {
currentFileName=fileref;
- qDebug("setDocument");
+ odebug << "setDocument" << oendl;
QFileInfo fi(currentFileName);
- qDebug("basename:"+fi.baseName()+": current filenmame "+currentFileName);
+ odebug << "basename:"+fi.baseName()+": current filenmame "+currentFileName << oendl;
if( (fi.baseName().left(1)).isEmpty() ) {
openDotFile(currentFileName);
} else {
- qDebug("setDoc open");
+ odebug << "setDoc open" << oendl;
bFromDocView = true;
openFile(fileref);
editor->setEdited(true);
edited1=false;
@@ -1033,20 +1036,20 @@ void TextEdit::changeStartConfig( bool b ) {
update();
}
void TextEdit::editorChanged() {
-// qDebug("editor changed");
+// odebug << "editor changed" << oendl;
if( /*editor->edited() &&*/ /*edited && */!edited1) {
setCaption( "*"+caption());
edited1=true;
}
edited=true;
}
void TextEdit::receive(const QCString&msg, const QByteArray &) {
- qDebug("QCop "+msg);
+ odebug << "QCop "+msg << oendl;
if ( msg == "setDocument(QString)" ) {
- qDebug("bugger all");
+ odebug << "bugger all" << oendl;
}
}
@@ -1128,9 +1131,9 @@ void TextEdit::timerCrank()
saveAs();
}
else
{
-// qDebug("autosave");
+// odebug << "autosave" << oendl;
save();
}
setTimer();
}
@@ -1144,20 +1147,20 @@ void TextEdit::doTimer(bool b)
featureAutoSave = b;
nAutoSave->setOn(b);
if(b)
{
-// qDebug("doTimer true");
+// odebug << "doTimer true" << oendl;
setTimer();
}
// else
-// qDebug("doTimer false");
+// odebug << "doTimer false" << oendl;
}
void TextEdit::setTimer()
{
if(featureAutoSave)
{
-// qDebug("setting autosave");
+// odebug << "setting autosave" << oendl;
QTimer *timer = new QTimer(this );
connect( timer, SIGNAL(timeout()), this, SLOT(timerCrank()) );
timer->start( 300000, true); //5 minutes
}