By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 2625
Collapse All | Expand All

(-)a/tdelibs.orig/tdeabc/plugins/file/resourcefile.cpp (-29 / +53 lines)
Lines 164-196 bool ResourceFile::doOpen() Link Here
164
164
165
    if ( file.size() == 0 ) {
165
    if ( file.size() == 0 ) {
166
      file.close();
166
      file.close();
167
      kdDebug() << "File size is zero. Evaluating backups" << endl;
167
      kdDebug(5700) << "File size is zero. Evaluating backups" << endl;
168
      for (int i=0; i!=20; i++)
168
      for (int i=0; i!=20; i++)
169
      {
169
      {
170
        TQFile backup( mFileName + "__" + TQString::number(i) );
170
        TQFile backup( mFileName + "__" + TQString::number(i) );
171
        kdDebug() << "Evaluating" << backup.name() << " size: " << backup.size() << endl;
171
        kdDebug(5700) << "Evaluating" << backup.name() << " size: " << backup.size() << endl;
172
        if ( backup.size() != 0 )
172
        if ( backup.size() != 0 )
173
        {
173
        {
174
          kdDebug() << "Restoring backup " << i << endl;
174
          kdDebug(5700) << "Restoring backup " << i << endl;
175
          const TQString src = mFileName + "__" + TQString::number(i);
175
          const TQString src = mFileName + "__" + TQString::number(i);
176
          const TQString dest = mFileName;
176
          const TQString dest = mFileName;
177
177
178
          // copy src to dest
179
          if ( ! backup.open( IO_ReadOnly ) ) {
180
//             const TQByteArray data = backup.readAll();
181
	    kdDebug(5700) << "can not open source for reading " << src << endl;
182
	    continue;
183
	  }
184
178
          // remove dest
185
          // remove dest
179
          TQFile::remove( dest );
186
          TQFile::remove( dest );
180
187
181
          // copy src to dest
188
	  TQString text;
182
          if ( backup.open( IO_ReadOnly ) ) {
189
	  TQTextStream instream( &backup );
183
            const TQByteArray data = backup.readAll();
190
	  instream.setEncoding( TQTextStream::UnicodeUTF8 );
184
191
	  text = instream.read();
185
            TQFile out( dest );
192
	  backup.close();
186
            if ( out.open( IO_WriteOnly ) ) {
193
187
              out.writeBlock( data );
194
	  TQFile out( dest );
188
              out.close();
195
	  if ( ! out.open( IO_WriteOnly ) ) {
189
            }
196
//          out.writeBlock( data );
190
197
		kdDebug(5700) << "can not open target for writing " << dest << endl;
191
            backup.close();
198
		continue;
192
          }
199
	  }
193
          return true; 
200
	  TQTextStream outstream( &out );
201
	  outstream.setEncoding( TQTextStream::UnicodeUTF8 );
202
	  outstream << text;
203
	  out.close();
204
205
          return true;
194
        }
206
        }
195
      }
207
      }
196
      return true;
208
      return true;
Lines 248-254 bool ResourceFile::save( Ticket * ) Link Here
248
  TQFile file( mFileName + "__0" );
260
  TQFile file( mFileName + "__0" );
249
  if ( file.size() != 0 ) {
261
  if ( file.size() != 0 ) {
250
    const TQString last = mFileName + "__20";
262
    const TQString last = mFileName + "__20";
251
    kdDebug() << "deleting " << last << endl;
263
    kdDebug(5700) << "deleting " << last << endl;
252
264
253
    TQFile::remove( last );
265
    TQFile::remove( last );
254
266
Lines 260-287 bool ResourceFile::save( Ticket * ) Link Here
260
272
261
      // copy src to dest
273
      // copy src to dest
262
      TQFile in( src );
274
      TQFile in( src );
263
      if ( in.open( IO_ReadOnly ) ) {
275
      if ( ! in.exists() )
264
        const TQByteArray data = in.readAll();
276
	continue;
265
277
      if ( ! in.open( IO_ReadOnly ) ) {
266
        TQFile out( dest );
278
//         const TQByteArray data = in.readAll();
267
        if ( out.open( IO_WriteOnly ) ) {
279
	  kdDebug(5700) << "can not open source for reading " << src << endl;
268
          out.writeBlock( data );
280
	  return false;
269
          out.close();
270
        }
271
272
        in.close();
273
      }
281
      }
282
      TQString text;
283
      TQTextStream instream( &in );
284
285
      instream.setEncoding( TQTextStream::UnicodeUTF8 );
286
      text = instream.read();
287
      in.close();
288
289
      TQFile out( dest );
290
      if ( ! out.open( IO_WriteOnly ) ) {
291
//          out.writeBlock( data );
292
	  kdDebug(5700) << "can not open target for writing " << dest << endl;
293
	  return false;
294
      }
295
      TQTextStream outstream( &out );
296
      outstream.setEncoding( TQTextStream::UnicodeUTF8 );
297
      outstream << text;
298
      out.close();
274
299
275
      // remove src
300
      // remove src
276
      TQFile::remove( src );
301
      TQFile::remove( src );
277
    }
302
    }
278
  } else
303
  } else
279
    kdDebug() << "Not starting logrotate __0 is 0 bytes." << endl;
304
    kdDebug(5700) << "Not starting logrotate __0 is 0 bytes." << endl;
280
305
281
  TQString extension = "__0";
306
  TQString extension = "__0";
282
  (void) KSaveFile::backupFile( mFileName, TQString::null /*directory*/,
307
  (void) KSaveFile::backupFile( mFileName, TQString::null /*directory*/,
283
                                extension );
308
                                extension );
284
285
  mDirWatch.stopScan();
309
  mDirWatch.stopScan();
286
310
287
  KSaveFile saveFile( mFileName );
311
  KSaveFile saveFile( mFileName );
(-)a/tdelibs.orig/tdeabc/vcardformatplugin.cpp (-4 / +12 lines)
Lines 41-47 bool VCardFormatPlugin::load( Addressee &addressee, TQFile *file ) Link Here
41
  TQString data;
41
  TQString data;
42
42
43
  TQTextStream t( file );
43
  TQTextStream t( file );
