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

KNewStuff

  • knewstuff
  • knewstuff3
  • core
knewstuff3/core/installation.h
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 #ifndef KNEWSTUFF3_INSTALLATION_H
20 #define KNEWSTUFF3_INSTALLATION_H
21 
22 #include <QtCore/QObject>
23 #include <QtCore/QString>
24 
25 #include <kconfiggroup.h>
26 
27 #include "entryinternal.h"
28 
29 class KArchiveDirectory;
30 class KJob;
31 
32 namespace KNS3
33 {
34 
45 class Installation :public QObject
46 {
47  Q_OBJECT
48 public:
52  Installation(QObject* parent = 0);
53 
54  enum Policy {
55  CheckNever,
56  CheckIfPossible,
57  CheckAlways
58  };
59 
60  enum Scope {
61  ScopeUser,
62  ScopeSystem
63  };
64 
65  bool readConfig(const KConfigGroup& group);
66  bool isRemote() const;
67 
68 public Q_SLOTS:
80  void downloadPayload(const KNS3::EntryInternal& entry);
81 
96  void install(KNS3::EntryInternal entry);
97 
108  void uninstall(KNS3::EntryInternal entry);
109 
110  void slotInstallationVerification(int result);
111  void slotPayloadResult(KJob *job);
112 
113 Q_SIGNALS:
114  void signalEntryChanged(const KNS3::EntryInternal& entry);
115  void signalInstallationFinished();
116  void signalInstallationFailed(const QString& message);
117 
118  void signalPayloadLoaded(KUrl payload); // FIXME: return Entry
119 
120 private:
121  void install(KNS3::EntryInternal entry, const QString& downloadedFile);
122 
123  QString targetInstallationPath(const QString& payloadfile);
124  QStringList installDownloadedFileAndUncompress(const KNS3::EntryInternal& entry, const QString& payloadfile, const QString installdir);
125  void runPostInstallationCommand(const QString& installPath);
126 
127  static QStringList archiveEntries(const QString& path, const KArchiveDirectory * dir);
128 
129  // applications can set this if they want the installed files/directories to be piped into a shell command
130  QString postInstallationCommand;
131  // a custom command to run for the uninstall
132  QString uninstallCommand;
133  // compression policy
134  QString uncompression;
135 
136  // only one of the five below can be set, that will be the target install path/file name
137  // FIXME: check this when reading the config and make one path out of it if possible?
138  QString standardResourceDirectory;
139  QString targetDirectory;
140  QString xdgTargetDirectory;
141  QString installPath;
142  QString absoluteInstallPath;
143 
144  // policies whether verification needs to be done
145  Policy checksumPolicy;
146  Policy signaturePolicy;
147  // scope: install into user or system dirs
148  Scope scope;
149 
150  // FIXME this throws together a file name from entry name and version - why would anyone want that?
151  bool customName;
152  bool acceptHtml;
153 
154  QMap<KJob*, EntryInternal> entry_jobs;
155 
156  Q_DISABLE_COPY(Installation)
157 };
158 
159 }
160 
161 #endif
KNS3::EntryInternal
KNewStuff data entry container.
Definition: entryinternal.h:54
KNS3::Installation::CheckNever
Definition: knewstuff3/core/installation.h:55
KNS3::Installation::Policy
Policy
Definition: knewstuff3/core/installation.h:54
KNS3::Installation::signalInstallationFinished
void signalInstallationFinished()
KNS3::Installation::Scope
Scope
Definition: knewstuff3/core/installation.h:60
QObject
KUrl
KNS3::Installation::slotInstallationVerification
void slotInstallationVerification(int result)
Definition: knewstuff3/core/installation.cpp:584
KNS3::Installation::readConfig
bool readConfig(const KConfigGroup &group)
Definition: knewstuff3/core/installation.cpp:57
KNS3::Installation::signalEntryChanged
void signalEntryChanged(const KNS3::EntryInternal &entry)
KNS3::Installation::downloadPayload
void downloadPayload(const KNS3::EntryInternal &entry)
Downloads a payload file.
Definition: knewstuff3/core/installation.cpp:154
KNS3::Installation::signalInstallationFailed
void signalInstallationFailed(const QString &message)
KNS3::Installation::ScopeUser
Definition: knewstuff3/core/installation.h:61
KNS3::Installation::uninstall
void uninstall(KNS3::EntryInternal entry)
Uninstalls an entry.
Definition: knewstuff3/core/installation.cpp:531
KNS3::Installation::CheckIfPossible
Definition: knewstuff3/core/installation.h:56
KConfigGroup
KArchiveDirectory
entryinternal.h
KNS3::Installation::ScopeSystem
Definition: knewstuff3/core/installation.h:62
KNS3::Installation
KNewStuff entry installation.
Definition: knewstuff3/core/installation.h:45
KNS3::Installation::slotPayloadResult
void slotPayloadResult(KJob *job)
Definition: knewstuff3/core/installation.cpp:192
KNS3::Installation::Installation
Installation(QObject *parent=0)
Constructor.
Definition: knewstuff3/core/installation.cpp:47
KNS3
Definition: atticaprovider.cpp:35
KNS3::Installation::install
void install(KNS3::EntryInternal entry)
Installs an entry's payload file.
Definition: knewstuff3/core/installation.cpp:149
KNS3::Installation::CheckAlways
Definition: knewstuff3/core/installation.h:57
KJob
KNS3::Installation::signalPayloadLoaded
void signalPayloadLoaded(KUrl payload)
QMap
kconfiggroup.h
KNS3::Installation::isRemote
bool isRemote() const
Definition: knewstuff3/core/installation.cpp:139
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jan 18 2020 00:00:00 by doxygen 1.8.15 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.38 API Reference

Skip menu "kdelibs-4.14.38 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