From 1f623303116125fa7401cef769a2f7c19506f115 Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 5 Apr 2025 09:49:56 -0500 Subject: [PATCH] Optimize loading of skips when there are no skips in the view. --- src/SeerSkipBrowserWidget.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/SeerSkipBrowserWidget.cpp b/src/SeerSkipBrowserWidget.cpp index 558eecc..3ea4c3d 100644 --- a/src/SeerSkipBrowserWidget.cpp +++ b/src/SeerSkipBrowserWidget.cpp @@ -198,11 +198,14 @@ void SeerSkipBrowserWidget::handleSaveToolButton () { void SeerSkipBrowserWidget::handleLoadToolButton () { - int result = QMessageBox::warning(this, "Seer", - QString("Load the previously saved skips from settings?\n\nThe existing skips in the view will be deleted first."), - QMessageBox::Ok|QMessageBox::Cancel, QMessageBox::Cancel); + // Warn only if there are existing skips in the view. + if (skipTreeWidget->topLevelItemCount() > 0) { + int result = QMessageBox::warning(this, "Seer", + QString("Load the previously saved skips from settings?\n\nThe existing skips in the view will be deleted first."), + QMessageBox::Ok|QMessageBox::Cancel, QMessageBox::Cancel); - if (result == QMessageBox::Cancel) return; + if (result == QMessageBox::Cancel) return; + } QSettings settings;