49
49
Compat *compat = 0;
51
int korg = productId.indexOf( "KOrganizer" );
52
int outl9 = productId.indexOf( "Outlook 9.0" );
51
int korg = productId.indexOf( QLatin1String("KOrganizer") );
52
int outl9 = productId.indexOf( QLatin1String("Outlook 9.0") );
55
int versionStart = productId.indexOf( " ", korg );
55
int versionStart = productId.indexOf( QLatin1String(" "), korg );
56
56
if ( versionStart >= 0 ) {
57
int versionStop = productId.indexOf( QRegExp( "[ /]" ), versionStart + 1 );
57
int versionStop = productId.indexOf( QRegExp( QLatin1String("[ /]") ), versionStart + 1 );
58
58
if ( versionStop >= 0 ) {
59
59
QString version = productId.mid( versionStart + 1,
60
60
versionStop - versionStart - 1 );
62
int versionNum = version.section( '.', 0, 0 ).toInt() * 10000 +
63
version.section( '.', 1, 1 ).toInt() * 100 +
64
version.section( '.', 2, 2 ).toInt();
65
int releaseStop = productId.indexOf( "/", versionStop );
62
int versionNum = version.section( QLatin1Char('.'), 0, 0 ).toInt() * 10000 +
63
version.section( QLatin1Char('.'), 1, 1 ).toInt() * 100 +
64
version.section( QLatin1Char('.'), 2, 2 ).toInt();
65
int releaseStop = productId.indexOf( QLatin1String("/"), versionStop );
67
67
if ( releaseStop > versionStop ) {
68
68
release = productId.mid( versionStop+1, releaseStop-versionStop-1 );
71
71
compat = new CompatPre31;
72
72
} else if ( versionNum < 30200 ) {
73
73
compat = new CompatPre32;
74
} else if ( versionNum == 30200 && release == "pre" ) {
74
} else if ( versionNum == 30200 && release == QLatin1String("pre") ) {
75
75
kDebug() << "Generating compat for KOrganizer 3.2 pre";
76
76
compat = new Compat32PrereleaseVersions;
77
77
} else if ( versionNum < 30400 ) {
91
91
// Older implementations lacked the implementation version,
92
92
// so apply this fix if it is a file from kontact and the version is missing.
93
93
if ( implementationVersion.isEmpty() &&
94
( productId.contains( "libkcal" ) ||
95
productId.contains( "KOrganizer" ) ||
96
productId.contains( "KAlarm" ) ) ) {
94
( productId.contains( QLatin1String("libkcal") ) ||
95
productId.contains( QLatin1String("KOrganizer") ) ||
96
productId.contains( QLatin1String("KAlarm") ) ) ) {
97
97
compat = new CompatPre410( compat );
117
117
if ( incidence->summary().isEmpty() && !( incidence->description().isEmpty() ) ) {
118
118
QString oldDescription = incidence->description().trimmed();
119
119
QString newSummary( oldDescription );
120
newSummary.remove( QRegExp( "\n.*" ) );
120
newSummary.remove( QRegExp( QLatin1String("\n.*") ) );
121
121
incidence->setSummary( newSummary );
122
122
if ( oldDescription == newSummary ) {
123
incidence->setDescription( "" );
123
incidence->setDescription( QLatin1String("") );