homescreenapp/hsdomainmodel/src/hsdatabase.cpp
changeset 46 23b5d6a29cce
parent 39 4e8ebe173323
child 51 4785f57bf3d4
--- a/homescreenapp/hsdomainmodel/src/hsdatabase.cpp	Mon May 03 12:24:59 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsdatabase.cpp	Fri May 14 15:43:04 2010 +0300
@@ -52,7 +52,8 @@
     Constructs a new database with the given \a parent object.
 */
 HsDatabase::HsDatabase(QObject *parent)
-  : QObject(parent)
+  : QObject(parent),
+  	mBlocked(false)
 {
 }
 
@@ -102,6 +103,10 @@
 */  
 bool HsDatabase::open()
 {
+	if (mBlocked) {
+		return false;
+	}
+
     QSqlDatabase database;
     if (QSqlDatabase::contains(mConnectionName)) {
         database = QSqlDatabase::database(mConnectionName);
@@ -190,10 +195,10 @@
         data.landscapeWallpaper  = query.value(2).toString();
         data.defaultPageId       = query.value(3).toInt();
         data.maximumPageCount    = query.value(4).toInt();
-        data.maximumWidgetHeight = query.value(5).toInt();
-        data.maximumWidgetWidth  = query.value(6).toInt();
-        data.minimumWidgetHeight = query.value(7).toInt();
-        data.minimumWidgetWidth  = query.value(8).toInt();
+        data.maximumWidgetHeight = query.value(5).toReal();
+        data.maximumWidgetWidth  = query.value(6).toReal();
+        data.minimumWidgetHeight = query.value(7).toReal();
+        data.minimumWidgetWidth  = query.value(8).toReal();
         return true;
     }
     
@@ -752,7 +757,24 @@
 
     return true;
 }
- 
+
+/*!
+    Sets the database blocked or unblocked.
+*/
+void HsDatabase::setDataBaseBlocked(bool blocked)
+{
+	mBlocked = blocked;
+}
+
+/*!
+    Returns is the database blocked.
+    Return value true if blocked.
+*/
+bool HsDatabase::getDataBaseBlocked()
+{
+	return mBlocked;
+}
+
 /*!
     Sets the database instance. The existing instance
     will be deleted.