Author: aschnell
Date: Fri Jan 15 16:17:32 2010
New Revision: 60403
URL: http://svn.opensuse.org/viewcvs/yast?rev=60403&view=rev
Log:
- tiny modernisations
Modified:
trunk/storage/storage/src/include/ep-all.ycp
trunk/storage/storage/src/include/ep-dialogs.ycp
trunk/storage/storage/src/include/ep-hd-lib.ycp
trunk/storage/storage/src/include/ep-lvm-lib.ycp
trunk/storage/storage/src/include/ep-raid-lib.ycp
trunk/storage/storage/src/include/ep-unused.ycp
Modified: trunk/storage/storage/src/include/ep-all.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-all.ycp?rev=60403&r1=60402&r2=60403&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-all.ycp (original)
+++ trunk/storage/storage/src/include/ep-all.ycp Fri Jan 15 16:17:32 2010
@@ -71,7 +71,7 @@
configs = add(configs, `item(`id(`xpram), `icon("yast-xpram"), _("Configure &XPRAM...")));
}
- if (size(configs) > 0) {
+ if (!isempty(configs)) {
// menu button text
buttons = add(buttons, `MenuButton(`opt(`key_F7), _("Configure..."), configs));
}
Modified: trunk/storage/storage/src/include/ep-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-dialogs.ycp?rev=60403&r1=60402&r2=60403&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-dialogs.ycp Fri Jan 15 16:17:32 2010
@@ -592,7 +592,7 @@
if (used_fs != `swap)
{
map free_data = Storage::GetFreeSpace(device, used_fs, true);
- if (size(free_data) == 0 || !free_data["ok"]:false)
+ if (isempty(free_data) || !free_data["ok"]:false)
{
y2error("Failed to retrieve FreeSpace %1, filesystem %2", device, data["used_fs"]:`none);
//FIXME: Really?
Modified: trunk/storage/storage/src/include/ep-hd-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-hd-lib.ycp?rev=60403&r1=60402&r2=60403&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-hd-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-hd-lib.ycp Fri Jan 15 16:17:32 2010
@@ -373,19 +373,20 @@
more partitions. After cloning, these
partitions will be deleted.</p>");
- list <string> AvailableTargetDisks() {
- list <string> items = [];
-
+ list <string> AvailableTargetDisks()
+ {
map filtered_target_map =
filter( string dev, map props, target_map, {
- return ( dev != device &&
- Storage::IsDiskType( props["type"]:`CT_UNKNOWN ) &&
- props["used_by_device"]:"" == "" &&
- props["cyl_size"]:0 == mycyl_size );
+ return dev != device &&
+ Storage::IsDiskType( props["type"]:`CT_UNKNOWN ) &&
+ isempty(props["used_by"]:[]) &&
+ props["cyl_size"]:0 == mycyl_size;
});
y2milestone("Available, suitable and unused disks (other than %1): %2", device, Map::Keys(filtered_target_map));
+ list <string> items = [];
+
foreach( string dev, map props, filtered_target_map,{
if( props["size_k"]:0 >= mysize )
items = add(items, dev);
Modified: trunk/storage/storage/src/include/ep-lvm-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lvm-lib.ycp?rev=60403&r1=60402&r2=60403&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-lvm-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-lvm-lib.ycp Fri Jan 15 16:17:32 2010
@@ -42,7 +42,7 @@
void EpCreateVolumeGroup()
{
map target_map = Storage::GetTargetMap();
- list<map> unused_pvs = filter(map pv, get_possible_pvs(target_map), { return isempty(pv["used_by_device"]:""); });
+ list<map> unused_pvs = filter(map pv, get_possible_pvs(target_map), { return isempty(pv["used_by"]:[]); });
if (size(unused_pvs) < 1)
{
Modified: trunk/storage/storage/src/include/ep-raid-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-raid-lib.ycp?rev=60403&r1=60402&r2=60403&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-raid-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-raid-lib.ycp Fri Jan 15 16:17:32 2010
@@ -42,7 +42,7 @@
void EpCreateRaid()
{
map target_map = Storage::GetTargetMap();
- list<map> unused_devices = filter(map dev, get_possible_rds(target_map), { return isempty(dev["used_by_device"]:""); });
+ list<map> unused_devices = filter(map dev, get_possible_rds(target_map), { return isempty(dev["used_by"]:[]); });
if (size(unused_devices) < 2)
{
Modified: trunk/storage/storage/src/include/ep-unused.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-unused.ycp?rev=60403&r1=60402&r2=60403&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-unused.ycp (original)
+++ trunk/storage/storage/src/include/ep-unused.ycp Fri Jan 15 16:17:32 2010
@@ -20,8 +20,8 @@
if (partition == nil)
{
- if (disk["partitions"]:[] == [] &&
- disk["used_by_type"]:`UB_NONE == `UB_NONE)
+ if (isempty(disk["partitions"]:[]) &&
+ isempty(disk["used_by"]:[]))
{
return `show;
}
@@ -31,8 +31,8 @@
else
{
if (partition["type"]:`primary != `extended &&
- partition["mount"]:"" == "" &&
- partition["used_by_type"]:`UB_NONE == `UB_NONE)
+ isempty(partition["mount"]:"") &&
+ isempty(partition["used_by"]:[]))
{
return `show;
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org