KDE 4.7 PyKDE API Reference

- KDE's Python API

# KSycoca Class Reference

`from PyKDE4.kdecore import *`

Inherits: QObject

## Detailed Description

Internal:
  Read-only SYstem COnfiguration CAche

## Enumerations

DatabaseType | { LocalDatabase, GlobalDatabase }

## Signals

| databaseChanged ()
| databaseChanged (QStringList changedResources)

## Methods

| __init__ (self, bool a0)
| __init__ (self)
| __init__ (self, KSycoca a0)
QStringList | allResourceDirs (self)
QDataStream | findEntry (self, int offset, KSycocaType type)
QDataStream | findFactory (self, KSycocaFactoryId id)
bool | isBuilding (self)
QString | kfsstnd_prefixes (self)
QString | language (self)
long | timeStamp (self)
long | updateSignature (self)

## Static Methods

QString | absoluteFilePath (KSycoca.DatabaseType type=KSycoca.LocalDatabase)
| disableAutoRebuild ()
| flagError ()
bool | isAvailable ()
bool | isChanged (QString type)
bool | readError ()
KSycoca | self ()
int | version ()

## Signal Documentation

databaseChanged | ( |  | ) |

Connect to this to get notified when the database changes Example: when mimetype definitions have changed, applications showing files as icons refresh icons to take into account the new mimetypes. Another example: after creating a .desktop file in KOpenWithDialog, it must wait until kbuildsycoca4 finishes until the KService.Ptr is available.

Parameters:

  | changedResources | List of resources where changes were detected. This can include the following resources (as defined in KStandardDirs) : apps, xdgdata-apps, services, servicetypes, xdgdata-mime.

Signal syntax:
  `QObject.connect(source, SIGNAL("databaseChanged()"), target_slot)`

databaseChanged | ( | QStringList | changedResources
| ) |  |  |

Connect to this to get notified when the database changes Example: when mimetype definitions have changed, applications showing files as icons refresh icons to take into account the new mimetypes. Another example: after creating a .desktop file in KOpenWithDialog, it must wait until kbuildsycoca4 finishes until the KService.Ptr is available.

Parameters:

  | changedResources | List of resources where changes were detected. This can include the following resources (as defined in KStandardDirs) : apps, xdgdata-apps, services, servicetypes, xdgdata-mime.

Signal syntax:
  `QObject.connect(source, SIGNAL("databaseChanged(const QStringList&)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | bool | a0
| ) |  |  |

Read-only database

__init__ | ( |  | self ) |

Read-only database

__init__ | ( | self, |
|  | KSycoca | a0
| ) |  |  |

Read-only database

QStringList allResourceDirs | ( |  | self ) |

Internal:
  - returns all directories with information stored inside sycoca.

QDataStream findEntry | ( | self, |
|  | int | offset,
|  | KSycocaType | type
| ) |  |  |

Internal:
  - called by factories in read-only mode This is how factories get a stream to an entry

QDataStream findFactory | ( | self, |
|  | KSycocaFactoryId | id
| ) |  |  |

Internal:
  - called by factories in read-only mode Returns stream(), but positioned for reading this factory, 0 on error.

bool isBuilding | ( |  | self ) |

Internal:

Returns:
  true if building (i.e. if a KBuildSycoca);

QString kfsstnd_prefixes | ( |  | self ) |

Internal:
  - returns kfsstnd stored inside database

QString language | ( |  | self ) |

Internal:
  - returns language stored inside database

long timeStamp | ( |  | self ) |

Internal:
  - returns timestamp of database

The database contains all changes made _before_ this time and _might_ contain changes made after that.

long updateSignature | ( |  | self ) |

Internal:
  - returns update signature of database

Signature that keeps track of changes to $KDEDIR/share/services/update_ksycoca

Touching this file causes the database to be recreated from scratch.

## Static Method Documentation

QString absoluteFilePath | ( | KSycoca.DatabaseType | type=KSycoca.LocalDatabase
| ) |  |  |

Internal:
  - returns absolute file path of the database

for global database type the database is searched under the 'services' install path. Otherwise, the value from the environment variable KDESYCOCA is returned if set. If not set the path is build based on KStandardDirs cache save location.

disableAutoRebuild | ( |  | ) |

Internal:
  - disables launching of kbuildsycoca

flagError | ( |  | ) |

A read error occurs.

Internal:

bool isAvailable | ( |  | ) |

Returns:
  true if the ksycoca database is available This is usually the case, except if KDE isn't installed yet, or before kded is started.

bool isChanged | ( | QString | type
| ) |  |  |

When you receive a "databaseChanged" signal, you can query here if a change has occurred in a specific resource type.

See also:
  KStandardDirs for the various resource types.

This method is meant to be called from the GUI thread only.

Deprecated:
  use the signal databaseChanged(QStringList) instead.

bool readError | ( |  | ) |

KSycoca self | ( |  | ) |

Get or create the only instance of KSycoca (read-only)

int version | ( |  | ) |

Returns:
  the compiled-in version, i.e. the one used when writing a new ksycoca

## Enumeration Documentation

DatabaseType

Enumerator: