Diffstat (limited to 'noncore/apps/advancedfm/output.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/output.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
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 | |||
@@ -4,21 +4,24 @@ | |||
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> |
12 | using 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 */ |
19 | using namespace Opie::Core; | ||
20 | using namespace Opie::Core; | ||
21 | static char * filesave_xpm[] = { | 24 | static 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", |
@@ -120,9 +123,9 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, | |||
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 ); |
@@ -156,9 +159,9 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, | |||
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)) { |
@@ -185,9 +188,9 @@ void Output::saveOutput() { | |||
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) { |
@@ -195,18 +198,18 @@ void Output::saveOutput() { | |||
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 | ||
207 | void Output::commandStdout(OProcess*, char *buffer, int buflen) { | 210 | void 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++ ) { |
@@ -221,15 +224,15 @@ void Output::commandStdout(OProcess*, char *buffer, int buflen) { | |||
221 | } | 224 | } |
222 | 225 | ||
223 | 226 | ||
224 | void Output::commandStdin( const QByteArray &data) { | 227 | void 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 | ||
230 | void Output::commandStderr(OProcess*, char *buffer, int buflen) { | 233 | void 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); |