Unused code
authorTomasz Iwanek <t.iwanek@samsung.com>
Tue, 22 Jan 2013 14:38:41 +0000 (15:38 +0100)
committerTomasz Iwanek <t.iwanek@samsung.com>
Thu, 24 Jan 2013 14:54:31 +0000 (15:54 +0100)
[Issue#]       LINUXWRT-50
[Bug]          Unused code
[Cause]        N/A
[Solution]     N/A
[Verification] build repository

Change-Id: Ib07ca6e382cda2b1160c0ddd2dc26655caa67575

src/domain/widget_data_types.h
src/domain/widget_model.cpp
src/domain/widget_model.h

index cbaea0c..a3fcdf4 100644 (file)
 // WidgetStartFileInfo
 #include <dpl/localization/localization_utils.h>
 
-enum WidgetStandard
-{
-    WidgetStandard_Unknown,
-    WidgetStandard_Wac20
-};
-
 typedef std::list<WarpIRI> WarpIRIList;
 
 /**
@@ -79,11 +73,6 @@ typedef std::list<WarpIRI> WarpIRIList;
 //    WidgetExecutionPhase_Invoke            = 1 << 3
 //};
 
-/**
- * Widget version is optional
- */
-typedef DPL::Optional<WidgetVersion> OptionalWidgetVersion;
-
 class WidgetModel;
 
 class WidgetAccessList
@@ -106,23 +95,6 @@ class WidgetAccessList
     bool m_isAccessAll;
 };
 
-struct WidgetStorageSize
-{
-    WidgetStorageSize() :
-        applicationStorage(0),
-        dataStorage(0)
-    {
-    }
-    WidgetStorageSize(size_t pApplicationStorage,
-                      size_t pDataStorage) :
-        applicationStorage(pApplicationStorage),
-        dataStorage(pDataStorage)
-    {
-    }
-    size_t applicationStorage;
-    size_t dataStorage;
-};
-
 static const DPL::String SETTING_NAME_SCREEN_ORIENTATION =
     L"screen-orientation";
 static const DPL::String SETTING_NAME_INDICATOR_PRESENCE =
index 89e29c9..625899e 100644 (file)
@@ -79,14 +79,10 @@ WidgetModel::WidgetModel(const std::string &tizenId) :
                              WidgetConfig::GetWidgetTemporaryStoragePath(
                                  this->TizenId + getTimestamp()))
                          ),
-    GUID(
-        this,
-        &BindToWidgetDAO<WidgetGUID, &WidgetDAOReadOnly::getGUID>::Get),
     defaultlocale(
         this,
         &BindToWidgetDAO<DPL::OptionalString,
                          &WidgetDAOReadOnly::getDefaultlocale>::Get),
-    Version(this, &WidgetModel::readVersion),
     Name(this),
     //localized, so not binded
     ShortName(this),
@@ -107,8 +103,6 @@ WidgetModel::WidgetModel(const std::string &tizenId) :
         &BindToWidgetDAO<WindowModeList,
                          &WidgetDAOReadOnly::getWindowModes>::Get),
     //localized, so not binded
-    Standard(this, &WidgetModel::readStandard),
-    ApplicationStorage(this, &WidgetModel::getApplicationStorage),
 //    AccessNetwork(this, false),
 //    WarpDefinitionEmpty(this),
     BackSupported(
@@ -139,92 +133,6 @@ DPL::String WidgetModel::getTizenId() const
     return TizenId;
 }
 
-WidgetStorageSize WidgetModel::getApplicationStorage(DPL::Event::Model *model)
-{
-    Assert(model);
-    WidgetModel *widgetModel = static_cast<WidgetModel *>(model);
-    WidgetDAOReadOnly widgetDao(widgetModel->TizenId);
-
-    const DPL::String installPath = widgetDao.getPath();
-    const DPL::String persistentPath =
-        widgetModel->PersistentStoragePath.Get();
-    const DPL::String temporaryPath =
-        widgetModel->TemporaryStoragePath.Get();
-
-    size_t appSize =
-        Utils::getFolderSize(DPL::ToUTF8String(installPath));
-
-    auto isPrefix =
-        [&installPath](const DPL::String& possiblePrefix)
-        {
-            return possiblePrefix.length() <= installPath.length() &&
-                std::equal(possiblePrefix.begin(),
-                        possiblePrefix.end(),
-                        installPath.begin());
-        };
-
-    size_t persistanceSize =
-        Utils::getFolderSize(DPL::ToUTF8String(persistentPath));
-    // we have to remember that persistance path can be inside install path
-    if (isPrefix(persistentPath)) {
-        appSize -= persistanceSize;
-    }
-
-    size_t temporarySize =
-        Utils::getFolderSize(DPL::ToUTF8String(temporaryPath));
-    // we have to remember that persistance path can be inside install path
-    if (isPrefix(temporaryPath)) {
-        appSize -= temporarySize;
-    }
-
-    LogDebug("App size: " << appSize);
-    LogDebug("Persistance size: " << persistanceSize);
-    LogDebug("Temporary size: " << temporaryPath);
-    return WidgetStorageSize(appSize, persistanceSize + temporarySize);
-}
-
-namespace { //anonymous
-const float FLOAT_WAC20_REPRESENTATION = 2.0;
-} //namespace anonymous
-
-WidgetStandard WidgetModel::readStandard(DPL::Event::Model *model)
-{
-    WidgetModel *widgetModel = static_cast<WidgetModel *>(model);
-
-    DPL::OptionalString minWacVersionString =
-        WidgetDAOReadOnly(widgetModel->TizenId).getMinimumWacVersion();
-
-    if (!minWacVersionString) {
-        return WidgetStandard_Unknown;
-    } else {
-        float minWacVersion;
-        std::stringstream minWacVersionStream(DPL::ToUTF8String(
-                                                  *minWacVersionString));
-        minWacVersionStream >> minWacVersion;
-        if (minWacVersionStream.fail()) {
-            return WidgetStandard_Unknown;
-        } else if (minWacVersion == FLOAT_WAC20_REPRESENTATION) {
-            return WidgetStandard_Wac20;
-        } else {
-            return WidgetStandard_Unknown;
-        }
-    }
-}
-
-OptionalWidgetVersion WidgetModel::readVersion(DPL::Event::Model *model)
-{
-    WidgetModel *widgetModel = static_cast<WidgetModel *>(model);
-
-    DPL::OptionalString optionalVersionString =
-        WidgetDAOReadOnly(widgetModel->TizenId).getVersion();
-
-    if (!optionalVersionString) {
-        return OptionalWidgetVersion();
-    } else {
-        return OptionalWidgetVersion(WidgetVersion(*optionalVersionString));
-    }
-}
-
 DPL::String WidgetModel::getTimestamp()
 {
     struct timeval tv;
index 9a52a55..51ff9fc 100644 (file)
@@ -114,13 +114,6 @@ class WidgetModel : public DPL::Event::Model
     DPL::Event::Property<DPL::String, DPL::Event::PropertyReadOnly> TemporaryStoragePath;
 
     /**
-     * @brief Widget GUID
-     */
-    DPL::Event::Property<WrtDB::WidgetGUID,
-                  DPL::Event::PropertyReadOnly,
-                  DPL::Event::PropertyStorageDynamicCached> GUID;
-
-    /**
      * @brief Widget defaultlocale
      */
     DPL::Event::Property<DPL::OptionalString,
@@ -128,13 +121,6 @@ class WidgetModel : public DPL::Event::Model
                   DPL::Event::PropertyStorageDynamicCached> defaultlocale;
 
     /**
-     * @brief Widget version
-     */
-    DPL::Event::Property<OptionalWidgetVersion,
-                  DPL::Event::PropertyReadOnly,
-                  DPL::Event::PropertyStorageDynamicCached> Version;
-
-    /**
      * @brief Widget name
      */
     DPL::Event::Property<DPL::OptionalString> Name;
@@ -178,19 +164,6 @@ class WidgetModel : public DPL::Event::Model
                   DPL::Event::PropertyReadOnly,
                   DPL::Event::PropertyStorageDynamic> WindowModes;
 
-    /**
-     * @brief Minimum of the WAC Engine Standard required to run widget.
-     */
-    DPL::Event::Property<WidgetStandard,
-                  DPL::Event::PropertyReadOnly,
-                  DPL::Event::PropertyStorageDynamicCached> Standard;
-
-    /**
-     * @brief How much space application and its storage takes.
-     */
-    DPL::Event::Property<WidgetStorageSize,
-                  DPL::Event::PropertyReadOnly,
-                  DPL::Event::PropertyStorageDynamicCached> ApplicationStorage;
     //    /**
     //     * @brief Value of network element.
     //     */
@@ -233,9 +206,6 @@ class WidgetModel : public DPL::Event::Model
 
   private:
     // Custom read write delegates
-    static WidgetStandard        readStandard(DPL::Event::Model *model);
-    static OptionalWidgetVersion readVersion(DPL::Event::Model *model);
-    static WidgetStorageSize     getApplicationStorage(DPL::Event::Model *model);
     static DPL::String           getTimestamp();
 
     DPL::String getTizenId() const;