pisilinux-kinfocenter.diff 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. diff --git a/Modules/infosummary/infosum.cpp b/Modules/infosummary/infosum.cpp
  2. index e58beb0..02f000c 100644
  3. --- a/Modules/infosummary/infosum.cpp
  4. +++ b/Modules/infosummary/infosum.cpp
  5. @@ -61,12 +61,12 @@ void InfoSumPlugin::createDisplay()
  6. void InfoSumPlugin::createOsBox()
  7. {
  8. DefaultBoxWidget *osWidget = new DefaultBoxWidget();
  9. - osWidget->setIcon(QIcon::fromTheme(QStringLiteral("kde")));
  10. + osWidget->setIcon(QIcon::fromTheme(QStringLiteral("PisiLinux")));
  11. osWidget->setLabelTitles(i18n("OS Version"),i18n("KDE Plasma Version"), i18n("Hostname"));
  12. OsDepInfo *osInfo = new OsDepInfo();
  13. - osWidget->setLabelOne(osInfo->osVersion());
  14. + osWidget->setLabelOne(osInfo->osVersion()+'\n'+osInfo->distroName());
  15. osWidget->setLabelTwo(QString(PLASMA_VERSION_STRING));
  16. osWidget->setLabelThree(osInfo->hostName());
  17. osWidget->setWhatsThis(i18nc("OS whats this","This shows information about your Operating System"));
  18. diff --git a/Modules/infosummary/osdepinfo.cpp b/Modules/infosummary/osdepinfo.cpp
  19. index 34afecc..8b7043f 100644
  20. --- a/Modules/infosummary/osdepinfo.cpp
  21. +++ b/Modules/infosummary/osdepinfo.cpp
  22. @@ -37,6 +37,11 @@ const QString OsDepInfo::osVersion()
  23. return m_osVersion;
  24. }
  25. +const QString OsDepInfo::distroName()
  26. +{
  27. + return m_distroName;
  28. +}
  29. +
  30. #if defined(Q_OS_UNIX)
  31. #include "osdepinfo_unix.cpp"
  32. #else
  33. @@ -50,6 +55,7 @@ void OsDepInfo::setDepInfo()
  34. {
  35. m_osVersion.clear();
  36. m_hostName.clear();
  37. + m_distroName.clear();
  38. }
  39. #endif // Q_OS_UNIX
  40. diff --git a/Modules/infosummary/osdepinfo.h b/Modules/infosummary/osdepinfo.h
  41. index 3452e8b..564a86c 100644
  42. --- a/Modules/infosummary/osdepinfo.h
  43. +++ b/Modules/infosummary/osdepinfo.h
  44. @@ -32,12 +32,14 @@ class OsDepInfo
  45. const QString hostName();
  46. const QString osVersion();
  47. + const QString distroName();
  48. private:
  49. void setDepInfo();
  50. QString m_hostName;
  51. QString m_osVersion;
  52. + QString m_distroName;
  53. };
  54. #endif //OSDEPINFO
  55. diff --git a/Modules/infosummary/osdepinfo_unix.cpp b/Modules/infosummary/osdepinfo_unix.cpp
  56. index d237337..3971945 100644
  57. --- a/Modules/infosummary/osdepinfo_unix.cpp
  58. +++ b/Modules/infosummary/osdepinfo_unix.cpp
  59. @@ -23,6 +23,18 @@
  60. #include "osdepinfo.h"
  61. #include <sys/utsname.h>
  62. +#include <KConfig>
  63. +#include <KConfigGroup>
  64. +#include <QString>
  65. +
  66. +QString getDistro()
  67. +{
  68. + KConfig osRelease( "/etc/os-release", KConfig::SimpleConfig );
  69. + KConfigGroup osR( &osRelease, "" );
  70. + QString pretty = osR.readEntry("PRETTY_NAME");
  71. + pretty.remove('"');
  72. + return(pretty);
  73. +}
  74. void OsDepInfo::setDepInfo()
  75. {
  76. @@ -31,4 +43,5 @@ void OsDepInfo::setDepInfo()
  77. m_osVersion = QString(unixInfo.sysname) + ' ' + QString(unixInfo.release);
  78. m_hostName = QString(unixInfo.nodename);
  79. + m_distroName = getDistro();
  80. }