Commit 55a4b860 authored by Claudio Valerio's avatar Claudio Valerio

fixed issue with copying a text

parent dbc9bf96
...@@ -2369,10 +2369,10 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint ...@@ -2369,10 +2369,10 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
if(qsTmp.startsWith("http")) if(qsTmp.startsWith("http"))
downloadURL(QUrl(qsTmp), QString(), pPos); downloadURL(QUrl(qsTmp), QString(), pPos);
else{ else{
if(mActiveScene->selectedItems().at(0)->type() == UBGraphicsItemType::TextItemType) if(mActiveScene->selectedItems().count() && mActiveScene->selectedItems().at(0)->type() == UBGraphicsItemType::TextItemType)
dynamic_cast<UBGraphicsTextItem*>(mActiveScene->selectedItems().at(0))->setHtml(pMimeData->text()); dynamic_cast<UBGraphicsTextItem*>(mActiveScene->selectedItems().at(0))->setHtml(pMimeData->text());
else else
mActiveScene->addTextHtml(pMimeData->text(), pPos); mActiveScene->addTextHtml("", pPos)->setHtml(pMimeData->text());
} }
} }
else{ else{
......
...@@ -190,15 +190,21 @@ void UBDocumentController::selectDocument(UBDocumentProxy* proxy, bool setAsCurr ...@@ -190,15 +190,21 @@ void UBDocumentController::selectDocument(UBDocumentProxy* proxy, bool setAsCurr
} }
bool bullshitcode = true;
void UBDocumentController::createNewDocumentGroup() void UBDocumentController::createNewDocumentGroup()
{ {
if(bullshitcode){
mDocumentUI->documentTreeWidget->selectedItems().at(0)->setSelected(false);
mDocumentUI->documentTreeWidget->topLevelItem(0)->setSelected(true);
}
UBDocumentGroupTreeItem* docGroupItem = new UBDocumentGroupTreeItem(0); // deleted by the tree widget UBDocumentGroupTreeItem* docGroupItem = new UBDocumentGroupTreeItem(0); // deleted by the tree widget
int i = 1; int i = 1;
QString newFolderName = tr("New Folder"); QString newFolderName = tr("New Folder");
while (allGroupNames().contains(newFolderName)) while (allGroupNames().contains(newFolderName))
{
newFolderName = tr("New Folder") + " " + QVariant(i++).toString(); newFolderName = tr("New Folder") + " " + QVariant(i++).toString();
}
docGroupItem->setGroupName(newFolderName); docGroupItem->setGroupName(newFolderName);
int trashIndex = mDocumentUI->documentTreeWidget->indexOfTopLevelItem(mTrashTi); int trashIndex = mDocumentUI->documentTreeWidget->indexOfTopLevelItem(mTrashTi);
...@@ -210,7 +216,6 @@ void UBDocumentController::createNewDocumentGroup() ...@@ -210,7 +216,6 @@ void UBDocumentController::createNewDocumentGroup()
mDocumentUI->documentTreeWidget->insertTopLevelItem(trashIndex, docGroupItem); mDocumentUI->documentTreeWidget->insertTopLevelItem(trashIndex, docGroupItem);
else else
selected->addChild(docGroupItem); selected->addChild(docGroupItem);
parentGroupName = docGroupItem->buildEntirePath(); parentGroupName = docGroupItem->buildEntirePath();
mMapOfPaths.insert(parentGroupName,docGroupItem); mMapOfPaths.insert(parentGroupName,docGroupItem);
......
...@@ -665,6 +665,13 @@ void UBGraphicsScene::DisposeMagnifierQWidgets() ...@@ -665,6 +665,13 @@ void UBGraphicsScene::DisposeMagnifierQWidgets()
magniferControlViewWidget = NULL; magniferControlViewWidget = NULL;
} }
if(magniferDisplayViewWidget)
{
magniferDisplayViewWidget->hide();
magniferDisplayViewWidget->setParent(0);
delete magniferDisplayViewWidget;
magniferDisplayViewWidget = NULL;
}
// some time have crash here on access to app (when call from destructor when close OpenBoard app) // some time have crash here on access to app (when call from destructor when close OpenBoard app)
// so i just add try/catch section here // so i just add try/catch section here
try try
......
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