From d1822cefd65a8a78eebbb7a4da967b0406e91a0f Mon Sep 17 00:00:00 2001 From: "craig.p.drummond@gmail.com" Date: Tue, 21 Aug 2012 11:06:42 +0000 Subject: [PATCH] Use "users" group and not "audio" when setting the group ID of covers, lyrics, and audio files. BUG:54 --- ChangeLog | 2 ++ application.cpp | 6 +++--- devices/utils.cpp | 10 +++++----- devices/utils.h | 2 +- po/cantata.pot | 6 +----- po/cs.po | 8 ++------ po/de.po | 8 ++------ po/es.po | 8 ++------ po/pl.po | 8 ++------ 9 files changed, 20 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 844b9d9f3..c9364035f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,6 +40,8 @@ where each track may have a different year. 26. To be consistent, use the year of the lowest track number to be an album's year. +27. Use "users" group and not "audio" when setting the group ID of covers, + lyrics, and audio files. 0.8.2 ----- diff --git a/application.cpp b/application.cpp index 4b8d0dfab..de083f665 100644 --- a/application.cpp +++ b/application.cpp @@ -71,13 +71,13 @@ int Application::newInstance() { w->showNormal(); } } else { - if (0==Utils::getAudioGroupId() && KMessageBox::Cancel==KMessageBox::warningContinueCancel(0, - i18n("You are not currently a member of the \"audio\" group. " + if (0==Utils::getGroupId() && KMessageBox::Cancel==KMessageBox::warningContinueCancel(0, + i18n("You are not currently a member of the \"users\" group. " "Cantata will function better (saving of album covers, lyrics, etc. with the correct permissions) if you " "(or your administrator) add yourself to this group.\n\n" "Note, that if you do add yourself you will need to logout and back in for this to take effect.\n\n" "Select \"Continue\" to start Cantata as is."), - i18n("Audio Group"), KStandardGuiItem::cont(), KStandardGuiItem::cancel(), "audioGroupWarning")) { + QString(), KStandardGuiItem::cont(), KStandardGuiItem::cancel(), "groupWarning")) { QApplication::exit(0); } w=new MainWindow(); diff --git a/devices/utils.cpp b/devices/utils.cpp index bb4681842..d5951a4bb 100644 --- a/devices/utils.cpp +++ b/devices/utils.cpp @@ -194,7 +194,7 @@ void Utils::cleanDir(const QString &dir, const QString &base, const QString &cov } #ifndef Q_OS_WIN -gid_t Utils::getAudioGroupId() +gid_t Utils::getGroupId() { static bool init=false; static gid_t gid=0; @@ -211,7 +211,7 @@ gid_t Utils::getAudioGroupId() return gid; } - struct group *audioGroup=getgrnam("audio"); + struct group *audioGroup=getgrnam("users"); if (audioGroup) { for (int i=0; audioGroup->gr_mem[i]; ++i) { @@ -226,14 +226,14 @@ gid_t Utils::getAudioGroupId() /* * Set file permissions. - * If user is a memeber of "audio" group, then set file as owned by and writeable by "audio" group. + * If user is a memeber of "users" group, then set file as owned by and writeable by "users" group. */ void Utils::setFilePerms(const QString &file) { // // Clear any umask before setting file perms mode_t oldMask(umask(0000)); - gid_t gid=getAudioGroupId(); + gid_t gid=getGroupId(); QByteArray fn=QFile::encodeName(file); ::chmod(fn.constData(), 0==gid ? 0644 : 0664); if (0!=gid) { @@ -262,7 +262,7 @@ bool Utils::createDir(const QString &dir, const QString &base) // // Clear any umask before dir is created mode_t oldMask(umask(0000)); - gid_t gid=base.isEmpty() ? 0 : getAudioGroupId(); + gid_t gid=base.isEmpty() ? 0 : getGroupId(); #endif #ifdef ENABLE_KDE_SUPPORT bool status(KStandardDirs::makeDir(dir, 0==gid ? 0755 : 0775)); diff --git a/devices/utils.h b/devices/utils.h index c6a5bc637..8b5ceac95 100644 --- a/devices/utils.h +++ b/devices/utils.h @@ -46,7 +46,7 @@ namespace Utils extern void moveDir(const QString &from, const QString &to, const QString &base, const QString &coverFile); extern void cleanDir(const QString &dir, const QString &base, const QString &coverFile, int level=0); #ifndef Q_OS_WIN - extern gid_t getAudioGroupId(); // Return 0 if user is not in audio group, otherwise returns audio group ID + extern gid_t getGroupId(); // Return 0 if user is not in audio group, otherwise returns audio group ID #endif extern void setFilePerms(const QString &file); extern bool createDir(const QString &dir, const QString &base); diff --git a/po/cantata.pot b/po/cantata.pot index 8b85ff981..7fd070fa8 100644 --- a/po/cantata.pot +++ b/po/cantata.pot @@ -20,7 +20,7 @@ msgstr "" #: application.cpp:67 msgid "" -"You are not currently a member of the \"audio\" group. Cantata will function " +"You are not currently a member of the \"users\" group. Cantata will function " "better (saving of album covers, lyrics, etc. with the correct permissions) " "if you (or your administrator) add yourself to this group.\n" "\n" @@ -30,10 +30,6 @@ msgid "" "Select \"Continue\" to start Cantata as is." msgstr "" -#: application.cpp:72 -msgid "Audio Group" -msgstr "" - #: devices/actiondialog.cpp:118 devices/mtpdevice.cpp:807 #: devices/remotefsdevice.cpp:360 devices/umsdevice.cpp:90 msgid "%1 free" diff --git a/po/cs.po b/po/cs.po index bd7ebfb19..ff6fd5c4c 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgstr "" #: application.cpp:67 msgid "" -"You are not currently a member of the \"audio\" group. Cantata will function " +"You are not currently a member of the \"users\" group. Cantata will function " "better (saving of album covers, lyrics, etc. with the correct permissions) " "if you (or your administrator) add yourself to this group.\n" "\n" @@ -30,7 +30,7 @@ msgid "" "\n" "Select \"Continue\" to start Cantata as is." msgstr "" -"Nyní nejste členem skupiny zvuk (audio). Cantata bude pracovat lépe " +"Nyní nejste členem skupiny zvuk (users). Cantata bude pracovat lépe " "(ukládání obalů alb, textů písní atd. se správnými oprávněními), pokud vy " "(nebo váš správce systému) přidáte sebe sama do této skupiny.\n" "\n" @@ -39,10 +39,6 @@ msgstr "" "\n" "Vyberte \"Pokračovat\" pro spuštění Cantaty, jak je." -#: application.cpp:72 -msgid "Audio Group" -msgstr "Skupina zvuk" - #: devices/actiondialog.cpp:118 devices/mtpdevice.cpp:807 #: devices/remotefsdevice.cpp:360 devices/umsdevice.cpp:90 msgid "%1 free" diff --git a/po/de.po b/po/de.po index a78781fbc..9b93d420e 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgstr "" #: application.cpp:67 msgid "" -"You are not currently a member of the \"audio\" group. Cantata will function " +"You are not currently a member of the \"users\" group. Cantata will function " "better (saving of album covers, lyrics, etc. with the correct permissions) " "if you (or your administrator) add yourself to this group.\n" "\n" @@ -31,7 +31,7 @@ msgid "" "\n" "Select \"Continue\" to start Cantata as is." msgstr "" -"Du bist aktuell nicht Mitglied der \"audio\" Gruppe. Cantata wird erst " +"Du bist aktuell nicht Mitglied der \"users\" Gruppe. Cantata wird erst " "richtig funktionieren (speichern von Albencovern, Texten usw.) wenn Du " "(oder der Systemadministrator) Dich dieser Gruppe hinzufügt.\n" "\n" @@ -40,10 +40,6 @@ msgstr "" "\n" "Wähler \"Weiter\" um einfach fortzufahren." -#: application.cpp:72 -msgid "Audio Group" -msgstr "Audio Gruppe" - #: devices/actiondialog.cpp:118 devices/mtpdevice.cpp:807 #: devices/remotefsdevice.cpp:360 devices/umsdevice.cpp:90 msgid "%1 free" diff --git a/po/es.po b/po/es.po index 98c835a76..92b1032fd 100644 --- a/po/es.po +++ b/po/es.po @@ -19,7 +19,7 @@ msgstr "" #: application.cpp:67 msgid "" -"You are not currently a member of the \"audio\" group. Cantata will function " +"You are not currently a member of the \"users\" group. Cantata will function " "better (saving of album covers, lyrics, etc. with the correct permissions) " "if you (or your administrator) add yourself to this group.\n" "\n" @@ -28,7 +28,7 @@ msgid "" "\n" "Select \"Continue\" to start Cantata as is." msgstr "" -"No es un miembro del grupo «audio». Cantata funciona mejor (almacenar " +"No es un miembro del grupo «users». Cantata funciona mejor (almacenar " "portadas de álbum, letras y más con los permisos adecuados) si Ud. o el " "administrador incluyen al usuario en el grupo.\n" "\n" @@ -37,10 +37,6 @@ msgstr "" "\n" "Seleccione «Continuar» para iniciar Cantata con la configuración actual." -#: application.cpp:72 -msgid "Audio Group" -msgstr "Grupo de audio" - #: devices/actiondialog.cpp:118 devices/mtpdevice.cpp:807 #: devices/remotefsdevice.cpp:360 devices/umsdevice.cpp:90 msgid "%1 free" diff --git a/po/pl.po b/po/pl.po index af964b195..80d499e50 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgstr "" #: application.cpp:67 msgid "" -"You are not currently a member of the \"audio\" group. Cantata will function " +"You are not currently a member of the \"users\" group. Cantata will function " "better (saving of album covers, lyrics, etc. with the correct permissions) " "if you (or your administrator) add yourself to this group.\n" "\n" @@ -30,7 +30,7 @@ msgid "" "\n" "Select \"Continue\" to start Cantata as is." msgstr "" -"Nie jesteś obecnie użytkownikiem należącym do grupy \"audio\". Cantata " +"Nie jesteś obecnie użytkownikiem należącym do grupy \"users\". Cantata " "będzie działać znacznie lepiej (zapisywanie okładek albumów, tekstów, etc. z " "odpowiednimi uprawnieniami), jeśli zostaniesz dodany do tej grupy.\n" "\n" @@ -38,10 +38,6 @@ msgstr "" "zalogowania użytkownika.\n" "Wybierz \"Kontynuuj\" by mimo to uruchomić program Cantata." -#: application.cpp:72 -msgid "Audio Group" -msgstr "Grupa Audio" - #: devices/actiondialog.cpp:118 devices/mtpdevice.cpp:807 #: devices/remotefsdevice.cpp:360 devices/umsdevice.cpp:90 msgid "%1 free"