this fixed the correct handling of the default main loop
but setting another DefaultTimeout isn't nice. I've to look later again into the problem. Maybe I did it wrong. Currently there's a compiler warning that could be ignores as long as Slot is created with void parameter, but I consider this as bug in the long time and I've to fix it!!
This commit is contained in:
parent
9af6f707eb
commit
dc833f4a89
8 changed files with 54 additions and 31 deletions
|
@ -44,7 +44,7 @@ public:
|
|||
/*!
|
||||
* \brief Gets the timeout interval.
|
||||
*
|
||||
* The dbus_timeout_handle() should be called each time this interval elapses,
|
||||
* The handle() should be called each time this interval elapses,
|
||||
* starting after it elapses once.
|
||||
*
|
||||
* The interval may change during the life of the timeout; if so, the timeout
|
||||
|
|
|
@ -54,9 +54,9 @@ private:
|
|||
|
||||
private:
|
||||
|
||||
GSource *_source;
|
||||
GMainContext *_ctx;
|
||||
int _priority;
|
||||
GSource *_source;
|
||||
|
||||
friend class BusDispatcher;
|
||||
};
|
||||
|
@ -79,9 +79,9 @@ private:
|
|||
|
||||
private:
|
||||
|
||||
GSource *_source;
|
||||
GMainContext *_ctx;
|
||||
int _priority;
|
||||
GSource *_source;
|
||||
|
||||
friend class BusDispatcher;
|
||||
};
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
*/
|
||||
void write(const void *buffer, unsigned int nbytes);
|
||||
|
||||
ssize_t read(void *buffer, unsigned int nbytes);
|
||||
ssize_t read(void *buffer, unsigned int &nbytes);
|
||||
|
||||
/*!
|
||||
* Simply write one single byte into the pipe. This is a shortcut
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <cassert>
|
||||
|
||||
#include "api.h"
|
||||
#include "debug.h"
|
||||
|
||||
|
@ -232,15 +234,29 @@ public:
|
|||
|
||||
R operator()(P param) const
|
||||
{
|
||||
/*if (_cb.get())*/ return _cb->call(param);
|
||||
if (!empty())
|
||||
{
|
||||
return _cb->call(param);
|
||||
}
|
||||
|
||||
// TODO: think about return type in this case
|
||||
// this assert should help me to find the use case where it's needed...
|
||||
//assert (false);
|
||||
}
|
||||
|
||||
R call(P param) const
|
||||
{
|
||||
/*if (_cb.get())*/ return _cb->call(param);
|
||||
if (!empty())
|
||||
{
|
||||
return _cb->call(param);
|
||||
}
|
||||
|
||||
// TODO: think about return type in this case
|
||||
// this assert should help me to find the use case where it's needed...
|
||||
//assert (false);
|
||||
}
|
||||
|
||||
bool empty()
|
||||
bool empty() const
|
||||
{
|
||||
return _cb.get() == 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue