File indexing completed on 2023-09-24 04:08:54
0001 /* -*- c++ -*- 0002 SPDX-FileCopyrightText: 2000 Waldo Bastian <bastian@kde.org> 0003 0004 SPDX-License-Identifier: BSD-2-Clause 0005 */ 0006 0007 #ifndef __KRECENTDIRS_H 0008 #define __KRECENTDIRS_H 0009 0010 #include <QStringList> 0011 0012 #include "kiofilewidgets_export.h" 0013 0014 /** 0015 * The goal of this namespace is to make sure that, when the user needs to 0016 * specify a file via the file selection dialog, this dialog will start 0017 * in the directory most likely to contain the desired files. 0018 * 0019 * This works as follows: Each time the file selection dialog is 0020 * shown, the programmer can specify a "file-class". The file-dialog will 0021 * then start with the directory associated with this file-class. When 0022 * the dialog closes, the directory currently shown in the file-dialog 0023 * will be associated with the file-class. 0024 * 0025 * A file-class can either start with ':' or with '::'. If it starts with 0026 * a single ':' the file-class is specific to the current application. 0027 * If the file-class starts with '::' it is global to all applications. 0028 * 0029 * @note Since 5.96 the file-class '::' syntax is deprecated, for lack of usage. 0030 * 0031 * @since 4.6 0032 */ 0033 namespace KRecentDirs 0034 { 0035 /** 0036 * Returns a list of directories associated with this file-class. 0037 * The most recently used directory is at the front of the list. 0038 * 0039 * @since 4.6 0040 */ 0041 KIOFILEWIDGETS_EXPORT QStringList list(const QString &fileClass); 0042 0043 /** 0044 * Returns the most recently used directory associated with this file-class. 0045 * 0046 * @since 4.6 0047 */ 0048 KIOFILEWIDGETS_EXPORT QString dir(const QString &fileClass); 0049 0050 /** 0051 * Associates @p directory with @p fileClass 0052 * 0053 * @since 4.6 0054 */ 0055 KIOFILEWIDGETS_EXPORT void add(const QString &fileClass, const QString &directory); 0056 } 0057 0058 #endif