diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f35e82f7..96c7ce660 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,8 +140,7 @@ ecm_setup_qtplugin_macro_names( CONFIG_CODE_VARIABLE PACKAGE_SETUP_AUTOMOC_VARIABLES ) - -add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) +add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050c00) #add_definitions(-Wno-deprecated) diff --git a/autotests/dialognativetest.cpp b/autotests/dialognativetest.cpp index a8ee56e38..4ed88d15c 100644 --- a/autotests/dialognativetest.cpp +++ b/autotests/dialognativetest.cpp @@ -23,7 +23,7 @@ void DialogNativeTest::initTestCase() { - QStandardPaths::enableTestMode(true); + QStandardPaths::setTestModeEnabled(true); m_cacheDir = QDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); m_cacheDir.removeRecursively(); diff --git a/autotests/framesvgtest.cpp b/autotests/framesvgtest.cpp index e23c92103..715c91528 100644 --- a/autotests/framesvgtest.cpp +++ b/autotests/framesvgtest.cpp @@ -24,7 +24,7 @@ void FrameSvgTest::initTestCase() { - QStandardPaths::enableTestMode(true); + QStandardPaths::setTestModeEnabled(true); m_cacheDir = QDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); m_cacheDir.removeRecursively(); diff --git a/autotests/modeltest.cpp b/autotests/modeltest.cpp index 54500b78c..2dcc9c20a 100644 --- a/autotests/modeltest.cpp +++ b/autotests/modeltest.cpp @@ -457,12 +457,12 @@ void ModelTest::data() } // General Purpose roles that should return a QColor - QVariant colorVariant = model->data(model->index(0, 0), Qt::BackgroundColorRole); + QVariant colorVariant = model->data(model->index(0, 0), Qt::BackgroundRole); if (colorVariant.isValid()) { Q_ASSERT(qVariantCanConvert (colorVariant)); } - colorVariant = model->data(model->index(0, 0), Qt::TextColorRole); + colorVariant = model->data(model->index(0, 0), Qt::ForegroundRole); if (colorVariant.isValid()) { Q_ASSERT(qVariantCanConvert (colorVariant)); } diff --git a/autotests/plasmoidpackagetest.cpp b/autotests/plasmoidpackagetest.cpp index c000b4b59..30d49cf3f 100644 --- a/autotests/plasmoidpackagetest.cpp +++ b/autotests/plasmoidpackagetest.cpp @@ -33,7 +33,7 @@ void PlasmoidPackageTest::initTestCase() { - QStandardPaths::enableTestMode(true); + QStandardPaths::setTestModeEnabled(true); } void PlasmoidPackageTest::init() diff --git a/autotests/storagetest.cpp b/autotests/storagetest.cpp index bf3690557..142d186ec 100644 --- a/autotests/storagetest.cpp +++ b/autotests/storagetest.cpp @@ -24,7 +24,7 @@ void StorageTest::initTestCase() { - QStandardPaths::enableTestMode(true); + QStandardPaths::setTestModeEnabled(true); m_data.insert(QStringLiteral("String 1"), "Fork"); m_data.insert(QStringLiteral("String 2"), "Spoon"); diff --git a/src/declarativeimports/calendar/calendar.cpp b/src/declarativeimports/calendar/calendar.cpp index a600645f5..f652c6571 100644 --- a/src/declarativeimports/calendar/calendar.cpp +++ b/src/declarativeimports/calendar/calendar.cpp @@ -186,7 +186,7 @@ int Calendar::currentWeek() const QString Calendar::dayName(int weekday) const { - return QDate::shortDayName(weekday); + return QLocale::system().dayName(weekday, QLocale::ShortFormat); } QString Calendar::monthName() const diff --git a/src/declarativeimports/core/datamodel.cpp b/src/declarativeimports/core/datamodel.cpp index b0257d866..50dc6c5e9 100644 --- a/src/declarativeimports/core/datamodel.cpp +++ b/src/declarativeimports/core/datamodel.cpp @@ -58,11 +58,15 @@ void SortFilterModel::syncRoleNames() m_roleIds[QString::fromUtf8(i.value())] = i.key(); } - setRoleNames(sourceModel()->roleNames()); setFilterRole(m_filterRole); setSortRole(m_sortRole); } +QHash SortFilterModel::roleNames() const +{ + return sourceModel()->roleNames(); +} + int SortFilterModel::roleNameToId(const QString &name) const { return m_roleIds.value(name, Qt::DisplayRole); @@ -419,8 +423,6 @@ void DataModel::setItems(const QString &sourceName, const QVariantList &list) } } - setRoleNames(m_roleNames); - if (firstRun) { endResetModel(); } else if (delta > 0) { @@ -432,6 +434,11 @@ void DataModel::setItems(const QString &sourceName, const QVariantList &list) createIndex(sourceIndex + qMin(list.length(), oldLength), 0)); } +QHash DataModel::roleNames() const +{ + return m_roleNames; +} + void DataModel::removeSource(const QString &sourceName) { //FIXME: find a way to remove only the proper things also in the case where sources are items diff --git a/src/declarativeimports/core/datamodel.h b/src/declarativeimports/core/datamodel.h index ff61b4300..98df02c18 100644 --- a/src/declarativeimports/core/datamodel.h +++ b/src/declarativeimports/core/datamodel.h @@ -139,7 +139,8 @@ Q_SIGNALS: protected: int roleNameToId(const QString &name) const; - bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; + bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; + QHash roleNames() const override; protected Q_SLOTS: void syncRoleNames(); @@ -227,7 +228,7 @@ public: protected: void setItems(const QString &sourceName, const QVariantList &list); inline int countItems() const; - + QHash roleNames() const override; Q_SIGNALS: void countChanged(); void sourceModelChanged(QObject *); diff --git a/src/plasma/containment.cpp b/src/plasma/containment.cpp index 96acf4ba2..c8fdfb204 100644 --- a/src/plasma/containment.cpp +++ b/src/plasma/containment.cpp @@ -265,7 +265,7 @@ void Containment::restoreContents(KConfigGroup &group) //restore the applets ordered by id QStringList groups = applets.groupList(); - qSort(groups.begin(), groups.end()); + std::sort(groups.begin(), groups.end()); // Sort the applet configs in order of geometry to ensure that applets // are added from left to right or top to bottom for a panel containment @@ -275,7 +275,7 @@ void Containment::restoreContents(KConfigGroup &group) KConfigGroup appletConfig(&applets, appletGroup); appletConfigs.append(appletConfig); } - qStableSort(appletConfigs.begin(), appletConfigs.end(), appletConfigLessThan); + std::stable_sort(appletConfigs.begin(), appletConfigs.end(), appletConfigLessThan); QMutableListIterator it(appletConfigs); while (it.hasNext()) { diff --git a/src/plasma/corona.cpp b/src/plasma/corona.cpp index 870e160fe..fff3e7405 100644 --- a/src/plasma/corona.cpp +++ b/src/plasma/corona.cpp @@ -599,7 +599,7 @@ QList CoronaPrivate::importLayout(const KConfigGroup &con KConfigGroup containmentsGroup(&conf, "Containments"); QStringList groups = containmentsGroup.groupList(); - qSort(groups.begin(), groups.end()); + std::sort(groups.begin(), groups.end()); foreach (const QString &group, groups) { KConfigGroup containmentConfig(&containmentsGroup, group); diff --git a/src/plasma/private/storagethread.cpp b/src/plasma/private/storagethread.cpp index ffcd003f2..43bc91c10 100644 --- a/src/plasma/private/storagethread.cpp +++ b/src/plasma/private/storagethread.cpp @@ -320,12 +320,12 @@ void StorageThread::expire(QPointer wcaller, const QVariantMap ¶ if (valueGroup.isEmpty()) { query.prepare(QStringLiteral("delete from ") + caller->clientName() + QStringLiteral(" where accessTime < :date")); QDateTime time(QDateTime::currentDateTime().addSecs(-params[QStringLiteral("age")].toUInt())); - query.bindValue(QStringLiteral(":date"), time.toTime_t()); + query.bindValue(QStringLiteral(":date"), time.toSecsSinceEpoch()); } else { query.prepare(QStringLiteral("delete from ") + caller->clientName() + QStringLiteral(" where valueGroup=:valueGroup and accessTime < :date")); query.bindValue(QStringLiteral(":valueGroup"), valueGroup); QDateTime time(QDateTime::currentDateTime().addSecs(-params[QStringLiteral("age")].toUInt())); - query.bindValue(QStringLiteral(":date"), time.toTime_t()); + query.bindValue(QStringLiteral(":date"), time.toSecsSinceEpoch()); } const bool success = query.exec(); diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp index cfa21ba9a..b6b805048 100644 --- a/src/plasma/private/theme_p.cpp +++ b/src/plasma/private/theme_p.cpp @@ -244,8 +244,8 @@ bool ThemePrivate::useCache() const QFileInfo metadataFileInfo(themeMetadataPath); const QFileInfo iconThemeMetadataFileInfo(iconThemeMetadataPath); - cachesTooOld = (cacheFileInfo.lastModified().toTime_t() < metadataFileInfo.lastModified().toTime_t()) || - (cacheFileInfo.lastModified().toTime_t() < iconThemeMetadataFileInfo.lastModified().toTime_t()); + cachesTooOld = (cacheFileInfo.lastModified().toSecsSinceEpoch() < metadataFileInfo.lastModified().toSecsSinceEpoch()) || + (cacheFileInfo.lastModified().toSecsSinceEpoch() < iconThemeMetadataFileInfo.lastModified().toSecsSinceEpoch()); } } diff --git a/src/plasma/svg.cpp b/src/plasma/svg.cpp index 8df69d956..89a892265 100644 --- a/src/plasma/svg.cpp +++ b/src/plasma/svg.cpp @@ -268,7 +268,7 @@ bool SvgPrivate::setImagePath(const QString &imagePath) if (!themed) { QFile f(actualPath); QFileInfo info(f); - lastModified = info.lastModified().toTime_t(); + lastModified = info.lastModified().toSecsSinceEpoch(); } q->resize(); diff --git a/src/plasma/theme.cpp b/src/plasma/theme.cpp index 06949a6ba..b18e48ce2 100644 --- a/src/plasma/theme.cpp +++ b/src/plasma/theme.cpp @@ -294,7 +294,7 @@ bool Theme::useGlobalSettings() const bool Theme::findInCache(const QString &key, QPixmap &pix, unsigned int lastModified) { - if (lastModified != 0 && d->useCache() && lastModified > uint(d->pixmapCache->lastModifiedTime().toTime_t())) { + if (lastModified != 0 && d->useCache() && lastModified > uint(d->pixmapCache->lastModifiedTime().toSecsSinceEpoch())) { return false; } diff --git a/src/plasmaquick/dialogshadows.cpp b/src/plasmaquick/dialogshadows.cpp index 5dd88622a..581e200c6 100644 --- a/src/plasmaquick/dialogshadows.cpp +++ b/src/plasmaquick/dialogshadows.cpp @@ -255,7 +255,7 @@ Qt::HANDLE DialogShadows::Private::createPixmap(const QPixmap &source) _connection, XCB_IMAGE_FORMAT_Z_PIXMAP, pixmap, _gc, image.width(), image.height(), 0, 0, 0, 32, - image.byteCount(), image.constBits()); + image.sizeInBytes(), image.constBits()); return (Qt::HANDLE)pixmap; diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index 6f8f002c4..57c50a139 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -688,7 +688,10 @@ QVariantList AppletInterface::availableScreenRegion() const reg = applet()->containment()->corona()->availableScreenRegion(screenId); } - foreach (QRect rect, reg.rects()) { + auto it = reg.begin(); + const auto itEnd = reg.end(); + for (; it != itEnd; ++it) { + QRect rect = *it; //make it relative QRect geometry = applet()->containment()->corona()->screenGeometry(screenId); rect.moveTo(rect.topLeft() - geometry.topLeft()); diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index 24f6a702d..c0e6721cd 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -987,7 +987,7 @@ void ContainmentInterface::mousePressEvent(QMouseEvent *event) Plasma::Applet *applet = nullptr; foreach (QObject *appletObject, m_appletInterfaces) { if (AppletInterface *ai = qobject_cast(appletObject)) { - if (ai->isVisible() && ai->contains(ai->mapFromItem(this, event->posF()))) { + if (ai->isVisible() && ai->contains(ai->mapFromItem(this, event->localPos()))) { applet = ai->applet(); break; } else {