Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
f55bdf07
Commit
f55bdf07
authored
Mar 18, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/Interface: Open() throws exception on error
parent
6c2b532a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
27 deletions
+15
-27
Main.cxx
src/Main.cxx
+1
-2
Interface.hxx
src/db/Interface.hxx
+3
-2
ProxyDatabasePlugin.cxx
src/db/plugins/ProxyDatabasePlugin.cxx
+3
-5
SimpleDatabasePlugin.cxx
src/db/plugins/simple/SimpleDatabasePlugin.cxx
+3
-8
SimpleDatabasePlugin.hxx
src/db/plugins/simple/SimpleDatabasePlugin.hxx
+1
-1
UpnpDatabasePlugin.cxx
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
+3
-5
DumpDatabase.cxx
test/DumpDatabase.cxx
+1
-4
No files found.
src/Main.cxx
View file @
f55bdf07
...
...
@@ -214,8 +214,7 @@ glue_db_init_and_load(void)
"because the database does not need it"
);
}
if
(
!
instance
->
database
->
Open
(
error
))
FatalError
(
error
);
instance
->
database
->
Open
();
if
(
!
instance
->
database
->
IsPlugin
(
simple_db_plugin
))
return
true
;
...
...
src/db/Interface.hxx
View file @
f55bdf07
...
...
@@ -55,9 +55,10 @@ public:
/**
* Open the database. Read it into memory if applicable.
*
* Throws #DatabaseError or std::runtime_error on error.
*/
virtual
bool
Open
(
gcc_unused
Error
&
error
)
{
return
true
;
virtual
void
Open
()
{
}
/**
...
...
src/db/plugins/ProxyDatabasePlugin.cxx
View file @
f55bdf07
...
...
@@ -113,7 +113,7 @@ public:
const
ConfigBlock
&
block
,
Error
&
error
);
virtual
bool
Open
(
Error
&
error
)
override
;
virtual
void
Open
(
)
override
;
virtual
void
Close
()
override
;
virtual
const
LightSong
*
GetSong
(
const
char
*
uri_utf8
,
Error
&
error
)
const
override
;
...
...
@@ -362,14 +362,12 @@ ProxyDatabase::Configure(const ConfigBlock &block, gcc_unused Error &error)
return
true
;
}
bool
ProxyDatabase
::
Open
(
gcc_unused
Error
&
error
)
void
ProxyDatabase
::
Open
()
{
Connect
();
update_stamp
=
0
;
return
true
;
}
void
...
...
src/db/plugins/simple/SimpleDatabasePlugin.cxx
View file @
f55bdf07
...
...
@@ -184,8 +184,8 @@ SimpleDatabase::Load(Error &error)
return
true
;
}
bool
SimpleDatabase
::
Open
(
gcc_unused
Error
&
error
)
void
SimpleDatabase
::
Open
()
{
assert
(
prefixed_light_song
==
nullptr
);
...
...
@@ -216,8 +216,6 @@ SimpleDatabase::Open(gcc_unused Error &error)
root
=
Directory
::
NewRoot
();
}
return
true
;
}
void
...
...
@@ -459,10 +457,7 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri,
name_fs
.
c_str
()),
compress
);
try
{
if
(
!
db
->
Open
(
error
))
{
delete
db
;
return
false
;
}
db
->
Open
();
}
catch
(...)
{
delete
db
;
throw
;
...
...
src/db/plugins/simple/SimpleDatabasePlugin.hxx
View file @
f55bdf07
...
...
@@ -107,7 +107,7 @@ public:
bool
Unmount
(
const
char
*
uri
);
/* virtual methods from class Database */
virtual
bool
Open
(
Error
&
error
)
override
;
virtual
void
Open
(
)
override
;
virtual
void
Close
()
override
;
const
LightSong
*
GetSong
(
const
char
*
uri_utf8
,
...
...
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
View file @
f55bdf07
...
...
@@ -80,7 +80,7 @@ public:
const
ConfigBlock
&
block
,
Error
&
error
);
virtual
bool
Open
(
Error
&
error
)
override
;
virtual
void
Open
(
)
override
;
virtual
void
Close
()
override
;
virtual
const
LightSong
*
GetSong
(
const
char
*
uri_utf8
,
Error
&
error
)
const
override
;
...
...
@@ -168,8 +168,8 @@ UpnpDatabase::Configure(const ConfigBlock &, Error &)
return
true
;
}
bool
UpnpDatabase
::
Open
(
gcc_unused
Error
&
error
)
void
UpnpDatabase
::
Open
()
{
UpnpClientGlobalInit
(
handle
);
...
...
@@ -181,8 +181,6 @@ UpnpDatabase::Open(gcc_unused Error &error)
UpnpClientGlobalFinish
();
throw
;
}
return
true
;
}
void
...
...
test/DumpDatabase.cxx
View file @
f55bdf07
...
...
@@ -136,10 +136,7 @@ try {
AtScopeExit
(
db
)
{
delete
db
;
};
if
(
!
db
->
Open
(
error
))
{
cerr
<<
error
.
GetMessage
()
<<
endl
;
return
EXIT_FAILURE
;
}
db
->
Open
();
AtScopeExit
(
db
)
{
db
->
Close
();
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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