Commit efa2b59b4616142e1ee55911a0d734d403c95879
1 parent
f2d34f64
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 <g.straub@partner.samsung.com>
Showing
1 changed file
with
3 additions
and
17 deletions
examples/builder/examples.cpp
| ... | ... | @@ -201,16 +201,9 @@ bool FileWatcher::FileHasChanged(void) |
| 201 | 201 | } |
| 202 | 202 | else |
| 203 | 203 | { |
| 204 | - if(buf.st_mtime > mLastTime) | |
| 205 | - { | |
| 206 | - mLastTime = buf.st_mtime; | |
| 207 | - return true; | |
| 208 | - } | |
| 209 | - else | |
| 210 | - { | |
| 211 | - mLastTime = buf.st_mtime; | |
| 212 | - return false; | |
| 213 | - } | |
| 204 | + const bool result = buf.st_mtime > mLastTime; | |
| 205 | + mLastTime = buf.st_mtime; | |
| 206 | + return result; | |
| 214 | 207 | } |
| 215 | 208 | |
| 216 | 209 | return false; |
| ... | ... | @@ -305,7 +298,6 @@ public: |
| 305 | 298 | |
| 306 | 299 | std::sort(files.begin(), files.end()); |
| 307 | 300 | |
| 308 | - ItemId itemId = 0; | |
| 309 | 301 | for(FileList::iterator iter = files.begin(); iter != files.end(); ++iter) |
| 310 | 302 | { |
| 311 | 303 | JsonParser parser = JsonParser::New(); |
| ... | ... | @@ -329,12 +321,6 @@ public: |
| 329 | 321 | if(node->Size()) |
| 330 | 322 | { |
| 331 | 323 | mFiles.push_back(*iter); |
| 332 | - | |
| 333 | - mItemView.InsertItem(Item(itemId, | |
| 334 | - MenuItem(ShortName(*iter))), | |
| 335 | - 0.5f); | |
| 336 | - | |
| 337 | - itemId++; | |
| 338 | 324 | } |
| 339 | 325 | else |
| 340 | 326 | { | ... | ... |