~ci-train-bot/thumbnailer/thumbnailer-ubuntu-yakkety-landing-072

« back to all changes in this revision

Viewing changes to plugins/Ubuntu/Thumbnailer.0.1/plugin.cpp

  • Committer: CI Train Bot
  • Author(s): Michi Henning
  • Date: 2015-09-15 11:04:11 UTC
  • mfrom: (125.1.2 landing150915)
  • Revision ID: ci-train-bot@canonical.com-20150915110411-233xw0fljaq7p2o0
Landing changes on devel to trunk.
Approved by: James Henstridge

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include "plugin.h"
20
20
 
 
21
#include <settings.h>
21
22
#include "albumartgenerator.h"
22
23
#include "artistartgenerator.h"
23
24
#include "thumbnailgenerator.h"
24
25
 
 
26
#include <memory>
 
27
 
25
28
namespace unity
26
29
{
27
30
 
41
44
{
42
45
    QQmlExtensionPlugin::initializeEngine(engine, uri);
43
46
 
 
47
    auto thumbnailer = std::make_shared<unity::thumbnailer::qt::Thumbnailer>();
 
48
    auto backlog_limiter = std::make_shared<unity::thumbnailer::RateLimiter>(
 
49
        Settings().max_backlog());
 
50
 
44
51
    try
45
52
    {
46
 
        engine->addImageProvider("albumart", new AlbumArtGenerator());
 
53
        engine->addImageProvider("albumart", new AlbumArtGenerator(
 
54
                                     thumbnailer, backlog_limiter));
47
55
    }
48
56
    // LCOV_EXCL_START
49
57
    catch (const std::exception& e)
59
67
 
60
68
    try
61
69
    {
62
 
        engine->addImageProvider("artistart", new ArtistArtGenerator());
 
70
        engine->addImageProvider("artistart", new ArtistArtGenerator(
 
71
                                     thumbnailer, backlog_limiter));
63
72
    }
64
73
    // LCOV_EXCL_START
65
74
    catch (const std::exception& e)
75
84
 
76
85
    try
77
86
    {
78
 
        engine->addImageProvider("thumbnailer", new ThumbnailGenerator());
 
87
        engine->addImageProvider("thumbnailer", new ThumbnailGenerator(
 
88
                                     thumbnailer, backlog_limiter));
79
89
    }
80
90
    // LCOV_EXCL_START
81
91
    catch (const std::exception& e)