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

« back to all changes in this revision

Viewing changes to utilities/queuemanager/assignedlist.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2010-08-26 19:25:16 UTC
  • mfrom: (1.2.30 upstream)
  • Revision ID: james.westby@ubuntu.com-20100826192516-mkbdww0h5v2x4yoy
Tags: 2:1.4.0-0ubuntu1
* New upstream bugfix release (LP: #626751)
* Install the file NEWS as upstream changelog because "ChangeLog" is
  too verbose.
* Don't copy the desktop .pot file to imageplugins, not needed anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
 
109
109
// ---------------------------------------------------------------------------
110
110
 
111
 
AssignedListView::AssignedListView(QWidget *parent)
 
111
AssignedListView::AssignedListView(QWidget* parent)
112
112
                : QTreeWidget(parent)
113
113
{
114
114
    setSelectionMode(QAbstractItemView::SingleSelection);
363
363
 
364
364
QMimeData* AssignedListView::mimeData(const QList<QTreeWidgetItem*> items) const
365
365
{
366
 
    QMimeData *mimeData = new QMimeData();
 
366
    QMimeData* mimeData = new QMimeData();
367
367
    QByteArray encodedData;
368
368
 
369
369
    QDataStream stream(&encodedData, QIODevice::WriteOnly);
383
383
    return mimeData;
384
384
}
385
385
 
386
 
void AssignedListView::dragEnterEvent(QDragEnterEvent *e)
 
386
void AssignedListView::dragEnterEvent(QDragEnterEvent* e)
387
387
{
388
388
    QTreeWidget::dragEnterEvent(e);
389
389
    e->accept();
390
390
}
391
391
 
392
 
void AssignedListView::dragMoveEvent(QDragMoveEvent *e)
 
392
void AssignedListView::dragMoveEvent(QDragMoveEvent* e)
393
393
{
394
394
    if (e->mimeData()->formats().contains("digikam/batchtoolslist") ||
395
395
        e->mimeData()->formats().contains("digikam/assignedbatchtool"))
401
401
    e->ignore();
402
402
}
403
403
 
404
 
void AssignedListView::dropEvent(QDropEvent *e)
 
404
void AssignedListView::dropEvent(QDropEvent* e)
405
405
{
406
406
    if (e->mimeData()->formats().contains("digikam/batchtoolslist"))
407
407
    {
436
436
                ds >> name;
437
437
                ds >> settings;
438
438
 
439
 
                BatchTool *tool = QueueMgrWindow::queueManagerWindow()->batchToolsManager()
 
439
                BatchTool* tool = QueueMgrWindow::queueManagerWindow()->batchToolsManager()
440
440
                                  ->findTool(name, (BatchTool::BatchToolGroup)group);
441
441
 
442
 
                AssignedListViewItem *preceding = dynamic_cast<AssignedListViewItem*>(itemAt(e->pos()));
 
442
                AssignedListViewItem* preceding = dynamic_cast<AssignedListViewItem*>(itemAt(e->pos()));
443
443
 
444
444
                BatchToolSet set;
445
445
                set.tool                   = tool;
504
504
    assignTools(map, 0);
505
505
}
506
506
 
507
 
void AssignedListView::assignTools(const QMap<int, QString>& map, AssignedListViewItem *preceding)
 
507
void AssignedListView::assignTools(const QMap<int, QString>& map, AssignedListViewItem* preceding)
508
508
{
509
509
    // We pop all items in reverse order to have same order than selection from Batch Tools list.
510
510
    QMapIterator<int, QString> it(map);
514
514
        it.previous();
515
515
        BatchTool::BatchToolGroup group = (BatchTool::BatchToolGroup)(it.key());
516
516
        QString name                    = it.value();
517
 
        BatchTool *tool                 = QueueMgrWindow::queueManagerWindow()->batchToolsManager()->findTool(name, group);
 
517
        BatchTool* tool                 = QueueMgrWindow::queueManagerWindow()->batchToolsManager()->findTool(name, group);
518
518
        BatchToolSet set;
519
 
        set.tool                   = tool;
520
 
        set.settings               = tool->defaultSettings();
521
 
        AssignedListViewItem* item = insertTool(preceding, set);
 
519
        set.tool                        = tool;
 
520
        set.settings                    = tool->defaultSettings();
 
521
        AssignedListViewItem* item      = insertTool(preceding, set);
522
522
        setCurrentItem(item);
523
523
    }
524
524
}
527
527
{
528
528
    if (!viewport()->isEnabled()) return;
529
529
 
530
 
    KActionCollection *acol = QueueMgrWindow::queueManagerWindow()->actionCollection();
 
530
    KActionCollection* acol = QueueMgrWindow::queueManagerWindow()->actionCollection();
531
531
    KMenu popmenu(this);
532
532
    popmenu.addAction(acol->action("queuemgr_toolup"));
533
533
    popmenu.addAction(acol->action("queuemgr_tooldown"));