mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Do not exit from read_config() even if reading file fails; edelib::Config class will simply use fallback values instead.
This commit is contained in:
parent
932e2c85fd
commit
0d6f18e867
@ -240,14 +240,7 @@ Panel::Panel() : PanelWindow(300, 30, "ede-panel") {
|
||||
|
||||
void Panel::read_config(void) {
|
||||
Resource r;
|
||||
|
||||
/* try to load applets even if panel configuration isn't present */
|
||||
if(E_UNLIKELY(r.load("ede-panel") == false)) {
|
||||
load_applets();
|
||||
hider = new Hider();
|
||||
add(hider);
|
||||
return;
|
||||
}
|
||||
r.load("ede-panel");
|
||||
|
||||
int tmp;
|
||||
if(r.get("Panel", "position", tmp, PANEL_POSITION_BOTTOM)) {
|
||||
@ -266,10 +259,17 @@ void Panel::read_config(void) {
|
||||
/* small button on the right edge for panel sliding */
|
||||
r.get("Panel", "hider", tmp, 1);
|
||||
if(tmp) {
|
||||
if(!hider) {
|
||||
hider = new Hider();
|
||||
add(hider);
|
||||
}
|
||||
|
||||
/* in case was hidden before */
|
||||
hider->show();
|
||||
} else {
|
||||
if(hider) hider->hide();
|
||||
}
|
||||
|
||||
char buf[128];
|
||||
if(r.get("Panel", "applets", buf, sizeof(buf)))
|
||||
load_applets(buf);
|
||||
@ -541,6 +541,8 @@ int Panel::handle(int e) {
|
||||
}
|
||||
|
||||
void Panel::load_applets(const char *applets) {
|
||||
mgr.clear(this);
|
||||
|
||||
/*
|
||||
* Hardcoded order, unless configuration file was found. For easier and uniform parsing
|
||||
* (similar string is expected from configuration), fallback is plain string.
|
||||
|
Loading…
Reference in New Issue
Block a user