From b84e68c9b86f9babbe21a1be4fb238120797419e Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Fri, 27 May 2011 16:14:59 +0200 Subject: [PATCH] fixed claudio's bug --- src/board/UBLibraryController.cpp | 7 ++++--- src/tools/UBToolsManager.cpp | 8 ++++---- src/tools/UBToolsManager.h | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index 78e39792..0885c64d 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -262,9 +262,10 @@ QImage* UBLibraryController::createThumbnail(UBLibElement* pElement) QImage* UBLibraryController::thumbnailForFile(UBLibElement* pElement) { - if (pElement->path().toString().contains("uniboardTool://")) - return &UBToolsManager::manager()->iconFromToolId(pElement->path().toString()).toImage(); - + if (pElement->path().toString().contains("uniboardTool://")){ + QImage* image = new QImage(UBToolsManager::manager()->iconFromToolId(pElement->path().toString())); + return image; + } QString thumbnailPath = UBFileSystemUtils::thumbnailPath(pElement->path().toLocalFile()); if (!thumbnailPath.length()) diff --git a/src/tools/UBToolsManager.cpp b/src/tools/UBToolsManager.cpp index 72cc8d0c..7ae641f6 100644 --- a/src/tools/UBToolsManager.cpp +++ b/src/tools/UBToolsManager.cpp @@ -17,28 +17,28 @@ UBToolsManager::UBToolsManager(QObject *parent) mask.icon = QPixmap(":/images/toolPalette/maskTool.png"); mask.label = tr("Mask"); mask.version = "1.0"; - mToolsIcon.insert(mask.id, mask.icon); + mToolsIcon.insert(mask.id, ":/images/toolPalette/maskTool.png"); mDescriptors << mask; ruler.id = "uniboardTool://uniboard.mnemis.com/ruler"; ruler.icon = QPixmap(":/images/toolPalette/rulerTool.png"); ruler.label = tr("Ruler"); ruler.version = "1.0"; - mToolsIcon.insert(ruler.id, ruler.icon); + mToolsIcon.insert(ruler.id, ":/images/toolPalette/rulerTool.png"); mDescriptors << ruler; compass.id = "uniboardTool://uniboard.mnemis.com/compass"; compass.icon = QPixmap(":/images/toolPalette/compassTool.png"); compass.label = tr("Compass"); compass.version = "1.0"; - mToolsIcon.insert(compass.id, compass.icon); + mToolsIcon.insert(compass.id, ":/images/toolPalette/compassTool.png"); mDescriptors << compass; protractor.id = "uniboardTool://uniboard.mnemis.com/protractor"; protractor.icon = QPixmap(":/images/toolPalette/protractorTool.png"); protractor.label = tr("Protractor"); protractor.version = "1.0"; - mToolsIcon.insert(protractor.id, protractor.icon); + mToolsIcon.insert(protractor.id,":/images/toolPalette/protractorTool.png"); mDescriptors << protractor; } diff --git a/src/tools/UBToolsManager.h b/src/tools/UBToolsManager.h index f07512b4..a60bf969 100644 --- a/src/tools/UBToolsManager.h +++ b/src/tools/UBToolsManager.h @@ -70,7 +70,7 @@ class UBToolsManager : public QObject UBToolDescriptor compass; UBToolDescriptor mask; - QPixmap iconFromToolId(QString id) { return mToolsIcon.value(id);} + QString iconFromToolId(QString id) { return mToolsIcon.value(id);} private: UBToolsManager(QObject *parent = 0); @@ -80,7 +80,7 @@ class UBToolsManager : public QObject QList mDescriptors; - QMap mToolsIcon; + QMap mToolsIcon; };