Git commit c6884971c2b63e82a245c88cd9cb0ebd23fd09e9 by Konstantinos Smanis. Committed on 22/10/2013 at 17:32. Pushed by ksmanis into branch 'master'. Drop GRUB device probing. Wasn't used for a loong time, even I can't remember why I introduced it. git log is always there if we ever need it again. M +0 -19 src/helper/helper.cpp M +0 -1 src/helper/helper.h M +0 -71 src/helper/kcmgrub2.actions M +0 -71 src/kcm_grub2.cpp M +0 -5 src/kcm_grub2.h http://commits.kde.org/kcm-grub2/c6884971c2b63e82a245c88cd9cb0ebd23fd09e9 diff --git a/src/helper/helper.cpp b/src/helper/helper.cpp index f9397bb..5164db2 100644 --- a/src/helper/helper.cpp +++ b/src/helper/helper.cpp @@ -152,25 +152,6 @@ ActionReply Helper::load(QVariantMap args) reply.addData("rawFileContents", file.readAll()); return reply; } -ActionReply Helper::probe(QVariantMap args) -{ - ActionReply reply; - QStringList mountPoints =3D args.value("mountPoints").toStringList(); - - QStringList grubPartitions; - HelperSupport::progressStep(0); - for (int i =3D 0; i < mountPoints.size(); i++) { - ActionReply grub_probeReply =3D executeCommand(QStringList() << GR= UB_PROBE_EXE << "-t" << "drive" << mountPoints.at(i)); - if (grub_probeReply.failed()) { - return grub_probeReply; - } - grubPartitions.append(grub_probeReply.data().value("output").toStr= ing().trimmed()); - HelperSupport::progressStep((i + 1) * 100. / mountPoints.size()); - } - - reply.addData("grubPartitions", grubPartitions); - return reply; -} ActionReply Helper::probevbe(QVariantMap args) { Q_UNUSED(args) diff --git a/src/helper/helper.h b/src/helper/helper.h index 782d382..2ede191 100644 --- a/src/helper/helper.h +++ b/src/helper/helper.h @@ -33,7 +33,6 @@ public Q_SLOTS: ActionReply defaults(QVariantMap args); ActionReply install(QVariantMap args); ActionReply load(QVariantMap args); - ActionReply probe(QVariantMap args); ActionReply probevbe(QVariantMap args); ActionReply save(QVariantMap args); }; diff --git a/src/helper/kcmgrub2.actions b/src/helper/kcmgrub2.actions index eaa7a1c..839e524 100644 --- a/src/helper/kcmgrub2.actions +++ b/src/helper/kcmgrub2.actions @@ -259,77 +259,6 @@ Description[zh_TW]=3D=E8=BC=89=E5=85=A5 GRUB2 =E9=96= =8B=E6=A9=9F=E8=BC=89=E5=85=A5=E5=99=A8=E8=A8=AD=E5=AE=9A=E9=9C=80=E8=A6=81= =E7=AE=A1=E7=90=86=E8=80=85=E6=AC=8A=E9=99=90 Policy=3Dauth_admin Persistence=3Dsession = -[org.kde.kcontrol.kcmgrub2.probe] -Name=3DProbe devices for their GRUB2 names -Name[bs]=3DTestiranje ure=C4=91aja za njihova GRUB2 imena -Name[ca]=3DProva els dispositius pels seus noms a Grub2 -Name[ca@valencia]=3DProva els dispositius pels seus noms a Grub2 -Name[cs]=3DProzkoumat za=C5=99=C3=ADzen=C3=AD pro jejich GRUB2 n=C3=A1zvy -Name[da]=3DS=C3=B8g efter enheders GRUB2-navne -Name[de]=3DGer=C3=A4te auf ihre GRUB2-Namen abfragen. -Name[el]=3D=CE=88=CE=BB=CE=B5=CE=B3=CF=87=CE=BF=CF=82 =CF=83=CF=85=CF=83= =CE=BA=CE=B5=CF=85=CF=8E=CE=BD =CE=B1=CE=BD =CE=AD=CF=87=CE=BF=CF=85=CE=BD = =CE=BF=CE=BD=CF=8C=CE=BC=CE=B1=CF=84=CE=B1 GRUB2 -Name[es]=3DExaminar los nombres de los dispositivos en GRUB2 -Name[et]=3DSeadmete kontrollimine GRUB2 nimede osas -Name[fi]=3DTunnustele laitteet niiden GRUB2-nimien selvitt=C3=A4miseksi -Name[fr]=3DInterroger les p=C3=A9riph=C3=A9riques pour trouver leurs noms = GRUB2 -Name[gl]=3DProbar os dispositivos polo seu nome en GRUB2 -Name[hu]=3DEszk=C3=B6z=C3=B6k vizsg=C3=A1lata a GRUB2 n=C3=A9v meghat=C3= =A1roz=C3=A1s=C3=A1hoz -Name[it]=3DSonda i dispositivi per trovarne i loro nomi in GRUB2 -Name[lt]=3DTikrini =C4=AFrenginius d=C4=97l GRUB2 vard=C5=B3 -Name[mr]=3D=E0=A4=B8=E0=A4=BE=E0=A4=A7=E0=A4=A8=E0=A4=BE=E0=A4=82=E0=A4=9A= =E0=A5=8D=E0=A4=AF=E0=A4=BE GRUB2 =E0=A4=A8=E0=A4=BE=E0=A4=B5=E0=A4=BE=E0= =A4=95=E0=A4=B0=E0=A4=BF=E0=A4=A4=E0=A4=BE =E0=A4=B8=E0=A4=BE=E0=A4=A7=E0= =A4=A8=E0=A5=87 =E0=A4=B6=E0=A5=8B=E0=A4=A7=E0=A4=BE -Name[nb]=3DUnders=C3=B8k enheter for =C3=A5 finne deres GRUB2-navn -Name[nds]=3DDe Reedschappen ehr Grub2-Naams opdecken -Name[nl]=3DApparaten aftasten voor hun GRUB2 namen -Name[pa]=3D=E0=A8=9C=E0=A9=B0=E0=A8=A4=E0=A8=B0 =E0=A8=A8=E0=A9=82=E0=A9= =B0 =E0=A8=89=E0=A8=B9=E0=A8=A8=E0=A8=BE=E0=A8=82 =E0=A8=A6=E0=A9=87 =E0=A8= =97=E0=A8=B0=E0=A8=AC2 =E0=A8=A8=E0=A8=BE=E0=A8=82 =E0=A8=B2=E0=A8=88 =E0= =A8=AA=E0=A9=9C=E0=A8=A4=E0=A8=BE=E0=A8=B2 =E0=A8=95=E0=A8=B0=E0=A9=8B -Name[pl]=3DWykryj nazwy urz=C4=85dze=C5=84 dla GRUB2 -Name[pt]=3DDetectar os nomes dos dispositivos no GRUB2 -Name[pt_BR]=3DDetectar os nomes dos dispositivos no GRUB2 -Name[ro]=3DSondeaz=C4=83 dispozitivele pentru denumirile lor GRUB2 -Name[ru]=3D=D0=9E=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8=D0= =B5 =D0=B8=D0=BC=D1=91=D0=BD =D1=83=D1=81=D1=82=D1=80=D0=BE=D0=B9=D1=81=D1= =82=D0=B2, =D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5=D0=BC=D1= =8B=D1=85 =D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D1=87=D0=B8=D0=BA=D0=BE=D0= =BC GRUB2 -Name[sk]=3DVysk=C3=BA=C5=A1a=C5=A5 zariadenia pre ich n=C3=A1zvy v GRUB2 -Name[sl]=3DPreizkusi naprave za njihova imena GRUB2 -Name[sv]=3DS=C3=B6k igenom enheter efter deras GRUB2-namn -Name[tr]=3DAyg=C4=B1tlar=C4=B1 GRUB2 isimleri i=C3=A7in ara=C5=9Ft=C4=B1r -Name[uk]=3D=D0=92=D0=B8=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD=D0=BD=D1=8F = =D0=BD=D0=B0=D0=B7=D0=B2 =D0=BF=D1=80=D0=B8=D1=81=D1=82=D1=80=D0=BE=D1=97= =D0=B2 GRUB2 -Name[x-test]=3DxxProbe devices for their GRUB2 namesxx -Name[zh_CN]=3D=E6=8E=A2=E6=B5=8B=E8=AE=BE=E5=A4=87=E7=9A=84 GRUB2 =E5=90= =8D=E5=AD=97 -Name[zh_TW]=3D=E5=81=B5=E6=B8=AC=E8=A3=9D=E7=BD=AE=E5=9C=A8 GRUB2 =E4=B8= =8A=E7=9A=84=E5=90=8D=E7=A8=B1 -Description=3DAdministrator authorization is required to probe devices for= their GRUB2 names -Description[bs]=3DAdministratorska potvrda je potrebna za upit ure=C4=91aj= a za njihova GRUB2 imena -Description[ca]=3DEs requereix autoritzaci=C3=B3 de l'administrador per a = provar els dispositius pels seus noms a Grub2 -Description[ca@valencia]=3DEs requereix autoritzaci=C3=B3 de l'administrad= or per a provar els dispositius pels seus noms a Grub2 -Description[cs]=3DPro prozkoum=C3=A1n=C3=AD GRUB2 n=C3=A1zv=C5=AF za=C5=99= =C3=ADzen=C3=AD je pot=C5=99eba opr=C3=A1vn=C4=9Bn=C3=AD administr=C3=A1tora -Description[da]=3DAdministrator-godkendelse kr=C3=A6ves for at s=C3=B8ge e= fter enheders GRUB2-navne -Description[de]=3DZur Abfrage der Ger=C3=A4te nach ihren GRUB2-Namen sind = Systemverwalterrechte erforderlich. -Description[el]=3D=CE=91=CF=80=CE=B1=CE=B9=CF=84=CE=B5=CE=AF=CF=84=CE=B1= =CE=B9 =CE=B5=CE=BE=CE=BF=CF=85=CF=83=CE=B9=CE=BF=CE=B4=CF=8C=CF=84=CE=B7= =CF=83=CE=B7 =CE=B4=CE=B9=CE=B1=CF=87=CE=B5=CE=B9=CF=81=CE=B9=CF=83=CF=84= =CE=AE =CE=B3=CE=B9=CE=B1 =CF=84=CE=BF=CE=BD =CE=AD=CE=BB=CE=B5=CE=B3=CF=87= =CE=BF =CF=83=CF=85=CF=83=CE=BA=CE=B5=CF=85=CF=8E=CE=BD =CE=B3=CE=B9=CE=B1 = =CE=BF=CE=BD=CF=8C=CE=BC=CE=B1=CF=84=CE=B1 GRUB2 -Description[es]=3DSe requiere la autorizaci=C3=B3n del administrador para = examinar los nombres de los dispositivos en GRUB2 -Description[et]=3DSeadmete kontrollimiseks GRUB2 nimede osas on vajalik au= tentimine administraatorina -Description[fi]=3DLaitteiden tunnusteleminen niiden GRUB2-nimien selvitt= =C3=A4miseksi vaatii p=C3=A4=C3=A4k=C3=A4ytt=C3=A4j=C3=A4n oikeudet -Description[fr]=3DL'autorisation de l'administrateur est requise pour inte= rroger les p=C3=A9riph=C3=A9riques pour trouver leurs noms GRUB2 -Description[gl]=3DPrec=C3=ADsase a autorizaci=C3=B3n do administrador para= probar os dispositivos polo seu nome en GRUB2 -Description[hu]=3DRendszergazdai jogosults=C3=A1gok sz=C3=BCks=C3=A9gesek = az eszk=C3=B6z=C3=B6k GRUB2 nev=C3=A9nek meghat=C3=A1roz=C3=A1s=C3=A1hoz -Description[it]=3DSono i richiesti i privilegi amministrativi per sondare = i dispositivi e trovarne i nomi in GRUB2 -Description[lt]=3DAdministratoriaus =C4=AFgaliojimas reikalingas, kad pati= krinti =C4=AFrengini=C5=B3 GRUB2 vardus -Description[mr]=3D=E0=A4=B8=E0=A4=BE=E0=A4=A7=E0=A4=A8=E0=A4=BE=E0=A4=82= =E0=A4=9A=E0=A5=8D=E0=A4=AF=E0=A4=BE GRUB2 =E0=A4=A8=E0=A4=BE=E0=A4=B5=E0= =A4=BE=E0=A4=95=E0=A4=B0=E0=A4=BF=E0=A4=A4=E0=A4=BE =E0=A4=B8=E0=A4=BE=E0= =A4=A7=E0=A4=A8=E0=A5=87 =E0=A4=B6=E0=A5=8B=E0=A4=A7=E0=A4=A3=E0=A5=8D=E0= =A4=AF=E0=A4=BE=E0=A4=95=E0=A4=B0=E0=A4=BF=E0=A4=A4=E0=A4=BE =E0=A4=B5=E0= =A5=8D=E0=A4=AF=E0=A4=B5=E0=A4=B8=E0=A5=8D=E0=A4=A5=E0=A4=BE=E0=A4=AA=E0=A4= =95=E0=A4=BE=E0=A4=9A=E0=A5=80 =E0=A4=AA=E0=A4=B0=E0=A4=B5=E0=A4=BE=E0=A4= =A8=E0=A4=97=E0=A5=80 =E0=A4=86=E0=A4=B5=E0=A4=B6=E0=A5=8D=E0=A4=AF=E0=A4= =95 =E0=A4=86=E0=A4=B9=E0=A5=87 -Description[nb]=3DDet kreves autorisasjon som administrator for =C3=A5 s= =C3=B8ke etter enheters GRUB2-navn -Description[nds]=3DDe Reedschappen ehr Grub2-Naams laat sik bloots mit Sys= teempleger-Verl=C3=B6=C3=B6f opdecken. -Description[nl]=3DAutorisatie van systeembeheerder is vereist om apparaten= af te tasten voor hun GRUB2 namen -Description[pl]=3DDo wykrycia nazw urz=C4=85dze=C5=84 dla GRUB2 potrzebne = s=C4=85 uprawnienia administratora -Description[pt]=3D=C3=89 necess=C3=A1ria a autoriza=C3=A7=C3=A3o do admini= strador para detectar os nomes dos dispositivos no GRUB2 -Description[pt_BR]=3D=C3=89 necess=C3=A1ria a autoriza=C3=A7=C3=A3o do adm= inistrador para detectar os nomes dos dispositivos no GRUB2 -Description[ro]=3DEste necesar=C4=83 autorizarea ca administrator pentru a= sonda dispozitivele pentru denumirile lor GRUB2 -Description[ru]=3D=D0=9D=D0=B5=D0=BE=D0=B1=D1=85=D0=BE=D0=B4=D0=B8=D0=BC= =D1=8B =D0=BF=D1=80=D0=B0=D0=B2=D0=B0 =D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=B8= =D1=81=D1=82=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=B0 =D0=B4=D0=BB=D1=8F =D0=BE= =D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F =D0=B8=D0=BC= =D1=91=D0=BD =D1=83=D1=81=D1=82=D1=80=D0=BE=D0=B9=D1=81=D1=82=D0=B2, =D0=B8= =D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5=D0=BC=D1=8B=D1=85 =D0=B7= =D0=B0=D0=B3=D1=80=D1=83=D0=B7=D1=87=D0=B8=D0=BA=D0=BE=D0=BC GRUB2 -Description[sk]=3DVy=C5=BEaduje sa overenie administr=C3=A1tora na vysk=C3= =BA=C5=A1anie zariaden=C3=AD pre ich n=C3=A1zvy v GRUB2 -Description[sl]=3DZa preizkus naprav za njihovimi imeni GRUB2 je zahtevana= pooblastitev skrbnika -Description[sv]=3DAdministrat=C3=B6rsbeh=C3=B6righet kr=C3=A4vs f=C3=B6r a= tt s=C3=B6ka igenom enheter efter deras GRUB2 namn -Description[tr]=3DAyg=C4=B1tlar=C4=B1n GRUB2 isimlerini ara=C5=9Ft=C4=B1rm= ak i=C3=A7in y=C3=B6netici yetkilendirmesi gerekli -Description[uk]=3D=D0=94=D0=BB=D1=8F =D0=B2=D0=B8=D0=B7=D0=BD=D0=B0=D1=87= =D0=B5=D0=BD=D0=BD=D1=8F =D0=BD=D0=B0=D0=B7=D0=B2 =D0=BF=D1=80=D0=B8=D1=81= =D1=82=D1=80=D0=BE=D1=97=D0=B2 GRUB2 =D1=81=D0=BB=D1=96=D0=B4 =D0=BD=D0=B0= =D0=B1=D1=83=D1=82=D0=B8 =D0=BF=D1=80=D0=B0=D0=B2 =D0=B4=D0=BE=D1=81=D1=82= =D1=83=D0=BF=D1=83 =D0=B0=D0=B4=D0=BC=D1=96=D0=BD=D1=96=D1=81=D1=82=D1=80= =D0=B0=D1=82=D0=BE=D1=80=D0=B0 -Description[x-test]=3DxxAdministrator authorization is required to probe d= evices for their GRUB2 namesxx -Description[zh_CN]=3D=E6=8E=A2=E6=B5=8B=E8=AE=BE=E5=A4=87=E7=9A=84 GRUB2 = =E5=90=8D=E5=AD=97=E9=9C=80=E8=A6=81=E7=AE=A1=E7=90=86=E5=91=98=E6=9D=83=E9= =99=90 -Description[zh_TW]=3D=E5=81=B5=E6=B8=AC=E8=A3=9D=E7=BD=AE=E5=9C=A8 GRUB2 = =E4=B8=8A=E7=9A=84=E5=90=8D=E7=A8=B1=E9=9C=80=E8=A6=81=E7=AE=A1=E7=90=86=E8= =80=85=E6=AC=8A=E9=99=90 -Policy=3Dauth_admin -Persistence=3Dsession - [org.kde.kcontrol.kcmgrub2.probevbe] Name=3DProbe VESA BIOS Extensions Name[bs]=3DIspitaj VESA BIOS pro=C5=A1irenja diff --git a/src/kcm_grub2.cpp b/src/kcm_grub2.cpp index 1189a98..1ed7e57 100644 --- a/src/kcm_grub2.cpp +++ b/src/kcm_grub2.cpp @@ -927,35 +927,6 @@ void KCMGRUB2::setupConnections() connect(ui->kpushbutton_install, SIGNAL(clicked(bool)), this, SLOT(slo= tInstallBootloader())); } = -QString KCMGRUB2::convertToGRUBFileName(const QString &fileName) -{ - QString grubFileName =3D fileName; - QString mountpoint =3D KMountPoint::currentMountPoints().findByPath(gr= ubFileName)->mountPoint(); - if (m_devices.contains(mountpoint)) { - if (mountpoint.compare("/") !=3D 0) { - grubFileName.remove(0, mountpoint.length()); - } - grubFileName.prepend(m_devices.value(mountpoint)); - } - return grubFileName; -} -QString KCMGRUB2::convertToLocalFileName(const QString &grubFileName) -{ - QString fileName =3D grubFileName; - QHash::const_iterator it =3D m_devices.constBegin(); - QHash::const_iterator end =3D m_devices.constEnd(); - for (; it !=3D end; ++it) { - if (fileName.startsWith(it.value())) { - fileName.remove(0, it.value().length()); - if (it.key().compare("/") !=3D 0) { - fileName.prepend(it.key()); - } - break; - } - } - return fileName; -} - ActionReply KCMGRUB2::loadFile(GrubFile grubFile) { Action loadAction("org.kde.kcontrol.kcmgrub2.load"); @@ -1041,48 +1012,6 @@ void KCMGRUB2::readMemtest() m_memtestOn =3D reply.data().value("memtestOn").toBool(); } } -void KCMGRUB2::readDevices() -{ - QStringList mountPoints; - Q_FOREACH(const KMountPoint::Ptr mp, KMountPoint::currentMountPoints()= ) { - if (mp->mountedFrom().startsWith(QLatin1String("/dev"))) { - mountPoints.append(mp->mountPoint()); - } - } - - Action probeAction("org.kde.kcontrol.kcmgrub2.probe"); - probeAction.setHelperID("org.kde.kcontrol.kcmgrub2"); - probeAction.addArgument("mountPoints", mountPoints); -#if KDE_IS_VERSION(4,6,0) - probeAction.setParentWidget(this); -#endif - if (probeAction.authorize() !=3D Action::Authorized) { - return; - } - - KProgressDialog progressDlg(this, i18nc("@title:window", "Probing devi= ces"), i18nc("@info:progress", "Probing devices for their GRUB names...")); - progressDlg.setAllowCancel(false); - progressDlg.setModal(true); - progressDlg.show(); - connect(probeAction.watcher(), SIGNAL(progressStep(int)), progressDlg.= progressBar(), SLOT(setValue(int))); - - ActionReply reply =3D probeAction.execute(); - processReply(reply); - if (reply.failed()) { - KMessageBox::detailedError(this, i18nc("@info", "Failed to get GRU= B device names."), reply.errorDescription()); - return; - } - QStringList grubPartitions =3D reply.data().value("grubPartitions").to= StringList(); - if (mountPoints.size() !=3D grubPartitions.size()) { - KMessageBox::error(this, i18nc("@info", "Helper returned malformed= device list.")); - return; - } - - m_devices.clear(); - for (int i =3D 0; i < mountPoints.size(); i++) { - m_devices[mountPoints.at(i)] =3D grubPartitions.at(i); - } -} void KCMGRUB2::readResolutions() { Action probeVbeAction("org.kde.kcontrol.kcmgrub2.probevbe"); diff --git a/src/kcm_grub2.h b/src/kcm_grub2.h index 5b2bff8..886a826 100644 --- a/src/kcm_grub2.h +++ b/src/kcm_grub2.h @@ -85,17 +85,12 @@ private: void setupObjects(); void setupConnections(); = - //TODO: Maybe remove? - QString convertToGRUBFileName(const QString &fileName); - QString convertToLocalFileName(const QString &grubFileName); - ActionReply loadFile(GrubFile grubFile); QString readFile(GrubFile grubFile); void readEntries(); void readSettings(); void readEnv(); void readMemtest(); - void readDevices(); void readResolutions(); = void sortResolutions();