kdecore Globals


Annotated List
Files
Globals
Hierarchy
Index

kapp.h

kckey.h

kcompletion_private.h

kconfigdata.h

kde_dmalloc.h

kdebug.h

kglobalaccel.h

kiconloader.h

klocale.h

kpixmap.h

krootprop.h

ksock.h

kstddirs.h

kurl.h

bool checkAccess (const QString& pathname, int mode)

#include <kapp.h>

Check, if a file may be accessed in a given mode. This is a wrapper around the access() system call. checkAccess() calls access() with the given parameters. If this is OK, checkAccess() returns true. If not, and W_OK is part of mode, it is checked if there is write access to the directory. If yes, checkAccess() returns true. In all other cases checkAccess() returns false.

Other than access() this function EXPLICITELY ignores non-existant files if checking for write access.

Parameters:
pathnameThe full path of the file you want to test
modeThe access mode, as in the access() system call.

Returns: Whether the access is allowed, true = Access allowed

inline bool operator < (const KEntryKey &k1, const KEntryKey &k2)

#include <kconfigdata.h>

compares two KEntryKeys (needed for QMap).

typedef QMap<KEntryKey, KEntry> KEntryMap

#include <kconfigdata.h>

type specifying a map of entries (key,value pairs). The keys are actually a key in a particular config file group together with the group name.

typedef QMap<KEntryKey, KEntry>::Iterator KEntryMapIterator

#include <kconfigdata.h>

type for iterating over keys in a KEntryMap in sorted order.

typedef QMap<KEntryKey, KEntry>::ConstIterator KEntryMapConstIterator

#include <kconfigdata.h>

type for iterating over keys in a KEntryMap in sorted order. It is const, thus you cannot change the entries in the iterator, only examine them.

void kDebugInfo ( const char* fmt, ... )

#include <kdebug.h>

kDebug provides and advanced mechanism for displaying debugging information to the user. kDebug works like printf does but takes one or two extra arguments. If your program is compiled with NDEBUG defined, the calls are rendered useless and your debugging statements hidden from the end-user's view. This doesn't apply to kDebugWarning, kDebugError and kDebugFatal, since those should always been shown to the user.

There are two families of functions. The first one allows variable arguments, much like printf or the previous kdebug, and has the notion of level (see below). The second one does not allow variable arguments and only applies to debug info, but adds the filename and line number before the message printed. You can't have both at the same time, for technical reasons (first faimly is functions, second one is macros, which can't have variable arguments since we support non-gcc compilers)

A kDebug level determines how important the message being displayed is. The first family of functions define four functions, one for each level : kDebugInfo for debug output kDebugWarning for when something strange or unexpected happened. kDebugError for when an error has occured, but the program can continue. kDebugFatal for when a horrific error has happened and the program must stop.

The first (and optional) argument is a debug "area". This "area" tells kDebug where the call to kDebug came from. The "area" is an unsigned number specified in kdebug.areas ($KDEDIR/share/config/kdebug.areas). If this number is zero or unspecified, the instance (e.g. application) name will be used.

A utility function for printing out "errno" is provided, similar to the POSIX perror() function. It uses the "Error" level: kDebugPError.

A separate program with a small configuration dialog box will soon be written, to let one assign actions to each debug level on an area by area basis.

void kdebug ( unsigned short level, unsigned short area, const char* fmt, ... )

#include <kdebug.h>

The second family of functions have more feature for debug output. Those print file and line information, which kDebugInfo can't do. And they also natively support QString.

Applications using areas, or libraries : use kDebugArea( area, my_char_* ) and kDebugStringArea( area, my_QString )

Applications not using areas : use kDebug( my_char_* ) and kDebugString( my_QString )

uint keyToXMod ( uint keyCode )

#include <kglobalaccel.h>

Returns the X key modifier for the key code keyCode.

uint keyToXSym ( uint keyCode )

#include <kglobalaccel.h>

Returns the X key sym for the key code keyCode.

QPixmap BarIcon (const QString& pixmap, const KInstance* library = KGlobal::instance())

#include <kiconloader.h>

Helper function to load toolbar icons with. It simply returns library->iconLoader()->loadIcon("toolbar/" + pixmap) so @see loadIcon

QPixmap AppIcon (const QString& pixmap, const KInstance* library = KGlobal::instance())

#include <kiconloader.h>

Helper function to load application icons with. It simply returns library->iconLoader()->loadIcon("apps/" + pixmap) so @see loadIcon

QPixmap MimeIcon (const QString& pixmap, const KInstance* library = KGlobal::instance())

#include <kiconloader.h>

Helper function to load mimetype icons with. It simply returns library->iconLoader()->loadIcon("mimetypes/" + pixmap) so @see loadIcon

QPixmap DevIcon (const QString& pixmap, const KInstance* library = KGlobal::instance())

#include <kiconloader.h>

Helper function to load device icons with. It simply returns library->iconLoader()->loadIcon("devices/" + pixmap) so @see loadIcon

QPixmap FileIcon (const QString& pixmap, const KInstance* library = KGlobal::instance())

#include <kiconloader.h>

Helper function to load filesystem icons with. It simply returns library->iconLoader()->loadIcon("filesystems/" + pixmap) so @see loadIcon

QString i18n (const char *text)

#include <klocale.h>

i18n is the function that does everything you need to translate a string. You just wrap around every user visible string a i18n call to get a QString with the string in the user's prefered language.

QString locate ( const char *type, const QString& filename, const KInstance* instance = KGlobal::instance() )

#include <kstddirs.h>

This function is just for convience. It simply calls KGlobal::dirs()->findResource(type, filename). But if you pass a KLibGlobal, then library->dirs() is queried for the desired resource.

QString locateLocal ( const char *type, const QString& filename, const KInstance* instance = KGlobal::instance() )

#include <kstddirs.h>

This function is much like locate. However it returns a filename suitable for writing to. No check is made if the specified filename actually exists. Missing directories are created. If filename is only a directory, without a specific file, filename must have a trailing slash.

bool urlcmp ( const QString& _url1, const QString& _url2 )

#include <kurl.h>

Compares URLs. They are parsed, split and compared. This means they should be both encoded before, or both decoded. Two malformed URLs with the same string representation are nevertheless considered to be unequal. That means no malformed URL equals anything else.

bool urlcmp ( const QString& _url1, const QString& _url2, bool _ignore_trailing, bool _ignore_ref )

#include <kurl.h>

Compares URLs. They are parsed, split and compared. This means they should be both encoded before, or both decoded. Two malformed URLs with the same string representation are nevertheless considered to be unequal. That means no malformed URL equals anything else.

Parameters:
_ignore_trailingDescribed in KURL::cmp
_ignore_refIf true, disables comparison of HTML-style references.


Generated by: root@tantive.terraplex.com on Sun Feb 27 17:39:19 2000, using kdoc 2.0a33.