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

« back to all changes in this revision

Viewing changes to utilities/queuemanager/actionthread.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:
54
54
{
55
55
public:
56
56
 
57
 
    ActionThreadPriv()
 
57
    ActionThreadPriv() :
 
58
        running(false),
 
59
        cancel(false),
 
60
        exifSetOrientation(true),
 
61
        tool(0)
58
62
    {
59
 
        tool               = 0;
60
 
        running            = false;
61
 
        cancel             = false;
62
 
        exifSetOrientation = true;
63
63
    }
64
64
 
65
65
    class Task
66
66
    {
67
 
        public:
68
 
 
69
 
            Task(){};
70
 
 
71
 
            AssignedBatchTools item;
 
67
    public:
 
68
 
 
69
        Task() {};
 
70
 
 
71
        AssignedBatchTools item;
72
72
    };
73
73
 
74
74
    bool           running;
89
89
};
90
90
 
91
91
ActionThread::ActionThread(QObject* parent)
92
 
            : QThread(parent), d(new ActionThreadPriv)
 
92
    : QThread(parent), d(new ActionThreadPriv)
93
93
{
94
94
    qRegisterMetaType<ActionData>();
95
95
}
129
129
void ActionThread::cancel()
130
130
{
131
131
    d->cancel  = true;
132
 
    if (d->tool) d->tool->cancel();
 
132
 
 
133
    if (d->tool)
 
134
    {
 
135
        d->tool->cancel();
 
136
    }
133
137
 
134
138
    QMutexLocker lock(&d->mutex);
135
139
    d->todo.clear();
149
153
        ActionThreadPriv::Task* t = 0;
150
154
        {
151
155
            QMutexLocker lock(&d->mutex);
 
156
 
152
157
            if (!d->todo.isEmpty())
 
158
            {
153
159
                t = d->todo.takeFirst();
 
160
            }
154
161
            else
 
162
            {
155
163
                d->condVar.wait(&d->mutex);
 
164
            }
156
165
        }
157
166
 
158
167
        if (t)
241
250
                    ActionData ad5;
242
251
                    ad5.fileUrl = t->item.m_itemUrl;
243
252
                    ad5.status  = ActionData::BatchFailed;
244
 
                    if (!errMsg.isEmpty()) ad5.message = errMsg;
 
253
 
 
254
                    if (!errMsg.isEmpty())
 
255
                    {
 
256
                        ad5.message = errMsg;
 
257
                    }
 
258
 
245
259
                    emit finished(ad5);
246
260
 
247
261
                    break;