Resolved missing icon for Favorite

preferencesAboutTextFull
Claudio Valerio 14 years ago
parent a37bcd583e
commit 6c742be862
  1. 7
      src/board/UBLibraryController.cpp
  2. 6
      src/tools/UBToolsManager.cpp
  3. 3
      src/tools/UBToolsManager.h

@ -262,6 +262,9 @@ QImage* UBLibraryController::createThumbnail(UBLibElement* pElement)
QImage* UBLibraryController::thumbnailForFile(UBLibElement* pElement)
{
if (pElement->path().toString().contains("uniboardTool://"))
return &UBToolsManager::manager()->iconFromToolId(pElement->path().toString()).toImage();
QString thumbnailPath = UBFileSystemUtils::thumbnailPath(pElement->path().toLocalFile());
if (!thumbnailPath.length())
@ -490,7 +493,7 @@ void UBLibraryController::persistFavoriteList()
foreach(UBLibElement* eachElement, mFavoriteList)
{
out << (quint32)eachElement->type();
out << eachElement->path();
out << eachElement->path().toString();
out << eachElement->information();
out << eachElement->name();
out << eachElement->extension();
@ -517,7 +520,7 @@ void UBLibraryController::readFavoriteList()
in >> type >> path >> info >> name >> extension;
UBLibElement* eachElement = new UBLibElement((eUBLibElementType)type, path, name);
UBLibElement* eachElement = new UBLibElement((eUBLibElementType)type, QUrl(path), name);
eachElement->setInformation(info);
eachElement->setExtension(extension);
eachElement->setThumbnail(thumbnailForFile(eachElement));

@ -17,24 +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);
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);
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);
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);
mDescriptors << protractor;
}
@ -42,4 +46,4 @@ UBToolsManager::UBToolsManager(QObject *parent)
UBToolsManager::~UBToolsManager()
{
// NOOP
}
}

@ -70,6 +70,7 @@ class UBToolsManager : public QObject
UBToolDescriptor compass;
UBToolDescriptor mask;
QPixmap iconFromToolId(QString id) { return mToolsIcon.value(id);}
private:
UBToolsManager(QObject *parent = 0);
@ -79,6 +80,8 @@ class UBToolsManager : public QObject
QList<UBToolDescriptor> mDescriptors;
QMap<QString ,QPixmap> mToolsIcon;
};
#endif /* UBTOOLSMANAGER_H_ */

Loading…
Cancel
Save