Fixed lost icons for favorite c++ tools.

preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent aa32cc7d91
commit 3dd7628f28
  1. 10
      src/board/UBFeaturesController.cpp

@ -566,7 +566,7 @@ void UBFeaturesController::addToFavorite( const QUrl &path )
{ {
QFileInfo fileInfo( filePath ); QFileInfo fileInfo( filePath );
QString fileName = fileInfo.fileName(); QString fileName = fileInfo.fileName();
UBFeatureElementType type = fileTypeFromUrl(fileInfo.absoluteFilePath()); UBFeatureElementType type = fileTypeFromUrl(filePath);
UBFeature elem(favoritePath + "/" + fileName, getIcon(filePath, type), fileName, path, fileTypeFromUrl(filePath) ); UBFeature elem(favoritePath + "/" + fileName, getIcon(filePath, type), fileName, path, fileTypeFromUrl(filePath) );
favoriteSet->insert( path ); favoriteSet->insert( path );
saveFavoriteList(); saveFavoriteList();
@ -603,15 +603,17 @@ UBFeatureElementType UBFeaturesController::fileTypeFromUrl(const QString &path)
{ {
QFileInfo fileInfo(path); QFileInfo fileInfo(path);
if ( path.contains("uniboardTool://"))
return FEATURE_INTERNAL;
if (!fileInfo.exists()) { if (!fileInfo.exists()) {
return FEATURE_INVALID; return FEATURE_INVALID;
} }
UBFeatureElementType fileType = FEATURE_INVALID;
QString fileName = fileInfo.fileName(); QString fileName = fileInfo.fileName();
QString mimeString = UBFileSystemUtils::mimeTypeFromFileName(fileName); QString mimeString = UBFileSystemUtils::mimeTypeFromFileName(fileName);
UBFeatureElementType fileType = FEATURE_INVALID;
if ( mimeString.contains("application")) { if ( mimeString.contains("application")) {
if (mimeString.contains("application/search")) { if (mimeString.contains("application/search")) {
fileType = FEATURE_SEARCH; fileType = FEATURE_SEARCH;
@ -620,8 +622,6 @@ UBFeatureElementType UBFeaturesController::fileTypeFromUrl(const QString &path)
} else { } else {
fileType = FEATURE_INTERACTIVE; fileType = FEATURE_INTERACTIVE;
} }
} else if ( path.contains("uniboardTool://")) {
fileType = FEATURE_INTERNAL;
} else if (mimeString.contains("audio")) { } else if (mimeString.contains("audio")) {
fileType = FEATURE_AUDIO; fileType = FEATURE_AUDIO;
} else if (mimeString.contains("video")) { } else if (mimeString.contains("video")) {

Loading…
Cancel
Save