~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to utilities/cameragui/camerahistoryupdater.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
// --------------------------------------------------------
67
67
 
68
68
CameraHistoryUpdater::CameraHistoryUpdater(QWidget* parent)
69
 
                    : QThread(parent), d(new CameraHistoryUpdaterPriv)
 
69
    : QThread(parent), d(new CameraHistoryUpdaterPriv)
70
70
{
71
71
    qRegisterMetaType<CHUpdateItemMap>("CHUpdateItemMap");
72
72
}
102
102
            CHUpdateItem item;
103
103
 
104
104
            QMutexLocker lock(&d->mutex);
 
105
 
105
106
            if (!d->updateItems.isEmpty())
106
107
            {
107
108
                item = d->updateItems.takeFirst();
116
117
            }
117
118
        }
118
119
    }
 
120
 
119
121
    sendBusy(false);
120
122
}
121
123
 
127
129
void CameraHistoryUpdater::addItems(const QByteArray& id, CHUpdateItemMap& map)
128
130
{
129
131
    if (map.empty())
 
132
    {
130
133
        return;
 
134
    }
131
135
 
132
136
    QMutexLocker lock(&d->mutex);
133
137
    d->running = true;
134
138
    d->canceled = false;
135
139
    d->updateItems << CHUpdateItem(id, map);
 
140
 
136
141
    if (!isRunning())
137
142
    {
138
143
        start(LowPriority);
139
144
    }
 
145
 
140
146
    d->condVar.wakeAll();
141
147
}
142
148
 
160
166
                (*it).downloaded = GPItemInfo::DownloadUnknown;
161
167
                break;
162
168
        }
 
169
 
163
170
        ++it;
164
171
 
165
 
    } while (it != map.end() && !d->canceled);
 
172
    }
 
173
    while (it != map.end() && !d->canceled);
166
174
 
167
175
    emit signalHistoryMap(_map);
168
176
}