Commit 49f003f2 authored by Jenkins's avatar Jenkins

New upstream version 0.0.1+git20181111

parent 31cfa333
project(plasma-settings)
cmake_minimum_required(VERSION 2.8.12)
################# Disallow in-source build #################
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "plasma-settings requires an out of source build. Please create a separate build directory and run 'cmake path_to_plasma-settings [options]' there.")
endif()
include(CPack)
include(FeatureSummary)
find_package(PkgConfig)
################# set KDE specific information #################
find_package(ECM 0.0.8 REQUIRED NO_MODULE)
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(ECMQMLModules)
find_package(Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui)
################# now find all used packages #################
set (QT_MIN_VERSION "5.4.0")
find_package(KF5 REQUIRED COMPONENTS
WindowSystem
CoreAddons
Solid
Config
Auth
DBusAddons
I18n
Plasma
PlasmaQuick
Declarative
KIO
KDELibs4Support
)
find_package(KAccounts)
find_package(AccountsQt5 1.10 CONFIG)
find_package(SignOnQt5 8.55 CONFIG)
ecm_find_qmlmodule(org.kde.kcm 1.0)
if (KAccounts_FOUND AND AccountsQt5_FOUND AND SignOnQt5_FOUND)
include_directories(${ACCOUNTSQT_INCLUDE_DIRS} ${SIGNONQT_INCLUDE_DIRS})
endif()
add_subdirectory(src)
add_subdirectory(import)
add_subdirectory(modules)
install(DIRECTORY package/ DESTINATION ${KDE_INSTALL_DATAROOTDIR}/kpackage/genericqml/org.kde.plasma.settings)
install(FILES org.kde.mobile.plasmasettings.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
This diff is collapsed.
This diff is collapsed.
You can find documentation for using the Active Settings infrastructure at
http://techbase.kde.org/Development/Tutorials/Plasma/QML/ActiveSettings
include: 'https://gitlab.com/debian-pm/tools/build/raw/master/docker/gitlab-ci-base.yml'
image: jbbgameich/build
plasma-settings (0.0.1+git20181111-1) UNRELEASED; urgency=medium
* New Snapshot
* libkgapi-dev -> libkpimgapi-dev
* Add dep to qml-module-org-kde-kirigami2
-- Jonah Brüchert <jbb@kaidan.im> Sun, 11 Nov 2018 12:09:33 +0100
plasma-settings (0.0.1-0ubuntu5) vivid; urgency=medium
* add dep to qml-module-ubuntu-onlineaccounts
-- Bhushan Shah <bshah@kde.org> Tue, 12 Jan 2016 18:29:38 +0530
plasma-settings (0.0.1-0ubuntu4) vivid; urgency=medium
* add deps
-- Boudewijn Rempt <boud@kde.org> Fri, 05 Jun 2015 08:03:51 +0000
plasma-settings (0.0.1-0ubuntu3) vivid; urgency=medium
* add deps
-- Boudewijn Rempt <boud@kde.org> Fri, 05 Jun 2015 07:57:36 +0000
plasma-settings (0.0.1-0ubuntu2) vivid; urgency=medium
* fix dependency
-- Boudewijn Rempt <boud@kde.org> Fri, 05 Jun 2015 07:48:43 +0000
plasma-settings (0.0.1-0ubuntu1) vivid; urgency=medium
* Add ecm as dependency
-- Boudewijn Rempt <boud@kde.org> Fri, 05 Jun 2015 07:37:38 +0000
plasma-settings (0.0.1-0ubuntu0) vivid; urgency=medium
* Initial release.
-- Boudewijn Rempt <boud@kde.org> Wed, 05 June 2015 09:50:41 +0000
Source: plasma-settings
Section: kde
Priority: optional
Maintainer: Debian/Kubuntu Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
XSBC-Original-Maintainer: Boudewijn Rempt <boud@kde.org>
Build-Depends: cmake (>= 3.0.0),
debhelper (>= 11),
extra-cmake-modules,
libaccounts-glib-dev,
libaccounts-qt5-dev,
libgettextpo-dev,
libkaccounts-dev,
libkf5archive-dev,
libkf5auth-dev,
libkf5bookmarks-dev,
libkf5codecs-dev,
libkf5completion-dev,
libkf5config-dev,
libkf5contacts-dev,
libkf5coreaddons-dev,
libkf5dbusaddons-dev,
libkf5declarative-dev,
libkf5i18n-dev,
libkf5iconthemes-dev,
libkf5kdelibs4support-dev,
libkf5notifications-dev,
libkf5plasma-dev,
libkf5plasma5,
libkf5plasmaquick5,
libkf5service-dev,
libkf5solid-dev,
libkf5sonnet-dev,
libkf5windowsystem-dev,
libkpimgapi-dev,
libsignon-qt5-dev,
pkg-config,
pkg-kde-tools (>= 0.9),
qtbase5-dev,
qtbase5-private-dev
Standards-Version: 4.2.1
Homepage: https://projects.kde.org/projects/extragear/base/plasma-settings
Vcs-Browser: https://gitlab.com/debian-pm/plasma-mobile/plasma-settings
Vcs-Git: https://gitlab.com/debian-pm/plasma-mobile/plasma-settings.git
Package: plasma-settings
Architecture: any
Depends: kaccounts-integration,
kaccounts-providers,
plasma-framework,
qml-module-org-kde-kaccounts,
qml-module-org-kde-kcm,
qml-module-org-kde-kirigami2,
qml-module-ubuntu-onlineaccounts,
${misc:Depends},
${shlibs:Depends}
Description: Plasma phone settings application
The settings application and a few modules for it.
This diff is collapsed.
#!/usr/bin/make -f
include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk
project(settings)
set(settings_SRCS
package.cpp
settingsplugin.cpp
settingsmodule.cpp
settingsmodulesmodel.cpp
settingscomponent.cpp
configgroup.cpp
)
add_library(settingsplugin SHARED ${settings_SRCS})
target_link_libraries(settingsplugin
Qt5::Core
Qt5::Qml
Qt5::Quick
KF5::I18n
KF5::Package
KF5::QuickAddons
KF5::ConfigCore
)
install(TARGETS settingsplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/active/settings)
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/active/settings)
install(FILES SettingsItem.qml DESTINATION ${QML_INSTALL_DIR}/org/kde/active/settings)
You can find documentation for using the Active Settins infrastructure at
http://techbase.kde.org/Development/Tutorials/Plasma/QML/ActiveSettings
// -*- coding: iso-8859-1 -*-
/*
* Copyright 2011-2012 Sebastian Kügler <sebas@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.2
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
import org.kde.active.settings 2.0 as ActiveSettings
PlasmaComponents.PageStack {
id: moduleContainer
objectName: "moduleContainer"
property alias module: settingsComponent.module
property alias icon: settingsComponent.icon
signal moduleLoaded
function pushModule(module) {
switcherPackage.name = module
var mainscript = switcherPackage.filePath("mainscript");
//print("Loading mainscript: " + mainscript);
settingsLoader.source = mainscript;
moduleContainer.push(settingsLoader);
moduleContainer.module = module
}
clip: true
Loader {
id: settingsLoader
anchors.fill: parent
}
ActiveSettings.SettingsComponent {
id: settingsComponent
onModuleChanged: {
if (module == "") {
moduleContainer.pop();
} else if (switcherPackage.name != module) {
switcherPackage.name = module
//print(" Loading package: " + switcherPackage.filePath("mainscript") + " " + module);
var mainscript = switcherPackage.filePath("mainscript");
settingsLoader.source = switcherPackage.filePath("mainscript");
//moduleContainer.replace(switcherPackage.filePath("mainscript"));
print("Loaded mainscript: " + mainscript);
moduleLoaded();
}
}
}
ActiveSettings.Package {
id: switcherPackage
}
}
/*
* Copyright 2011-2012 by Sebastian Kügler <sebas@kde.org>
* Copyright 2013 by Aaron Seigo <aseigo@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "configgroup.h"
#include <QtCore/QTimer>
#include <KConfig>
#include <KConfigGroup>
#include <KSharedConfig>
#include <QDebug>
namespace Plasma
{
class ConfigGroupPrivate {
public:
ConfigGroupPrivate(ConfigGroup *q)
: q(q),
config(0),
configGroup(0)
{}
~ConfigGroupPrivate()
{
delete configGroup;
}
ConfigGroup* q;
KSharedConfigPtr config;
KConfigGroup *configGroup;
QString file;
QTimer *syncTimer;
QString group;
};
ConfigGroup::ConfigGroup(QQuickItem *parent)
: QQuickItem(parent),
d(new ConfigGroupPrivate(this))
{
// Delay and compress everything within 5 seconds into one sync
d->syncTimer = new QTimer(this);
d->syncTimer->setSingleShot(true);
d->syncTimer->setInterval(1500);
connect(d->syncTimer, &QTimer::timeout, this, &ConfigGroup::sync);
}
ConfigGroup::~ConfigGroup()
{
if (d->syncTimer->isActive()) {
qDebug() << "SYNC......";
d->syncTimer->stop();
d->configGroup->sync();
}
delete d;
}
KConfigGroup* ConfigGroup::configGroup()
{
return d->configGroup;
}
QString ConfigGroup::file() const
{
return d->file;
}
void ConfigGroup::setFile(const QString& filename)
{
if (d->file == filename) {
return;
}
d->file = filename;
readConfigFile();
emit fileChanged();
}
QString ConfigGroup::group() const
{
return d->group;
}
void ConfigGroup::setGroup(const QString& groupname)
{
if (d->group == groupname) {
return;
}
d->group = groupname;
qDebug() << "Set group name: " << groupname;
readConfigFile();
emit groupChanged();
emit keyListChanged();
}
QStringList ConfigGroup::keyList() const
{
if (!d->configGroup) {
return QStringList();
}
return d->configGroup->keyList();
}
QStringList ConfigGroup::groupList() const
{
return d->configGroup->groupList();
}
bool ConfigGroup::readConfigFile()
{
// Find parent ConfigGroup
ConfigGroup* parentGroup = 0;
QObject* current = parent();
while (current) {
parentGroup = qobject_cast<ConfigGroup*>(current);
if (parentGroup) {
break;
}
current = current->parent();
}
delete d->configGroup;
d->configGroup = 0;
if (parentGroup) {
d->configGroup = new KConfigGroup(parentGroup->configGroup(), d->group);
return true;
} else {
if (d->file.isEmpty()) {
//qWarning() << "Could not find KConfig Parent: specify a file or parent to another ConfigGroup";
return false;
}
d->config = KSharedConfig::openConfig(d->file);
d->configGroup = new KConfigGroup(d->config, d->group);
qDebug() << "Opened config" << d->configGroup->entryMap();
return true;
}
}
// Bound methods and slots
bool ConfigGroup::writeEntry(const QString& key, const QVariant& value)
{
if (!d->configGroup) {
return false;
}
d->configGroup->writeEntry(key, value);
d->syncTimer->start();
return true;
}
QVariant ConfigGroup::readEntry(const QString& key)
{
if (!d->configGroup) {
return QVariant();
}
const QVariant value = d->configGroup->readEntry(key, QVariant(""));
qDebug() << " reading setting: " << key << value;
return value;
}
void ConfigGroup::deleteEntry(const QString& key)
{
d->configGroup->deleteEntry(key);
d->syncTimer->start();
}
void ConfigGroup::sync()
{
if (d->configGroup) {
qDebug() << "synching config...";
d->configGroup->sync();
}
}
} // namespace Plasma
#include "configgroup.moc"
/*
* Copyright 2011-2012 by Sebastian Kügler <sebas@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CONFIGGROUP_H
#define CONFIGGROUP_H
#include <QObject>
#include <QQuickItem>
#include <QVariant>
class KConfigGroup;
namespace Plasma
{
class ConfigGroupPrivate;
class ConfigGroup : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(QString file READ file WRITE setFile NOTIFY fileChanged)
Q_PROPERTY(QString group READ group WRITE setGroup NOTIFY groupChanged)
Q_PROPERTY(QStringList keyList READ keyList NOTIFY keyListChanged)
Q_PROPERTY(QStringList groupList READ groupList NOTIFY groupListChanged)
public:
ConfigGroup(QQuickItem* parent=0);
~ConfigGroup();
KConfigGroup* configGroup();
QString file() const;
void setFile(const QString &filename);
QString group() const;
void setGroup(const QString &groupname);
QStringList keyList() const;
QStringList groupList() const;
Q_INVOKABLE QVariant readEntry(const QString &key);
Q_INVOKABLE bool writeEntry(const QString &key, const QVariant &value);
Q_INVOKABLE void deleteEntry(const QString& key);
Q_SIGNALS:
void fileChanged();
void groupChanged();
void keyListChanged();
void groupListChanged();
private:
ConfigGroupPrivate* d;
bool readConfigFile();
private Q_SLOTS:
void sync();
};
}
#endif
/***************************************************************************
* Copyright 2011 Marco Martin <mart@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Library General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#include "package.h"
#include <QStandardPaths>
#include <QDebug>
#include <KLocalizedString>
#include <KPackage/PackageLoader>
Package::Package(QObject *parent)
: QObject(parent)
{
}
Package::~Package()
{
}
QString Package::name() const
{
return m_name;
}
void Package::setName(const QString &name)
{
if (m_name == name) {
return;
}
m_name = name;
m_package = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("KPackage/GenericQML"));
m_package.setPath(name);
QString domain = QStringLiteral("plasma_package_") + name;
KLocalizedString::setApplicationDomain(domain.toLocal8Bit().data());
emit nameChanged(name);
emit visibleNameChanged();
}
QString Package::visibleName() const
{
if (!m_package.isValid()) {
return QString();
}
return m_package.metadata().name();
}
QString Package::filePath(const QString &fileType, const QString &fileName) const
{
if (!m_package.isValid()) {
return QString();
}
if (fileName.isEmpty()) {
return m_package.filePath(fileType.toLatin1());
} else {
return m_package.filePath(fileType.toLatin1(), fileName);
}
}
QString Package::filePath(const QString &fileType) const
{
if (!m_package.isValid()) {
return QString();
}
return m_package.filePath(fileType.toLatin1());
}
#include "package.moc"
/***************************************************************************
* Copyright 2011 Marco Martin <mart@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Library General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/
#ifndef PACKAGE_H
#define PACKAGE_H
#include <QQuickItem>
#include <QUrl>
#include <KPackage/Package>
class QTimer;
class Package : public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(QString visibleName READ visibleName NOTIFY visibleNameChanged)
public:
Package(QObject *parent = 0);
~Package();
QString name() const;
void setName(const QString &name);
Q_INVOKABLE QString filePath(const QString &fileType, const QString &filename) const;
Q_INVOKABLE QString filePath(const QString &fileType) const;
QString visibleName() const;
Q_SIGNALS:
void nameChanged(const QString &);
void visibleNameChanged();
private:
QString m_name;
KPackage::Package m_package;
};
#endif