[mythtv] [PATCH] Controlled autoexpire vs immediate deletion

Kai Fritzowsky mythtv-dev at blackhole.hadinet.de
Sat Mar 26 22:46:39 UTC 2005


Hi!

Sometimes (or often), you want to delete a recording after watching it.
You delete it and the day after your wife tells you that you shouldn't...

This patch adds a menu entry to the delete box enabling the user to set the
autoexpire value to 999, so the given recording will be deleted before the
untouched ones but not immediately. So far, there is no indication of the
current autoexpire value in the frontend. If there's some interest, I will
be happy to add that.

A short time ago there was the thread "Proposed alternate behaviour for show
delete". Since there was no consensus about the necessity of an undelete
functionality, I don't think this patch will make it into the cvs.
Unfortunately I don't have enough time to implement one of the better ideas
mentioned there. Anyway, it works quite good for me, and I thought someone
might be interested.

/Kai
-------------- next part --------------
Index: libs/libmythtv/programinfo.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/programinfo.cpp,v
retrieving revision 1.201
diff -r1.201 programinfo.cpp
1274c1274
< void ProgramInfo::SetAutoExpire(bool autoExpire)
---
> void ProgramInfo::SetAutoExpire(long long autoExpire)
Index: libs/libmythtv/programinfo.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/programinfo.h,v
retrieving revision 1.101
diff -r1.101 programinfo.h
157c157
<     void SetAutoExpire(bool autoExpire);
---
>     void SetAutoExpire(long long autoExpire);
Index: programs/mythfrontend/playbackbox.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/playbackbox.cpp,v
retrieving revision 1.203
diff -r1.203 playbackbox.cpp
1807a1808,1820
>     switch (types)
>     {
>         case EndOfRecording:
>         case DeleteRecording:
>              tmpmessage = tr("No, but autoexpire first");
>              tmpslot = SLOT(doAutoExpireNext());
>              popup->addButton(tmpmessage, this, tmpslot);
>              break;
>         case AutoExpireRecording:
>         case StopRecording:
>              break;
>     }
> 
2818a2832,2852
> void PlaybackBox::doAutoExpireFirst(void)
> {
>     if (!expectingPopup)
>         return;
> 
>     cancelPopup();
> 
>     delitem->SetAutoExpire(999);
> 
>     ProgramInfo *tmpItem = findMatchingProg(delitem);
>     if (tmpItem)
>         tmpItem->programflags |= FL_AUTOEXP;
> 
>     delete delitem;
>     delitem = NULL;
> 
>     state = kChanging;
> 
>     update(listRect);
> }
> 
Index: programs/mythfrontend/playbackbox.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/playbackbox.h,v
retrieving revision 1.67
diff -r1.67 playbackbox.h
78a79
>     void doAutoExpireFirst();


More information about the mythtv-dev mailing list