libreofficekit/qa/gtktiledviewer/gtv-helpers.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
New commits: commit 30198f6006ee585904b05917dd2e41f72ab9df98 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Oct 21 23:10:00 2022 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sat Oct 22 09:31:56 2022 +0200 Use g_get_user_name instead of access through getpwuid It is more portable - available also on Windows Change-Id: I424e1993ad9621ca42b6f48896d5025832ac681e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141584 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> (cherry picked from commit 66fcc9db0f7eacd0ebda06d9ee634af2d0e73d04) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141585 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/libreofficekit/qa/gtktiledviewer/gtv-helpers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-helpers.cxx index b557fe4ba99b..109b0946366a 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-helpers.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-helpers.cxx @@ -9,8 +9,6 @@ #include <gtk/gtk.h> -#include <pwd.h> - #include <cstring> #include "gtv-helpers.hxx" @@ -94,8 +92,7 @@ void GtvHelpers::clipboardSetHtml(GtkClipboard* pClipboard, const char* pSelecti std::string GtvHelpers::getNextAuthor() { static int nCounter = 0; - struct passwd* pPasswd = getpwuid(getuid()); - return std::string(pPasswd->pw_gecos) + " #" + std::to_string(++nCounter); + return std::string(g_get_user_name()) + " #" + std::to_string(++nCounter); } GtkWidget* GtvHelpers::createCommentBox(const boost::property_tree::ptree& aComment)