Commit a956b390 authored by Yuri Chornoivan's avatar Yuri Chornoivan

Fix minor EBN issues and typo

parent 15acf047
......@@ -99,7 +99,7 @@ MainDialog::MainDialog(QWidget *parent) :
{
if (newImageFile.left(7) == "file://")
newImageFile = QUrl(newImageFile).toLocalFile();
if (newImageFile != "")
if (!newImageFile.isEmpty())
{
newImageFile = QDir(newImageFile).absolutePath();
// Update the default open dir
......@@ -232,7 +232,7 @@ void MainDialog::dropEvent(QDropEvent* event)
}
}
}
if (newImageFile != "")
if (!newImageFile.isEmpty())
{
// If something was really received update the information
preprocessImageFile(newImageFile);
......@@ -267,7 +267,7 @@ void MainDialog::openImageFile()
QString newImageFile = QFileDialog::getOpenFileName(this, "", m_LastOpenedDir,
i18n("Disk Images (%1)", QString("*.iso *.bin *.img")) + ";;" + i18n("All Files (%1)", QString("(*)")),
NULL, QFileDialog::ReadOnly);
if (newImageFile != "")
if (!newImageFile.isEmpty())
{
m_LastOpenedDir = newImageFile.left(newImageFile.lastIndexOf('/'));
preprocessImageFile(newImageFile);
......@@ -310,7 +310,7 @@ void MainDialog::enumFlashDevices()
platformEnumFlashDevices(addFlashDeviceCallback, ui);
// Restore the previously selected device (if present)
if (selectedDevice != "")
if (!selectedDevice.isEmpty())
for (int i = 0; i < ui->deviceList->count(); ++i)
{
UsbDevice* dev = ui->deviceList->itemData(i).value<UsbDevice*>();
......@@ -411,7 +411,7 @@ IsoResult MainDialog::verifyISO() {
void MainDialog::writeToDeviceKAuth(bool zeroing)
{
qCDebug(ISOIMAGEWRITER_LOG) << "writeToDeviceKAuth()";
if ((ui->deviceList->count() == 0) || (!zeroing && (m_ImageFile == "")))
if ((ui->deviceList->count() == 0) || (!zeroing && (m_ImageFile.isEmpty())))
return;
UsbDevice* selectedDevice = ui->deviceList->itemData(ui->deviceList->currentIndex()).value<UsbDevice*>();
if (!zeroing && (m_ImageSize > selectedDevice->m_Size))
......@@ -458,8 +458,8 @@ void MainDialog::writeToDeviceKAuth(bool zeroing)
action.setArguments(helperargs);
action.setTimeout(3600000); // an hour
m_job = action.execute();
connect(m_job, SIGNAL(percent(KJob*, unsigned long)), this, SLOT(progressStep(KJob*, unsigned long)), Qt::DirectConnection);
connect(m_job, SIGNAL(newData(const QVariantMap &)), this, SLOT(progressStep(const QVariantMap &)));
connect(m_job, SIGNAL(percent(KJob*,ulong)), this, SLOT(progressStep(KJob*,ulong)), Qt::DirectConnection);
connect(m_job, SIGNAL(newData(QVariantMap)), this, SLOT(progressStep(QVariantMap)));
connect(m_job, SIGNAL(statusChanged(KAuth::Action::AuthStatus)), this, SLOT(statusChanged(KAuth::Action::AuthStatus)));
connect(m_job, SIGNAL(result(KJob*)), this, SLOT(finished(KJob*)));
qCDebug(ISOIMAGEWRITER_LOG) << "runWriteImage start()";
......
......@@ -193,7 +193,7 @@ bool platformEnumFlashDevices(AddFlashDeviceCallbackProc callback, void* cbParam
SAFE_RELEASE(pPartitionObject);
// If DeviceID was fetched proceed to the logical disks
if (qstrQueryLetters != "")
if (!qstrQueryLetters.isEmpty())
{
// Construct the request for listing the logical disks related to the current partition
qstrQueryLetters = "ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" + qstrQueryLetters + "'} WHERE AssocClass = Win32_LogicalDiskToPartition";
......
......@@ -90,8 +90,8 @@ void Testy::runAsync() {
helperargs[QStringLiteral("filename")] = "bar";
action.setArguments(helperargs);
KAuth::ExecuteJob *job = action.execute();
connect(job, SIGNAL(percent(KJob*, unsigned long)), this, SLOT(progressStep(KJob*, unsigned long)));
connect(job, SIGNAL(newData(const QVariantMap &)), this, SLOT(progressStep(const QVariantMap &)));
connect(job, SIGNAL(percent(KJob*,ulong)), this, SLOT(progressStep(KJob*,ulong)));
connect(job, SIGNAL(newData(QVariantMap)), this, SLOT(progressStep(QVariantMap)));
connect(job, SIGNAL(statusChanged(KAuth::Action::AuthStatus)), this, SLOT(statusChanged(KAuth::Action::AuthStatus)));
connect(job, SIGNAL(result(KJob*)), this, SLOT(finished(KJob*)));
job->start();
......@@ -155,7 +155,7 @@ void Testy::enumFlashDevices()
platformEnumFlashDevices(addFlashDeviceCallback, this);
// Restore the previously selected device (if present)
if (selectedDevice != "")
if (!selectedDevice.isEmpty())
for (int i = 0; i < m_deviceList->count(); ++i)
{
UsbDevice* dev = m_deviceList->itemData(i).value<UsbDevice*>();
......@@ -186,8 +186,8 @@ void Testy::runWriteImage() {
action.setArguments(helperargs);
KAuth::ExecuteJob *job = action.execute();
connect(job, SIGNAL(percent(KJob*, unsigned long)), this, SLOT(progressStep(KJob*, unsigned long)));
connect(job, SIGNAL(newData(const QVariantMap &)), this, SLOT(progressStep(const QVariantMap &)));
connect(job, SIGNAL(percent(KJob*,ulong)), this, SLOT(progressStep(KJob*,ulong)));
connect(job, SIGNAL(newData(QVariantMap)), this, SLOT(progressStep(QVariantMap)));
connect(job, SIGNAL(statusChanged(KAuth::Action::AuthStatus)), this, SLOT(statusChanged(KAuth::Action::AuthStatus)));
connect(job, SIGNAL(result(KJob*)), this, SLOT(finished(KJob*)));
job->start();
......
......@@ -62,7 +62,7 @@ bool UsbDeviceMonitor::nativeEventFilter(const QByteArray& eventType, void* mess
if ((msg->message == WM_DEVICECHANGE) &&
((msg->wParam == DBT_DEVICEARRIVAL) || (msg->wParam == DBT_DEVICEREMOVECOMPLETE)))
{
// If the event was caused by adding or remiving a device, mark the WinAPI message as processed
// If the event was caused by adding or removing a device, mark the WinAPI message as processed
// and emit the notification signal
*result = TRUE;
emit deviceChanged();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment