Ticket #11865: channelIconsSG.patch.0

File channelIconsSG.patch.0, 980 bytes (added by Bill Meek <keemllib@…>, 11 years ago)
Line 
1diff --git a/mythtv/programs/mythbackend/services/guide.cpp b/mythtv/programs/mythbackend/services/guide.cpp
2index 9132243..d7e6029 100644
3--- a/mythtv/programs/mythbackend/services/guide.cpp
4+++ b/mythtv/programs/mythbackend/services/guide.cpp
5@@ -33,6 +33,8 @@
6 #include "scheduler.h"
7 #include "autoexpire.h"
8 #include "channelutil.h"
9+#include "mythcorecontext.h"
10+#include "storagegroup.h"
11 
12 extern AutoExpire  *expirer;
13 extern Scheduler   *sched;
14@@ -225,6 +227,18 @@ QFileInfo Guide::GetChannelIcon( int nChanId,
15     // Get Icon file path
16 
17     QString sFileName = ChannelUtil::GetIcon( nChanId );
18+    QString sChannelIconsDir;
19+    StorageGroup sg;
20+
21+    if ( !sFileName.startsWith( "/" ) ) {
22+
23+        sg.Init( "ChannelIcons", gCoreContext->GetHostName() );
24+
25+        sChannelIconsDir = sg.FindNextDirMostFree();
26+
27+        sFileName = QString( "%1/%2" ).arg(sChannelIconsDir).arg(sFileName);
28+
29+    }
30 
31     if (sFileName.isEmpty())
32         return QFileInfo();