Mac weirdness workaround

This commit is contained in:
a b 2011-10-12 18:53:02 +02:00
parent 8877bfe71c
commit 50e85496fa
3 changed files with 7 additions and 9 deletions

View file

@ -654,12 +654,12 @@ void DlgSettings::closeEvent(QCloseEvent *event)
event->ignore();
return;
}
if (!QDir(settingsCache->getDeckPath()).exists())
if (!QDir(settingsCache->getDeckPath()).exists() || settingsCache->getDeckPath().isEmpty())
if (QMessageBox::critical(this, tr("Error"), tr("The path to your deck directory is invalid. Would you like to go back and set the correct path?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
event->ignore();
return;
}
if (!QDir(settingsCache->getPicsPath()).exists())
if (!QDir(settingsCache->getPicsPath()).exists() || settingsCache->getPicsPath().isEmpty())
if (QMessageBox::critical(this, tr("Error"), tr("The path to your card pictures directory is invalid. Would you like to go back and set the correct path?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
event->ignore();
return;

View file

@ -22,6 +22,8 @@ GameView::GameView(QGraphicsScene *scene, QWidget *parent)
aCloseMostRecentZoneView->setShortcut(tr("Esc"));
connect(aCloseMostRecentZoneView, SIGNAL(triggered()), scene, SLOT(closeMostRecentZoneView()));
addAction(aCloseMostRecentZoneView);
rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
}
void GameView::resizeEvent(QResizeEvent *event)
@ -43,7 +45,6 @@ void GameView::updateSceneRect(const QRectF &rect)
void GameView::startRubberBand(const QPointF &_selectionOrigin)
{
selectionOrigin = _selectionOrigin;
rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
rubberBand->setGeometry(QRect(mapFromScene(selectionOrigin), QSize(0, 0)));
rubberBand->show();
}
@ -56,8 +57,5 @@ void GameView::resizeRubberBand(const QPointF &cursorPoint)
void GameView::stopRubberBand()
{
if (rubberBand) {
rubberBand->deleteLater();
rubberBand = 0;
}
rubberBand->hide();
}

View file

@ -108,11 +108,11 @@ int main(int argc, char *argv[])
if (!QDir(settingsCache->getPicsPath()).exists())
settingsCache->setPicsPath(baseDir.absolutePath() + "/pics");
#endif
if (!db->getLoadSuccess() || !QDir(settingsCache->getDeckPath()).exists() || !QDir(settingsCache->getPicsPath()).exists()) {
if (!db->getLoadSuccess() || !QDir(settingsCache->getDeckPath()).exists() || settingsCache->getDeckPath().isEmpty() || settingsCache->getPicsPath().isEmpty() || !QDir(settingsCache->getPicsPath()).exists()) {
DlgSettings dlgSettings;
dlgSettings.show();
app.exec();
startMainProgram = (db->getLoadSuccess() && QDir(settingsCache->getDeckPath()).exists() && QDir(settingsCache->getPicsPath()).exists());
startMainProgram = (db->getLoadSuccess() && QDir(settingsCache->getDeckPath()).exists() && !settingsCache->getDeckPath().isEmpty() && QDir(settingsCache->getPicsPath()).exists() && !settingsCache->getPicsPath().isEmpty());
}
if (startMainProgram) {