[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kcm-grub2] src: Drop GRUB device probing.
From:       Konstantinos Smanis <konstantinos.smanis () gmail ! com>
Date:       2013-10-22 20:55:58
Message-ID: E1VYize-0002Rf-0y () scm ! kde ! org
[Download RAW message or body]

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 = args.value("mountPoints").toStringList();
-
-    QStringList grubPartitions;
-    HelperSupport::progressStep(0);
-    for (int i = 0; i < mountPoints.size(); i++) {
-        ActionReply grub_probeReply = executeCommand(QStringList() << GRUB_PROBE_EXE << "-t" << "drive" \
                << mountPoints.at(i));
-        if (grub_probeReply.failed()) {
-            return grub_probeReply;
-        }
-        grubPartitions.append(grub_probeReply.data().value("output").toString().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]=載入 GRUB2 開機載入器設定需要管理者權限
 Policy=auth_admin
 Persistence=session
 
-[org.kde.kcontrol.kcmgrub2.probe]
-Name=Probe devices for their GRUB2 names
-Name[bs]=Testiranje uređaja za njihova GRUB2 imena
-Name[ca]=Prova els dispositius pels seus noms a Grub2
-Name[ca@valencia]=Prova els dispositius pels seus noms a Grub2
-Name[cs]=Prozkoumat zařízení pro jejich GRUB2 názvy
-Name[da]=Søg efter enheders GRUB2-navne
-Name[de]=Geräte auf ihre GRUB2-Namen abfragen.
-Name[el]=Έλεγχος συσκευών αν έχουν ονόματα GRUB2
-Name[es]=Examinar los nombres de los dispositivos en GRUB2
-Name[et]=Seadmete kontrollimine GRUB2 nimede osas
-Name[fi]=Tunnustele laitteet niiden GRUB2-nimien selvittämiseksi
-Name[fr]=Interroger les périphériques pour trouver leurs noms GRUB2
-Name[gl]=Probar os dispositivos polo seu nome en GRUB2
-Name[hu]=Eszközök vizsgálata a GRUB2 név meghatározásához
-Name[it]=Sonda i dispositivi per trovarne i loro nomi in GRUB2
-Name[lt]=Tikrini įrenginius dėl GRUB2 vardų
-Name[mr]=साधनांच्या GRUB2 नावाकरिता साधने शोधा
-Name[nb]=Undersøk enheter for å finne deres GRUB2-navn
-Name[nds]=De Reedschappen ehr Grub2-Naams opdecken
-Name[nl]=Apparaten aftasten voor hun GRUB2 namen
-Name[pa]=ਜੰਤਰ ਨੂੰ ਉਹਨਾਂ ਦੇ ਗਰਬ2 ਨਾਂ ਲਈ ਪੜਤਾਲ \
                ਕਰੋ
-Name[pl]=Wykryj nazwy urządzeń dla GRUB2
-Name[pt]=Detectar os nomes dos dispositivos no GRUB2
-Name[pt_BR]=Detectar os nomes dos dispositivos no GRUB2
-Name[ro]=Sondează dispozitivele pentru denumirile lor GRUB2
-Name[ru]=Определение имён устройств, используемых \
                загрузчиком GRUB2
-Name[sk]=Vyskúšať zariadenia pre ich názvy v GRUB2
-Name[sl]=Preizkusi naprave za njihova imena GRUB2
-Name[sv]=Sök igenom enheter efter deras GRUB2-namn
-Name[tr]=Aygıtları GRUB2 isimleri için araştır
-Name[uk]=Визначення назв пристроїв GRUB2
-Name[x-test]=xxProbe devices for their GRUB2 namesxx
-Name[zh_CN]=探测设备的 GRUB2 名字
-Name[zh_TW]=偵測裝置在 GRUB2 上的名稱
-Description=Administrator authorization is required to probe devices for their GRUB2 names
-Description[bs]=Administratorska potvrda je potrebna za upit uređaja za njihova GRUB2 imena
-Description[ca]=Es requereix autorització de l'administrador per a provar els dispositius pels seus \
                noms a Grub2
-Description[ca@valencia]=Es requereix autorització de l'administrador per a provar els dispositius pels \
                seus noms a Grub2
-Description[cs]=Pro prozkoumání GRUB2 názvů zařízení je potřeba oprávnění administrátora
-Description[da]=Administrator-godkendelse kræves for at søge efter enheders GRUB2-navne
-Description[de]=Zur Abfrage der Geräte nach ihren GRUB2-Namen sind Systemverwalterrechte erforderlich.
-Description[el]=Απαιτείται εξουσιοδότηση διαχειριστή για τον \
                έλεγχο συσκευών για ονόματα GRUB2
-Description[es]=Se requiere la autorización del administrador para examinar los nombres de los \
                dispositivos en GRUB2
-Description[et]=Seadmete kontrollimiseks GRUB2 nimede osas on vajalik autentimine administraatorina
-Description[fi]=Laitteiden tunnusteleminen niiden GRUB2-nimien selvittämiseksi vaatii pääkäyttäjän \
                oikeudet
-Description[fr]=L'autorisation de l'administrateur est requise pour interroger les périphériques pour \
                trouver leurs noms GRUB2
-Description[gl]=Precísase a autorización do administrador para probar os dispositivos polo seu nome en \
                GRUB2
-Description[hu]=Rendszergazdai jogosultságok szükségesek az eszközök GRUB2 nevének \
                meghatározásához
-Description[it]=Sono i richiesti i privilegi amministrativi per sondare i dispositivi e trovarne i nomi \
                in GRUB2
-Description[lt]=Administratoriaus įgaliojimas reikalingas, kad patikrinti įrenginių GRUB2 vardus
-Description[mr]=साधनांच्या GRUB2 नावाकरिता साधने \
शोधण्याकरिता व्यवस्थापकाची परवानगी \
                आवश्यक आहे
-Description[nb]=Det kreves autorisasjon som administrator for å søke etter enheters GRUB2-navn
-Description[nds]=De Reedschappen ehr Grub2-Naams laat sik bloots mit Systeempleger-Verlööf opdecken.
-Description[nl]=Autorisatie van systeembeheerder is vereist om apparaten af te tasten voor hun GRUB2 \
                namen
-Description[pl]=Do wykrycia nazw urządzeń dla GRUB2 potrzebne są uprawnienia administratora
-Description[pt]=É necessária a autorização do administrador para detectar os nomes dos dispositivos \
                no GRUB2
-Description[pt_BR]=É necessária a autorização do administrador para detectar os nomes dos \
                dispositivos no GRUB2
-Description[ro]=Este necesară autorizarea ca administrator pentru a sonda dispozitivele pentru \
                denumirile lor GRUB2
-Description[ru]=Необходимы права администратора для \
                определения имён устройств, используемых \
                загрузчиком GRUB2
-Description[sk]=Vyžaduje sa overenie administrátora na vyskúšanie zariadení pre ich názvy v GRUB2
-Description[sl]=Za preizkus naprav za njihovimi imeni GRUB2 je zahtevana pooblastitev skrbnika
-Description[sv]=Administratörsbehörighet krävs för att söka igenom enheter efter deras GRUB2 namn
-Description[tr]=Aygıtların GRUB2 isimlerini araştırmak için yönetici yetkilendirmesi gerekli
-Description[uk]=Для визначення назв пристроїв GRUB2 слід набути \
                прав доступу адміністратора
-Description[x-test]=xxAdministrator authorization is required to probe devices for their GRUB2 namesxx
-Description[zh_CN]=探测设备的 GRUB2 名字需要管理员权限
-Description[zh_TW]=偵測裝置在 GRUB2 上的名稱需要管理者權限
-Policy=auth_admin
-Persistence=session
-
 [org.kde.kcontrol.kcmgrub2.probevbe]
 Name=Probe VESA BIOS Extensions
 Name[bs]=Ispitaj VESA BIOS proširenja
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(slotInstallBootloader()));
 }
 
-QString KCMGRUB2::convertToGRUBFileName(const QString &fileName)
-{
-    QString grubFileName = fileName;
-    QString mountpoint = KMountPoint::currentMountPoints().findByPath(grubFileName)->mountPoint();
-    if (m_devices.contains(mountpoint)) {
-        if (mountpoint.compare("/") != 0) {
-            grubFileName.remove(0, mountpoint.length());
-        }
-        grubFileName.prepend(m_devices.value(mountpoint));
-    }
-    return grubFileName;
-}
-QString KCMGRUB2::convertToLocalFileName(const QString &grubFileName)
-{
-    QString fileName = grubFileName;
-    QHash<QString, QString>::const_iterator it = m_devices.constBegin();
-    QHash<QString, QString>::const_iterator end = m_devices.constEnd();
-    for (; it != end; ++it) {
-        if (fileName.startsWith(it.value())) {
-            fileName.remove(0, it.value().length());
-            if (it.key().compare("/") != 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 = 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() != Action::Authorized) {
-        return;
-    }
-
-    KProgressDialog progressDlg(this, i18nc("@title:window", "Probing devices"), 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 = probeAction.execute();
-    processReply(reply);
-    if (reply.failed()) {
-        KMessageBox::detailedError(this, i18nc("@info", "Failed to get GRUB device names."), \
                reply.errorDescription());
-        return;
-    }
-    QStringList grubPartitions = reply.data().value("grubPartitions").toStringList();
-    if (mountPoints.size() != grubPartitions.size()) {
-        KMessageBox::error(this, i18nc("@info", "Helper returned malformed device list."));
-        return;
-    }
-
-    m_devices.clear();
-    for (int i = 0; i < mountPoints.size(); i++) {
-        m_devices[mountPoints.at(i)] = 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();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic