summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-19 20:36:57 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-11-19 21:32:41 +0100
commit12764781c6053898925484dee07e71a52abc4f26 (patch)
tree3f89294c8053770ac4e1e4769bfd28a234554ee6 /rbutil/rbutilqt/base
parentf608de723c863abc0e32cd7584c046eceb910d78 (diff)
downloadrockbox-12764781c6053898925484dee07e71a52abc4f26.tar.gz
rockbox-12764781c6053898925484dee07e71a52abc4f26.tar.bz2
rockbox-12764781c6053898925484dee07e71a52abc4f26.zip
rbutil: Modernize code to use C++11 nullptr.
Change-Id: I112cf95122a896cdb30a823b4c1f49831273dc7e
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/autodetection.cpp2
-rw-r--r--rbutil/rbutilqt/base/autodetection.h2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallams.cpp4
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallbase.cpp2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallbspatch.cpp2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallchinachip.h2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallhelper.cpp2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallhex.cpp8
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallhex.h2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallimx.cpp2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallipod.cpp2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallsansa.cpp4
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallsansa.h2
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstalltcc.cpp8
-rw-r--r--rbutil/rbutilqt/base/encoderexe.h2
-rw-r--r--rbutil/rbutilqt/base/encoderrbspeex.cpp4
-rw-r--r--rbutil/rbutilqt/base/encoderrbspeex.h2
-rw-r--r--rbutil/rbutilqt/base/httpget.h2
-rw-r--r--rbutil/rbutilqt/base/mspackutil.cpp12
-rw-r--r--rbutil/rbutilqt/base/rbsettings.cpp10
-rw-r--r--rbutil/rbutilqt/base/system.cpp8
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp2
-rw-r--r--rbutil/rbutilqt/base/talkfile.cpp2
-rw-r--r--rbutil/rbutilqt/base/ttsbase.cpp2
-rw-r--r--rbutil/rbutilqt/base/ttsespeak.h2
-rw-r--r--rbutil/rbutilqt/base/ttsespeakng.h2
-rw-r--r--rbutil/rbutilqt/base/ttsexes.h2
-rw-r--r--rbutil/rbutilqt/base/ttsfestival.h2
-rw-r--r--rbutil/rbutilqt/base/ttsflite.h2
-rw-r--r--rbutil/rbutilqt/base/ttsmimic.h2
-rw-r--r--rbutil/rbutilqt/base/ttsmssp.h2
-rw-r--r--rbutil/rbutilqt/base/ttssapi.cpp4
-rw-r--r--rbutil/rbutilqt/base/ttssapi.h2
-rw-r--r--rbutil/rbutilqt/base/ttssapi4.h2
-rw-r--r--rbutil/rbutilqt/base/ttsswift.h2
-rw-r--r--rbutil/rbutilqt/base/uninstall.cpp2
-rw-r--r--rbutil/rbutilqt/base/voicefile.cpp6
-rw-r--r--rbutil/rbutilqt/base/zipinstaller.cpp6
-rw-r--r--rbutil/rbutilqt/base/ziputil.cpp4
39 files changed, 66 insertions, 66 deletions
diff --git a/rbutil/rbutilqt/base/autodetection.cpp b/rbutil/rbutilqt/base/autodetection.cpp
index 8c800607c3..00918bf769 100644
--- a/rbutil/rbutilqt/base/autodetection.cpp
+++ b/rbutil/rbutilqt/base/autodetection.cpp
@@ -250,7 +250,7 @@ void Autodetection::mergePatcher(void)
// try ipodpatcher
// initialize sector buffer. Needed.
struct ipod_t ipod;
- ipod.sectorbuf = NULL;
+ ipod.sectorbuf = nullptr;
ipod_alloc_buffer(&ipod, BUFFER_SIZE);
n = ipod_scan(&ipod);
// FIXME: handle more than one Ipod connected in ipodpatcher.
diff --git a/rbutil/rbutilqt/base/autodetection.h b/rbutil/rbutilqt/base/autodetection.h
index f9adf2aa0c..cdbb94d303 100644
--- a/rbutil/rbutilqt/base/autodetection.h
+++ b/rbutil/rbutilqt/base/autodetection.h
@@ -32,7 +32,7 @@ class Autodetection :public QObject
Q_OBJECT
public:
- Autodetection(QObject* parent=0);
+ Autodetection(QObject* parent=nullptr);
enum PlayerStatus {
PlayerOk,
diff --git a/rbutil/rbutilqt/base/bootloaderinstallams.cpp b/rbutil/rbutilqt/base/bootloaderinstallams.cpp
index 3905ae9fd3..524ce99e98 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallams.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallams.cpp
@@ -93,7 +93,7 @@ void BootloaderInstallAms::installStage2(void)
rb_packed = load_rockbox_file(bootfile.toLocal8Bit().data(), &model,
&bootloader_size,&rb_packedsize,
errstr,sizeof(errstr));
- if (rb_packed == NULL)
+ if (rb_packed == nullptr)
{
LOG_ERROR() << "could not load bootloader: " << bootfile;
emit logItem(errstr, LOGERROR);
@@ -106,7 +106,7 @@ void BootloaderInstallAms::installStage2(void)
buf = load_of_file(m_offile.toLocal8Bit().data(), model, &len, &sum,
&firmware_size, &of_packed ,&of_packedsize,
errstr, sizeof(errstr));
- if (buf == NULL)
+ if (buf == nullptr)
{
LOG_ERROR() << "could not load OF: " << m_offile;
emit logItem(errstr, LOGERROR);
diff --git a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
index 5f8fd40d08..efc61f7529 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
@@ -246,7 +246,7 @@ bool BootloaderInstallBase::setOfFile(QString of, QStringList blfile)
delete zu;
// if ZIP failed, try CAB
- if(util == 0)
+ if(util == nullptr)
{
MsPackUtil *msu = new MsPackUtil(this);
if(msu->open(of))
diff --git a/rbutil/rbutilqt/base/bootloaderinstallbspatch.cpp b/rbutil/rbutilqt/base/bootloaderinstallbspatch.cpp
index 8b2ef97cd2..f8eab408fd 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallbspatch.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallbspatch.cpp
@@ -57,7 +57,7 @@ void BootloaderThreadBSPatch::run(void)
BootloaderInstallBSPatch::BootloaderInstallBSPatch(QObject *parent)
: BootloaderInstallBase(parent)
{
- m_thread = NULL;
+ m_thread = nullptr;
}
QString BootloaderInstallBSPatch::ofHint()
diff --git a/rbutil/rbutilqt/base/bootloaderinstallchinachip.h b/rbutil/rbutilqt/base/bootloaderinstallchinachip.h
index d82919a571..e92f292283 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallchinachip.h
+++ b/rbutil/rbutilqt/base/bootloaderinstallchinachip.h
@@ -27,7 +27,7 @@ class BootloaderInstallChinaChip : public BootloaderInstallBase
Q_OBJECT
public:
- BootloaderInstallChinaChip(QObject *parent = 0);
+ BootloaderInstallChinaChip(QObject *parent = nullptr);
bool install(void);
bool uninstall(void);
BootloaderInstallBase::BootloaderType installed(void);
diff --git a/rbutil/rbutilqt/base/bootloaderinstallhelper.cpp b/rbutil/rbutilqt/base/bootloaderinstallhelper.cpp
index ca055bc7e9..c94ed29140 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallhelper.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallhelper.cpp
@@ -73,7 +73,7 @@ BootloaderInstallBase* BootloaderInstallHelper::createBootloaderInstaller(QObjec
return new BootloaderInstallBSPatch(parent);
}
else {
- return NULL;
+ return nullptr;
}
}
diff --git a/rbutil/rbutilqt/base/bootloaderinstallhex.cpp b/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
index 0c8087eaf4..931c7dfa2e 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallhex.cpp
@@ -32,11 +32,11 @@ struct md5s {
struct md5s md5sums[] = {
#include "irivertools/h100sums.h"
- { 0, 0 },
+ { nullptr, nullptr },
#include "irivertools/h120sums.h"
- { 0, 0 },
+ { nullptr, nullptr },
#include "irivertools/h300sums.h"
- { 0, 0 }
+ { nullptr, nullptr }
};
@@ -86,7 +86,7 @@ bool BootloaderInstallHex::install(void)
m_model = 4;
// 3: h300, 2: h120, 1: h100, 0:invalid
while(i--) {
- if(md5sums[i].orig == 0)
+ if(md5sums[i].orig == nullptr)
m_model--;
if(!qstrcmp(md5sums[i].orig, hash.toLatin1()))
break;
diff --git a/rbutil/rbutilqt/base/bootloaderinstallhex.h b/rbutil/rbutilqt/base/bootloaderinstallhex.h
index c971429a10..700d77447a 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallhex.h
+++ b/rbutil/rbutilqt/base/bootloaderinstallhex.h
@@ -31,7 +31,7 @@ class BootloaderInstallHex : public BootloaderInstallBase
Q_OBJECT
public:
- BootloaderInstallHex(QObject *parent = 0);
+ BootloaderInstallHex(QObject *parent = nullptr);
bool install(void);
bool uninstall(void);
BootloaderInstallBase::BootloaderType installed(void);
diff --git a/rbutil/rbutilqt/base/bootloaderinstallimx.cpp b/rbutil/rbutilqt/base/bootloaderinstallimx.cpp
index 547c8d8fc4..581d70270c 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallimx.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallimx.cpp
@@ -63,7 +63,7 @@ void BootloaderThreadImx::run(void)
BootloaderInstallImx::BootloaderInstallImx(QObject *parent)
: BootloaderInstallBase(parent)
{
- m_thread = NULL;
+ m_thread = nullptr;
}
diff --git a/rbutil/rbutilqt/base/bootloaderinstallipod.cpp b/rbutil/rbutilqt/base/bootloaderinstallipod.cpp
index fdee6f5778..3535f9c69c 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallipod.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallipod.cpp
@@ -45,7 +45,7 @@ BootloaderInstallIpod::~BootloaderInstallIpod()
bool BootloaderInstallIpod::install(void)
{
- if(ipod.sectorbuf == NULL) {
+ if(ipod.sectorbuf == nullptr) {
emit logItem(tr("Error: can't allocate buffer memory!"), LOGERROR);
emit done(true);
return false;
diff --git a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
index 5d56fe593a..e4fd3766cb 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
@@ -46,7 +46,7 @@ BootloaderInstallSansa::~BootloaderInstallSansa()
*/
bool BootloaderInstallSansa::install(void)
{
- if(sansa.sectorbuf == NULL) {
+ if(sansa.sectorbuf == nullptr) {
emit logItem(tr("Error: can't allocate buffer memory!"), LOGERROR);
return false;
emit done(true);
@@ -88,7 +88,7 @@ bool BootloaderInstallSansa::install(void)
*/
void BootloaderInstallSansa::installStage2(void)
{
- unsigned char* buf = NULL;
+ unsigned char* buf = nullptr;
unsigned int len;
emit logItem(tr("Installing Rockbox bootloader"), LOGINFO);
diff --git a/rbutil/rbutilqt/base/bootloaderinstallsansa.h b/rbutil/rbutilqt/base/bootloaderinstallsansa.h
index 40dc89ff25..45837f0ac3 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallsansa.h
+++ b/rbutil/rbutilqt/base/bootloaderinstallsansa.h
@@ -30,7 +30,7 @@ class BootloaderInstallSansa : public BootloaderInstallBase
Q_OBJECT
public:
- BootloaderInstallSansa(QObject *parent = 0);
+ BootloaderInstallSansa(QObject *parent = nullptr);
~BootloaderInstallSansa();
bool install(void);
bool uninstall(void);
diff --git a/rbutil/rbutilqt/base/bootloaderinstalltcc.cpp b/rbutil/rbutilqt/base/bootloaderinstalltcc.cpp
index e0bfbe3cf2..1551d7c45d 100644
--- a/rbutil/rbutilqt/base/bootloaderinstalltcc.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstalltcc.cpp
@@ -57,7 +57,7 @@ bool BootloaderInstallTcc::install(void)
void BootloaderInstallTcc::installStage2(void)
{
- unsigned char *of_buf, *boot_buf = NULL, *patched_buf = NULL;
+ unsigned char *of_buf, *boot_buf = nullptr, *patched_buf = nullptr;
int n, of_size, boot_size, patched_size;
char errstr[200];
bool ret = false;
@@ -76,7 +76,7 @@ void BootloaderInstallTcc::installStage2(void)
/* Load original firmware file */
of_buf = file_read(m_offile.toLocal8Bit().data(), &of_size);
- if (of_buf == NULL)
+ if (of_buf == nullptr)
{
emit logItem(errstr, LOGERROR);
emit logItem(tr("Could not load %1").arg(m_offile), LOGERROR);
@@ -93,7 +93,7 @@ void BootloaderInstallTcc::installStage2(void)
/* Load bootloader file */
boot_buf = file_read(bootfile.toLocal8Bit().data(), &boot_size);
- if (boot_buf == NULL)
+ if (boot_buf == nullptr)
{
emit logItem(errstr, LOGERROR);
emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR);
@@ -105,7 +105,7 @@ void BootloaderInstallTcc::installStage2(void)
patched_buf = patch_firmware_tcc(of_buf, of_size, boot_buf, boot_size,
&patched_size);
- if (patched_buf == NULL)
+ if (patched_buf == nullptr)
{
emit logItem(errstr, LOGERROR);
emit logItem(tr("Could not patch firmware"), LOGERROR);
diff --git a/rbutil/rbutilqt/base/encoderexe.h b/rbutil/rbutilqt/base/encoderexe.h
index dd1c57ec67..4008689167 100644
--- a/rbutil/rbutilqt/base/encoderexe.h
+++ b/rbutil/rbutilqt/base/encoderexe.h
@@ -34,7 +34,7 @@ class EncoderExe : public EncoderBase
Q_OBJECT
public:
- EncoderExe(QString name,QObject *parent = NULL);
+ EncoderExe(QString name,QObject *parent = nullptr);
bool encode(QString input,QString output);
bool start();
bool stop() {return true;}
diff --git a/rbutil/rbutilqt/base/encoderrbspeex.cpp b/rbutil/rbutilqt/base/encoderrbspeex.cpp
index 0fc0293685..2bee66028a 100644
--- a/rbutil/rbutilqt/base/encoderrbspeex.cpp
+++ b/rbutil/rbutilqt/base/encoderrbspeex.cpp
@@ -83,11 +83,11 @@ bool EncoderRbSpeex::encode(QString input,QString output)
char errstr[512];
FILE *fin,*fout;
- if ((fin = fopen(input.toLocal8Bit(), "rb")) == NULL) {
+ if ((fin = fopen(input.toLocal8Bit(), "rb")) == nullptr) {
LOG_ERROR() << "Error: could not open input file\n";
return false;
}
- if ((fout = fopen(output.toLocal8Bit(), "wb")) == NULL) {
+ if ((fout = fopen(output.toLocal8Bit(), "wb")) == nullptr) {
LOG_ERROR() << "Error: could not open output file\n";
fclose(fin);
return false;
diff --git a/rbutil/rbutilqt/base/encoderrbspeex.h b/rbutil/rbutilqt/base/encoderrbspeex.h
index b3028b3250..6ad41c38a3 100644
--- a/rbutil/rbutilqt/base/encoderrbspeex.h
+++ b/rbutil/rbutilqt/base/encoderrbspeex.h
@@ -34,7 +34,7 @@ class EncoderRbSpeex : public EncoderBase
Q_OBJECT
public:
- EncoderRbSpeex(QObject *parent = NULL);
+ EncoderRbSpeex(QObject *parent = nullptr);
bool encode(QString input,QString output);
bool start();
bool stop() {return true;}
diff --git a/rbutil/rbutilqt/base/httpget.h b/rbutil/rbutilqt/base/httpget.h
index 7cdddedfbf..dfd7b87c89 100644
--- a/rbutil/rbutilqt/base/httpget.h
+++ b/rbutil/rbutilqt/base/httpget.h
@@ -32,7 +32,7 @@ class HttpGet : public QObject
Q_OBJECT
public:
- HttpGet(QObject *parent = 0);
+ HttpGet(QObject *parent = nullptr);
void getFile(const QUrl &url);
void setProxy(const QUrl &url);
diff --git a/rbutil/rbutilqt/base/mspackutil.cpp b/rbutil/rbutilqt/base/mspackutil.cpp
index 1ee250cd6d..b794272199 100644
--- a/rbutil/rbutilqt/base/mspackutil.cpp
+++ b/rbutil/rbutilqt/base/mspackutil.cpp
@@ -24,8 +24,8 @@
MsPackUtil::MsPackUtil(QObject* parent)
:ArchiveUtil(parent)
{
- m_cabd = mspack_create_cab_decompressor(NULL);
- m_cabinet = NULL;
+ m_cabd = mspack_create_cab_decompressor(nullptr);
+ m_cabinet = nullptr;
if(!m_cabd)
LOG_ERROR() << "CAB decompressor creation failed!";
}
@@ -41,20 +41,20 @@ bool MsPackUtil::open(QString& mspackfile)
{
close();
- if(m_cabd == NULL)
+ if(m_cabd == nullptr)
{
LOG_ERROR() << "No CAB decompressor available: cannot open file!";
return false;
}
m_cabinet = m_cabd->search(m_cabd, QFile::encodeName(mspackfile).constData());
- return m_cabinet != NULL;
+ return m_cabinet != nullptr;
}
bool MsPackUtil::close(void)
{
if(m_cabd && m_cabinet)
m_cabd->close(m_cabd, m_cabinet);
- m_cabinet = NULL;
+ m_cabinet = nullptr;
return true;
}
@@ -76,7 +76,7 @@ bool MsPackUtil::extractArchive(const QString& dest, QString file)
else if(!file.isEmpty())
singleoutfile = dest;
struct mscabd_file *f = m_cabinet->files;
- if(f == NULL)
+ if(f == nullptr)
{
LOG_WARNING() << "CAB doesn't contain file" << file;
return true;
diff --git a/rbutil/rbutilqt/base/rbsettings.cpp b/rbutil/rbutilqt/base/rbsettings.cpp
index 512341b84c..827c0f96fd 100644
--- a/rbutil/rbutilqt/base/rbsettings.cpp
+++ b/rbutil/rbutilqt/base/rbsettings.cpp
@@ -82,11 +82,11 @@ const static struct {
};
//! pointer to setting object to NULL
-QSettings* RbSettings::userSettings = NULL;
+QSettings* RbSettings::userSettings = nullptr;
void RbSettings::ensureRbSettingsExists()
{
- if(userSettings == NULL)
+ if(userSettings == nullptr)
{
// portable installation:
// check for a configuration file in the program folder.
@@ -96,13 +96,13 @@ void RbSettings::ensureRbSettingsExists()
if(config.isFile())
{
userSettings = new QSettings(QCoreApplication::instance()->applicationDirPath()
- + "/RockboxUtility.ini", QSettings::IniFormat, NULL);
+ + "/RockboxUtility.ini", QSettings::IniFormat, nullptr);
LOG_INFO() << "configuration: portable";
}
else
{
userSettings = new QSettings(QSettings::IniFormat,
- QSettings::UserScope, "rockbox.org", "RockboxUtility",NULL);
+ QSettings::UserScope, "rockbox.org", "RockboxUtility",nullptr);
LOG_INFO() << "configuration: system";
}
}
@@ -123,7 +123,7 @@ void RbSettings::sync()
{
char* realuser = getenv("SUDO_UID");
char* realgroup = getenv("SUDO_GID");
- if(realuser != NULL && realgroup != NULL)
+ if(realuser != nullptr && realgroup != nullptr)
{
int realuid = atoi(realuser);
int realgid = atoi(realgroup);
diff --git a/rbutil/rbutilqt/base/system.cpp b/rbutil/rbutilqt/base/system.cpp
index 73f5024fa2..dafab971ec 100644
--- a/rbutil/rbutilqt/base/system.cpp
+++ b/rbutil/rbutilqt/base/system.cpp
@@ -242,18 +242,18 @@ QMultiMap<uint32_t, QString> System::listUsbDevices(void)
LOG_INFO() << "Searching for USB devices";
#if defined(Q_OS_LINUX)
libusb_device **devs;
- if(libusb_init(NULL) != 0) {
+ if(libusb_init(nullptr) != 0) {
LOG_ERROR() << "Initializing libusb-1 failed.";
return usbids;
}
- if(libusb_get_device_list(NULL, &devs) < 1) {
+ if(libusb_get_device_list(nullptr, &devs) < 1) {
LOG_ERROR() << "Error getting device list.";
return usbids;
}
libusb_device *dev;
int i = 0;
- while((dev = devs[i++]) != NULL) {
+ while((dev = devs[i++]) != nullptr) {
QString name;
unsigned char buf[256];
uint32_t id;
@@ -279,7 +279,7 @@ QMultiMap<uint32_t, QString> System::listUsbDevices(void)
}
libusb_free_device_list(devs, 1);
- libusb_exit(NULL);
+ libusb_exit(nullptr);
#endif
#if defined(Q_OS_MACX)
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index f2d47be93d..67b0428ceb 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -200,7 +200,7 @@ QMap<int, QStringList> SystemInfo::usbIdMap(enum MapType type)
int j = ids.size();
while(j--) {
QStringList l;
- int id = ids.at(j).toInt(0, 16);
+ int id = ids.at(j).toInt(nullptr, 16);
if(id == 0) {
continue;
}
diff --git a/rbutil/rbutilqt/base/talkfile.cpp b/rbutil/rbutilqt/base/talkfile.cpp
index b4f05762e9..1b1dd934ed 100644
--- a/rbutil/rbutilqt/base/talkfile.cpp
+++ b/rbutil/rbutilqt/base/talkfile.cpp
@@ -230,7 +230,7 @@ bool TalkFileCreator::copyTalkFiles(QString* errString)
int m_progress = 0;
emit logProgress(m_progress,progressMax);
- QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
+ QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, nullptr);
installlog.beginGroup("talkfiles");
for(int i=0; i < m_talkList.size(); i++)
diff --git a/rbutil/rbutilqt/base/ttsbase.cpp b/rbutil/rbutilqt/base/ttsbase.cpp
index 0254c44e1d..0102d215a6 100644
--- a/rbutil/rbutilqt/base/ttsbase.cpp
+++ b/rbutil/rbutilqt/base/ttsbase.cpp
@@ -69,7 +69,7 @@ void TTSBase::initTTSList()
TTSBase* TTSBase::getTTS(QObject* parent,QString ttsName)
{
- TTSBase* tts = 0;
+ TTSBase* tts = nullptr;
#if defined(Q_OS_WIN)
if(ttsName == "sapi")
tts = new TTSSapi(parent);
diff --git a/rbutil/rbutilqt/base/ttsespeak.h b/rbutil/rbutilqt/base/ttsespeak.h
index 85d126e94f..afe19fbdac 100644
--- a/rbutil/rbutilqt/base/ttsespeak.h
+++ b/rbutil/rbutilqt/base/ttsespeak.h
@@ -28,7 +28,7 @@ class TTSEspeak : public TTSExes
{
Q_OBJECT
public:
- TTSEspeak(QObject* parent=NULL) : TTSExes(parent)
+ TTSEspeak(QObject* parent=nullptr) : TTSExes(parent)
{
m_name = "espeak";
diff --git a/rbutil/rbutilqt/base/ttsespeakng.h b/rbutil/rbutilqt/base/ttsespeakng.h
index 367b70b06c..55aba62e7d 100644
--- a/rbutil/rbutilqt/base/ttsespeakng.h
+++ b/rbutil/rbutilqt/base/ttsespeakng.h
@@ -28,7 +28,7 @@ class TTSEspeakNG : public TTSExes
{
Q_OBJECT
public:
- TTSEspeakNG(QObject* parent=NULL) : TTSExes(parent)
+ TTSEspeakNG(QObject* parent=nullptr) : TTSExes(parent)
{
m_name = "espeak-ng";
diff --git a/rbutil/rbutilqt/base/ttsexes.h b/rbutil/rbutilqt/base/ttsexes.h
index 03252cdc92..5707c827fe 100644
--- a/rbutil/rbutilqt/base/ttsexes.h
+++ b/rbutil/rbutilqt/base/ttsexes.h
@@ -34,7 +34,7 @@ class TTSExes : public TTSBase
Q_OBJECT
public:
- TTSExes(QObject* parent=NULL);
+ TTSExes(QObject* parent=nullptr);
TTSStatus voice(QString text, QString wavfile, QString *errStr);
bool start(QString *errStr);
bool stop() {return true;}
diff --git a/rbutil/rbutilqt/base/ttsfestival.h b/rbutil/rbutilqt/base/ttsfestival.h
index 2772108a23..5f6dc13ab5 100644
--- a/rbutil/rbutilqt/base/ttsfestival.h
+++ b/rbutil/rbutilqt/base/ttsfestival.h
@@ -36,7 +36,7 @@ class TTSFestival : public TTSBase
Q_OBJECT
public:
- TTSFestival(QObject* parent=NULL) : TTSBase(parent) {}
+ TTSFestival(QObject* parent=nullptr) : TTSBase(parent) {}
~TTSFestival();
bool start(QString *errStr);
bool stop();
diff --git a/rbutil/rbutilqt/base/ttsflite.h b/rbutil/rbutilqt/base/ttsflite.h
index 1d9021108e..717c311a34 100644
--- a/rbutil/rbutilqt/base/ttsflite.h
+++ b/rbutil/rbutilqt/base/ttsflite.h
@@ -28,7 +28,7 @@ class TTSFlite : public TTSExes
{
Q_OBJECT
public:
- TTSFlite(QObject* parent=NULL) : TTSExes(parent)
+ TTSFlite(QObject* parent=nullptr) : TTSExes(parent)
{
m_name = "flite";
diff --git a/rbutil/rbutilqt/base/ttsmimic.h b/rbutil/rbutilqt/base/ttsmimic.h
index fba4e53fe2..f4d7a8beac 100644
--- a/rbutil/rbutilqt/base/ttsmimic.h
+++ b/rbutil/rbutilqt/base/ttsmimic.h
@@ -28,7 +28,7 @@ class TTSMimic : public TTSExes
{
Q_OBJECT
public:
- TTSMimic(QObject* parent=NULL) : TTSExes(parent)
+ TTSMimic(QObject* parent=nullptr) : TTSExes(parent)
{
m_name = "mimic";
diff --git a/rbutil/rbutilqt/base/ttsmssp.h b/rbutil/rbutilqt/base/ttsmssp.h
index 6727ed5d37..817b9fde58 100644
--- a/rbutil/rbutilqt/base/ttsmssp.h
+++ b/rbutil/rbutilqt/base/ttsmssp.h
@@ -28,7 +28,7 @@ class TTSMssp: public TTSSapi
{
Q_OBJECT
public:
- TTSMssp(QObject* parent=NULL) : TTSSapi(parent)
+ TTSMssp(QObject* parent=nullptr) : TTSSapi(parent)
{
m_TTSTemplate = "cscript //nologo \"%exe\" "
"/language:%lang /voice:\"%voice\" "
diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp
index 75d83e7d21..f754f1a19b 100644
--- a/rbutil/rbutilqt/base/ttssapi.cpp
+++ b/rbutil/rbutilqt/base/ttssapi.cpp
@@ -124,7 +124,7 @@ bool TTSSapi::start(QString *errStr)
execstring.replace("%speed",m_TTSSpeed);
LOG_INFO() << "Start:" << execstring;
- voicescript = new QProcess(NULL);
+ voicescript = new QProcess(nullptr);
//connect(voicescript,SIGNAL(readyReadStandardError()),this,SLOT(error()));
voicescript->start(execstring);
LOG_INFO() << "wait for process";
@@ -190,7 +190,7 @@ QStringList TTSSapi::getVoiceList(QString language)
execstring.replace("%lang",language);
LOG_INFO() << "Start:" << execstring;
- voicescript = new QProcess(NULL);
+ voicescript = new QProcess(nullptr);
voicescript->start(execstring);
LOG_INFO() << "wait for process";
if(!voicescript->waitForStarted()) {
diff --git a/rbutil/rbutilqt/base/ttssapi.h b/rbutil/rbutilqt/base/ttssapi.h
index f645774852..25d7d3dab7 100644
--- a/rbutil/rbutilqt/base/ttssapi.h
+++ b/rbutil/rbutilqt/base/ttssapi.h
@@ -36,7 +36,7 @@ class TTSSapi : public TTSBase
Q_OBJECT
public:
- TTSSapi(QObject* parent=NULL);
+ TTSSapi(QObject* parent=nullptr);
TTSStatus voice(QString text,QString wavfile, QString *errStr);
bool start(QString *errStr);
diff --git a/rbutil/rbutilqt/base/ttssapi4.h b/rbutil/rbutilqt/base/ttssapi4.h
index 7964cbfd2b..d6408eaa2c 100644
--- a/rbutil/rbutilqt/base/ttssapi4.h
+++ b/rbutil/rbutilqt/base/ttssapi4.h
@@ -28,7 +28,7 @@ class TTSSapi4: public TTSSapi
{
Q_OBJECT
public:
- TTSSapi4(QObject* parent=NULL) : TTSSapi(parent)
+ TTSSapi4(QObject* parent=nullptr) : TTSSapi(parent)
{
m_TTSTemplate = "cscript //nologo \"%exe\" "
"/language:%lang /voice:\"%voice\" "
diff --git a/rbutil/rbutilqt/base/ttsswift.h b/rbutil/rbutilqt/base/ttsswift.h
index 9d678a6d92..adbc674d78 100644
--- a/rbutil/rbutilqt/base/ttsswift.h
+++ b/rbutil/rbutilqt/base/ttsswift.h
@@ -28,7 +28,7 @@ class TTSSwift : public TTSExes
{
Q_OBJECT
public:
- TTSSwift(QObject* parent=NULL) : TTSExes(parent)
+ TTSSwift(QObject* parent=nullptr) : TTSExes(parent)
{
m_name = "swift";
m_TTSTemplate = "\"%exe\" %options -o \"%wavfile\" -- \"%text\"";
diff --git a/rbutil/rbutilqt/base/uninstall.cpp b/rbutil/rbutilqt/base/uninstall.cpp
index 4b90bc6b77..5ab670a031 100644
--- a/rbutil/rbutilqt/base/uninstall.cpp
+++ b/rbutil/rbutilqt/base/uninstall.cpp
@@ -112,7 +112,7 @@ void Uninstaller::uninstall(void)
QStringList Uninstaller::getAllSections()
{
- QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
+ QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, nullptr);
QStringList allSections = installlog.childGroups();
allSections.removeAt(allSections.lastIndexOf("Bootloader"));
return allSections;
diff --git a/rbutil/rbutilqt/base/voicefile.cpp b/rbutil/rbutilqt/base/voicefile.cpp
index ec9ecbed33..c4edac64b9 100644
--- a/rbutil/rbutilqt/base/voicefile.cpp
+++ b/rbutil/rbutilqt/base/voicefile.cpp
@@ -300,7 +300,7 @@ void VoiceFileCreator::create(void)
//make voicefile
emit logItem(tr("Creating voicefiles..."),LOGINFO);
FILE* ids2 = fopen(m_filename.toLocal8Bit(), "r");
- if (ids2 == NULL)
+ if (ids2 == nullptr)
{
cleanup();
emit logItem(tr("Error opening downloaded file"),LOGERROR);
@@ -310,7 +310,7 @@ void VoiceFileCreator::create(void)
FILE* output = fopen(QString(m_mountpoint + "/.rockbox/langs/" + m_lang
+ ".voice").toLocal8Bit(), "wb");
- if (output == NULL)
+ if (output == nullptr)
{
cleanup();
fclose(ids2);
@@ -327,7 +327,7 @@ void VoiceFileCreator::create(void)
cleanup();
// Add Voice file to the install log
- QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
+ QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, nullptr);
installlog.beginGroup(QString("Voice (self created, %1)").arg(m_lang));
installlog.setValue("/.rockbox/langs/" + m_lang + ".voice", m_versionstring);
installlog.endGroup();
diff --git a/rbutil/rbutilqt/base/zipinstaller.cpp b/rbutil/rbutilqt/base/zipinstaller.cpp
index 4bce1e5a25..3376169911 100644
--- a/rbutil/rbutilqt/base/zipinstaller.cpp
+++ b/rbutil/rbutilqt/base/zipinstaller.cpp
@@ -24,7 +24,7 @@
ZipInstaller::ZipInstaller(QObject* parent) :
QObject(parent),
- m_unzip(true), m_usecache(false), m_getter(0)
+ m_unzip(true), m_usecache(false), m_getter(nullptr)
{
}
@@ -87,7 +87,7 @@ void ZipInstaller::installStart()
m_file = m_downloadFile->fileName();
m_downloadFile->close();
// get the real file.
- if(m_getter != 0) m_getter->deleteLater();
+ if(m_getter != nullptr) m_getter->deleteLater();
m_getter = new HttpGet(this);
if(m_usecache) {
m_getter->setCache(true);
@@ -188,7 +188,7 @@ void ZipInstaller::downloadDone(bool error)
}
emit logItem(tr("Creating installation log"),LOGINFO);
- QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, 0);
+ QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, nullptr);
installlog.beginGroup(m_logsection);
for(int i = 0; i < zipContents.size(); i++)
diff --git a/rbutil/rbutilqt/base/ziputil.cpp b/rbutil/rbutilqt/base/ziputil.cpp
index b6cfdddce2..45119f7d99 100644
--- a/rbutil/rbutilqt/base/ziputil.cpp
+++ b/rbutil/rbutilqt/base/ziputil.cpp
@@ -29,7 +29,7 @@
ZipUtil::ZipUtil(QObject* parent) : ArchiveUtil(parent)
{
- m_zip = NULL;
+ m_zip = nullptr;
}
@@ -65,7 +65,7 @@ bool ZipUtil::close(void)
error = m_zip->getZipError();
}
delete m_zip;
- m_zip = NULL;
+ m_zip = nullptr;
return (error == UNZ_OK) ? true : false;
}