summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-14 06:42:01 (UTC)
committer zautrix <zautrix>2004-10-14 06:42:01 (UTC)
commita6dff815a9c6d3a91094573d23c28a8553fc7cc2 (patch) (unidiff)
treea8830e9adcd72faa8178d4ee2517bfc31cda8653
parent909d25797c50fc38c435834a68aaf60bf87e32f9 (diff)
downloadkdepimpi-a6dff815a9c6d3a91094573d23c28a8553fc7cc2.zip
kdepimpi-a6dff815a9c6d3a91094573d23c28a8553fc7cc2.tar.gz
kdepimpi-a6dff815a9c6d3a91094573d23c28a8553fc7cc2.tar.bz2
fixes umlaute in beaming
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/service/gsmcal.c15
-rw-r--r--gammu/emb/common/service/gsmcal.h1
-rw-r--r--kaddressbook/kabcore.cpp6
-rw-r--r--korganizer/calendarview.cpp12
-rw-r--r--microkde/kapplication.cpp22
-rw-r--r--microkde/kapplication.h1
6 files changed, 50 insertions, 7 deletions
diff --git a/gammu/emb/common/service/gsmcal.c b/gammu/emb/common/service/gsmcal.c
index 0ea8e06..0375fee 100644
--- a/gammu/emb/common/service/gsmcal.c
+++ b/gammu/emb/common/service/gsmcal.c
@@ -63,16 +63,19 @@ void GSM_CalendarFindDefaultTextTimeAlarmPhoneRecurrance(GSM_CalendarEntry *entr
63 case CAL_ALARM_DATETIME : 63 case CAL_ALARM_DATETIME :
64 case CAL_SILENT_ALARM_DATETIME: 64 case CAL_SILENT_ALARM_DATETIME:
65 if (*Alarm == -1) *Alarm = i; 65 if (*Alarm == -1) *Alarm = i;
66 break; 66 break;
67 case CAL_RECURRANCE: 67 case CAL_RECURRANCE:
68 if (*Recurrance == -1) *Recurrance = i; 68 if (*Recurrance == -1) *Recurrance = i;
69 break; 69 break;
70 case CAL_TEXT: 70 case CAL_TEXT:
71 *Text = i;
72 break;
73 case CAL_DESCRIPTION:
71 if (*Text == -1) *Text = i; 74 if (*Text == -1) *Text = i;
72 break; 75 break;
73 case CAL_PHONE: 76 case CAL_PHONE:
74 if (*Phone == -1) *Phone = i; 77 if (*Phone == -1) *Phone = i;
75 break; 78 break;
76 case CAL_LOCATION: 79 case CAL_LOCATION:
77 if (*Location == -1) *Location = i; 80 if (*Location == -1) *Location = i;
78 break; 81 break;
@@ -192,19 +195,19 @@ GSM_Error GSM_EncodeVCALENDAR(char *Buffer, int *Length, GSM_CalendarEntry *note
192 if (note->Type == GSM_CAL_CALL) { 195 if (note->Type == GSM_CAL_CALL) {
193 buffer[0] = 0; 196 buffer[0] = 0;
194 buffer[1] = 0; 197 buffer[1] = 0;
195 if (Phone != -1) CopyUnicodeString(buffer,note->Entries[Phone].Text); 198 if (Phone != -1) CopyUnicodeString(buffer,note->Entries[Phone].Text);
196 if (Text != -1) { 199 if (Text != -1) {
197 if (Phone != -1) EncodeUnicode(buffer+UnicodeLength(buffer)*2," ",1); 200 if (Phone != -1) EncodeUnicode(buffer+UnicodeLength(buffer)*2," ",1);
198 CopyUnicodeString(buffer+UnicodeLength(buffer)*2,note->Entries[Text].Text); 201 CopyUnicodeString(buffer+UnicodeLength(buffer)*2,note->Entries[Text].Text);
199 } 202 }
200 SaveVCALText(Buffer, Length, buffer, "DESCRIPTION"); 203 SaveVCALText(Buffer, Length, buffer, "SUMMARY");
201 } else { 204 } else {
202 SaveVCALText(Buffer, Length, note->Entries[Text].Text, "DESCRIPTION"); 205 SaveVCALText(Buffer, Length, note->Entries[Text].Text, "SUMMARY");
203 } 206 }
204 } else if (Version == SonyEricsson_VCalendar) { 207 } else if (Version == SonyEricsson_VCalendar) {
205 *Length+=sprintf(Buffer+(*Length), "CATEGORIES:"); 208 *Length+=sprintf(Buffer+(*Length), "CATEGORIES:");
206 switch (note->Type) { 209 switch (note->Type) {
207 case GSM_CAL_MEETING: 210 case GSM_CAL_MEETING:
208 *Length+=sprintf(Buffer+(*Length), "Meeting%c%c",13,10); 211 *Length+=sprintf(Buffer+(*Length), "Meeting%c%c",13,10);
209 break; 212 break;
210 case GSM_CAL_REMINDER: 213 case GSM_CAL_REMINDER:
@@ -411,21 +414,27 @@ GSM_Error GSM_DecodeVCALENDAR_VTODO(unsigned char *Buffer, int *Pos, GSM_Calenda
411 Calendar->Entries[Calendar->EntriesNum].Number = 30*24; 414 Calendar->Entries[Calendar->EntriesNum].Number = 30*24;
412 Calendar->EntriesNum++; 415 Calendar->EntriesNum++;
413 } 416 }
414 if (strstr(Line,"RRULE:YD1")) { 417 if (strstr(Line,"RRULE:YD1")) {
415 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_RECURRANCE; 418 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_RECURRANCE;
416 Calendar->Entries[Calendar->EntriesNum].Number = 365*24; 419 Calendar->Entries[Calendar->EntriesNum].Number = 365*24;
417 Calendar->EntriesNum++; 420 Calendar->EntriesNum++;
418 } 421 }
419 if ((ReadVCALText(Line, "SUMMARY", Buff)) || (ReadVCALText(Line, "DESCRIPTION", Buff))) { 422 // LR
423 if ((ReadVCALText(Line, "SUMMARY", Buff)) ) {
420 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_TEXT; 424 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_TEXT;
421 CopyUnicodeString(Calendar->Entries[Calendar->EntriesNum].Text,Buff); 425 CopyUnicodeString(Calendar->Entries[Calendar->EntriesNum].Text,Buff);
422 Calendar->EntriesNum++; 426 Calendar->EntriesNum++;
423 } 427 }
428 if (ReadVCALText(Line, "DESCRIPTION", Buff)) {
429 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_DESCRIPTION;
430 CopyUnicodeString(Calendar->Entries[Calendar->EntriesNum].Text,Buff);
431 Calendar->EntriesNum++;
432 }
424 if (ReadVCALText(Line, "LOCATION", Buff)) { 433 if (ReadVCALText(Line, "LOCATION", Buff)) {
425 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_LOCATION; 434 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_LOCATION;
426 CopyUnicodeString(Calendar->Entries[Calendar->EntriesNum].Text,Buff); 435 CopyUnicodeString(Calendar->Entries[Calendar->EntriesNum].Text,Buff);
427 Calendar->EntriesNum++; 436 Calendar->EntriesNum++;
428 } 437 }
429 if (ReadVCALText(Line, "DTSTART", Buff)) { 438 if (ReadVCALText(Line, "DTSTART", Buff)) {
430 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_START_DATETIME; 439 Calendar->Entries[Calendar->EntriesNum].EntryType = CAL_START_DATETIME;
431 ReadVCALDateTime(DecodeUnicodeString(Buff), &Calendar->Entries[Calendar->EntriesNum].Date); 440 ReadVCALDateTime(DecodeUnicodeString(Buff), &Calendar->Entries[Calendar->EntriesNum].Date);
diff --git a/gammu/emb/common/service/gsmcal.h b/gammu/emb/common/service/gsmcal.h
index 0a41b7b..c69fdbe 100644
--- a/gammu/emb/common/service/gsmcal.h
+++ b/gammu/emb/common/service/gsmcal.h
@@ -152,16 +152,17 @@ typedef enum {
152 /** 152 /**
153 * Recurrance. 153 * Recurrance.
154 */ 154 */
155 CAL_RECURRANCE, 155 CAL_RECURRANCE,
156 /** 156 /**
157 * Text. 157 * Text.
158 */ 158 */
159 CAL_TEXT, 159 CAL_TEXT,
160 CAL_DESCRIPTION, // LR added
160 /** 161 /**
161 * Location. 162 * Location.
162 */ 163 */
163 CAL_LOCATION, 164 CAL_LOCATION,
164 /** 165 /**
165 * Phone number. 166 * Phone number.
166 */ 167 */
167 CAL_PHONE, 168 CAL_PHONE,
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 47ed858..dae9cd2 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -808,18 +808,19 @@ void KABCore::beamVCard(const QStringList& uids)
808 } 808 }
809 datastream += vcard.mid( start,vcard.length() ); 809 datastream += vcard.mid( start,vcard.length() );
810 } 810 }
811#ifndef DESKTOP_VERSION 811#ifndef DESKTOP_VERSION
812 QFile outFile(fileName); 812 QFile outFile(fileName);
813 if ( outFile.open(IO_WriteOnly) ) { 813 if ( outFile.open(IO_WriteOnly) ) {
814 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); 814 datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" );
815 QTextStream t( &outFile ); // use a text stream 815 QTextStream t( &outFile ); // use a text stream
816 t.setEncoding( QTextStream::UnicodeUTF8 ); 816 //t.setEncoding( QTextStream::UnicodeUTF8 );
817 t <<datastream; 817 t.setEncoding( QTextStream::Latin1 );
818 t <<datastream.latin1();
818 outFile.close(); 819 outFile.close();
819 Ir *ir = new Ir( this ); 820 Ir *ir = new Ir( this );
820 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); 821 connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) );
821 ir->send( fileName, description, "text/x-vCard" ); 822 ir->send( fileName, description, "text/x-vCard" );
822 } else { 823 } else {
823 qDebug("Error open temp beam file "); 824 qDebug("Error open temp beam file ");
824 return; 825 return;
825 } 826 }
@@ -827,16 +828,17 @@ void KABCore::beamVCard(const QStringList& uids)
827 828
828} 829}
829 830
830void KABCore::beamDone( Ir *ir ) 831void KABCore::beamDone( Ir *ir )
831{ 832{
832#ifndef DESKTOP_VERSION 833#ifndef DESKTOP_VERSION
833 delete ir; 834 delete ir;
834#endif 835#endif
836 topLevelWidget()->raise();
835} 837}
836 838
837 839
838void KABCore::browse( const QString& url ) 840void KABCore::browse( const QString& url )
839{ 841{
840#ifndef KAB_EMBEDDED 842#ifndef KAB_EMBEDDED
841 kapp->invokeBrowser( url ); 843 kapp->invokeBrowser( url );
842#else //KAB_EMBEDDED 844#else //KAB_EMBEDDED
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1f2c6da..3e0a27d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2318,46 +2318,54 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2318 bool addText = false; 2318 bool addText = false;
2319 if ( delSel.count() < 10 ) 2319 if ( delSel.count() < 10 )
2320 addText = true; 2320 addText = true;
2321 else { 2321 else {
2322 description.sprintf(i18n(" %d items?"),delSel.count() ); 2322 description.sprintf(i18n(" %d items?"),delSel.count() );
2323 } 2323 }
2324 while ( incidence ) { 2324 while ( incidence ) {
2325 Incidence *in = incidence->clone(); 2325 Incidence *in = incidence->clone();
2326 if ( ! in->summary().isEmpty() ) {
2327 in->setDescription("");
2328 } else {
2329 in->setSummary( in->description().left(20));
2330 in->setDescription("");
2331 }
2326 if ( addText ) 2332 if ( addText )
2327 description += in->summary() + "\n"; 2333 description += in->summary() + "\n";
2328 cal->addIncidence( in ); 2334 cal->addIncidence( in );
2329 incidence = delSel.next(); 2335 incidence = delSel.next();
2330 } 2336 }
2331 if ( beamDialog->beamVcal() ) { 2337 if ( beamDialog->beamVcal() ) {
2332 fn += ".vcs"; 2338 fn += ".vcs";
2333 FileStorage storage( cal, fn, new VCalFormat ); 2339 FileStorage storage( cal, fn, new VCalFormat );
2334 storage.save(); 2340 storage.save();
2335 } else { 2341 } else {
2336 fn += ".ics"; 2342 fn += ".ics";
2337 FileStorage storage( cal, fn, new ICalFormat( ) ); 2343 FileStorage storage( cal, fn, new ICalFormat( ) );
2338 storage.save(); 2344 storage.save();
2339 } 2345 }
2340 delete cal; 2346 delete cal;
2341 mes = i18n("KO/Pi: Ready for beaming"); 2347 mes = i18n("KO/Pi: Ready for beaming");
2342 setCaption(mes); 2348 topLevelWidget()->setCaption(mes);
2343 2349 KApplication::convert2latin1( fn );
2344#ifndef DESKTOP_VERSION 2350#ifndef DESKTOP_VERSION
2345 Ir *ir = new Ir( this ); 2351 Ir *ir = new Ir( this );
2346 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2352 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2347 ir->send( fn, description, "text/x-vCalendar" ); 2353 ir->send( fn, description, "text/x-vCalendar" );
2348#endif 2354#endif
2349 } 2355 }
2350} 2356}
2351void CalendarView::beamDone( Ir *ir ) 2357void CalendarView::beamDone( Ir *ir )
2352{ 2358{
2353#ifndef DESKTOP_VERSION 2359#ifndef DESKTOP_VERSION
2354 delete ir; 2360 delete ir;
2355#endif 2361#endif
2362 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2363 topLevelWidget()->raise();
2356} 2364}
2357 2365
2358void CalendarView::moveIncidence(Incidence * inc ) 2366void CalendarView::moveIncidence(Incidence * inc )
2359{ 2367{
2360 if ( !inc ) return; 2368 if ( !inc ) return;
2361 // qDebug("showDatePickerForIncidence( ) "); 2369 // qDebug("showDatePickerForIncidence( ) ");
2362 if ( mDateFrame->isVisible() ) 2370 if ( mDateFrame->isVisible() )
2363 mDateFrame->hide(); 2371 mDateFrame->hide();
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index 98ef2f2..56c01af 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -59,16 +59,38 @@ void KApplication::showFile(QString caption, QString fn)
59 } 59 }
60 QTextStream ts( &file ); 60 QTextStream ts( &file );
61 text = ts.read(); 61 text = ts.read();
62 file.close(); 62 file.close();
63 KApplication::showText( caption, text ); 63 KApplication::showText( caption, text );
64 64
65} 65}
66 66
67bool KApplication::convert2latin1(QString fileName)
68{
69 QString text;
70 QFile file( fileName );
71 if (!file.open( IO_ReadOnly ) ) {
72 return false;
73
74 }
75 QTextStream ts( &file );
76 ts.setEncoding( QTextStream::UnicodeUTF8 );
77 text = ts.read();
78 file.close();
79 if (!file.open( IO_WriteOnly ) ) {
80 return false;
81 }
82 QTextStream tsIn( &file );
83 tsIn.setEncoding( QTextStream::Latin1 );
84 tsIn << text.latin1();
85 file.close();
86
87
88}
67void KApplication::showText(QString caption, QString text) 89void KApplication::showText(QString caption, QString text)
68{ 90{
69 QDialog dia( 0, "name", true ); ; 91 QDialog dia( 0, "name", true ); ;
70 dia.setCaption( caption ); 92 dia.setCaption( caption );
71 QVBoxLayout* lay = new QVBoxLayout( &dia ); 93 QVBoxLayout* lay = new QVBoxLayout( &dia );
72 lay->setSpacing( 3 ); 94 lay->setSpacing( 3 );
73 lay->setMargin( 3 ); 95 lay->setMargin( 3 );
74 QTextBrowser tb ( &dia ); 96 QTextBrowser tb ( &dia );
diff --git a/microkde/kapplication.h b/microkde/kapplication.h
index 79cdb33..41546a0 100644
--- a/microkde/kapplication.h
+++ b/microkde/kapplication.h
@@ -15,12 +15,13 @@ class KApplication
15 * @param length Generate a string of this length. 15 * @param length Generate a string of this length.
16 * @return the random string 16 * @return the random string
17 */ 17 */
18 static QString randomString(int length); 18 static QString randomString(int length);
19 static int execDialog( QDialog* ); 19 static int execDialog( QDialog* );
20 static void showLicence(); 20 static void showLicence();
21 static void showFile(QString caption, QString file); 21 static void showFile(QString caption, QString file);
22 static void showText(QString caption, QString text); 22 static void showText(QString caption, QString text);
23 static bool convert2latin1(QString file);
23}; 24};
24 25
25 26
26#endif 27#endif