diff options
| author | Aleix Pol <aleixpol@kde.org> | 2015-08-31 15:15:53 (GMT) |
|---|---|---|
| committer | Aleix Pol <aleixpol@kde.org> | 2015-08-31 15:15:53 (GMT) |
| commit | ead3de1c9808523e65d43d276941187b12609764 (patch) | |
| tree | 82f78e88e087a314b6e2b3f8dea42b6e25299fc2 | |
| parent | 90e2abeddba422fb958fc9624ae2600450d5ba13 (diff) | |
Use kdesu instead of pkexec
pkexec doesn't cut it on GUI applications, kdesu seems to work.
On kubuntu it should be using sudo instead of su.
REVIEW: 125003
| -rw-r--r-- | README.PACKAGERS | 9 | ||||
| -rw-r--r-- | libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp | 6 | ||||
| -rw-r--r-- | libmuon/backends/ApplicationBackend/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | libmuonapt/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | libmuonapt/QAptActions.cpp | 12 |
5 files changed, 14 insertions, 16 deletions
diff --git a/README.PACKAGERS b/README.PACKAGERS index 28f1519..8c66ab8 100644 --- a/README.PACKAGERS +++ b/README.PACKAGERS @@ -1,11 +1,10 @@ Runtime dependencies: -libmuonprivate: -- kdesudo -- software-properties-kde - muon: - apt-xapian-index -muon-discover: +apt-backend: - app-install-data - apt-xapian-index +- kde-cli-tools (kdesu) +- software-properties-kde + diff --git a/libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp b/libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp index bb56c35..414509f 100644 --- a/libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp +++ b/libmuon/backends/ApplicationBackend/ApplicationNotifier.cpp @@ -103,10 +103,8 @@ void ApplicationNotifier::checkUpgradeFinished(int exitStatus) void ApplicationNotifier::upgradeActivated() { - QString pkexec = QStandardPaths::findExecutable("pkexec"); - QString upgrader = QStringLiteral("do-release-upgrade -m desktop -f DistUpgradeViewKDE"); - - QProcess::startDetached(pkexec, QStringList() << upgrader); + const QString kdesu = QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesu"); + QProcess::startDetached(kdesu, { "--", "do-release-upgrade", "-m", "desktop", "-f", "DistUpgradeViewKDE" }); } void ApplicationNotifier::recheckSystemUpdateNeeded() diff --git a/libmuon/backends/ApplicationBackend/CMakeLists.txt b/libmuon/backends/ApplicationBackend/CMakeLists.txt index 4785e1f..b90ee44 100644 --- a/libmuon/backends/ApplicationBackend/CMakeLists.txt +++ b/libmuon/backends/ApplicationBackend/CMakeLists.txt @@ -34,6 +34,7 @@ install(FILES distupgradeevent/releasechecker DESTINATION ${DATA_INSTALL_DIR}/li ) add_library(MuonApplicationNotifier MODULE ApplicationNotifier.cpp) +target_compile_definitions(MuonApplicationNotifier PRIVATE -DCMAKE_INSTALL_FULL_LIBEXECDIR_KF5=\"${CMAKE_INSTALL_FULL_LIBEXECDIR_KF5}\") target_link_libraries(MuonApplicationNotifier KF5::CoreAddons KF5::I18n KF5::Notifications KF5::IconThemes MuonNotifiers) install(TARGETS MuonApplicationNotifier DESTINATION ${PLUGIN_INSTALL_DIR}/muon-notifier) diff --git a/libmuonapt/CMakeLists.txt b/libmuonapt/CMakeLists.txt index 1c8bae9..fe3928c 100644 --- a/libmuonapt/CMakeLists.txt +++ b/libmuonapt/CMakeLists.txt @@ -14,6 +14,8 @@ target_link_libraries(MuonApt Qt5::Core QApt::Main KF5::I18n ) +target_compile_definitions(MuonApt PRIVATE -DCMAKE_INSTALL_FULL_LIBEXECDIR_KF5=\"${CMAKE_INSTALL_FULL_LIBEXECDIR_KF5}\") + target_include_directories(MuonApt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) add_executable(muon_repo_helper AddRepositoryHelper.cpp) diff --git a/libmuonapt/QAptActions.cpp b/libmuonapt/QAptActions.cpp index 7b82f67..c37c452 100644 --- a/libmuonapt/QAptActions.cpp +++ b/libmuonapt/QAptActions.cpp @@ -389,10 +389,10 @@ void QAptActions::runSourcesEditor() QStringList arguments; int winID = m_mainWindow->effectiveWinId(); - QString pkexec = QStandardPaths::findExecutable("pkexec"); - QString editor = QStandardPaths::findExecutable("software-properties-kde"); + const QString kdesu = QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesu"); + const QString editor = QStandardPaths::findExecutable("software-properties-kde"); - arguments << pkexec << editor << QStringLiteral("--attach") % QString::number(winID); + arguments << kdesu << "--" << editor << QStringLiteral("--attach") << QString::number(winID); if (m_reloadWhenEditorFinished) { arguments << QStringLiteral("--dont-update"); } @@ -503,10 +503,8 @@ void QAptActions::closeHistoryDialog() void QAptActions::launchDistUpgrade() { - QString pkexec = QStandardPaths::findExecutable("pkexec"); - QString upgrader = QStringLiteral("do-release-upgrade -m desktop -f DistUpgradeViewKDE"); - - QProcess::startDetached(pkexec, QStringList() << upgrader); + const QString kdesu = QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesu"); + QProcess::startDetached(kdesu, {"--", "do-release-upgrade", "-m", "desktop", "-f", "DistUpgradeViewKDE"}); } void QAptActions::checkDistUpgrade() |
