ref: refs/heads/master
commit 93073b2d3f55a9ee3a87a3e8b95bf6937a0902f8
Author: Klaus Kämpf
Date: Wed Jul 15 16:43:09 2009 +0200
Add FIXMEs
---
.../app/controllers/system_time_controller.rb | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/plugins/systemtime/app/controllers/system_time_controller.rb b/plugins/systemtime/app/controllers/system_time_controller.rb
index a2fe83e..2155aa1 100644
--- a/plugins/systemtime/app/controllers/system_time_controller.rb
+++ b/plugins/systemtime/app/controllers/system_time_controller.rb
@@ -1,6 +1,8 @@
require 'yast/service_resource'
require 'systemtime'
+# FIXME: add comments to explain functions
+
class SystemTimeController < ApplicationController
before_filter :login_required
layout 'main'
@@ -15,6 +17,7 @@ class SystemTimeController < ApplicationController
end
def fill_current_region
+ # FIXME: @region can remain unset
@@timezones.each do |region|
region.entries.each do |entry|
if entry.id == @systemtime.timezone
@@ -25,17 +28,19 @@ class SystemTimeController < ApplicationController
end
def fill_date_and_time (timedate)
+ # FIXME: such conversions should be in a model
@time = timedate[timedate.index(" - ")+3,8]
@date = timedate[0..timedate.index(" - ")-1]
#convert date to format for datepicker
@date.sub!(/^(\d+)-(\d+)-(\d+)/,'\3/\2/\1')
end
-
-
public
+
+ # FIXME: should go to initialize()
@@timezones = {}
+ # FIXME: should go to initialize()
# Initialize GetText and Content-Type.
init_gettext "yast_webclient_systemtime" # textdomain, options(:charset, :content_type)
@@ -53,9 +58,11 @@ class SystemTimeController < ApplicationController
fill_date_and_time(@systemtime.time)
end
+ # FIXME: rename to 'update' to match rails conventions
def commit_time
t = load_proxy 'org.opensuse.yast.modules.yapi.time'
+ # FIXME: add a 'redirect_to'
unless t
return false
end
@@ -71,14 +78,17 @@ class SystemTimeController < ApplicationController
rescue ActiveResource::ClientError => e
flash[:error] = YaST::ServiceResource.error(e)
log_exception e
+ #FIXME: what about other exceptions ?
end
redirect_to :action => :index
end
+ # FIXME: rename to 'update' to match rails conventions
def commit_timezone
t = load_proxy 'org.opensuse.yast.modules.yapi.time'
+ # FIXME: add a 'redirect_to'
unless t
return false
end
@@ -91,6 +101,7 @@ class SystemTimeController < ApplicationController
rescue ActiveResource::ClientError => e
flash[:error] = YaST::ServiceResource.error(e)
log_exception e
+ #FIXME: what about other exceptions ?
end
redirect_to :action => :index
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org