Search for usage in LXR

Kdelibs4Migration Class Referencefinal

#include <Kdelibs4Migration>

Public Member Functions

 Kdelibs4Migration ()
 Kdelibs4Migration (const Kdelibs4Migration &)=delete
 ~Kdelibs4Migration ()
QString kdeHome () const
bool kdeHomeFound () const
QString locateLocal (const char *type, const QString &filename) const
Kdelibs4Migrationoperator= (const Kdelibs4Migration &)=delete
QString saveLocation (const char *type, const QString &suffix=QString()) const

Detailed Description

Kdelibs4Migration provides support for locating config files and application data files saved by kdelibs 4 in the user's home directory ($KDEHOME, i.e.

typically ~/.kde).

Distributions that built kdelibs4 with a custom KDE home with the CMake option _KDE_DEFAULT_HOME_POSTFIX should use the same option here with _KDE4_DEFAULT_HOME_POSTFIX

The purpose is to be able to let the application migrate these files to the KF5/Qt5 location for these files (QStandardPaths).

Files from the "config" resource (as saved by KConfig) should be migrated to QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)

Files from the "data" resource should be migrated to a subdirectory of QStandardPaths::writableLocation(QStandardPaths::DataLocation)

The following resources are supported:

  • config
  • data
  • services
  • servicetypes
  • wallpaper
  • emoticons
  • templates

Use kdeHome() for anything else.

Class for migration of config files from kdelibs4


Definition at line 60 of file kdelibs4migration.h.

Constructor & Destructor Documentation

Kdelibs4Migration::Kdelibs4Migration ( )

Constructs a Kdelibs4Migration instance.

The constructor attempts to locate the user's "kdehome" from kdelibs4.

Definition at line 26 of file kdelibs4migration.cpp.

Kdelibs4Migration::~Kdelibs4Migration ( )


Member Function Documentation

QString Kdelibs4Migration::kdeHome ( ) const

Returns the kdehome that was found.

Don't use this method if you can use locateLocal or saveLocation


Definition at line 66 of file kdelibs4migration.cpp.

bool Kdelibs4Migration::kdeHomeFound ( ) const

Returns true if a "kdehome" was found.

Otherwise, there is nothing to migrate.

Definition at line 61 of file kdelibs4migration.cpp.

QString Kdelibs4Migration::locateLocal ( const char *  type,
const QString filename 
) const

Finds a local file in a resource.

This API is inspired by KStandardDirs::locateLocal for ease of porting.

typeThe type of wanted resource.
filenameA relative filename of the resource.

Definition at line 71 of file kdelibs4migration.cpp.

QString Kdelibs4Migration::saveLocation ( const char *  type,
const QString suffix = QString() 
) const

Finds a location to save files into for the given type in the user's home directory.

typeThe type of location to return.
suffixA subdirectory name.

Definition at line 98 of file kdelibs4migration.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Apr 10 2021 23:01:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.