Commit 6501d337 authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen 🌈
Browse files

Merge branch 'master' into prettify-kaccounts-kcm

parents 1d82b30b 4ad7ceea
......@@ -5,13 +5,10 @@ cmake_minimum_required(VERSION 2.8.12)
set(QT_REQUIRED_VERSION "5.7.0")
set(KF5_MIN_VERSION "5.4.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
enable_testing()
set(RELEASE_SERVICE_VERSION_MAJOR "20")
set(RELEASE_SERVICE_VERSION_MINOR "03")
set(RELEASE_SERVICE_VERSION_MICRO "70")
......@@ -36,11 +33,8 @@ set_package_properties(SignOnQt5 PROPERTIES DESCRIPTION "D-Bus service which per
TYPE REQUIRED
PURPOSE "Required for building this module")
add_definitions (
-DQT_NO_KEYWORDS)
add_definitions (-DTRANSLATION_DOMAIN=\"kaccounts-integration\" -DQT_NO_KEYWORDS -DQT_NO_FOREACH)
add_definitions(-DTRANSLATION_DOMAIN=\"kaccounts-integration\")
add_definitions(-DQT_NO_FOREACH)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git" AND AccountsQt5_VERSION VERSION_GREATER 1.15)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x060000)
......@@ -52,13 +46,13 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMInstallIcons)
include(FeatureSummary)
kde_enable_exceptions()
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(GenerateExportHeader)
include(ECMPackageConfigHelpers)
include_directories(${ACCOUNTSQT_INCLUDE_DIRS} ${SIGNONQT_INCLUDE_DIRS})
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
add_subdirectory(src)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -54,7 +54,7 @@ ApplicationWindow
Component {
id: jobComponent
CreateAccount {}
CreateAccountJob {}
}
onClicked: {
......
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
set(accounts_daemon_SRCS
daemon.cpp
kcoreaddons_add_plugin(
kded_accounts
SOURCES daemon.cpp
JSON kded_accounts.json
INSTALL_NAMESPACE "kf5/kded"
)
add_library(kded_accounts MODULE
${accounts_daemon_SRCS}
)
kcoreaddons_desktop_to_json(kded_accounts accounts.desktop)
target_link_libraries(kded_accounts
Qt5::Core
KF5::DBusAddons
kaccounts
)
set_target_properties(kded_accounts PROPERTIES OUTPUT_NAME accounts)
install(TARGETS kded_accounts DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kded)
[Desktop Entry]
Name=Accounts
Name[ar]=الحسابات
Name[ca]=Comptes
Name[ca@valencia]=Comptes
Name[cs]=Účty
Name[da]=Konti
Name[de]=Zugänge
Name[el]=Λογαριασμοί
Name[en_GB]=Accounts
Name[es]=Cuentas
Name[et]=Kontod
Name[eu]=Kontuak
Name[fi]=Tilit
Name[fr]=Comptes
Name[gl]=Contas
Name[hu]=Fiókok
Name[ia]=Contos
Name[it]=Account
Name[ko]=계정
Name[lt]=Paskyros
Name[nl]=Accounts
Name[nn]=Kontoar
Name[pl]=Konta
Name[pt]=Contas
Name[pt_BR]=Contas
Name[ro]=Conturi
Name[ru]=Учётные записи в Интернете
Name[sk]=Účty
Name[sl]=Računi
Name[sr]=Налози
Name[sr@ijekavian]=Налози
Name[sr@ijekavianlatin]=Nalozi
Name[sr@latin]=Nalozi
Name[sv]=Konton
Name[tr]=Hesaplar
Name[uk]=Облікові записи
Name[x-test]=xxAccountsxx
Name[zh_CN]=帐户
Name[zh_TW]=帳號
Comment=Accounts management
Comment[ar]=إدارة الحساباتل
Comment[ca]=Gestor de comptes
Comment[ca@valencia]=Gestor de comptes
Comment[cs]=Správa účtů
Comment[da]=Håndtering af konti
Comment[de]=Zugangs-Verwaltung
Comment[el]=Διαχείριση λογαριασμών
Comment[en_GB]=Accounts management
Comment[es]=Gestión de cuentas
Comment[et]=Kontode haldus
Comment[eu]=Kontuen kudeaketa
Comment[fi]=Tilienhallinta
Comment[fr]=Gestion des comptes
Comment[gl]=Xestión das contas
Comment[hu]=Fiókkezelés
Comment[ia]=Gestion de contos
Comment[it]=Gestione account
Comment[ko]=계정 관리
Comment[lt]=Paskyrų tvarkymas
Comment[nl]=Accountbeheer
Comment[nn]=Konto­handsaming
Comment[pl]=Zarządzanie kontami
Comment[pt]=Gestão de contas
Comment[pt_BR]=Gerenciamento de contas
Comment[ro]=Gestiune conturi
Comment[ru]=Управление учётными записями в интернет-службах
Comment[sk]=Správa účtov
Comment[sl]=Upravljanje računov
Comment[sr]=Управљање налозима
Comment[sr@ijekavian]=Управљање налозима
Comment[sr@ijekavianlatin]=Upravljanje nalozima
Comment[sr@latin]=Upravljanje nalozima
Comment[sv]=Kontohantering
Comment[tr]=Hesap yönetimi
Comment[uk]=Керування обліковими записами
Comment[x-test]=xxAccounts managementxx
Comment[zh_CN]=账户管理
Comment[zh_TW]=帳號管理
Type=Service
Icon=preferences-system-power-management
X-KDE-ServiceTypes=KDEDModule
X-KDE-Library=accounts
X-KDE-DBus-ModuleName=accounts
X-KDE-Kded-autoload=true
X-KDE-Kded-load-on-demand=false
X-KDE-Kded-phase=1
......@@ -59,7 +59,7 @@ AccountsDaemon::AccountsDaemon(QObject *parent, const QList<QVariant>&)
continue;
}
KAccountsDPlugin* plugin = factory->create<KAccountsDPlugin>(this, {});
KAccountsDPlugin* plugin = factory->create<KAccountsDPlugin>(this, QVariantList());
if (!plugin) {
qDebug() << "Error loading plugin" << metadata.name() << loader.errorString();
continue;
......
{
"KPlugin": {
"Description": "Accounts management",
"Name": "Accounts"
},
"OnlyShowIn": "KDE;",
"X-KDE-Kded-autoload": true,
"X-KDE-Kded-phase": 1,
"X-KDE-ModuleType": "Library"
}
include_directories(${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/..)
add_library(kaccountsdeclarativeplugin SHARED kaccountsdeclarativeplugin.cpp)
target_link_libraries(kaccountsdeclarativeplugin Qt5::Qml
......
......@@ -18,9 +18,9 @@
*************************************************************************************/
#include "kaccountsdeclarativeplugin.h"
#include "../jobs/createaccountjob.h"
#include "../jobs/accountservicetogglejob.h"
#include "../jobs/removeaccountjob.h"
#include "createaccountjob.h"
#include "accountservicetogglejob.h"
#include "removeaccountjob.h"
#include "accountsmodel.h"
#include "servicesmodel.h"
#include <qqml.h>
......@@ -32,4 +32,6 @@ void KAccountsDeclarativePlugin::registerTypes(const char* uri)
qmlRegisterType<RemoveAccountJob>(uri, 1, 2, "RemoveAccount");
qmlRegisterType<AccountsModel>(uri, 1, 2, "AccountsModel");
qmlRegisterType<ServicesModel>(uri, 1, 2, "ServicesModel");
qmlRegisterType<CreateAccountJob>(uri, 1, 0, "CreateAccountJob");
qmlRegisterType<AccountServiceToggleJob>(uri, 1, 1, "AccountServiceToggleJob");
}
......@@ -29,10 +29,10 @@ K_PLUGIN_CLASS_WITH_JSON(AccountsSettings, "kcm_kaccounts.json")
AccountsSettings::AccountsSettings(QObject* parent, const QVariantList& args)
: KQuickAddons::ConfigModule(parent, args)
{
KAboutData* about = new KAboutData("kcm_kaccounts", i18n("Accounts"),
"1.0", QString(), KAboutLicense::LGPL);
about->addAuthor(i18n("Sebastian Kügler"), QString(), "sebas@kde.org");
about->addAuthor(i18n("Dan Leinir Turthra Jensen"), QString(), "sebas@kde.org", QString(), "leinir");
KAboutData* about = new KAboutData(QStringLiteral("kcm_kaccounts"), i18n("Accounts"),
QStringLiteral("1.0"), QString(), KAboutLicense::LGPL);
about->addAuthor(i18n("Sebastian Kügler"), QString(), QStringLiteral("sebas@kde.org"));
about->addAuthor(i18n("Dan Leinir Turthra Jensen"), QString(), QStringLiteral("admin@leinir.dk"), QString(), QStringLiteral("leinir"));
setAboutData(about);
}
......
project (kaccounts-support-library)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KAccounts")
include(ECMGenerateHeaders)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(CMakePackageConfigHelpers)
include(WriteBasicConfigVersionFile)
include(KDECMakeSettings)
include(GenerateExportHeader)
ecm_setup_version(${KACCOUNTS_VERSION}
VARIABLE_PREFIX KACCOUNTS
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kaccounts_version.h"
......@@ -23,38 +9,33 @@ ecm_setup_version(${KACCOUNTS_VERSION}
set (kaccountslib_SRCS
accountsmodel.cpp
core.cpp
getcredentialsjob.cpp
kaccountsdplugin.cpp
kaccountsuiplugin.cpp
servicesmodel.cpp
uipluginsmanager.cpp
../jobs/accountservicetogglejob.cpp
../jobs/createaccountjob.cpp
../jobs/removeaccountjob.cpp
accountservicetogglejob.cpp
createaccountjob.cpp
getcredentialsjob.cpp
removeaccountjob.cpp
)
ecm_generate_headers(kaccountslib_HEADERS
HEADER_NAMES
AccountsModel
Core
GetCredentialsJob
KAccountsUiPlugin
KAccountsDPlugin
ServicesModel
REQUIRED_HEADERS kaccountslib_HEADERS
)
ecm_generate_headers(kaccountslib_jobs_HEADERS
HEADER_NAMES
AccountServiceToggleJob
GetCredentialsJob
CreateAccountJob
RemoveAccountJob
RELATIVE ../jobs
REQUIRED_HEADERS kaccountslib_jobs_HEADERS
REQUIRED_HEADERS kaccountslib_HEADERS
)
add_library (kaccounts SHARED
${kaccountslib_SRCS}
)
add_library(kaccounts ${kaccountslib_SRCS})
generate_export_header(kaccounts BASE_NAME kaccounts)
target_link_libraries (kaccounts
......@@ -95,7 +76,6 @@ install(EXPORT KAccountsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KA
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/kaccounts_export.h
${kaccountslib_HEADERS}
${kaccountslib_jobs_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/kaccounts_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR}/KAccounts COMPONENT Devel
)
......
......@@ -19,6 +19,7 @@
#ifndef ACCOUNTSERVICETOGGLE_H
#define ACCOUNTSERVICETOGGLE_H
#include "kaccounts_export.h"
#include "kaccounts_export.h"
......
......@@ -162,7 +162,7 @@ QVariant AccountsModel::data(const QModelIndex& index, int role) const
break;
case IconNameRole:
{
QString iconName{"unknown"};
QString iconName = QString::fromLatin1("unknown");
if (account->provider().isValid() && !account->provider().iconName().isEmpty()) {
iconName = account->provider().iconName();
}
......
......@@ -74,7 +74,7 @@ void CreateAccountJob::processSession()
} else {
SignOn::IdentityInfo info;
info.setCaption(m_providerName);
info.setAccessControlList(QStringList("*"));
info.setAccessControlList({QStringLiteral("*")});
info.setType(SignOn::IdentityInfo::Application);
info.setStoreSecret(true);
......@@ -87,7 +87,7 @@ void CreateAccountJob::processSession()
});
QVariantMap data = m_accInfo->authData().parameters();
data.insert("Embedded", false);
data.insert(QStringLiteral("Embedded"), false);
SignOn::SessionData sessionData(data);
SignOn::AuthSessionP session = m_identity->createSession(m_accInfo->authData().method());
......@@ -184,18 +184,18 @@ void CreateAccountJob::info(const SignOn::IdentityInfo &info)
if (m_account->displayName().isEmpty()) {
m_account->setDisplayName(info.userName());
}
m_account->setValue("username", info.userName());
m_account->setValue(QStringLiteral("username"), info.userName());
m_account->setCredentialsId(info.id());
Accounts::AuthData authData = m_accInfo->authData();
m_account->setValue("auth/mechanism", authData.mechanism());
m_account->setValue("auth/method", authData.method());
m_account->setValue(QStringLiteral("auth/mechanism"), authData.mechanism());
m_account->setValue(QStringLiteral("auth/method"), authData.method());
QString base("auth/");
QString base = QStringLiteral("auth/");
base.append(authData.method());
base.append("/");
base.append(QLatin1Char('/'));
base.append(authData.mechanism());
base.append("/");
base.append(QLatin1Char('/'));
QVariantMap data = authData.parameters();
QMapIterator<QString, QVariant> i(data);
......
......@@ -81,7 +81,7 @@ void GetCredentialsJob::Private::getCredentials()
return;
}
authData["AccountUsername"] = acc->value(QLatin1String("username")).toString();
authData[QStringLiteral("AccountUsername")] = acc->value(QLatin1String("username")).toString();
QPointer<SignOn::AuthSession> authSession = identity->createSession(authMethod.isEmpty() ? serviceAuthData.method() : authMethod);
if (!authSession) {
qWarning() << "Unable to create auth session for" << authMethod << serviceAuthData.method();
......
......@@ -183,8 +183,8 @@ QString ServicesModel::accountProviderName() const
QString ServicesModel::accountIconName() const
{
if (d->account && !d->account->provider().iconName().isEmpty()) {
if (d->account && d->account->provider().isValid() && !d->account->provider().iconName().isEmpty()) {
return d->account->provider().iconName();
}
return QString{"unknown"};
return QString::fromLatin1("unknown");
}
......@@ -133,7 +133,7 @@ KAccountsUiPlugin* UiPluginsManager::pluginForName(const QString &name)
s_instance->loadPlugins();
}
return s_instance->pluginsForNames.value(name + ".so");
return s_instance->pluginsForNames.value(name + QStringLiteral(".so"));
}
KAccountsUiPlugin* UiPluginsManager::pluginForService(const QString &service)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment