mirror of
https://bitbucket.org/smil3y/kde-playground.git
synced 2025-02-23 18:32:51 +00:00
polkit-kde-kcmmodules-1: adjust to Katie changes
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
3c298dd37a
commit
9afa3f9dea
11 changed files with 37 additions and 18 deletions
|
@ -5,6 +5,9 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
|
|||
find_package(KDE4 REQUIRED)
|
||||
include(KDE4Defaults)
|
||||
|
||||
include_directories(${KDE4_INCLUDES})
|
||||
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
|
||||
function(dbus_add_activation_system_service _sources)
|
||||
pkg_search_module( DBUS dbus-1 )
|
||||
foreach (_i ${_sources})
|
||||
|
|
|
@ -15,9 +15,11 @@
|
|||
|
||||
#include <kdemacros.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class IdentityWidget;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class KDE_EXPORT IdentityWidget : public QWidget
|
||||
{
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include <QCoreApplication>
|
||||
#include <QSettings>
|
||||
#include <QTextCodec>
|
||||
#include <QRegExp>
|
||||
#include <QStringList>
|
||||
#include <QDebug>
|
||||
|
@ -41,7 +42,11 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
QSettings ini(argv[1], QSettings::IniFormat);
|
||||
#ifndef QT_KATIE // Katie uses C-strings codec which is UTF-8
|
||||
ini.setIniCodec("UTF-8");
|
||||
#else
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
#endif
|
||||
if (ini.status()) {
|
||||
qCritical("Error loading file: %s", argv[1]);
|
||||
return 1;
|
||||
|
|
|
@ -12,14 +12,15 @@
|
|||
|
||||
#include "helperadaptor.h"
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtXml/QDomDocument>
|
||||
|
||||
#include <QtDBus/QDBusConnection>
|
||||
|
||||
#include <PolkitQt1/Authority>
|
||||
#include <QDir>
|
||||
#include <KLocalizedString>
|
||||
|
||||
bool orderByPriorityLessThan(const PKLAEntry &e1, const PKLAEntry &e2)
|
||||
|
@ -75,10 +76,9 @@ void PolkitKde1Helper::saveGlobalConfiguration(const QString& adminIdentities, i
|
|||
|
||||
// Ok, let's see what we have to save here.
|
||||
QSettings kdesettings("/etc/polkit-1/polkit-kde-1.conf", QSettings::IniFormat);
|
||||
kdesettings.beginGroup("General");
|
||||
|
||||
kdesettings.setValue("ConfigPriority", systemPriority);
|
||||
kdesettings.setValue("PoliciesPriority", policiesPriority);
|
||||
kdesettings.setValue("General/ConfigPriority", systemPriority);
|
||||
kdesettings.setValue("General/PoliciesPriority", policiesPriority);
|
||||
|
||||
QString contents = QString("[Configuration]\nAdminIdentities=%1\n").arg(adminIdentities);
|
||||
|
||||
|
@ -316,10 +316,9 @@ void PolkitKde1Helper::writePolicy(const QList<PKLAEntry>& policy)
|
|||
qSort(entries.begin(), entries.end(), orderByPriorityLessThan);
|
||||
|
||||
QSettings kdesettings("/etc/polkit-1/polkit-kde-1.conf", QSettings::IniFormat);
|
||||
kdesettings.beginGroup("General");
|
||||
|
||||
QString pathName = QString("/var/lib/polkit-1/localauthority/%1-polkitkde.d/")
|
||||
.arg(kdesettings.value("PoliciesPriority",75).toInt());
|
||||
.arg(kdesettings.value("General/PoliciesPriority",75).toInt());
|
||||
|
||||
foreach(const PKLAEntry &entry, entries) {
|
||||
QString fullPath;
|
||||
|
|
|
@ -339,8 +339,7 @@ void ActionWidget::addNewPKLAEntry(const PKLAEntry& entry)
|
|||
PKLAEntry toInsert(entry);
|
||||
// Match it to the current config value
|
||||
QSettings settings("/etc/polkit-1/polkit-kde-1.conf", QSettings::IniFormat);
|
||||
settings.beginGroup("General");
|
||||
toInsert.filePriority = settings.value("PoliciesPriority", 75).toInt();
|
||||
toInsert.filePriority = settings.value("General/PoliciesPriority", 75).toInt();
|
||||
|
||||
// If there's no file order, append it to the end of the current entries
|
||||
if (toInsert.fileOrder < 0) {
|
||||
|
|
|
@ -12,14 +12,18 @@
|
|||
#define ACTIONWIDGET_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include "PKLAEntry.h"
|
||||
#include <QtGui/QListWidgetItem>
|
||||
#include <PolkitQt1/ActionDescription>
|
||||
|
||||
#include "PKLAEntry.h"
|
||||
|
||||
class KComboBox;
|
||||
#include <QListWidgetItem>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class ActionWidget;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace PolkitKde {
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ void PoliciesModel::insertOrUpdate(const QStringList &actionPath, const PolkitQt
|
|||
QString path = actionPath.join(".");
|
||||
PolicyItem *action = 0;
|
||||
for (int i = 0; i < parent->childCount(); i++) {
|
||||
if (!parent->child(i)->isGroup() && path == parent->child(i)->data(PathRole)) {
|
||||
if (!parent->child(i)->isGroup() && path == parent->child(i)->data(PathRole).toString()) {
|
||||
action = parent->child(i);
|
||||
break;
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ void PoliciesModel::insertOrUpdate(const QStringList &actionPath, const PolkitQt
|
|||
QString path = actionPath.at(level);
|
||||
PolicyItem *group = 0;
|
||||
for (int i = 0; i < parent->childCount(); i++) {
|
||||
if (parent->child(i)->isGroup() && path == parent->child(i)->data(PathRole)) {
|
||||
if (parent->child(i)->isGroup() && path == parent->child(i)->data(PathRole).toString()) {
|
||||
group = parent->child(i);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -14,17 +14,19 @@
|
|||
#include <kcmodule.h>
|
||||
#include <PolkitQt1/Authority>
|
||||
#include <QtCore/QPointer>
|
||||
#include <QtCore/QModelIndex>
|
||||
|
||||
#include <QModelIndex>
|
||||
namespace PolkitKde {
|
||||
class PoliciesModel;
|
||||
class AuthorizationsFilterModel;
|
||||
class ActionWidget;
|
||||
}
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class PolkitActionsMainView;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class PolkitActionsKCM : public KCModule
|
||||
{
|
||||
|
|
|
@ -11,13 +11,16 @@
|
|||
#ifndef EXPLICITAUTHORIZATIONDIALOG_H
|
||||
#define EXPLICITAUTHORIZATIONDIALOG_H
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <KDialog>
|
||||
|
||||
#include "PKLAEntry.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class ExplicitAuthorizationWidget;
|
||||
}
|
||||
#include <QVBoxLayout>
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace PolkitKde {
|
||||
|
||||
|
|
|
@ -79,9 +79,8 @@ void KCMPolkitConfig::load()
|
|||
{
|
||||
// Load the first tab
|
||||
QSettings settings("/etc/polkit-1/polkit-kde-1.conf", QSettings::IniFormat);
|
||||
settings.beginGroup("General");
|
||||
|
||||
int priority = settings.value("ConfigPriority", 75).toInt();
|
||||
int priority = settings.value("General/ConfigPriority", 75).toInt();
|
||||
int highestPriority = -1;
|
||||
QString highestFilename;
|
||||
|
||||
|
@ -134,7 +133,7 @@ void KCMPolkitConfig::load()
|
|||
|
||||
// Set up the other tab
|
||||
m_ui->configPrioritySpin->setValue(priority);
|
||||
m_ui->policyPrioritySpin->setValue(settings.value("PoliciesPriority", 75).toInt());
|
||||
m_ui->policyPrioritySpin->setValue(settings.value("General/PoliciesPriority", 75).toInt());
|
||||
}
|
||||
|
||||
void KCMPolkitConfig::save()
|
||||
|
|
|
@ -14,9 +14,12 @@
|
|||
#include <kcmodule.h>
|
||||
|
||||
#include <QVBoxLayout>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class PolkitConfig;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class KCMPolkitConfig : public KCModule
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue