summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeif Lotfy <seif@lotfy.com>2013-03-08 14:01:52 +0100
committerSeif Lotfy <seif@lotfy.com>2013-03-08 18:34:51 +0100
commit9292f9ceb120b42e509af7d65ae0f5c65a5cabbc (patch)
tree028df04abef07860735250d2571c6dc319ef25d8
parent6b62b330e140385534f0d02e90fbb38acc681e33 (diff)
downloadzeitgeist-9292f9ceb120b42e509af7d65ae0f5c65a5cabbc.tar.gz
Remove explicit Sourcefunc setting
Throw only EngineError
-rw-r--r--libzeitgeist/log.vala54
1 files changed, 17 insertions, 37 deletions
diff --git a/libzeitgeist/log.vala b/libzeitgeist/log.vala
index 04f0e577..cc4b116f 100644
--- a/libzeitgeist/log.vala
+++ b/libzeitgeist/log.vala
@@ -272,10 +272,9 @@ public class Log : QueuedProxyWrapper
StorageState storage_state,
uint32 num_events,
ResultType result_type,
- Cancellable? cancellable=null) throws EngineError, Error
+ Cancellable? cancellable=null) throws Error
{
if (dbreader != null) {
- SourceFunc callback = find_events.callback;
SimpleResultSet result_set = null;
EngineError error = null;
ThreadFunc<void*> run = () => {
@@ -286,17 +285,13 @@ public class Log : QueuedProxyWrapper
} catch (EngineError err) {
error = err;
} finally {
- Idle.add ((owned) callback);
+ Idle.add (find_events.callback);
}
return null;
};
- try {
- threads.add (new DbWorker (run));
- yield;
- } catch (ThreadError err) {
- error = new EngineError.DATABASE_ERROR (err.message);
- }
+ threads.add (new DbWorker (run));
+ yield;
if (error != null)
throw error;
@@ -340,10 +335,9 @@ public class Log : QueuedProxyWrapper
StorageState storage_state,
uint32 num_events,
ResultType result_type,
- Cancellable? cancellable=null) throws EngineError, Error
+ Cancellable? cancellable=null) throws Error
{
if (dbreader != null) {
- SourceFunc callback = find_event_ids.callback;
uint32[] ids = null;
EngineError error = null;
ThreadFunc<void*> run = () => {
@@ -353,17 +347,13 @@ public class Log : QueuedProxyWrapper
} catch (EngineError err) {
error = err;
} finally {
- Idle.add ((owned) callback);
+ Idle.add (find_event_ids.callback);
}
return null;
};
- try {
- threads.add (new DbWorker (run));
- yield;
- } catch (ThreadError err) {
- error = new EngineError.DATABASE_ERROR (err.message);
- }
+ threads.add (new DbWorker (run));
+ yield;
if (error != null)
throw error;
@@ -397,7 +387,7 @@ public class Log : QueuedProxyWrapper
*/
public async ResultSet get_events (
Array<uint32> event_ids,
- Cancellable? cancellable=null) throws EngineError, Error
+ Cancellable? cancellable=null) throws Error
{
uint32[] simple_event_ids = new uint32[event_ids.length];
for (int i = 0; i < event_ids.length; i++)
@@ -405,7 +395,6 @@ public class Log : QueuedProxyWrapper
if (dbreader != null)
{
- SourceFunc callback = get_events.callback;
SimpleResultSet result_set = null;
EngineError error = null;
ThreadFunc<void*> run = () => {
@@ -415,17 +404,13 @@ public class Log : QueuedProxyWrapper
} catch (EngineError err) {
error = err;
} finally {
- Idle.add ((owned) callback);
+ Idle.add (get_events.callback);
}
return null;
};
- try {
- threads.add (new DbWorker (run));
- yield;
- } catch (ThreadError err) {
- error = new EngineError.DATABASE_ERROR (err.message);
- }
+ threads.add (new DbWorker (run));
+ yield;
if (error != null)
throw error;
@@ -459,10 +444,9 @@ public class Log : QueuedProxyWrapper
StorageState storage_state,
uint32 num_events,
ResultType result_type,
- Cancellable? cancellable=null) throws EngineError, Error
+ Cancellable? cancellable=null) throws Error
{
if (dbreader != null) {
- SourceFunc callback = find_related_uris.callback;
string[] uris = null;
EngineError error = null;
ThreadFunc<void*> run = () => {
@@ -472,18 +456,14 @@ public class Log : QueuedProxyWrapper
} catch (EngineError err) {
error = err;
} finally {
- Idle.add ((owned) callback);
+ Idle.add (find_related_uris.callback);
}
return null;
};
- try {
- threads.add (new DbWorker (run));
- yield;
- } catch (ThreadError err) {
- error = new EngineError.DATABASE_ERROR (err.message);
- }
-
+ threads.add (new DbWorker (run));
+ yield;
+
if (error != null)
throw error;
return uris;