summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/autodetection.cpp3
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallipod.cpp14
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallsansa.cpp12
3 files changed, 18 insertions, 11 deletions
diff --git a/rbutil/rbutilqt/base/autodetection.cpp b/rbutil/rbutilqt/base/autodetection.cpp
index ab2b1bd05c..695cb6a204 100644
--- a/rbutil/rbutilqt/base/autodetection.cpp
+++ b/rbutil/rbutilqt/base/autodetection.cpp
@@ -339,13 +339,14 @@ QString Autodetection::resolveMountPoint(QString device)
for(letter = 'A'; letter <= 'Z'; letter++) {
if(resolveDevicename(QString(letter)).toUInt() == driveno) {
result = letter;
+ qDebug() << "[Autodetect] resolved mountpoint is:" << result;
break;
}
}
- qDebug() << "[Autodetect] resolved mountpoint is:" << result;
if(!result.isEmpty())
return result + ":/";
#endif
+ qDebug() << "[Autodetect] resolving mountpoint failed!";
return QString("");
}
diff --git a/rbutil/rbutilqt/base/bootloaderinstallipod.cpp b/rbutil/rbutilqt/base/bootloaderinstallipod.cpp
index 55fd3fcbd8..e784ee9a1f 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallipod.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallipod.cpp
@@ -226,17 +226,19 @@ BootloaderInstallBase::Capabilities BootloaderInstallIpod::capabilities(void)
bool BootloaderInstallIpod::ipodInitialize(struct ipod_t *ipod)
{
if(!m_blfile.isEmpty()) {
+ QString devicename = Autodetection::resolveDevicename(m_blfile);
+ if(devicename.isEmpty()) {
+ emit logItem(tr("Error: could not retrieve device name"), LOGERROR);
+ return false;
+ }
#if defined(Q_OS_WIN32)
- sprintf(ipod->diskname, "\\\\.\\PhysicalDrive%i",
- Autodetection::resolveDevicename(m_blfile).toInt());
+ sprintf(ipod->diskname, "\\\\.\\PhysicalDrive%i", diskname.toInt());
#elif defined(Q_OS_MACX)
sprintf(ipod->diskname, "%s",
- qPrintable(Autodetection::resolveDevicename(m_blfile)
- .remove(QRegExp("s[0-9]+$"))));
+ qPrintable(devicename.remove(QRegExp("s[0-9]+$"))));
#else
sprintf(ipod->diskname, "%s",
- qPrintable(Autodetection::resolveDevicename(m_blfile)
- .remove(QRegExp("[0-9]+$"))));
+ qPrintable(devicename.remove(QRegExp("[0-9]+$"))));
#endif
qDebug() << "[BootloaderInstallIpod] ipodpatcher: overriding scan, using"
<< ipod->diskname;
diff --git a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
index 48bd0053ee..0dc94c553c 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallsansa.cpp
@@ -242,15 +242,19 @@ BootloaderInstallBase::BootloaderType BootloaderInstallSansa::installed(void)
bool BootloaderInstallSansa::sansaInitialize(struct sansa_t *sansa)
{
if(!m_blfile.isEmpty()) {
+ QString devicename = Autodetection::resolveDevicename(m_blfile);
+ if(devicename.isEmpty()) {
+ emit logItem(tr("Error: could not retrieve device name"), LOGERROR);
+ return false;
+ }
#if defined(Q_OS_WIN32)
- sprintf(sansa->diskname, "\\\\.\\PhysicalDrive%i",
- Autodetection::resolveDevicename(m_blfile).toInt());
+ sprintf(sansa->diskname, "\\\\.\\PhysicalDrive%i", devicename.toInt());
#elif defined(Q_OS_MACX)
sprintf(sansa->diskname,
- qPrintable(Autodetection::resolveDevicename(m_blfile).remove(QRegExp("s[0-9]+$"))));
+ qPrintable(devicename.remove(QRegExp("s[0-9]+$"))));
#else
sprintf(sansa->diskname,
- qPrintable(Autodetection::resolveDevicename(m_blfile).remove(QRegExp("[0-9]+$"))));
+ qPrintable(devicename.remove(QRegExp("[0-9]+$"))));
#endif
qDebug() << "[BootloaderInstallSansa] sansapatcher: overriding scan, using"
<< sansa->diskname;