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

« back to all changes in this revision

Viewing changes to akonadi/statisticsproxymodel.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:
1
1
/*
2
2
    Copyright (c) 2009 Kevin Ottens <ervin@kde.org>
3
3
 
4
 
 
5
4
    This library is free software; you can redistribute it and/or modify it
6
5
    under the terms of the GNU Library General Public License as published by
7
6
    the Free Software Foundation; either version 2 of the License, or (at your
71
70
      }
72
71
    }
73
72
 
74
 
 
75
73
    QString toolTipForCollection( const QModelIndex &index, const Collection &collection )
76
74
    {
77
75
      QString bckColor = QApplication::palette().color( QPalette::ToolTipBase ).name();
91
89
        "  </tr>\n"
92
90
        ).arg( txtColor ).arg( bckColor ).arg( index.data( Qt::DisplayRole ).toString() ).arg( textDirection );
93
91
 
94
 
 
95
92
      tip += QString::fromLatin1(
96
93
        "  <tr>\n"
97
94
        "    <td align=\"%1\" valign=\"top\">\n"
123
120
        "      <strong>%1</strong>: %2<br>\n"
124
121
        ).arg( i18n( "Storage Size" ) ).arg( KIO::convertSize( (KIO::filesize_t)( currentFolderSize ) ) );
125
122
 
126
 
 
127
123
      qint64 totalSize = 0;
128
124
      getCountRecursive( index, totalSize );
129
125
      totalSize -= currentFolderSize;
133
129
          ).arg( i18n("Subfolder Storage Size") ).arg( KIO::convertSize( (KIO::filesize_t)( totalSize ) ) );
134
130
      }
135
131
 
136
 
 
137
132
     QString iconName = CollectionUtils::defaultIconName( collection );
138
133
      if ( collection.hasAttribute<EntityDisplayAttribute>() &&
139
134
         !collection.attribute<EntityDisplayAttribute>()->iconName().isEmpty() ) {
144
139
           iconName = collection.attribute<EntityDisplayAttribute>()->iconName();
145
140
      }
146
141
 
147
 
 
148
142
      int iconSizes[] = { 32, 22 };
149
143
      int icon_size_found = 32;
150
144
 
178
172
        tip += tipIcon + QString::fromLatin1( "</td><td align=\"%3\" valign=\"top\">" ).arg( textDirection ) + tipInfo;
179
173
      }
180
174
 
181
 
 
182
175
      tip += QString::fromLatin1(
183
176
        "  </tr>" \
184
177
        "</table>"
254
247
 
255
248
  const int columnCount = mParent->sourceModel()->columnCount();
256
249
 
257
 
  for( int i = 0; i < m_persistent.size(); ++i ) {
 
250
  for ( int i = 0; i < m_persistent.size(); ++i ) {
258
251
    const QModelIndex persistentIdx = m_persistent.at( i );
259
252
    const QModelIndex nonPersistentIdx = m_nonPersistent.at( i );
260
253
    if ( m_persistentFirstColumn.at( i ) != m_nonPersistentFirstColumn.at( i ) && persistentIdx.column() >= columnCount ) {
290
283
  QSortFilterProxyModel::connectNotify(signal);
291
284
}
292
285
 
293
 
 
294
286
StatisticsProxyModel::StatisticsProxyModel( QObject *parent )
295
287
  : QSortFilterProxyModel( parent ),
296
288
    d( new Private( this ) )
329
321
    if (!hasIndex(row, column, parent))
330
322
      return QModelIndex();
331
323
 
332
 
 
333
324
    int sourceColumn = column;
334
325
 
335
326
    if ( column>=d->sourceColumnCount( parent ) ) {
444
435
  return list;
445
436
}
446
437
 
447
 
 
448
438
#include "moc_statisticsproxymodel.cpp"
449
439