-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 7cc4062..f5d2b20 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -289,34 +289,36 @@ bool VMemo::startRecording() { | |||
289 | } | 289 | } |
290 | 290 | ||
291 | config.setGroup("Defaults"); | 291 | config.setGroup("Defaults"); |
292 | 292 | ||
293 | QDateTime dt = QDateTime::currentDateTime(); | 293 | QDateTime dt = QDateTime::currentDateTime(); |
294 | 294 | ||
295 | QString fName; | 295 | QString fName; |
296 | config.setGroup( "System" ); | 296 | config.setGroup( "System" ); |
297 | fName = QPEApplication::documentDir() ; | 297 | fName = QPEApplication::documentDir() ; |
298 | fileName = config.readEntry("RecLocation", fName); | 298 | fileName = config.readEntry("RecLocation", fName); |
299 | 299 | ||
300 | int s; | 300 | int s; |
301 | s=fileName.find(':'); | 301 | s=fileName.find(':'); |
302 | if(s) | 302 | if(s) |
303 | fileName=fileName.right(fileName.length()-s-2); | 303 | fileName=fileName.right(fileName.length()-s-2); |
304 | qDebug("filename will be "+fileName); | 304 | qDebug("filename will be "+fileName); |
305 | if( fileName.right(1).find('/') == -1) | 305 | if( fileName.left(1).find('/') == -1) |
306 | fileName+="/"; | 306 | fileName="/"+fileName; |
307 | if( fileName.right(1).find('/') == -1) | ||
308 | fileName+="/"; | ||
307 | fName = "vm_"+ dt.toString()+ ".wav"; | 309 | fName = "vm_"+ dt.toString()+ ".wav"; |
308 | 310 | ||
309 | fileName+=fName; | 311 | fileName+=fName; |
310 | qDebug("filename is "+fileName); | 312 | qDebug("filename is "+fileName); |
311 | // No spaces in the filename | 313 | // No spaces in the filename |
312 | fileName.replace(QRegExp("'"),""); | 314 | fileName.replace(QRegExp("'"),""); |
313 | fileName.replace(QRegExp(" "),"_"); | 315 | fileName.replace(QRegExp(" "),"_"); |
314 | fileName.replace(QRegExp(":"),"."); | 316 | fileName.replace(QRegExp(":"),"."); |
315 | fileName.replace(QRegExp(","),""); | 317 | fileName.replace(QRegExp(","),""); |
316 | 318 | ||
317 | if(openWAV(fileName.latin1()) == -1) { | 319 | if(openWAV(fileName.latin1()) == -1) { |
318 | QString err("Could not open the output file\n"); | 320 | QString err("Could not open the output file\n"); |
319 | err += fileName; | 321 | err += fileName; |
320 | QMessageBox::critical(0, "VMemo", err, "Abort"); | 322 | QMessageBox::critical(0, "VMemo", err, "Abort"); |
321 | close(dsp); | 323 | close(dsp); |
322 | return FALSE; | 324 | return FALSE; |