Commit 5962e4d8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

The real fix is to change #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) to

to #if QTWEBENGINEWIDGETS_VERSION < QT_VERSION_CHECK(5, 13, 0)

This problem is that freesbd doesn't build qtwebengine 5.13 with qt 5.13
but it uses directly qt5.12.

Revert "Revert "Port some deprecated methods""

This reverts commit 601cf0ec.
parent 601cf0ec
......@@ -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.5.0")
set(QT_MIN_VERSION "5.11.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.sprintf( "%.2d", i );
num = QString::asprintf( "%.2d", i );
mDict.insert( QLatin1String( "int" ) + num, ki18n( "Int %1" ).subs( i - 1, 3 ).toString() );
num.sprintf( "%.3d", i + 255);
num = QString::asprintf( "%.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;
QTime timeKillWasSent;
QElapsedTimer timeKillWasSent;
int index;
Process::Changes changes;
int elapsedTimeMilliSeconds;
......@@ -483,7 +483,7 @@ QList< Process* > & Process::children() const
return d->children;
}
QTime Process::timeKillWasSent() const
QElapsedTimer Process::timeKillWasSent() const
{
return d->timeKillWasSent;
}
......
......@@ -24,6 +24,7 @@
#include <QList>
#include <QTime>
#include <QElapsedTimer>
#include <QFlags>
namespace KSysGuard
......@@ -205,7 +206,7 @@ public:
bool& hasManagedGuiWindow() const; // REF, make non-ref later!
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.
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.
QString translatedStatus() const; ///< Returns a translated string of the status. e.g. "Running" etc
......
......@@ -30,6 +30,7 @@
#include <QSet>
#include <QMutableSetIterator>
#include <QByteArray>
#include <QElapsedTimer>
//for sysconf
#include <unistd.h>
......@@ -70,7 +71,7 @@ namespace KSysGuard
ProcessesATop *mHistoricProcesses; ///< A way to get historic information about processes
bool mIsLocalHost; ///< Whether this is localhost or not
QTime mLastUpdated; ///< This is the time we last updated. Used to calculate cpu usage.
QElapsedTimer 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 = qUpperBound(d->historyTimes.begin(), d->historyTimes.end(), tmpWhen);
QList< QPair<QDateTime,uint> >::iterator i = std::upper_bound(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;
filterChanged();//Tell the proxy view to refresh all its information
invalidateFilter();//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().isNull()) {
if (process->timeKillWasSent().isValid()) {
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().isNull()) {
if (process->timeKillWasSent().isValid()) {
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().isNull() && process->timeKillWasSent().elapsed() < MILLISECONDS_TO_SHOW_RED_FOR_KILLED_PROCESS) {
if (process && process->timeKillWasSent().isValid() && 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().isNull())
if (numProcesses == 1 && process->timeKillWasSent().isValid())
d->mProcessContextMenu->addAction(d->kill);
}
......
......@@ -87,7 +87,11 @@ 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
......@@ -219,7 +223,7 @@ new QWebChannel(window.qt.webChannelTransport, function(channel) {
"body { background: %1; color: %2; }" \
"a { color: %3; }" \
"a:visited { color: %4; } "
).arg(palette().background().color().name(),
).arg(palette().window().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