LOG Updated to 0.5.8

This commit is contained in:
Denis Silakov 2012-09-17 16:09:15 +04:00
parent 8a109dde42
commit abea4bdb3f
4 changed files with 108 additions and 26 deletions

View file

@ -1,2 +1,2 @@
sources:
"kcm-grub2-0.5.5.tar.gz": 1f63e76f9dcd14402ba2c6605ae79b13d744a73d
"kcm-grub2-0.5.8.tar.gz": 01b389d23d4ec2733ed78b859a4e1d27c4530c68

20
get_res.cpp Normal file
View file

@ -0,0 +1,20 @@
#include <hd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
FILE *file = fopen("/var/lib/mandriva/kde4-profiles/common/share/config/kcm-modes", "w");
hd_data_t hd_data;
memset(&hd_data, 0, sizeof(hd_data));
hd_t *hd = hd_list(&hd_data, hw_framebuffer, 1, NULL);
for (hd_res_t *res = hd->res; res; res = res->next) {
if (res->any.type == res_framebuffer) {
fprintf(file, "%dx%dx%d\n", res->framebuffer.width, res->framebuffer.height, res->framebuffer.colorbits);
}
}
hd_free_hd_list(hd);
hd_free_hd_data(&hd_data);
fclose(file);
return 0;
}

View file

