Commit 5e19ebe3 authored by Claudio Valerio's avatar Claudio Valerio

remove extension from the name for applications

parent 685432a4
......@@ -370,16 +370,20 @@ QList<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPat
for (fileInfo = fileInfoList.begin(); fileInfo != fileInfoList.end(); fileInfo += 1) {
eUBLibElementType fileType = fileInfo->isDir() ? eUBLibElementType_Folder : eUBLibElementType_Item;
QString fileName = fileInfo->fileName();
if (UBFileSystemUtils::mimeTypeFromFileName(fileName).contains("application")) {
QString itemName = fileInfo->fileName();
QString extension="";
if (UBFileSystemUtils::mimeTypeFromFileName(itemName).contains("application")) {
fileType = eUBLibElementType_InteractiveItem;
itemName = fileInfo->baseName();
extension = fileInfo->completeSuffix();
}
// This is necessary because of the w3c widget directory (xxxx.wgt).
QString itemName = (fileType != eUBLibElementType_Item) ? fileName : fileInfo->completeBaseName();
UBLibElement *element = new UBLibElement(fileType, QUrl::fromLocalFile(fileInfo->absoluteFilePath()), itemName);
if(!extension.isEmpty())
element->setExtension(extension);
if (fileType == eUBLibElementType_Folder) {
element->setThumbnail(QImage(":images/libpalette/folder.svg"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment