Commit ff333a47 authored by Noah Davis's avatar Noah Davis 🌵
Browse files

Fix QTime function deprecation warnings by switching to QElapsedTimer

The following functions have deprecation warnings: QTime::start(), QTime::restart(), QTime::elapsed() and recommend that QElapsedTimer be used instead of QTime.
_clock.isNull() had to be changed to !_clock.isValid() since QElapsedTimer does not have isNull().
QTime::isNull() is also invalid, so behavior shouldn't change.

Reviewers: #breeze, #plasma, hpereiradacosta

Reviewed By: hpereiradacosta

Subscribers: hpereiradacosta, plasma-devel

Tags: #plasma

Differential Revision:
parent 8a6f6851
......@@ -30,7 +30,7 @@
#include "breezetransitionwidget.h"
#include <QObject>
#include <QTime>
#include <QElapsedTimer>
#include <QWidget>
namespace Breeze
......@@ -76,13 +76,13 @@ namespace Breeze
//* start clock
void startClock()
if( _clock.isNull() ) _clock.start();
if( !_clock.isValid() ) _clock.start();
else _clock.restart();
//* check if rendering is two slow
bool slow() const
{ return !( _clock.isNull() || _clock.elapsed() <= maxRenderTime() ); }
{ return !( !_clock.isValid() || _clock.elapsed() <= maxRenderTime() ); }
protected Q_SLOTS:
......@@ -118,7 +118,7 @@ namespace Breeze
bool _recursiveCheck = false;
//* timer used to detect slow rendering
QTime _clock;
QElapsedTimer _clock;
//* max render time
/*! used to detect slow rendering */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment