summaryrefslogtreecommitdiff
path: root/core/applets
Unidiff
Diffstat (limited to 'core/applets') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/cardmon/cardmon.cpp6
-rw-r--r--core/applets/vmemo/vmemo.cpp9
2 files changed, 6 insertions, 9 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp
index 3a6ad27..3af3d03 100644
--- a/core/applets/cardmon/cardmon.cpp
+++ b/core/applets/cardmon/cardmon.cpp
@@ -144,26 +144,25 @@ void CardMonitor::mousePressEvent( QMouseEvent * )
144 144
145 QPoint p = mapToGlobal( QPoint( 0, 0 ) ); 145 QPoint p = mapToGlobal( QPoint( 0, 0 ) );
146 QSize s = menu->sizeHint(); 146 QSize s = menu->sizeHint();
147 int opt = menu->exec( QPoint( p.x() + ( width() / 2 ) - ( s.width() / 2 ), 147 int opt = menu->exec( QPoint( p.x() + ( width() / 2 ) - ( s.width() / 2 ),
148 p.y() - s.height() ), 0 ); 148 p.y() - s.height() ), 0 );
149 149
150 if ( opt == 1 ) 150 if ( opt == 1 )
151 { 151 {
152 cmd = "/sbin/cardctl eject 0"; 152 cmd = "/sbin/cardctl eject 0";
153 err = system( ( const char * ) cmd ); 153 err = system( ( const char * ) cmd );
154 if ( err != 0 ) 154 if ( err != 0 )
155 { 155 {
156 qDebug( "Could not execute `/sbin/cardctl eject 0'! err=%d", 156 odebug << "Could not execute `/sbin/cardctl eject 0'! err=" << err << oendl;
157 err );
158 popUp( tr( "CF/PCMCIA card eject failed!" ) ); 157 popUp( tr( "CF/PCMCIA card eject failed!" ) );
159 } 158 }
160 } 159 }
161 else if ( opt == 0 ) 160 else if ( opt == 0 )
162 { 161 {
163 if ( ODevice::inst() ->system() == System_Familiar ) 162 if ( ODevice::inst() ->system() == System_Familiar )
164 { 163 {
165 cmd = "umount /dev/mmc/part1"; 164 cmd = "umount /dev/mmc/part1";
166 } 165 }
167 else 166 else
168 { 167 {
169 cmd = "umount /dev/mmcda1"; 168 cmd = "umount /dev/mmcda1";
@@ -171,26 +170,25 @@ void CardMonitor::mousePressEvent( QMouseEvent * )
171 err = system( ( const char * ) cmd ); 170 err = system( ( const char * ) cmd );
172 if ( err != 0 ) 171 if ( err != 0 )
173 { 172 {
174 popUp( tr( "SD/MMC card eject failed!" ) ); 173 popUp( tr( "SD/MMC card eject failed!" ) );
175 } 174 }
176 } 175 }
177 else if ( opt == 2 ) 176 else if ( opt == 2 )
178 { 177 {
179 cmd = "/sbin/cardctl eject 1"; 178 cmd = "/sbin/cardctl eject 1";
180 err = system( ( const char * ) cmd ); 179 err = system( ( const char * ) cmd );
181 if ( err != 0 ) 180 if ( err != 0 )
182 { 181 {
183 qDebug( "Could not execute `/sbin/cardctl eject 1'! err=%d", 182 odebug << "Could not execute `/sbin/cardctl eject 1'! err=" << err << oendl;
184 err );
185 popUp( tr( "CF/PCMCIA card eject failed!" ) ); 183 popUp( tr( "CF/PCMCIA card eject failed!" ) );
186 } 184 }
187 } 185 }
188 delete menu; 186 delete menu;
189} 187}
190 188
191 189
192void CardMonitor::cardMessage( const QCString & msg, const QByteArray & ) 190void CardMonitor::cardMessage( const QCString & msg, const QByteArray & )
193{ 191{
194 if ( msg == "stabChanged()" ) 192 if ( msg == "stabChanged()" )
195 { 193 {
196 // odebug << "Pcmcia: stabchanged" << oendl; 194 // odebug << "Pcmcia: stabchanged" << oendl;
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 835f63a..f088bef 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -214,25 +214,25 @@ VMemo::VMemo( QWidget *parent, const char *_name )
214 odebug << "toggleKey " << toggleKey << "" << oendl; 214 odebug << "toggleKey " << toggleKey << "" << oendl;
215 215
216// if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) 216// if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ))
217// systemZaurus=TRUE; 217// systemZaurus=TRUE;
218// else 218// else
219 systemZaurus = FALSE; 219 systemZaurus = FALSE;
220 220
221 myChannel = new QCopChannel( "QPE/VMemo", this ); 221 myChannel = new QCopChannel( "QPE/VMemo", this );
222 connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)), 222 connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)),
223 this, SLOT(receive(const QCString&,const QByteArray&)) ); 223 this, SLOT(receive(const QCString&,const QByteArray&)) );
224 224
225 if( toggleKey != -1 ) { 225 if( toggleKey != -1 ) {
226 qDebug("Register key %d", toggleKey); 226 odebug << "Register key " << toggleKey << "" << oendl;
227 QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); 227 QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)");
228 // e << 4096; // Key_Escape 228 // e << 4096; // Key_Escape
229 // e << Key_F5; //4148 229 // e << Key_F5; //4148
230 e << toggleKey; 230 e << toggleKey;
231 e << QString("QPE/VMemo"); 231 e << QString("QPE/VMemo");
232 e << QString("toggleRecord()"); 232 e << QString("toggleRecord()");
233 } 233 }
234 if(toggleKey == 1) 234 if(toggleKey == 1)
235 usingIcon = TRUE; 235 usingIcon = TRUE;
236 else 236 else
237 usingIcon = FALSE; 237 usingIcon = FALSE;
238// if( vmCfg.readNumEntry("hideIcon",0) == 1) 238// if( vmCfg.readNumEntry("hideIcon",0) == 1)
@@ -467,26 +467,26 @@ int VMemo::openWAV(const char *filename) {
467 wh.sc_len = 16; 467 wh.sc_len = 16;
468 if(useADPCM) 468 if(useADPCM)
469 wh.format = WAVE_FORMAT_DVI_ADPCM;//PCM_CODE; 469 wh.format = WAVE_FORMAT_DVI_ADPCM;//PCM_CODE;
470 else 470 else
471 wh.format = PCM_CODE; 471 wh.format = PCM_CODE;
472 wh.modus = channels; 472 wh.modus = channels;
473 wh.sample_fq = speed; 473 wh.sample_fq = speed;
474 wh.byte_p_sec = speed * channels * resolution/8; 474 wh.byte_p_sec = speed * channels * resolution/8;
475 wh.byte_p_spl = channels * (resolution / 8); 475 wh.byte_p_spl = channels * (resolution / 8);
476 wh.bit_p_spl = resolution; 476 wh.bit_p_spl = resolution;
477 wh.data_chunk = DATA; 477 wh.data_chunk = DATA;
478 wh.data_length= 0; 478 wh.data_length= 0;
479 // qDebug("Write header channels %d, speed %d, b/s %d, blockalign %d, bitrate %d" 479 // odebug << "Write header channels " << wh.modus << ", speed " << wh.sample_fq << ", b/s "
480 // , wh.modus, wh.sample_fq, wh.byte_p_sec, wh.byte_p_spl, wh.bit_p_spl ); 480 // << wh.byte_p_sec << ", blockalign " << wh.byte_p_spl << ", bitrate " << wh.bit_p_spl << oendl;
481 write (wav, &wh, sizeof(WaveHeader)); 481 write (wav, &wh, sizeof(WaveHeader));
482 482
483 return 1; 483 return 1;
484} 484}
485 485
486bool VMemo::record() { 486bool VMemo::record() {
487 length = 0; 487 length = 0;
488 int bytesWritten = 0; 488 int bytesWritten = 0;
489 int result = 0; 489 int result = 0;
490 int value = 0; 490 int value = 0;
491 QString msg; 491 QString msg;
492 msg.sprintf("Recording format %d", format); 492 msg.sprintf("Recording format %d", format);
@@ -550,26 +550,25 @@ bool VMemo::record() {
550 recording = false; 550 recording = false;
551 perror("dev/dsp's is a lookin' messy"); 551 perror("dev/dsp's is a lookin' messy");
552 QMessageBox::message("Vmemo","Error writing to file\n"+ fileName); 552 QMessageBox::message("Vmemo","Error writing to file\n"+ fileName);
553 break; 553 break;
554 return FALSE; 554 return FALSE;
555 } 555 }
556 // printf("%d\r", length); 556 // printf("%d\r", length);
557 // fflush(stdout); 557 // fflush(stdout);
558 qApp->processEvents(); 558 qApp->processEvents();
559 } 559 }
560 } 560 }
561 } 561 }
562 // qDebug("file has length of %d lasting %d seconds", 562 // odebug << "file has length of " << length << " lasting " << (( length / speed) / channels) / 2 ) << " seconds" << oendl;
563 // length, (( length / speed) / channels) / 2 );
564 563
565 value = length + 36; 564 value = length + 36;
566 565
567 lseek(wav, 4, SEEK_SET); 566 lseek(wav, 4, SEEK_SET);
568 write(wav, &value, 4); 567 write(wav, &value, 4);
569 lseek(wav, 40, SEEK_SET); 568 lseek(wav, 40, SEEK_SET);
570 569
571 write(wav, &length, 4); 570 write(wav, &length, 4);
572 571
573 track.close(); 572 track.close();
574 odebug << "Track closed" << oendl; 573 odebug << "Track closed" << oendl;
575 574