File indexing completed on 2024-05-05 12:20:44
0001 /* 0002 knewstuff3/errorcode.h. 0003 SPDX-FileCopyrightText: 2018 Dan Leinir Turthra Jensen <admin@leinir.dk> 0004 0005 SPDX-License-Identifier: LGPL-2.1-or-later 0006 */ 0007 0008 #ifndef KNSCORE_ERRORCODE_H 0009 #define KNSCORE_ERRORCODE_H 0010 0011 #include "knewstuffcore_export.h" 0012 #include <qobjectdefs.h> 0013 0014 namespace KNSCore 0015 { 0016 KNEWSTUFFCORE_EXPORT Q_NAMESPACE 0017 /** 0018 * An enumeration of specific error conditions which might occur and which 0019 * users of KNewStuff would want to react to. It is used by both the Engine and 0020 * Provider classes. 0021 * @since 5.53 0022 * TODO: KF6 do not repeat entry properties in the QVariantList 0023 */ 0024 enum ErrorCode { 0025 UnknownError, ///< An unknown error (this should not be used, an error report of this nature should be considered a bug) 0026 NetworkError, ///< A network error. In signalErrorCode, this will be accompanied by the QtNetwork error code in the metadata 0027 OcsError, ///< An error reported by the OCS API server. In signalErrorCode, this will be accompanied by the OCS error code in the metadata 0028 ConfigFileError, ///< The configuration file is missing or somehow incorrect. The configuration file filename will be held in the metadata 0029 ProviderError, ///< A provider has failed to load or initialize. The provider file URL or provider URL will be held in the metadata 0030 InstallationError, ///< Installation of a content item has failed. If known, the entry's unique ID will be the metadata 0031 ImageError, ///< Loading an image has failed. The entry name and preview type which failed will be held in the metadata as a QVariantList 0032 AdoptionError, ///< Adopting one entry has failed. The adoption command will be in the metadata as a QVariantList. 0033 TryAgainLaterError, ///< Specific error condition for failed network calls which explicitly request an amount of time to wait before retrying (generally 0034 ///< interpreted as maintenance). The retry will be scheduled automatically, and this code can be used to show the user how long 0035 ///< they have to wait. The time after which the user can try again can be read as a QDateTime in the metadata. @since 5.84 0036 }; 0037 Q_ENUM_NS(ErrorCode) 0038 } 0039 #endif // KNSCORE_ERRORCODE_H