ednungs check

This commit is contained in:
Jonas Mucke
2020-01-23 16:13:52 +01:00
parent 244a9b769f
commit 12614096f8
2 changed files with 19 additions and 9 deletions

View File

@@ -52,21 +52,27 @@ void IntelliPhotoGui::slotOpen(){
// If we have a file name load the image and place // If we have a file name load the image and place
// it in the paintingArea // it in the paintingArea
if (!fileName.isEmpty()) { if (!fileName.isEmpty()) {
if(fileName.length()>3){ bool rightFileType =true;
if(*(fileName.rend()+1)==QChar('f') && if(fileName.size()>=4){
*(fileName.rend()+2)==QChar('d') && QString endung(".idf");
*(fileName.rend()+3)==QChar('i') && int length = fileName.size();
*(fileName.rend()+4)==QChar('.')){ for(int i=0; i<4; i++){
qDebug() << "works."; if(endung[i]!=fileName[length-4+i]){
IntelliDatamanager::loadProject(paintingArea,fileName); rightFileType = false;
break;
}
} }
} }
}
if(rightFileType){
//paintingArea->open(fileName); //paintingArea->open(fileName);
//TODO remove datamanager funciton and enable painting area function //TODO remove datamanager funciton and enable painting area function
IntelliDatamanager::loadProject(paintingArea,fileName); IntelliDatamanager::loadProject(paintingArea,fileName);
UpdateGui(); UpdateGui();
}
} }
}
} }
// Called when the user clicks Save As in the menu // Called when the user clicks Save As in the menu

View File

@@ -436,6 +436,10 @@ QImage PaintingArea::getImageDataOfActiveLayer(){
return returnImage; return returnImage;
} }
std::vector<LayerObject>* PaintingArea::getLayerBundle(){
return &layerBundle;
}
void PaintingArea::updateTools(){ void PaintingArea::updateTools(){
if(Tool!=nullptr) { if(Tool!=nullptr) {
if(Tool->getIsDrawing()) { if(Tool->getIsDrawing()) {