KNewStuff
knewstuff3/core/installation.cpp
Go to the documentation of this file.
66 if (uncompresssetting != "always" && uncompresssetting != "archive" && uncompresssetting != "never") {
67 kError() << "invalid Uncompress setting chosen, must be one of: always, archive, or never" << endl;
164 emit signalInstallationFailed(i18n("Download of item failed: no download URL for \"%1\".", entry.name()));
179 KUrl destination = QString(KGlobal::dirs()->saveLocation("tmp") + KRandom::randomString(10) + '-' + fileName);
183 KIO::FileCopyJob *job = KIO::file_copy(source, destination, -1, KIO::Overwrite | KIO::HideProgressInfo);
200 emit signalInstallationFailed(i18n("Download of \"%1\" failed, error: %2", entry.name(), job->errorString()));
204 // check if the app likes html files - disabled by default as too many bad links have been submitted to opendesktop.org
208 if (KMessageBox::questionYesNo(0, i18n("The downloaded file is a html file. This indicates a link to a website instead of the actual download. Would you like to open the site with a browser instead?"), i18n("Possibly bad download link"))
266 QStringList installedFiles = installDownloadedFileAndUncompress(entry, downloadedFile, targetPath);
352 installdir = QString::fromUtf16((const ushort *) wPath) + QLatin1Char('/') + installpath + QLatin1Char('/');
380 QStringList Installation::installDownloadedFileAndUncompress(const KNS3::EntryInternal& entry, const QString& payloadfile, const QString installdir)
451 // FIXME: make naming convention configurable through *.knsrc? e.g. for kde-look.org image names
484 const bool update = ((entry.status() == Entry::Updateable) || (entry.status() == Entry::Updating));
488 if (KMessageBox::warningContinueCancel(0, i18n("Overwrite existing file?") + "\n'" + installpath + '\'', i18n("Download File")) == KMessageBox::Cancel) {
void setShellCommand(const QString &cmd)
Definition: knewstuff3/entry.h:63
QString i18n(const char *text)
Definition: knewstuff3/entry.h:59
virtual bool isDirectory() const
QString updateVersion() const
Retrieve the version string of the object that is available as update.
Definition: entryinternal.cpp:254
KStandardDirs * dirs()
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void signalInstallationFinished()
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
KUrl destUrl() const
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
void slotInstallationVerification(int result)
Definition: knewstuff3/core/installation.cpp:579
void setReleaseDate(const QDate &releasedate)
Sets the release date.
Definition: entryinternal.cpp:229
bool readConfig(const KConfigGroup &group)
Definition: knewstuff3/core/installation.cpp:57
void signalEntryChanged(const KNS3::EntryInternal &entry)
QStringList installedFiles() const
Retrieve the locally installed files.
Definition: entryinternal.cpp:382
void downloadPayload(const KNS3::EntryInternal &entry)
Downloads a payload file.
Definition: knewstuff3/core/installation.cpp:154
KUrl srcUrl() const
void signalInstallationFailed(const QString &message)
FileCopyJob * file_copy(const KUrl &src, const KUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
Definition: knewstuff3/entry.h:61
void uninstall(KNS3::EntryInternal entry)
Uninstalls an entry.
Definition: knewstuff3/core/installation.cpp:526
QString pathOrUrl() const
QString localxdgdatadir() const
Definition: knewstuff3/entry.h:60
static int questionYesNo(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonYes=KStandardGuiItem::yes(), const KGuiItem &buttonNo=KStandardGuiItem::no(), const QString &dontAskAgainName=QString(), Options options=Notify)
QString quoteArg(const QString &arg)
static QString installPath(const char *type)
QString version() const
Retrieve the version string of the object.
Definition: entryinternal.cpp:214
void copyTo(const QString &dest, bool recursive=true) const
const KArchiveEntry * entry(const QString &name) const
Definition: knewstuff3/entry.h:64
QString dir(const QString &fileClass)
void checkValidity(const QString &fileName)
Verifies the integrity and the signature of a tarball file.
Definition: knewstuff3/core/security.cpp:227
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
QDate updateReleaseDate() const
Retrieve the date of the newer version that is available as update.
Definition: entryinternal.cpp:244
Handles security related issues, like signing, verifying.
Definition: knewstuff3/core/security.h:47
int execute(int msecs=-1)
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
Definition: knewstuff3/entry.h:65
void setUnInstalledFiles(const QStringList &files)
Set the files that have been uninstalled by the uninstall command.
Definition: entryinternal.cpp:387
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
void slotPayloadResult(KJob *job)
Definition: knewstuff3/core/installation.cpp:192
void setStatus(Entry::Status status)
Returns the checksum for the entry.
Definition: entryinternal.cpp:372
static void invokeBrowser(const QString &url, const QByteArray &startup_id=QByteArray())
QString randomString(int length)
T readEntry(const QString &key, const T &aDefault) const
void install(KNS3::EntryInternal entry)
Installs an entry's payload file.
Definition: knewstuff3/core/installation.cpp:149
static int warningContinueCancel(QWidget *parent, const QString &text, const QString &caption=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
void signalPayloadLoaded(KUrl payload)
QStringList entries() const
void setInstalledFiles(const QStringList &files)
Set the files that have been installed by the install command.
Definition: entryinternal.cpp:377
Definition: knewstuff3/entry.h:62
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.