diff --git a/cockatrice/src/dlg_settings.cpp b/cockatrice/src/dlg_settings.cpp index 01d4445a..43a643f1 100644 --- a/cockatrice/src/dlg_settings.cpp +++ b/cockatrice/src/dlg_settings.cpp @@ -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; diff --git a/cockatrice/src/gameview.cpp b/cockatrice/src/gameview.cpp index e1d32a0d..d8de4893 100644 --- a/cockatrice/src/gameview.cpp +++ b/cockatrice/src/gameview.cpp @@ -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(); } diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index e59e18df..5225ee1b 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -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) {