summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm/output.cpp
Unidiff
Diffstat (limited to 'noncore/apps/advancedfm/output.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/output.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp
index 8c585f4..8f654d5 100644
--- a/noncore/apps/advancedfm/output.cpp
+++ b/noncore/apps/advancedfm/output.cpp
@@ -171,50 +171,51 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name,
171 perror("Error: "); 171 perror("Error: ");
172 QString errorMsg=tr("Error\n")+(QString)strerror(errno); 172 QString errorMsg=tr("Error\n")+(QString)strerror(errno);
173 OutputEdit->append( errorMsg); 173 OutputEdit->append( errorMsg);
174 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 174 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
175 } 175 }
176} 176}
177 177
178Output::~Output() { 178Output::~Output() {
179} 179}
180 180
181void Output::saveOutput() { 181void Output::saveOutput() {
182 182
183 InputDialog *fileDlg; 183 InputDialog *fileDlg;
184 fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); 184 fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0);
185 fileDlg->exec(); 185 fileDlg->exec();
186 if( fileDlg->result() == 1 ) { 186 if( fileDlg->result() == 1 ) {
187 QString filename = QPEApplication::documentDir(); 187 QString filename = QPEApplication::documentDir();
188 if(filename.right(1).find('/') == -1) 188 if(filename.right(1).find('/') == -1)
189 filename+="/"; 189 filename+="/";
190 QString name = fileDlg->LineEdit1->text(); 190 QString name = fileDlg->LineEdit1->text();
191 filename+="text/plain/"+name; 191 filename+="text/plain/"+name;
192 odebug << filename << oendl; 192 odebug << filename << oendl;
193 193
194 QFile f(filename); 194 QFile f(filename);
195 f.open( IO_WriteOnly); 195 if ( !f.open( IO_WriteOnly ) )
196 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { 196 owarn << "Could no open file" << oendl;
197 else if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) {
197 DocLnk lnk; 198 DocLnk lnk;
198 lnk.setName(name); //sets file name 199 lnk.setName(name); //sets file name
199 lnk.setFile(filename); //sets File property 200 lnk.setFile(filename); //sets File property
200 lnk.setType("text/plain"); 201 lnk.setType("text/plain");
201 if(!lnk.writeLink()) { 202 if(!lnk.writeLink()) {
202 odebug << "Writing doclink did not work" << oendl; 203 odebug << "Writing doclink did not work" << oendl;
203 } 204 }
204 } else 205 } else
205 owarn << "Could not write file" << oendl; 206 owarn << "Could not write file" << oendl;
206 f.close(); 207 f.close();
207 } 208 }
208} 209}
209 210
210void Output::commandStdout(OProcess*, char *buffer, int buflen) { 211void Output::commandStdout(OProcess*, char *buffer, int buflen) {
211 owarn << "received stdout " << buflen << " bytes" << oendl; 212 owarn << "received stdout " << buflen << " bytes" << oendl;
212 213
213// QByteArray data(buflen); 214// QByteArray data(buflen);
214// data.fill(*buffer, buflen); 215// data.fill(*buffer, buflen);
215// for (uint i = 0; i < data.count(); i++ ) { 216// for (uint i = 0; i < data.count(); i++ ) {
216// printf("%c", buffer[i] ); 217// printf("%c", buffer[i] );
217// } 218// }
218// printf("\n"); 219// printf("\n");
219 220
220 QString lineStr = buffer; 221 QString lineStr = buffer;