ISSUE Sankore 1661

preferencesAboutTextFull
-f 11 years ago
parent bc0cffb45d
commit 276ccde541
  1. 8
      src/board/UBBoardController.cpp
  2. 21
      src/board/UBFeaturesController.cpp

@ -2366,11 +2366,13 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
if("" != pMimeData->text()){ if("" != pMimeData->text()){
// Sometimes, it is possible to have an URL as text. we check here if it is the case // Sometimes, it is possible to have an URL as text. we check here if it is the case
QString qsTmp = pMimeData->text().remove(QRegExp("[\\0]")); QString qsTmp = pMimeData->text().remove(QRegExp("[\\0]"));
if(qsTmp.startsWith("http")){ if(qsTmp.startsWith("http"))
downloadURL(QUrl(qsTmp), QString(), pPos); downloadURL(QUrl(qsTmp), QString(), pPos);
}
else{ else{
mActiveScene->addTextHtml(pMimeData->html(), pPos); if(mActiveScene->selectedItems().at(0)->type() == UBGraphicsItemType::TextItemType)
dynamic_cast<UBGraphicsTextItem*>(mActiveScene->selectedItems().at(0))->setHtml(pMimeData->text());
else
mActiveScene->addTextHtml(pMimeData->text(), pPos);
} }
} }
else{ else{

@ -449,7 +449,7 @@ void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QStrin
if ( fullFileName.contains(".thumbnail.")) if ( fullFileName.contains(".thumbnail."))
continue; continue;
UBFeature testFeature(currVirtualPath + "/" + fileName, icon, fileName, QUrl::fromLocalFile(fullFileName), featureType); UBFeature testFeature(currVirtualPath + "/" + fileName, icon, fileName, QUrl::fromLocalFile(fullFileName), featureType);
featuresList->append(testFeature); featuresList->append(testFeature);
@ -750,17 +750,17 @@ void UBFeaturesController::importImage( const QImage &image, const UBFeature &de
QDateTime now = QDateTime::currentDateTime(); QDateTime now = QDateTime::currentDateTime();
static int imageCounter = 0; static int imageCounter = 0;
mFileName = tr("ImportedImage") + "-" + now.toString("dd-MM-yyyy hh-mm-ss"); mFileName = tr("ImportedImage") + "-" + now.toString("dd-MM-yyyy hh-mm-ss");
filePath = dest.getFullPath().toLocalFile() + "/" + mFileName; filePath = dest.getFullPath().toLocalFile() + "/" + mFileName;
if (QFile::exists(filePath+".png")) if (QFile::exists(filePath+".png"))
mFileName += QString("-[%1]").arg(++imageCounter); mFileName += QString("-[%1]").arg(++imageCounter);
else else
imageCounter = 0; imageCounter = 0;
mFileName += ".png"; mFileName += ".png";
} }
if ( !destination.getFullVirtualPath().startsWith( picturesElement.getFullVirtualPath(), Qt::CaseInsensitive ) ) if ( !destination.getFullVirtualPath().startsWith( picturesElement.getFullVirtualPath(), Qt::CaseInsensitive ) )
{ {
@ -861,7 +861,7 @@ void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteA
QString fileName; QString fileName;
QString filePath; QString filePath;
//Audio item //Audio item
if(dest == picturesElement) { if(dest == picturesElement) {
@ -913,7 +913,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
UBFeature dest = destination; UBFeature dest = destination;
if ( destination != trashElement && if ( destination != trashElement &&
!destination.getFullVirtualPath().startsWith( possibleDest.getFullVirtualPath(), Qt::CaseInsensitive ) ) !destination.getFullVirtualPath().startsWith( possibleDest.getFullVirtualPath(), Qt::CaseInsensitive ) )
{ {
dest = possibleDest; dest = possibleDest;
@ -930,9 +930,9 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
} }
QImage thumb = getIcon( newFullPath ); QImage thumb = getIcon( newFullPath );
UBFeatureElementType type = FEATURE_ITEM; UBFeatureElementType type = FEATURE_ITEM;
if ( UBFileSystemUtils::mimeTypeFromFileName( newFullPath ).contains("application") ) if ( UBFileSystemUtils::mimeTypeFromFileName( newFullPath ).contains("application") )
type = FEATURE_INTERACTIVE; type = FEATURE_INTERACTIVE;
UBFeature newElement( destVirtualPath + "/" + name, thumb, name, QUrl::fromLocalFile( newFullPath ), type ); UBFeature newElement( destVirtualPath + "/" + name, thumb, name, QUrl::fromLocalFile( newFullPath ), type );
return newElement; return newElement;
@ -1042,11 +1042,8 @@ void UBFeaturesController::moveExternalData(const QUrl &url, const UBFeature &de
UBFeature dest = destination; UBFeature dest = destination;
if ( destination != trashElement && destination != UBFeature() if ( destination != trashElement && destination != UBFeature())
/*&& !destination.getFullVirtualPath().startsWith( possibleDest.getFullVirtualPath(), Qt::CaseInsensitive )*/ )
{
dest = possibleDest; dest = possibleDest;
}
UBFeatureElementType type = fileTypeFromUrl(sourcePath); UBFeatureElementType type = fileTypeFromUrl(sourcePath);

Loading…
Cancel
Save