summaryrefslogtreecommitdiff
path: root/ui/grid_view.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:14:37 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:14:37 +0200
commit8bf668665b107469086f16cb8ad23e47d479d2b4 (patch)
tree66a91ef06a8caa7cd6819dcbe1860693d3eda8d5 /ui/grid_view.h
parent3.21 (diff)
downloadFreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.tar.gz
FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.tar.bz2
FreeFileSync-8bf668665b107469086f16cb8ad23e47d479d2b4.zip
4.0
Diffstat (limited to 'ui/grid_view.h')
-rw-r--r--ui/grid_view.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/ui/grid_view.h b/ui/grid_view.h
index 87d5c38d..5bf2f8b2 100644
--- a/ui/grid_view.h
+++ b/ui/grid_view.h
@@ -120,15 +120,15 @@ private:
struct RefIndex
{
- RefIndex(size_t folderInd, HierarchyObject::ObjectID id) :
+ RefIndex(size_t folderInd, FileSystemObject::ObjectID id) :
folderIndex(folderInd),
objId(id) {}
size_t folderIndex;
- HierarchyObject::ObjectID objId;
+ FileSystemObject::ObjectID objId;
};
- FileSystemObject* getReferencedRow(const RefIndex ref); //returns NULL if not found
- const FileSystemObject* getReferencedRow(const RefIndex ref) const; //returns NULL if not found
+ FileSystemObject* getReferencedRow(const RefIndex& ref); //returns NULL if not found
+ const FileSystemObject* getReferencedRow(const RefIndex& ref) const; //returns NULL if not found
bool isInvalidRow(const RefIndex& ref) const;
@@ -147,7 +147,7 @@ private:
template <bool ascending>
class LessDirectoryPair;
- template <bool ascending, SelectedSide side>
+ template <bool ascending>
class LessRelativeName;
template <bool ascending, SelectedSide side>
@@ -219,17 +219,16 @@ size_t GridView::rowsTotal() const //total number of rows available
inline
-const zen::FileSystemObject* GridView::getReferencedRow(const RefIndex ref) const
+const zen::FileSystemObject* GridView::getReferencedRow(const RefIndex& ref) const
{
- return folderCmp[ref.folderIndex].retrieveById(ref.objId);
+ return FileSystemObject::retrieve(ref.objId);
}
inline
-zen::FileSystemObject* GridView::getReferencedRow(const RefIndex ref)
+zen::FileSystemObject* GridView::getReferencedRow(const RefIndex& ref)
{
- //code re-use of const method: see Meyers Effective C++
- return const_cast<FileSystemObject*>(static_cast<const GridView&>(*this).getReferencedRow(ref));
+ return FileSystemObject::retrieve(ref.objId);
}
}
bgstack15