44
  t.setEncoding( TQTextStream::Latin1 );
44
  t.setEncoding( TQTextStream::UnicodeUTF8 );
45
  data = t.read();
45
  data = t.read();
46
46
47
  VCardConverter converter;
47
  VCardConverter converter;
Lines 60-66 bool VCardFormatPlugin::loadAll( AddressBook*, Resource *resource, TQFile *file Link Here
60
  TQString data;
60
  TQString data;
61
61
62
  TQTextStream t( file );
62
  TQTextStream t( file );
63
  t.setEncoding( TQTextStream::Latin1 );
63
  t.setEncoding( TQTextStream::UnicodeUTF8 );
64
  data = t.read();
64
  data = t.read();
65
65
66
  VCardConverter converter;
66
  VCardConverter converter;
Lines 88-94 void VCardFormatPlugin::save( const Addressee &addressee, TQFile *file ) Link Here
88
88
89
  TQTextStream t( file );
89
  TQTextStream t( file );
90
  t.setEncoding( TQTextStream::UnicodeUTF8 );
90
  t.setEncoding( TQTextStream::UnicodeUTF8 );
91
  t << converter.createVCards( vcardlist );
91
  TQString text = converter.createVCards( vcardlist );
92
//  kdDebug(5700)<< ">>>>>>>>> DEBUG <<<<<<<<<<" << endl;
93
//  kdDebug(5700)<< text << endl;
94
//  kdDebug(5700)<< ">>>>>>>>> DEBUG <<<<<<<<<<" << endl;
95
  t << text;
92
}
96
}
93
97
94
void VCardFormatPlugin::saveAll( AddressBook*, Resource *resource, TQFile *file )
98
void VCardFormatPlugin::saveAll( AddressBook*, Resource *resource, TQFile *file )
Lines 104-110 void VCardFormatPlugin::saveAll( AddressBook*, Resource *resource, TQFile *file Link Here
104
108
105
  TQTextStream t( file );
109
  TQTextStream t( file );
106
  t.setEncoding( TQTextStream::UnicodeUTF8 );
110
  t.setEncoding( TQTextStream::UnicodeUTF8 );
107
  t << converter.createVCards( vcardlist );
111
  TQString text = converter.createVCards( vcardlist );
112
//  kdDebug(5700)<< ">>>>>>>>> DEBUG <<<<<<<<<<" << endl;
113
//  kdDebug(5700)<< text << endl;
114
//  kdDebug(5700)<< ">>>>>>>>> DEBUG <<<<<<<<<<" << endl;
115
  t << text;
108
}
116
}
109
117
110
bool VCardFormatPlugin::checkFormat( TQFile *file ) const
118
bool VCardFormatPlugin::checkFormat( TQFile *file ) const
(-)a/tdelibs.orig/tdeabc/vcardparser/CMakeLists.txt (+78 lines)
Lines 11-24 Link Here
11
11
12
include_directories(
12
include_directories(
13
  ${TQT_INCLUDE_DIRS}
13
  ${TQT_INCLUDE_DIRS}
14
  ${CMAKE_BINARY_DIR}
15
  ${CMAKE_SOURCE_DIR}
14
  ${CMAKE_BINARY_DIR}/tdecore
16
  ${CMAKE_BINARY_DIR}/tdecore
15
  ${CMAKE_SOURCE_DIR}/tdecore
17
  ${CMAKE_SOURCE_DIR}/tdecore
18
  ${CMAKE_BINARY_DIR}/tdeabc
19
  ${CMAKE_SOURCE_DIR}/tdeabc
20
  ${CMAKE_SOURCE_DIR}/tdeabc/vcard/include
21
  ${CMAKE_SOURCE_DIR}/tdeabc/vcard/include/generated
22
  ${CMAKE_SOURCE_DIR}/tdeio/tdeio
23
  ${CMAKE_SOURCE_DIR}/dcop
16
)
24
)
17
25
18
link_directories(
26
link_directories(
19
  ${TQT_LIBRARY_DIRS}
27
  ${TQT_LIBRARY_DIRS}
20
)
28
)
21
29
30
set( TDEABC_TESTS_LINK
31
  ${TQT_LIBRARIES}
32
  DCOP-shared
33
  tdecore-shared
34
  tdeui-shared
35
  tdefx-shared
36
  tdeio-shared
37
  tdetexteditor-shared
38
  tdeabc-shared
39
)
22
40
23
##### headers ###################################
41
##### headers ###################################
24
42
Lines 38-40 set( ${target}_SRCS Link Here
38
tde_add_library( ${target} STATIC_PIC
56
tde_add_library( ${target} STATIC_PIC
39
  SOURCES ${${target}_SRCS}
57
  SOURCES ${${target}_SRCS}
40
)
58
)
59
60
61
##### test programs ##############################
62
63
tde_add_executable( testread
64
  SOURCES testread.cpp AUTOMOC
65
  LINK ${TDEABC_TESTS_LINK}
66
)
67
68
tde_add_executable( testread2
69
  SOURCES testread2.cpp testutils.cpp AUTOMOC
70
  LINK ${TDEABC_TESTS_LINK}
71
)
72
73
tde_add_executable( testwrite
74
  SOURCES testwrite.cpp AUTOMOC
75
  LINK ${TDEABC_TESTS_LINK}
76
)
77
78
tde_add_executable( testwrite2
79
  SOURCES testwrite2.cpp AUTOMOC
80
  LINK ${TDEABC_TESTS_LINK}
81
)
82
83
tde_add_executable( testvcardformat
84
  SOURCES testvcardformat.cpp AUTOMOC
85
  LINK ${TDEABC_TESTS_LINK}
86
)
87
88
tde_add_executable( testvcardformatimpl
89
  SOURCES testvcardformatimpl.cpp AUTOMOC
90
  LINK ${TDEABC_TESTS_LINK}
91
)
92
93
add_custom_target(testing ALL
94
   COMMAND echo "creating test infrastructure"
95
   DEPENDS testread
96
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
97
)
98
99
add_custom_command(
100
  TARGET testing PRE_BUILD
101
  COMMAND test
102
  ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/test.sh || ln -s ${CMAKE_SOURCE_DIR}/tdeabc/vcardparser/test.sh ${CMAKE_CURRENT_BINARY_DIR}
103
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
104
)
105
106
add_custom_command(
107
  TARGET testing PRE_BUILD
108
  COMMAND test
109
  ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/checkvcard.pl || ln -s ${CMAKE_SOURCE_DIR}/tdeabc/vcardparser/checkvcard.pl ${CMAKE_CURRENT_BINARY_DIR}
110
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
111
)
112
113
add_custom_command(
114
  TARGET testing PRE_BUILD
115
  COMMAND test
116
  ARGS -d ${CMAKE_CURRENT_BINARY_DIR}/tests || ln -s ${CMAKE_SOURCE_DIR}/tdeabc/vcardparser/tests ${CMAKE_CURRENT_BINARY_DIR}
117
  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
118
)
(-)a/tdelibs.orig/tdeabc/vcardparser/checkvcard.pl (-43 / +32 lines)
Lines 1-69 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
use utf8;
4
use strict;
5
use warnings;
6
3
if ( @ARGV != 1 ) {
7
if ( @ARGV != 1 ) {
4
  print STDERR "Missing arg: filename\n";
8
  print STDERR "Missing arg: filename\n";
5
  exit 1;
9
  exit 1;
6
}
10
}
7
11
8
$file = $ARGV[0];
12
my $file = $ARGV[0];
13
my $ref = "$file.ref";
9
14
10
if ( !open( IN, "$file" ) ) {
15
my $options="";
11
  print STDERR "Unable to open '$file'\n";
16
my $error=0;
12
  exit 1;
17
my @prscont;
13
}
18
my @refcont;
14
19
20
open( IN, "<", $file ) || die ("Unable to open $file");
15
while( <IN> ) {
21
while( <IN> ) {
16
  if (/^VERSION:(.*)$/ ) {
22
  if (/^VERSION:(.*)$/ ) { my $v = $1; $options = "--vcard21" if $v eq "2.1"; }
17
    $version = $1;
18
    if ( $version eq "2.1" ) { $options = "--vcard21"; }
19
  }
20
}
23
}
21
22
close IN;
24
close IN;
23
25
24
$ref = "$file.ref";
26
open( REF, "$ref" ) ||  die ("Unable to open $ref");
25
27
while( <REF> ) { 
26
if ( !open( REF, "$ref" ) ) {
28
  next if $_ =~ /^UID/;
27
  print STDERR "Unable to open $ref\n";
29
  push @refcont , $_ ; 
28
  exit 1;
29
}
30
31
while( <REF> ) {
32
  push @ref, $_;
33
}
30
}
34
35
close REF;
31
close REF;
36
32
37
if ( !open( READ, "./testread $file $options 2> /dev/null |" ) ) {
33
open( READ, "./testread $file $options 2> /dev/null |" ) || die  ("Unable to open testread");
38
  print STDERR "Unable to open testread\n";
34
print "Checking: $file ";
39
  exit 1;
40
}
41
42
print "Checking '$file':\n";
43
44
$gotsomething = 0;
45
$error = 0;
46
$i = 0;
47
while( <READ> ) {
35
while( <READ> ) {
48
  $gotsomething = 1;
36
  next if $_ =~ /^UID/;
49
  $out = $_;
37
  push @prscont , $_;
50
  $ref = @ref[$i++];
51
52
  if ( $out ne $ref ) {
53
    if ( $ref =~ /^UID/ && $out =~ /^UID/ ) { next; }
54
    $error++;
55
    print "  Expected      : $ref";
56
    print "  Parser output : $out";
57
  }
58
}
38
}
59
60
close READ;
39
close READ;
61
40
62
if ( $gotsomething == 0 ) {
41
63
  print "\n  FAILED: testread didn't output anything\n";
42
if ( $#refcont != $#prscont ) {
43
  print "\n  FAILED: ref size and parsed size mismatch.\n";
64
  system "touch FAILED";
44
  system "touch FAILED";
65
  exit 1;
45
  exit 1;
66
}
46
}
47
48
for (my $i=0; $i<=$#refcont; $i++) {
49
   if ( $refcont[$i] ne $prscont[$i] ) {
50
	$error++;
51
	print "\n  Expected      : $refcont[$i]";
52
	print "  Parser output : $prscont[$i]";
53
   }
54
}
55
67
if ( $error > 0 ) {
56
if ( $error > 0 ) {
68
  print "\n  FAILED: $error errors found.\n";
57
  print "\n  FAILED: $error errors found.\n";
69
  system "touch FAILED";
58
  system "touch FAILED";
(-)a/tdelibs-trinity-14.0.3/tdeabc/vcardparser/test.sh (+6 lines)
Line 0 Link Here
1
TESTFILES="vcard1.vcf vcard2.vcf vcard3.vcf vcard4.vcf vcard6.vcf vcard7.vcf vcard8.vcf vcard9.vcf"
2
3
test -f FAILED && rm -f FAILED;
4
for i in $TESTFILES;
5
  do perl ./checkvcard.pl ./tests/$i ;
6
done;
(-)a/tdelibs.orig/tdeabc/vcardparser/testread.cpp (-2 / +2 lines)
Lines 30-36 Link Here
30
#include <tdelocale.h>
30
#include <tdelocale.h>
31
#include <tdeaboutdata.h>
31
#include <tdeaboutdata.h>
32
32
33
#include "vcardconverter.h"
33
#include "tdeabc/vcardconverter.h"
34
#include "vcard.h"
34
#include "vcard.h"
35
35
36
static const TDECmdLineOptions options[] =
36
static const TDECmdLineOptions options[] =
Lines 70-76 int main( int argc, char **argv ) Link Here
70
  TQString text;
70
  TQString text;
71
71
72
  TQTextStream s( &file );
72
  TQTextStream s( &file );
73
  s.setEncoding( TQTextStream::Latin1 );
73
  s.setEncoding( TQTextStream::UnicodeUTF8 );
74
  text = s.read();
74
  text = s.read();
75
  file.close();
75
  file.close();
76
76
(-)a/tdelibs.orig/tdeabc/vcardparser/testread2.cpp (+2 lines)
Lines 34-40 main() Link Here
34
            kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
34
            kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
35
        } else {
35
        } else {
36
            kdDebug()<<"\tAddressee  - FAILED"<<endl;
36
            kdDebug()<<"\tAddressee  - FAILED"<<endl;
37
            kdDebug()<<">>>>>>>Addressee from code<<<<<<<<"<<endl;
37
            (*itr1).dump();
38
            (*itr1).dump();
39
            kdDebug()<<">>>>>>>Addressee from file<<<<<<<<"<<endl;
38
            (*itr2).dump();
40
            (*itr2).dump();
39
            //kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
41
            //kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
40
        }
42
        }
(-)a/tdelibs-trinity-14.0.3/tdeabc/vcardparser/tests/vcard8.vcf (+12 lines)
Line 0 Link Here
1
BEGIN:VCARD
2
ADR;TYPE=home:;;Müllerstrasse 21;Wörthersee;Kärnten;8400;Österreich;
3
ORG:HansWürstel AG
4
EMAIL:boehmermann@wuerstel.com
5
FN:Jahn Böhmermann
6
N:Böhmermann;Jahn;;;
7
TITLE:Komödiant
8
REV:2016-04-02T23:54:06Z
9
TEL;TYPE=VOICE,MSG,WORK:+43 699373419
10
VERSION:3.0
11
X-GENDER-GENDER:Male
12
END:VCARD
(-)a/tdelibs-trinity-14.0.3/tdeabc/vcardparser/tests/vcard8.vcf.ref (+14 lines)
Line 0 Link Here
1
BEGIN:VCARD
2
ADR;TYPE=home:;;Müllerstrasse 21;Wörthersee;Kärnten;8400;Österreich
3
EMAIL:boehmermann@wuerstel.com
4
FN:Jahn Böhmermann
5
N:Böhmermann;Jahn;;;
6
ORG:HansWürstel AG
7
REV:2016-04-02T23:54:06Z
8
TEL;TYPE=MSG;TYPE=VOICE;TYPE=WORK:+43 699373419
9
TITLE:Komödiant
10
UID:vz7nMFMbYE
11
VERSION:3.0
12
X-GENDER-GENDER:Male
13
END:VCARD
14
(-)a/tdelibs-trinity-14.0.3/tdeabc/vcardparser/tests/vcard9.vcf (+14 lines)
Line 0 Link Here
1
BEGIN:VCARD
2
ADR;TYPE=home:;;Цар Борис III;София;София град;1000;България
3
ORG:България ООД
4
EMAIL:иван.иванов@българия.com
5
FN:Иван Иванов
6
NAME:Иван
7
N:Иванов;
8
TITLE:Др
9
REV:2016-04-03T23:54:06Z
10
TEL;TYPE=VOICE,MSG,WORK:+359 888 111 222
11
VERSION:3.0
12
X-GENDER-GENDER:Male
13
END:VCARD
14
(-)a/tdelibs-trinity-14.0.3/tdeabc/vcardparser/tests/vcard9.vcf.ref (+15 lines)
Line 0 Link Here
1
BEGIN:VCARD
2
ADR;TYPE=home:;;Цар Борис III;София;София град;1000;България
3
EMAIL:иван.иванов@българия.com
4
FN:Иван Иванов
5
N:Иванов;;;;
6
NAME:Иван
7
ORG:България ООД
8
REV:2016-04-03T23:54:06Z
9
TEL;TYPE=MSG;TYPE=VOICE;TYPE=WORK:+359 888 111 222
10
TITLE:Др
11
UID:nzIRLdymsP
12
VERSION:3.0
13
X-GENDER-GENDER:Male
14
END:VCARD
15
(-)a/tdelibs.orig/tdeabc/vcardparser/testutils.cpp (-4 / +53 lines)
Lines 1-6 Link Here
1
#include <vcardparser.h>
1
#include "vcardparser.h"
2
#include <tdeabc/addressee.h>
2
#include <tdeabc/addressee.h>
3
#include <tqfile.h>
3
#include <tqfile.h>
4
#include <tqstring.h>
4
5
5
using namespace TDEABC;
6
using namespace TDEABC;
6
7
Lines 60-67 vcard3() Link Here
60
    return addr;
61
    return addr;
61
}
62
}
62
63
64
Addressee
65
vcard8()
66
{
67
    Addressee addr;
68
69
    addr.setName( TQString::fromUtf8("Jahn") );
70
    addr.setFamilyName( TQString::fromUtf8("Böhmermann") );
71
    addr.setFormattedName( TQString::fromUtf8("Jahn Böhmermann") );
72
    addr.setOrganization( TQString::fromUtf8("HansWürstel AG") );
73
    addr.insertEmail( TQString::fromUtf8("boehmermann@wuerstel.com") );
74
    addr.setTitle( TQString::fromUtf8("Komödiant") );
75
    addr.insertPhoneNumber( PhoneNumber("+43 699373419",PhoneNumber::Voice|PhoneNumber::Msg|PhoneNumber::Work) );
76
    Address a( Address::Work );
77
    a.setStreet( TQString::fromUtf8("Müllerstrasse 21") );
78
    a.setLocality( TQString::fromUtf8("Wörthersee") );
79
    a.setRegion( TQString::fromUtf8("Kärnten") );
80
    a.setPostalCode( "8400" );
81
    a.setCountry( TQString::fromUtf8("Österreich") );
82
    addr.insertAddress( a );
83
    return addr;
84
}
85
86
Addressee
87
vcard9()
88
{
89
    Addressee addr;
90
91
    addr.setName( TQString::fromUtf8("Иван") );
92
    addr.setFamilyName( TQString::fromUtf8("Иванов") );
93
    addr.setFormattedName( TQString::fromUtf8("Иван Иванов") );
94
    addr.setOrganization( TQString::fromUtf8("България ООД") );
95
    addr.insertEmail( TQString::fromUtf8("иван.иванов@българия.com") );
96
    addr.setTitle( TQString::fromUtf8("Др") );
97
    addr.insertPhoneNumber( PhoneNumber("+359 888 111 222",PhoneNumber::Voice|PhoneNumber::Msg|PhoneNumber::Work) );
98
    Address a( Address::Work );
99
    a.setStreet( TQString::fromUtf8("Цар Борис III") );
100
    a.setLocality( TQString::fromUtf8("София") );
101
    a.setRegion( TQString::fromUtf8("София град") );
102
    a.setPostalCode( "1000" );
103
    a.setCountry( TQString::fromUtf8("България") );
104
    addr.insertAddress( a );
105
    return addr;
106
}
107
63
108
64
QString
109
TQString
65
vcardAsText( const TQString& location )
110
vcardAsText( const TQString& location )
66
{
111
{
67
    TQString line;
112
    TQString line;
Lines 84-99 vCardsAsAddresseeList() Link Here
84
    l.append( vcard1() );
129
    l.append( vcard1() );
85
    l.append( vcard2() );
130
    l.append( vcard2() );
86
    l.append( vcard3() );
131
    l.append( vcard3() );
132
    l.append( vcard8() );
133
    l.append( vcard9() );
87
134
88
    return l;
135
    return l;
89
}
136
}
90
137
91
QString
138
TQString
92
vCardsAsText()
139
 vCardsAsText()
