Skip to content

Commit

Permalink
Merge master branch into class member names/initialization branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed Feb 27, 2019
2 parents 4bb310b + 7f28a74 commit 5b3f308
Show file tree
Hide file tree
Showing 72 changed files with 244 additions and 3,934 deletions.
2 changes: 1 addition & 1 deletion mythplugins/mytharchive/mytharchive/archivesettings.cpp
Expand Up @@ -78,7 +78,7 @@ static HostFileBrowserSetting *MythArchiveDVDLocation()

gc->setHelpText(ArchiveSettings::tr("Which DVD drive to use when burning "
"discs."));
gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden);
gc->SetTypeFilter(QDir::AllDirs | QDir::Files | QDir::System | QDir::Hidden);
return gc;
};

Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/pls.cpp
Expand Up @@ -131,7 +131,7 @@ int PlayListFile::parseASX(PlayListFile *pls, const QString &filename)
}
file.close();

QDomElement docElem = doc.documentElement();
//QDomElement docElem = doc.documentElement();
QDomNodeList entryList = doc.elementsByTagName("Entry");
QString url;

Expand Down
2 changes: 2 additions & 0 deletions mythtv/libs/libmyth/output.h
Expand Up @@ -114,6 +114,8 @@ class MPUBLIC OutputListeners : public MythObservable
void prepareVisuals();

private:
Q_DISABLE_COPY(OutputListeners)

QMutex m_mtx;
Visuals m_visuals;

Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythbase/codecutil.cpp
Expand Up @@ -14,5 +14,6 @@ bool CodecUtil::isValidUTF8(const QByteArray& data)
if (state.invalidChars > 0)
return false;

Q_UNUSED(text);
return true;
}
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/hardwareprofile.cpp
Expand Up @@ -157,7 +157,7 @@ QString HardwareProfile::GetAdminPasswordFromFile() const
return ret;
}

bool HardwareProfile::WritePrivateUUIDToFile(QString uuid)
bool HardwareProfile::WritePrivateUUIDToFile(const QString &uuid)
{
QString hwuuid_file = GetConfDir() + "/HardwareProfile/hw-uuid";
QFile file(hwuuid_file);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/hardwareprofile.h
Expand Up @@ -27,7 +27,7 @@ class MBASE_PUBLIC HardwareProfile : public QObject
void GenerateUUIDs(void);

QString GetPrivateUUIDFromFile(void) const;
bool WritePrivateUUIDToFile(QString uuid);
bool WritePrivateUUIDToFile(const QString &uuid);
QString GetPublicUUIDFromFile(void) const;
QString GetAdminPasswordFromFile(void) const;

Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/iso639.cpp
Expand Up @@ -957,15 +957,15 @@ static ISO639ToNameMap createLanguageMap(void)

static ISO639ToNameMap gLanguageMap;

QString GetISO639LanguageName(QString iso639_1)
QString GetISO639LanguageName(const QString &iso639_1)
{
if (gLanguageMap.isEmpty())
gLanguageMap = createLanguageMap();

return gLanguageMap[iso639_1];
}

QString GetISO639EnglishLanguageName(QString iso639_1)
QString GetISO639EnglishLanguageName(const QString &iso639_1)
{
QString iso639_2 = iso639_str2_to_str3(iso639_1);
int key2 = iso639_str3_to_key(iso639_2);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/iso639.h
Expand Up @@ -102,7 +102,7 @@ static inline QString iso639_str_to_canonoical_str(const QString &str3)
return iso639_key_to_str3(can);
}

MBASE_PUBLIC QString GetISO639LanguageName(QString iso639Code);
MBASE_PUBLIC QString GetISO639EnglishLanguageName(QString iso639Code);
MBASE_PUBLIC QString GetISO639LanguageName(const QString &iso639Code);
MBASE_PUBLIC QString GetISO639EnglishLanguageName(const QString &iso639Code);

#endif // _ISO_639_2_H_
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/mythcommandlineparser.h
Expand Up @@ -24,9 +24,9 @@ class MBASE_PUBLIC CommandLineArg : public ReferenceCounter
explicit CommandLineArg(QString name);
~CommandLineArg() = default;

CommandLineArg* SetGroup(QString group) { m_group = group;
CommandLineArg* SetGroup(const QString &group) { m_group = group;
return this; }
void AddKeyword(QString keyword) { m_keywords << keyword; }
void AddKeyword(const QString &keyword) { m_keywords << keyword; }

QString GetName(void) const { return m_name; }
QString GetUsedKeyword(void) const { return m_usedKeyword; }
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythbase/mythcorecontext.h
Expand Up @@ -263,6 +263,7 @@ class MBASE_PUBLIC MythCoreContext : public QObject, public MythObservable, publ
void TVPlaybackPlaying(void);

private:
Q_DISABLE_COPY(MythCoreContext)
MythCoreContextPrivate *d {nullptr};

void connected(MythSocket *sock) override { (void)sock; } //MythSocketCBs
Expand Down
16 changes: 8 additions & 8 deletions mythtv/libs/libmythbase/mythdbcon.cpp
Expand Up @@ -282,15 +282,15 @@ MDBManager::~MDBManager()
{
CloseDatabases();

if (m_connCount != 0 || m_schedCon || m_DDCon)
if (m_connCount != 0 || m_schedCon || m_channelCon)
{
LOG(VB_GENERAL, LOG_CRIT,
"MDBManager exiting with connections still open");
}
#if 0 /* some post logStop() debugging... */
cout<<"m_connCount: "<<m_connCount<<endl;
cout<<"m_schedCon: "<<m_schedCon<<endl;
cout<<"m_DDCon: "<<m_DDCon<<endl;
cout<<"m_channelCon: "<<m_channelCon<<endl;
#endif
}

Expand Down Expand Up @@ -461,9 +461,9 @@ MSqlDatabase *MDBManager::getSchedCon()
return getStaticCon(&m_schedCon, "SchedCon");
}

MSqlDatabase *MDBManager::getDDCon()
MSqlDatabase *MDBManager::getChannelCon()
{
return getStaticCon(&m_DDCon, "DataDirectCon");
return getStaticCon(&m_channelCon, "ChannelCon");
}

void MDBManager::CloseDatabases()
Expand Down Expand Up @@ -494,8 +494,8 @@ void MDBManager::CloseDatabases()

if (db == m_schedCon)
m_schedCon = nullptr;
if (db == m_DDCon)
m_DDCon = nullptr;
if (db == m_channelCon)
m_channelCon = nullptr;
}
m_lock.unlock();
}
Expand Down Expand Up @@ -582,9 +582,9 @@ MSqlQueryInfo MSqlQuery::SchedCon()
return qi;
}

MSqlQueryInfo MSqlQuery::DDCon()
MSqlQueryInfo MSqlQuery::ChannelCon()
{
MSqlDatabase *db = GetMythDB()->GetDBManager()->getDDCon();
MSqlDatabase *db = GetMythDB()->GetDBManager()->getChannelCon();
MSqlQueryInfo qi;

InitMSqlQueryInfo(qi);
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythbase/mythdbcon.h
Expand Up @@ -65,7 +65,7 @@ class MBASE_PUBLIC MDBManager
void pushConnection(MSqlDatabase *db);

MSqlDatabase *getSchedCon(void);
MSqlDatabase *getDDCon(void);
MSqlDatabase *getChannelCon(void);

private:
MSqlDatabase *getStaticCon(MSqlDatabase **dbcon, QString name);
Expand All @@ -82,7 +82,7 @@ class MBASE_PUBLIC MDBManager
int m_connCount {0};

MSqlDatabase *m_schedCon {nullptr};
MSqlDatabase *m_DDCon {nullptr};
MSqlDatabase *m_channelCon {nullptr};
QHash<QThread*, DBList> m_static_pool;
};

Expand Down Expand Up @@ -208,7 +208,7 @@ class MBASE_PUBLIC MSqlQuery : private QSqlQuery
static MSqlQueryInfo SchedCon();

/// \brief Returns dedicated connection. (Required for using temporary SQL tables.)
static MSqlQueryInfo DDCon();
static MSqlQueryInfo ChannelCon();

private:
// Only QSql::In is supported as a param type and only named params...
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythlocale.cpp
Expand Up @@ -13,7 +13,7 @@
#include "iso3166.h"
#include "iso639.h"

