1 //=============================================================================
2 //  MuseScore
3 //  Music Composition & Notation
4 //
5 //  Copyright (C) 2014 Werner Schweer
6 //
7 //  This program is free software; you can redistribute it and/or modify
8 //  it under the terms of the GNU General Public License version 2
9 //  as published by the Free Software Foundation and appearing in
10 //  the file LICENCE.GPL
11 //=============================================================================
12 
13 #include "scoreInfo.h"
14 #include "icons.h"
15 #include "musescore.h"
16 
17 namespace Ms {
18 
19 //---------------------------------------------------------
20 //   pixmap
21 //---------------------------------------------------------
22 
pixmap() const23 QPixmap ScoreInfo::pixmap() const
24       {
25       if (_pixmap.isNull()) {
26             // load or generate an actual thumbnail for the score
27             _pixmap = mscore->extractThumbnail(filePath());
28             if (_pixmap.isNull()) {
29                   // couldn't load/generate thumbnail so display generic icon
30                   _pixmap = icons[int(Icons::file_ICON)]->pixmap(QSize(50,60));
31                   }
32             }
33       return _pixmap;
34       }
35 
36 }
37 
38 
39