• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.8 API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • knewstuff
  • knewstuff3
  • core
knewstuff3/core/installation.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KNewStuff2.
3  Copyright (c) 2007 Josef Spillner <spillner@kde.org>
4  Copyright (C) 2009 Frederik Gladhorn <gladhorn@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "installation.h"
21 
22 #include <QDir>
23 #include <QFile>
24 
25 #include "kstandarddirs.h"
26 #include "kmimetype.h"
27 #include "karchive.h"
28 #include "kzip.h"
29 #include "ktar.h"
30 #include "kprocess.h"
31 #include "kio/job.h"
32 #include "krandom.h"
33 #include "kshell.h"
34 #include "kmessagebox.h" // TODO get rid of message box
35 #include "ktoolinvocation.h" // TODO remove, this was only for my playing round
36 #include "klocalizedstring.h"
37 #include "kdebug.h"
38 
39 #include "core/security.h"
40 #ifdef Q_OS_WIN
41 #include <windows.h>
42 #include <shlobj.h>
43 #endif
44 
45 using namespace KNS3;
46 
47 Installation::Installation(QObject* parent)
48  : QObject(parent)
49  , checksumPolicy(Installation::CheckIfPossible)
50  , signaturePolicy(Installation::CheckIfPossible)
51  , scope(Installation::ScopeUser)
52  , customName(false)
53  , acceptHtml(false)
54 {
55 }
56 
57 bool Installation::readConfig(const KConfigGroup& group)
58 {
59  // FIXME: add support for several categories later on
60  // FIXME: read out only when actually installing as a performance improvement?
61  QString uncompresssetting = group.readEntry("Uncompress", QString("never"));
62  // support old value of true as equivalent of always
63  if (uncompresssetting == "true") {
64  uncompresssetting = "always";
65  }
66  if (uncompresssetting != "always" && uncompresssetting != "archive" && uncompresssetting != "never") {
67  kError() << "invalid Uncompress setting chosen, must be one of: always, archive, or never" << endl;
68  return false;
69  }
70  uncompression = uncompresssetting;
71  postInstallationCommand = group.readEntry("InstallationCommand", QString());
72  uninstallCommand = group.readEntry("UninstallCommand", QString());
73  standardResourceDirectory = group.readEntry("StandardResource", QString());
74  targetDirectory = group.readEntry("TargetDir", QString());
75  xdgTargetDirectory = group.readEntry("XdgTargetDir", QString());
76  installPath = group.readEntry("InstallPath", QString());
77  absoluteInstallPath = group.readEntry("AbsoluteInstallPath", QString());
78  customName = group.readEntry("CustomName", false);
79  acceptHtml = group.readEntry("AcceptHtmlDownloads", false);
80 
81  if (standardResourceDirectory.isEmpty() &&
82  targetDirectory.isEmpty() &&
83  xdgTargetDirectory.isEmpty() &&
84  installPath.isEmpty() &&
85  absoluteInstallPath.isEmpty()) {
86  kError() << "No installation target set";
87  return false;
88  }
89 
90  QString checksumpolicy = group.readEntry("ChecksumPolicy", QString());
91  if (!checksumpolicy.isEmpty()) {
92  if (checksumpolicy == "never")
93  checksumPolicy = Installation::CheckNever;
94  else if (checksumpolicy == "ifpossible")
95  checksumPolicy = Installation::CheckIfPossible;
96  else if (checksumpolicy == "always")
97  checksumPolicy = Installation::CheckAlways;
98  else {
99  kError() << "The checksum policy '" + checksumpolicy + "' is unknown." << endl;
100  return false;
101  }
102  }
103 
104  QString signaturepolicy = group.readEntry("SignaturePolicy", QString());
105  if (!signaturepolicy.isEmpty()) {
106  if (signaturepolicy == "never")
107  signaturePolicy = Installation::CheckNever;
108  else if (signaturepolicy == "ifpossible")
109  signaturePolicy = Installation::CheckIfPossible;
110  else if (signaturepolicy == "always")
111  signaturePolicy = Installation::CheckAlways;
112  else {
113  kError() << "The signature policy '" + signaturepolicy + "' is unknown." << endl;
114  return false;
115  }
116  }
117 
118  QString scopeString = group.readEntry("Scope", QString());
119  if (!scopeString.isEmpty()) {
120  if (scopeString == "user")
121  scope = ScopeUser;
122  else if (scopeString == "system")
123  scope = ScopeSystem;
124  else {
125  kError() << "The scope '" + scopeString + "' is unknown." << endl;
126  return false;
127  }
128 
129  if (scope == ScopeSystem) {
130  if (!installPath.isEmpty()) {
131  kError() << "System installation cannot be mixed with InstallPath." << endl;
132  return false;
133  }
134  }
135  }
136  return true;
137 }
138 
139 bool Installation::isRemote() const
140 {
141  if (!installPath.isEmpty()) return false;
142  if (!targetDirectory.isEmpty()) return false;
143  if (!xdgTargetDirectory.isEmpty()) return false;
144  if (!absoluteInstallPath.isEmpty()) return false;
145  if (!standardResourceDirectory.isEmpty()) return false;
146  return true;
147 }
148 
149 void Installation::install(EntryInternal entry)
150 {
151  downloadPayload(entry);
152 }
153 
154 void Installation::downloadPayload(const KNS3::EntryInternal& entry)
155 {
156  if(!entry.isValid()) {
157  emit signalInstallationFailed(i18n("Invalid item."));
158  return;
159  }
160  KUrl source = KUrl(entry.payload());
161 
162  if (!source.isValid()) {
163  kError() << "The entry doesn't have a payload." << endl;
164  emit signalInstallationFailed(i18n("Download of item failed: no download URL for \"%1\".", entry.name()));
165  return;
166  }
167 
168  // FIXME no clue what this is supposed to do
169  if (isRemote()) {
170  // Remote resource
171  //kDebug() << "Relaying remote payload '" << source << "'";
172  install(entry, source.pathOrUrl());
173  emit signalPayloadLoaded(source);
174  // FIXME: we still need registration for eventual deletion
175  return;
176  }
177 
178  QString fileName(source.fileName());
179  KUrl destination = QString(KGlobal::dirs()->saveLocation("tmp") + KRandom::randomString(10) + '-' + fileName);
180  kDebug() << "Downloading payload '" << source << "' to '" << destination << "'";
181 
182  // FIXME: check for validity
183  KIO::FileCopyJob *job = KIO::file_copy(source, destination, -1, KIO::Overwrite | KIO::HideProgressInfo);
184  connect(job,
185  SIGNAL(result(KJob*)),
186  SLOT(slotPayloadResult(KJob*)));
187 
188  entry_jobs[job] = entry;
189 }
190 
191 
192 void Installation::slotPayloadResult(KJob *job)
193 {
194  // for some reason this slot is getting called 3 times on one job error
195  if (entry_jobs.contains(job)) {
196  EntryInternal entry = entry_jobs[job];
197  entry_jobs.remove(job);
198 
199  if (job->error()) {
200  emit signalInstallationFailed(i18n("Download of \"%1\" failed, error: %2", entry.name(), job->errorString()));
201  } else {
202  KIO::FileCopyJob *fcjob = static_cast<KIO::FileCopyJob*>(job);
203 
204  // check if the app likes html files - disabled by default as too many bad links have been submitted to opendesktop.org
205  if (!acceptHtml) {
206  KMimeType::Ptr mimeType = KMimeType::findByPath(fcjob->destUrl().toLocalFile());
207  if (mimeType->is("text/html") || mimeType->is("application/x-php")) {
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"))
209  == KMessageBox::Yes) {
210  KToolInvocation::invokeBrowser(fcjob->srcUrl().url());
211  emit signalInstallationFailed(i18n("Downloaded file was a HTML file. Opened in browser."));
212  entry.setStatus(Entry::Invalid);
213  emit signalEntryChanged(entry);
214  return;
215  }
216  }
217  }
218 
219  install(entry, fcjob->destUrl().toLocalFile());
220  emit signalPayloadLoaded(fcjob->destUrl());
221  }
222  }
223 }
224 
225 
226 void Installation::install(KNS3::EntryInternal entry, const QString& downloadedFile)
227 {
228  kDebug() << "Install: " << entry.name() << " from " << downloadedFile;
229 
230  if (entry.payload().isEmpty()) {
231  kDebug() << "No payload associated with: " << entry.name();
232  return;
233  }
234 
235  // FIXME: first of all, do the security stuff here
236  // this means check sum comparison and signature verification
237  // signature verification might take a long time - make async?!
238  /*
239  if (checksumPolicy() != Installation::CheckNever) {
240  if (entry.checksum().isEmpty()) {
241  if (checksumPolicy() == Installation::CheckIfPossible) {
242  //kDebug() << "Skip checksum verification";
243  } else {
244  kError() << "Checksum verification not possible" << endl;
245  return false;
246  }
247  } else {
248  //kDebug() << "Verify checksum...";
249  }
250  }
251  if (signaturePolicy() != Installation::CheckNever) {
252  if (entry.signature().isEmpty()) {
253  if (signaturePolicy() == Installation::CheckIfPossible) {
254  //kDebug() << "Skip signature verification";
255  } else {
256  kError() << "Signature verification not possible" << endl;
257  return false;
258  }
259  } else {
260  //kDebug() << "Verify signature...";
261  }
262  }
263  */
264 
265  QString targetPath = targetInstallationPath(downloadedFile);
266  QStringList installedFiles = installDownloadedFileAndUncompress(entry, downloadedFile, targetPath);
267 
268  if (installedFiles.isEmpty()) {
269  if (entry.status() == Entry::Installing) {
270  entry.setStatus(Entry::Downloadable);
271  } else if (entry.status() == Entry::Updating) {
272  entry.setStatus(Entry::Updateable);
273  }
274  emit signalEntryChanged(entry);
275  emit signalInstallationFailed(i18n("Could not install \"%1\": file not found.", entry.name()));
276  return;
277  }
278 
279  entry.setInstalledFiles(installedFiles);
280 
281  if (!postInstallationCommand.isEmpty()) {
282  QString target;
283  if (installedFiles.size() == 1) {
284  runPostInstallationCommand(installedFiles.first());
285  } else {
286  runPostInstallationCommand(targetPath);
287  }
288  }
289 
290  // ==== FIXME: security code below must go above, when async handling is complete ====
291 
292  // FIXME: security object lifecycle - it is a singleton!
293  Security *sec = Security::ref();
294 
295  connect(sec,
296  SIGNAL(validityResult(int)),
297  SLOT(slotInstallationVerification(int)));
298 
299  // FIXME: change to accept filename + signature
300  sec->checkValidity(QString());
301 
302  // update version and release date to the new ones
303  if (entry.status() == Entry::Updating) {
304  if (!entry.updateVersion().isEmpty()) {
305  entry.setVersion(entry.updateVersion());
306  }
307  if (entry.updateReleaseDate().isValid()) {
308  entry.setReleaseDate(entry.updateReleaseDate());
309  }
310  }
311 
312  entry.setStatus(Entry::Installed);
313  emit signalEntryChanged(entry);
314  emit signalInstallationFinished();
315 }
316 
317 QString Installation::targetInstallationPath(const QString& payloadfile)
318 {
319  QString installpath(payloadfile);
320  QString installdir;
321 
322  if (!isRemote()) {
323  // installdir is the target directory
324 
325  // installpath also contains the file name if it's a single file, otherwise equal to installdir
326  int pathcounter = 0;
327  if (!standardResourceDirectory.isEmpty()) {
328  if (scope == ScopeUser) {
329  installdir = KStandardDirs::locateLocal(standardResourceDirectory.toUtf8(), "/");
330  } else { // system scope
331  installdir = KStandardDirs::installPath(standardResourceDirectory.toUtf8());
332  }
333  pathcounter++;
334  }
335  if (!targetDirectory.isEmpty()) {
336  if (scope == ScopeUser) {
337  installdir = KStandardDirs::locateLocal("data", targetDirectory + '/');
338  } else { // system scope
339  installdir = KStandardDirs::installPath("data") + targetDirectory + '/';
340  }
341  pathcounter++;
342  }
343  if (!xdgTargetDirectory.isEmpty()) {
344  installdir = KStandardDirs().localxdgdatadir() + '/' + xdgTargetDirectory + '/';
345  pathcounter++;
346  }
347  if (!installPath.isEmpty()) {
348 #if defined(Q_WS_WIN)
349 #ifndef _WIN32_WCE
350  WCHAR wPath[MAX_PATH+1];
351  if ( SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, wPath) == S_OK) {
352  installdir = QString::fromUtf16((const ushort *) wPath) + QLatin1Char('/') + installpath + QLatin1Char('/');
353  } else {
354 #endif
355  installdir = QDir::home().path() + QLatin1Char('/') + installPath + QLatin1Char('/');
356 #ifndef _WIN32_WCE
357  }
358 #endif
359 #else
360  installdir = QDir::home().path() + '/' + installPath + '/';
361 #endif
362  pathcounter++;
363  }
364  if (!absoluteInstallPath.isEmpty()) {
365  installdir = absoluteInstallPath + '/';
366  pathcounter++;
367  }
368  if (pathcounter != 1) {
369  kError() << "Wrong number of installation directories given." << endl;
370  return QString();
371  }
372 
373  kDebug() << "installdir: " << installdir;
374 
375  }
376 
377  return installdir;
378 }
379 
380 QStringList Installation::installDownloadedFileAndUncompress(const KNS3::EntryInternal& entry, const QString& payloadfile, const QString installdir)
381 {
382  QString installpath(payloadfile);
383  // Collect all files that were installed
384  QStringList installedFiles;
385 
386  if (!isRemote()) {
387  bool isarchive = true;
388 
389  // respect the uncompress flag in the knsrc
390  if (uncompression == "always" || uncompression == "archive") {
391  // this is weird but a decompression is not a single name, so take the path instead
392  installpath = installdir;
393  KMimeType::Ptr mimeType = KMimeType::findByPath(payloadfile);
394  //kDebug() << "Postinstallation: uncompress the file";
395 
396  // FIXME: check for overwriting, malicious archive entries (../foo) etc.
397  // FIXME: KArchive should provide "safe mode" for this!
398  KArchive *archive = 0;
399 
400 
401  if (mimeType->is("application/zip")) {
402  archive = new KZip(payloadfile);
403  } else if (mimeType->is("application/tar")
404  || mimeType->is("application/x-gzip")
405  || mimeType->is("application/x-bzip")
406  || mimeType->is("application/x-lzma")
407  || mimeType->is("application/x-xz")
408  || mimeType->is("application/x-bzip-compressed-tar")
409  || mimeType->is("application/x-compressed-tar") ) {
410  archive = new KTar(payloadfile);
411  } else {
412  delete archive;
413  kError() << "Could not determine type of archive file '" << payloadfile << "'";
414  if (uncompression == "always") {
415  return QStringList();
416  }
417  isarchive = false;
418  }
419 
420  if (isarchive) {
421  bool success = archive->open(QIODevice::ReadOnly);
422  if (!success) {
423  kError() << "Cannot open archive file '" << payloadfile << "'";
424  if (uncompression == "always") {
425  return QStringList();
426  }
427  // otherwise, just copy the file
428  isarchive = false;
429  }
430 
431  if (isarchive) {
432  const KArchiveDirectory *dir = archive->directory();
433  dir->copyTo(installdir);
434 
435  installedFiles << archiveEntries(installdir, dir);
436  installedFiles << installdir + '/';
437 
438  archive->close();
439  QFile::remove(payloadfile);
440  delete archive;
441  }
442  }
443  }
444 
445  kDebug() << "isarchive: " << isarchive;
446 
447  if (uncompression == "never" || (uncompression == "archive" && !isarchive)) {
448  // no decompress but move to target
449 
451  // FIXME: make naming convention configurable through *.knsrc? e.g. for kde-look.org image names
452  KUrl source = KUrl(entry.payload());
453  kDebug() << "installing non-archive from " << source.url();
454  QString installfile;
455  QString ext = source.fileName().section('.', -1);
456  if (customName) {
457  installfile = entry.name();
458  installfile += '-' + entry.version();
459  if (!ext.isEmpty()) installfile += '.' + ext;
460  } else {
461  // TODO HACK This is a hack, the correct way of fixing it would be doing the KIO::get
462  // and using the http headers if they exist to get the file name, but as discussed in
463  // Randa this is not going to happen anytime soon (if ever) so go with the hack
464  if (source.url().startsWith("http://newstuff.kde.org/cgi-bin/hotstuff-access?file=")) {
465  installfile = source.queryItemValue("file");
466  int lastSlash = installfile.lastIndexOf('/');
467  if (lastSlash >= 0)
468  installfile = installfile.mid(lastSlash);
469  }
470  if (installfile.isEmpty()) {
471  installfile = source.fileName();
472  }
473  }
474  installpath = installdir + '/' + installfile;
475 
476  //kDebug() << "Install to file " << installpath;
477  // FIXME: copy goes here (including overwrite checking)
478  // FIXME: what must be done now is to update the cache *again*
479  // in order to set the new payload filename (on root tag only)
480  // - this might or might not need to take uncompression into account
481  // FIXME: for updates, we might need to force an overwrite (that is, deleting before)
482  QFile file(payloadfile);
483  bool success = true;
484  const bool update = ((entry.status() == Entry::Updateable) || (entry.status() == Entry::Updating));
485 
486  if (QFile::exists(installpath)) {
487  if (!update) {
488  if (KMessageBox::warningContinueCancel(0, i18n("Overwrite existing file?") + "\n'" + installpath + '\'', i18n("Download File")) == KMessageBox::Cancel) {
489  return QStringList();
490  }
491  }
492  success = QFile::remove(installpath);
493  }
494  if (success) {
495  success = file.rename(KUrl(installpath).toLocalFile());
496  kDebug() << "move: " << file.fileName() << " to " << installpath;
497  }
498  if (!success) {
499  kError() << "Cannot move file '" << payloadfile << "' to destination '" << installpath << "'";
500  return QStringList();
501  }
502  installedFiles << installpath;
503  }
504  }
505  return installedFiles;
506 }
507 
508 void Installation::runPostInstallationCommand(const QString& installPath)
509 {
510  KProcess process;
511  QString command(postInstallationCommand);
512  QString fileArg(KShell::quoteArg(installPath));
513  command.replace("%f", fileArg);
514 
515  kDebug() << "Run command: " << command;
516 
517  process.setShellCommand(command);
518  int exitcode = process.execute();
519 
520  if (exitcode) {
521  kError() << "Command failed" << endl;
522  }
523 }
524 
525 
526 void Installation::uninstall(EntryInternal entry)
527 {
528  entry.setStatus(Entry::Deleted);
529 
530  if (!uninstallCommand.isEmpty()) {
531  KProcess process;
532  foreach (const QString& file, entry.installedFiles()) {
533  QFileInfo info(file);
534  if (info.isFile()) {
535  QString fileArg(KShell::quoteArg(file));
536  QString command(uninstallCommand);
537  command.replace("%f", fileArg);
538 
539  process.setShellCommand(command);
540  int exitcode = process.execute();
541 
542  if (exitcode) {
543  kError() << "Command failed" << endl;
544  } else {
545  //kDebug() << "Command executed successfully";
546  }
547  }
548  }
549  }
550 
551  foreach(const QString &file, entry.installedFiles()) {
552  if (file.endsWith('/')) {
553  QDir dir;
554  bool worked = dir.rmdir(file);
555  if (!worked) {
556  // Maybe directory contains user created files, ignore it
557  continue;
558  }
559  } else {
560  QFileInfo info(file);
561  if (info.exists() || info.isSymLink()) {
562  bool worked = QFile::remove(file);
563  if (!worked) {
564  kWarning() << "unable to delete file " << file;
565  return;
566  }
567  } else {
568  kWarning() << "unable to delete file " << file << ". file does not exist.";
569  }
570  }
571  }
572  entry.setUnInstalledFiles(entry.installedFiles());
573  entry.setInstalledFiles(QStringList());
574 
575  emit signalEntryChanged(entry);
576 }
577 
578 
579 void Installation::slotInstallationVerification(int result)
580 {
581  //kDebug() << "SECURITY result " << result;
582 
583  //FIXME do something here ??? and get the right entry again
584  EntryInternal entry;
585 
586  if (result & Security::SIGNED_OK)
587  emit signalEntryChanged(entry);
588  else
589  emit signalEntryChanged(entry);
590 }
591 
592 
593 QStringList Installation::archiveEntries(const QString& path, const KArchiveDirectory * dir)
594 {
595  QStringList files;
596  foreach(const QString &entry, dir->entries()) {
597  QString childPath = path + '/' + entry;
598  if (dir->entry(entry)->isFile()) {
599  files << childPath;
600  }
601 
602  if (dir->entry(entry)->isDirectory()) {
603  const KArchiveDirectory* childDir = static_cast<const KArchiveDirectory*>(dir->entry(entry));
604  files << archiveEntries(childPath, childDir);
605  files << childPath + '/';
606  }
607  }
608  return files;
609 }
610 
611 
612 #include "installation.moc"
KProcess::setShellCommand
void setShellCommand(const QString &cmd)
KNS3::Entry::Deleted
Definition: knewstuff3/entry.h:63
i18n
QString i18n(const char *text)
KIO::Overwrite
KNS3::EntryInternal::setVersion
void setVersion(const QString &version)
Sets the version number.
Definition: entryinternal.cpp:219
KNS3::Entry::Invalid
Definition: knewstuff3/entry.h:59
krandom.h
KProcess
kdebug.h
KNS3::EntryInternal
KNewStuff data entry container.
Definition: entryinternal.h:54
kmimetype.h
KArchiveEntry::isDirectory
virtual bool isDirectory() const
KNS3::EntryInternal::isValid
bool isValid() const
Definition: entryinternal.cpp:119
KNS3::EntryInternal::updateVersion
QString updateVersion() const
Retrieve the version string of the object that is available as update.
Definition: entryinternal.cpp:254
KNS3::EntryInternal::name
QString name() const
Retrieve the name of the data object.
Definition: entryinternal.cpp:124
KNS3::EntryInternal::payload
QString payload() const
Retrieve the file name of the object.
Definition: entryinternal.cpp:234
KNS3::Installation::CheckNever
Definition: knewstuff3/core/installation.h:55
KIO::HideProgressInfo
KArchive
kshell.h
KGlobal::dirs
KStandardDirs * dirs()
kError
static QDebug kError(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KNS3::Installation::signalInstallationFinished
void signalInstallationFinished()
KUrl::toLocalFile
QString toLocalFile(AdjustPathOption trailing=LeaveTrailingSlash) const
KIO::FileCopyJob::destUrl
KUrl destUrl() const
QString
ktoolinvocation.h
QObject
kDebug
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
installation.h
KUrl
KNS3::Installation::slotInstallationVerification
void slotInstallationVerification(int result)
Definition: knewstuff3/core/installation.cpp:579
KMessageBox::Cancel
KNS3::EntryInternal::setReleaseDate
void setReleaseDate(const QDate &releasedate)
Sets the release date.
Definition: entryinternal.cpp:229
KNS3::Installation::readConfig
bool readConfig(const KConfigGroup &group)
Definition: knewstuff3/core/installation.cpp:57
KNS3::Installation::signalEntryChanged
void signalEntryChanged(const KNS3::EntryInternal &entry)
KNS3::EntryInternal::installedFiles
QStringList installedFiles() const
Retrieve the locally installed files.
Definition: entryinternal.cpp:382
KNS3::Installation::downloadPayload
void downloadPayload(const KNS3::EntryInternal &entry)
Downloads a payload file.
Definition: knewstuff3/core/installation.cpp:154
kzip.h
karchive.h
kprocess.h
KIO::FileCopyJob::srcUrl
KUrl srcUrl() const
KNS3::Installation::signalInstallationFailed
void signalInstallationFailed(const QString &message)
KIO::file_copy
FileCopyJob * file_copy(const KUrl &src, const KUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
KNS3::Entry::Installed
Definition: knewstuff3/entry.h:61
KStandardDirs
KNS3::Installation::ScopeUser
Definition: knewstuff3/core/installation.h:61
KTar
QStringList
KNS3::Installation::uninstall
void uninstall(KNS3::EntryInternal entry)
Uninstalls an entry.
Definition: knewstuff3/core/installation.cpp:526
KUrl::pathOrUrl
QString pathOrUrl() const
KNS3::EntryInternal::status
Entry::Status status() const
Retrieves the entry&#39;s status.
Definition: entryinternal.cpp:367
KStandardDirs::localxdgdatadir
QString localxdgdatadir() const
KZip
KNS3::Security::SIGNED_OK
The MD5 sum check is OK.
Definition: knewstuff3/core/security.h:86
KNS3::Entry::Downloadable
Definition: knewstuff3/entry.h:60
KNS3::Installation::CheckIfPossible
Definition: knewstuff3/core/installation.h:56
KMessageBox::questionYesNo
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)
KShell::quoteArg
QString quoteArg(const QString &arg)
KStandardDirs::installPath
static QString installPath(const char *type)
KNS3::EntryInternal::version
QString version() const
Retrieve the version string of the object.
Definition: entryinternal.cpp:214
KArchiveDirectory::copyTo
void copyTo(const QString &dest, bool recursive=true) const
KArchiveDirectory::entry
const KArchiveEntry * entry(const QString &name) const
ktar.h
job.h
KConfigGroup
KArchiveDirectory
KNS3::Entry::Installing
Definition: knewstuff3/entry.h:64
dir
QString dir(const QString &fileClass)
KNS3::Security::checkValidity
void checkValidity(const QString &fileName)
Verifies the integrity and the signature of a tarball file.
Definition: knewstuff3/core/security.cpp:227
klocalizedstring.h
KUrl::fileName
QString fileName(const DirectoryOptions &options=IgnoreTrailingSlash) const
KStandardDirs::locateLocal
static QString locateLocal(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
KIO::FileCopyJob
kstandarddirs.h
KNS3::EntryInternal::updateReleaseDate
QDate updateReleaseDate() const
Retrieve the date of the newer version that is available as update.
Definition: entryinternal.cpp:244
KNS3::Installation::isRemote
bool isRemote() const
Definition: knewstuff3/core/installation.cpp:139
KNS3::Security
Handles security related issues, like signing, verifying.
Definition: knewstuff3/core/security.h:47
KProcess::execute
int execute(int msecs=-1)
kWarning
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KNS3::Entry::Updating
Definition: knewstuff3/entry.h:65
KNS3::Installation::ScopeSystem
Definition: knewstuff3/core/installation.h:62
KNS3::EntryInternal::setUnInstalledFiles
void setUnInstalledFiles(const QStringList &files)
Set the files that have been uninstalled by the uninstall command.
Definition: entryinternal.cpp:387
KNS3::Installation
KNewStuff entry installation.
Definition: knewstuff3/core/installation.h:45
KMessageBox::Yes
KUrl::url
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
KNS3::Installation::slotPayloadResult
void slotPayloadResult(KJob *job)
Definition: knewstuff3/core/installation.cpp:192
KNS3::EntryInternal::setStatus
void setStatus(Entry::Status status)
Returns the checksum for the entry.
Definition: entryinternal.cpp:372
KToolInvocation::invokeBrowser
static void invokeBrowser(const QString &url, const QByteArray &startup_id=QByteArray())
KNS3::Installation::Installation
Installation(QObject *parent=0)
Constructor.
Definition: knewstuff3/core/installation.cpp:47
kmessagebox.h
KRandom::randomString
QString randomString(int length)
KConfigGroup::readEntry
T readEntry(const QString &key, const T &aDefault) const
KNS3::Installation::install
void install(KNS3::EntryInternal entry)
Installs an entry&#39;s payload file.
Definition: knewstuff3/core/installation.cpp:149
KNS3::Installation::CheckAlways
Definition: knewstuff3/core/installation.h:57
KMessageBox::warningContinueCancel
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)
KJob
KNS3::Installation::signalPayloadLoaded
void signalPayloadLoaded(KUrl payload)
KArchiveDirectory::entries
QStringList entries() const
KNS3::EntryInternal::setInstalledFiles
void setInstalledFiles(const QStringList &files)
Set the files that have been installed by the install command.
Definition: entryinternal.cpp:377
KNS3::Entry::Updateable
Definition: knewstuff3/entry.h:62
KNS3::Security::ref
static Security * ref()
Definition: knewstuff3/core/security.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Wed Aug 14 2019 04:18:16 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.8 API Reference

Skip menu "kdelibs-4.14.8 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal