|
|
@ -57,10 +57,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
template class TQDict<TQStringList>;
|
|
|
|
template class TQDict<TQStringList>;
|
|
|
|
|
|
|
|
|
|
|
|
class KStandardDirs::KStandardDirsPrivate
|
|
|
|
class TDEStandardDirs::TDEStandardDirsPrivate
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
KStandardDirsPrivate()
|
|
|
|
TDEStandardDirsPrivate()
|
|
|
|
: restrictionsActive(false),
|
|
|
|
: restrictionsActive(false),
|
|
|
|
dataRestrictionActive(false),
|
|
|
|
dataRestrictionActive(false),
|
|
|
|
checkRestrictions(true)
|
|
|
|
checkRestrictions(true)
|
|
|
@ -76,20 +76,20 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
// Singleton, with data shared by all kstandarddirs instances.
|
|
|
|
// Singleton, with data shared by all kstandarddirs instances.
|
|
|
|
// Used in static methods like findExe()
|
|
|
|
// Used in static methods like findExe()
|
|
|
|
class KStandardDirsSingleton
|
|
|
|
class TDEStandardDirsSingleton
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
TQString defaultprefix;
|
|
|
|
TQString defaultprefix;
|
|
|
|
TQString defaultbindir;
|
|
|
|
TQString defaultbindir;
|
|
|
|
static KStandardDirsSingleton* self();
|
|
|
|
static TDEStandardDirsSingleton* self();
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
static KStandardDirsSingleton* s_self;
|
|
|
|
static TDEStandardDirsSingleton* s_self;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
static KStaticDeleter<KStandardDirsSingleton> kstds_sd;
|
|
|
|
static KStaticDeleter<TDEStandardDirsSingleton> kstds_sd;
|
|
|
|
KStandardDirsSingleton* KStandardDirsSingleton::s_self = 0;
|
|
|
|
TDEStandardDirsSingleton* TDEStandardDirsSingleton::s_self = 0;
|
|
|
|
KStandardDirsSingleton* KStandardDirsSingleton::self() {
|
|
|
|
TDEStandardDirsSingleton* TDEStandardDirsSingleton::self() {
|
|
|
|
if ( !s_self )
|
|
|
|
if ( !s_self )
|
|
|
|
kstds_sd.setObject( s_self, new KStandardDirsSingleton );
|
|
|
|
kstds_sd.setObject( s_self, new TDEStandardDirsSingleton );
|
|
|
|
return s_self;
|
|
|
|
return s_self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -105,9 +105,9 @@ static const char* const types[] = {"html", "html-bundle", "icon", "apps", "soun
|
|
|
|
static int tokenize( TQStringList& token, const TQString& str,
|
|
|
|
static int tokenize( TQStringList& token, const TQString& str,
|
|
|
|
const TQString& delim );
|
|
|
|
const TQString& delim );
|
|
|
|
|
|
|
|
|
|
|
|
KStandardDirs::KStandardDirs( ) : addedCustoms(false)
|
|
|
|
TDEStandardDirs::TDEStandardDirs( ) : addedCustoms(false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
d = new KStandardDirsPrivate;
|
|
|
|
d = new TDEStandardDirsPrivate;
|
|
|
|
dircache.setAutoDelete(true);
|
|
|
|
dircache.setAutoDelete(true);
|
|
|
|
relatives.setAutoDelete(true);
|
|
|
|
relatives.setAutoDelete(true);
|
|
|
|
absolutes.setAutoDelete(true);
|
|
|
|
absolutes.setAutoDelete(true);
|
|
|
@ -115,12 +115,12 @@ KStandardDirs::KStandardDirs( ) : addedCustoms(false)
|
|
|
|
addKDEDefaults();
|
|
|
|
addKDEDefaults();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KStandardDirs::~KStandardDirs()
|
|
|
|
TDEStandardDirs::~TDEStandardDirs()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
delete d;
|
|
|
|
delete d;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool KStandardDirs::isRestrictedResource(const char *type, const TQString& relPath) const
|
|
|
|
bool TDEStandardDirs::isRestrictedResource(const char *type, const TQString& relPath) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!d || !d->restrictionsActive)
|
|
|
|
if (!d || !d->restrictionsActive)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -140,7 +140,7 @@ bool KStandardDirs::isRestrictedResource(const char *type, const TQString& relPa
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::applyDataRestrictions(const TQString &relPath) const
|
|
|
|
void TDEStandardDirs::applyDataRestrictions(const TQString &relPath) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString key;
|
|
|
|
TQString key;
|
|
|
|
int i = relPath.find(QChar('/'));
|
|
|
|
int i = relPath.find(QChar('/'));
|
|
|
@ -154,7 +154,7 @@ void KStandardDirs::applyDataRestrictions(const TQString &relPath) const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList KStandardDirs::allTypes() const
|
|
|
|
TQStringList TDEStandardDirs::allTypes() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQStringList list;
|
|
|
|
TQStringList list;
|
|
|
|
for (int i = 0; types[i] != 0; ++i)
|
|
|
|
for (int i = 0; types[i] != 0; ++i)
|
|
|
@ -177,12 +177,12 @@ static void priorityAdd(TQStringList &prefixes, const TQString& dir, bool priori
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::addPrefix( const TQString& _dir )
|
|
|
|
void TDEStandardDirs::addPrefix( const TQString& _dir )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
addPrefix(_dir, false);
|
|
|
|
addPrefix(_dir, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::addPrefix( const TQString& _dir, bool priority )
|
|
|
|
void TDEStandardDirs::addPrefix( const TQString& _dir, bool priority )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_dir.isEmpty())
|
|
|
|
if (_dir.isEmpty())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -197,12 +197,12 @@ void KStandardDirs::addPrefix( const TQString& _dir, bool priority )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::addXdgConfigPrefix( const TQString& _dir )
|
|
|
|
void TDEStandardDirs::addXdgConfigPrefix( const TQString& _dir )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
addXdgConfigPrefix(_dir, false);
|
|
|
|
addXdgConfigPrefix(_dir, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::addXdgConfigPrefix( const TQString& _dir, bool priority )
|
|
|
|
void TDEStandardDirs::addXdgConfigPrefix( const TQString& _dir, bool priority )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_dir.isEmpty())
|
|
|
|
if (_dir.isEmpty())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -217,12 +217,12 @@ void KStandardDirs::addXdgConfigPrefix( const TQString& _dir, bool priority )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::addXdgDataPrefix( const TQString& _dir )
|
|
|
|
void TDEStandardDirs::addXdgDataPrefix( const TQString& _dir )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
addXdgDataPrefix(_dir, false);
|
|
|
|
addXdgDataPrefix(_dir, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::addXdgDataPrefix( const TQString& _dir, bool priority )
|
|
|
|
void TDEStandardDirs::addXdgDataPrefix( const TQString& _dir, bool priority )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_dir.isEmpty())
|
|
|
|
if (_dir.isEmpty())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -237,27 +237,27 @@ void KStandardDirs::addXdgDataPrefix( const TQString& _dir, bool priority )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::kfsstnd_prefixes()
|
|
|
|
TQString TDEStandardDirs::kfsstnd_prefixes()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return prefixes.join(TQChar(KPATH_SEPARATOR));
|
|
|
|
return prefixes.join(TQChar(KPATH_SEPARATOR));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::kfsstnd_xdg_conf_prefixes()
|
|
|
|
TQString TDEStandardDirs::kfsstnd_xdg_conf_prefixes()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return d->xdgconf_prefixes.join(TQChar(KPATH_SEPARATOR));
|
|
|
|
return d->xdgconf_prefixes.join(TQChar(KPATH_SEPARATOR));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::kfsstnd_xdg_data_prefixes()
|
|
|
|
TQString TDEStandardDirs::kfsstnd_xdg_data_prefixes()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return d->xdgdata_prefixes.join(TQChar(KPATH_SEPARATOR));
|
|
|
|
return d->xdgdata_prefixes.join(TQChar(KPATH_SEPARATOR));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool KStandardDirs::addResourceType( const char *type,
|
|
|
|
bool TDEStandardDirs::addResourceType( const char *type,
|
|
|
|
const TQString& relativename )
|
|
|
|
const TQString& relativename )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return addResourceType(type, relativename, true);
|
|
|
|
return addResourceType(type, relativename, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool KStandardDirs::addResourceType( const char *type,
|
|
|
|
bool TDEStandardDirs::addResourceType( const char *type,
|
|
|
|
const TQString& relativename,
|
|
|
|
const TQString& relativename,
|
|
|
|
bool priority )
|
|
|
|
bool priority )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -283,14 +283,14 @@ bool KStandardDirs::addResourceType( const char *type,
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool KStandardDirs::addResourceDir( const char *type,
|
|
|
|
bool TDEStandardDirs::addResourceDir( const char *type,
|
|
|
|
const TQString& absdir)
|
|
|
|
const TQString& absdir)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// KDE4: change priority to bring in line with addResourceType
|
|
|
|
// KDE4: change priority to bring in line with addResourceType
|
|
|
|
return addResourceDir(type, absdir, false);
|
|
|
|
return addResourceDir(type, absdir, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool KStandardDirs::addResourceDir( const char *type,
|
|
|
|
bool TDEStandardDirs::addResourceDir( const char *type,
|
|
|
|
const TQString& absdir,
|
|
|
|
const TQString& absdir,
|
|
|
|
bool priority)
|
|
|
|
bool priority)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -314,7 +314,7 @@ bool KStandardDirs::addResourceDir( const char *type,
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::findResource( const char *type,
|
|
|
|
TQString TDEStandardDirs::findResource( const char *type,
|
|
|
|
const TQString& filename ) const
|
|
|
|
const TQString& filename ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!TQDir::isRelativePath(filename))
|
|
|
|
if (!TQDir::isRelativePath(filename))
|
|
|
@ -349,7 +349,7 @@ static TQ_UINT32 updateHash(const TQString &file, TQ_UINT32 hash)
|
|
|
|
return hash;
|
|
|
|
return hash;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQ_UINT32 KStandardDirs::calcResourceHash( const char *type,
|
|
|
|
TQ_UINT32 TDEStandardDirs::calcResourceHash( const char *type,
|
|
|
|
const TQString& filename, bool deep) const
|
|
|
|
const TQString& filename, bool deep) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQ_UINT32 hash = 0;
|
|
|
|
TQ_UINT32 hash = 0;
|
|
|
@ -375,7 +375,7 @@ TQ_UINT32 KStandardDirs::calcResourceHash( const char *type,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList KStandardDirs::findDirs( const char *type,
|
|
|
|
TQStringList TDEStandardDirs::findDirs( const char *type,
|
|
|
|
const TQString& reldir ) const
|
|
|
|
const TQString& reldir ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQDir testdir;
|
|
|
|
TQDir testdir;
|
|
|
@ -409,12 +409,12 @@ TQStringList KStandardDirs::findDirs( const char *type,
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::findResourceDir( const char *type,
|
|
|
|
TQString TDEStandardDirs::findResourceDir( const char *type,
|
|
|
|
const TQString& filename) const
|
|
|
|
const TQString& filename) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifndef NDEBUG
|
|
|
|
#ifndef NDEBUG
|
|
|
|
if (filename.isEmpty()) {
|
|
|
|
if (filename.isEmpty()) {
|
|
|
|
fprintf(stderr, "filename for type %s in KStandardDirs::findResourceDir is not supposed to be empty!!", type);
|
|
|
|
fprintf(stderr, "filename for type %s in TDEStandardDirs::findResourceDir is not supposed to be empty!!", type);
|
|
|
|
return TQString::null;
|
|
|
|
return TQString::null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -430,7 +430,7 @@ TQString KStandardDirs::findResourceDir( const char *type,
|
|
|
|
#ifdef Q_WS_WIN //this ensures we're using installed .la files
|
|
|
|
#ifdef Q_WS_WIN //this ensures we're using installed .la files
|
|
|
|
if ((*it).isEmpty() && filename.right(3)==".la") {
|
|
|
|
if ((*it).isEmpty() && filename.right(3)==".la") {
|
|
|
|
#ifndef NDEBUG
|
|
|
|
#ifndef NDEBUG
|
|
|
|
fprintf(stderr, "KStandardDirs::findResourceDir() found .la in cwd: skipping. (fname=%s)\n", filename.ascii());
|
|
|
|
fprintf(stderr, "TDEStandardDirs::findResourceDir() found .la in cwd: skipping. (fname=%s)\n", filename.ascii());
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -447,7 +447,7 @@ TQString KStandardDirs::findResourceDir( const char *type,
|
|
|
|
return TQString::null;
|
|
|
|
return TQString::null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool KStandardDirs::exists(const TQString &fullPath)
|
|
|
|
bool TDEStandardDirs::exists(const TQString &fullPath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KDE_struct_stat buff;
|
|
|
|
KDE_struct_stat buff;
|
|
|
|
if ((access(TQFile::encodeName(fullPath), R_OK) == 0) && (KDE_stat( TQFile::encodeName(fullPath), &buff ) == 0)) {
|
|
|
|
if ((access(TQFile::encodeName(fullPath), R_OK) == 0) && (KDE_stat( TQFile::encodeName(fullPath), &buff ) == 0)) {
|
|
|
@ -620,7 +620,7 @@ static void lookupPrefix(const TQString& prefix, const TQString& relpath,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList
|
|
|
|
TQStringList
|
|
|
|
KStandardDirs::findAllResources( const char *type,
|
|
|
|
TDEStandardDirs::findAllResources( const char *type,
|
|
|
|
const TQString& filter,
|
|
|
|
const TQString& filter,
|
|
|
|
bool recursive,
|
|
|
|
bool recursive,
|
|
|
|
bool unique,
|
|
|
|
bool unique,
|
|
|
@ -676,7 +676,7 @@ KStandardDirs::findAllResources( const char *type,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList
|
|
|
|
TQStringList
|
|
|
|
KStandardDirs::findAllResources( const char *type,
|
|
|
|
TDEStandardDirs::findAllResources( const char *type,
|
|
|
|
const TQString& filter,
|
|
|
|
const TQString& filter,
|
|
|
|
bool recursive,
|
|
|
|
bool recursive,
|
|
|
|
bool unique) const
|
|
|
|
bool unique) const
|
|
|
@ -686,7 +686,7 @@ KStandardDirs::findAllResources( const char *type,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString
|
|
|
|
TQString
|
|
|
|
KStandardDirs::realPath(const TQString &dirname)
|
|
|
|
TDEStandardDirs::realPath(const TQString &dirname)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char realpath_buffer[MAXPATHLEN + 1];
|
|
|
|
char realpath_buffer[MAXPATHLEN + 1];
|
|
|
|
memset(realpath_buffer, 0, MAXPATHLEN + 1);
|
|
|
|
memset(realpath_buffer, 0, MAXPATHLEN + 1);
|
|
|
@ -704,7 +704,7 @@ KStandardDirs::realPath(const TQString &dirname)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString
|
|
|
|
TQString
|
|
|
|
KStandardDirs::realFilePath(const TQString &filename)
|
|
|
|
TDEStandardDirs::realFilePath(const TQString &filename)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char realpath_buffer[MAXPATHLEN + 1];
|
|
|
|
char realpath_buffer[MAXPATHLEN + 1];
|
|
|
|
memset(realpath_buffer, 0, MAXPATHLEN + 1);
|
|
|
|
memset(realpath_buffer, 0, MAXPATHLEN + 1);
|
|
|
@ -718,7 +718,7 @@ KStandardDirs::realFilePath(const TQString &filename)
|
|
|
|
return filename;
|
|
|
|
return filename;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::createSpecialResource(const char *type)
|
|
|
|
void TDEStandardDirs::createSpecialResource(const char *type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char hostname[256];
|
|
|
|
char hostname[256];
|
|
|
|
hostname[0] = 0;
|
|
|
|
hostname[0] = 0;
|
|
|
@ -792,17 +792,17 @@ void KStandardDirs::createSpecialResource(const char *type)
|
|
|
|
addResourceDir(type, dir+QChar('/'));
|
|
|
|
addResourceDir(type, dir+QChar('/'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList KStandardDirs::resourceDirs(const char *type) const
|
|
|
|
TQStringList TDEStandardDirs::resourceDirs(const char *type) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQStringList *candidates = dircache.find(type);
|
|
|
|
TQStringList *candidates = dircache.find(type);
|
|
|
|
|
|
|
|
|
|
|
|
if (!candidates) { // filling cache
|
|
|
|
if (!candidates) { // filling cache
|
|
|
|
if (strcmp(type, "socket") == 0)
|
|
|
|
if (strcmp(type, "socket") == 0)
|
|
|
|
const_cast<KStandardDirs *>(this)->createSpecialResource(type);
|
|
|
|
const_cast<TDEStandardDirs *>(this)->createSpecialResource(type);
|
|
|
|
else if (strcmp(type, "tmp") == 0)
|
|
|
|
else if (strcmp(type, "tmp") == 0)
|
|
|
|
const_cast<KStandardDirs *>(this)->createSpecialResource(type);
|
|
|
|
const_cast<TDEStandardDirs *>(this)->createSpecialResource(type);
|
|
|
|
else if (strcmp(type, "cache") == 0)
|
|
|
|
else if (strcmp(type, "cache") == 0)
|
|
|
|
const_cast<KStandardDirs *>(this)->createSpecialResource(type);
|
|
|
|
const_cast<TDEStandardDirs *>(this)->createSpecialResource(type);
|
|
|
|
|
|
|
|
|
|
|
|
TQDir testdir;
|
|
|
|
TQDir testdir;
|
|
|
|
|
|
|
|
|
|
|
@ -883,7 +883,7 @@ TQStringList KStandardDirs::resourceDirs(const char *type) const
|
|
|
|
return *candidates;
|
|
|
|
return *candidates;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList KStandardDirs::systemPaths( const TQString& pstr )
|
|
|
|
TQStringList TDEStandardDirs::systemPaths( const TQString& pstr )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQStringList tokens;
|
|
|
|
TQStringList tokens;
|
|
|
|
TQString p = pstr;
|
|
|
|
TQString p = pstr;
|
|
|
@ -929,7 +929,7 @@ TQStringList KStandardDirs::systemPaths( const TQString& pstr )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::findExe( const TQString& appname,
|
|
|
|
TQString TDEStandardDirs::findExe( const TQString& appname,
|
|
|
|
const TQString& pstr, bool ignore)
|
|
|
|
const TQString& pstr, bool ignore)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
@ -978,7 +978,7 @@ TQString KStandardDirs::findExe( const TQString& appname,
|
|
|
|
return TQString::null;
|
|
|
|
return TQString::null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int KStandardDirs::findAllExe( TQStringList& list, const TQString& appname,
|
|
|
|
int TDEStandardDirs::findAllExe( TQStringList& list, const TQString& appname,
|
|
|
|
const TQString& pstr, bool ignore )
|
|
|
|
const TQString& pstr, bool ignore )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
@ -1033,7 +1033,7 @@ static int tokenize( TQStringList& tokens, const TQString& str,
|
|
|
|
return tokens.count();
|
|
|
|
return tokens.count();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::kde_default(const char *type) {
|
|
|
|
TQString TDEStandardDirs::kde_default(const char *type) {
|
|
|
|
if (!strcmp(type, "data"))
|
|
|
|
if (!strcmp(type, "data"))
|
|
|
|
return "share/apps/";
|
|
|
|
return "share/apps/";
|
|
|
|
if (!strcmp(type, "html-bundle"))
|
|
|
|
if (!strcmp(type, "html-bundle"))
|
|
|
@ -1096,7 +1096,7 @@ TQString KStandardDirs::kde_default(const char *type) {
|
|
|
|
return TQString::null;
|
|
|
|
return TQString::null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::saveLocation(const char *type,
|
|
|
|
TQString TDEStandardDirs::saveLocation(const char *type,
|
|
|
|
const TQString& suffix,
|
|
|
|
const TQString& suffix,
|
|
|
|
bool create) const
|
|
|
|
bool create) const
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1127,7 +1127,7 @@ TQString KStandardDirs::saveLocation(const char *type,
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
dirs = absolutes.find(type);
|
|
|
|
dirs = absolutes.find(type);
|
|
|
|
if (!dirs)
|
|
|
|
if (!dirs)
|
|
|
|
tqFatal("KStandardDirs: The resource type %s is not registered", type);
|
|
|
|
tqFatal("TDEStandardDirs: The resource type %s is not registered", type);
|
|
|
|
pPath = new TQString(realPath(dirs->last()));
|
|
|
|
pPath = new TQString(realPath(dirs->last()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1151,7 +1151,7 @@ TQString KStandardDirs::saveLocation(const char *type,
|
|
|
|
return fullPath;
|
|
|
|
return fullPath;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::relativeLocation(const char *type, const TQString &absPath)
|
|
|
|
TQString TDEStandardDirs::relativeLocation(const char *type, const TQString &absPath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString fullPath = absPath;
|
|
|
|
TQString fullPath = absPath;
|
|
|
|
int i = absPath.findRev('/');
|
|
|
|
int i = absPath.findRev('/');
|
|
|
@ -1173,7 +1173,7 @@ TQString KStandardDirs::relativeLocation(const char *type, const TQString &absPa
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool KStandardDirs::makeDir(const TQString& dir, int mode)
|
|
|
|
bool TDEStandardDirs::makeDir(const TQString& dir, int mode)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// we want an absolute path
|
|
|
|
// we want an absolute path
|
|
|
|
if (TQDir::isRelativePath(dir))
|
|
|
|
if (TQDir::isRelativePath(dir))
|
|
|
@ -1254,9 +1254,9 @@ static TQString executablePrefix()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::kfsstnd_defaultprefix()
|
|
|
|
TQString TDEStandardDirs::kfsstnd_defaultprefix()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KStandardDirsSingleton* s = KStandardDirsSingleton::self();
|
|
|
|
TDEStandardDirsSingleton* s = TDEStandardDirsSingleton::self();
|
|
|
|
if (!s->defaultprefix.isEmpty())
|
|
|
|
if (!s->defaultprefix.isEmpty())
|
|
|
|
return s->defaultprefix;
|
|
|
|
return s->defaultprefix;
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
@ -1269,14 +1269,14 @@ TQString KStandardDirs::kfsstnd_defaultprefix()
|
|
|
|
s->defaultprefix = TDEDIR;
|
|
|
|
s->defaultprefix = TDEDIR;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if (s->defaultprefix.isEmpty()) {
|
|
|
|
if (s->defaultprefix.isEmpty()) {
|
|
|
|
fprintf(stderr, "KStandardDirs::kfsstnd_defaultprefix(): default TDE prefix not found!\n");
|
|
|
|
fprintf(stderr, "TDEStandardDirs::kfsstnd_defaultprefix(): default TDE prefix not found!\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return s->defaultprefix;
|
|
|
|
return s->defaultprefix;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::kfsstnd_defaultbindir()
|
|
|
|
TQString TDEStandardDirs::kfsstnd_defaultbindir()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KStandardDirsSingleton* s = KStandardDirsSingleton::self();
|
|
|
|
TDEStandardDirsSingleton* s = TDEStandardDirsSingleton::self();
|
|
|
|
if (!s->defaultbindir.isEmpty())
|
|
|
|
if (!s->defaultbindir.isEmpty())
|
|
|
|
return s->defaultbindir;
|
|
|
|
return s->defaultbindir;
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
|
#ifdef Q_WS_WIN
|
|
|
@ -1287,12 +1287,12 @@ TQString KStandardDirs::kfsstnd_defaultbindir()
|
|
|
|
s->defaultbindir = kfsstnd_defaultprefix() + TQString::fromLatin1("/bin");
|
|
|
|
s->defaultbindir = kfsstnd_defaultprefix() + TQString::fromLatin1("/bin");
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if (s->defaultbindir.isEmpty()) {
|
|
|
|
if (s->defaultbindir.isEmpty()) {
|
|
|
|
fprintf(stderr, "KStandardDirs::kfsstnd_defaultbindir(): default binary TDE dir not found!\n");
|
|
|
|
fprintf(stderr, "TDEStandardDirs::kfsstnd_defaultbindir(): default binary TDE dir not found!\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return s->defaultbindir;
|
|
|
|
return s->defaultbindir;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::addKDEDefaults()
|
|
|
|
void TDEStandardDirs::addKDEDefaults()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQStringList tdedirList;
|
|
|
|
TQStringList tdedirList;
|
|
|
|
|
|
|
|
|
|
|
@ -1459,10 +1459,10 @@ void KStandardDirs::addKDEDefaults()
|
|
|
|
addResourceDir("locale", "/usr/share/locale-langpack/", true);
|
|
|
|
addResourceDir("locale", "/usr/share/locale-langpack/", true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KStandardDirs::checkConfig() const
|
|
|
|
void TDEStandardDirs::checkConfig() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!addedCustoms && TDEGlobal::_instance && TDEGlobal::_instance->_config)
|
|
|
|
if (!addedCustoms && TDEGlobal::_instance && TDEGlobal::_instance->_config)
|
|
|
|
const_cast<KStandardDirs*>(this)->addCustomized(TDEGlobal::_instance->_config);
|
|
|
|
const_cast<TDEStandardDirs*>(this)->addCustomized(TDEGlobal::_instance->_config);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static TQStringList lookupProfiles(const TQString &mapFile)
|
|
|
|
static TQStringList lookupProfiles(const TQString &mapFile)
|
|
|
@ -1534,7 +1534,7 @@ static TQStringList lookupProfiles(const TQString &mapFile)
|
|
|
|
|
|
|
|
|
|
|
|
extern bool kde_kiosk_admin;
|
|
|
|
extern bool kde_kiosk_admin;
|
|
|
|
|
|
|
|
|
|
|
|
bool KStandardDirs::addCustomized(TDEConfig *config)
|
|
|
|
bool TDEStandardDirs::addCustomized(TDEConfig *config)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (addedCustoms && !d->checkRestrictions) // there are already customized entries
|
|
|
|
if (addedCustoms && !d->checkRestrictions) // there are already customized entries
|
|
|
|
return false; // we just quit and hope they are the right ones
|
|
|
|
return false; // we just quit and hope they are the right ones
|
|
|
@ -1666,19 +1666,19 @@ bool KStandardDirs::addCustomized(TDEConfig *config)
|
|
|
|
return configDirsChanged;
|
|
|
|
return configDirsChanged;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::localtdedir() const
|
|
|
|
TQString TDEStandardDirs::localtdedir() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Return the prefix to use for saving
|
|
|
|
// Return the prefix to use for saving
|
|
|
|
return prefixes.first();
|
|
|
|
return prefixes.first();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::localxdgdatadir() const
|
|
|
|
TQString TDEStandardDirs::localxdgdatadir() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Return the prefix to use for saving
|
|
|
|
// Return the prefix to use for saving
|
|
|
|
return d->xdgdata_prefixes.first();
|
|
|
|
return d->xdgdata_prefixes.first();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQString KStandardDirs::localxdgconfdir() const
|
|
|
|
TQString TDEStandardDirs::localxdgconfdir() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Return the prefix to use for saving
|
|
|
|
// Return the prefix to use for saving
|
|
|
|
return d->xdgconf_prefixes.first();
|
|
|
|
return d->xdgconf_prefixes.first();
|
|
|
|