diff --git a/dataengines/executable/executable.cpp b/dataengines/executable/executable.cpp index 0fb2f2be6..395de15ba 100644 --- a/dataengines/executable/executable.cpp +++ b/dataengines/executable/executable.cpp @@ -44,7 +44,7 @@ void ExecutableContainer::exec() if (m_process->state() == QProcess::NotRunning) { m_process->start(); } else { - qDebug() << "Process" << objectName() << "already running. Pid:" << m_process->pid(); + qDebug() << "Process" << objectName() << "already running. Pid:" << m_process->processId(); } } diff --git a/kcms/cursortheme/kcmcursortheme.cpp b/kcms/cursortheme/kcmcursortheme.cpp index 735c51ea9..66a88dbdb 100644 --- a/kcms/cursortheme/kcmcursortheme.cpp +++ b/kcms/cursortheme/kcmcursortheme.cpp @@ -56,8 +56,8 @@ CursorThemeConfig::CursorThemeConfig(QObject *parent, const QVariantList &args) m_preferredSize = cursorThemeSettings()->cursorSize(); connect(cursorThemeSettings(), &CursorThemeSettings::cursorThemeChanged, this, &CursorThemeConfig::updateSizeComboBox); qmlRegisterType("org.kde.private.kcm_cursortheme", 1, 0, "PreviewWidget"); - qmlRegisterType(); - qmlRegisterType(); + qmlRegisterAnonymousType("SortProxyModel",1); + qmlRegisterAnonymousType("CursorThemeSettings",1); KAboutData *aboutData = new KAboutData(QStringLiteral("kcm_cursortheme"), i18n("Cursors"), QStringLiteral("1.0"), diff --git a/kcms/cursortheme/plasma-apply-cursortheme.cpp b/kcms/cursortheme/plasma-apply-cursortheme.cpp index ee53a6870..aa3c13e6e 100644 --- a/kcms/cursortheme/plasma-apply-cursortheme.cpp +++ b/kcms/cursortheme/plasma-apply-cursortheme.cpp @@ -59,7 +59,7 @@ int main(int argc, char **argv) } if (settings->cursorTheme() == requestedTheme) { - ts << i18n("The requested theme \"%1\" is already set as the theme for the current Plasma session.", requestedTheme) << endl; + ts << i18n("The requested theme \"%1\" is already set as the theme for the current Plasma session.", requestedTheme) << Qt::endl; // This is not an error condition, no reason to set an error code } else { auto results = model->findIndex(requestedTheme); @@ -70,9 +70,9 @@ int main(int argc, char **argv) settings->setCursorTheme(theme->name()); if (settings->save() && applyTheme(theme, theme->defaultCursorSize())) { notifyKcmChange(GlobalChangeType::CursorChanged); - ts << i18n("Successfully applied the mouse cursor theme %1 to your current Plasma session", theme->title()) << endl; + ts << i18n("Successfully applied the mouse cursor theme %1 to your current Plasma session", theme->title()) << Qt::endl; } else { - ts << i18n("You have to restart the Plasma session for your newly applied mouse cursor theme to display correctly.") << endl; + ts << i18n("You have to restart the Plasma session for your newly applied mouse cursor theme to display correctly.") << Qt::endl; // A bit of an odd one, more a warning than an error, but this means we can forward it errorCode = -1; } @@ -85,18 +85,18 @@ int main(int argc, char **argv) ts << i18n("Could not find theme \"%1\". The theme should be one of the following options: %2", requestedTheme, availableThemes.join(QLatin1String{", "})) - << endl; + << Qt::endl; errorCode = -1; } } } else if (parser->isSet(QStringLiteral("list-themes"))) { - ts << i18n("You have the following mouse cursor themes on your system:") << endl; + ts << i18n("You have the following mouse cursor themes on your system:") << Qt::endl; for (int i = 0; i < model->rowCount(); ++i) { const CursorTheme *theme = model->theme(model->index(i, 0)); if (settings->cursorTheme() == theme->name()) { - ts << QString(" * %1 (%2 - current theme for this Plasma session)").arg(theme->title()).arg(theme->name()) << endl; + ts << QString(" * %1 (%2 - current theme for this Plasma session)").arg(theme->title()).arg(theme->name()) << Qt::endl; } else { - ts << QString(" * %1 (%2)").arg(theme->title()).arg(theme->name()) << endl; + ts << QString(" * %1 (%2)").arg(theme->title()).arg(theme->name()) << Qt::endl; } } } else { diff --git a/kcms/fonts/fonts.cpp b/kcms/fonts/fonts.cpp index ffeacd9d6..ce6eb9459 100644 --- a/kcms/fonts/fonts.cpp +++ b/kcms/fonts/fonts.cpp @@ -56,9 +56,9 @@ KFonts::KFonts(QObject *parent, const QVariantList &args) KAboutData *about = new KAboutData("kcm_fonts", i18n("Fonts"), "0.1", QString(), KAboutLicense::LGPL); about->addAuthor(i18n("Antonis Tsiapaliokas"), QString(), "antonis.tsiapaliokas@kde.org"); setAboutData(about); - qmlRegisterType(); - qmlRegisterType(); - qmlRegisterType(); + qmlRegisterAnonymousType("QStandardItemModel",1); + qmlRegisterAnonymousType("FontsSettings",1); + qmlRegisterAnonymousType("FontsAASettings",1); setButtons(Apply | Default | Help); diff --git a/kcms/kfontinst/kcmfontinst/DuplicatesDialog.cpp b/kcms/kfontinst/kcmfontinst/DuplicatesDialog.cpp index 4b7eaa637..1ee3da9eb 100644 --- a/kcms/kfontinst/kcmfontinst/DuplicatesDialog.cpp +++ b/kcms/kfontinst/kcmfontinst/DuplicatesDialog.cpp @@ -126,7 +126,7 @@ void CDuplicatesDialog::scanFinished() details.append(*fit); details.append(""); details.append(KFormat().formatByteSize(info.size())); - details.append(QLocale().toString(info.created())); + details.append(QLocale().toString(info.birthTime())); if (info.isSymLink()) { details.append(info.symLinkTarget()); } diff --git a/kcms/kfontinst/kcmfontinst/FontList.cpp b/kcms/kfontinst/kcmfontinst/FontList.cpp index 10fdf37c4..7522be1f6 100644 --- a/kcms/kfontinst/kcmfontinst/FontList.cpp +++ b/kcms/kfontinst/kcmfontinst/FontList.cpp @@ -1337,7 +1337,7 @@ void CFontListView::getFonts(CJobRunner::ItemList &urls, QStringList &fontNames, CFamilyItem *fam = static_cast(realIndex.internalPointer()); for (int ch = 0; ch < fam->fontCount(); ++ch) { - QModelIndex child(itsProxy->mapToSource(index.child(ch, 0))); + QModelIndex child(itsProxy->mapToSource(index.model()->index(ch, 0, index))); if (child.isValid() && (static_cast(child.internalPointer()))->isFont()) { CFontItem *font = static_cast(child.internalPointer()); @@ -1804,7 +1804,7 @@ void CFontListView::startDrag(Qt::DropActions supportedActions) drag->setPixmap(pix); drag->setMimeData(data); drag->setHotSpot(hotspot); - drag->start(supportedActions); + drag->exec(supportedActions); } } diff --git a/kcms/notifications/kcm.cpp b/kcms/notifications/kcm.cpp index 8d4b0b6a9..0e5aec207 100644 --- a/kcms/notifications/kcm.cpp +++ b/kcms/notifications/kcm.cpp @@ -49,13 +49,13 @@ KCMNotifications::KCMNotifications(QObject *parent, const QVariantList &args) const char uri[] = "org.kde.private.kcms.notifications"; qmlRegisterUncreatableType(uri, 1, 0, "SourcesModel", QStringLiteral("Cannot create instances of SourcesModel")); - qmlRegisterType(); - qmlRegisterType(); - qmlRegisterType(); - qmlRegisterType(); - qmlRegisterType(); - qmlRegisterType(); - qmlRegisterType(); + qmlRegisterAnonymousType("FilterProxyModel",1); + qmlRegisterAnonymousType("QKeySequence",1); + qmlRegisterAnonymousType("DoNotDisturbSettings",1); + qmlRegisterAnonymousType("NotificationSettings",1); + qmlRegisterAnonymousType("JobSettings",1); + qmlRegisterAnonymousType("BadgeSettings",1); + qmlRegisterAnonymousType("BehaviorSettings",1); qmlProtectModule(uri, 1); KAboutData *about = new KAboutData(QStringLiteral("kcm_notifications"), i18n("Notifications"), QStringLiteral("5.0"), QString(), KAboutLicense::GPL); diff --git a/ksmserver/client.cpp b/ksmserver/client.cpp index 988b70119..ec2ed0bb1 100644 --- a/ksmserver/client.cpp +++ b/ksmserver/client.cpp @@ -24,7 +24,7 @@ #endif #include -#include +#include extern KSMServer *the_server; @@ -79,7 +79,7 @@ char *safeSmsGenerateClientID(SmsConn /*c*/) (1 would be IP, 2 would be DEC-NET format) */ char hostname[256]; if (gethostname(hostname, 255) != 0) - *my_addr = QStringLiteral("0%1").arg(KRandom::random(), 8, 16); + *my_addr = QStringLiteral("0%1").arg(QRandomGenerator::global()->generate(), 8, 16); else { // create some kind of hash for the hostname int addr[4] = {0, 0, 0, 0}; diff --git a/shell/containmentconfigview.cpp b/shell/containmentconfigview.cpp index 473d6eaa0..b3c9d920e 100644 --- a/shell/containmentconfigview.cpp +++ b/shell/containmentconfigview.cpp @@ -42,7 +42,7 @@ ContainmentConfigView::ContainmentConfigView(Plasma::Containment *cont, QWindow : ConfigView(cont, parent) , m_containment(cont) { - qmlRegisterType(); + qmlRegisterAnonymousType("QAbstractItemModel",1); rootContext()->setContextProperty(QStringLiteral("configDialog"), this); setCurrentWallpaper(cont->containment()->wallpaper()); diff --git a/wallpapers/image/imageplugin.cpp b/wallpapers/image/imageplugin.cpp index 2cfe4db8a..57731d22e 100644 --- a/wallpapers/image/imageplugin.cpp +++ b/wallpapers/image/imageplugin.cpp @@ -13,5 +13,5 @@ void ImagePlugin::registerTypes(const char *uri) Q_ASSERT(uri == QLatin1String("org.kde.plasma.wallpapers.image")); qmlRegisterType(uri, 2, 0, "Image"); - qmlRegisterType(); + qmlRegisterAnonymousType("QAbstractItemModel",1); } diff --git a/xembed-sni-proxy/snidbus.cpp b/xembed-sni-proxy/snidbus.cpp index d79aaad7f..12caec540 100644 --- a/xembed-sni-proxy/snidbus.cpp +++ b/xembed-sni-proxy/snidbus.cpp @@ -22,10 +22,10 @@ KDbusImageStruct::KDbusImageStruct(const QImage &image) width = image.size().width(); height = image.size().height(); if (image.format() == QImage::Format_ARGB32) { - data = QByteArray((char *)image.bits(), image.byteCount()); + data = QByteArray((char *)image.bits(), image.sizeInBytes()); } else { QImage image32 = image.convertToFormat(QImage::Format_ARGB32); - data = QByteArray((char *)image32.bits(), image32.byteCount()); + data = QByteArray((char *)image32.bits(), image32.sizeInBytes()); } // swap to network byte order if we are little endian