mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
rbutil: Modernize code to use C++11 nullptr.
Change-Id: I112cf95122a896cdb30a823b4c1f49831273dc7e
This commit is contained in:
parent
f608de723c
commit
12764781c6
58 changed files with 111 additions and 111 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class Autodetection :public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Autodetection(QObject* parent=0);
|
||||
Autodetection(QObject* parent=nullptr);
|
||||
|
||||
enum PlayerStatus {
|
||||
PlayerOk,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void BootloaderThreadBSPatch::run(void)
|
|||
BootloaderInstallBSPatch::BootloaderInstallBSPatch(QObject *parent)
|
||||
: BootloaderInstallBase(parent)
|
||||
{
|
||||
m_thread = NULL;
|
||||
m_thread = nullptr;
|
||||
}
|
||||
|
||||
QString BootloaderInstallBSPatch::ofHint()
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ BootloaderInstallBase* BootloaderInstallHelper::createBootloaderInstaller(QObjec
|
|||
return new BootloaderInstallBSPatch(parent);
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ void BootloaderThreadImx::run(void)
|
|||
BootloaderInstallImx::BootloaderInstallImx(QObject *parent)
|
||||
: BootloaderInstallBase(parent)
|
||||
{
|
||||
m_thread = NULL;
|
||||
m_thread = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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++)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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;}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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\" "
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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\" "
|
||||
|
|
|
|||
|
|
@ -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\"";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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++)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue