mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-18 08:31:16 +02:00
2016-07-20 Fred Gleason <fredg@paravelsystems.com>
* Added a 'remove' command to rdclilogedit(1) in 'utils/rdclilogedit/rdclilogedit.cpp' and 'utils/rdclilogedit/rdclilogedit.h'.
This commit is contained in:
@@ -214,6 +214,12 @@ void MainObject::List()
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Remove(int line)
|
||||
{
|
||||
edit_log_event->remove(line,1);
|
||||
}
|
||||
|
||||
|
||||
void MainObject::Save()
|
||||
{
|
||||
if(edit_log_event==NULL) {
|
||||
@@ -371,6 +377,22 @@ void MainObject::DispatchCommand(const QString &cmd)
|
||||
processed=true;
|
||||
}
|
||||
|
||||
if(verb=="remove") {
|
||||
if(cmds.size()==2) {
|
||||
line=cmds[1].toInt(&ok);
|
||||
if(ok&&(line>=0)&&(line<edit_log_event->size())) {
|
||||
Remove(line);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"remove: invalid line number\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"remove: invalid command arguments\n");
|
||||
}
|
||||
processed=true;
|
||||
}
|
||||
|
||||
if(verb=="save") {
|
||||
Save();
|
||||
processed=true;
|
||||
|
Reference in New Issue
Block a user