@ -0,0 +1,69 @@
diff -Naur kcm-grub2-0.5.8//src/helper/helper.cpp kcm-grub-new//src/helper/helper.cpp
--- kcm-grub2-0.5.8//src/helper/helper.cpp 2012-06-18 13:06:58.000000000 +0400
+++ kcm-grub-new//src/helper/helper.cpp 2012-07-27 18:22:14.830328237 +0400
@@ -36,10 +36,11 @@
//Project
#include "../config.h"
-#if HAVE_HD
-#undef slots
-#include <hd.h>
-#endif
+
+#include <fstream>
+#include <string>
+using std::ifstream;
+using std::string;
Helper::Helper()
{
@@ -209,24 +210,20 @@
{
Q_UNUSED(args)
ActionReply reply;
-
-#if HAVE_HD
QStringList gfxmodes;
- hd_data_t hd_data;
- memset(&hd_data, 0, sizeof(hd_data));
- hd_t *hd = hd_list(&hd_data, hw_framebuffer, 1, NULL);
- for (hd_res_t *res = hd->res; res; res = res->next) {
- if (res->any.type == res_framebuffer) {
- gfxmodes += QString("%1x%2x%3").arg(QString::number(res->framebuffer.width), QString::number(res->framebuffer.height), QString::number(res->framebuffer.colorbits));
- }
+
+ ifstream input("/var/lib/mandriva/kde4-profiles/common/share/config/kcm-modes");
+ if(input.fail())
+ {
+ reply = ActionReply::HelperErrorReply;
+ }else{
+ string str;
+ while(getline(input,str))
+ {
+ gfxmodes += QString("%1").arg(QString::fromStdString(str));
+ }
+ reply.addData("gfxmodes", gfxmodes);
}
- hd_free_hd_list(hd);
- hd_free_hd_data(&hd_data);
- reply.addData("gfxmodes", gfxmodes);
-#else
- reply = ActionReply::HelperErrorReply;
-#endif
-
return reply;
}
ActionReply Helper::save(QVariantMap args)
diff -Naur kcm-grub2-0.5.8//src/helper/kcmgrub2.actions kcm-grub-new//src/helper/kcmgrub2.actions
--- kcm-grub2-0.5.8//src/helper/kcmgrub2.actions 2012-06-18 13:06:58.000000000 +0400
+++ kcm-grub-new//src/helper/kcmgrub2.actions 2012-07-27 18:33:43.148145232 +0400
@@ -303,8 +303,7 @@
Description[x-test]=xxAdministrator authorization is required to probe VESA BIOS Extensionsxx
Description[zh_CN]=探测 VESA BIOS 扩展需要管理员权限
Description[zh_TW]=偵測 VESA BIOS 延伸需要管理者權限
-Policy=auth_admin
-Persistence=session
+Policy=yes
[org.kde.kcontrol.kcmgrub2.save]
Name=Save the GRUB2 Bootloader settings

View file

@ -3,20 +3,25 @@
%define _kde4_configkcfgdir %{_kde4_sharedir}/config.kcfg
%define getres kcm-grub2-getres
Name: kcm-grub2
Requires: grub2
BuildRequires: gcc-c++
BuildRequires: kdelibs4-devel
BuildRequires: libhd-devel
BuildRequires: pkgconfig(ImageMagick)
BuildRequires: libmagick-devel
License: GPLv3+
Url: http://ksmanis.wordpress.com/projects/grub2-editor/
Group: Graphical desktop/KDE
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: A KDE Control Module for configuring the GRUB2 bootloader
Version: 0.5.5
Version: 0.5.8
Release: 1
Source: %{name}-%{version}.tar.gz
Source0: %{name}-%{version}.tar.gz
Source1: get_res.cpp
Patch0: kcm-grub2-read-mode-from-file.patch
#%kde4_runtime_requires
%description
@ -29,6 +34,8 @@ Author(s):
%prep
%setup -n %{name}-%{version} -q
%apply_patches
gcc %{SOURCE1} -l hd -o %{getres}
%build
#%cmake_kde4 -d ..
@ -41,11 +48,17 @@ cd .. && %make
#kde_post_install
#rm -fr %buildroot
make -C build DESTDIR=%buildroot install
%find_lang %{name}
install -d %{buildroot}%{_sbindir}
install -m 700 %{getres} %{buildroot}%{_sbindir}/%{getres}
%post
%{_sbindir}/%{getres}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING README
%{_datadir}/kde4/services/kcm_grub2.desktop
@ -54,27 +67,7 @@ rm -rf $RPM_BUILD_ROOT
%config %{_sysconfdir}/dbus-1/system.d/org.kde.kcontrol.kcmgrub2.conf
%{_datadir}/dbus-1/system-services/org.kde.kcontrol.kcmgrub2.service
%{_datadir}/polkit-1/actions/org.kde.kcontrol.kcmgrub2.policy
%lang(ca) %{_datadir}/locale/ca/LC_MESSAGES/*
%lang(cs) %{_datadir}/locale/cs/LC_MESSAGES/*
%lang(da) %{_datadir}/locale/da/LC_MESSAGES/*
%lang(de) %{_datadir}/locale/de/LC_MESSAGES/*
%lang(el) %{_datadir}/locale/el/LC_MESSAGES/*
%lang(es) %{_datadir}/locale/es/LC_MESSAGES/*
%lang(et) %{_datadir}/locale/et/LC_MESSAGES/*
%lang(fr) %{_datadir}/locale/fr/LC_MESSAGES/*
%lang(ga) %{_datadir}/locale/ga/LC_MESSAGES/*
%lang(hu) %{_datadir}/locale/hu/LC_MESSAGES/*
%lang(lt) %{_datadir}/locale/lt/LC_MESSAGES/*
%lang(nl) %{_datadir}/locale/nl/LC_MESSAGES/*
%lang(pa) %{_datadir}/locale/pa/LC_MESSAGES/*
%lang(pl) %{_datadir}/locale/pl/LC_MESSAGES/*
%lang(pt) %{_datadir}/locale/pt/LC_MESSAGES/*
%lang(pt_BR) %{_datadir}/locale/pt_BR/LC_MESSAGES/*
%lang(ru) %{_datadir}/locale/ru/LC_MESSAGES/*
%lang(sv) %{_datadir}/locale/sv/LC_MESSAGES/*
%lang(uk) %{_datadir}/locale/uk/LC_MESSAGES/*
%lang(zh_TW) %{_datadir}/locale/zh_TW/LC_MESSAGES/*
%{_sbindir}/%{getres}
%changelog