Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
f3f063e1
Commit
f3f063e1
authored
12 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-389: make retrieving default value and testing of the value more robust
parent
0a576ef4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/user/PreferencesImpl.java
+11
-5
11 additions, 5 deletions
src/main/java/org/olat/user/PreferencesImpl.java
with
11 additions
and
5 deletions
src/main/java/org/olat/user/PreferencesImpl.java
+
11
−
5
View file @
f3f063e1
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
package
org.olat.user
;
package
org.olat.user
;
import
org.olat.core.id.Preferences
;
import
org.olat.core.id.Preferences
;
import
org.olat.core.util.StringHelper
;
import
org.olat.core.util.i18n.I18nManager
;
import
org.olat.core.util.i18n.I18nManager
;
import
org.olat.core.util.notifications.NotificationsManager
;
import
org.olat.core.util.notifications.NotificationsManager
;
...
@@ -38,7 +39,10 @@ import org.olat.core.util.notifications.NotificationsManager;
...
@@ -38,7 +39,10 @@ import org.olat.core.util.notifications.NotificationsManager;
*
*
* @author guido
* @author guido
*/
*/
public
class
PreferencesImpl
implements
Preferences
{
public
class
PreferencesImpl
implements
Preferences
{
private
static
final
long
serialVersionUID
=
-
8013230820111033911L
;
private
String
language
;
private
String
language
;
private
String
fontsize
;
private
String
fontsize
;
private
String
notificationInterval
;
private
String
notificationInterval
;
...
@@ -107,8 +111,12 @@ public class PreferencesImpl implements Preferences{
...
@@ -107,8 +111,12 @@ public class PreferencesImpl implements Preferences{
public
String
getNotificationInterval
()
{
public
String
getNotificationInterval
()
{
// Always return a valid notification interval
// Always return a valid notification interval
NotificationsManager
notiMgr
=
NotificationsManager
.
getInstance
();
NotificationsManager
notiMgr
=
NotificationsManager
.
getInstance
();
if
(
notificationInterval
==
null
||
notificationInterval
.
isEmpty
()
if
(!
StringHelper
.
containsNonWhitespace
(
notificationInterval
))
{
||
notiMgr
==
null
||
!
notiMgr
.
getEnabledNotificationIntervals
().
contains
(
notificationInterval
))
{
if
(
notiMgr
!=
null
)
{
notificationInterval
=
notiMgr
.
getDefaultNotificationInterval
();
}
}
else
if
(
notiMgr
!=
null
&&
notiMgr
.
getEnabledNotificationIntervals
()
!=
null
&&
!
notiMgr
.
getEnabledNotificationIntervals
().
contains
(
notificationInterval
))
{
notificationInterval
=
notiMgr
.
getDefaultNotificationInterval
();
notificationInterval
=
notiMgr
.
getDefaultNotificationInterval
();
}
}
return
notificationInterval
;
return
notificationInterval
;
...
@@ -157,7 +165,5 @@ public class PreferencesImpl implements Preferences{
...
@@ -157,7 +165,5 @@ public class PreferencesImpl implements Preferences{
*/
*/
public
void
setPresenceMessagesPublic
(
boolean
b
)
{
public
void
setPresenceMessagesPublic
(
boolean
b
)
{
this
.
presenceMessagesPublic
=
b
;
this
.
presenceMessagesPublic
=
b
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment