From: György Straub Date: Wed, 28 Oct 2020 11:52:56 +0000 (+0000) Subject: Simplified the Scripted UI example. X-Git-Tag: dali_2.0.0~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F57%2F246457%2F4;p=platform%2Fcore%2Fuifw%2Fdali-demo.git Simplified the Scripted UI example. - there is no need to pre-populate the item view; it will be populated upon activation; - removed branching & multiple returns in FileWatcher::FileHasChanged(); Change-Id: I47a92d5f0e3d84701f1688ba083f4a6850b6d909 Signed-off-by: György Straub --- diff --git a/examples/builder/examples.cpp b/examples/builder/examples.cpp index 4835599..cf0f140 100644 --- a/examples/builder/examples.cpp +++ b/examples/builder/examples.cpp @@ -201,16 +201,9 @@ bool FileWatcher::FileHasChanged(void) } else { - if(buf.st_mtime > mLastTime) - { - mLastTime = buf.st_mtime; - return true; - } - else - { - mLastTime = buf.st_mtime; - return false; - } + const bool result = buf.st_mtime > mLastTime; + mLastTime = buf.st_mtime; + return result; } return false; @@ -305,7 +298,6 @@ public: std::sort(files.begin(), files.end()); - ItemId itemId = 0; for(FileList::iterator iter = files.begin(); iter != files.end(); ++iter) { JsonParser parser = JsonParser::New(); @@ -329,12 +321,6 @@ public: if(node->Size()) { mFiles.push_back(*iter); - - mItemView.InsertItem(Item(itemId, - MenuItem(ShortName(*iter))), - 0.5f); - - itemId++; } else {