93
{
140
{
94
    TQString vcards = vcardAsText( "tests/vcard1.vcf" );
141
    TQString vcards = vcardAsText( "tests/vcard1.vcf" );
95
    vcards += vcardAsText( "tests/vcard2.vcf" );
142
    vcards += vcardAsText( "tests/vcard2.vcf" );
96
    vcards += vcardAsText( "tests/vcard3.vcf" );
143
    vcards += vcardAsText( "tests/vcard3.vcf" );
144
    vcards += vcardAsText( "tests/vcard8.vcf" );
145
    vcards += vcardAsText( "tests/vcard9.vcf" );
97
146
98
    return vcards;
147
    return vcards;
99
}
148
}
(-)a/tdelibs-trinity-14.0.3/tdeabc/vcardparser/testvcardformat.cpp (+178 lines)
Line 0 Link Here
1
2
/*
3
    This file is part of libtdeabc.
4
5
    This library is free software; you can redistribute it and/or
6
    modify it under the terms of the GNU Library General Public
7
    License as published by the Free Software Foundation; either
8
    version 2 of the License, or (at your option) any later version.
9
10
    This library is distributed in the hope that it will be useful,
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
    Library General Public License for more details.
14
15
    You should have received a copy of the GNU Library General Public License
16
    along with this library; see the file COPYING.LIB.  If not, write to
17
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
    Boston, MA 02110-1301, USA.
19
*/
20
21
#include <kdebug.h>
22
#include <tdeapplication.h>
23
#include <tdecmdlineargs.h>
24
// #include <tdelocale.h>
25
#include <tdeaboutdata.h>
26
27
#include "vcardformatplugin.h"
28
29
using namespace TDEABC;
30
31
/**
32
 * 
33
 * @param argc 
34
 * @param argv 
35
 * @return 
36
 */
