categoriesMetadata();
/**
* The adoption command can be used to allow a user to make use of an entry's
* installed data. For example, this command might be used to ask the system to
* switch to a wallpaper or icon theme which was installed with KNS.
*
* The following is how this might look in a knsrc file. The example shows how
* an external tool is called on the installed file represented by %d.
*
AdoptionCommand=/usr/lib64/libexec/plasma-changeicons %d
*
*
* @param entry The entry to return an adoption command for
* @return The command to run to adopt this entry's installed data
*/
QString adoptionCommand(const KNSCore::EntryInternal &entry) const;
/**
* Whether or not an adoption command exists for this engine
*
* @see adoptionCommand(KNSCore::EntryInternal)
* @return True if an adoption command exists
*/
bool hasAdoptionCommand() const;
/**
* Set the page size for requests not made explicitly with requestData(int,int)
* @param pageSize the default number of entries to request from the provider
* @see requestData(int,int)
*/
void setPageSize(int pageSize);
+
+ /**
+ * Get a list of all the locations which will be used when searching for knsrc
+ * files, in the order in which the search will occur.
+ *
+ * @param includeFallbackLocations Whether or not the deprecated search locations are included
+ * @return The search list for knsrc files
+ * @since 5.57
+ */
+ static QStringList configSearchLocations(bool includeFallbackLocations = false);
+ /**
+ * Sets whether or not the config file location discovery fallback should be active.
+ * If enabled (default), if the config file is not found in the knsrcfiles location,
+ * then the engine will also look in the systemwide config location (usually /etc/xdg
+ * on linux). If disabled, this fallback location will not be searched.
+ *
+ * @param enableFallback Whether or not the fallback discovery should be enabled
+ * @since 5.57
+ */
+ void setConfigLocationFallback(bool enableFallback);
+
Q_SIGNALS:
/**
* Indicates a message to be added to the ui's log, or sent to a messagebox
*/
void signalMessage(const QString &message);
void signalProvidersLoaded();
void signalEntriesLoaded(const KNSCore::EntryInternal::List &entries);
void signalUpdateableEntriesLoaded(const KNSCore::EntryInternal::List &entries);
void signalEntryChanged(const KNSCore::EntryInternal &entry);
void signalEntryDetailsLoaded(const KNSCore::EntryInternal &entry);
// a new search result is there, clear the list of items
void signalResetView();
void signalEntryPreviewLoaded(const KNSCore::EntryInternal &, KNSCore::EntryInternal::PreviewType);
void signalPreviewFailed();
void signalEntryUploadFinished();
void signalEntryUploadFailed();
void signalDownloadDialogDone(KNSCore::EntryInternal::List);
void jobStarted(KJob *, const QString &);
QT_DEPRECATED void signalError(const QString &);
void signalBusy(const QString &);
void signalIdle(const QString &);
/**
* Fires in the case of any critical or serious errors, such as network or API problems.
* @param errorCode Represents the specific type of error which has occurred
* @param message A human-readable message which can be shown to the end user
* @param metadata Any additional data which might be hepful to further work out the details of the error (see KNSCore::EntryInternal::ErrorCode for the metadata details)
* @see KNSCore::EntryInternal::ErrorCode
* @since 5.53
*/
void signalErrorCode(const KNSCore::ErrorCode &errorCode, const QString &message, const QVariant &metadata);
void signalCategoriesMetadataLoded(const QList &categories);
private Q_SLOTS:
// the .knsrc file was loaded
void slotProviderFileLoaded(const QDomDocument &doc);
// instead of getting providers from knsrc, use what was configured in ocs systemsettings
void atticaProviderLoaded(const Attica::Provider &provider);
// loading the .knsrc file failed
void slotProvidersFailed();
// called when a provider is ready to work
void providerInitialized(KNSCore::Provider *);
void slotEntriesLoaded(const KNSCore::Provider::SearchRequest &, KNSCore::EntryInternal::List);
void slotEntryDetailsLoaded(const KNSCore::EntryInternal &entry);
void slotPreviewLoaded(const KNSCore::EntryInternal &entry, KNSCore::EntryInternal::PreviewType type);
void slotSearchTimerExpired();
void slotEntryChanged(const KNSCore::EntryInternal &entry);
void slotInstallationFinished();
void slotInstallationFailed(const QString &message);
void downloadLinkLoaded(const KNSCore::EntryInternal &entry);
void providerJobStarted(KJob *);
private:
/**
* load providers from the providersurl in the knsrc file
* creates providers based on their type and adds them to the list of providers
*/
void loadProviders();
/**
Add a provider and connect it to the right slots
*/
void addProvider(QSharedPointer provider);
void updateStatus();
void doRequest();
//FIXME KF6: move all of this in EnginePrivate
// handle installation of entries
Installation *m_installation;
// read/write cache of entries
QSharedPointer m_cache;
QTimer *m_searchTimer;
// The url of the file containing information about content providers
QString m_providerFileUrl;
// Categories from knsrc file
QStringList m_categories;
QHash > m_providers;
QString m_adoptionCommand;
// the current request from providers
Provider::SearchRequest m_currentRequest;
EnginePrivate * const d;
// the page that is currently displayed, so it is not requested repeatedly
int m_currentPage;
// when requesting entries from a provider, how many to ask for
int m_pageSize;
int m_numDataJobs;
int m_numPictureJobs;
int m_numInstallJobs;
// If the provider is ready to be used
bool m_initialized;
Q_DISABLE_COPY(Engine)
};
}
#endif