Let DesktopIcon::rename() handle most of the stuff

This commit is contained in:
Sanel Zukan 2009-05-20 08:55:39 +00:00
parent 8d6cb50fb7
commit cf8f661b17

View File

@ -69,10 +69,6 @@ static void rename_cb(Fl_Widget*, void* d) {
E_ASSERT(di != NULL); E_ASSERT(di != NULL);
const char* new_name = edelib::input(_("New name"), di->label()); const char* new_name = edelib::input(_("New name"), di->label());
if(!new_name)
return;
if(new_name[0] == '\0')
return;
di->rename(new_name); di->rename(new_name);
} }
@ -261,7 +257,7 @@ int DesktopIcon::drag_icon_y(void) {
} }
void DesktopIcon::rename(const char* str) { void DesktopIcon::rename(const char* str) {
if(!str) if(!str ||(str[0] == '\0'))
return; return;
if(settings->name == str) if(settings->name == str)