~ubuntu-branches/ubuntu/vivid/digikam/vivid

« back to all changes in this revision

Viewing changes to core/libs/widgets/itemview/digikamkcategorizedview.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-02-14 19:29:29 UTC
  • mfrom: (1.2.38) (3.1.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120214192929-cx2zia3b2nt67lvz
Tags: 4:2.5.0-1ubuntu1
* Merge from debian unstable, remaining changes:
  - keep seperate binary packages:
    + libkface1, libkface-data, libkface-dev
    + libkgeomap1, libkgeomap-data, libkgeomap-dev
    + libvkontakte1, libkvkontakte-dev
    + libmediawiki1, libmediawiki-dev
  - keep patches:
    + kubuntu_mysqld_executable_name.diff
  - don't fail on missing files in dh_install
  - install oxygen icons for kipi-plugins
  - build-depend on mysql 5.5 instead of 5.1
  - update install files
* digikam breaks/replaces kipi-plugins-common << 4:2.5.0~
* digikam-doc breaks/replaces digikam-data << 4:2.5.0~
* digikam-data breaks/replaces kipi-plugins << 4:2.5.0~
* kipi-plugins-common breaks/replaces kipi-plugins << 4:2.5.0~

Show diffs side-by-side

added added

removed removed

Lines of Context:
230
230
        row            = elementsInfo[index.row()].relativeOffsetToCategory / elementsPerRow;
231
231
    }
232
232
 
233
 
    foreach (const QString& category, categories)
 
233
    foreach(const QString& category, categories)
234
234
    {
235
235
        if (category == curCategory)
236
236
        {
335
335
        elementsPerRow = 1;
336
336
    }
337
337
 
338
 
    foreach (const QString& itCategory, categories)
 
338
    foreach(const QString& itCategory, categories)
339
339
    {
340
340
        if (itCategory == category)
341
341
        {
510
510
{
511
511
    QStyleOptionViewItemV4 option = listView->viewOptions();
512
512
    option.state                  &= ~QStyle::State_MouseOver;
513
 
    foreach (const QModelIndex& index, listView->selectionModel()->selectedIndexes())
 
513
    foreach(const QModelIndex& index, listView->selectionModel()->selectedIndexes())
514
514
    {
515
515
        const int dx = mousePosition.x() - initialPressPosition.x() + listView->horizontalOffset();
516
516
        const int dy = mousePosition.y() - initialPressPosition.y() + listView->verticalOffset();
529
529
    QRect rectToUpdate;
530
530
    QRect currentRect;
531
531
 
532
 
    foreach (const QModelIndex& index, listView->selectionModel()->selectedIndexes())
 
532
    foreach(const QModelIndex& index, listView->selectionModel()->selectedIndexes())
533
533
    {
534
534
        int dx      = mousePosition.x() - initialPressPosition.x() + listView->horizontalOffset();
535
535
        int dy      = mousePosition.y() - initialPressPosition.y() + listView->verticalOffset();
649
649
    // We traverse the categories and find the first where point.y() is below the visualRect
650
650
    int     y = 0, lastY = 0;
651
651
    QString lastCategory;
652
 
    foreach (const QString& category, d->categories)
 
652
    foreach(const QString& category, d->categories)
653
653
    {
654
654
        y = d->categoryVisualRect(category).top();
655
655
 
811
811
        alternate = dirtyIndexes[0].row() % 2;
812
812
    }
813
813
 
814
 
    foreach (const QModelIndex& index, dirtyIndexes)
 
814
    foreach(const QModelIndex& index, dirtyIndexes)
815
815
    {
816
816
        if (alternatingRows && alternate)
817
817
        {
875
875
    QStyleOptionViewItemV4 otherOption;
876
876
    bool                   intersectedInThePast = false;
877
877
 
878
 
    foreach (const QString& category, d->categories)
 
878
    foreach(const QString& category, d->categories)
879
879
    {
880
880
        otherOption       = option;
881
881
        otherOption.rect  = d->categoryVisualRect(category);
1245
1245
    d->hoveredCategory.clear();
1246
1246
 
1247
1247
    // Redraw categories
1248
 
    foreach (const QString& category, d->categories)
 
1248
    foreach(const QString& category, d->categories)
1249
1249
    {
1250
1250
        if (d->categoryVisualRect(category).intersects(QRect(event->pos(), event->pos())))
1251
1251
        {
1335
1335
    if ((selectionMode() != SingleSelection) && (selectionMode() != NoSelection) &&
1336
1336
        (initialPressPosition == d->initialPressPosition))
1337
1337
    {
1338
 
        foreach (const QString& category, d->categories)
 
1338
        foreach(const QString& category, d->categories)
1339
1339
        {
1340
1340
            if (d->categoryVisualRect(category).contains(event->pos()) &&
1341
1341
                selectionModel())
1343
1343
                QItemSelection selection      = selectionModel()->selection();
1344
1344
                const QVector<int> &indexList = d->categoriesIndexes[category];
1345
1345
 
1346
 
                foreach (int row, indexList)
 
1346
                foreach(int row, indexList)
1347
1347
                {
1348
1348
                    QModelIndex selectIndex = d->proxyModel->index(row, 0);
1349
1349
 
1524
1524
    QString afterCategory = d->categories.first();
1525
1525
    bool hasToBreak       = false;
1526
1526
 
1527
 
    foreach (const QString& category, d->categories)
 
1527
    foreach(const QString& category, d->categories)
1528
1528
    {
1529
1529
        if (hasToBreak)
1530
1530
        {