37
int
38
main( int argc, char **argv )
39
{
40
  TDEAboutData aboutData( "testvcardformatplugin", "vCard format plugin", "0.1" );
41
42
  TDECmdLineArgs::init( argc, argv, &aboutData );
43
44
  TDEApplication app( false, false );
45
  
46
47
  TDEABC::Addressee addressee;
48
49
  addressee.setNameFromString( TQString::fromUtf8("Иван Иванов") );
50
  addressee.setNickName( TQString::fromUtf8("иванчо") );
51
  addressee.setBirthday( TQDate( 1981, 7, 19 ) );
52
  addressee.setMailer( "mutt1.2" );
53
  addressee.setTimeZone( TDEABC::TimeZone( +2 ) );
54
55
  TDEABC::Geo geo;
56
  geo.setLatitude( 30 );
57
  geo.setLongitude( 51 );
58
  addressee.setGeo( geo );
59
60
  addressee.setTitle( TQString::fromUtf8("Др") );
61
  addressee.setRole( TQString::fromUtf8("Самарянин") );
62
  addressee.setOrganization( TQString::fromUtf8("България ООД") );
63
  addressee.setNote( TQString::fromUtf8("не\nпипай работеща система") );
64
  addressee.setProductId( "testId" );
65
  addressee.setRevision( TQDateTime::currentDateTime() );
66
  addressee.setSortString( TQString::fromUtf8("сортиране") );
67
  addressee.setUrl( KURL( "http://wgess17.dyndns.org") );
68
  addressee.setSecrecy(  TDEABC::Secrecy( TDEABC::Secrecy::Confidential ) );
69
/*
70
  TQImage img;
71
  img.load( "testimg.png", "PNG" );
72
  TDEABC::Picture photo;
73
  photo.setData( img );
74
  addressee.setPhoto( photo );
75
76
  TQImage img2;
77
  img2.load( "testimg.png", "PNG" );
78
  TDEABC::Picture logo;
79
  logo.setData( img2 );
80
  addressee.setLogo( logo );
81
82
  TQFile soundFile( "testsound.wav" );
83
  soundFile.open( IO_ReadOnly );
84
  TQByteArray data = soundFile.readAll();
85
  soundFile.close();
86
  TDEABC::Sound sound;
87
  sound.setData( data );
88
  addressee.setSound( sound );
89
*/
90
  addressee.insertEmail( TQString::fromUtf8("иван.иванов@българия.оод"), true );
91
  addressee.insertEmail( TQString::fromUtf8("иванчо@yahoo.de"), true );
92
93
  TDEABC::PhoneNumber phone1( "029876543", TDEABC::PhoneNumber::Pref | TDEABC::PhoneNumber::Home );
94
  TDEABC::PhoneNumber phone2( "+359888111222", TDEABC::PhoneNumber::Work );
95
  addressee.insertPhoneNumber( phone1 );
96
  addressee.insertPhoneNumber( phone2 );
97
98
  TDEABC::Key key( "secret key", TDEABC::Key::X509 );
99
  addressee.insertKey( key );
100
101
  TQStringList categories;
102
  categories << "Friends" << "School" << "KDE";
103
  addressee.setCategories( categories );
104
105
  TDEABC::Address a( TDEABC::Address::Work | TDEABC::Address::Postal | TDEABC::Address::Parcel );
106
  a.setStreet( TQString::fromUtf8("Цар Борис III") );
107
  a.setLocality( TQString::fromUtf8("София" ));
108
  a.setRegion( TQString::fromUtf8("София град" ));
109
  a.setPostalCode( TQString::fromUtf8("1000" ));
110
  a.setCountry( TQString::fromUtf8("България" ));
111
  addressee.insertAddress( a );
112
113
  addressee.insertCustom( "1hsdf", "test1",TQString::fromUtf8( "ежзик" ));
114
  addressee.insertCustom( "2hsdf", "test2",TQString::fromUtf8( "ежзик" ));
115
  addressee.insertCustom( "3hsdf", "test3",TQString::fromUtf8( "ежзик" ));
116
117
  addressee.dump();
118
119
//   TDEABC::Addressee::List list;
120
//   for ( int i = 0; i < 20; ++i ) {
121
//     TDEABC::Addressee addr = addressee;
122
//     addr.setUid( TQString::number( i ) );
123
//     list.append( addr );
124
//   }
125
126
//   TDEABC::VCardConverter converter;
127
//   TQString txt = converter.createVCards( list );
128
// 
129
//   TQFile file( "out2.vcf" );
130
//   file.open( IO_WriteOnly );
131
// 
132
//   TQTextStream s( &file );
133
//   s.setEncoding( TQTextStream::UnicodeUTF8 );
134
//   s << txt;
135
//   file.close();
136
137
  VCardFormatPlugin *vcfplugin = new VCardFormatPlugin();
138
  TQFile file( "vfout.vcf" );
139
  if ( file.open(IO_WriteOnly) ){
140
	vcfplugin->save(addressee, &file);
141
	file.close();
142
  }
143
144
  
145
  TDEABC::Addressee addressee2;
146
147
  if ( file.open(IO_ReadOnly ) ){
148
	vcfplugin->load(addressee2, &file);
149
	file.close();
150
  }
151
152
  addressee2.dump();
153
154
  return 0;
155
156
157
/*    Addressee::List::iterator itr1;
158
    Addressee::List::iterator itr2;
159
    for ( itr1 = l.begin(), itr2 = parsed.begin();
160
          itr1 != l.end(); ++itr1, ++itr2 ) {
161
        if ( (*itr1).fullEmail() == (*itr2).fullEmail() &&
162
             (*itr1).organization() == (*itr2).organization() &&
163
             (*itr1).phoneNumbers() == (*itr2).phoneNumbers()  &&
164
             (*itr1).emails() == (*itr2).emails() &&
165
             (*itr1).role() == (*itr2).role()  ) {
166
            kdDebug()<<"\tAddressee  - PASSED"<<endl;
167
            kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
168
        } else {
169
            kdDebug()<<"\tAddressee  - FAILED"<<endl;
170
            kdDebug()<<">>>>>>>Addressee from code<<<<<<<<"<<endl;
171
            (*itr1).dump();
172
            kdDebug()<<">>>>>>>Addressee from file<<<<<<<<"<<endl;
173
            (*itr2).dump();
174
            //kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
175
        }
176
    }
177
*/
178
}
(-)a/tdelibs-trinity-14.0.3/tdeabc/vcardparser/testvcardformatimpl.cpp (+174 lines)
Line 0 Link Here
1
2
/*
3
    This file is part of libtdeabc.
4
5
    This library is free software; you can redistribute it and/or
6
    modify it under the terms of the GNU Library General Public
7
    License as published by the Free Software Foundation; either
8
    version 2 of the License, or (at your option) any later version.
9
10
    This library is distributed in the hope that it will be useful,
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
    Library General Public License for more details.
14
15
    You should have received a copy of the GNU Library General Public License
16
    along with this library; see the file COPYING.LIB.  If not, write to
17
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
    Boston, MA 02110-1301, USA.
19
*/
20
21
#include <kdebug.h>
22
#include <tdeapplication.h>
23
#include <tdecmdlineargs.h>
24
// #include <tdelocale.h>
25
#include <tdeaboutdata.h>
26
27
#include "vcardformatimpl.h"
28
29
using namespace TDEABC;
30
31
int
32
main( int argc, char **argv )
33
{
34
  TDEAboutData aboutData( "testvcardformatimpl", "vCard format plugin", "0.1" );
35
36
  TDECmdLineArgs::init( argc, argv, &aboutData );
37
38
  TDEApplication app( false, false );
39
  
40
41
  TDEABC::Addressee addressee;
42
43
  addressee.setNameFromString( TQString::fromUtf8("Иван Иванов") );
44
  addressee.setNickName( TQString::fromUtf8("иванчо") );
45
  addressee.setBirthday( TQDate( 1981, 7, 19 ) );
46
  addressee.setMailer( "mutt1.2" );
47
  addressee.setTimeZone( TDEABC::TimeZone( +2 ) );
48
49
  TDEABC::Geo geo;
50
  geo.setLatitude( 30 );
51
  geo.setLongitude( 51 );
52
  addressee.setGeo( geo );
53
54
  addressee.setTitle( TQString::fromUtf8("Др") );
55
  addressee.setRole( TQString::fromUtf8("Самарянин") );
56
  addressee.setOrganization( TQString::fromUtf8("България ООД") );
57
  addressee.setNote( TQString::fromUtf8("не\nпипай работеща система") );
58
  addressee.setProductId( "testId" );
59
  addressee.setRevision( TQDateTime::currentDateTime() );
60
  addressee.setSortString( TQString::fromUtf8("сортиране") );
61
  addressee.setUrl( KURL( "http://wgess17.dyndns.org") );
62
  addressee.setSecrecy(  TDEABC::Secrecy( TDEABC::Secrecy::Confidential ) );
63
/*
64
  TQImage img;
65
  img.load( "testimg.png", "PNG" );
66
  TDEABC::Picture photo;
67
  photo.setData( img );
68
  addressee.setPhoto( photo );
69
70
  TQImage img2;
71
  img2.load( "testimg.png", "PNG" );
72
  TDEABC::Picture logo;
73
  logo.setData( img2 );
74
  addressee.setLogo( logo );
75
76
  TQFile soundFile( "testsound.wav" );
77
  soundFile.open( IO_ReadOnly );
78
  TQByteArray data = soundFile.readAll();
79
  soundFile.close();
80
  TDEABC::Sound sound;
81
  sound.setData( data );
82
  addressee.setSound( sound );
83
*/
84
  addressee.insertEmail( TQString::fromUtf8("иван.иванов@българия.оод"), true );
85
  addressee.insertEmail( TQString::fromUtf8("иванчо@yahoo.de"), true );
86
87
  TDEABC::PhoneNumber phone1( "029876543", TDEABC::PhoneNumber::Pref | TDEABC::PhoneNumber::Home );
88
  TDEABC::PhoneNumber phone2( "+359888111222", TDEABC::PhoneNumber::Work );
89
  addressee.insertPhoneNumber( phone1 );
90
  addressee.insertPhoneNumber( phone2 );
91
92
  TDEABC::Key key( "secret key", TDEABC::Key::X509 );
93
  addressee.insertKey( key );
94
95
  TQStringList categories;
96
  categories << "Friends" << "School" << "KDE";
97
  addressee.setCategories( categories );
98
99
  TDEABC::Address a( TDEABC::Address::Work | TDEABC::Address::Postal | TDEABC::Address::Parcel );
100
  a.setStreet( TQString::fromUtf8("Цар Борис III") );
101
  a.setLocality( TQString::fromUtf8("София" ));
102
  a.setRegion( TQString::fromUtf8("София град" ));
103
  a.setPostalCode( TQString::fromUtf8("1000" ));
104
  a.setCountry( TQString::fromUtf8("България" ));
105
  addressee.insertAddress( a );
106
107
  addressee.insertCustom( "1hsdf", "test1",TQString::fromUtf8( "ежзик" ));
108
  addressee.insertCustom( "2hsdf", "test2",TQString::fromUtf8( "ежзик" ));
109
  addressee.insertCustom( "3hsdf", "test3",TQString::fromUtf8( "ежзик" ));
110
111
  addressee.dump();
112
113
  kdDebug() << ">>>>>>>>>>>>>>>>END FIRST ADDRESSEE<<<<<<<<<<<<<<" << endl;
114
115
//   TDEABC::Addressee::List list;
116
//   for ( int i = 0; i < 20; ++i ) {
117
//     TDEABC::Addressee addr = addressee;
118
//     addr.setUid( TQString::number( i ) );
119
//     list.append( addr );
120
//   }
121
122
//   TDEABC::VCardConverter converter;
123
//   TQString txt = converter.createVCards( list );
124
// 
125
//   TQFile file( "out2.vcf" );
126
//   file.open( IO_WriteOnly );
127
// 
128
//   TQTextStream s( &file );
129
//   s.setEncoding( TQTextStream::UnicodeUTF8 );
130
//   s << txt;
131
//   file.close();
132
133
  VCardFormatImpl *vcfImpl = new VCardFormatImpl();
134
  TQFile file( "vfimpout.vcf" );
135
  if ( file.open(IO_WriteOnly) ){
136
	vcfImpl->save(addressee, &file);
137
	file.close();
138
  }
139
140
  
141
  TDEABC::Addressee addressee2;
142
143
  if ( file.open(IO_ReadOnly ) ){
144
	vcfImpl->load(addressee2, &file);
145
	file.close();
146
  }
147
148
  addressee2.dump();
149
150
  return 0;
151
152
153
/*    Addressee::List::iterator itr1;
154
    Addressee::List::iterator itr2;
155
    for ( itr1 = l.begin(), itr2 = parsed.begin();
156
          itr1 != l.end(); ++itr1, ++itr2 ) {
157
        if ( (*itr1).fullEmail() == (*itr2).fullEmail() &&
158
             (*itr1).organization() == (*itr2).organization() &&
159
             (*itr1).phoneNumbers() == (*itr2).phoneNumbers()  &&
160
             (*itr1).emails() == (*itr2).emails() &&
161
             (*itr1).role() == (*itr2).role()  ) {
162
            kdDebug()<<"\tAddressee  - PASSED"<<endl;
163
            kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
164
        } else {
165
            kdDebug()<<"\tAddressee  - FAILED"<<endl;
166
            kdDebug()<<">>>>>>>Addressee from code<<<<<<<<"<<endl;
167
            (*itr1).dump();
168
            kdDebug()<<">>>>>>>Addressee from file<<<<<<<<"<<endl;
169
            (*itr2).dump();
170
            //kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl;
171
        }
172
    }
173
*/
174
}
(-)a/tdelibs-trinity-14.0.3/tdeabc/vcardparser/testwrite2.cpp (+136 lines)
Line 0 Link Here
1
/*
2
    This file is part of libtdeabc.
3
4
    This library is free software; you can redistribute it and/or
5
    modify it under the terms of the GNU Library General Public
6
    License as published by the Free Software Foundation; either
7
    version 2 of the License, or (at your option) any later version.
8
9
    This library is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
    Library General Public License for more details.
13
14
    You should have received a copy of the GNU Library General Public License
15
    along with this library; see the file COPYING.LIB.  If not, write to
16
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
    Boston, MA 02110-1301, USA.
18
*/
19
20
#include <tdeabc/addressee.h>
21
#include <tdeabc/phonenumber.h>
22
#include <tdeabc/address.h>
23
#include <tdeabc/key.h>
24
#include <tdeabc/picture.h>
25
#include <tdeabc/sound.h>
26
#include <tdeabc/secrecy.h>
27
#include <tdeaboutdata.h>
28
#include <tdeapplication.h>
29
#include <tdecmdlineargs.h>
30
31
#include <tqfile.h>
32
#include <tqtextstream.h>
33
34
#include "vcardconverter.h"
35
36
int main( int argc, char **argv )
37
{
38
  TDEAboutData aboutData( "testwrite", "vCard test writer", "0.1" );
39
40
  TDECmdLineArgs::init( argc, argv, &aboutData );
41
42
  TDEApplication app( false, false );
43
44
45
  TDEABC::Addressee addressee;
46
47
  addressee.setNameFromString( TQString::fromUtf8("Иван Иванов") );
48
  addressee.setNickName( TQString::fromUtf8("иванчо") );
49
  addressee.setBirthday( TQDate( 1981, 7, 19 ) );
50
  addressee.setMailer( "mutt1.2" );
51
  addressee.setTimeZone( TDEABC::TimeZone( +2 ) );
52
53
  TDEABC::Geo geo;
54
  geo.setLatitude( 30 );
55
  geo.setLongitude( 51 );
56
  addressee.setGeo( geo );
57
58
  addressee.setTitle( TQString::fromUtf8("Др") );
59
  addressee.setRole( TQString::fromUtf8("Самарянин") );
60
  addressee.setOrganization( TQString::fromUtf8("България ООД") );
61
  addressee.setNote( TQString::fromUtf8("не\nпипай работеща система") );
62
  addressee.setProductId( "testId" );
63
  addressee.setRevision( TQDateTime::currentDateTime() );
64
  addressee.setSortString( TQString::fromUtf8("сортиране") );
65
  addressee.setUrl( KURL( "http://wgess17.dyndns.org") );
66
  addressee.setSecrecy(  TDEABC::Secrecy( TDEABC::Secrecy::Confidential ) );
67
/*
68
  TQImage img;
69
  img.load( "testimg.png", "PNG" );
70
  TDEABC::Picture photo;
71
  photo.setData( img );
72
  addressee.setPhoto( photo );
73
74
  TQImage img2;
75
  img2.load( "testimg.png", "PNG" );
76
  TDEABC::Picture logo;
77
  logo.setData( img2 );
78
  addressee.setLogo( logo );
79
80
  TQFile soundFile( "testsound.wav" );
81
  soundFile.open( IO_ReadOnly );
82
  TQByteArray data = soundFile.readAll();
83
  soundFile.close();
84
  TDEABC::Sound sound;
85
  sound.setData( data );
86
  addressee.setSound( sound );
87
*/
88
  addressee.insertEmail( TQString::fromUtf8("иван.иванов@българия.оод"), true );
89
  addressee.insertEmail( TQString::fromUtf8("иванчо@yahoo.de"), true );
90
91
  TDEABC::PhoneNumber phone1( "029876543", TDEABC::PhoneNumber::Pref | TDEABC::PhoneNumber::Home );
92
  TDEABC::PhoneNumber phone2( "+359888111222", TDEABC::PhoneNumber::Work );
93
  addressee.insertPhoneNumber( phone1 );
94
  addressee.insertPhoneNumber( phone2 );
95
96
  TDEABC::Key key( "secret key", TDEABC::Key::X509 );
97
  addressee.insertKey( key );
98
99
  TQStringList categories;
100
  categories << "Friends" << "School" << "KDE";
101
  addressee.setCategories( categories );
102
103
  TDEABC::Address a( TDEABC::Address::Work | TDEABC::Address::Postal | TDEABC::Address::Parcel );
104
  a.setStreet( TQString::fromUtf8("Цар Борис III") );
105
  a.setLocality( TQString::fromUtf8("София" ));
106
  a.setRegion( TQString::fromUtf8("София град" ));
107
  a.setPostalCode( TQString::fromUtf8("1000" ));
108
  a.setCountry( TQString::fromUtf8("България" ));
109
  addressee.insertAddress( a );
110
111
  addressee.insertCustom( "1hsdf", "test1",TQString::fromUtf8( "ежзик" ));
112
  addressee.insertCustom( "2hsdf", "test2",TQString::fromUtf8( "ежзик" ));
113
  addressee.insertCustom( "3hsdf", "test3",TQString::fromUtf8( "ежзик" ));
114
115
  addressee.dump();
116
117
  TDEABC::Addressee::List list;
118
  for ( int i = 0; i < 20; ++i ) {
119
    TDEABC::Addressee addr = addressee;
120
    addr.setUid( TQString::number( i ) );
121
    list.append( addr );
122
  }
123
124
  TDEABC::VCardConverter converter;
125
  TQString txt = converter.createVCards( list );
126
127
  TQFile file( "out2.vcf" );
128
  file.open( IO_WriteOnly );
129
130
  TQTextStream s( &file );
131
  s.setEncoding( TQTextStream::UnicodeUTF8 );
132
  s << txt;
133
  file.close();
134
135
  return 0;
136
}
(-)a/tdelibs.orig/tdeabc/vcardparser/vcardparser.cpp (-3 / +3 lines)
Lines 151-158 VCard::List VCardParser::parseVCards( const TQString& text ) Link Here
151
            input = TQCString(value.latin1());
