desktop_util: Rename *_DE symbols to *_DU

DU is a more appropriate macro suffix for this code unit.
This commit is contained in:
Ignacio R. Morelle 2013-11-10 04:49:17 -03:00
parent d3e18e1e9b
commit 671af5f08a

View file

@ -34,8 +34,8 @@
#endif
static lg::log_domain log_desktop("desktop");
#define ERR_DE LOG_STREAM(err, log_desktop)
#define LOG_DE LOG_STREAM(info, log_desktop)
#define ERR_DU LOG_STREAM(err, log_desktop)
#define LOG_DU LOG_STREAM(info, log_desktop)
namespace desktop {
@ -44,10 +44,10 @@ bool open_in_file_manager(const std::string& path)
#if defined(_X11) || defined(__APPLE__)
#ifndef __APPLE__
LOG_DE << "open_in_file_manager(): on X11, will use xdg-open\n";
LOG_DU << "open_in_file_manager(): on X11, will use xdg-open\n";
const char launcher[] = "xdg-open";
#else
LOG_DE << "open_in_file_manager(): on OS X, will use open\n";
LOG_DU << "open_in_file_manager(): on OS X, will use open\n";
const char launcher[] = "open";
#endif
@ -55,22 +55,22 @@ bool open_in_file_manager(const std::string& path)
const pid_t child = fork();
if(child == -1) {
ERR_DE << "open_in_file_manager(): fork() failed\n";
ERR_DU << "open_in_file_manager(): fork() failed\n";
return false;
} else if(child == 0) {
execlp(launcher, launcher, path.c_str(), reinterpret_cast<char*>(NULL));
_exit(1); // This shouldn't happen.
} else if(waitpid(child, &child_status, 0) == -1) {
ERR_DE << "open_in_file_manager(): waitpid() failed\n";
ERR_DU << "open_in_file_manager(): waitpid() failed\n";
return false;
}
if(child_status) {
if(WIFEXITED(child_status)) {
ERR_DE << "open_in_file_manager(): " << launcher << " returned "
ERR_DU << "open_in_file_manager(): " << launcher << " returned "
<< WEXITSTATUS(child_status) << '\n';
} else {
ERR_DE << "open_in_file_manager(): " << launcher << " failed\n";
ERR_DU << "open_in_file_manager(): " << launcher << " failed\n";
}
return false;
@ -80,14 +80,14 @@ bool open_in_file_manager(const std::string& path)
#elif defined(_WIN32)
LOG_DE << "open_in_file_manager(): on Win32, will use ShellExecute()\n";
LOG_DU << "open_in_file_manager(): on Win32, will use ShellExecute()\n";
wide_string wpath = utils::string_to_wstring(path);
wpath.push_back(wchar_t(0)); // Make wpath NULL-terminated
const ptrdiff_t res = reinterpret_cast<ptrdiff_t>(ShellExecute(NULL, L"open", &wpath.front(), NULL, NULL, SW_SHOW));
if(res <= 32) {
ERR_DE << "open_in_file_manager(): ShellExecute() failed (" << res << ")\n";
ERR_DU << "open_in_file_manager(): ShellExecute() failed (" << res << ")\n";
return false;
}
@ -95,7 +95,7 @@ bool open_in_file_manager(const std::string& path)
#else
ERR_DE << "open_in_file_manager(): unsupported platform\n";
ERR_DU << "open_in_file_manager(): unsupported platform\n";
return false;
#endif