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

KNewStuff

  • knewstuff
  • knewstuff2
  • ui
knewstuff2/ui/downloaddialog.cpp
Go to the documentation of this file.
1/*
2 This file is part of KNewStuff2.
3 Copyright (C) 2005 by Enrico Ros <eros.kde@email.it>
4 Copyright (C) 2005 - 2007 Josef Spillner <spillner@kde.org>
5 Copyright (C) 2007 Dirk Mueller <mueller@kde.org>
6 Copyright (C) 2007 Jeremy Whiting <jpwhiting@kde.org>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22// own include
23#include "downloaddialog.h"
24
25// qt/kde includes
26#include <QtCore/QTimer>
27#include <QtGui/QPixmap>
28#include <QtGui/QSortFilterProxyModel>
29#include <kaboutdata.h>
30#include <kcomponentdata.h>
31#include <kmessagebox.h>
32#include <ktoolinvocation.h>
33
34#include <kdebug.h>
35
36#include "knewstuff2/core/provider.h"
37#include "knewstuff2/core/providerhandler.h"
38#include "knewstuff2/core/entry.h"
39#include "knewstuff2/core/entryhandler.h"
40#include "knewstuff2/core/category.h"
41
42#include "knewstuff2/dxs/dxs.h"
43
44// local includes
45#include "ui_DownloadDialog.h"
46#include "itemsmodel.h"
47#include "itemsviewdelegate.h"
48#include "kdxsrating.h"
49#include "kdxscomment.h"
50#include "kdxscomments.h"
51
52const char * ConfigGroup = "DownloadDialog Settings";
53
54using namespace KNS;
55
56DownloadDialog::DownloadDialog(DxsEngine* _engine, QWidget * _parent)
57 : KDialog(_parent)
58{
59 setButtons(0);
60
61 m_engine = _engine;
62 connect(m_engine, SIGNAL(signalProgress(QString,int)), SLOT(slotProgress(QString,int)));
63 connect(m_engine, SIGNAL(signalEntryChanged(KNS::Entry*)), SLOT(slotEntryChanged(KNS::Entry*)));
64 connect(m_engine, SIGNAL(signalPayloadFailed(KNS::Entry*)), SLOT(slotPayloadFailed(KNS::Entry*)));
65 connect(m_engine, SIGNAL(signalPayloadLoaded(KUrl)), SLOT(slotPayloadLoaded(KUrl)));
66 connect(m_engine, SIGNAL(signalProvidersFailed()), SLOT(slotProvidersFailed()));
67 connect(m_engine, SIGNAL(signalEntriesFailed()), SLOT(slotEntriesFailed()));
68
69 connect(m_engine, SIGNAL(signalEntryLoaded(KNS::Entry*,const KNS::Feed*,const KNS::Provider*)),
70 this, SLOT(slotEntryLoaded(KNS::Entry*,const KNS::Feed*,const KNS::Provider*)));
71 connect(m_engine, SIGNAL(signalEntryRemoved(KNS::Entry*,const KNS::Feed*)),
72 this, SLOT(slotEntryRemoved(KNS::Entry*,const KNS::Feed*)));
73
74 // initialize the private classes
75 messageTimer = new QTimer(this);
76 messageTimer->setSingleShot(true);
77 connect(messageTimer, SIGNAL(timeout()), SLOT(slotResetMessage()));
78
79 networkTimer = new QTimer(this);
80 connect(networkTimer, SIGNAL(timeout()), SLOT(slotNetworkTimeout()));
81
82 m_searchTimer = new QTimer(this);
83 m_searchTimer->setSingleShot(true);
84 m_searchTimer->setInterval(1000); // timeout after 30 seconds
85 connect(m_searchTimer, SIGNAL(timeout()), SLOT(slotUpdateSearch()));
86
87 // popuplate dialog with stuff
88 QWidget* _mainWidget = new QWidget(this);
89 setMainWidget(_mainWidget);
90 setupUi(_mainWidget);
91
92 // create the delegate
93 mDelegate = new ItemsViewDelegate(m_listView, this);
94 m_listView->setItemDelegate(mDelegate);
95 connect(mDelegate, SIGNAL(performAction(DownloadDialog::EntryAction,KNS::Entry*)),
96 SLOT(slotPerformAction(DownloadDialog::EntryAction,KNS::Entry*)));
97
98 // create the filter model
99 m_filteredModel = new QSortFilterProxyModel(this);
100 m_filteredModel->setFilterRole(ItemsModel::kNameRole);
101 m_filteredModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
102 m_listView->setModel(m_filteredModel);
103 connect(m_listView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
104 this, SLOT(slotListIndexChanged(QModelIndex,QModelIndex)));
105
106 // create left picture widget (if picture found)
107 //QPixmap p( KStandardDirs::locate( "data", "knewstuff/pics/ghns.png" ) );
108 //if ( !p.isNull() )
109 // horLay->addWidget( new ExtendImageWidget( p, this ) );
110 // FIXME KDE4PORT: if we use a left bar image, find a better way
111
112
113 connect(m_sourceCombo, SIGNAL(currentIndexChanged(int)), SLOT(slotLoadProviderDXS()));
114 connect(m_sortCombo, SIGNAL(currentIndexChanged(int)), SLOT(slotSortingSelected(int)));
115 connect(m_searchEdit, SIGNAL(textChanged(QString)), SLOT(slotSearchTextChanged()));
116 connect(m_searchEdit, SIGNAL(editingFinished()), SLOT(slotUpdateSearch()));
117
118 // FIXME: not sure if this is better, or setting openExternalLinks
119 //connect( m_providerLinkLabel, SIGNAL(linkActivated(QString)),
120 // KToolInvocation::self(), SLOT(invokeBrowser(QString)));
121
122 // load the last size from config
123 KConfigGroup group(KGlobal::config(), ConfigGroup);
124 restoreDialogSize(group);
125 setMinimumSize(700, 400);
126
127 setCaption(i18n("Get Hot New Stuff"));
128 m_titleWidget->setText(i18nc("Program name followed by 'Add On Installer'",
129 "%1 Add-On Installer",
130 KGlobal::activeComponent().aboutData()->programName()));
131 m_titleWidget->setPixmap(KIcon(KGlobal::activeComponent().aboutData()->programIconName()));
132
133 connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(accept()));
134
135 KMenu * collabMenu = new KMenu(m_collaborationButton);
136 QAction * action_collabrating = collabMenu->addAction(i18n("Add Rating"));
137 action_collabrating->setData(DownloadDialog::kCollabRate);
138
139 QAction * action_collabcomment = collabMenu->addAction(i18n("Add Comment"));
140 action_collabcomment->setData(DownloadDialog::kCollabComment);
141
142 QAction * action_comment = collabMenu->addAction(SmallIcon("help-about"), i18n("View Comments"));
143 action_comment->setData(DownloadDialog::kComments);
144
145/* TODO: Re-enable when implemented
146 QAction * action_collabtranslation = collabMenu->addAction(i18n("Translate"));
147 action_collabtranslation->setData(DownloadDialog::kCollabTranslate);
148
149 QAction * action_collabsubscribe = collabMenu->addAction(i18n("Subscribe"));
150 action_collabsubscribe->setData(DownloadDialog::kCollabSubscribe);
151
152 QAction * action_collabremoval = collabMenu->addAction(i18n("Report bad entry"));
153 action_collabremoval->setData(DownloadDialog::kCollabRemoval);
154*/
155
156 m_collaborationButton->setMenu(collabMenu);
157 connect(m_collaborationButton, SIGNAL(triggered(QAction*)), this, SLOT(slotCollabAction(QAction*)));
158}
159
160DownloadDialog::~DownloadDialog()
161{
162 KConfigGroup group(KGlobal::config(), ConfigGroup);
163 saveDialogSize(group, KConfigBase::Persistent);
164}
165
166void DownloadDialog::slotPerformAction(DownloadDialog::EntryAction action, KNS::Entry * entry)
167{
168 kDebug(551) << "perform action: " << action;
169 const Provider * provider = m_providers.contains(entry) ? m_providers[entry] : NULL;
170 Dxs * dxs = m_engine->dxsObject(provider);
171 switch (action) {
172 case kViewInfo:
173 if (provider && dxs) {
174 if (provider->webService().isValid()) {
175 dxs->call_info();
176 } else {
177 slotInfo(provider->name().representation(),
178 provider->webAccess().pathOrUrl(),
179 QString());
180 }
181 }
182 break;
183 case kComments:
184 // show the entry's comments
185 if (provider && dxs) {
186 connect(dxs, SIGNAL(signalComments(QStringList)), this, SLOT(slotComments(QStringList)));
187 dxs->call_comments(entry->idNumber());
188 }
189 break;
190 case kChanges:
191 // show the entry's changelog
192 break;
193 case kContactEmail:
194 // invoke mail with the address of the author
195 KToolInvocation::invokeMailer(entry->author().email(), i18n("Re: %1", entry->name().representation()));
196 break;
197 case kContactJabber:
198 // start jabber with author's info
199 break;
200 case kCollabTranslate:
201 // open translation dialog
202 break;
203 case kCollabRemoval:
204 // verify removal, maybe authenticate?
205 break;
206 case kCollabSubscribe:
207 // subscribe to changes
208 break;
209 case kUninstall:
210 // uninstall
211 setCursor(Qt::WaitCursor);
212 m_engine->uninstall(entry);
213 setCursor(Qt::ArrowCursor);
214 break;
215 case kInstall:
216 // install
217 setCursor(Qt::WaitCursor);
218 m_engine->downloadPayload(entry);
219 break;
220 case kCollabComment: {
221 // open comment dialog
222 QPointer<KDXSComment> commentDialog = new KDXSComment(this);
223 int ret = commentDialog->exec();
224 if (ret == QDialog::Accepted) {
225 QString s = commentDialog->comment();
226 if (dxs && !s.isEmpty()) {
227 dxs->call_comment(entry->idNumber(), s);
228 }
229 }
230 delete commentDialog;
231 }
232 break;
233 case kCollabRate: {
234 // prompt for rating, and send to provider
235 QPointer<KDXSRating> ratingDialog = new KDXSRating(this);
236 int ret = ratingDialog->exec();
237 if (ret == QDialog::Accepted) {
238 int rating = ratingDialog->rating();
239 if (dxs) {
240 dxs->call_rating(entry->idNumber(), rating);
241 }
242 }
243 delete ratingDialog;
244 }
245 break;
246 }
247}
248
249void DownloadDialog::slotCollabAction(QAction * action)
250{
251 DownloadDialog::EntryAction entryAction = (DownloadDialog::EntryAction)action->data().toInt();
252 QModelIndex currentIndex = m_listView->currentIndex();
253 const ItemsModel * realmodel = qobject_cast<const ItemsModel*>(m_filteredModel->sourceModel());
254 QModelIndex index = m_filteredModel->mapToSource(currentIndex);
255 KNS::Entry * entry = realmodel->entryForIndex(index);
256 slotPerformAction(entryAction, entry);
257}
258
259void DownloadDialog::slotListIndexChanged(const QModelIndex &index, const QModelIndex &/*old */)
260{
261 //kDebug() << "slotListIndexChanged called";
262
263 m_collaborationButton->setEnabled(m_hasDxs && index.isValid());
264}
265
266void DownloadDialog::hideEvent(QHideEvent * event)
267{
268 KConfigGroup group(KGlobal::config(), ConfigGroup);
269 saveDialogSize(group, KConfigBase::Persistent);
270 KDialog::hideEvent(event);
271}
272
273void DownloadDialog::displayMessage(const QString & msg, KTitleWidget::MessageType type, int timeOutMs)
274{
275 // stop the pending timer if present
276 messageTimer->stop();
277
278 // set text to messageLabel
279 m_titleWidget->setComment(msg, type);
280
281 // single shot the resetColors timer (and create it if null)
282 if (timeOutMs > 0) {
283 //kDebug(551) << "starting the message timer for " << timeOutMs;
284 messageTimer->start(timeOutMs);
285 }
286}
287
288void DownloadDialog::installItem(Entry *entry)
289{
290 // safety check
291// if ( item->url().isEmpty() || item->destinationPath().isEmpty() )
292// {
293// displayMessage( i18n("I don't know how to install this. Sorry, my fault."), Info );
294// return;
295// }
296
297 //TODO check for AvailableItem deletion! (avoid broken pointers) -> cancel old jobs
298 slotEntryChanged(entry);
299}
300
301void DownloadDialog::removeItem(Entry *entry)
302{
303 Q_UNUSED(entry);
304// displayMessage( i18n("%1 is no more installed.").arg( item->name().representation() ) );
305}
306
307void DownloadDialog::slotResetMessage() // SLOT
308{
309 m_titleWidget->setComment(QString());
310}
311
312void DownloadDialog::slotNetworkTimeout() // SLOT
313{
314 displayMessage(i18n("Timeout. Check Internet connection."), KTitleWidget::ErrorMessage);
315}
316
317void DownloadDialog::slotSortingSelected(int sortType) // SLOT
318{
319 if (sortType >= 0) {
320 //kDebug(551) << "sorting Selected, setting the sourcemodel for the view";
321 QString feedName = m_sortCombo->currentText();
322 QString feedType = m_sortCombo->itemData(sortType).toString();
323
324 const Provider * currentProvider = m_entriesByProvider.keys()[m_sourceCombo->currentIndex()];
325 Feed * selectedFeed = currentProvider->downloadUrlFeed(feedType);
326 m_filteredModel->setSourceModel(m_models.value(selectedFeed));
327 m_collaborationButton->setEnabled(false);
328 }
329}
330
331
333
334void DownloadDialog::slotLoadProviderDXS()
335{
336 kDebug(551) << "slotLoadProviderDXS called";
337 //QString category = m_sourceCombo->currentText();
338 //QString categoryname = categorymap[category];
339 QString providerName = m_sourceCombo->currentText();
340
341 QList<const Provider*> providers = m_entriesByProvider.keys();
342 const Provider * provider = 0;
343
344 for (int i = 0; i < providers.size(); ++i) {
345 if (providers[i]->name().representation() == providerName) {
346 provider = providers[i];
347 // update the sortCombo with this provider's feeds
348 populateSortCombo(providers[i]);
349
350 Feed * selectedFeed = providers[i]->downloadUrlFeed(m_sortCombo->itemData(m_sortCombo->currentIndex()).toString());
351 m_filteredModel->setSourceModel(m_models.value(selectedFeed));
352 //m_list->setProvider(providers[i],
353 // providers[i]->downloadUrlFeed(m_sortCombo->itemData(m_sortCombo->currentIndex()).toString()));
354 break;
355 }
356 }
357 m_hasDxs = (provider && m_engine->dxsObject(provider) != NULL);
358 m_collaborationButton->setEnabled(m_hasDxs);
359}
360
361void DownloadDialog::slotUpdateSearch()
362{
363 m_searchTimer->stop();
364 m_filteredModel->setFilterFixedString(m_searchEdit->text());
365 m_filteredModel->invalidate();
366}
367
368void DownloadDialog::slotLoadProvidersListDXS()
369{
370}
371
372void DownloadDialog::slotSearchTextChanged()
373{
374 m_searchTimer->start();
375}
376
377void DownloadDialog::slotCategories(QList<KNS::Category*> categories)
378{
379 categorymap.clear();
380
381 for (QList<KNS::Category*>::Iterator it = categories.begin(); it != categories.end(); ++it) {
382 KNS::Category *category = (*it);
383 //kDebug(551) << "Category: " << category->name().representation();
384 QPixmap icon = DesktopIcon(category->icon().url(), 16);
385 // FIXME: use icon from remote URLs (see non-DXS providers as well)
386 m_sourceCombo->addItem(icon, category->name().representation());
387 categorymap[category->name().representation()] = category->id();
388 // FIXME: better use global id, since names are not guaranteed
389 // to be unique
390 }
391
392 //m_sourceCombo->setEnabled(true);
393
394 slotLoadProviderDXS();
395}
396
397void DownloadDialog::slotEntries(QList<KNS::Entry*> _entries)
398{
399 Q_UNUSED(_entries);
400
401 //d->itemsView->setItems( entries );
402 // FIXME: old API here
403}
404
405void DownloadDialog::slotEntriesFailed()
406{
407 displayMessage(i18n("Entries failed to load"));
408}
409// FIXME: below here, those are for traditional GHNS
410
411void DownloadDialog::slotEntryLoaded(Entry *entry, const Feed *feed, const Provider *provider)
412{
413 Entry::List e = entries[feed];
414 e.append(entry);
415 entries[feed] = e;
416
417 if (!m_entriesByProvider.contains(provider)) {
418 kDebug(551) << "adding provider " << provider->name().representation() << " to combobox";
419 m_sourceCombo->addItem(provider->name().representation());
420 }
421 m_entriesByProvider[provider].append(entry);
422
423 // FIXME: what if entry belongs to more than one provider at once?
424 m_providers[entry] = provider;
425
426 mMutex.lock();
427
428 if (!m_models.value(feed)) {
429 // new feed
430 kDebug(551) << "making a new model for this feed" << feed;
431 m_models[feed] = new KNS::ItemsModel(this, provider->webService().isValid());
432 connect(m_engine, SIGNAL(signalEntryChanged(KNS::Entry*)),
433 m_models[feed], SLOT(slotEntryChanged(KNS::Entry*)));
434 if (provider->name().representation() == m_sourceCombo->currentText()) {
435 // this provider is selected, so refresh the feed combobox
436 populateSortCombo(provider);
437 }
438 }
439 mMutex.unlock();
440
441 KNS::ItemsModel* thisModel = m_models.value(feed);
442
443 Q_ASSERT(thisModel != NULL);
444 thisModel->addEntry(entry);
445}
446
447void DownloadDialog::slotEntryRemoved(KNS::Entry *entry, const KNS::Feed *feed)
448{
449 Q_ASSERT(m_models[feed] != NULL);
450
451 m_models[feed]->removeEntry(entry);
452}
453
454void DownloadDialog::refresh()
455{
456 m_sourceCombo->clear();
457
458 Q_ASSERT(m_entriesByProvider.keys().size() > 0);
459
460 for (int i = 0; i < m_entriesByProvider.keys().count(); i++) {
461 const Provider *provider = m_entriesByProvider.keys().at(i);
462 if (!provider) {
463 //kDebug(551) << "INVALID FEED?!";
464 continue;
465 }
466 //QPixmap icon = DesktopIcon(QString(), 16);
467 //d->m_typeCombo->addItem(icon, feed->name().representation());
468 m_sourceCombo->addItem(provider->name().representation());
469 // FIXME: see DXS categories
470 }
471
472 slotLoadProviderDXS();
473
475 //const Provider * selectedProvider = m_entriesByProvider.keys()[0];
476
477 //populateSortCombo(selectedProvider);
478
479 //m_sourceCombo->setEnabled(true);
480 //m_sortCombo->setEnabled(true);
481 //m_searchEdit->setEnabled(true);
482}
483
484void DownloadDialog::populateSortCombo(const Provider * provider)
485{
486 QString url = provider->webAccess().pathOrUrl();
487 if (url.isEmpty()) {
488 m_providerLinkLabel->hide();
489 } else {
490 m_providerLinkLabel->setText(QString("<a href=\"%1\">?</a>").arg(url));
491 }
492
493 QStringList feeds = provider->feeds();
494 m_sortCombo->clear();
495 for (int i = 0; i < feeds.size(); ++i) {
496 QString feedName = provider->downloadUrlFeed(feeds[i])->name().representation();
497 kDebug(551) << "adding feed " << feeds[i] << " to combobox";
498 m_sortCombo->addItem(feedName, feeds[i]); // put in the name for the text, and feeds[i] for the userData
499 }
500}
501
502void DownloadDialog::slotInfo(QString provider, QString server, QString version)
503{
504 QString link = QString("<a href=\"%1\">%1</a>").arg(server);
505 QString infostring = i18n("Server: %1", link);
506 infostring += i18n("<br />Provider: %1", provider);
507 infostring += i18n("<br />Version: %1", version);
508
509 KMessageBox::information(this,
510 infostring,
511 i18n("Provider information"));
512}
513
514void DownloadDialog::slotComments(QStringList comments)
515{
516 QPointer<KDXSComments> commentsdlg = new KDXSComments(this);
517
518 for (QStringList::const_iterator it = comments.constBegin(); it != comments.constEnd(); ++it) {
519 //kDebug() << "Comment: " << (*it);
520 commentsdlg->addComment("foo", (*it));
521 }
522
523 commentsdlg->exec();
524 delete commentsdlg;
525}
526
528
529void DownloadDialog::slotEntryChanged(KNS::Entry * entry)
530{
531 Q_UNUSED(entry)
532 setCursor(Qt::ArrowCursor);
533}
534
535void DownloadDialog::slotPayloadFailed(KNS::Entry * entry)
536{
537 setCursor(Qt::ArrowCursor);
538 KMessageBox::error(this, i18n("Could not install %1", entry->name().representation()),
539 i18n("Get Hot New Stuff!"));
540}
541
542void DownloadDialog::slotPayloadLoaded(KUrl url)
543{
544 Q_UNUSED(url)
545 setCursor(Qt::ArrowCursor);
546}
547
548void DownloadDialog::slotProgress(const QString & text, int percentage)
549{
550 m_progress->addProgress(text, percentage);
551}
552
553void DownloadDialog::slotProvidersFailed()
554{
555 kDebug(551) << "slotProvidersFailed";
556 KMessageBox::error(this,
557 i18n("There was an error loading data providers."),
558 i18n("Get Hot New Stuff"));
559}
560
561/*void DownloadDialog::slotItemMessage( KJob * job, const QString & message )
562{
563 AvailableItem * item = d->transferJobs[ job ].item;
564 kDebug(551) << "Name: " << item->name().representation() << " msg: '" << message << "'.";
565 d->itemsView->updateItem( item );
566}
567
568void DownloadDialog::slotItemPercentage( KJob * job, unsigned long percent )
569{
570 AvailableItem * item = d->transferJobs[ job ].item;
571 item->setProgress( (float)percent / 100.0 );
572 d->itemsView->updateItem( item );
573}
574
575void DownloadDialog::slotItemResult( KJob * job )
576{
577 item->setState( AvailableItem::Normal );
578 item->setProgress( 100.0 );
579 d->itemsView->updateItem( item );
580
581}*/
582//END File(s) Transferring
583
584// fault/error from kdxsbutton
585void DownloadDialog::slotFault()
586{
587 KMessageBox::error(this,
588 i18n("A protocol fault has occurred. The request has failed."),
589 i18n("Desktop Exchange Service"));
590}
591
592void DownloadDialog::slotError()
593{
594 KMessageBox::error(this,
595 i18n("A network error has occurred. The request has failed."),
596 i18n("Desktop Exchange Service"));
597}
598
599#include "downloaddialog.moc"
category.h
KConfigBase::Persistent
Persistent
KConfigGroup
KDXSComment
KNewStuff comment addition window.
Definition: kdxscomment.h:37
KDXSComments
KNewStuff comments window.
Definition: kdxscomments.h:37
KDXSRating
KNewStuff rating submission window.
Definition: kdxsrating.h:39
KDialog
KDialog::setMainWidget
void setMainWidget(QWidget *widget)
KDialog::hideEvent
virtual void hideEvent(QHideEvent *)
KDialog::saveDialogSize
void saveDialogSize(KConfigGroup &config, KConfigGroup::WriteConfigFlags options=KConfigGroup::Normal) const
KDialog::restoreDialogSize
void restoreDialogSize(const KConfigGroup &config)
KDialog::setButtons
void setButtons(ButtonCodes buttonMask)
KDialog::setCaption
virtual void setCaption(const QString &caption)
KIcon
KMenu
KMessageBox::error
static void error(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Notify)
KMessageBox::information
static void information(QWidget *parent, const QString &text, const QString &caption=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
KNS::Author::email
QString email() const
Retrieve the author's email address.
Definition: knewstuff2/core/author.cpp:68
KNS::Category
KNewStuff category.
Definition: category.h:36
KNS::Category::name
KTranslatable name() const
Retrieve the name of the category.
Definition: category.cpp:55
KNS::Category::id
QString id() const
Retrieve the unique id of the category.
Definition: category.cpp:45
KNS::Category::icon
KUrl icon() const
Retrieve the icon of the category.
Definition: category.cpp:75
KNS::CoreEngine::downloadPayload
void downloadPayload(Entry *entry)
Downloads a payload file.
Definition: coreengine.cpp:300
KNS::CoreEngine::uninstall
bool uninstall(KNS::Entry *entry)
Uninstalls an entry.
Definition: coreengine.cpp:1576
KNS::DownloadDialog::hideEvent
virtual void hideEvent(QHideEvent *event)
Definition: knewstuff2/ui/downloaddialog.cpp:266
KNS::DownloadDialog::refresh
void refresh()
Definition: knewstuff2/ui/downloaddialog.cpp:454
KNS::DownloadDialog::displayMessage
void displayMessage(const QString &msg, KTitleWidget::MessageType type=KTitleWidget::PlainMessage, int timeOutMs=0)
Definition: knewstuff2/ui/downloaddialog.cpp:273
KNS::DownloadDialog::installItem
void installItem(Entry *entry)
Definition: knewstuff2/ui/downloaddialog.cpp:288
KNS::DownloadDialog::~DownloadDialog
~DownloadDialog()
Definition: knewstuff2/ui/downloaddialog.cpp:160
KNS::DownloadDialog::EntryAction
EntryAction
Definition: knewstuff2/ui/downloaddialog.h:76
KNS::DownloadDialog::kInstall
@ kInstall
Definition: knewstuff2/ui/downloaddialog.h:86
KNS::DownloadDialog::kCollabTranslate
@ kCollabTranslate
Definition: knewstuff2/ui/downloaddialog.h:82
KNS::DownloadDialog::kUninstall
@ kUninstall
Definition: knewstuff2/ui/downloaddialog.h:85
KNS::DownloadDialog::kComments
@ kComments
Definition: knewstuff2/ui/downloaddialog.h:78
KNS::DownloadDialog::kCollabRemoval
@ kCollabRemoval
Definition: knewstuff2/ui/downloaddialog.h:83
KNS::DownloadDialog::kCollabRate
@ kCollabRate
Definition: knewstuff2/ui/downloaddialog.h:88
KNS::DownloadDialog::kCollabSubscribe
@ kCollabSubscribe
Definition: knewstuff2/ui/downloaddialog.h:84
KNS::DownloadDialog::kContactEmail
@ kContactEmail
Definition: knewstuff2/ui/downloaddialog.h:80
KNS::DownloadDialog::kChanges
@ kChanges
Definition: knewstuff2/ui/downloaddialog.h:79
KNS::DownloadDialog::kContactJabber
@ kContactJabber
Definition: knewstuff2/ui/downloaddialog.h:81
KNS::DownloadDialog::kCollabComment
@ kCollabComment
Definition: knewstuff2/ui/downloaddialog.h:87
KNS::DownloadDialog::kViewInfo
@ kViewInfo
Definition: knewstuff2/ui/downloaddialog.h:77
KNS::DownloadDialog::removeItem
void removeItem(Entry *entry)
Definition: knewstuff2/ui/downloaddialog.cpp:301
KNS::DownloadDialog::DownloadDialog
DownloadDialog(DxsEngine *engine, QWidget *parent)
Definition: knewstuff2/ui/downloaddialog.cpp:56
KNS::DxsEngine
KNewStuff DXS engine.
Definition: dxsengine.h:40
KNS::DxsEngine::dxsObject
Dxs * dxsObject(const Provider *provider)
Definition: dxsengine.cpp:43
KNS::Dxs
KNewStuff DXS proxy.
Definition: dxs.h:49
KNS::Dxs::call_rating
void call_rating(int id, int rating)
Definition: dxs.cpp:168
KNS::Dxs::call_comments
void call_comments(int id)
Definition: dxs.cpp:92
KNS::Dxs::call_info
void call_info()
Definition: dxs.cpp:57
KNS::Dxs::call_comment
void call_comment(int id, QString comment)
Definition: dxs.cpp:152
KNS::Entry
KNewStuff data entry container.
Definition: knewstuff2/core/entry.h:47
KNS::Entry::name
KTranslatable name() const
Retrieve the name of the data object.
Definition: knewstuff2/core/entry.cpp:81
KNS::Entry::idNumber
int idNumber() const
Definition: knewstuff2/core/entry.cpp:251
KNS::Entry::author
Author author() const
Retrieve the author of the object.
Definition: knewstuff2/core/entry.cpp:101
KNS::Feed
KNewStuff feed.
Definition: feed.h:46
KNS::Feed::name
KTranslatable name() const
Retrieve the name of the feed.
Definition: feed.cpp:47
KNS::ItemsModel
Definition: knewstuff2/ui/itemsmodel.h:34
KNS::ItemsModel::entryForIndex
KNS::Entry * entryForIndex(const QModelIndex &index) const
Definition: knewstuff2/ui/itemsmodel.cpp:108
KNS::ItemsModel::kNameRole
@ kNameRole
the name of the entry
Definition: knewstuff2/ui/itemsmodel.h:42
KNS::ItemsModel::addEntry
void addEntry(Entry *entry)
Definition: knewstuff2/ui/itemsmodel.cpp:116
KNS::ItemsViewDelegate
Definition: knewstuff2/ui/itemsviewdelegate.h:40
KNS::KTranslatable::representation
QString representation() const
Returns the string which matches most closely the current language.
Definition: ktranslatable.cpp:64
KNS::Provider
KNewStuff provider container.
Definition: knewstuff2/core/provider.h:52
KNS::Provider::downloadUrlFeed
Feed * downloadUrlFeed(const QString &feedtype) const
Feed to retrieve for the given feed type.
Definition: knewstuff2/core/provider.cpp:50
KNS::Provider::webAccess
KUrl webAccess() const
Retrieves the web frontend URL.
Definition: knewstuff2/core/provider.cpp:104
KNS::Provider::feeds
QStringList feeds() const
Returns a list of all feeds.
Definition: knewstuff2/core/provider.cpp:119
KNS::Provider::name
KTranslatable name() const
Retrieves the common name of the provider.
Definition: knewstuff2/core/provider.cpp:64
KNS::Provider::webService
KUrl webService() const
Retrieves the URL to the DXS Web Service.
Definition: knewstuff2/core/provider.cpp:114
KTitleWidget::MessageType
MessageType
KTitleWidget::ErrorMessage
ErrorMessage
KToolInvocation::invokeMailer
static void invokeMailer(const KUrl &mailtoURL, const QByteArray &startup_id=QByteArray(), bool allowAttachments=false)
KUrl
KUrl::pathOrUrl
QString pathOrUrl() const
KUrl::url
QString url(AdjustPathOption trailing=LeaveTrailingSlash) const
QAction
QList
QSortFilterProxyModel
QWidget
dxs.h
entryhandler.h
kDebug
#define kDebug
kaboutdata.h
kcomponentdata.h
kdebug.h
kdxscomment.h
kdxscomments.h
kdxsrating.h
SmallIcon
QPixmap SmallIcon(const QString &name, int force_size, int state, const QStringList &overlays)
DesktopIcon
QPixmap DesktopIcon(const QString &name, int force_size, int state, const QStringList &overlays)
timeout
int timeout
i18n
QString i18n(const char *text)
i18nc
QString i18nc(const char *ctxt, const char *text)
kmessagebox.h
entry.h
provider.h
ConfigGroup
const char * ConfigGroup
Definition: knewstuff2/ui/downloaddialog.cpp:52
downloaddialog.h
itemsmodel.h
itemsviewdelegate.h
ktoolinvocation.h
KGlobal::config
KSharedConfigPtr config()
KGlobal::activeComponent
KComponentData activeComponent()
link
CopyJob * link(const KUrl &src, const KUrl &destDir, JobFlags flags=DefaultFlags)
group
group
KNS
Definition: knewstuff2/core/author.h:27
name
const char * name(StandardAction id)
providerhandler.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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