151
            input = TQCString(value.latin1());
152
            KCodecs::quotedPrintableDecode( input, output );
152
            KCodecs::quotedPrintableDecode( input, output );
153
          }
153
          }
154
        } else {
154
        } else { //assume it's in UTF-8 (as used in previous KDE versions)
155
          output = TQCString(value.latin1());
155
          output = TQCString(value.utf8());
156
        }
156
        }
157
157
158
        if ( params.findIndex( "charset" ) != -1 ) { // have to convert the data
158
        if ( params.findIndex( "charset" ) != -1 ) { // have to convert the data
Lines 275-281 TQString VCardParser::createVCards( const VCard::List& list ) Link Here
275
              for ( uint i = 0; i <= ( textLine.length() / FOLD_WIDTH ); ++i )
275
              for ( uint i = 0; i <= ( textLine.length() / FOLD_WIDTH ); ++i )
276
                text.append( ( i == 0 ? "" : " " ) + textLine.mid( i * FOLD_WIDTH, FOLD_WIDTH ) + "\r\n" );
276
                text.append( ( i == 0 ? "" : " " ) + textLine.mid( i * FOLD_WIDTH, FOLD_WIDTH ) + "\r\n" );
277
            } else
277
            } else
278
              text.append( textLine + "\r\n" );
278
            text.append( textLine + "\r\n" );
279
          }
279
          }
280
          else {
280
          else {
281
            // URIs can be full of weird symbols, etc. so bypass all checks
281
            // URIs can be full of weird symbols, etc. so bypass all checks

Return to bug 2625