[plasma-framework] port away from deprecated KF5 APIs
Summary: KDeclarative::setupBindings() is deprecated, replaced calls with its implementation (setupContext + static setupEngine call), but see comment about whether we can be sure this is done only once per engine, as requested by the setupEngine API. It's 100% equivalent to the old code though, can't be worse. KPackage::contentsHash is deprecated, replaced call with implementation. Depends on D25433 for the KActionCollection::changed signal. Test Plan: Builds Reviewers: mart, davidedmundson, broulik, apol Reviewed By: apol Subscribers: apol, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D25434
This commit is contained in:
parent
29f2171813
commit
00ddc6c1f0
@ -142,6 +142,7 @@ ecm_setup_qtplugin_macro_names(
|
||||
PACKAGE_SETUP_AUTOMOC_VARIABLES
|
||||
)
|
||||
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050d00)
|
||||
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054000)
|
||||
|
||||
#add_definitions(-Wno-deprecated)
|
||||
|
||||
|
@ -64,7 +64,8 @@ void CoreBindingsPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
|
||||
if (!engine->rootContext()->contextObject()) {
|
||||
KDeclarative::KDeclarative kdeclarative;
|
||||
kdeclarative.setDeclarativeEngine(engine);
|
||||
kdeclarative.setupBindings();
|
||||
kdeclarative.setupContext();
|
||||
KDeclarative::KDeclarative::setupEngine(engine);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -224,7 +224,7 @@ void Package::setContentsPrefixPaths(const QStringList &prefixPaths)
|
||||
|
||||
QString Package::contentsHash() const
|
||||
{
|
||||
return d->internalPackage->contentsHash();
|
||||
return QString::fromLocal8Bit(d->internalPackage->cryptographicHash(QCryptographicHash::Sha1));
|
||||
}
|
||||
|
||||
void Package::addDirectoryDefinition(const char *key, const QString &path, const QString &name)
|
||||
|
@ -101,7 +101,8 @@ void ConfigViewPrivate::init()
|
||||
} else {
|
||||
kdeclarative.setTranslationDomain(QStringLiteral("plasma_applet_") + applet.data()->pluginMetaData().pluginId());
|
||||
}
|
||||
kdeclarative.setupBindings();
|
||||
kdeclarative.setupContext();
|
||||
KDeclarative::KDeclarative::setupEngine(q->engine()); // ### how to make sure to do this only once per engine?
|
||||
|
||||
//FIXME: problem on nvidia, all windows should be transparent or won't show
|
||||
q->setColor(Qt::transparent);
|
||||
|
@ -198,7 +198,8 @@ View::View(Plasma::Corona *corona, QWindow *parent)
|
||||
kdeclarative.setDeclarativeEngine(engine());
|
||||
//binds things like kconfig and icons
|
||||
kdeclarative.setTranslationDomain(QStringLiteral("plasma_shell_") + pkg.metadata().pluginId());
|
||||
kdeclarative.setupBindings();
|
||||
kdeclarative.setupContext();
|
||||
KDeclarative::KDeclarative::setupEngine(engine()); // ### how to make sure to do this only once per engine?
|
||||
} else {
|
||||
qWarning() << "Invalid home screen package";
|
||||
}
|
||||
|
@ -166,9 +166,7 @@ void ContainmentInterface::init()
|
||||
connect(m_containment.data(), &Plasma::Containment::containmentTypeChanged,
|
||||
this, &ContainmentInterface::containmentTypeChanged);
|
||||
|
||||
connect(m_containment.data()->actions(), &KActionCollection::inserted,
|
||||
this, &ContainmentInterface::actionsChanged);
|
||||
connect(m_containment.data()->actions(), &KActionCollection::removed,
|
||||
connect(m_containment.data()->actions(), &KActionCollection::changed,
|
||||
this, &ContainmentInterface::actionsChanged);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user