mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Remove commented code
Some refactoring
This commit is contained in:
parent
8a08b132ad
commit
40400c0654
@ -120,31 +120,6 @@ DesktopIcon::DesktopIcon(GlobalIconSettings* gs, IconSettings* is, int bg) :
|
||||
imenu->menu(icon_menu);
|
||||
|
||||
load_icon(ICON_FACE_ONE);
|
||||
|
||||
#if 0
|
||||
if(!settings->icon.empty()) {
|
||||
const char* nn = settings->icon.c_str();
|
||||
|
||||
//edelib::String ipath = edelib::IconTheme::get(nn, edelib::ICON_SIZE_MEDIUM);
|
||||
edelib::String ipath = edelib::IconTheme::get(nn, edelib::ICON_SIZE_HUGE);
|
||||
if(!ipath.empty()) {
|
||||
Fl_Image* img = Fl_Shared_Image::get(ipath.c_str());
|
||||
if(img) {
|
||||
int img_w = img->w();
|
||||
int img_h = img->h();
|
||||
|
||||
// resize box if icon is larger
|
||||
if(img_w > ICON_SIZE_MIN_W || img_h > ICON_SIZE_MIN_H)
|
||||
size(img_w + OFFSET_W, img_h + OFFSET_H);
|
||||
|
||||
image(img);
|
||||
} else
|
||||
E_DEBUG(E_STRLOC ": Unable to load %s\n", ipath.c_str());
|
||||
} else
|
||||
E_DEBUG(E_STRLOC ": Got empty icon name ?!?\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
fix_position(x(), y());
|
||||
|
||||
//Use desktop color as color for icon background
|
||||
@ -337,8 +312,6 @@ void DesktopIcon::icon2(void) {
|
||||
}
|
||||
|
||||
void DesktopIcon::fast_redraw(void) {
|
||||
E_ASSERT(parent() != NULL && "Impossible !");
|
||||
|
||||
int wsz = w();
|
||||
int xpos = x();
|
||||
|
||||
|
@ -192,13 +192,14 @@ Desktop::~Desktop() {
|
||||
}
|
||||
|
||||
void Desktop::init_internals(void) {
|
||||
edelib::String p;
|
||||
|
||||
init_atoms();
|
||||
update_workarea();
|
||||
|
||||
/*
|
||||
* NOTE: order how childs are added is important. First
|
||||
* non iconable ones should be added (wallpaper, menu, ...)
|
||||
* then icons, so they can be drawn at top of them.
|
||||
* NOTE: order how childs are added is important. First non iconable ones should be
|
||||
* added (wallpaper, menu, ...) then icons, so they can be drawn at top of them.
|
||||
*/
|
||||
begin();
|
||||
dmenu = new Fl_Menu_Button(0, 0, 0, 0);
|
||||
@ -216,28 +217,22 @@ void Desktop::init_internals(void) {
|
||||
dbus = NULL;
|
||||
}
|
||||
|
||||
// read main config
|
||||
read_config();
|
||||
|
||||
/*
|
||||
* Now try to load icons, first looking inside ~/Desktop directory
|
||||
* FIXME: dir_exists() can't handle '~/Desktop' ???
|
||||
*/
|
||||
edelib::String desktop_path = edelib::dir_home();
|
||||
if(desktop_path.empty()) {
|
||||
E_WARNING(E_STRLOC ": can't read home directory; icons will not be loaded\n");
|
||||
return;
|
||||
}
|
||||
desktop_path += "/Desktop";
|
||||
// now try to load icons, looking inside ~/Desktop directory
|
||||
p = edelib::dir_home();
|
||||
edelib::String desktop_path = edelib::build_filename(p.c_str(), "Desktop");
|
||||
|
||||
// setup watcher on ~/Desktop and Trash directories
|
||||
// setup watcher used for Desktop and Trash directories
|
||||
edelib::DirWatch::init();
|
||||
|
||||
if(edelib::dir_exists(desktop_path.c_str())) {
|
||||
load_icons(desktop_path.c_str());
|
||||
|
||||
if(!edelib::DirWatch::add(desktop_path.c_str(),
|
||||
edelib::DW_CREATE | edelib::DW_MODIFY | edelib::DW_RENAME | edelib::DW_DELETE)) {
|
||||
|
||||
edelib::DW_CREATE | edelib::DW_MODIFY | edelib::DW_RENAME | edelib::DW_DELETE))
|
||||
{
|
||||
E_WARNING(E_STRLOC ": Unable to watch %s\n", desktop_path.c_str());
|
||||
}
|
||||
}
|
||||
@ -248,8 +243,8 @@ void Desktop::init_internals(void) {
|
||||
*
|
||||
* FIXME: at startup it should be checked is Trash empty and update icons for that
|
||||
*/
|
||||
trash_path = edelib::user_data_dir();
|
||||
trash_path += "/Trash/files";
|
||||
p = edelib::user_data_dir();
|
||||
trash_path = edelib::build_filename(p.c_str(), "Trash/files");
|
||||
|
||||
if(edelib::dir_exists(trash_path.c_str())) {
|
||||
if(!edelib::DirWatch::add(trash_path.c_str(), edelib::DW_CREATE | edelib::DW_DELETE))
|
||||
|
Loading…
Reference in New Issue
Block a user