summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-06 19:41:10 (UTC)
committer zautrix <zautrix>2004-10-06 19:41:10 (UTC)
commitbe3a5ea82c9a160eeeaad187a357c9a085fdb20a (patch) (unidiff)
tree933c685c84430f5c19a0657239b5c8b50a88de05
parent656636acfb8c607901c97c4f55129e29e1df9913 (diff)
downloadkdepimpi-be3a5ea82c9a160eeeaad187a357c9a085fdb20a.zip
kdepimpi-be3a5ea82c9a160eeeaad187a357c9a085fdb20a.tar.gz
kdepimpi-be3a5ea82c9a160eeeaad187a357c9a085fdb20a.tar.bz2
bugfixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/gsmstate.h2
-rw-r--r--kaddressbook/kabcore.cpp6
-rw-r--r--libkdepim/phoneaccess.cpp12
3 files changed, 10 insertions, 10 deletions
diff --git a/gammu/emb/common/gsmstate.h b/gammu/emb/common/gsmstate.h
index 2b4806c..f15a6a7 100644
--- a/gammu/emb/common/gsmstate.h
+++ b/gammu/emb/common/gsmstate.h
@@ -152,25 +152,24 @@ typedef struct _GSM_Reply_Function GSM_Reply_Function;
152# undef GSM_ENABLE_IRDAAT 152# undef GSM_ENABLE_IRDAAT
153# undef GSM_ENABLE_FBUS2IRDA 153# undef GSM_ENABLE_FBUS2IRDA
154 154
155# undef GSM_ENABLE_BLUETOOTHDEVICE 155# undef GSM_ENABLE_BLUETOOTHDEVICE
156# undef GSM_ENABLE_BLUEPHONET 156# undef GSM_ENABLE_BLUEPHONET
157# undef GSM_ENABLE_BLUEOBEX 157# undef GSM_ENABLE_BLUEOBEX
158# undef GSM_ENABLE_BLUEAT 158# undef GSM_ENABLE_BLUEAT
159# undef GSM_ENABLE_BLUEFBUS2 159# undef GSM_ENABLE_BLUEFBUS2
160# undef GSM_ENABLE_PHONETBLUE 160# undef GSM_ENABLE_PHONETBLUE
161# undef GSM_ENABLE_FBUS2BLUE 161# undef GSM_ENABLE_FBUS2BLUE
162# undef GSM_ENABLE_MROUTERBLUE 162# undef GSM_ENABLE_MROUTERBLUE
163#endif 163#endif
164
165#ifndef WIN32 164#ifndef WIN32
166# ifdef ENABLE_LGPL 165# ifdef ENABLE_LGPL
167# undef GSM_ENABLE_IRDADEVICE 166# undef GSM_ENABLE_IRDADEVICE
168# undef GSM_ENABLE_IRDAPHONET 167# undef GSM_ENABLE_IRDAPHONET
169# undef GSM_ENABLE_IRDAOBEX 168# undef GSM_ENABLE_IRDAOBEX
170# undef GSM_ENABLE_IRDAAT 169# undef GSM_ENABLE_IRDAAT
171# undef GSM_ENABLE_FBUS2IRDA 170# undef GSM_ENABLE_FBUS2IRDA
172 171
173# undef GSM_ENABLE_BLUETOOTHDEVICE 172# undef GSM_ENABLE_BLUETOOTHDEVICE
174# undef GSM_ENABLE_BLUEPHONET 173# undef GSM_ENABLE_BLUEPHONET
175# undef GSM_ENABLE_BLUEOBEX 174# undef GSM_ENABLE_BLUEOBEX
176# undef GSM_ENABLE_BLUEAT 175# undef GSM_ENABLE_BLUEAT
@@ -1568,12 +1567,13 @@ int smprintf(GSM_StateMachine *s, const char *format, ...);
1568 1567
1569void GSM_OSErrorInfo(GSM_StateMachine *s, char *description); 1568void GSM_OSErrorInfo(GSM_StateMachine *s, char *description);
1570 1569
1571#ifdef GSM_ENABLE_BACKUP 1570#ifdef GSM_ENABLE_BACKUP
1572void GSM_GetPhoneFeaturesForBackup(GSM_StateMachine *s, GSM_Backup_Info *info); 1571void GSM_GetPhoneFeaturesForBackup(GSM_StateMachine *s, GSM_Backup_Info *info);
1573#endif 1572#endif
1574 1573
1575#endif 1574#endif
1576 1575
1577/* How should editor hadle tabs in this file? Add editor commands here. 1576/* How should editor hadle tabs in this file? Add editor commands here.
1578 * vim: noexpandtab sw=8 ts=8 sts=8: 1577 * vim: noexpandtab sw=8 ts=8 sts=8:
1579 */ 1578 */
1579
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 7bec90a..b014cba 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -26,24 +26,25 @@ Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include "kabcore.h" 31#include "kabcore.h"
32 32
33#include <stdaddressbook.h> 33#include <stdaddressbook.h>
34#include <klocale.h> 34#include <klocale.h>
35#include <kfiledialog.h> 35#include <kfiledialog.h>
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qlabel.h> 37#include <qlabel.h>
38#include <qregexp.h>
38#include <qlineedit.h> 39#include <qlineedit.h>
39#include <qcheckbox.h> 40#include <qcheckbox.h>
40#include <qpushbutton.h> 41#include <qpushbutton.h>
41#include <qprogressbar.h> 42#include <qprogressbar.h>
42#include <libkdepim/phoneaccess.h> 43#include <libkdepim/phoneaccess.h>
43 44
44#ifndef KAB_EMBEDDED 45#ifndef KAB_EMBEDDED
45#include <qclipboard.h> 46#include <qclipboard.h>
46#include <qdir.h> 47#include <qdir.h>
47#include <qfile.h> 48#include <qfile.h>
48#include <qapplicaton.h> 49#include <qapplicaton.h>
49#include <qprogressbar.h> 50#include <qprogressbar.h>
@@ -717,24 +718,29 @@ void KABCore::export2phone()
717 datastream +=vcard.mid( next+5,sep -next -5 ).upper(); 718 datastream +=vcard.mid( next+5,sep -next -5 ).upper();
718 start = sep; 719 start = sep;
719 } 720 }
720 datastream += vcard.mid( start,vcard.length() ); 721 datastream += vcard.mid( start,vcard.length() );
721 } 722 }
722 QFile outFile(fileName); 723 QFile outFile(fileName);
723 if ( outFile.open(IO_WriteOnly) ) { 724 if ( outFile.open(IO_WriteOnly) ) {
724 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 725 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
725 QTextStream t( &outFile ); // use a text stream 726 QTextStream t( &outFile ); // use a text stream
726 t.setEncoding( QTextStream::UnicodeUTF8 ); 727 t.setEncoding( QTextStream::UnicodeUTF8 );
727 t <<datastream; 728 t <<datastream;
728 outFile.close(); 729 outFile.close();
730 if ( PhoneAccess::writeToPhone( fileName ) )
731 qDebug("Export okay ");
732 else
733 qDebug("Error export contacts ");
734
729 } else { 735 } else {
730 qDebug("Error open temp file "); 736 qDebug("Error open temp file ");
731 return; 737 return;
732 } 738 }
733 739
734 740
735#if 0 741#if 0
736 742
737 setCaption( i18n("Writing to phone...")); 743 setCaption( i18n("Writing to phone..."));
738 if ( PhoneFormat::writeToPhone( cal ) ) 744 if ( PhoneFormat::writeToPhone( cal ) )
739 setCaption( i18n("Export to phone successful!")); 745 setCaption( i18n("Export to phone successful!"));
740 else 746 else
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp
index c0bd6cc..357cd39 100644
--- a/libkdepim/phoneaccess.cpp
+++ b/libkdepim/phoneaccess.cpp
@@ -31,38 +31,38 @@
31#include <kmessagebox.h> 31#include <kmessagebox.h>
32#include <stdlib.h> 32#include <stdlib.h>
33#include "phoneaccess.h" 33#include "phoneaccess.h"
34 34
35void PhoneAccess::writeConfig( QString device, QString connection, QString model ) 35void PhoneAccess::writeConfig( QString device, QString connection, QString model )
36{ 36{
37#ifdef _WIN32_ 37#ifdef _WIN32_
38 QString fileName = qApp->applicationDirPath () +"\\gammurc"; 38 QString fileName = qApp->applicationDirPath () +"\\gammurc";
39#else 39#else
40 QString fileName = QDir::homeDirPath() +"/.gammurc"; 40 QString fileName = QDir::homeDirPath() +"/.gammurc";
41#endif 41#endif
42 //qDebug("save %d ", load ); 42 //qDebug("save %d ", load );
43 QString content; 43 QString content = "[gammu]\n";;
44 bool write = false; 44 bool write = false;
45 bool addPort = true, addConnection = true, addModel = true; 45 bool addPort = true, addConnection = true, addModel = true;
46 QFile file( fileName ); 46 QFile file( fileName );
47 if ( QFile::exists( fileName) ) { 47 if ( QFile::exists( fileName) ) {
48 if (!file.open( IO_ReadOnly ) ) { 48 if (!file.open( IO_ReadOnly ) ) {
49 qDebug("Error: cannot open %s ", fileName.latin1() ); 49 qDebug("Error: cannot open %s ", fileName.latin1() );
50 return; 50 return;
51 } 51 }
52 QString line; 52 QString line;
53 while ( file.readLine( line, 1024 ) > 0 ) { 53 while ( file.readLine( line, 1024 ) > 0 ) {
54 //qDebug("*%s* ", line.latin1() ); 54 //qDebug("*%s* ", line.latin1() );
55 if ( line.left(7 ) == "[gammu]" ) { 55 if ( line.left(7 ) == "[gammu]" ) {
56 ; 56 ;
57 } else 57 } else
58 if ( line.left(4 ) == "port" ) { 58 if ( line.left(4 ) == "port" ) {
59 if ( line == "port = " + device+"\n" ) { 59 if ( line == "port = " + device+"\n" ) {
60 content += line ; 60 content += line ;
61 addPort = false; 61 addPort = false;
62 //qDebug("port found" ); 62 //qDebug("port found" );
63 } 63 }
64 64
65 } else if ( line.left(5 ) == "model" ) { 65 } else if ( line.left(5 ) == "model" ) {
66 if ( line == "model = " + model +"\n") { 66 if ( line == "model = " + model +"\n") {
67 content += line ; 67 content += line ;
68 addModel = false; 68 addModel = false;
@@ -84,45 +84,39 @@ void PhoneAccess::writeConfig( QString device, QString connection, QString model
84 } else { 84 } else {
85 if ( ! connection.isEmpty() ) { 85 if ( ! connection.isEmpty() ) {
86 addConnection = true; 86 addConnection = true;
87 } 87 }
88 if ( ! device.isEmpty() ) { 88 if ( ! device.isEmpty() ) {
89 addPort = true; 89 addPort = true;
90 90
91 } 91 }
92 if ( ! model.isEmpty() ) { 92 if ( ! model.isEmpty() ) {
93 addModel = true; 93 addModel = true;
94 } 94 }
95 } 95 }
96 96
97 if ( addConnection ) { 97 if ( addConnection ) {
98 if ( ! write )
99 content += "[gammu]\n";
100 write = true; 98 write = true;
101 content += "connection = "; 99 content += "connection = ";
102 content += connection; 100 content += connection;
103 content += "\n"; 101 content += "\n";
104 } 102 }
105 if ( addPort ) { 103 if ( addPort ) {
106 if ( ! write )
107 content += "[gammu]\n";
108 write = true; 104 write = true;
109 content += "port = "; 105 content += "port = ";
110 content += device; 106 content += device;
111 content += "\n"; 107 content += "\n";
112 108
113 } 109 }
114 if ( addModel ) { 110 if ( addModel ) {
115 if ( ! write )
116 content += "[gammu]\n";
117 write = true; 111 write = true;
118 content += "model = "; 112 content += "model = ";
119 content += model; 113 content += model;
120 content += "\n"; 114 content += "\n";
121 } 115 }
122 if ( write ) { 116 if ( write ) {
123 if (!file.open( IO_WriteOnly ) ) { 117 if (!file.open( IO_WriteOnly ) ) {
124 qDebug("Error: cannot write file %s ", fileName.latin1() ); 118 qDebug("Error: cannot write file %s ", fileName.latin1() );
125 return; 119 return;
126 } 120 }
127 qDebug("Writing file %s ", fileName.latin1() ); 121 qDebug("Writing file %s ", fileName.latin1() );
128 QTextStream ts( &file ); 122 QTextStream ts( &file );