Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
a8884c5d
Commit
a8884c5d
authored
Nov 12, 2015
by
Hugo Beauzée-Luyssen
Browse files
Use a const sqlite::Row to load the cache key
parent
4be33502
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/Folder.cpp
View file @
a8884c5d
...
...
@@ -37,7 +37,7 @@ namespace policy
return
self
->
path
();
}
FolderCache
::
KeyType
FolderCache
::
key
(
sqlite
::
Row
&
row
)
FolderCache
::
KeyType
FolderCache
::
key
(
const
sqlite
::
Row
&
row
)
{
return
row
.
load
<
FolderCache
::
KeyType
>
(
1
);
}
...
...
src/Folder.h
View file @
a8884c5d
...
...
@@ -47,7 +47,7 @@ struct FolderCache
{
using
KeyType
=
std
::
string
;
static
const
KeyType
&
key
(
const
IFolder
*
self
);
static
KeyType
key
(
sqlite
::
Row
&
row
);
static
KeyType
key
(
const
sqlite
::
Row
&
row
);
};
}
...
...
src/Label.cpp
View file @
a8884c5d
...
...
@@ -95,7 +95,7 @@ const std::string&policy::LabelCachePolicy::key( const ILabel* self )
return
self
->
name
();
}
std
::
string
policy
::
LabelCachePolicy
::
key
(
sqlite
::
Row
&
row
)
std
::
string
policy
::
LabelCachePolicy
::
key
(
const
sqlite
::
Row
&
row
)
{
return
row
.
load
<
KeyType
>
(
1
);
}
src/Label.h
View file @
a8884c5d
...
...
@@ -45,7 +45,7 @@ struct LabelCachePolicy
{
typedef
std
::
string
KeyType
;
static
const
std
::
string
&
key
(
const
ILabel
*
self
);
static
std
::
string
key
(
sqlite
::
Row
&
row
);
static
std
::
string
key
(
const
sqlite
::
Row
&
row
);
};
}
...
...
src/Media.cpp
View file @
a8884c5d
...
...
@@ -353,7 +353,7 @@ const std::string& policy::MediaCache::key( const IMedia* self )
return
self
->
mrl
();
}
std
::
string
policy
::
MediaCache
::
key
(
sqlite
::
Row
&
row
)
std
::
string
policy
::
MediaCache
::
key
(
const
sqlite
::
Row
&
row
)
{
return
row
.
load
<
std
::
string
>
(
5
);
}
src/Media.h
View file @
a8884c5d
...
...
@@ -53,7 +53,7 @@ struct MediaCache
{
typedef
std
::
string
KeyType
;
static
const
std
::
string
&
key
(
const
IMedia
*
self
);
static
std
::
string
key
(
sqlite
::
Row
&
row
);
static
std
::
string
key
(
const
sqlite
::
Row
&
row
);
};
}
...
...
src/database/Cache.h
View file @
a8884c5d
...
...
@@ -40,7 +40,7 @@ class PrimaryKeyCacheKeyPolicy
{
return
self
->
id
();
}
static
unsigned
int
key
(
sqlite
::
Row
&
row
)
static
unsigned
int
key
(
const
sqlite
::
Row
&
row
)
{
return
row
.
load
<
unsigned
int
>
(
0
);
}
...
...
src/database/SqliteTools.h
View file @
a8884c5d
...
...
@@ -74,7 +74,7 @@ public:
* @brief Returns the value in column idx, but doesn't advance to the next column
*/
template
<
typename
T
>
T
load
(
unsigned
int
idx
)
T
load
(
unsigned
int
idx
)
const
{
if
(
m_idx
+
1
>
m_nbColumns
)
throw
errors
::
ColumnOutOfRange
(
m_idx
,
m_nbColumns
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment