You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
QMessageBox::critical(mainwindow, "Houston we have a problem!", "Could not find images in directory: " + project.dir.path());
175
+
Project *project = new Project;
176
+
project->setDir(QDir(dir));
177
+
bool ok = project->scanDir();
178
+
if(!project->size()) {
179
+
QMessageBox::critical(mainwindow, "Houston we have a problem!", "Could not find images in directory: " + project->dir.path());
177
180
return;
178
181
}
179
182
180
183
if(!ok) {
181
184
//check if we can rotate a few images.
182
185
bool canrotate = false;
183
-
for(Image &image: project.images) {
184
-
if(image.size == project.imgsize)
186
+
for(Image &image: project->images) {
187
+
if(image.size == project->imgsize)
185
188
continue;
186
189
187
-
if(image.isRotated(project.imgsize))
190
+
if(image.isRotated(project->imgsize))
188
191
canrotate = true;
189
192
}
190
193
if(canrotate) {
191
194
int answer = QMessageBox::question(mainwindow, "Some images are rotated.", "Do you wish to uniform image rotation?", QMessageBox::Yes, QMessageBox::No);
192
195
if(answer != QMessageBox::No)
193
-
project.rotateImages();
196
+
project->rotateImages();
194
197
} else
195
198
QMessageBox::critical(mainwindow, "Resolution problem", "Not all of the images in the folder have the same resolution,\nyou might need to fix this problem manually.");
QString imagefolder = QFileDialog::getExistingDirectory(mainwindow, "Could not find the images, please select the image folder:", project.dir.absolutePath());
257
+
QString imagefolder = QFileDialog::getExistingDirectory(mainwindow, "Could not find the images, please select the image folder:", project->dir.absolutePath());
255
258
if(imagefolder.isNull()) {
256
259
QMessageBox::critical(mainwindow, "No folder selected", "No folder selected.");
0 commit comments