Commit 2311ca22 authored by David Jarvie's avatar David Jarvie
Browse files

Disable command output option for display alarms if user unauthorised

If the user is not authorised to run shell commands, don't offer the
command output option for display alarms in the edit alarm dialog.

Backported from d3035b2d9f5089d99094f779c7490d65528153d1 in master.
parent 37cb99fd
KAlarm Change Log
=== Version 2.7.4 --- 16 August 2011 ===
=== Version 2.7.4 --- 19 August 2011 ===
- Fix crash when last recurrence of late-cancel alarm triggers too late.
- Fix conversion of pre-version 1.4.14 subsidiary alarms.
- Don't do search if invalid regular expression is entered in Find dialogue.
......@@ -8,6 +8,8 @@ KAlarm Change Log
window is displayed [using KDE 4.7.1 or later].
- Only reset visible tab in multi-tab settings sections when Defaults is clicked
in Configuration dialogue, and Current tab option is selected.
- Disable command output option for display alarms in edit alarm dialogue if
user not authorised to run shell commands.
=== Version 2.7.3 --- 26 July 2011 ===
- Fix crash when Wake From Suspend dialogue is shown with no alarm selected.
......@@ -73,6 +73,7 @@ using namespace KCal;
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QDragEnterEvent>
#include <QStandardItemModel>
enum { tTEXT, tFILE, tCOMMAND }; // order of mTypeCombo items
......@@ -160,6 +161,18 @@ void EditDisplayAlarmDlg::type_init(QWidget* parent, QVBoxLayout* frameLayout)
mTypeCombo->addItem(commandItem); // index = tCOMMAND
mTypeCombo->setCurrentIndex(-1); // ensure slotAlarmTypeChanged() is called when index is set
if (!ShellProcess::authorised())
// User not authorised to issue shell commands - disable Command Output option
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(mTypeCombo->model());
if (model)
QModelIndex index = model->index(2, mTypeCombo->modelColumn(), mTypeCombo->rootModelIndex());
QStandardItem* item = model->itemFromIndex(index);
if (item)
connect(mTypeCombo, SIGNAL(currentIndexChanged(int)), SLOT(slotAlarmTypeChanged(int)));
connect(mTypeCombo, SIGNAL(currentIndexChanged(int)), SLOT(contentsChanged()));
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