From 2509def164ee7f4aecbe6a786df57140f19e35f2 Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 14 Nov 2020 16:23:56 +0100 Subject: rbutil: Rework player configuration. - Split internal configuration into player specific and common parts. Always require passing the player for player specific data instead of implicitly assuming the currently selected one; only use the currently selected one if the player name is explicitly passed as empty. - Similarly adjust handling of server info data; prepare for splitting into build type specific values so the naming becomes cleaner. Change-Id: I894e694f83bd9fe2d22ad46b3f8f7df3e2c68033 --- rbutil/rbutilqt/configure.cpp | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'rbutil/rbutilqt/configure.cpp') diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp index 5b81027eb8..182001e3b8 100644 --- a/rbutil/rbutilqt/configure.cpp +++ b/rbutil/rbutilqt/configure.cpp @@ -355,8 +355,8 @@ void Config::setDevices() QMultiMap manuf; for(int it = 0; it < platformList.size(); it++) { - QString curbrand = SystemInfo::platformValue(platformList.at(it), - SystemInfo::CurBrand).toString(); + QString curbrand = SystemInfo::platformValue( + SystemInfo::CurBrand, platformList.at(it)).toString(); manuf.insert(curbrand, platformList.at(it)); } @@ -384,10 +384,10 @@ void Config::setDevices() if(!manuf.values(brands.at(c)).contains(platformList.at(it))) continue; // construct display name - QString curname = SystemInfo::platformValue(platformList.at(it), - SystemInfo::CurName).toString() + - " (" +ServerInfo::platformValue(platformList.at(it), - ServerInfo::CurStatus).toString() +")"; + QString curname = SystemInfo::platformValue( + SystemInfo::CurName, platformList.at(it)).toString() + + " (" +ServerInfo::platformValue( + ServerInfo::CurStatus, platformList.at(it)).toString() +")"; LOG_INFO() << "add supported device:" << brands.at(c) << curname; w2 = new QTreeWidgetItem(w, QStringList(curname)); w2->setData(0, Qt::UserRole, platformList.at(it)); @@ -471,10 +471,10 @@ void Config::updateEncState() return; QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString(); - QString encoder = SystemInfo::platformValue(devname, - SystemInfo::CurEncoder).toString(); - ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(devname, - SystemInfo::CurEncoder).toString())); + QString encoder = SystemInfo::platformValue( + SystemInfo::CurEncoder, devname).toString(); + ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue( + SystemInfo::CurEncoder, devname).toString())); EncoderBase* enc = EncoderBase::getEncoder(this,encoder); @@ -742,8 +742,8 @@ void Config::autodetect() mp = tr("(unknown)"); } msg += QString("
  • %1
  • ").arg(tr("%1 at %2").arg( - SystemInfo::platformValue(detected.at(i).device, - SystemInfo::CurPlatformName).toString(), + SystemInfo::platformValue( + SystemInfo::CurPlatformName, detected.at(i).device).toString(), QDir::toNativeSeparators(mp))); } msg += ""; @@ -768,22 +768,22 @@ void Config::autodetect() case Autodetection::PlayerIncompatible: msg += tr("Detected an unsupported player:\n%1\n" "Sorry, Rockbox doesn't run on your player.") - .arg(SystemInfo::platformValue(detected.at(0).device, - SystemInfo::CurName).toString()); + .arg(SystemInfo::platformValue( + SystemInfo::CurName, detected.at(0).device).toString()); break; case Autodetection::PlayerMtpMode: msg = tr("%1 in MTP mode found!\n" "You need to change your player to MSC mode for installation. ") - .arg(SystemInfo::platformValue(detected.at(0).device, - SystemInfo::CurName).toString()); + .arg(SystemInfo::platformValue( + SystemInfo::CurName, detected.at(0).device).toString()); break; case Autodetection::PlayerWrongFilesystem: - if(SystemInfo::platformValue(detected.at(0).device, - SystemInfo::CurBootloaderMethod) == "ipod") { + if(SystemInfo::platformValue( + SystemInfo::CurBootloaderMethod, detected.at(0).device) == "ipod") { msg = tr("%1 \"MacPod\" found!\n" "Rockbox needs a FAT formatted Ipod (so-called \"WinPod\") " "to run. ").arg(SystemInfo::platformValue( - detected.at(0).device, SystemInfo::CurName).toString()); + SystemInfo::CurName, detected.at(0).device).toString()); } else { msg = tr("The player contains an incompatible filesystem.\n" @@ -962,10 +962,10 @@ void Config::configEnc() return; QString devname = ui.treeDevices->selectedItems().at(0)->data(0, Qt::UserRole).toString(); - QString encoder = SystemInfo::platformValue(devname, - SystemInfo::CurEncoder).toString(); - ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue(devname, - SystemInfo::CurEncoder).toString())); + QString encoder = SystemInfo::platformValue( + SystemInfo::CurEncoder, devname).toString(); + ui.encoderName->setText(EncoderBase::getEncoderName(SystemInfo::platformValue( + SystemInfo::CurEncoder, devname).toString())); EncoderBase* enc = EncoderBase::getEncoder(this,encoder); -- cgit v1.2.3