00001 /* 00002 * $Id$ 00003 * Kockpit - an Qt application for user/group management on unix based systems. 00004 * 00005 * Copyright (C) 2010 Julian Thome 00006 * 00007 * This program is free software; you can redistribute it and/or modify it under the terms of 00008 * the GNU General Public License as published by the Free Software Foundation; 00009 * either version 3 of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00012 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00013 * See the GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along with this program; 00016 * if not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #ifndef KOCKPITHELPERS_H 00020 #define KOCKPITHELPERS_H 00021 00022 #include <kockpitunitmap.h> 00023 #include <QtGui> 00024 #include <QVariant> 00025 00027 00030 namespace KockpitHelpers { 00031 00033 00041 bool idAlreadyUsed(QList<KockpitUnitMap*>* klist, const QString &id); 00042 00044 00052 KockpitGroup* getPrimaryGroupByGid(const QList<KockpitUnitMap*>* kgmap, int gidNumber); 00053 00055 00061 KockpitGroup* getKockpitGroupFromQListWidgetItem(QListWidgetItem *item); 00062 00064 00070 KockpitUser* getKockpitUserFromQListWidgetItem(QListWidgetItem *item); 00071 00073 00077 void secDel(QObject *p); 00078 00080 00085 void deleteListObjects(QList<KockpitUnitMap*> &list); 00086 00087 00089 00093 void deleteListMaps(QList<KockpitUnitMap*> &list); 00094 00096 00103 QDir directoryOf(const QString &subdir); 00104 } 00105 #endif // KOCKPITHELPERS_H