From 586a5f786f9af3ddccdb6eba16fd529a5e88ed4c Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 15 Oct 2011 09:34:36 +0000 Subject: Raw TQt conversion of kiosktool git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kiosktool@1258970 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kiosktool/kiosktool-kdedirs.cpp | 52 ++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'kiosktool/kiosktool-kdedirs.cpp') diff --git a/kiosktool/kiosktool-kdedirs.cpp b/kiosktool/kiosktool-kdedirs.cpp index 3aaa0b7..99f6548 100644 --- a/kiosktool/kiosktool-kdedirs.cpp +++ b/kiosktool/kiosktool-kdedirs.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include @@ -39,19 +39,19 @@ static const char *description = I18N_NOOP("A tool to set $KDEDIRS according to the current user profile."); -static QString readEnvPath(const char *env) +static TQString readEnvPath(const char *env) { - QCString c_path = getenv(env); + TQCString c_path = getenv(env); if (c_path.isEmpty()) - return QString::null; - return QFile::decodeName(c_path); + return TQString(); + return TQFile::decodeName(c_path); } -static QStringList lookupProfiles(const QString &mapFile) +static TQStringList lookupProfiles(const TQString &mapFile) { - QStringList profiles; + TQStringList profiles; - if (mapFile.isEmpty() || !QFile::exists(mapFile)) + if (mapFile.isEmpty() || !TQFile::exists(mapFile)) { profiles << "default"; return profiles; @@ -64,7 +64,7 @@ static QStringList lookupProfiles(const QString &mapFile) return profiles; // Not good } - QCString user = pw->pw_name; + TQCString user = pw->pw_name; gid_t sup_gids[512]; int sup_gids_nr = getgroups(512, sup_gids); @@ -78,14 +78,14 @@ static QStringList lookupProfiles(const QString &mapFile) } mapCfg.setGroup("General"); - QStringList groups = mapCfg.readListEntry("groups"); + TQStringList groups = mapCfg.readListEntry("groups"); mapCfg.setGroup("Groups"); - for( QStringList::ConstIterator it = groups.begin(); + for( TQStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it ) { - QCString grp = (*it).utf8(); + TQCString grp = (*it).utf8(); // Check if user is in this group struct group *grp_ent = getgrnam(grp); if (!grp_ent) continue; @@ -132,22 +132,22 @@ int main(int argc, char **argv) if (args->isSet("check")) { (void) KGlobal::config(); // Force config file processing - QString dirs = KGlobal::dirs()->kfsstnd_prefixes(); - printf("%s\n", QFile::encodeName(dirs).data()); + TQString dirs = KGlobal::dirs()->kfsstnd_prefixes(); + printf("%s\n", TQFile::encodeName(dirs).data()); return 0; } - QStringList kdedirList; + TQStringList kdedirList; // begin KDEDIRS - QString kdedirs = readEnvPath("KDEDIRS"); + TQString kdedirs = readEnvPath("KDEDIRS"); if (!kdedirs.isEmpty()) { - kdedirList = QStringList::split(":", kdedirs); + kdedirList = TQStringList::split(":", kdedirs); } else { - QString kdedir = readEnvPath("KDEDIR"); + TQString kdedir = readEnvPath("KDEDIR"); if (!kdedir.isEmpty()) { kdedir = KShell::tildeExpand(kdedir); @@ -157,19 +157,19 @@ int main(int argc, char **argv) KConfig *config = KGlobal::config(); config->setGroup("Directories"); - QString userMapFile = config->readEntry("userProfileMapFile"); - QString profileDirsPrefix = config->readEntry("profileDirsPrefix"); + TQString userMapFile = config->readEntry("userProfileMapFile"); + TQString profileDirsPrefix = config->readEntry("profileDirsPrefix"); if (!profileDirsPrefix.isEmpty() && !profileDirsPrefix.endsWith("/")) profileDirsPrefix.append('/'); - QStringList profiles = lookupProfiles(userMapFile); + TQStringList profiles = lookupProfiles(userMapFile); while(!profiles.isEmpty()) { - QString profile = profiles.back(); - config->setGroup(QString::fromLatin1("Directories-%1").arg(profile)); + TQString profile = profiles.back(); + config->setGroup(TQString::tqfromLatin1("Directories-%1").tqarg(profile)); profiles.pop_back(); - QStringList list = config->readListEntry("prefixes"); - for (QStringList::ConstIterator it = list.begin(); it != list.end(); it++) + TQStringList list = config->readListEntry("prefixes"); + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); it++) { kdedirList.prepend(*it); } @@ -178,7 +178,7 @@ int main(int argc, char **argv) kdedirList.prepend(profileDirsPrefix + profile); } } - printf("%s\n", QFile::encodeName(kdedirList.join(":")).data()); + printf("%s\n", TQFile::encodeName(kdedirList.join(":")).data()); return 0; } -- cgit v1.2.3