[mythtv-users] "watch recordings" menu -- 900 program limit?,
and slow to generate
David Engel
dlengel at attbi.com
Thu Nov 20 17:00:13 EST 2003
On Wed, Nov 19, 2003 at 11:29:46PM -0600, David Engel wrote:
> On Wed, Nov 19, 2003 at 10:34:26AM -0800, Eric Wemhoff wrote:
> > While I'm on the subject of the recorded programs menu, on my machine
> > with my admittedly large collection of recorded programs it takes a
> > little over 10 seconds to generate the menu, with a respectable
> > ...
>
> There appears to be a lot of copying of data going on. I don't know
> how much it would help, but using pointers instead of copying
> certainly wouldn't hurt.
Here's a very experimental patch you can try to see if it speeds
things up any.
David
--
David Engel
dlengel at attbi.com
-------------- next part --------------
Index: programs/mythfrontend/playbackbox.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/playbackbox.cpp,v
retrieving revision 1.101
diff -u -r1.101 playbackbox.cpp
--- programs/mythfrontend/playbackbox.cpp 18 Nov 2003 04:14:50 -0000 1.101
+++ programs/mythfrontend/playbackbox.cpp 20 Nov 2003 21:50:37 -0000
@@ -134,6 +134,11 @@
delete curitem;
if (titleData)
delete [] titleData;
+ {
+ QMap<QString, ProgramInfo*>::iterator it;
+ for (it = showData.begin(); it != showData.end(); it++)
+ delete it.data();
+ }
}
void PlaybackBox::LoadWindow(QDomElement &element)
@@ -564,7 +569,7 @@
container = theme->GetSet("selector");
- typedef QMap<QString, ProgramInfo> ShowData;
+ typedef QMap<QString, ProgramInfo*> ShowData;
ProgramInfo *tempInfo;
ShowData::Iterator it;
@@ -651,7 +656,7 @@
{
if (pastSkip <= 0)
{
- tempInfo = &(it.data());
+ tempInfo = it.data();
tempCurrent = RemoteGetRecordingStatus(tempInfo,
overrectime,
@@ -959,18 +964,23 @@
typedef QMap<QString,QString> ShowData;
int order = 1;
order = gContext->GetNumSetting("PlayBoxOrdering", 1);
- int cnt = 999;
+ int cnt = 9999;
if (order == 0 && type != Delete)
- cnt = 100;
+ cnt = 1000;
noUpdate = true;
- showData.clear();
- showDateData.clear();
- if (showList.count() > 0)
+ vector<ProgramInfo *> *infoList;
+ infoList = RemoteGetRecordedList(type == Delete);
+
{
- showList.clear();
+ QMap<QString, ProgramInfo*>::iterator it;
+ for (it = showData.begin(); it != showData.end(); it++)
+ delete it.data();
}
+ showData.clear();
+ showDateData.clear();
+ showList.clear();
if (titleData)
delete [] titleData;
@@ -978,8 +988,6 @@
showList[""] = tr("All Programs");
- vector<ProgramInfo *> *infoList;
- infoList = RemoteGetRecordedList(type == Delete);
if (infoList)
{
QString temp;
@@ -989,14 +997,13 @@
{
showList[((*i)->title).lower()] = (*i)->title;
temp = QString("%1-!-%2").arg(((*i)->title).lower()).arg(cnt);
- showData[temp] = *(*i);
+ showData[temp] = *i;
temp = QString("%1").arg(cnt);
- showDateData[temp] = *(*i);
+ showDateData[temp] = *i;
if (order == 0 && type != Delete)
cnt++;
else
cnt--;
- delete (*i);
}
delete infoList;
}
Index: programs/mythfrontend/playbackbox.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/playbackbox.h,v
retrieving revision 1.33
diff -u -r1.33 playbackbox.h
--- programs/mythfrontend/playbackbox.h 15 Nov 2003 00:56:03 -0000 1.33
+++ programs/mythfrontend/playbackbox.h 20 Nov 2003 21:50:37 -0000
@@ -108,8 +108,8 @@
int curShowing;
QString *titleData;
QMap<QString, QString> showList;
- QMap<QString, ProgramInfo> showData;
- QMap<QString, ProgramInfo> showDateData;
+ QMap<QString, ProgramInfo*> showData;
+ QMap<QString, ProgramInfo*> showDateData;
BoxType type;
More information about the mythtv-users
mailing list