Skip to content

Commit

Permalink
polkit-agent: Move PolicyKit agent out of the shell
Browse files Browse the repository at this point in the history
Move the code to a separate process.
It doesn't build now and will be fixed later.

Issue: #146
  • Loading branch information
plfiorini committed Feb 25, 2014
1 parent abbb2bc commit 42d49b2
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 111 deletions.
11 changes: 2 additions & 9 deletions src/client/CMakeLists.txt
Expand Up @@ -6,9 +6,7 @@ find_package(ALSA)

include_directories(
${Qt5Gui_PRIVATE_INCLUDE_DIRS}
${POLKITQT-1_INCLUDE_DIR}
${WaylandClient_INCLUDE_DIRS}
${QtAccountsService_INCLUDE_DIRS}
${ALSA_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_SOURCE_DIR}/src/libhawaiishell
Expand All @@ -24,7 +22,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/scripting
${CMAKE_CURRENT_SOURCE_DIR}/services
${CMAKE_CURRENT_SOURCE_DIR}/services/datetime
${CMAKE_CURRENT_SOURCE_DIR}/services/policykit-agent
${CMAKE_CURRENT_SOURCE_DIR}/services/powermanager
${CMAKE_CURRENT_SOURCE_DIR}/services/processlauncher
${CMAKE_CURRENT_SOURCE_DIR}/services/volumecontrol
Expand Down Expand Up @@ -54,7 +51,6 @@ set(SOURCES
scripting/scriptengine.cpp
services/servicefactory.cpp
services/datetime/datetime.cpp
services/policykit-agent/policykitagent.cpp
services/powermanager/powermanagerbackend.cpp
services/powermanager/powermanager.cpp
services/powermanager/systemdpowerbackend.cpp
Expand Down Expand Up @@ -84,17 +80,14 @@ qtwayland_add_protocol_client(SOURCES
qt5_add_resources(RESOURCES client.qrc)

add_executable(hawaii-shell-client ${SOURCES} ${RESOURCES})
qt5_use_modules(hawaii-shell-client Quick Widgets Script)
qt5_use_modules(hawaii-shell-client DBus Quick Widgets Script)
set_target_properties(hawaii-shell-client PROPERTIES
COMPILE_FLAGS "-rdynamic"
LINK_FLAGS "-L${WaylandClient_LIBDIR} -L${POLKITQT-1_LIB_DIR}"
LINK_FLAGS "-L${WaylandClient_LIBDIR}"
)
target_link_libraries(hawaii-shell-client
${WaylandClient_LIBRARIES}
${POLKITQT-1_CORE_LIBRARY}
${POLKITQT-1_AGENT_LIBRARY}
${ALSA_LIBRARIES}
${QtAccountsService_LIBRARIES}
HF1HawaiiShell
)

Expand Down
5 changes: 0 additions & 5 deletions src/client/client.qrc
Expand Up @@ -6,9 +6,6 @@
<!-- Notifications -->
<file>qml/NotificationsPanel.qml</file>

<!-- Dialogs -->
<file>qml/AuthenticationDialog.qml</file>

<!-- Overlays -->
<file>qml/Overlay.qml</file>
<file>qml/ShortcutsOverlay.qml</file>
Expand All @@ -17,8 +14,6 @@
<file>qml/WorkspacesOverlay.qml</file>

<!-- Other files -->
<file>qml/qmldir</file>
<file>qml/DialogsSingleton.qml</file>
<file>qml/Registrar.qml</file>
</qresource>
</RCC>
71 changes: 0 additions & 71 deletions src/client/qml/DialogsSingleton.qml

This file was deleted.

1 change: 0 additions & 1 deletion src/client/qml/qmldir

This file was deleted.

5 changes: 0 additions & 5 deletions src/client/registration.cpp
Expand Up @@ -33,7 +33,6 @@
#include "registration.h"
#include "keybinding.h"
#include "shellcontroller.h"
#include "policykitagent.h"
#include "powermanager.h"
#include "processlauncher.h"
#include "servicefactory.h"
Expand Down Expand Up @@ -71,15 +70,11 @@ void Registration::registerFactories()
qmlRegisterUncreatableType<PowerManager>(uri, 1, 0,
"PowerManager",
QStringLiteral("Do not create PowerManager"));
qmlRegisterUncreatableType<PolicyKitAgent>(uri, 1, 0,
"PolicyKitAgent",
QStringLiteral("Do not create PolicyKitAgent"));

// Register service factories
ServiceFactory::registerFactory<DateTime>();
ServiceFactory::registerFactory<PowerManager>();
ServiceFactory::registerFactory<ProcessLauncher>();
ServiceFactory::registerFactory<SessionManager>();
ServiceFactory::registerFactory<VolumeControl>();
ServiceFactory::registerFactory<PolicyKitAgent>();
}
3 changes: 3 additions & 0 deletions src/daemons/CMakeLists.txt
@@ -1 +1,4 @@
add_subdirectory(notifications)
if(PolkitQt-1_FOUND AND QtAccountsService_FOUND)
add_subdirectory(polkitagent)
endif()
33 changes: 33 additions & 0 deletions src/daemons/polkitagent/CMakeLists.txt
@@ -0,0 +1,33 @@
include_directories(
${POLKITQT-1_INCLUDE_DIR}
${QtAccountsService_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/headers
${CMAKE_BINARY_DIR}/headers
)

if(systemd_FOUND)
include_directories(${systemd_INCLUDE_DIRS})
endif()

set(SOURCES
main.cpp
policykitagent.cpp
)

set(LINK_FLAGS "-L${POLKITQT-1_LIB_DIR}")
set(LIBRARIES
${POLKITQT-1_CORE_LIBRARY}
${POLKITQT-1_AGENT_LIBRARY}
${QtAccountsService_LIBRARIES}
)
if(systemd_FOUND)
set(LINK_FLAGS "${LINK_FLAGS} -L${systemd_LIBDIR}")
set(LIBRARIES ${LIBRARIES} ${systemd_LIBRARIES})
endif()

add_executable(hawaii-polkit-agent ${SOURCES} ${RESOURCES})
qt5_use_modules(hawaii-polkit-agent DBus Quick)
set_target_properties(hawaii-polkit-agent PROPERTIES LINK_FLAGS ${LINK_FLAGS})
target_link_libraries(hawaii-polkit-agent ${LIBRARIES})

install(TARGETS hawaii-polkit-agent DESTINATION ${CMAKE_INSTALL_BINDIR})
Expand Up @@ -6,19 +6,19 @@
* Author(s):
* Pier Luigi Fiorini
*
* $BEGIN_LICENSE:LGPL2.1+$
* $BEGIN_LICENSE:GPL2+$
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* it under the terms of the GNU 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 Lesser General Public License for more details.
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $END_LICENSE$
Expand Down
Expand Up @@ -6,19 +6,19 @@
* Author(s):
* Pier Luigi Fiorini
*
* $BEGIN_LICENSE:LGPL2.1+$
* $BEGIN_LICENSE:GPL2+$
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* it under the terms of the GNU 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 Lesser General Public License for more details.
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $END_LICENSE$
Expand Down
Expand Up @@ -6,19 +6,19 @@
* Author(s):
* Pier Luigi Fiorini
*
* $BEGIN_LICENSE:LGPL2.1+$
* $BEGIN_LICENSE:GPL2+$
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* it under the terms of the GNU 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 Lesser General Public License for more details.
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $END_LICENSE$
Expand Down
8 changes: 8 additions & 0 deletions src/libhawaiishell/packages_p.cpp
Expand Up @@ -129,9 +129,17 @@ void LookAndFeelPackage::initializePackage(Package *package)
// Previews
package->addDirectoryDefinition("previews", QStringLiteral("previews"),
tr("Preview images"));
package->addFileDefinition("authenticationpreview", QStringLiteral("previews/authentication.png"),
tr("Preview for the authentication user interface"));
package->addFileDefinition("lockscreenpreview", QStringLiteral("previews/lockscreen.png"),
tr("Preview for the Lock Screen"));

// Authentication
package->addDirectoryDefinition("authentication", QStringLiteral("authentication"),
tr("Authentication user interface"));
package->addFileDefinition("authentication", QStringLiteral("authentication/Authentication.qml"),
tr("Main authentication user interface file"));

// Lock Screen
package->addDirectoryDefinition("lockscreen", QStringLiteral("lockscreen"),
tr("Lock screen user interface"));
Expand Down
Expand Up @@ -6,19 +6,19 @@
* Author(s):
* Pier Luigi Fiorini
*
* $BEGIN_LICENSE:LGPL2.1+$
* $BEGIN_LICENSE:GPL2+$
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the License, or
* it under the terms of the GNU 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 Lesser General Public License for more details.
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* $END_LICENSE$
Expand Down

0 comments on commit 42d49b2

Please sign in to comment.