Fixed a segfault in theme scheduler.
authoreshe <jessehakanen@gmail.com>
Mon, 26 Jul 2010 18:22:46 +0000 (19:22 +0100)
committereshe <jessehakanen@gmail.com>
Mon, 26 Jul 2010 18:22:46 +0000 (19:22 +0100)
src/poisettings.cpp
src/themescheduler.cpp
src/themeschedulersettings.cpp

index 5601c23..577631c 100644 (file)
@@ -63,7 +63,7 @@ PoiSettings::PoiSettings(QWidget* parent): QDialog(parent)
     QHBoxLayout* distance = new QHBoxLayout;
     distance->addWidget(distanceLabel_);
     distance->addWidget(distance_);
-    onlyOnRoute_ = new QCheckBox(tr("Alert only if poi is in route"));
+    onlyOnRoute_ = new QCheckBox(tr("Alert only if poi is on route"));
     onlyOnRoute_->setChecked(Settings::instance().value("alert_only_on_route", true).toBool());
 
     ButtonBox* buttons = new ButtonBox;
index c8f939a..086b45a 100644 (file)
@@ -81,7 +81,7 @@ void ThemeScheduler::removeItem(QTime const& time)
         {
             delete items_.at(i);
             items_.removeAt(i);
-            break;
+            return;
         }
     }
 }
index c545b58..7e967fe 100644 (file)
@@ -112,8 +112,11 @@ void ThemeSchedulerSettings::addScheduledTheme()
 
 void ThemeSchedulerSettings::clearScheduler()
 {
-    ThemeScheduler::instance().clear();
-    loadItems();
+    if(!ThemeScheduler::instance().isEmpty())
+    {
+        ThemeScheduler::instance().clear();
+        loadItems();
+    }
 }
 
 void ThemeSchedulerSettings::loadItems()
@@ -167,11 +170,6 @@ void ThemeSchedulerSettings::loadItems()
         currentWidget_ = itemList_;
         layout_->addWidget(itemList_);
     }
-
-    QApplication::processEvents();
-    adjustSize();
-    QApplication::processEvents();
-
 }
 
 void ThemeSchedulerSettings::saveSettings()