All pastes #1531562 Raw Edit

frontend Header Cleanup

public diff v1 · immutable
#1531562 ·published 2009-08-16 16:14 UTC
rendered paste body
Index: mythtv/programs/mythfrontend/playbackbox.cpp===================================================================--- mythtv/programs/mythfrontend/playbackbox.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/playbackbox.cpp	(working copy)@@ -1,6 +1,4 @@ -using namespace std;- #include <QDateTime> #include <QDir> #include <QApplication>Index: mythtv/programs/mythfrontend/viewscheduled.h===================================================================--- mythtv/programs/mythfrontend/viewscheduled.h	(revision 21309)+++ mythtv/programs/mythfrontend/viewscheduled.h	(working copy)@@ -1,10 +1,13 @@ #ifndef VIEWSCHEDULED_H_ #define VIEWSCHEDULED_H_ +// QT #include <QDateTime> +// libmythtv #include "programlist.h" +// libmythui #include "mythscreentype.h"  class TV;Index: mythtv/programs/mythfrontend/statusbox.h===================================================================--- mythtv/programs/mythfrontend/statusbox.h	(revision 21309)+++ mythtv/programs/mythfrontend/statusbox.h	(working copy)@@ -1,8 +1,7 @@ #ifndef STATUSBOX_H_ #define STATUSBOX_H_ -#include <vector>-using namespace std;+#include <vector> // For std::vector  #include "mythscreentype.h" @@ -59,7 +58,7 @@     QMap<int, QString> contentData;     recprof2bps_t      recordingProfilesBPS; -    vector<ProgramInfo *> m_expList;+    std::vector<ProgramInfo *> m_expList;      MythScreenStack *m_popupStack; Index: mythtv/programs/mythfrontend/guidegrid.cpp===================================================================--- mythtv/programs/mythfrontend/guidegrid.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/guidegrid.cpp	(working copy)@@ -1,14 +1,8 @@-// c/c++-#include <math.h>-#include <unistd.h>-#include <iostream>-#include <algorithm>-using namespace std;  //qt #include <QApplication>-#include <QKeyEvent> #include <QDateTime>+#include <QtGlobal>  // myth #include "mythcontext.h"@@ -278,9 +272,9 @@      fillTimeInfos();     fillChannelInfos();-    int maxchannel = max((int)GetChannelCount() - 1, 0);+    int maxchannel = qMax((int)GetChannelCount() - 1, 0);     setStartChannel((int)(m_currentStartChannel) - (int)(m_channelCount / 2));-    m_channelCount = min(m_channelCount, maxchannel + 1);+    m_channelCount = qMin(m_channelCount, maxchannel + 1);     updateChannels();      m_recList.FromScheduler();@@ -658,7 +652,7 @@      uint si  = m_channelInfoIdx[idx]; -    vector<uint64_t> sel;+    std::vector<uint64_t> sel;     sel.push_back( MKKEY(idx, si) );      const PixmapChannel *ch = GetChannelInfo(sel[0]>>32, sel[0]&0xffff);@@ -734,7 +728,7 @@     DBChanList channels = ChannelUtil::GetChannels(0, true, "", m_changrpid);     ChannelUtil::SortChannels(channels, m_channelOrdering, false); -    typedef vector<uint> uint_list_t;+    typedef std::vector<uint> uint_list_t;     QMap<QString,uint_list_t> channum_to_index_map;     QMap<QString,uint_list_t> callsign_to_index_map; @@ -988,7 +982,7 @@      ProgramList::iterator program;     program = proglist->begin();-    vector<ProgramInfo*> unknownlist;+    std::vector<ProgramInfo*> unknownlist;     bool unknown = false;     ProgramInfo *proginfo = NULL;     for (int x = 0; x < m_timeCount; x++)@@ -1036,7 +1030,7 @@         ts = ts.addSecs(5 * 60);     } -    vector<ProgramInfo*>::iterator it = unknownlist.begin();+    std::vector<ProgramInfo*>::iterator it = unknownlist.begin();     for (; it != unknownlist.end(); ++it)         proglist->append(*it); @@ -1467,8 +1461,8 @@      int maxchannel = 0;     fillChannelInfos();-    maxchannel = max((int)GetChannelCount() - 1, 0);-    m_channelCount = min(m_guideGrid->getChannelCount(), maxchannel + 1);+    maxchannel = qMax((int)GetChannelCount() - 1, 0);+    m_channelCount = qMin(m_guideGrid->getChannelCount(), maxchannel + 1);      m_recList.FromScheduler();     fillProgramInfos();Index: mythtv/programs/mythfrontend/channelrecpriority.cpp===================================================================--- mythtv/programs/mythfrontend/channelrecpriority.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/channelrecpriority.cpp	(working copy)@@ -1,8 +1,6 @@ -#include <iostream>-#include <algorithm>-#include <vector>-using namespace std;+#include <QtAlgorithms>+#include <QVector>  #include "channelrecpriority.h" #include "tv.h"@@ -361,9 +359,9 @@     }      int i, j;-    vector<RecPriorityInfo> sortingList;+    QVector<RecPriorityInfo> sortingList;     QMap<QString, ChannelInfo>::iterator pit;-    vector<RecPriorityInfo>::iterator sit;+    QVector<RecPriorityInfo>::iterator sit;     ChannelInfo *chanInfo;     RecPriorityInfo *recPriorityInfo; @@ -379,12 +377,12 @@     switch(m_sortType)     {         case byRecPriority:-            sort(sortingList.begin(), sortingList.end(),+            qSort(sortingList.begin(), sortingList.end(),             channelRecPrioritySort());             break;         case byChannel:         default:-            sort(sortingList.begin(), sortingList.end(),+            qSort(sortingList.begin(), sortingList.end(),             channelSort());             break;     }Index: mythtv/programs/mythfrontend/mythappearance.h===================================================================--- mythtv/programs/mythfrontend/mythappearance.h	(revision 21309)+++ mythtv/programs/mythfrontend/mythappearance.h	(working copy)@@ -1,8 +1,8 @@ #ifndef MYTHAPPEARANCE_H #define MYTHAPPEARANCE_H -#include <qstringlist.h>-#include <qstring.h>+#include <QStringList>+#include <QString>  #include "mythscreentype.h" #include "mythuitext.h"Index: mythtv/programs/mythfrontend/proglist.h===================================================================--- mythtv/programs/mythfrontend/proglist.h	(revision 21309)+++ mythtv/programs/mythfrontend/proglist.h	(working copy)@@ -3,7 +3,6 @@  // Qt headers #include <QDateTime>-#include <QKeyEvent>  // MythTV headers #include "mythscreentype.h"Index: mythtv/programs/mythfrontend/custompriority.cpp===================================================================--- mythtv/programs/mythfrontend/custompriority.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/custompriority.cpp	(working copy)@@ -1,6 +1,3 @@-#include <unistd.h>-#include <iostream>-using namespace std;  #include "custompriority.h" Index: mythtv/programs/mythfrontend/progfind.h===================================================================--- mythtv/programs/mythfrontend/progfind.h	(revision 21309)+++ mythtv/programs/mythfrontend/progfind.h	(working copy)@@ -4,8 +4,6 @@ // qt #include <QDateTime> #include <QEvent>-#include <QKeyEvent>-#include <QPaintEvent>  // myth #include "mythscreentype.h"Index: mythtv/programs/mythfrontend/mythfexml.h===================================================================--- mythtv/programs/mythfrontend/mythfexml.h	(revision 21309)+++ mythtv/programs/mythfrontend/mythfexml.h	(working copy)@@ -8,8 +8,7 @@ #ifndef MYTHFEXML_H_ #define MYTHFEXML_H_ -#include <qdom.h>-#include <qdatetime.h> +#include <QDateTime>  #include "upnp.h" #include "eventing.h"Index: mythtv/programs/mythfrontend/manualschedule.cpp===================================================================--- mythtv/programs/mythfrontend/manualschedule.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/manualschedule.cpp	(working copy)@@ -1,8 +1,4 @@ -#include <unistd.h>-#include <iostream>-using namespace std;- #include <QDateTime>  #include "manualschedule.h"Index: mythtv/programs/mythfrontend/viewscheduled.cpp===================================================================--- mythtv/programs/mythfrontend/viewscheduled.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/viewscheduled.cpp	(working copy)@@ -1,22 +1,21 @@-#include <stdlib.h> -#include <iostream>-using namespace std;--#include <QDateTime>-#include <QRegExp>- #include "viewscheduled.h"++// Libmythtv #include "scheduledrecording.h" #include "customedit.h" #include "programinfo.h" #include "proglist.h" #include "tv_play.h" -#include "mythcontext.h"+// Libmythdb #include "mythverbose.h"++// Libmyth+#include "mythcontext.h" #include "remoteutil.h" +// Libmythui #include "mythuitext.h" #include "mythuistatetype.h" #include "mythuibuttonlist.h"Index: mythtv/programs/mythfrontend/statusbox.cpp===================================================================--- mythtv/programs/mythfrontend/statusbox.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/statusbox.cpp	(working copy)@@ -1,12 +1,6 @@  #include "statusbox.h" -#include <unistd.h>-#include <stdlib.h>--#include <iostream>-using namespace std;- #include <QRegExp> #include <QHostAddress> @@ -1198,7 +1192,7 @@     // get free disk space     QString hostnames; -    vector<FileSystemInfo> fsInfos = RemoteGetFreeSpace();+    std::vector<FileSystemInfo> fsInfos = RemoteGetFreeSpace();     for (uint i=0; i<fsInfos.size(); i++)     {         // For a single-directory installation just display the totals@@ -1279,7 +1273,7 @@     long long             deletedGroupSize(0);     int                   deletedGroupCount(0); -    vector<ProgramInfo *>::iterator it;+    std::vector<ProgramInfo *>::iterator it;     for (it = m_expList.begin(); it != m_expList.end(); it++)         delete *it;     m_expList.clear();Index: mythtv/programs/mythfrontend/programrecpriority.cpp===================================================================--- mythtv/programs/mythfrontend/programrecpriority.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/programrecpriority.cpp	(working copy)@@ -1,7 +1,5 @@ -#include <iostream> #include <vector>-using namespace std;  #include <QDateTime> #include <QRegExp>@@ -1015,7 +1013,7 @@ void ProgramRecPriority::FillList(void) {     int cnt = 999, rtRecPriors[11];-    vector<ProgramInfo *> recordinglist;+    std::vector<ProgramInfo *> recordinglist;      int autopriority = gContext->GetNumSetting("AutoRecPriority", 0); @@ -1024,7 +1022,7 @@      RemoteGetAllScheduledRecordings(recordinglist); -    vector<ProgramInfo *>::reverse_iterator pgiter = recordinglist.rbegin();+    std::vector<ProgramInfo *>::reverse_iterator pgiter = recordinglist.rbegin();      for (; pgiter != recordinglist.rend(); pgiter++)     {@@ -1174,9 +1172,9 @@         m_currentItem = qVariantValue<ProgramRecPriorityInfo*>(item->GetData());      int i, j;-    vector<RecPriorityInfo> sortingList;+    std::vector<RecPriorityInfo> sortingList;     QMap<QString, ProgramRecPriorityInfo>::Iterator pit;-    vector<RecPriorityInfo>::iterator sit;+    std::vector<RecPriorityInfo>::iterator sit;     RecPriorityInfo *recPriorityInfo;      // copy m_programData into sortingList and make a copyIndex: mythtv/programs/mythfrontend/proglist.cpp===================================================================--- mythtv/programs/mythfrontend/proglist.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/proglist.cpp	(working copy)@@ -1,12 +1,8 @@-#include <iostream>-#include <map>-#include <vector>-#include <algorithm>-using namespace std;  // qt #include <QApplication> #include <QRegExp>+#include <QVector>  // myth #include "mythcontext.h"@@ -15,13 +11,12 @@ #include "proglist.h" #include "scheduledrecording.h" #include "customedit.h"-#include "remoteutil.h" #include "channelutil.h"  // mythdb-#include "libmythdb/mythdb.h"-#include "libmythdb/mythdbcon.h"-#include "libmythdb/mythverbose.h"+#include "mythdb.h"+#include "mythdbcon.h"+#include "mythverbose.h"  // mythui #include "mythuitext.h"@@ -1369,7 +1364,7 @@     }      ProgramInfo *s;-    vector<ProgramInfo *> sortedList;+    QVector<ProgramInfo *> sortedList;     const QRegExp prefixes("^(The |A |An )");      while (!m_itemList.empty())@@ -1387,14 +1382,14 @@     if (m_type == plNewListings || m_titleSort)     {         if (m_type == plPreviouslyRecorded)-            sort(sortedList.begin(), sortedList.end(), plPrevTitleSort());+            qSort(sortedList.begin(), sortedList.end(), plPrevTitleSort());         else         {             // Prune to one per title-            sort(sortedList.begin(), sortedList.end(), plTitleSort());+            qSort(sortedList.begin(), sortedList.end(), plTitleSort());              QString curtitle = "";-            vector<ProgramInfo *>::iterator i = sortedList.begin();+            QVector<ProgramInfo *>::iterator i = sortedList.begin();             while (i != sortedList.end())             {                 ProgramInfo *p = *i;@@ -1417,13 +1412,13 @@      if (m_reverseSort)     {-        vector<ProgramInfo *>::reverse_iterator r = sortedList.rbegin();-        for (; r != sortedList.rend(); r++)+        QVector<ProgramInfo *>::iterator r = sortedList.end() - 1;+        for (; r != sortedList.begin() - 1; r--)             m_itemList.append(*r);     }     else     {-        vector<ProgramInfo *>::iterator i = sortedList.begin();+        QVector<ProgramInfo *>::iterator i = sortedList.begin();         for (; i != sortedList.end(); i++)             m_itemList.append(*i);     }Index: mythtv/programs/mythfrontend/mythcontrols.cpp===================================================================--- mythtv/programs/mythfrontend/mythcontrols.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/mythcontrols.cpp	(working copy)@@ -29,7 +29,6 @@ // Qt headers #include <QStringList> #include <QApplication>-#include <QKeyEvent>  // MythTV headers #include <mythcontext.h>@@ -39,7 +38,6 @@ #include <mythuitext.h> #include <mythuibutton.h> #include <mythuibuttonlist.h>-#include <mythuiimage.h> #include <mythdialogbox.h>  // MythControls headersIndex: mythtv/programs/mythfrontend/progfind.cpp===================================================================--- mythtv/programs/mythfrontend/progfind.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/progfind.cpp	(working copy)@@ -1,8 +1,4 @@-#include <unistd.h>-#include <time.h>-#include <cassert> - // qt #include <QDateTime> #include <QApplication>@@ -30,9 +26,6 @@  #include "progfind.h" -using namespace std;-- #define LOC      QString("ProgFinder: ") #define LOC_ERR  QString("ProgFinder, Error: ") #define LOC_WARN QString("ProgFinder, Warning: ")Index: mythtv/programs/mythfrontend/guidegrid.h===================================================================--- mythtv/programs/mythfrontend/guidegrid.h	(revision 21309)+++ mythtv/programs/mythfrontend/guidegrid.h	(working copy)@@ -3,7 +3,7 @@ #define GUIDEGRID_H_  // c++-#include <vector>+#include <vector> // For std::vector  // qt #include <QString>@@ -17,8 +17,6 @@ #include "channelgroup.h" #include "channelutil.h" -using namespace std;- class ProgramInfo; class TV; class QTimer;@@ -28,8 +26,8 @@ #define MAX_DISPLAY_CHANS 12 #define MAX_DISPLAY_TIMES 36 -typedef vector<PixmapChannel>   pix_chan_list_t;-typedef vector<pix_chan_list_t> pix_chan_list_list_t;+typedef std::vector<PixmapChannel>   pix_chan_list_t;+typedef std::vector<pix_chan_list_t> pix_chan_list_list_t;  class JumpToChannel; class MPUBLIC JumpToChannelListenerIndex: mythtv/programs/mythfrontend/mediarenderer.h===================================================================--- mythtv/programs/mythfrontend/mediarenderer.h	(revision 21309)+++ mythtv/programs/mythfrontend/mediarenderer.h	(working copy)@@ -11,8 +11,8 @@ #ifndef __MEDIARENDERER_H__ #define __MEDIARENDERER_H__ -#include <qobject.h>-#include <qmutex.h>+#include <QObject>+#include <QMutex>  #include "upnp.h" #include "upnpcmgr.h"Index: mythtv/programs/mythfrontend/exitprompt.cpp===================================================================--- mythtv/programs/mythfrontend/exitprompt.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/exitprompt.cpp	(working copy)@@ -1,4 +1,3 @@-#include <stdlib.h>  // for system()  #include <QApplication> Index: mythtv/programs/mythfrontend/mythfexml.cpp===================================================================--- mythtv/programs/mythfrontend/mythfexml.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/mythfexml.cpp	(working copy)@@ -7,18 +7,19 @@  #include "mythfexml.h" +//#include <math.h>+ #include "mythcontext.h" #include "util.h" #include "mythdbcon.h"  #include "mythmainwindow.h" -#include <qtextstream.h>-#include <qdir.h>-#include <qfile.h>-#include <qregexp.h>-#include <qbuffer.h>-#include <math.h>+#include <QTextStream>+#include <QDir>+#include <QFile>+#include <QRegExp>+#include <QBuffer>  #include "../../config.h" @@ -54,7 +55,7 @@  MythFEXMLMethod MythFEXML::GetMethod( const QString &sURI ) {-    if (sURI == "GetScreenShot"        ) return MFEXML_GetScreenShot;+    if (sURI == "GetScreenShot") return MFEXML_GetScreenShot;      return( MFEXML_Unknown ); }@@ -73,12 +74,12 @@                 return( false );              VERBOSE(VB_UPNP, QString("MythFEXML::ProcessRequest: %1 : %2")-			             .arg(pRequest->m_sMethod)-				     .arg(pRequest->m_sRawRequest));+                         .arg(pRequest->m_sMethod)+                     .arg(pRequest->m_sRawRequest));              switch( GetMethod( pRequest->m_sMethod ))             {-		case MFEXML_GetScreenShot      : GetScreenShot    ( pRequest ); return true;+                case MFEXML_GetScreenShot      : GetScreenShot    ( pRequest ); return true;                   default: @@ -123,7 +124,7 @@     if (!gContext->GetMainWindow()->screenShot(sFileName,nWidth, nHeight))     {         VERBOSE(VB_GENERAL, "MythFEXML: Failed to take screenshot. Aborting");-	return;+        return;     }      pRequest->m_sFileName = sFileName;Index: mythtv/programs/mythfrontend/action.cpp===================================================================--- mythtv/programs/mythfrontend/action.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/action.cpp	(working copy)@@ -23,7 +23,7 @@  */  // Qt headers-#include <qkeysequence.h>+#include <QKeySequence>  // MythControls headers #include "action.h"Index: mythtv/programs/mythfrontend/mythosdmenueditor.cpp===================================================================--- mythtv/programs/mythfrontend/mythosdmenueditor.cpp	(revision 21309)+++ mythtv/programs/mythfrontend/mythosdmenueditor.cpp	(working copy)@@ -1,28 +1,16 @@ #define MYTHOSDMENUEDITOR_CPP  /* QT includes */-#include <qnamespace.h>-#include <qstringlist.h>-#include <qapplication.h>-#include <qdom.h>-#include <qbuttongroup.h>-#include <qimage.h>-#include <qevent.h>-#include <qdir.h>-#include <qstring.h>+#include <QString>+#include <QListIterator>  /* MythTV includes */ #include "mythcontext.h"-#include "mythdbcon.h"-#include "mythmainwindow.h"-#include "myththemebase.h" #include "mythuibuttonlist.h" #include "mythuibutton.h" #include "mythosdmenueditor.h" #include "tvosdmenuentry.h" -using namespace std;- /* Static data members */ TVState MythOSDMenuEditor::WatchingLiveTV = kState_WatchingLiveTV; TVState MythOSDMenuEditor::WatchingPreRecorded = kState_WatchingPreRecorded;