X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Futils%2Fresourcewidget.cpp;h=c0ea22991ff08b6f83d50137d02b6944aa166bc8;hb=e8cb078eb6a33d286c9fe2aff730980f7a2eff32;hp=80fbc18ebef50334bae34a15b0eb5690c381cc3d;hpb=6c588712c2e110e5fefa37ca57952af304937cba;p=kdenlive diff --git a/src/utils/resourcewidget.cpp b/src/utils/resourcewidget.cpp index 80fbc18e..c0ea2299 100644 --- a/src/utils/resourcewidget.cpp +++ b/src/utils/resourcewidget.cpp @@ -40,8 +40,10 @@ #include #include #include +#if KDE_IS_VERSION(4,4,0) #include #include +#endif #include #ifdef USE_NEPOMUK @@ -93,9 +95,11 @@ ResourceWidget::ResourceWidget(const QString & folder, QWidget * parent) : config_button->setMenu(resourceMenu); config_button->setIcon(KIcon("configure")); +#if KDE_IS_VERSION(4,4,0) m_busyWidget = new KPixmapSequenceOverlayPainter(this); m_busyWidget->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); m_busyWidget->setWidget(search_results->viewport()); +#endif sound_box->setEnabled(false); search_text->setFocus(); @@ -118,7 +122,9 @@ void ResourceWidget::slotStartSearch(int page) page_number->blockSignals(true); page_number->setValue(page); page_number->blockSignals(false); +#if KDE_IS_VERSION(4,4,0) m_busyWidget->start(); +#endif m_currentService->slotStartSearch(search_text->text(), page); } @@ -215,7 +221,7 @@ void ResourceWidget::slotSaveItem(const QString originalUrl) if (!path.endsWith('/')) path.append('/'); if (!originalUrl.isEmpty()) { path.append(KUrl(originalUrl).fileName()); - ext = "*." + KUrl(originalUrl).fileName().section(".", -1); + ext = "*." + KUrl(originalUrl).fileName().section('.', -1); m_currentInfo.itemDownload = originalUrl; } else { @@ -250,13 +256,12 @@ void ResourceWidget::slotGotFile(KJob *job) res.setProperty( Nepomuk::Vocabulary::NIE::license(), (Nepomuk::Variant) job->property("license") ); res.setProperty( Nepomuk::Vocabulary::NIE::licenseType(), (Nepomuk::Variant) job->property("licenseurl") ); res.setProperty( Nepomuk::Vocabulary::NDO::copiedFrom(), (Nepomuk::Variant) job->property("originurl") ); - res.setProperty( Nepomuk::Vocabulary::NDO::copiedFrom(), (Nepomuk::Variant) job->property("originurl") ); res.setProperty( Nepomuk::Vocabulary::NCO::creator(), (Nepomuk::Variant) job->property("author") ); //res.setDescription(item_description->toPlainText()); //res.setProperty( Soprano::Vocabulary::NAO::description(), #endif #endif - emit addClip(filePath, QString()); + emit addClip(filePath, stringMap()); } void ResourceWidget::slotOpenUrl(const QString &url) @@ -283,10 +288,12 @@ void ResourceWidget::slotChangeService() connect(m_currentService, SIGNAL(gotMetaInfo(const QString)), this, SLOT(slotSetMetadata(const QString))); connect(m_currentService, SIGNAL(gotMetaInfo(QMap )), this, SLOT(slotDisplayMetaInfo(QMap ))); - connect(m_currentService, SIGNAL(maxPages(int)), page_number, SLOT(setMaximum(int))); + connect(m_currentService, SIGNAL(maxPages(int)), this, SLOT(slotSetMaximum(int))); connect(m_currentService, SIGNAL(searchInfo(QString)), search_info, SLOT(setText(QString))); connect(m_currentService, SIGNAL(gotThumb(const QString)), this, SLOT(slotLoadThumb(const QString))); +#if KDE_IS_VERSION(4,4,0) connect(m_currentService, SIGNAL(searchDone()), m_busyWidget, SLOT(stop())); +#endif button_preview->setVisible(m_currentService->hasPreview); button_import->setVisible(!m_currentService->inlineDownload); @@ -294,6 +301,11 @@ void ResourceWidget::slotChangeService() if (!search_text->text().isEmpty()) slotStartSearch(); } +void ResourceWidget::slotSetMaximum(int max) +{ + page_number->setMaximum(max); +} + void ResourceWidget::slotOnline() { button_search->setEnabled(true); @@ -389,4 +401,5 @@ void ResourceWidget::updateLayout() if (!m_desc.isEmpty()) content.append(m_desc); if (!m_meta.isEmpty()) content.append(m_meta); info_browser->setHtml(content); -} \ No newline at end of file +} +