Skip to content

Commit fcecf9f

Browse files
committed
Replace deprecated boost timer
Signed-off-by: Patrik Dahlström <risca@powerlamerz.org>
1 parent d939624 commit fcecf9f

7 files changed

Lines changed: 6 additions & 12 deletions

File tree

plex/CMakeModules/PlatformConfigLINUX.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ foreach(l ${LINK_PKG})
6464
plex_find_package(${l} 1 1)
6565
endforeach()
6666

67-
find_package(Boost COMPONENTS thread system REQUIRED)
67+
find_package(Boost COMPONENTS thread system timer REQUIRED)
6868
if(Boost_FOUND)
6969
include_directories(${Boost_INCLUDE_DIRS})
7070
list(APPEND CONFIG_PLEX_LINK_LIBRARIES ${Boost_LIBRARIES})

plex/Client/PlexServer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "PlexTranscoderClient.h"
1010

1111
#include <boost/foreach.hpp>
12-
#include <boost/timer.hpp>
12+
#include <boost/timer/timer.hpp>
1313
#include <settings/AdvancedSettings.h>
1414

1515
using namespace std;
@@ -233,7 +233,7 @@ bool CPlexServer::UpdateReachability()
233233
if (m_connections.size() == 0)
234234
return false;
235235

236-
m_connTestTimer.restart();
236+
boost::timer::cpu_timer timer; // start timer
237237
CLog::Log(LOGDEBUG, "CPlexServer::UpdateReachability Updating reachability for %s with %ld connections.", m_name.c_str(), m_connections.size());
238238

239239
m_bestConnection.reset();
@@ -281,9 +281,10 @@ bool CPlexServer::UpdateReachability()
281281
CSingleLock tlk(m_testingLock);
282282
m_complete = true;
283283
m_activeConnection = m_bestConnection;
284+
timer.stop();
284285

285-
CLog::Log(LOGDEBUG, "CPlexServer::UpdateReachability Connectivity test to %s completed in %.1f Seconds -> %s",
286-
m_name.c_str(), m_connTestTimer.elapsed(), m_activeConnection ? m_activeConnection->toString().c_str() : "FAILED");
286+
CLog::Log(LOGDEBUG, "CPlexServer::UpdateReachability Connectivity test to %s completed in %s Seconds -> %s",
287+
m_name.c_str(), timer.format(1, "%w").c_str(), m_activeConnection ? m_activeConnection->toString().c_str() : "FAILED");
287288

288289
return (bool)m_bestConnection;
289290
}

plex/Client/PlexServer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#include <boost/shared_ptr.hpp>
77
#include <boost/enable_shared_from_this.hpp>
8-
#include <boost/timer.hpp>
98

109
#include "threads/CriticalSection.h"
1110
#include "Job.h"
@@ -151,8 +150,6 @@ class CPlexServer : public boost::enable_shared_from_this<CPlexServer>
151150
int m_connectionsLeft;
152151
bool m_complete;
153152

154-
boost::timer m_connTestTimer;
155-
156153
CCriticalSection m_serverLock;
157154

158155
CCriticalSection m_testingLock;

plex/Home/GUIWindowHome.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "guilib/GUIWindow.h"
2828
#include "guilib/GUIStaticItem.h"
2929
#include "Job.h"
30-
#include <boost/timer.hpp>
3130

3231
#include "VideoThumbLoader.h"
3332
#include "MusicThumbLoader.h"

plex/Network/NetworkServiceAdvertiser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <boost/foreach.hpp>
1313
#include <boost/shared_ptr.hpp>
1414
#include <boost/thread.hpp>
15-
#include <boost/timer.hpp>
1615

1716
#include "NetworkService.h"
1817
#include "NetworkServiceBase.h"

plex/Network/NetworkServiceBrowser.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <boost/asio.hpp>
1818
#include <boost/foreach.hpp>
1919
#include <boost/thread.hpp>
20-
#include <boost/timer.hpp>
2120

2221
#include "NetworkInterface.h"
2322
#include "NetworkServiceBase.h"

plex/Remote/PlexRemoteSubscriberManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include <map>
1313
#include <boost/shared_ptr.hpp>
14-
#include <boost/timer.hpp>
1514
#include "PlexGlobalTimer.h"
1615
#include "threads/Event.h"
1716
#include "URL.h"

0 commit comments

Comments
 (0)