~ubuntu-branches/ubuntu/trusty/kdepimlibs/trusty

« back to all changes in this revision

Viewing changes to kcalcore/compat.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg, Rohan Garg, Philip Muškovac
  • Date: 2013-11-23 17:36:44 UTC
  • mfrom: (1.1.102)
  • Revision ID: package-import@ubuntu.com-20131123173644-p5ow94192ezsny8g
Tags: 4:4.11.80-0ubuntu1
[ Rohan Garg ]
* New upstream beta release
  - Bump akonadi requirement to 1.10.45
  - Update install files
  - Update symbols

[ Philip Muškovac ]
* kdepimlibs-dev/-dbg breaks/replaces kdepim-runtime/-dbg (<< 4:4.11.80)

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
{
49
49
  Compat *compat = 0;
50
50
 
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") );
53
53
 
54
54
  if ( korg >= 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 );
61
61
 
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 );
66
66
        QString release;
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 );
98
98
  }
99
99
 
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("") );
124
124
    }
125
125
  }
126
126
}