Remove KDE4Support dependency from plasma-frameworks (almost)
Stop using classes from kde4support: - KComponentData is deprecated, it will be using QCoreApplication:: applicationName() and QCoreApplication::applicationVersion(). Of course, this means that the existing shells will have to be ported. I have no problem with doing that port myself, if I'm told where to look into. - Drop usage of KLocale, ported to QLocale - Drop usage of KStandardDirs, ported to QStandardPaths - Drop usage of KIcon, ported to QIcon Furthermore, there's a module in src/declarativeimports/locale that IIUC exposes KLocale bindings to QML. A specific plan to port it should happen as well. REVIEW: 113920
This commit is contained in:
parent
082e6c65e5
commit
f187db1e86
@ -45,15 +45,7 @@ find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Quick X11Extras Sql UiTools Qml W
|
|||||||
find_package(KF5 CONFIG REQUIRED KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver
|
find_package(KF5 CONFIG REQUIRED KIdleTime ItemModels KWidgetsAddons KWindowSystem KCodecs KArchive KCoreAddons Solid ThreadWeaver
|
||||||
KConfig KAuth KJS KWallet KDBusAddons KI18n KGuiAddons KConfigWidgets
|
KConfig KAuth KJS KWallet KDBusAddons KI18n KGuiAddons KConfigWidgets
|
||||||
KService ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet KTextWidgets XmlGui KCrash
|
KService ItemViews KNotifications KIconThemes KCompletion KJobWidgets KConfigWidgets Sonnet KTextWidgets XmlGui KCrash
|
||||||
KBookmarks KDeclarative KUnitConversion Kross KParts)
|
KBookmarks KDeclarative KUnitConversion Kross KParts KIO KActivities)
|
||||||
|
|
||||||
# those are not "done" yet:
|
|
||||||
find_package(KIO REQUIRED NO_MODULE)
|
|
||||||
|
|
||||||
find_package(KDE4Support REQUIRED NO_MODULE)
|
|
||||||
|
|
||||||
#the shell needs kactivities
|
|
||||||
find_package(KActivities REQUIRED NO_MODULE)
|
|
||||||
|
|
||||||
#optional features
|
#optional features
|
||||||
find_package(X11 MODULE)
|
find_package(X11 MODULE)
|
||||||
|
@ -15,7 +15,6 @@ target_link_libraries(sortfiltermodeltest
|
|||||||
Plasma
|
Plasma
|
||||||
Qt5::Gui
|
Qt5::Gui
|
||||||
Qt5::Test
|
Qt5::Test
|
||||||
KF5::KDE4Support
|
|
||||||
KF5::KI18n
|
KF5::KI18n
|
||||||
Qt5::Qml
|
Qt5::Qml
|
||||||
)
|
)
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
using namespace Plasma;
|
using namespace Plasma;
|
||||||
|
|
||||||
QTEST_KDEMAIN(SortFilterModelTest, GUI)
|
QTEST_MAIN(SortFilterModelTest)
|
||||||
|
|
||||||
void SortFilterModelTest::setModel()
|
void SortFilterModelTest::setModel()
|
||||||
{
|
{
|
||||||
|
@ -1,18 +1,12 @@
|
|||||||
project(localebindings)
|
project(localebindings)
|
||||||
|
|
||||||
# include(KDE4Defaults)
|
|
||||||
#
|
|
||||||
set(localebindings_SRCS
|
set(localebindings_SRCS
|
||||||
locale.cpp
|
locale.cpp
|
||||||
localebindingsplugin.cpp
|
localebindingsplugin.cpp
|
||||||
calendarsystem.cpp
|
calendarsystem.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
# INCLUDE_DIRECTORIES(
|
find_package(KDE4Support REQUIRED)
|
||||||
# ${CMAKE_SOURCE_DIR}
|
|
||||||
# ${CMAKE_BINARY_DIR}
|
|
||||||
# ${KDE4_INCLUDES}
|
|
||||||
# )
|
|
||||||
|
|
||||||
add_library(localebindingsplugin SHARED ${localebindings_SRCS})
|
add_library(localebindingsplugin SHARED ${localebindings_SRCS})
|
||||||
target_link_libraries(localebindingsplugin
|
target_link_libraries(localebindingsplugin
|
||||||
|
@ -7,7 +7,6 @@ target_link_libraries(fullmodelaccesstest
|
|||||||
Qt5::Gui
|
Qt5::Gui
|
||||||
Qt5::Test
|
Qt5::Test
|
||||||
KF5::KCoreAddons
|
KF5::KCoreAddons
|
||||||
KF5::KDE4Support
|
|
||||||
KF5::KI18n
|
KF5::KI18n
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -135,7 +135,6 @@ target_link_libraries(Plasma
|
|||||||
KF5::KDeclarative
|
KF5::KDeclarative
|
||||||
KF5::XmlGui
|
KF5::XmlGui
|
||||||
KF5::KConfigWidgets
|
KF5::KConfigWidgets
|
||||||
KF5::KDE4Support
|
|
||||||
${PLASMA_EXTRA_LIBS}
|
${PLASMA_EXTRA_LIBS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ void DataEngineManager::timerEvent(QTimerEvent *)
|
|||||||
QTextStream out(&f);
|
QTextStream out(&f);
|
||||||
|
|
||||||
QHashIterator<QString, DataEngine*> it(d->engines);
|
QHashIterator<QString, DataEngine*> it(d->engines);
|
||||||
out << "================================== " << KLocale::global()->formatDateTime(QDateTime::currentDateTime()) << endl;
|
out << "================================== " << QLocale().toString(QDateTime::currentDateTime()) << endl;
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
DataEngine *engine = it.value();
|
DataEngine *engine = it.value();
|
||||||
|
@ -67,7 +67,6 @@ target_link_libraries(plasma-shell
|
|||||||
Plasma
|
Plasma
|
||||||
PlasmaQuick
|
PlasmaQuick
|
||||||
Qt5::Script
|
Qt5::Script
|
||||||
KF5::KDE4Support
|
|
||||||
KF5::Solid
|
KF5::Solid
|
||||||
KF5::KDeclarative
|
KF5::KDeclarative
|
||||||
KF5::KI18n
|
KF5::KI18n
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <kactioncollection.h>
|
#include <kactioncollection.h>
|
||||||
#include <kconfig.h>
|
#include <kconfig.h>
|
||||||
#include <kicon.h>
|
|
||||||
#include <kstandarddirs.h>
|
#include <kstandarddirs.h>
|
||||||
#include <kwindowsystem.h>
|
#include <kwindowsystem.h>
|
||||||
|
|
||||||
@ -103,7 +102,7 @@ QString Activity::name()
|
|||||||
QPixmap Activity::pixmap(const QSize &size)
|
QPixmap Activity::pixmap(const QSize &size)
|
||||||
{
|
{
|
||||||
if (m_info->isValid() && !m_info->icon().isEmpty()) {
|
if (m_info->isValid() && !m_info->icon().isEmpty()) {
|
||||||
return KIcon(m_info->icon()).pixmap(size);
|
return QIcon::fromTheme(m_info->icon()).pixmap(size);
|
||||||
} else {
|
} else {
|
||||||
return KIdenticonGenerator::self()->generatePixmap(size.width(), m_id);
|
return KIdenticonGenerator::self()->generatePixmap(size.width(), m_id);
|
||||||
}
|
}
|
||||||
@ -145,7 +144,7 @@ void Activity::removed()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const QString name = "activities/" + m_id;
|
const QString name = "activities/" + m_id;
|
||||||
QFile::remove(KStandardDirs::locateLocal("appdata", name));
|
QFile::remove(QStandardPaths::writableLocation(QStandardPaths::DataLocation)+QChar('/')+name);
|
||||||
}
|
}
|
||||||
|
|
||||||
Plasma::Containment* Activity::containmentForScreen(int screen)
|
Plasma::Containment* Activity::containmentForScreen(int screen)
|
||||||
|
@ -98,7 +98,7 @@ QList<int> AppInterface::panelIds() const
|
|||||||
|
|
||||||
QString AppInterface::applicationVersion() const
|
QString AppInterface::applicationVersion() const
|
||||||
{
|
{
|
||||||
return KComponentData::mainComponent().aboutData()->version();
|
return qApp->applicationVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AppInterface::platformVersion() const
|
QString AppInterface::platformVersion() const
|
||||||
|
@ -264,7 +264,7 @@ QScriptValue ScriptEngine::loadTemplate(QScriptContext *context, QScriptEngine *
|
|||||||
}
|
}
|
||||||
|
|
||||||
const QString constraint = QString("[X-Plasma-Shell] == '%1' and [X-KDE-PluginInfo-Name] == '%2'")
|
const QString constraint = QString("[X-Plasma-Shell] == '%1' and [X-KDE-PluginInfo-Name] == '%2'")
|
||||||
.arg(KComponentData::mainComponent().componentName(),layout);
|
.arg(qApp->applicationName(),layout);
|
||||||
KService::List offers = KServiceTypeTrader::self()->query("Plasma/LayoutTemplate", constraint);
|
KService::List offers = KServiceTypeTrader::self()->query("Plasma/LayoutTemplate", constraint);
|
||||||
|
|
||||||
if (offers.isEmpty()) {
|
if (offers.isEmpty()) {
|
||||||
|
@ -596,7 +596,7 @@ void ShellCorona::checkAddPanelAction(const QStringList &sycocaChanges)
|
|||||||
|
|
||||||
KPluginInfo::List panelContainmentPlugins = Plasma::PluginLoader::listContainmentsOfType("Panel");
|
KPluginInfo::List panelContainmentPlugins = Plasma::PluginLoader::listContainmentsOfType("Panel");
|
||||||
const QString constraint = QString("[X-Plasma-Shell] == '%1' and 'panel' ~in [X-Plasma-ContainmentCategories]")
|
const QString constraint = QString("[X-Plasma-Shell] == '%1' and 'panel' ~in [X-Plasma-ContainmentCategories]")
|
||||||
.arg(KComponentData::mainComponent().componentName());
|
.arg(qApp->applicationName());
|
||||||
KService::List templates = KServiceTypeTrader::self()->query("Plasma/LayoutTemplate", constraint);
|
KService::List templates = KServiceTypeTrader::self()->query("Plasma/LayoutTemplate", constraint);
|
||||||
|
|
||||||
if (panelContainmentPlugins.count() + templates.count() == 1) {
|
if (panelContainmentPlugins.count() + templates.count() == 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user