Changeset View
Changeset View
Standalone View
Standalone View
krusader/FileSystem/krpermhandler.cpp
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 65 | { | |||
---|---|---|---|---|---|
69 | // 200 groups should be enough | 69 | // 200 groups should be enough | ||
70 | gid_t groupList[200]; | 70 | gid_t groupList[200]; | ||
71 | int groupNo = getgroups(200, groupList); | 71 | int groupNo = getgroups(200, groupList); | ||
72 | 72 | | |||
73 | // In kdewin32 implementation as of 4.1.2, getpwent always returns the same struct | 73 | // In kdewin32 implementation as of 4.1.2, getpwent always returns the same struct | ||
74 | #ifndef Q_WS_WIN | 74 | #ifndef Q_WS_WIN | ||
75 | // fill the UID cache | 75 | // fill the UID cache | ||
76 | struct passwd *pass; | 76 | struct passwd *pass; | ||
77 | while ((pass = getpwent()) != 0L) { | 77 | while ((pass = getpwent()) != nullptr) { | ||
78 | uidCache.insert(pass->pw_uid, pass->pw_name); | 78 | uidCache.insert(pass->pw_uid, pass->pw_name); | ||
79 | } | 79 | } | ||
80 | delete pass; | 80 | delete pass; | ||
81 | endpwent(); | 81 | endpwent(); | ||
82 | 82 | | |||
83 | // fill the GID cache | 83 | // fill the GID cache | ||
84 | struct group *gr; | 84 | struct group *gr; | ||
85 | while ((gr = getgrent()) != 0L) { | 85 | while ((gr = getgrent()) != nullptr) { | ||
86 | gidCache.insert(gr->gr_gid, QString(gr->gr_name)); | 86 | gidCache.insert(gr->gr_gid, QString(gr->gr_name)); | ||
87 | } | 87 | } | ||
88 | delete gr; | 88 | delete gr; | ||
89 | endgrent(); | 89 | endgrent(); | ||
90 | #endif | 90 | #endif | ||
91 | 91 | | |||
92 | // fill the groups for the current user | 92 | // fill the groups for the current user | ||
93 | for (int i = 0; i < groupNo; ++i) { | 93 | for (int i = 0; i < groupNo; ++i) { | ||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |