mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Updated changes for build_filename()
This commit is contained in:
parent
b9de0633f8
commit
f05e34c63b
@ -42,7 +42,7 @@ static void resolve_path(const edelib::String& datadir, edelib::String& item, bo
|
|||||||
const char* i = item.c_str();
|
const char* i = item.c_str();
|
||||||
|
|
||||||
if(!edelib::file_exists(i) && have_datadir) {
|
if(!edelib::file_exists(i) && have_datadir) {
|
||||||
item = edelib::build_filename("/", datadir.c_str(), i);
|
item = edelib::build_filename(datadir.c_str(), i);
|
||||||
i = item.c_str();
|
i = item.c_str();
|
||||||
if(!edelib::file_exists(i)) {
|
if(!edelib::file_exists(i)) {
|
||||||
// no file, send then empty
|
// no file, send then empty
|
||||||
|
@ -90,7 +90,7 @@ void Xsm::xresource_replace(void) {
|
|||||||
edelib::String home = edelib::dir_home();
|
edelib::String home = edelib::dir_home();
|
||||||
|
|
||||||
// try to open ~/.Xdefaults; if failed, X Resource will not complain
|
// try to open ~/.Xdefaults; if failed, X Resource will not complain
|
||||||
edelib::String db_file = edelib::build_filename("/", home.c_str(), USER_XRESOURCE);
|
edelib::String db_file = edelib::build_filename(home.c_str(), USER_XRESOURCE);
|
||||||
|
|
||||||
// initialize XResource manager
|
// initialize XResource manager
|
||||||
XrmInitialize();
|
XrmInitialize();
|
||||||
@ -145,7 +145,7 @@ void Xsm::xresource_replace(void) {
|
|||||||
XrmPutLineResource(&db, tmp.c_str());
|
XrmPutLineResource(&db, tmp.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
edelib::String tmp_db_file = edelib::build_filename("/", home.c_str(), USER_XRESOURCE_TMP);
|
edelib::String tmp_db_file = edelib::build_filename(home.c_str(), USER_XRESOURCE_TMP);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to merge existing ~/.Xdefaults (if present) with our changes. If there is existing
|
* Try to merge existing ~/.Xdefaults (if present) with our changes. If there is existing
|
||||||
@ -158,7 +158,7 @@ void Xsm::xresource_replace(void) {
|
|||||||
//XrmSetDatabase(fl_display, db);
|
//XrmSetDatabase(fl_display, db);
|
||||||
XrmDestroyDatabase(db);
|
XrmDestroyDatabase(db);
|
||||||
if(status) {
|
if(status) {
|
||||||
edelib::String db_backup = edelib::build_filename("/", home.c_str(), USER_XRESOURCE_SAVED);
|
edelib::String db_backup = edelib::build_filename(home.c_str(), USER_XRESOURCE_SAVED);
|
||||||
edelib::file_rename(db_file.c_str(), db_backup.c_str());
|
edelib::file_rename(db_file.c_str(), db_backup.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,8 +169,8 @@ void Xsm::xresource_undo(void) {
|
|||||||
edelib::String home, db_file_backup, db_file;
|
edelib::String home, db_file_backup, db_file;
|
||||||
|
|
||||||
home = edelib::dir_home();
|
home = edelib::dir_home();
|
||||||
db_file_backup = edelib::build_filename("/", home.c_str(), USER_XRESOURCE_SAVED);
|
db_file_backup = edelib::build_filename(home.c_str(), USER_XRESOURCE_SAVED);
|
||||||
db_file = edelib::build_filename("/", home.c_str(), USER_XRESOURCE);
|
db_file = edelib::build_filename(home.c_str(), USER_XRESOURCE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we have backup, restore it; otherwise delete ~/.Xdefaults.
|
* If we have backup, restore it; otherwise delete ~/.Xdefaults.
|
||||||
|
Loading…
Reference in New Issue
Block a user