MythLocale::MythLocale(QString localeName)
MythLocale::MythLocale(const QString &localeName)
{
Init(localeName);
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythlocale.h
Expand Up @@ -12,7 +12,7 @@
class MBASE_PUBLIC MythLocale
{
public:
explicit MythLocale(QString localeName = QString());
explicit MythLocale(const QString &localeName = QString());
~MythLocale() = default;

void ReInit();
Expand Down
3 changes: 3 additions & 0 deletions mythtv/libs/libmythbase/mythobservable.h
Expand Up @@ -22,6 +22,9 @@ class MBASE_PUBLIC MythObservable

bool hasListeners(void) { return !m_listeners.isEmpty(); }

private:
Q_DISABLE_COPY(MythObservable)

protected:
QMutex *m_lock {nullptr};
QSet<QObject*> m_listeners;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythsorthelper.cpp
Expand Up @@ -79,7 +79,7 @@ MythSortHelper::MythSortHelper()
MythSortHelper::MythSortHelper(
Qt::CaseSensitivity case_sensitive,
SortPrefixMode prefix_mode,
QString exclusions) :
const QString &exclusions) :
m_case_sensitive(case_sensitive),
m_prefix_mode(prefix_mode),
m_exclusions(exclusions)
Expand Down
5 changes: 3 additions & 2 deletions mythtv/libs/libmythbase/mythsorthelper.h
Expand Up @@ -31,8 +31,9 @@ class MBASE_PUBLIC MythSortHelper

public:
MythSortHelper();
MythSortHelper(MythSortHelper *other);
MythSortHelper(Qt::CaseSensitivity case_sensitve, SortPrefixMode prefix_mode, QString exclusions);
explicit MythSortHelper(MythSortHelper *other);
MythSortHelper(Qt::CaseSensitivity case_sensitve, SortPrefixMode prefix_mode,
const QString &exclusions);

QString doTitle(const QString& title) const;
QString doPathname(const QString& filename) const;
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythbase/mythstorage.cpp
Expand Up @@ -31,13 +31,13 @@ void SimpleDBStorage::Load(void)
}
}

void SimpleDBStorage::Save(QString _table)
void SimpleDBStorage::Save(const QString &table)
{
if (!IsSaveRequired())
return;

MSqlBindings bindings;
QString querystr = "SELECT * FROM " + _table + " WHERE "
QString querystr = "SELECT * FROM " + table + " WHERE "
+ GetWhereClause(bindings) + ';';

MSqlQuery query(MSqlQuery::InitCon());
Expand All @@ -54,7 +54,7 @@ void SimpleDBStorage::Save(QString _table)
{
// Row already exists
// Don"t change this QString. See the CVS logs rev 1.91.
querystr = "UPDATE " + _table + " SET " + GetSetClause(bindings) +
querystr = "UPDATE " + table + " SET " + GetSetClause(bindings) +
" WHERE " + GetWhereClause(bindings) + ';';

query.prepare(querystr);
Expand All @@ -66,7 +66,7 @@ void SimpleDBStorage::Save(QString _table)
else
{
// Row does not exist yet
querystr = "INSERT INTO " + _table + " SET "
querystr = "INSERT INTO " + table + " SET "
+ GetSetClause(bindings) + ';';

query.prepare(querystr);
Expand Down
26 changes: 13 additions & 13 deletions mythtv/libs/libmythbase/mythstorage.h
Expand Up @@ -26,16 +26,16 @@ class MBASE_PUBLIC Storage

virtual void Load(void) = 0;
virtual void Save(void) = 0;
virtual void Save(QString /*destination*/) { }
virtual void Save(const QString &/*destination*/) { }
virtual bool IsSaveRequired(void) const { return true; };
virtual void SetSaveRequired(void) { };
};

class MBASE_PUBLIC DBStorage : public Storage
{
public:
DBStorage(StorageUser *_user, QString _table, QString _column) :
m_user(_user), m_tablename(_table), m_columnname(_column) { }
DBStorage(StorageUser *user, const QString &table, const QString &column) :
m_user(user), m_tablename(table), m_columnname(column) { }

virtual ~DBStorage() = default;

Expand All @@ -51,14 +51,14 @@ class MBASE_PUBLIC DBStorage : public Storage
class MBASE_PUBLIC SimpleDBStorage : public DBStorage
{
public:
SimpleDBStorage(StorageUser *_user,
QString _table, QString _column) :
DBStorage(_user, _table, _column) { m_initval.clear(); }
SimpleDBStorage(StorageUser *user,
const QString &table, const QString &column) :
DBStorage(user, table, column) { m_initval.clear(); }
virtual ~SimpleDBStorage() = default;

void Load(void) override; // Storage
void Save(void) override; // Storage
void Save(QString destination) override; // Storage
void Save(const QString &destination) override; // Storage
bool IsSaveRequired(void) const override; // Storage
void SetSaveRequired(void) override; // Storage

Expand All @@ -73,11 +73,11 @@ class MBASE_PUBLIC SimpleDBStorage : public DBStorage
class MBASE_PUBLIC GenericDBStorage : public SimpleDBStorage
{
public:
GenericDBStorage(StorageUser *_user,
QString _table, QString _column,
QString _keycolumn, QString _keyvalue = QString()) :
SimpleDBStorage(_user, _table, _column),
m_keycolumn(_keycolumn), m_keyvalue(_keyvalue) {}
GenericDBStorage(StorageUser *user,
const QString &table, const QString &column,
const QString &keycolumn, const QString &keyvalue = QString()) :
SimpleDBStorage(user, table, column),
m_keycolumn(keycolumn), m_keyvalue(keyvalue) {}
virtual ~GenericDBStorage() = default;

void SetKeyValue(const QString &val) { m_keyvalue = val; }
Expand All @@ -100,7 +100,7 @@ class MBASE_PUBLIC TransientStorage : public Storage

void Load(void) override { } // Storage
void Save(void) override { } // Storage
void Save(QString /*destination*/) override { } // Storage
void Save(const QString &/*destination*/) override { } // Storage
};

class MBASE_PUBLIC HostDBStorage : public SimpleDBStorage
Expand Down
3 changes: 0 additions & 3 deletions mythtv/libs/libmythbase/mythsystem.cpp
Expand Up @@ -50,9 +50,6 @@ class MythSystemLegacyWrapper : public MythSystem
if (args.empty())
return nullptr;

QString program = args[0];
QStringList other_args = args.mid(1);

MythSystemLegacy *legacy =
new MythSystemLegacy(args.join(" "), flags);

Expand Down
2 changes: 2 additions & 0 deletions mythtv/libs/libmythbase/portchecker.cpp
Expand Up @@ -101,7 +101,9 @@ bool PortChecker::checkPort(QString &host, int port, int timeLimit, bool linkLoc
return false;
}
QList<QNetworkInterface> cards = QNetworkInterface::allInterfaces();
#ifndef _WIN32
QListIterator<QNetworkInterface> iCard = cards;
#endif
MythTimer timer(MythTimer::kStartRunning);
QTcpSocket socket(this);
QAbstractSocket::SocketState state = QAbstractSocket::UnconnectedState;
Expand Down
5 changes: 4 additions & 1 deletion mythtv/libs/libmythservicecontracts/service.h
Expand Up @@ -71,7 +71,10 @@ class SERVICE_PUBLIC Service : public QObject
//
//////////////////////////////////////////////////////////////////////////////

inline Service::Service(QObject *parent) : QObject(parent) {}
inline Service::Service(QObject *parent) : QObject(parent)
{
qRegisterMetaType< QFileInfo >();
}

//////////////////////////////////////////////////////////////////////////////
//
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/avfringbuffer.h
Expand Up @@ -37,7 +37,7 @@ class AVFRingBuffer

private:
RingBuffer *m_rbuffer {nullptr};
bool m_initState;
bool m_initState {true};
static bool s_avrprotocol_initialised;
static URLProtocol s_avfrURL;
};
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/channelscan/channelscan_sm.cpp
Expand Up @@ -275,7 +275,7 @@ void ChannelScanSM::HandleAllGood(void)
}
else
{
// nothing to do here, XMLTV & DataDirect have better info
// nothing to do here, XMLTV has better info
}

m_scanMonitor->ScanAppendTextToLog(msg);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/channelscan/externrecscanner.h
Expand Up @@ -44,7 +44,7 @@ class ExternRecChannelScanner : public QRunnable
uint m_cardid;
QString m_inputname;
uint m_sourceid;
uint m_channel_total;
uint m_channel_total {0};
uint m_channel_cnt {1};
bool m_thread_running {false};
bool m_stop_now {false};
Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythtv/channelsettings.cpp
Expand Up @@ -177,8 +177,7 @@ class TimeOffset : public MythUISpinBoxSetting
setHelpText(QCoreApplication::translate("(ChannelSettings)",
"Offset (in minutes) to apply to the program guide data during "
"import. This can be used when the listings for a particular "
"channel are in a different time zone. (Works for DataDirect "
"listings only.)"));
"channel are in a different time zone."));
}
};

Expand Down

0 comments on commit 5b3f308

Please sign in to comment.