Removed warnings from ipcbase.cpp
Removed extra wxYields from progress dialog Yield on wxX11 yields twice git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -31,8 +31,10 @@ IMPLEMENT_CLASS(wxClientBase, wxObject)
|
|||||||
IMPLEMENT_CLASS(wxConnectionBase, wxObject)
|
IMPLEMENT_CLASS(wxConnectionBase, wxObject)
|
||||||
|
|
||||||
wxConnectionBase::wxConnectionBase(wxChar *buffer, int size)
|
wxConnectionBase::wxConnectionBase(wxChar *buffer, int size)
|
||||||
: m_buffer(buffer), m_buffersize(size),
|
: m_connected(true),
|
||||||
m_deletebufferwhendone(false), m_connected(true)
|
m_buffer(buffer),
|
||||||
|
m_buffersize(size),
|
||||||
|
m_deletebufferwhendone(false)
|
||||||
{
|
{
|
||||||
if ( buffer == (wxChar *)NULL )
|
if ( buffer == (wxChar *)NULL )
|
||||||
{ // behave like next constructor
|
{ // behave like next constructor
|
||||||
@@ -42,14 +44,19 @@ wxConnectionBase::wxConnectionBase(wxChar *buffer, int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxConnectionBase::wxConnectionBase()
|
wxConnectionBase::wxConnectionBase()
|
||||||
: m_buffersize(0), m_buffer(NULL), m_deletebufferwhendone(true),
|
: m_connected(true),
|
||||||
m_connected(true)
|
m_buffer(NULL),
|
||||||
|
m_buffersize(0),
|
||||||
|
m_deletebufferwhendone(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxConnectionBase::wxConnectionBase(wxConnectionBase& copy)
|
wxConnectionBase::wxConnectionBase(wxConnectionBase& copy)
|
||||||
: m_buffer(copy.m_buffer), m_buffersize(copy.m_buffersize),
|
: m_connected(copy.m_connected),
|
||||||
m_deletebufferwhendone(false), m_connected(copy.m_connected)
|
m_buffer(copy.m_buffer),
|
||||||
|
m_buffersize(copy.m_buffersize),
|
||||||
|
m_deletebufferwhendone(false)
|
||||||
|
|
||||||
{
|
{
|
||||||
// copy constructor would require ref-counted pointer to buffer
|
// copy constructor would require ref-counted pointer to buffer
|
||||||
wxFAIL_MSG( _T("Copy constructor of wxConnectionBase not implemented") );
|
wxFAIL_MSG( _T("Copy constructor of wxConnectionBase not implemented") );
|
||||||
|
@@ -269,11 +269,6 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
// Update the display (especially on X, GTK)
|
// Update the display (especially on X, GTK)
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
// FIXME: shouldn't be needed
|
|
||||||
#ifdef __WXX11__
|
|
||||||
wxYield();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
MacUpdateImmediately();
|
MacUpdateImmediately();
|
||||||
#endif
|
#endif
|
||||||
@@ -337,11 +332,6 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
|
|||||||
m_msg->SetLabel(newmsg);
|
m_msg->SetLabel(newmsg);
|
||||||
|
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
// FIXME: shouldn't be needed
|
|
||||||
#ifdef __WXX11__
|
|
||||||
wxYield();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) )
|
if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) )
|
||||||
@@ -382,11 +372,6 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
|
|||||||
|
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
// FIXME: shouldn't be needed
|
|
||||||
#ifdef __WXX11__
|
|
||||||
wxYield();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
(void)ShowModal();
|
(void)ShowModal();
|
||||||
}
|
}
|
||||||
else // auto hide
|
else // auto hide
|
||||||
@@ -403,11 +388,6 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
|
|||||||
{
|
{
|
||||||
// update the display
|
// update the display
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
// FIXME: shouldn't be needed
|
|
||||||
#ifdef __WXX11__
|
|
||||||
wxYield();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
@@ -90,8 +90,8 @@ void wxTimerScheduler::QueueTimer(wxTimerDesc *desc, unsigned long when)
|
|||||||
desc->shotTime = when;
|
desc->shotTime = when;
|
||||||
desc->running = TRUE;
|
desc->running = TRUE;
|
||||||
|
|
||||||
wxLogTrace("timer", "queued timer %p at tick %i",
|
wxLogTrace("timer", "queued timer %p at tick %ld",
|
||||||
desc->timer, when);
|
desc->timer, (long) when);
|
||||||
|
|
||||||
if ( m_timers )
|
if ( m_timers )
|
||||||
{
|
{
|
||||||
@@ -143,8 +143,8 @@ void wxTimerScheduler::NotifyTimers()
|
|||||||
|
|
||||||
if ( !timerDeleted )
|
if ( !timerDeleted )
|
||||||
{
|
{
|
||||||
wxLogTrace("timer", "notified timer %p sheduled for %i",
|
wxLogTrace("timer", "notified timer %p sheduled for %ld",
|
||||||
desc->timer, desc->shotTime);
|
desc->timer, (long) desc->shotTime);
|
||||||
|
|
||||||
desc->deleteFlag = NULL;
|
desc->deleteFlag = NULL;
|
||||||
if ( !oneShot )
|
if ( !oneShot )
|
||||||
|
@@ -1040,4 +1040,3 @@ void wxFontModule::OnExit()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
// not GTK 2.0
|
// not GTK 2.0
|
||||||
|
|
@@ -1174,46 +1174,53 @@ void wxExit()
|
|||||||
|
|
||||||
bool wxApp::Yield(bool onlyIfNeeded)
|
bool wxApp::Yield(bool onlyIfNeeded)
|
||||||
{
|
{
|
||||||
bool s_inYield = FALSE;
|
// Sometimes only 2 yields seem
|
||||||
|
// to do the trick, e.g. in the
|
||||||
if ( s_inYield )
|
// progress dialog
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
if ( !onlyIfNeeded )
|
bool s_inYield = FALSE;
|
||||||
|
|
||||||
|
if ( s_inYield )
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxYield called recursively" ) );
|
if ( !onlyIfNeeded )
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( wxT("wxYield called recursively" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
s_inYield = TRUE;
|
||||||
}
|
|
||||||
|
|
||||||
s_inYield = TRUE;
|
// Make sure we have an event loop object,
|
||||||
|
// or Pending/Dispatch will fail
|
||||||
|
wxEventLoop* eventLoop = wxEventLoop::GetActive();
|
||||||
|
wxEventLoop* newEventLoop = NULL;
|
||||||
|
if (!eventLoop)
|
||||||
|
{
|
||||||
|
newEventLoop = new wxEventLoop;
|
||||||
|
wxEventLoop::SetActive(newEventLoop);
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure we have an event loop object,
|
while (wxTheApp && wxTheApp->Pending())
|
||||||
// or Pending/Dispatch will fail
|
wxTheApp->Dispatch();
|
||||||
wxEventLoop* eventLoop = wxEventLoop::GetActive();
|
|
||||||
wxEventLoop* newEventLoop = NULL;
|
|
||||||
if (!eventLoop)
|
|
||||||
{
|
|
||||||
newEventLoop = new wxEventLoop;
|
|
||||||
wxEventLoop::SetActive(newEventLoop);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (wxTheApp && wxTheApp->Pending())
|
|
||||||
wxTheApp->Dispatch();
|
|
||||||
|
|
||||||
#if wxUSE_TIMER
|
#if wxUSE_TIMER
|
||||||
wxTimer::NotifyTimers();
|
wxTimer::NotifyTimers();
|
||||||
#endif
|
#endif
|
||||||
ProcessIdle();
|
ProcessIdle();
|
||||||
|
|
||||||
if (newEventLoop)
|
if (newEventLoop)
|
||||||
{
|
{
|
||||||
wxEventLoop::SetActive(NULL);
|
wxEventLoop::SetActive(NULL);
|
||||||
delete newEventLoop;
|
delete newEventLoop;
|
||||||
|
}
|
||||||
|
|
||||||
|
s_inYield = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_inYield = FALSE;
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user