author | llornkcor <llornkcor> | 2002-07-29 12:22:11 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-29 12:22:11 (UTC) |
commit | 0868e96b1737d121733c898ae92348a279e5b53f (patch) (side-by-side diff) | |
tree | b0fd8451d06776994528f3aa3b561fccbd053151 | |
parent | b4827a8b268af9d1485455cdf727f564047f396e (diff) | |
download | opie-0868e96b1737d121733c898ae92348a279e5b53f.zip opie-0868e96b1737d121733c898ae92348a279e5b53f.tar.gz opie-0868e96b1737d121733c898ae92348a279e5b53f.tar.bz2 |
fix bug number 140
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 0c792c6..577db75 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -321,96 +321,97 @@ bool VMemo::startRecording() { // if(useAlerts) // QMessageBox::message("VMemo","Really Record?");//) ==1) // return; // } else { // if (!systemZaurus ) // QSound::play(Resource::findSound("vmemob")); // } qDebug("Start recording engines"); recording = TRUE; if (openDSP() == -1) { // QMessageBox::critical(0, "vmemo", "Could not open dsp device.\n"+errorMsg, "Abort"); // delete msgLabel; recording = FALSE; msgLabel=0; delete msgLabel; return FALSE; } config.setGroup("Defaults"); QDateTime dt = QDateTime::currentDateTime(); QString fName; config.setGroup( "System" ); fName = QPEApplication::documentDir() ; fileName = config.readEntry("RecLocation", fName); int s; s=fileName.find(':'); if(s) fileName=fileName.right(fileName.length()-s-2); qDebug("pathname will be "+fileName); if( fileName.left(1).find('/') == -1) fileName="/"+fileName; if( fileName.right(1).find('/') == -1) fileName+="/"; fName = "vm_"+ dt.toString()+ ".wav"; fileName+=fName; // No spaces in the filename fileName.replace(QRegExp("'"),""); fileName.replace(QRegExp(" "),"_"); fileName.replace(QRegExp(":"),"."); fileName.replace(QRegExp(","),""); + fileName += ".wav"; qDebug("filename is "+fileName); // open tmp file here char *pointer; pointer=tmpnam(NULL); qDebug("Opening tmp file %s",pointer); if(openWAV(pointer ) == -1) { // if(openWAV(fileName.latin1()) == -1) { QString err("Could not open the temp file\n"); err += fileName; QMessageBox::critical(0, "vmemo", err, "Abort"); ::close(dsp); return FALSE; } if( record() ) { QString cmd; cmd.sprintf("mv %s "+fileName, pointer); // move tmp file to regular file here system(cmd.latin1()); QArray<int> cats(1); cats[0] = config.readNumEntry("Category", 0); QString dlName("vm_"); dlName += dt.toString(); DocLnk l; l.setFile(fileName); l.setName(dlName); l.setType("audio/x-wav"); l.setCategories(cats); l.writeLink(); return TRUE; } else return FALSE; } void VMemo::stopRecording() { show(); qDebug("Stopped recording"); recording = FALSE; if(useAlerts) { msgLabel->close(); msgLabel=0; delete msgLabel; |