mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-28 17:48:39 +00:00
Shrink code
This commit is contained in:
parent
199f8876fb
commit
a87c3ee205
19
src/conky.cc
19
src/conky.cc
@ -2827,7 +2827,7 @@ void set_current_config() {
|
|||||||
current_config = builtin_config_magic;
|
current_config = builtin_config_magic;
|
||||||
NORM_ERR(NOCFGFILEFOUND ", using builtin default");
|
NORM_ERR(NOCFGFILEFOUND ", using builtin default");
|
||||||
#else
|
#else
|
||||||
throw std::runtime_error(NOCFGFILEFOUND);
|
throw conky::critical_error(NOCFGFILEFOUND);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2842,7 +2842,7 @@ void initialisation(int argc, char **argv) {
|
|||||||
set_default_configurations();
|
set_default_configurations();
|
||||||
|
|
||||||
try { set_current_config(); }
|
try { set_current_config(); }
|
||||||
catch(std::runtime_error &e) { throw e; }
|
catch(conky::critical_error &e) { throw e; }
|
||||||
load_config_file();
|
load_config_file();
|
||||||
|
|
||||||
/* handle other command line arguments */
|
/* handle other command line arguments */
|
||||||
@ -3079,14 +3079,11 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try { set_current_config(); }
|
|
||||||
catch(std::runtime_error &e) {
|
|
||||||
std::cerr << e.what() << std::endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
state.reset(new lua::state);
|
|
||||||
try {
|
try {
|
||||||
|
set_current_config();
|
||||||
|
|
||||||
|
state.reset(new lua::state);
|
||||||
|
|
||||||
conky::export_symbols(*state);
|
conky::export_symbols(*state);
|
||||||
|
|
||||||
#ifdef BUILD_WEATHER_XOAP
|
#ifdef BUILD_WEATHER_XOAP
|
||||||
@ -3125,10 +3122,6 @@ int main(int argc, char **argv)
|
|||||||
std::cerr << e.what() << std::endl;
|
std::cerr << e.what() << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
catch(std::runtime_error &e) {
|
|
||||||
std::cerr << e.what() << std::endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
disk_cleanup();
|
disk_cleanup();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user