KNewStuff
coreengine.cpp
Go to the documentation of this file.
58 : QObject(parent), m_uploadedentry(NULL), m_uploadprovider(NULL), m_installation(NULL), m_activefeeds(0),
104 if (uncompresssetting != "always" && uncompresssetting != "archive" && uncompresssetting != "never") {
105 kError() << "invalid Uncompress setting chosen, must be one of: always, archive, or never" << endl;
289 KIO::FileCopyJob *job = KIO::file_copy(source, destination, -1, KIO::Overwrite | KIO::HideProgressInfo);
329 KIO::FileCopyJob *job = KIO::file_copy(source, destination, -1, KIO::Overwrite | KIO::HideProgressInfo);
365 KIO::FileCopyJob *fcjob = KIO::file_copy(sourcepayload, destfolder, -1, KIO::Overwrite | KIO::HideProgressInfo);
504 KIO::FileCopyJob *fcjob = KIO::file_copy(sourcepreview, destfolder, -1, KIO::Overwrite | KIO::HideProgressInfo);
527 KUrl sourcemeta = QString(KGlobal::dirs()->saveLocation("tmp") + KRandom::randomString(10) + ".meta");
553 KIO::FileCopyJob *fcjob = KIO::file_copy(sourcemeta, destfolder, -1, KIO::Overwrite | KIO::HideProgressInfo);
1113 // extra code to get the feedname from the provider, we could use feed->name().representation()
1146 for (Provider::List::Iterator it = m_provider_cache.begin(); it != m_provider_cache.end(); ++it) {
1173 void CoreEngine::cacheFeed(const Provider *provider, const QString & feedname, const Feed *feed, Entry::List entries)
1281 kError() << "Cannot write meta information to '" << registrydir + registryfile << "'." << endl;
1390 // installpath also contains the file name if it's a single file, otherwise equal to installdir
1413 installdir = QString::fromUtf16((const ushort *) wPath) + QLatin1Char('/') + m_installation->installPath() + QLatin1Char('/');
1416 installdir = QDir::home().path() + QLatin1Char('/') + m_installation->installPath() + QLatin1Char('/');
1438 if (m_installation->uncompression() == "always" || m_installation->uncompression() == "archive") {
1491 if (m_installation->uncompression() == "never" || (m_installation->uncompression() == "archive" && !isarchive)) {
1495 // FIXME: make naming convention configurable through *.knsrc? e.g. for kde-look.org image names
1650 QStringList KNS::CoreEngine::archiveEntries(const QString& path, const KArchiveDirectory * dir)
void setUnInstalledFiles(const QStringList &files)
Set the files that have been uninstalled by the uninstall command.
Definition: knewstuff2/core/entry.cpp:256
void setShellCommand(const QString &cmd)
void signalProvidersFailed()
void message(KMessage::MessageType messageType, const QString &text, const QString &caption=QString())
Definition: knewstuff2/core/entry.h:322
QString saveLocation(const char *type, const QString &suffix=QString(), bool create=true) const
QString i18n(const char *text)
void clear()
void signalInstallationFailed()
AutomationPolicy
Engine automation can be activated to let the engine take care by itself of all the method calls need...
Definition: coreengine.h:98
KTranslatable name() const
Retrieves the common name of the provider.
Definition: knewstuff2/core/provider.cpp:64
QString checksum() const
Returns the checksum for the entry.
Definition: knewstuff2/core/entry.cpp:201
void setUninstallCommand(const QString &command)
Definition: knewstuff2/core/installation.cpp:64
virtual bool isDirectory() const
QDomNode appendChild(const QDomNode &newChild)
QString standardResourceDir() const
Definition: knewstuff2/core/installation.cpp:124
QString attribute(const QString &name, const QString &defValue) const
bool remove()
QString uncompression() const
Definition: knewstuff2/core/installation.cpp:109
QObject * sender() const
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
QStringList findDirs(const char *type, const QString &reldir) const
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
QDate releaseDate() const
Retrieve the date of the object's publication.
Definition: knewstuff2/core/entry.cpp:151
void loadEntries(Provider *provider)
Loads all entries of all the feeds from a provider.
Definition: coreengine.cpp:231
const T & at(int i) const
bool rename(const QString &newName)
const Provider * provider() const
Returns the provider which was used for download.
Definition: entryloader.cpp:67
void signalProviderLoaded(KNS::Provider *provider)
Indicates that the list of providers has been successfully loaded.
KStandardDirs * dirs()
QString version() const
Retrieve the version string of the object.
Definition: knewstuff2/core/entry.cpp:131
QDomElement nextSiblingElement(const QString &tagName) const
Policy checksumPolicy() const
Definition: knewstuff2/core/installation.cpp:153
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool hasGroup(const QString &group) const
static KUrl fromPath(const QString &text)
KConfigGroup group(const QByteArray &group)
int release() const
Retrieve the release number of the object.
Definition: knewstuff2/core/entry.cpp:141
QDomElement documentElement() const
void signalPayloadLoaded(KUrl payload)
KUrl destUrl() const
Like CacheReplaceable, but only update if necessary.
Definition: coreengine.h:79
bool exists() const
QString uninstallCommand() const
Definition: knewstuff2/core/installation.cpp:119
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KTranslatable name() const
Retrieve the name of the data object.
Definition: knewstuff2/core/entry.cpp:81
Definition: knewstuff2/core/entry.h:295
int size() const
void load(const Provider *provider, Feed *feed)
Starts asynchronously loading the list of entries from the given provider for the given feed...
Definition: entryloader.cpp:40
void signalProgress(const QString &message, int percentage)
bool isFile() const
QString language() const
Returns the language which most likely resembles the current language.
Definition: ktranslatable.cpp:77
bool customName() const
Definition: knewstuff2/core/installation.cpp:163
int count(const T &value) const
KTranslatable payload() const
Retrieve the file name of the object.
Definition: knewstuff2/core/entry.cpp:161
void append(const T &value)
QString fromUtf8(const char *str, int size)
QString signature() const
Returns the signature for the entry.
Definition: knewstuff2/core/entry.cpp:211
KUrl srcUrl() const
bool rmdir(const QString &dirName) const
FileCopyJob * file_copy(const KUrl &src, const KUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
QString text() const
Feed * downloadUrlFeed(const QString &feedtype) const
Feed to retrieve for the given feed type.
Definition: knewstuff2/core/provider.cpp:50
Handles security related issues, like signing, verifying.
Definition: knewstuff2/core/security.h:47
QString path() const
void checkValidity(const QString &fileName)
Verifies the integrity and the signature of a tarball file.
Definition: knewstuff2/core/security.cpp:216
QString fromUtf16(const ushort *unicode, int size)
bool hasAttribute(const QString &name) const
void setSignaturePolicy(Policy policy)
Definition: knewstuff2/core/installation.cpp:94
bool uploadEntry(Provider *provider, Entry *entry)
Uploads a complete entry, including its payload and preview files (if present) and all associated met...
Definition: coreengine.cpp:340
void signalInstallationFinished()
Definition: coreengine.h:83
void setAttribute(const QString &name, const QString &value)
void signalEntryFailed()
AccessMode accessMode() const
void setInstalledFiles(const QStringList &files)
Set the files that have been installed by the install command.
Definition: knewstuff2/core/entry.cpp:236
bool isEmpty() const
QString pathOrUrl() const
void setAbsoluteInstallPath(const QString &dir)
Definition: knewstuff2/core/installation.cpp:84
void setChecksumPolicy(Policy policy)
Definition: knewstuff2/core/installation.cpp:89
void setTargetDir(const QString &dir)
Definition: knewstuff2/core/installation.cpp:74
Definition: knewstuff2/core/entry.h:320
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
typedef Iterator
void signalPreviewFailed()
void signalProvidersFinished()
T & first()
QString path(AdjustPathOption trailing=LeaveTrailingSlash) const
void signalEntryChanged(KNS::Entry *entry)
QString representation() const
Returns the string which matches most closely the current language.
Definition: ktranslatable.cpp:64
QStringList installedFiles() const
Retrieve the locally installed files.
Definition: knewstuff2/core/entry.cpp:241
void load(const QString &providersurl)
Starts asynchronously loading the list of providers from the specified URL.
Definition: providerloader.cpp:38
QDomText createTextNode(const QString &value)
iterator end()
QString quoteArg(const QString &arg)
void signalEntriesFeedFinished(const KNS::Feed *feed)
void signalPayloadFailed(KNS::Entry *entry)
static QString installPath(const char *type)
Definition: knewstuff2/core/entry.h:293
void copyTo(const QString &dest, bool recursive=true) const
void setUncompression(const QString &uncompression)
Definition: knewstuff2/core/installation.cpp:54
const KArchiveEntry * entry(const QString &name) const
bool isNull() const
void setCommand(const QString &command)
Definition: knewstuff2/core/installation.cpp:59
QString targetDir() const
Definition: knewstuff2/core/installation.cpp:129
QString & replace(int position, int n, QChar after)
bool install(const QString &payloadfile)
Installs an entry's payload file.
Definition: coreengine.cpp:1333
void signalEntriesFinished()
void signalEntryLoaded(KNS::Entry *entry, const KNS::Feed *feed, const KNS::Provider *provider)
void setFileName(const QString &_txt)
bool isValid() const
void signalEntriesFailed()
QString dir(const QString &fileClass)
void setScope(Scope scope)
Definition: knewstuff2/core/installation.cpp:99
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const
QByteArray fromBase64(const QByteArray &base64)
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
void setInstallPath(const QString &dir)
Definition: knewstuff2/core/installation.cpp:79
QDomElement firstChildElement(const QString &tagName) const
typedef ConstIterator
QString findResource(const char *type, const QString &filename) const
int execute(int msecs=-1)
void signalProviderChanged(KNS::Provider *provider)
QString absoluteInstallPath() const
Definition: knewstuff2/core/installation.cpp:139
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QString section(QChar sep, int start, int end, QFlags< QString::SectionFlag > flags) const
void signalPreviewLoaded(KUrl preview)
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
QString tagName() const
KUrl webService() const
Retrieves the URL to the DXS Web Service.
Definition: knewstuff2/core/provider.cpp:114
QDomElement createElement(const QString &tagName)
void setCachePolicy(CachePolicy policy)
Definition: coreengine.cpp:1645
void setStandardResourceDir(const QString &dir)
Definition: knewstuff2/core/installation.cpp:69
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString installPath() const
Definition: knewstuff2/core/installation.cpp:134
void setAutomationPolicy(AutomationPolicy policy)
Definition: coreengine.cpp:1640
void signalEntryUploaded()
KTranslatable preview() const
Retrieve the file name of an image containing a preview of the object.
Definition: knewstuff2/core/entry.cpp:171
QString randomString(int length)
T readEntry(const QString &key, const T &aDefault) const
QDir home()
void setCustomName(bool customname)
Definition: knewstuff2/core/installation.cpp:104
QString baseName() const
iterator begin()
Operate on cache files but never update them.
Definition: coreengine.h:81
QStringList entries() const
Policy signaturePolicy() const
Definition: knewstuff2/core/installation.cpp:158
bool setContent(const QByteArray &data, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn)
void mergeEntries(Entry::List entries, Feed *feed, const Provider *provider)
Definition: coreengine.cpp:1036
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:25:43 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.