aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/events/duiorientationtracker.cpp4
-rw-r--r--src/mashup/mashup/duiappletinventory.cpp7
-rw-r--r--src/mashup/mashup/duifiledatastore.cpp5
-rw-r--r--src/scene/duiscenemanager.cpp5
-rw-r--r--src/widgets/duiapplicationpage.cpp1
5 files changed, 13 insertions, 9 deletions
diff --git a/src/events/duiorientationtracker.cpp b/src/events/duiorientationtracker.cpp
index 3870a5d7..808290c2 100644
--- a/src/events/duiorientationtracker.cpp
+++ b/src/events/duiorientationtracker.cpp
@@ -65,12 +65,11 @@ void DuiOrientationTrackerPrivate::topEdgeChanged()
{
#ifdef HAVE_CONTEXTSUBSCRIBER
Dui::OrientationAngle angle;
- Dui::Orientation orientation;
+ Dui::Orientation orientation = Dui::Landscape;
QString edge = topEdgeProperty.value().toString();
if (edge == "top") {
angle = Dui::Angle0;
- orientation = Dui::Landscape;
} else if (edge == "left") {
angle = Dui::Angle270;
orientation = Dui::Portrait;
@@ -79,7 +78,6 @@ void DuiOrientationTrackerPrivate::topEdgeChanged()
orientation = Dui::Portrait;
} else if (edge == "bottom") {
angle = Dui::Angle180;
- orientation = Dui::Landscape;
} else {
angle = currentAngle;
}
diff --git a/src/mashup/mashup/duiappletinventory.cpp b/src/mashup/mashup/duiappletinventory.cpp
index b0b9f6e4..84b00266 100644
--- a/src/mashup/mashup/duiappletinventory.cpp
+++ b/src/mashup/mashup/duiappletinventory.cpp
@@ -105,10 +105,13 @@ QStringList DuiAppletInventory::categories() const
void DuiAppletInventory::appletButtonClicked()
{
DuiAppletButton *button = dynamic_cast<DuiAppletButton *>(sender());
+
Q_ASSERT(button != NULL);
- mashupCanvas->appletInstanceManager()->instantiateApplet(button->metadataFilename());
- emit hideAppletInventory();
+ if (button) {
+ mashupCanvas->appletInstanceManager()->instantiateApplet(button->metadataFilename());
+ emit hideAppletInventory();
+ }
}
void DuiAppletInventory::appletPathChanged(const QString &path)
diff --git a/src/mashup/mashup/duifiledatastore.cpp b/src/mashup/mashup/duifiledatastore.cpp
index c1e3db92..7e78625d 100644
--- a/src/mashup/mashup/duifiledatastore.cpp
+++ b/src/mashup/mashup/duifiledatastore.cpp
@@ -169,7 +169,6 @@ bool DuiFileDataStore::setValue(const QString &key, const QVariant &value)
// QSettings has some kind of a cache so we'll prevent any temporary writes
// by checking if the data can be actually stored before doing anything
if (isWritable() && settings.contains(key)) {
- bool originalValueSet = settings.contains(key);
QVariant originalValue = settings.value(key);
settings.setValue(key, value);
bool syncOk = doSync(settings, watcher);
@@ -180,11 +179,9 @@ bool DuiFileDataStore::setValue(const QString &key, const QVariant &value)
settingsSnapshot[key] = value;
emit valueChanged(key, value);
}
- } else if (originalValueSet) {
+ } else {
// if sync fails, make sure the value in memory is the original
settings.setValue(key, originalValue);
- } else {
- settings.remove(key);
}
}
return returnValue;
diff --git a/src/scene/duiscenemanager.cpp b/src/scene/duiscenemanager.cpp
index b2e1949f..d469d54c 100644
--- a/src/scene/duiscenemanager.cpp
+++ b/src/scene/duiscenemanager.cpp
@@ -1005,6 +1005,11 @@ void DuiSceneManager::showWindowNow(DuiSceneWindow *window, DuiSceneWindow::Dele
int DuiSceneManager::execDialog(DuiDialog *dialog)
{
+ if (dialog == 0) {
+ duiWarning("DuiSceneManager") << "Invalid dialog instance";
+ return DuiDialog::Rejected;
+ }
+
QEventLoop eventLoop;
QPointer<DuiDialog> dialog_ptr = dialog;
connect(dialog, SIGNAL(finished(int)), &eventLoop, SLOT(quit()));
diff --git a/src/widgets/duiapplicationpage.cpp b/src/widgets/duiapplicationpage.cpp
index 757f160c..a1bdb658 100644
--- a/src/widgets/duiapplicationpage.cpp
+++ b/src/widgets/duiapplicationpage.cpp
@@ -336,6 +336,7 @@ void DuiApplicationPage::actionEvent(QActionEvent *e)
case QEvent::ActionRemoved: {
if (action)
action->disconnect(this);
+ //fall through is intentional.
}
case QEvent::ActionAdded: {
emit actionUpdated(e);