I have uploaded a patch file to the review board. However, it is up there as just a file attachement - not a diff file. Why? This happened last time too.
git format-patch -2 HEAD -o ~/development/kdenlive/f ^^^ this gave me 2 patch files. One which did have the new stuff I wrote on top of my other new stuff. And this is the file I have uploaded. If however you try and upload this as a diff file the review board website says "The uploaded diff uses short revisions, but Review Board requires full revisions." but git format-patch -2 HEAD --full-index -o ~/development/kdenlive/ produces a file that the review board web site is unable to parse. But hopefully you can get the attachment and apply it. On Wed, Jan 20, 2016 at 9:28 PM, Jean-Baptiste Mardelle <[email protected]> wrote: > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/126796/ > > Thanks for this patch. Some comments / questions: > Some files are missing a license header > The token is saved in $HOME/config/kde.org/kdenlive.conf is that a standard > location for saving web tokens ? > > > src/utils/freesound.cpp > <https://git.reviewboard.kde.org/r/126796/diff/1/?file=434205#file434205line317> > (Diff > revision 1) > > 310 > > m_previewProcess->start(KdenliveSettings::ffplaypath() + " " + url > + " -nodisp -autoexit"); > > I'd prefer if you keep the previous format, calling start with: > > m_previewProcess->start(app, parameters); > > Seems more secure to me, especially if the url arg is comming from an > unsecure source... I am not sure how Qt handles the situation if the url is > like; > > "http://test.org;rm -Rf *" > > > - Jean-Baptiste Mardelle > > On janvier 18th, 2016, 1:54 après-midi UTC, Roger Morton wrote: > Review request for Kdenlive and Vincent Pinon. > By Roger Morton. > > *Updated jan. 18, 2016, 1:54 après-midi* > *Repository: * kdenlive > Description > > online resource -logs into users freesound accounts to get permission for HQ > audio. Fixes archive.org video search new dependancy KF5WebKit. > (libkf5webkit5-dev) > > Testing > > Built. Tested file downloads from freesound. Auhenticates to freesound. keeps > authenticated until you delete $HOME/.config/kde.org/kdenlive.conf > Archive.org video search is now working. Display animiated .gif as the > preview file from Archive.org videos. > No longer have to click search button twice to get it to do the search the > first time it runs > Option to not use personal freesound account and just use HQ preview file > instead. > Downloads low quality preview file in background and does not notify you of > it finishing. > > Diffs > > - src/CMakeLists.txt (87d29d2) > - src/qt-oauth-lib/logindialog.h (PRE-CREATION) > - src/qt-oauth-lib/logindialog.cpp (PRE-CREATION) > - src/qt-oauth-lib/oauth2.h (PRE-CREATION) > - src/qt-oauth-lib/oauth2.cpp (PRE-CREATION) > - src/ui/freesound_ui.ui (55a453d) > - src/utils/abstractservice.h (0a6a4a7) > - src/utils/archiveorg.h (5cdc84f) > - src/utils/archiveorg.cpp (1be4d6f) > - src/utils/freesound.h (f72d145) > - src/utils/freesound.cpp (932c47f) > - src/utils/openclipart.h (7a4df1e) > - src/utils/openclipart.cpp (adbba68) > - src/utils/resourcewidget.h (c171e3c) > - src/utils/resourcewidget.cpp (6453f7f) > > View Diff <https://git.reviewboard.kde.org/r/126796/diff/> >
From 864e02c6d4ad6b51e4176a945f32d8faff2594a6 Mon Sep 17 00:00:00 2001 From: Roger Morton <[email protected]> Date: Wed, 3 Feb 2016 23:41:00 +1100 Subject: [PATCH 2/2] move token storage in freesound to settings file --- src/qt-oauth-lib/logindialog.cpp | 36 ++++++++++++++ src/qt-oauth-lib/logindialog.h | 36 ++++++++++++++ src/qt-oauth-lib/oauth2.cpp | 102 ++++++++++++++++++++++----------------- src/qt-oauth-lib/oauth2.h | 36 ++++++++++++++ src/utils/freesound.cpp | 7 +-- src/utils/resourcewidget.cpp | 36 ++++++++------ src/utils/resourcewidget.h | 4 +- 7 files changed, 190 insertions(+), 67 deletions(-) diff --git a/src/qt-oauth-lib/logindialog.cpp b/src/qt-oauth-lib/logindialog.cpp index dd5a3cd..78b15f3 100644 --- a/src/qt-oauth-lib/logindialog.cpp +++ b/src/qt-oauth-lib/logindialog.cpp @@ -1,3 +1,39 @@ +/******************************************************************************************************** + * Copyright (C) 2015 Roger Morton ([email protected]) + * + * Purpose: implements client access to freesound.org using ver2 of the freesound API. + * + * Based on code at https://code.google.com/p/qt-oauth-lib/ + * Which is Qt Library created by Integrated Computer Solutions, Inc. (ICS) + * to provide OAuth2.0 for the Google API. + * + * Licence: GNU Lesser General Public License + * http://www.gnu.org/licenses/lgpl.html + * This version of the GNU Lesser General Public License incorporates the terms + * and conditions of version 3 of the GNU General Public License http://www.gnu.org/licenses/gpl-3.0-standalone.html + * supplemented by the additional permissions listed at http://www.gnu.org/licenses/lgpl.html + * + * Disclaimer of Warranty. + * THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + * EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE + * THE PROGRAM âAS ISâ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + * SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + * OR CORRECTION. + * + * Limitation of Liability. + * IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, + * OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO + * YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + * OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR + * DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF + * THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *********************************************************************************************************/ #include "logindialog.h" #include "ui_logindialog.h" diff --git a/src/qt-oauth-lib/logindialog.h b/src/qt-oauth-lib/logindialog.h index 08be49d..1cf2448 100644 --- a/src/qt-oauth-lib/logindialog.h +++ b/src/qt-oauth-lib/logindialog.h @@ -1,3 +1,39 @@ +/******************************************************************************************************** + * Copyright (C) 2015 Roger Morton ([email protected]) + * + * Purpose: implements client access to freesound.org using ver2 of the freesound API. + * + * Based on code at https://code.google.com/p/qt-oauth-lib/ + * Which is Qt Library created by Integrated Computer Solutions, Inc. (ICS) + * to provide OAuth2.0 for the Google API. + * + * Licence: GNU Lesser General Public License + * http://www.gnu.org/licenses/lgpl.html + * This version of the GNU Lesser General Public License incorporates the terms + * and conditions of version 3 of the GNU General Public License http://www.gnu.org/licenses/gpl-3.0-standalone.html + * supplemented by the additional permissions listed at http://www.gnu.org/licenses/lgpl.html + * + * Disclaimer of Warranty. + * THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + * EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE + * THE PROGRAM âAS ISâ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + * SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + * OR CORRECTION. + * + * Limitation of Liability. + * IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, + * OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO + * YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + * OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR + * DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF + * THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *********************************************************************************************************/ #ifndef LOGINDIALOG_H #define LOGINDIALOG_H diff --git a/src/qt-oauth-lib/oauth2.cpp b/src/qt-oauth-lib/oauth2.cpp index 249d840..03b9f6f 100644 --- a/src/qt-oauth-lib/oauth2.cpp +++ b/src/qt-oauth-lib/oauth2.cpp @@ -1,49 +1,52 @@ -/* - * Author: Roger Morton ([email protected] - * Date: 13 Dec 2015 - * Purpose: Demo of how use the freesound.org ver2 API. - * This program authenticates at freesound, obtains an authorisation - * code from freesound - if the user has authorised the app to use freesound. - * It then obtains an access_token. Once the access token is obtained it emits accessTokenReceived signal - * If the class already has an access_token it does not log on to free sound - it just emits accessTokenReceived signal +/******************************************************************************************************** + * Copyright (C) 2015 Roger Morton ([email protected]) + * + * Purpose: implements client access to freesound.org using ver2 of the freesound API. * * Based on code at https://code.google.com/p/qt-oauth-lib/ * Which is Qt Library created by Integrated Computer Solutions, Inc. (ICS) * to provide OAuth2.0 for the Google API. * - * Licence: GNU Lesser General Public License + * Licence: GNU Lesser General Public License * http://www.gnu.org/licenses/lgpl.html + * This version of the GNU Lesser General Public License incorporates the terms + * and conditions of version 3 of the GNU General Public License http://www.gnu.org/licenses/gpl-3.0-standalone.html + * supplemented by the additional permissions listed at http://www.gnu.org/licenses/lgpl.html + * + * Disclaimer of Warranty. + * THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + * EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE + * THE PROGRAM âAS ISâ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + * SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + * OR CORRECTION. * - * Disclaimer of Warranty. -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. - EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE -THE PROGRAM âAS ISâ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. -SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR -OR CORRECTION. - - Limitation of Liability. -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, - OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO - YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR - DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF -THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - -*/ + * Limitation of Liability. + * IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, + * OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO + * YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + * OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR + * DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF + * THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *********************************************************************************************************/ #include "oauth2.h" #include <QDebug> #include <QApplication> #include "logindialog.h" -#include <QSettings> + #include <QMessageBox> #include <QUrl> #include <QUrlQuery> #include <QJsonParseError> +#include <KSharedConfig> +#include <KConfigGroup> + #ifndef DOXYGEN_SHOULD_SKIP_THIS QString OAuth2::m_strClientSecret ="441d88374716e7a3503997151e4780566f007313"; //obtained when ttguy registered the kdenlive application with freesound @@ -66,10 +69,15 @@ OAuth2::OAuth2(QWidget* parent) // if there is no access token in the settings it will be blank and OAuth2::obtainAccessToken() // will logon to freesound // If it is older than 24hrs OAuth2::obtainAccessToken() will fail but then the class will - // request a new access token via a saved refresh_token - // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - QSettings settings("kde.org", "kdenlive");//read from $HOME/.config/kde.org/kdenlive.conf - QString strAccessTokenFromSettings = settings.value("freesound_access_token", "").toString(); + // request a new access token via a saved refresh_token - that is saved in the kdenlive settings file + // $HOME/.config/kdenlive.rc + // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvn + + KSharedConfigPtr config = KSharedConfig::openConfig(); + KConfigGroup authGroup(config, "FreeSoundAuthentication"); + + QString strAccessTokenFromSettings =authGroup.readEntry(QStringLiteral("freesound_access_token")); + if (strAccessTokenFromSettings!="") { m_bAccessTokenRec=true; @@ -109,8 +117,12 @@ OAuth2::OAuth2(QWidget* parent) */ void OAuth2::ForgetAccessToken() { - QSettings settings("kde.org", "kdenlive");//read from $HOME/.config/kde.org/kdenlive.conf - settings.remove("freesound_access_token"); + + KSharedConfigPtr config = KSharedConfig::openConfig(); + KConfigGroup authGroup(config, "FreeSoundAuthentication"); + + authGroup.deleteEntry(QStringLiteral("freesound_access_token")); + m_bAccessTokenRec=false; m_strAccessToken=""; } @@ -304,12 +316,12 @@ void OAuth2::serviceRequestFinished(QNetworkReply* reply) if (m_bAccessTokenRec) { - QSettings settings("kde.org", "kdenlive"); // create a new settings object - settings.setValue("freesound_access_token", m_strAccessToken); // save the access token in our settings object - settings.setValue("access_token_expires_in", iExpiresIn); - settings.setValue("freesound_refresh_token", mstr_RefreshToken); - //saves to $HOME/.config/kde.org/kdenlive.conf + + KSharedConfigPtr config = KSharedConfig::openConfig(); + KConfigGroup authGroup(config, "FreeSoundAuthentication"); + authGroup.writeEntry(QStringLiteral("freesound_access_token"), m_strAccessToken); + authGroup.writeEntry(QStringLiteral("freesound_refresh_token"), mstr_RefreshToken); // access tokens have a limited lifetime of 24 hours. emit accessTokenReceived(m_strAccessToken);//notifies ResourceWidget::slotAccessTokenReceived @@ -356,7 +368,11 @@ void OAuth2::SlotDownloadHQPreview() void OAuth2::obtainNewAccessToken(){ - QSettings settings("kde.org", "kdenlive");//read from $HOME/.config/kde.org/kdenlive.conf - QString mstr_RefreshToken = settings.value("freesound_refresh_token", "").toString(); + + + KSharedConfigPtr config = KSharedConfig::openConfig(); + KConfigGroup authGroup(config, "FreeSoundAuthentication"); + + QString mstr_RefreshToken =authGroup.readEntry(QStringLiteral("freesound_refresh_token")); OAuth2::RequestAccessCode(true,mstr_RefreshToken);// request new access code via the refresh token method } diff --git a/src/qt-oauth-lib/oauth2.h b/src/qt-oauth-lib/oauth2.h index a3fa764..eb495c9 100644 --- a/src/qt-oauth-lib/oauth2.h +++ b/src/qt-oauth-lib/oauth2.h @@ -1,3 +1,39 @@ +/******************************************************************************************************** + * Copyright (C) 2015 Roger Morton ([email protected]) + * + * Purpose: implements client access to freesound.org using ver2 of the freesound API. + * + * Based on code at https://code.google.com/p/qt-oauth-lib/ + * Which is Qt Library created by Integrated Computer Solutions, Inc. (ICS) + * to provide OAuth2.0 for the Google API. + * + * Licence: GNU Lesser General Public License + * http://www.gnu.org/licenses/lgpl.html + * This version of the GNU Lesser General Public License incorporates the terms + * and conditions of version 3 of the GNU General Public License http://www.gnu.org/licenses/gpl-3.0-standalone.html + * supplemented by the additional permissions listed at http://www.gnu.org/licenses/lgpl.html + * + * Disclaimer of Warranty. + * THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. + * EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE + * THE PROGRAM âAS ISâ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + * SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + * OR CORRECTION. + * + * Limitation of Liability. + * IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, + * OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO + * YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + * OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR + * DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF + * THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *********************************************************************************************************/ #ifndef OAUTH2_H #define OAUTH2_H diff --git a/src/utils/freesound.cpp b/src/utils/freesound.cpp index 4290fd4..19433a3 100644 --- a/src/utils/freesound.cpp +++ b/src/utils/freesound.cpp @@ -306,12 +306,7 @@ bool FreeSound::startItemPreview(QListWidgetItem *item) if (m_previewProcess->state() != QProcess::NotRunning) { m_previewProcess->close(); } - - -// HEAD m_previewProcess->start(KdenliveSettings::ffplaypath() + " " + url + " -nodisp -autoexit"); - - - m_previewProcess->start(KdenliveSettings::ffplaypath(), QStringList() <<url<<"-nodisp"<<"-autoexit"); + m_previewProcess->start(KdenliveSettings::ffplaypath(), QStringList() <<url<<QStringLiteral("-nodisp")<<QStringLiteral("-autoexit")); } return true; diff --git a/src/utils/resourcewidget.cpp b/src/utils/resourcewidget.cpp index 80cd96d..b6bf8e4 100644 --- a/src/utils/resourcewidget.cpp +++ b/src/utils/resourcewidget.cpp @@ -420,6 +420,7 @@ void ResourceWidget::slotSaveItem(const QString &originalUrl) } + slotSetDescription(""); button_import->setEnabled(false); // disable buttons while download runs. enabled in slotGotFile if(m_currentService->serviceType==FREESOUND)// open a dialog to authenticate with free sound and download the file { @@ -657,9 +658,11 @@ void ResourceWidget::slotOpenLink(const QUrl &url) } } /** - * @brief ResourceWidget::slotSetDescription - * @param desc - */ + * @brief ResourceWidget::slotSetDescription Updates the display with the description text + * @param desc /n + * The description is either the detailed description of the file or is progress messages on the download process + * +*/ void ResourceWidget::slotSetDescription(const QString &desc) { if(m_desc != desc) { @@ -668,23 +671,24 @@ void ResourceWidget::slotSetDescription(const QString &desc) } } /** - * @brief ResourceWidget::slotSetMetadata - * @param desc - * This is called when gotMetaInfo(Qstring) signal fires. That signal is passing html in the parameter + * @brief ResourceWidget::slotSetMetadata updates the display with the metadata. + * @param desc /n + * The meta data is info on the sounds length, samplerate, filesize and number of channels. This is called when gotMetaInfo(Qstring) signal fires. That signal is passing html in the parameter * This function is updating the html (m_meta) in the ResourceWidget and then calls updateLayout() * which updates actual widget */ -void ResourceWidget::slotSetMetadata(const QString &desc) +void ResourceWidget::slotSetMetadata(const QString &metadata) { - if (m_meta != desc) { - m_meta = desc; + if (m_meta != metadata) { + m_meta = metadata; updateLayout(); } } /** - * @brief ResourceWidget::slotSetImage + * @brief ResourceWidget::slotSetImage Sets a thumbnail on the widget * @param desc - * called by ResourceWidget::slotLoadThumb + * called by ResourceWidget::slotLoadThumb \n + * This sets a thumb nail image onto a label on the resource widget. If it is a animated .gif it will play */ void ResourceWidget::slotSetImage(const QString &desc) { @@ -695,20 +699,20 @@ void ResourceWidget::slotSetImage(const QString &desc) GifLabel->setPixmap(*pic);// pass a pointer as a parameter. Display the pic in our lable } -/** @brief updates the display with infomation on the seleted item +/** @brief updates the display with infomation on the seleted item. The title consists of the sounds file name and the author * * Called by ResourceWidget::slotUpdateCurrentSound() */ -void ResourceWidget::slotSetTitle(const QString &desc) +void ResourceWidget::slotSetTitle(const QString &title) { - if (m_title != desc) { - m_title = desc; + if (m_title != title) { + m_title = title; updateLayout(); } } /** * @brief ResourceWidget::updateLayout - * This concats the html in m_title, m_image,m_desc and m_meta and sets the resulting + * This concats the html in m_title, m_desc and m_meta and sets the resulting * html markup into the content of the ResourceWidget \n * Called by slotSetTitle() , slotSetMetadata() ,slotSetDescription() */ diff --git a/src/utils/resourcewidget.h b/src/utils/resourcewidget.h index 31d32f8..7b80ff6 100644 --- a/src/utils/resourcewidget.h +++ b/src/utils/resourcewidget.h @@ -78,10 +78,10 @@ private slots: void slotLoadThumb(const QString& url); /** @brief A file download is finished */ void slotGotFile(KJob *job); - void slotSetMetadata(const QString &desc); + void slotSetMetadata(const QString &metadata); void slotSetDescription(const QString &desc); void slotSetImage(const QString &desc); - void slotSetTitle(const QString &desc); + void slotSetTitle(const QString &title); void slotSetMaximum(int max); void slotPreviewFinished(); void slotFreesoundAccessDenied(); -- 2.1.4
_______________________________________________ kdenlive mailing list [email protected] https://mail.kde.org/mailman/listinfo/kdenlive
