Commit 601cf0ec authored by Ben Cooksley's avatar Ben Cooksley
Browse files

Revert "Port some deprecated methods"

This breaks the build on FreeBSD, whose QtWebEngine comes from Qt 5.12 (while the rest of Qt is 5.13).

This reverts commit 0eddf065.
parent 336e1517
......@@ -5,7 +5,7 @@ set(PROJECT_VERSION "5.17.80")
set(PROJECT_VERSION_MAJOR 5)
# check with non-Plasma consumers (e.g. KDevelop) before bumping these versions
set(QT_MIN_VERSION "5.11.0")
set(QT_MIN_VERSION "5.5.0")
set(KF5_MIN_VERSION "5.62.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
......
......@@ -209,9 +209,9 @@ void SensorManager::retranslate()
QString num;
for ( int i = 1; i < 25; i++ ) {
num = QString::asprintf( "%.2d", i );
num.sprintf( "%.2d", i );
mDict.insert( QLatin1String( "int" ) + num, ki18n( "Int %1" ).subs( i - 1, 3 ).toString() );
num = QString::asprintf( "%.3d", i + 255);
num.sprintf( "%.3d", i + 255);
mDict.insert( QLatin1String( "int" ) + num, ki18n( "Int %1" ).subs( i + 255, 4 ).toString() );
}
......
......@@ -80,7 +80,7 @@ public:
long ioCharactersActuallyWrittenRate;
int numThreads;
QList<Process *> children;
QElapsedTimer timeKillWasSent;
QTime timeKillWasSent;
int index;
Process::Changes changes;
int elapsedTimeMilliSeconds;
......@@ -483,7 +483,7 @@ QList< Process* > & Process::children() const
return d->children;
}
QElapsedTimer Process::timeKillWasSent() const
QTime Process::timeKillWasSent() const
{
return d->timeKillWasSent;
}
......
......@@ -24,7 +24,6 @@
#include <QList>
#include <QTime>
#include <QElapsedTimer>
#include <QFlags>
namespace KSysGuard
......@@ -206,7 +205,7 @@ public:
bool& hasManagedGuiWindow() const; // REF, make non-ref later!
QElapsedTimer timeKillWasSent() const; ///< This is usually a NULL time. When trying to kill a process, this is the time that the kill signal was sent to the process.
QTime timeKillWasSent() const; ///< This is usually a NULL time. When trying to kill a process, this is the time that the kill signal was sent to the process.
QString translatedStatus() const; ///< Returns a translated string of the status. e.g. "Running" etc
......
......@@ -30,7 +30,6 @@
#include <QSet>
#include <QMutableSetIterator>
#include <QByteArray>
#include <QElapsedTimer>
//for sysconf
#include <unistd.h>
......@@ -71,7 +70,7 @@ namespace KSysGuard
ProcessesATop *mHistoricProcesses; ///< A way to get historic information about processes
bool mIsLocalHost; ///< Whether this is localhost or not
QElapsedTimer mLastUpdated; ///< This is the time we last updated. Used to calculate cpu usage.
QTime mLastUpdated; ///< This is the time we last updated. Used to calculate cpu usage.
long mElapsedTimeMilliSeconds; ///< The number of milliseconds (1000ths of a second) that passed since the last update
Processes::UpdateFlags mUpdateFlags;
......
......@@ -303,7 +303,7 @@ QDateTime ProcessesATop::viewingTime() const
bool ProcessesATop::setViewingTime(const QDateTime &when)
{
QPair<QDateTime, uint> tmpWhen(when, 0);
QList< QPair<QDateTime,uint> >::iterator i = std::upper_bound(d->historyTimes.begin(), d->historyTimes.end(), tmpWhen);
QList< QPair<QDateTime,uint> >::iterator i = qUpperBound(d->historyTimes.begin(), d->historyTimes.end(), tmpWhen);
if(i->first == when || (i->first > when && i->first.addSecs(-i->second) <= when)) {
//We found the time :)
......
......@@ -150,6 +150,6 @@ bool ProcessFilter::lessThan(const QModelIndex &left, const QModelIndex &right)
void ProcessFilter::setFilter(State filter) {
mFilter = filter;
invalidateFilter();//Tell the proxy view to refresh all its information
filterChanged();//Tell the proxy view to refresh all its information
}
......@@ -741,7 +741,7 @@ void ProcessModelPrivate::processChanged(KSysGuard::Process *process, bool onlyT
else
row = process->parent()->children().indexOf(process);
if (process->timeKillWasSent().isValid()) {
if (!process->timeKillWasSent().isNull()) {
int elapsed = process->timeKillWasSent().elapsed();
if (elapsed < MILLISECONDS_TO_SHOW_RED_FOR_KILLED_PROCESS) {
if (!mPidsToUpdate.contains(process->pid()))
......@@ -2004,7 +2004,7 @@ QVariant ProcessModel::data(const QModelIndex &index, int role) const
if (!d->mHaveTimer) //If there is no timer, then no processes are being killed, so no point looking for one
return QVariant();
KSysGuard::Process *process = reinterpret_cast< KSysGuard::Process * > (index.internalPointer());
if (process->timeKillWasSent().isValid()) {
if (!process->timeKillWasSent().isNull()) {
int elapsed = process->timeKillWasSent().elapsed();
if (elapsed < MILLISECONDS_TO_SHOW_RED_FOR_KILLED_PROCESS) {//Only show red for about 7 seconds
int transparency = 255 - elapsed*250/MILLISECONDS_TO_SHOW_RED_FOR_KILLED_PROCESS;
......@@ -2346,7 +2346,7 @@ void ProcessModelPrivate::timerEvent( QTimerEvent * event )
Q_UNUSED(event);
foreach (qlonglong pid, mPidsToUpdate) {
KSysGuard::Process *process = mProcesses->getProcess(pid);
if (process && process->timeKillWasSent().isValid() && process->timeKillWasSent().elapsed() < MILLISECONDS_TO_SHOW_RED_FOR_KILLED_PROCESS) {
if (process && !process->timeKillWasSent().isNull() && process->timeKillWasSent().elapsed() < MILLISECONDS_TO_SHOW_RED_FOR_KILLED_PROCESS) {
int row;
if(mSimple)
row = process->index();
......
......@@ -629,7 +629,7 @@ void KSysGuardProcessList::showProcessContextMenu(const QPoint &point) {
if (showSignalingEntries) {
d->mProcessContextMenu->addSeparator();
d->mProcessContextMenu->addAction(d->terminate);
if (numProcesses == 1 && process->timeKillWasSent().isValid())
if (numProcesses == 1 && !process->timeKillWasSent().isNull())
d->mProcessContextMenu->addAction(d->kill);
}
......
......@@ -87,11 +87,7 @@ class ScriptingHtmlDialog : public QDialog {
setLayout(layout);
layout->setContentsMargins(0,0,0,0);
m_webView.settings()->setAttribute(QWebEngineSettings::PluginsEnabled, false);
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
m_webView.page()->profile()->setRequestInterceptor(new RemoteUrlInterceptor(this));
#else
m_webView.page()->profile()->setUrlRequestInterceptor(new RemoteUrlInterceptor(this));
#endif
#endif
}
#if HAVE_QTWEBENGINEWIDGETS
......@@ -223,7 +219,7 @@ new QWebChannel(window.qt.webChannelTransport, function(channel) {
"body { background: %1; color: %2; }" \
"a { color: %3; }" \
"a:visited { color: %4; } "
).arg(palette().window().color().name(),
).arg(palette().background().color().name(),
palette().text().color().name(),
palette().link().color().name(),
palette().linkVisited().color().name());
......
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